/* ============================================
   Tekglen Admin Dashboard - Modern SaaS Design
   ============================================ */

:root {
  /* Primary palette */
  --primary: #0f766e;
  --primary-light: #14b8a6;
  --primary-dark: #115e59;
  --primary-bg: #f0fdfa;

  /* Semantic colors */
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;

  /* Neutral palette */
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Layout */
  --app-bar-height: 64px;
  --drawer-width: 480px;
  --content-max-width: 1400px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   Dashboard App Layout
   ============================================ */

.dashboard-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   Top App Bar
   ============================================ */

.app-bar {
  height: var(--app-bar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}

.app-bar-left {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.app-bar-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--primary);
  transition: background 0.15s, color 0.15s;
}

.app-bar-nav-link:hover {
  background: var(--primary);
  color: #fff;
}

.app-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.control-group label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.control-select {
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.control-select:hover {
  border-color: var(--primary);
}

.control-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.btn-export {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn-export:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.btn-export:active {
  transform: scale(0.98);
}

.last-updated {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 6px 12px;
  background: var(--bg);
  border-radius: var(--border-radius-sm);
}

.update-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.update-time {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ============================================
   Page Header
   ============================================ */

.page-header {
  padding: 24px 24px 0;
  max-width: var(--content-max-width);
  margin: 0 auto;
  width: 100%;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

/* ============================================
   Main Content
   ============================================ */

.dashboard-content {
  flex: 1;
  padding: 24px;
  max-width: var(--content-max-width);
  margin: 0 auto;
  width: 100%;
}

/* ============================================
   Hero KPI Cards
   ============================================ */

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.4s ease-out backwards;
}

.hero-kpis .kpi-card:nth-child(1) { animation-delay: 0.05s; }
.hero-kpis .kpi-card:nth-child(2) { animation-delay: 0.1s; }
.hero-kpis .kpi-card:nth-child(3) { animation-delay: 0.15s; }
.hero-kpis .kpi-card:nth-child(4) { animation-delay: 0.2s; }

.kpi-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, transparent 0%, var(--primary-light) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.2s;
}

.kpi-card:hover::after {
  opacity: 1;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.kpi-card:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.kpi-card.kpi-highlight {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--primary-bg) 100%);
  border-color: var(--primary-light);
}

.kpi-card.kpi-highlight::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

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

.kpi-icon-savings {
  background: var(--success-light);
  color: var(--success);
}

.kpi-icon-deflection {
  background: var(--info-light);
  color: var(--info);
}

.kpi-icon-users {
  background: #ede9fe;
  color: #7c3aed;
}

.kpi-icon-accuracy {
  background: var(--warning-light);
  color: var(--warning);
}

.kpi-content {
  flex: 1;
  min-width: 0;
}

.kpi-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.kpi-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.kpi-caption {
  font-size: 12px;
  color: var(--text-muted);
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  position: absolute;
  top: 16px;
  right: 16px;
}

.kpi-trend-up {
  background: var(--success-light);
  color: var(--success);
}

.kpi-trend-down {
  background: var(--danger-light);
  color: var(--danger);
}

.kpi-trend-neutral {
  background: var(--bg);
  color: var(--text-muted);
}

/* ============================================
   Tab Bar
   ============================================ */

.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  width: fit-content;
}

.tab-btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.tab-btn.active {
  color: white;
  background: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================
   Charts Grid
   ============================================ */

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

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  transition: box-shadow 0.15s, border-color 0.15s;
  animation: fadeInUp 0.4s ease-out backwards;
}

.chart-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border);
}

.chart-card-wide {
  grid-column: span 2;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.chart-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chart-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.chart-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.chart-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.chart-action-btn:hover {
  background: var(--primary);
  color: white;
}

.chart-body {
  height: 200px;
  position: relative;
}

.chart-body-donut {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   Metrics Cards Row
   ============================================ */

.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.metrics-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
}

.metrics-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.metrics-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metrics-icon-engagement {
  background: #fce7f3;
  color: #db2777;
}

.metrics-icon-efficiency {
  background: var(--warning-light);
  color: var(--warning);
}

.metrics-icon-adoption {
  background: var(--info-light);
  color: var(--info);
}

.metrics-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.metrics-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.metric-item:hover {
  background: var(--bg-hover);
}

.metric-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.metric-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.metric-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
}

