/* ═══════════════════════════════════════════════════════════════════════════
   BPKH COMMAND CENTER v3 — Design System
   Theme: Navy Blue + White + Gold / Premium Enterprise Intelligence
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── TOKEN LAYER ─── */
:root {
  /* Navy Scale */
  --navy-950: #020E1E;
  --navy-900: #0D2B4E;
  --navy-800: #163D6A;
  --navy-700: #1B4F86;
  --navy-600: #1D60A6;
  --navy-500: #2B72C8;
  --navy-400: #5A9FE0;
  --navy-300: #93C4EF;
  --navy-200: #C7DEFA;
  --navy-100: #DBEAFE;
  --navy-50:  #EFF6FF;

  /* BPKH Gold */
  --gold:        #C9A84C;
  --gold-light:  #E8C97A;
  --gold-dark:   #A8852A;
  --gold-dim:    rgba(201,168,76,0.10);
  --gold-border: rgba(201,168,76,0.28);

  /* Surfaces */
  --bg:          #F0F4F8;
  --surface:     #FFFFFF;
  --surface-2:   #F8FAFC;
  --surface-3:   #F1F5F9;

  /* Borders */
  --border:      #E2E8F0;
  --border-2:    #CBD5E1;

  /* Text */
  --text:        #0F172A;
  --text-2:      #475569;
  --text-3:      #94A3B8;

  /* Text on Navy */
  --text-navy:   #FFFFFF;
  --text-navy-2: #B8CCEC;
  --text-navy-3: rgba(255,255,255,0.40);

  /* Status Colors */
  --green:         #10B981;
  --green-dim:     rgba(16,185,129,0.10);
  --green-border:  rgba(16,185,129,0.28);
  --red:           #EF4444;
  --red-dim:       rgba(239,68,68,0.10);
  --red-border:    rgba(239,68,68,0.28);
  --amber:         #F59E0B;
  --amber-dim:     rgba(245,158,11,0.10);
  --amber-border:  rgba(245,158,11,0.28);
  --blue:          #3B82F6;
  --blue-dim:      rgba(59,130,246,0.10);
  --blue-border:   rgba(59,130,246,0.28);
  --purple:        #8B5CF6;
  --purple-dim:    rgba(139,92,246,0.10);

  /* NEW v3: 5-Tier State System */
  --state-normal:      #10B981;
  --state-watch:       #F59E0B;
  --state-opportunity: #3B82F6;
  --state-risk:        #EF4444;
  --state-urgent:      #DC2626;

  /* Shadows */
  --shadow-xs:    0 1px 2px rgba(15,23,42,0.05);
  --shadow-sm:    0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md:    0 4px 6px rgba(15,23,42,0.07), 0 2px 4px rgba(15,23,42,0.04);
  --shadow-lg:    0 10px 15px rgba(15,23,42,0.08), 0 4px 6px rgba(15,23,42,0.04);
  --shadow-xl:    0 20px 25px rgba(15,23,42,0.10), 0 8px 10px rgba(15,23,42,0.04);
  --shadow-navy:  0 4px 16px rgba(13,43,78,0.30);
  --shadow-gold:  0 4px 12px rgba(201,168,76,0.25);

  /* Typography */
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-sans:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', monospace;

  /* Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;

  /* Transitions */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.4, 0, 1, 1);
  --ease-inout: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 13px; line-height: 1.6; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ══════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════ */

.cmd-nav {
  background: var(--navy-900);
  height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: var(--shadow-navy);
}

.cmd-nav-left { display: flex; align-items: center; gap: 0; }

