/* ==========================================================================
   Sales Management System - Dashboard & Analytics Stylesheet
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.primary::after { background-color: var(--primary-600); }
.stat-card.success::after { background-color: var(--success-500); }
.stat-card.warning::after { background-color: var(--warning-500); }
.stat-card.purple::after { background-color: var(--purple-600); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card.primary .stat-icon { background-color: var(--primary-50); color: var(--primary-600); }
.stat-card.success .stat-icon { background-color: var(--success-50); color: var(--success-600); }
.stat-card.warning .stat-icon { background-color: var(--warning-50); color: var(--warning-600); }
.stat-card.purple .stat-icon { background-color: var(--purple-50); color: var(--purple-600); }

.stat-info {
  flex: 1;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 2px;
  color: var(--text-main);
}

.stat-subtext {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  min-height: 340px;
  display: flex;
  flex-direction: column;
}

.chart-wrapper {
  flex: 1;
  position: relative;
  width: 100%;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Custom SVG Canvas fallback chart rendering styles */
.bar-chart-container {
  width: 100%;
  height: 240px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.bar-fill {
  width: 70%;
  max-width: 44px;
  background: linear-gradient(180deg, var(--primary-500), var(--primary-700));
  border-radius: 4px 4px 0 0;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.bar-fill.success {
  background: linear-gradient(180deg, var(--success-500), var(--success-700));
}

.bar-fill:hover {
  filter: brightness(1.15);
}

.bar-tooltip {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--secondary-900);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.bar-col:hover .bar-tooltip {
  opacity: 1;
}

.bar-label {
  position: absolute;
  bottom: -24px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Tab Headers */
.tab-headers {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-muted);
  cursor: pointer;
}

.tab-btn.active {
  color: var(--primary-600);
  border-bottom-color: var(--primary-600);
}