.metric-trend-up {
  color: var(--success);
}

.metric-trend-down {
  color: var(--danger);
}

/* ============================================
   Insights Section
   ============================================ */

.insights-section {
  margin-top: 8px;
}

.section-header {
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.insight-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, background 0.2s;
  animation: fadeInUp 0.4s ease-out backwards;
}

.insight-tile:nth-child(1) { animation-delay: 0.05s; }
.insight-tile:nth-child(2) { animation-delay: 0.1s; }
.insight-tile:nth-child(3) { animation-delay: 0.15s; }
.insight-tile:nth-child(4) { animation-delay: 0.2s; }
.insight-tile:nth-child(5) { animation-delay: 0.25s; }
.insight-tile:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.insight-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--primary-bg) 100%);
}

/* Accent left borders by analytics type */
.insight-tile[data-insight="policy_clarity"],
.insight-tile[data-insight="benefits_clarity"] {
  border-left-color: #f59e0b;
}

.insight-tile[data-insight="manager_risk"],
.insight-tile[data-insight="pto_pressure"] {
  border-left-color: #7c3aed;
}

.insight-tile[data-insight="automation_opportunity"] {
  border-left-color: #10b981;
}

.insight-tile[data-insight="benefits_value_gap"] {
  border-left-color: #3b82f6;
}