.cmd-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 18px;
  border-right: 1px solid rgba(255,255,255,0.12);
  margin-right: 14px;
  text-decoration: none;
}
.cmd-logo {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  clip-path: polygon(50% 0%,100% 25%,100% 75%,50% 100%,0% 75%,0% 25%);
  flex-shrink: 0;
  box-shadow: var(--shadow-gold);
  animation: logoBreath 5s ease-in-out infinite;
}
@keyframes logoBreath { 0%,100%{filter:brightness(1)} 50%{filter:brightness(1.15)} }
.cmd-brand-text {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cmd-brand-text span { color: var(--gold-light); }
.cmd-v3-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(201,168,76,0.20);
  color: var(--gold-light);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 2px;
  margin-left: 4px;
}

.cmd-tabs { display: flex; align-items: center; gap: 1px; }
.cmd-tab {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-navy-3);
  padding: 0 12px;
  height: 52px;
  display: flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  position: relative;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.cmd-tab:hover { color: rgba(255,255,255,0.80); background: rgba(255,255,255,0.04); }
.cmd-tab.active { color: #FFFFFF; }
.cmd-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10px;
  right: 10px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 2px 2px 0 0;
}

.cmd-nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--green);
  letter-spacing: 0.06em;
}
.live-dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.35;transform:scale(0.65)} }
.nav-clock {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-navy-3);
  letter-spacing: 0.1em;
}

/* ══════════════════════════════════════
   PAGE HEADER (NAVY BAND)
   ══════════════════════════════════════ */

.page-header {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(201,168,76,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.page-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 24px 0;
}
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-eyebrow::before { content: ''; width: 16px; height: 1px; background: var(--gold); opacity: 0.6; }
.page-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.page-sub {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-navy-2);
  margin-top: 3px;
  opacity: 0.75;
}
.page-header-actions { display: flex; align-items: center; gap: 8px; padding-bottom: 18px; }

.page-tabs { display: flex; gap: 0; margin-top: 16px; }
.page-tab {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-navy-3);
  padding: 8px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  background: transparent;
  border-top: none; border-left: none; border-right: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.page-tab:hover { color: rgba(255,255,255,0.75); }
.page-tab.active { color: #FFFFFF; border-bottom-color: var(--gold); }

/* ══════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════ */

.container { max-width: 1400px; margin: 0 auto; padding: 22px 24px; }

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

/* ══════════════════════════════════════
   SECTION LABEL
   ══════════════════════════════════════ */

.sec-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ══════════════════════════════════════
   CARD
   ══════════════════════════════════════ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}
.card-title {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.card-actions { display: flex; align-items: center; gap: 6px; }

/* Card accent bar */
.card-accent-left {
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.accent-navy { background: var(--navy-600); }
.accent-gold { background: var(--gold); }
.accent-green { background: var(--green); }
.accent-red { background: var(--red); }
.accent-amber { background: var(--amber); }

/* ══════════════════════════════════════
   NEW v3: INSIGHT PANEL SYSTEM
   ══════════════════════════════════════ */

.insight-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.insight-panel.normal { border-left-color: var(--state-normal); }
.insight-panel.watch { border-left-color: var(--state-watch); }
.insight-panel.opportunity { border-left-color: var(--state-opportunity); }
.insight-panel.risk { border-left-color: var(--state-risk); }
.insight-panel.urgent { border-left-color: var(--state-urgent); }

.panel-why {
  font-size: 11px;
  color: var(--text-3);
  font-style: italic;
  margin-top: 4px;
  margin-bottom: 12px;
}

.panel-narasi {
  background: var(--surface-2);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
  margin-top: 12px;
}

.narrative-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-2);
}

