/* ═══════════════════════════════════════════════════════════════════════
   StratPulse AI — GTM Command Center | Executive Dashboard Styles
   Spotify-adjacent dark theme: #121212 / #1A1A1A / #282828 / #1DB954
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────────────── */
:root {
  --bg-base:         #0a0a0a;
  --bg-surface:      #141414;
  --bg-elevated:     #1a1a1a;
  --bg-hover:        #242424;
  --bg-card:         #181818;

  --accent:          #1DB954;
  --accent-dim:      #14803b;
  --accent-glow:     rgba(29, 185, 84, 0.15);
  --accent-glow-sm:  rgba(29, 185, 84, 0.08);

  --text-primary:    #FFFFFF;
  --text-secondary:  #B3B3B3;
  --text-muted:      #6A6A6A;
  --text-accent:     #1DB954;

  --border:          rgba(255, 255, 255, 0.07);
  --border-accent:   rgba(29, 185, 84, 0.25);

  --blue:            #4A9EFF;
  --purple:          #A855F7;
  --orange:          #F97316;
  --teal:            #2DD4BF;
  --red:             #EF4444;
  --yellow:          #FBBF24;

  --radius-sm:       6px;
  --radius-md:       10px;
  --radius-lg:       14px;
  --radius-xl:       18px;

  --shadow-card:     0 2px 20px rgba(0,0,0,0.6), 0 1px 4px rgba(0,0,0,0.4);
  --shadow-elevated: 0 8px 40px rgba(0,0,0,0.7);

  --font-main:       'Inter', 'Circular Std', system-ui, sans-serif;
  --font-mono:       'JetBrains Mono', 'Fira Code', monospace;

  --nav-h:           52px;
  --filter-h:        auto;
  --kpi-h:           auto;
  --transition:      all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme override */
body.light-mode {
  --bg-base:         #f8fafc;
  --bg-surface:      #ffffff;
  --bg-elevated:     #f1f5f9;
  --bg-hover:        #e2e8f0;
  --bg-card:         #ffffff;
  --text-primary:    #0f172a;
  --text-secondary:  #334155;
  --text-muted:      #64748b;
  --border:          rgba(0, 0, 0, 0.08);
  --border-accent:   rgba(29, 185, 84, 0.4);
  --shadow-card:     0 1px 3px 0 rgba(0, 0, 0, 0.07), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-elevated: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

body.light-mode .kpi-card-highlight {
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
  border-color: rgba(29, 185, 84, 0.35);
}

body.light-mode .chip {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

body.light-mode .chip:hover {
  border-color: var(--accent);
  color: #0f172a;
}

body.light-mode .chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

body.light-mode .scenario-btn-group {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

body.light-mode .scenario-btn {
  color: #475569;
}

body.light-mode .scenario-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #0f172a;
}

body.light-mode .scenario-btn.active {
  background: var(--accent);
  color: #ffffff;
}

body.light-mode .scenario-btn.active[data-scenario="worst"] {
  background: var(--orange);
  color: #ffffff;
}

body.light-mode .scenario-btn.active[data-scenario="best"] {
  background: #16a34a;
  color: #ffffff;
}

body.light-mode .range-slider {
  background: #e2e8f0;
}

body.light-mode .range-slider::-webkit-slider-thumb {
  border-color: #ffffff;
}

body.light-mode .range-slider::-moz-range-thumb {
  border-color: #ffffff;
}

body.light-mode .reset-btn {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

body.light-mode .reset-btn:hover {
  background: var(--red);
  color: #ffffff;
  border-color: var(--red);
}

body.light-mode .theme-toggle {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

body.light-mode .theme-toggle:hover {
  background: #e2e8f0;
  color: var(--accent);
}

body.light-mode .insight-pill {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}

body.light-mode .data-table thead tr {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

body.light-mode .data-table th {
  color: #475569;
}

body.light-mode .data-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
}

body.light-mode .data-table tbody tr:hover {
  background: #f8fafc;
}

body.light-mode .data-table td {
  color: #334155;
}

body.light-mode .rank-badge.rank-other {
  background: #f1f5f9;
  color: #64748b;
}

body.light-mode .feasibility-mini-bar {
  background: #e2e8f0;
}

/* ── Global Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #1DB954; }

/* ══════════════════════════════════════════════════════════════════════
   TOP NAV
   ══════════════════════════════════════════════════════════════════════ */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

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

.brand-logo { display: flex; align-items: center; }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.brand-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.data-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow-sm);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-accent);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

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

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.nav-company {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.theme-toggle {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.theme-toggle:hover {
  background: var(--bg-elevated);
  color: var(--accent);
  border-color: var(--border-accent);
}

/* ══════════════════════════════════════════════════════════════════════
   FILTER RIBBON
   ══════════════════════════════════════════════════════════════════════ */
.filter-ribbon {
  position: sticky;
  top: var(--nav-h);
  z-index: 99;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
}

.filter-ribbon > .filter-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.filter-label-text {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.filter-select {
  height: 32px;
  padding: 0 28px 0 10px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-main);
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  -webkit-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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  min-width: 155px;
}

.filter-select:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow-sm);
}

.filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-select option {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  padding: 6px;
}

body.light-mode .filter-select {
  background-color: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.light-mode .filter-select:hover {
  border-color: var(--accent);
}

body.light-mode .filter-select option {
  background-color: #ffffff;
  color: #0f172a;
}

.multi-select {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 260px;
}

.chip {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  user-select: none;
}

.chip:hover { border-color: var(--accent); color: var(--text-primary); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}

.filter-range-group { min-width: 160px; }

.range-slider-wrap {
  position: relative;
  height: 20px;
  width: 150px;
  display: flex;
  align-items: center;
}

.range-slider-wrap::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--bg-elevated);
  border-radius: 3px;
  pointer-events: none;
}

body.light-mode .range-slider-wrap::before {
  background: #e2e8f0;
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 150px;
  height: 3px;
  background: transparent;
  outline: none;
  position: absolute;
  pointer-events: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  pointer-events: auto;
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.range-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  pointer-events: auto;
  border: 2px solid var(--bg-surface);
}

.scenario-group { min-width: 220px; }

.scenario-btn-group {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.scenario-btn {
  flex: 1;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-main);
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.scenario-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.scenario-btn.active {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}

.scenario-btn.active[data-scenario="worst"] {
  background: var(--orange);
  color: #000;
}

.scenario-btn.active[data-scenario="best"] {
  background: #22c55e;
  color: #000;
}

.reset-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-main);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  align-self: flex-end;
  height: 26px;
}

.reset-btn:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* ══════════════════════════════════════════════════════════════════════
   KPI CARDS
   ══════════════════════════════════════════════════════════════════════ */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-base);
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 100%);
  pointer-events: none;
}