/* Hover gradient per type */
.insight-tile[data-insight="policy_clarity"]:hover,
.insight-tile[data-insight="benefits_clarity"]:hover {
  background: linear-gradient(135deg, var(--bg-card) 0%, #fffbeb 100%);
}

.insight-tile[data-insight="manager_risk"]:hover,
.insight-tile[data-insight="pto_pressure"]:hover {
  background: linear-gradient(135deg, var(--bg-card) 0%, #f5f3ff 100%);
}

.insight-tile[data-insight="automation_opportunity"]:hover {
  background: linear-gradient(135deg, var(--bg-card) 0%, #ecfdf5 100%);
}

.insight-tile[data-insight="benefits_value_gap"]:hover {
  background: linear-gradient(135deg, var(--bg-card) 0%, #eff6ff 100%);
}

.insight-tile:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.insight-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.insight-icon-policy {
  background: var(--info-light);
  color: var(--info);
}

.insight-icon-manager {
  background: var(--warning-light);
  color: var(--warning);
}

.insight-icon-automation {
  background: var(--success-light);
  color: var(--success);
}

.insight-icon-benefits {
  background: #fce7f3;
  color: #db2777;
}

.insight-icon-pto {
  background: #ede9fe;
  color: #7c3aed;
}

.insight-icon-value {
  background: var(--primary-bg);
  color: var(--primary);
}

.insight-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.insight-metric {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
}

.insight-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.insight-unit {
  font-size: 14px;
  color: var(--text-muted);
}

.insight-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.insight-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.5s ease-out;
}

.insight-bar-warning {
  background: var(--warning);
}

.insight-bar-success {
  background: var(--success);
}

.insight-bar-danger {
  background: var(--danger);
}

.insight-caption {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.insight-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.insight-badge-diagnostic {
  background: #fef3c7;
  color: #92400e;
}

.insight-badge-predictive {
  background: #ede9fe;
  color: #5b21b6;
}

.insight-badge-prescriptive {
  background: #d1fae5;
  color: #065f46;
}

.insight-badge-descriptive {
  background: #dbeafe;
  color: #1e40af;
}

.insight-severity {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 8px;
}

.insight-severity-low {
  color: var(--success);
}

.insight-severity-moderate {
  color: var(--warning);
}

.insight-severity-high {
  color: var(--danger);
}

.insight-action {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
}

/* Drawer analytics section styling */
.analytics-layer {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid;
}

.analytics-layer-descriptive {
  background: #eff6ff;
  border-left-color: #3b82f6;
}

.analytics-layer-diagnostic {
  background: #fffbeb;
  border-left-color: #f59e0b;
}

.analytics-layer-predictive {
  background: #f5f3ff;
  border-left-color: #7c3aed;
}

.analytics-layer-prescriptive {
  background: #ecfdf5;
  border-left-color: #10b981;
}

.analytics-layer h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.analytics-layer-descriptive h4 { color: #1e40af; }
.analytics-layer-diagnostic h4 { color: #92400e; }
.analytics-layer-predictive h4 { color: #5b21b6; }
.analytics-layer-prescriptive h4 { color: #065f46; }

.analytics-layer p, .analytics-layer li {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.analytics-layer ul {
  margin: 6px 0 0 0;
  padding-left: 18px;
}

.analytics-layer li {
  margin-bottom: 4px;
}

.severity-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  margin-top: 8px;
}

.severity-low { background: #d1fae5; color: #065f46; }
.severity-moderate { background: #fef3c7; color: #92400e; }
.severity-high { background: #fee2e2; color: #991b1b; }

/* ============================================
   Side Drawer
   ============================================ */

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--drawer-width);
  max-width: 100%;
  height: 100vh;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.drawer-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--border-radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.drawer-close:hover {
  background: var(--bg);
  color: var(--text);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Drawer Content Styles */
.drawer-section {
  margin-bottom: 24px;
}

.drawer-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-section-title svg {
  color: var(--primary);
}

.drawer-summary {
  padding: 16px;
  background: var(--bg);
  border-radius: var(--border-radius);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.drawer-chart {
  height: 200px;
  margin-bottom: 20px;
}

.drawer-recommendations {
  padding: 16px;
  background: var(--primary-bg);
  border-radius: var(--border-radius);
  border-left: 3px solid var(--primary);
}

.drawer-recommendations h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.drawer-recommendations ul {
  margin: 0;
  padding-left: 18px;
}

.drawer-recommendations li {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.5;
}

.drawer-recommendations li:last-child {
  margin-bottom: 0;
}

.drawer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.drawer-table th,
.drawer-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.drawer-table th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
  background: var(--bg);
}

.drawer-table td {
  color: var(--text);
}

.drawer-table tr:hover td {
  background: var(--bg);
}

/* Loading State */
.drawer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Loading Skeletons
   ============================================ */

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--border-radius-sm);
}

.skeleton-kpi-value {
  height: 32px;
  width: 80px;
  margin-bottom: 4px;
}

.skeleton-kpi-caption {
  height: 14px;
  width: 120px;
}

.skeleton-chart {
  height: 180px;
  width: 100%;
  border-radius: var(--border-radius);
}

.skeleton-metric {
  height: 42px;
  width: 100%;
  margin-bottom: 8px;
}

.skeleton-insight-value {
  height: 36px;
  width: 60px;
}

.skeleton-insight-bar {
  height: 6px;
  width: 100%;
}

/* ============================================
   Empty States
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================
   Mobile Hamburger Menu
   ============================================ */

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.mobile-menu-btn:active {
  transform: scale(0.95);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1200px) {
  .hero-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chart-card-wide {
    grid-column: span 2;
  }
}

@media (max-width: 992px) {
  .metrics-row {
    grid-template-columns: 1fr;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-card-wide {
    grid-column: span 1;
  }

  .drawer {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .app-bar-right {
    display: none;
  }

  .app-bar-right.mobile-open {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .app-bar {
    padding: 0 16px;
    height: auto;
    min-height: var(--app-bar-height);
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .hero-kpis {
    grid-template-columns: 1fr;
  }

  .tab-bar {
    width: 100%;
  }

  .tab-btn {
    flex: 1;
    text-align: center;
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    padding: 16px 16px 0;
  }

  .page-title {
    font-size: 24px;
  }

  .dashboard-content {
    padding: 16px;
  }

  .kpi-card {
    padding: 16px;
  }

  .kpi-value {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .control-group {
    flex: 1;
    min-width: 0;
  }

  .control-select {
    width: 100%;
  }

  .last-updated {
    display: none;
  }
}