.implication-block {
  background: var(--surface-2);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px;
  margin-top: 12px;
}
.implication-block .what-happened,
.implication-block .so-what,
.implication-block .impact,
.implication-block .recommendation {
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 2px solid transparent;
}
.implication-block .what-happened { border-left-color: var(--blue); }
.implication-block .so-what { border-left-color: var(--amber); }
.implication-block .impact { border-left-color: var(--red); }
.implication-block .recommendation { border-left-color: var(--green); }
.implication-block .section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.implication-block .section-text {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ══════════════════════════════════════
   NEW v3: METRIC ROW
   ══════════════════════════════════════ */

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.metric-row:last-child { border-bottom: none; }
.metric-row-label {
  flex: 1;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}
.metric-row-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.metric-row-change {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  min-width: 60px;
  text-align: right;
}
.metric-row-status {
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   NEW v3: REGIME CARD
   ══════════════════════════════════════ */

.regime-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.regime-recovery { background: rgba(16,185,129,0.15); color: #059669; border: 1px solid rgba(16,185,129,0.3); }
.regime-expansion { background: rgba(59,130,246,0.15); color: #2563EB; border: 1px solid rgba(59,130,246,0.3); }
.regime-peaking { background: rgba(245,158,11,0.15); color: #D97706; border: 1px solid rgba(245,158,11,0.3); }
.regime-slowdown { background: rgba(239,68,68,0.12); color: #DC2626; border: 1px solid rgba(239,68,68,0.25); }
.regime-contraction { background: rgba(220,38,38,0.18); color: #991B1B; border: 1px solid rgba(220,38,38,0.35); }

.regime-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.regime-card-icon {
  font-size: 28px;
  margin-bottom: 12px;
}
.regime-card-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.regime-card-confidence {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

/* ══════════════════════════════════════
   NEW v3: STATUS BADGES (5-TIER)
   ══════════════════════════════════════ */

.badge-normal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16,185,129,0.10);
  color: var(--state-normal);
  border: 1px solid rgba(16,185,129,0.28);
}
.badge-watch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(245,158,11,0.10);
  color: var(--state-watch);
  border: 1px solid rgba(245,158,11,0.28);
}
.badge-opportunity {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(59,130,246,0.10);
  color: var(--state-opportunity);
  border: 1px solid rgba(59,130,246,0.28);
}
.badge-risk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(239,68,68,0.10);
  color: var(--state-risk);
  border: 1px solid rgba(239,68,68,0.28);
}
.badge-urgent {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(220,38,38,0.15);
  color: var(--state-urgent);
  border: 1px solid rgba(220,38,38,0.35);
}

/* ══════════════════════════════════════
   NEW v3: STATUS DOTS (ANIMATED)
   ══════════════════════════════════════ */

.status-dot-normal {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--state-normal);
  box-shadow: 0 0 0 2px rgba(16,185,129,0.15);
  flex-shrink: 0;
  display: inline-block;
}
.status-dot-watch {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--state-watch);
  box-shadow: 0 0 0 2px rgba(245,158,11,0.15);
  flex-shrink: 0;
  display: inline-block;
}
.status-dot-opportunity {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--state-opportunity);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
  flex-shrink: 0;
  display: inline-block;
}
.status-dot-risk {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--state-risk);
  box-shadow: 0 0 0 2px rgba(239,68,68,0.15);
  flex-shrink: 0;
  display: inline-block;
  animation: pulseRisk 2s ease-in-out infinite;
}
.status-dot-urgent {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--state-urgent);
  box-shadow: 0 0 0 2px rgba(220,38,38,0.20);
  flex-shrink: 0;
  display: inline-block;
  animation: pulseUrgent 1.2s ease-in-out infinite;
}
@keyframes pulseRisk { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(1.1)} }
@keyframes pulseUrgent { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(1.15)} }

/* ══════════════════════════════════════
   KPI CARDS
   ══════════════════════════════════════ */

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.kpi-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kpi-val {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  transition: all 0.4s var(--ease-out);
}
.kpi-val.animating { animation: valueUpdate 0.4s var(--ease-out); }
@keyframes valueUpdate { 0%{transform:translateY(-3px);opacity:0.5} 100%{transform:translateY(0);opacity:1} }

.kpi-sub {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-prog {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}
.kpi-prog-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1.4s var(--ease-out);
}