.kpi-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-elevated);
}

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

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

.kpi-icon-blue   { background: rgba(74, 158, 255, 0.12); color: var(--blue); }
.kpi-icon-green  { background: rgba(29, 185, 84, 0.12);  color: var(--accent); }
.kpi-icon-purple { background: rgba(168, 85, 247, 0.12); color: var(--purple); }
.kpi-icon-accent { background: rgba(29, 185, 84, 0.18);  color: var(--accent); }
.kpi-icon-orange { background: rgba(249, 115, 22, 0.12); color: var(--orange); }
.kpi-icon-teal   { background: rgba(45, 212, 191, 0.12); color: var(--teal); }

.kpi-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.kpi-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text-primary);
  line-height: 1.1;
}

.kpi-card-highlight .kpi-value { color: var(--accent); }

.kpi-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ══════════════════════════════════════════════════════════════════════
   INSIGHTS BOX CONTAINER (EXECUTIVE BOX TYPE)
   ══════════════════════════════════════════════════════════════════════ */
.insights-box-wrapper {
  margin: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
}

body.light-mode .insights-box-wrapper {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.insights-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

body.light-mode .insights-box-header {
  border-bottom-color: #e2e8f0;
}

.insights-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-primary);
}

body.light-mode .insights-header-title {
  color: #0f172a;
}

.insights-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

body.light-mode .insights-badge {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

.insights-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.insight-card-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  border-left: 3px solid var(--accent);
}

body.light-mode .insight-card-box {
  background: #f8fafc;
  border-color: #e2e8f0;
  border-left-color: #10b981;
}

.insight-card-box:hover {
  border-color: var(--border-accent);
  border-left-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.insight-box-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.insight-box-icon {
  font-size: 16px;
  line-height: 1;
}

.insight-box-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}

body.light-mode .insight-box-title {
  color: #059669;
}

.insight-box-content {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
}

body.light-mode .insight-box-content {
  color: #334155;
}

.insight-box-content strong,
.insight-box-content .insight-bold {
  color: var(--text-primary);
  font-weight: 700;
}

body.light-mode .insight-box-content strong,
body.light-mode .insight-box-content .insight-bold {
  color: #0f172a;
}

/* ══════════════════════════════════════════════════════════════════════
   CHART GRID
   ══════════════════════════════════════════════════════════════════════ */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  padding: 12px 20px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-card:hover {
  border-color: rgba(29, 185, 84, 0.2);
  box-shadow: var(--shadow-elevated);
}

