.analytics-header {
  height: 70px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.analytics-header .header-logo {
  cursor: pointer; display: flex; align-items: center; gap: 12px;
}
.analytics-header .header-logo svg { width: 32px; height: 32px; fill: var(--teal-500); }
.analytics-header h1 { font-size: 1.5rem; font-weight: 700; }
.header-badge {
  font-size: 0.75rem; font-weight: 600;
  padding: 2px 8px; border-radius: 4px; text-transform: uppercase;
}
.analytics-badge {
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: #a78bfa;
}
.header-right { display: flex; align-items: center; gap: 16px; }

/* Period Tabs */
.period-tabs {
  display: flex;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 4px;
  gap: 2px;
}
.period-tab {
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 7px;
  color: var(--slate-300);
  background: transparent;
  border: none;
  transition: all 0.2s ease;
}
.period-tab:hover { color: #fff; background: rgba(255,255,255,0.05); }
.period-tab.active {
  background: linear-gradient(135deg, var(--teal-600), var(--teal-500));
  color: #fff;
  box-shadow: 0 2px 8px rgba(20,184,166,0.25);
}

/* Container */
.analytics-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
  display: flex; flex-direction: column; gap: 28px;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.kpi-card {
  text-align: center;
  padding: 24px 20px;
}
.kpi-icon { margin-bottom: 10px; }
.kpi-val {
  font-family: var(--font-heading);
  font-size: 2.5rem; font-weight: 800;
  color: #ffffff; line-height: 1;
  margin-bottom: 6px;
}
.kpi-label {
  font-size: 0.82rem; color: var(--slate-300);
  font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.chart-card { padding: 24px; }
.chart-wide { grid-column: 1 / -1; }
.chart-header { margin-bottom: 16px; }
.chart-header h3 { font-size: 1.05rem; margin-bottom: 4px; }
.chart-subtitle { font-size: 0.8rem; color: var(--slate-300); }
.chart-wrapper { position: relative; height: 240px; }
.chart-doughnut-wrapper { height: 200px; }

/* Outcomes Legend */
.outcomes-legend {
  display: flex; justify-content: center;
  gap: 20px; margin-top: 12px;
}
.legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--slate-300);
}
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

/* Loading state */
.chart-loading {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--slate-700);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-wide { grid-column: 1; }
  .analytics-container { padding: 16px; }
  .period-tabs { display: none; }
}