/* ══════════════════════════════════════
   BADGES
   ══════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.badge-live  { background: var(--green-dim); color: var(--green); border: 1px solid var(--green-border); }
.badge-watch { background: var(--amber-dim); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-risk  { background: var(--red-dim); color: var(--red); border: 1px solid var(--red-border); }
.badge-info  { background: var(--blue-dim); color: var(--blue); border: 1px solid var(--blue-border); }
.badge-gold  { background: var(--gold-dim); color: var(--gold-dark); border: 1px solid var(--gold-border); }
.badge-navy  { background: var(--navy-50); color: var(--navy-700); border: 1px solid var(--navy-200); }

/* Inline delta badges */
.delta-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}
.delta-up   { background: var(--green-dim); color: var(--green); }
.delta-down { background: var(--red-dim); color: var(--red); }
.delta-flat { background: var(--amber-dim); color: var(--amber); }

/* ══════════════════════════════════════
   STATUS DOT
   ══════════════════════════════════════ */

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.dot-green  { background: var(--green); box-shadow: 0 0 0 2px var(--green-dim); }
.dot-amber  { background: var(--amber); box-shadow: 0 0 0 2px var(--amber-dim); }
.dot-red    { background: var(--red);   box-shadow: 0 0 0 2px var(--red-dim); }
.dot-navy   { background: var(--navy-500); }
.dot-gray   { background: var(--text-3); }

/* ══════════════════════════════════════
   DATA TABLE
   ══════════════════════════════════════ */

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
.data-table td {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-2);
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table td:first-child { color: var(--text); font-weight: 500; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }
.data-table .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.data-table .ta-r { text-align: right; }
.data-table .ta-c { text-align: center; }

/* ══════════════════════════════════════
   AI INSIGHT MODULE
   ══════════════════════════════════════ */

.ai-panel {
  background: linear-gradient(135deg, var(--navy-50) 0%, var(--surface-2) 100%);
  border: 1px solid var(--navy-200);
  border-left: 3px solid var(--navy-600);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  animation: fadeInDown 0.4s var(--ease-out);
}
.ai-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--navy-900);
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}
.ai-chip-dot {
  width: 5px; height: 5px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
.ai-panel-ts {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  margin-left: auto;
}
.ai-panel-body p {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.70;
  margin-bottom: 8px;
}
.ai-panel-body p:last-child { margin-bottom: 0; }
.ai-panel-body strong { color: var(--navy-800); font-weight: 600; }
.ai-panel-body .ai-tag {
  display: inline-block;
  background: var(--navy-100);
  color: var(--navy-700);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 4px;
  letter-spacing: 0.04em;
}

/* AI Quadrant (what / so what / impact / rec) */
.ai-quad {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--navy-200);
}
.ai-quad-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  color: var(--navy-600);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.ai-quad-text {
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.55;
}

/* ══════════════════════════════════════
   NEW v3: CHART ENHANCEMENTS
   ══════════════════════════════════════ */

.chart-container {
  position: relative;
  width: 100%;
  min-height: 200px;
}

.chart-tooltip-custom {
  background: var(--navy-900);
  color: #FFFFFF;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  box-shadow: var(--shadow-lg);
}

.chart-legend-custom {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

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

.animated-value {
  animation: countUp 0.6s var(--ease-out);
}

@keyframes valueFlash {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

.value-updating {
  animation: valueFlash 0.5s ease-out;
}

/* ══════════════════════════════════════
   NEW v3: PROGRESSIVE DISCLOSURE
   ══════════════════════════════════════ */

.detail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
  border: none;
}
.detail-toggle:hover { color: var(--text); }
.detail-toggle::before {
  content: '▶';
  display: inline-block;
  transition: transform 0.2s var(--ease-out);
  font-size: 8px;
}
.detail-toggle[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

.detail-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease-out);
  opacity: 0;
}
.detail-content.open {
  max-height: 1000px;
  opacity: 1;
  transition: max-height 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

/* ══════════════════════════════════════
   NEW v3: STORY FLOW
   ══════════════════════════════════════ */

.story-flow {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.story-flow-section {
  position: relative;
  padding-left: 24px;
}

.story-flow-section::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20px;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--gold);
}