.chart-card.highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow), var(--shadow-elevated);
}

.span-4  { grid-column: span 4; }
.span-6  { grid-column: span 6; }
.span-8  { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.chart-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.chart-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  background: var(--accent-glow-sm);
  border: 1px solid var(--border-accent);
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.chart-wrap {
  flex: 1;
  position: relative;
  min-height: 220px;
  max-height: 280px;
}

.chart-wrap-tall {
  min-height: 280px;
  max-height: 340px;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ══════════════════════════════════════════════════════════════════════
   HEATMAPS
   ══════════════════════════════════════════════════════════════════════ */
.heatmap-container {
  overflow-x: auto;
  flex: 1;
}

.heatmap-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11px;
}

.heatmap-table th {
  padding: 6px 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0.3px;
}

.heatmap-table th.row-header {
  text-align: left;
  color: var(--text-secondary);
  min-width: 180px;
  font-size: 11px;
}

.heatmap-table td {
  padding: 6px 10px;
  text-align: center;
  font-weight: 700;
  font-size: 11px;
  border-radius: 4px;
  cursor: default;
  transition: transform 0.12s;
  min-width: 80px;
  position: relative;
}

.heatmap-table td:not(.hm-label):hover {
  transform: scale(1.08);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.heatmap-table td.hm-label {
  text-align: left;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  background: transparent !important;
  padding-right: 14px;
}

.heatmap-wide .heatmap-table th.row-header { min-width: 160px; }

/* ══════════════════════════════════════════════════════════════════════
   TOP 20 TABLE
   ══════════════════════════════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table thead tr {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.data-table th:hover { color: var(--accent); }
.data-table th.num-col { text-align: right; }
.data-table th.rank-col { width: 36px; text-align: center; }
.data-table th.score-col { color: var(--accent); }

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}

.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr.selected { background: var(--accent-glow-sm); border-color: var(--border-accent); }

.data-table td {
  padding: 9px 12px;
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table td.num-col { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 11px; }
.data-table td.rank-col { text-align: center; font-weight: 700; color: var(--text-muted); font-size: 12px; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.rank-badge.rank-1 { background: #FFD700; color: #000; }
.rank-badge.rank-2 { background: #C0C0C0; color: #000; }
.rank-badge.rank-3 { background: #CD7F32; color: #000; }
.rank-badge.rank-other { background: var(--bg-elevated); color: var(--text-muted); }

.feasibility-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.feasibility-score {
  font-weight: 800;
  font-size: 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  min-width: 36px;
  text-align: right;
}

.feasibility-mini-bar {
  width: 42px;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.feasibility-mini-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
}

.risk-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.risk-low  { background: rgba(29,185,84,0.15); color: var(--accent); }
.risk-med  { background: rgba(251,191,36,0.15); color: var(--yellow); }
.risk-high { background: rgba(239,68,68,0.15);  color: var(--red); }

/* ══════════════════════════════════════════════════════════════════════
   EXPORT BUTTON
   ══════════════════════════════════════════════════════════════════════ */
.export-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-main);
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.export-btn:hover {
  background: #22da62;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(29, 185, 84, 0.4);
}

/* ══════════════════════════════════════════════════════════════════════
   FOOTER (EXECUTIVE REDESIGN)
   ══════════════════════════════════════════════════════════════════════ */
.dash-footer {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  margin-top: 16px;
}

body.light-mode .dash-footer {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 32px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.footer-brand-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.footer-desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 14px;
  max-width: 320px;
}

.footer-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.3);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(29, 185, 84, 0); }
  100% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0); }
}

.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.footer-meta-list, .footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.footer-meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 4px;
}

.footer-meta-list li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.footer-links-list li a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-links-list li a::before {
  content: '→';
  color: var(--accent);
  font-size: 11px;
}

.footer-links-list li a:hover {
  color: var(--accent);
  transform: translateX(2px);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

.footer-badges {
  display: flex;
  gap: 8px;
}

.footer-chip {
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 24px; }
}

@media (max-width: 640px) {
  .footer-top { grid-template-columns: 1fr; gap: 20px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ══════════════════════════════════════════════════════════════════════
   LOADING STATE
   ══════════════════════════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 1400px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .span-4  { grid-column: span 6; }
  .span-6  { grid-column: span 6; }
  .span-8  { grid-column: span 8; }
}

@media (max-width: 900px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .span-4, .span-6, .span-8, .span-12 { grid-column: span 12; }
  .filters-row { flex-direction: column; }
  .multi-select { max-width: 100%; }
}