.story-flow-section:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 30px;
  width: 2px;
  height: 32px;
  background: linear-gradient(180deg, var(--gold) 0%, transparent 100%);
}

.story-flow-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.story-flow-content {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ══════════════════════════════════════
   ALERT BANNERS
   ══════════════════════════════════════ */

.alert-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  font-size: 12px;
  animation: fadeInDown 0.3s var(--ease-out);
}
.alert-bar.warning { background: var(--amber-dim); border: 1px solid var(--amber-border); border-left: 3px solid var(--amber); }
.alert-bar.danger  { background: var(--red-dim);   border: 1px solid var(--red-border);   border-left: 3px solid var(--red); }
.alert-bar.info    { background: var(--blue-dim);  border: 1px solid var(--blue-border);  border-left: 3px solid var(--blue); }
.alert-bar.success { background: var(--green-dim); border: 1px solid var(--green-border); border-left: 3px solid var(--green); }
.alert-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 1px;
}
.alert-bar.warning .alert-tag { color: var(--amber); }
.alert-bar.danger  .alert-tag { color: var(--red); }
.alert-bar.info    .alert-tag { color: var(--blue); }
.alert-bar.success .alert-tag { color: var(--green); }
.alert-msg { color: var(--text-2); line-height: 1.5; flex: 1; }
.alert-dismiss {
  color: var(--text-3);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 2px;
}
.alert-dismiss:hover { color: var(--text-2); }

/* ══════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn-primary  { background: var(--navy-900); color: #FFFFFF; }
.btn-primary:hover { background: var(--navy-800); box-shadow: var(--shadow-navy); }
.btn-secondary { background: var(--surface); color: var(--text-2); border: 1px solid var(--border-2); }
.btn-secondary:hover { background: var(--surface-3); color: var(--text); }
.btn-gold  { background: var(--gold); color: #FFFFFF; }
.btn-gold:hover { background: var(--gold-dark); }
.btn-ghost { background: transparent; color: var(--text-3); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text-2); }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-xs { padding: 2px 8px; font-size: 10px; }

/* ══════════════════════════════════════
   TICK / MARKET DATA
   ══════════════════════════════════════ */

.ticker-bar {
  background: var(--navy-950);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
  height: 34px;
}
.ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-right: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  height: 100%;
}
.ticker-item:first-child { padding-left: 0; }
.ticker-sym {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ticker-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.ticker-chg {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.ticker-chg.pos { color: var(--green); }
.ticker-chg.neg { color: var(--red); }
.ticker-chg.flat { color: var(--text-3); }
.ticker-stale { color: var(--amber); font-size: 8.5px; letter-spacing: 0.05em; }

/* ══════════════════════════════════════
   DATA FRESHNESS
   ══════════════════════════════════════ */

.freshness {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 1.5px 6px;
  border-radius: 3px;
}
.fresh  { background: var(--green-dim); color: var(--green); border: 1px solid var(--green-border); }
.stale  { background: var(--amber-dim); color: var(--amber); border: 1px solid var(--amber-border); }
.manual { background: var(--blue-dim); color: var(--blue); border: 1px solid var(--blue-border); }

/* ══════════════════════════════════════
   PROGRESS BARS
   ══════════════════════════════════════ */

.progress { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; transition: width 1.2s var(--ease-out); }
.progress-navy   { background: var(--navy-600); }
.progress-gold   { background: var(--gold); }
.progress-green  { background: var(--green); }
.progress-amber  { background: var(--amber); }
.progress-red    { background: var(--red); }

/* ══════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════ */

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--border) 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
  color: transparent;
  user-select: none;
}

/* Entrance stagger */
.stagger > * { animation: fadeInDown 0.35s var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 50ms; }
.stagger > *:nth-child(3) { animation-delay: 100ms; }
.stagger > *:nth-child(4) { animation-delay: 150ms; }
.stagger > *:nth-child(5) { animation-delay: 200ms; }
.stagger > *:nth-child(6) { animation-delay: 250ms; }

/* ══════════════════════════════════════
   UTILITY
   ══════════════════════════════════════ */

.divider { height: 1px; background: var(--border); margin: 16px 0; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.flex  { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; }
.flex-col     { display: flex; flex-direction: column; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-sm  { font-size: 11px; }
.text-xs  { font-size: 10px; }
.text-muted { color: var(--text-3); }
.text-2   { color: var(--text-2); }
.mono     { font-family: var(--font-mono); }
.tabular  { font-variant-numeric: tabular-nums; }
.fw-600   { font-weight: 600; }
.fw-700   { font-weight: 700; }
.green    { color: var(--green); }
.red      { color: var(--red); }
.amber    { color: var(--amber); }
.gold     { color: var(--gold); }
.navy     { color: var(--navy-700); }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* ══════════════════════════════════════
   CHART WRAPPER
   ══════════════════════════════════════ */

.chart-wrap { position: relative; width: 100%; }
.chart-wrap canvas { display: block; }

/* ══════════════════════════════════════
   DATA FOOTER
   ══════════════════════════════════════ */

.data-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.data-footer-ts {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
}

/* ══════════════════════════════════════
   HIGHLIGHT BAND (page top summary)
   ══════════════════════════════════════ */

.highlight-band {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
}
.highlight-band-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.highlight-kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  min-width: 90px;
}
.highlight-kv-label {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.highlight-kv-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.highlight-kv-sub { font-size: 10px; color: var(--text-3); font-family: var(--font-sans); }


/* ══════════════════════════════════════
   GLOBAL RESPONSIVE + STATUS BADGES
   ══════════════════════════════════════ */
.data-status-badge, .kpi-source-badge, .macro-badge, .saudi-badge {
  white-space: nowrap;
}
.data-status-badge.live, .status-badge.live, .macro-badge.live { background: rgba(16,185,129,.10); color: #047857; border-color: rgba(16,185,129,.30); }
.data-status-badge.baseline, .status-badge.baseline, .macro-badge.baseline { background: rgba(245,158,11,.10); color: #B45309; border-color: rgba(245,158,11,.30); }
.data-status-badge.manual, .status-badge.manual, .macro-badge.manual { background: rgba(59,130,246,.10); color: #1D4ED8; border-color: rgba(59,130,246,.30); }

@media (max-width: 1024px) {
  .page-container, .container, .main-content { padding-left: 16px !important; padding-right: 16px !important; }
  .grid-6, .grid-5, .grid-4, .grid-3, .grid-2, .bpih-mini-grid, .impact-cards, .hajj-grid, .macro-card-grid, .saudi-grid, .cx-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .panel-header { gap: 12px; }
}
@media (max-width: 720px) {
  .cmd-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cmd-brand-text { font-size: 13px !important; white-space: normal !important; }
  .grid-6, .grid-5, .grid-4, .grid-3, .grid-2, .bpih-mini-grid, .impact-cards, .hajj-grid, .macro-card-grid, .saudi-grid, .cx-grid-2, .macro-explain, .panel-grid, .card-grid {
    grid-template-columns: 1fr !important;
  }
  .panel, .card, .kpi-card { border-radius: 14px !important; }
  .panel-header, .macro-source-row, .data-footer { flex-direction: column !important; align-items: flex-start !important; }
  .chart-container, .hajj-chart-wrap, .trend-chart-wrap { min-height: 260px !important; height: 260px !important; }
  table { min-width: 720px; }
  .table-wrap, .scenario-table-wrap, .overflow-x-auto { overflow-x: auto !important; }
  input, button, select { min-height: 38px; }
}
