/* ═══════════════════════════════════════════════════════════════════
   DIOS — DANANTARA INTEGRATED OVERSIGHT SYSTEM
   Design System — adapted from KSP Monitoring Dashboard (gold accent)
   ═══════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ─── CSS VARIABLES ─────────────────────────────────────────────── */
:root {
  --bg:           #08090c;
  --bg2:          #0c0e12;
  --card:         #14171d;
  --card-hover:   #1a1e26;
  --sidebar:      #0e1015;
  --border:       #23262e;
  --border-mid:   #3a3f4b;
  --text-1:       #f2f4f8;
  --text-2:       #a4abb8;
  --text-3:       #6d7585;
  --gold:         #c4902a;
  --gold-b:       #d9a83f;
  --gold-soft:    rgba(196,144,42,0.12);
  --gold-bdr:     rgba(196,144,42,0.3);
  --blue:         #4a8fe8;
  --blue-soft:    rgba(74,143,232,0.12);
  --green:        #22c55e;
  --green-soft:   rgba(34,197,94,0.12);
  --amber:        #f59e0b;
  --amber-soft:   rgba(245,158,11,0.12);
  --red:          #ef4444;
  --red-soft:     rgba(239,68,68,0.12);
  --purple:       #a855f7;
  --purple-soft:  rgba(168,85,247,0.12);
  --orange:       #f97316;
  --orange-soft:  rgba(249,115,22,0.12);
  --mono:         'IBM Plex Mono', monospace;
  --r:            6px;
  --r-sm:         4px;
  --r-md:         8px;
  --r-lg:         12px;
  --r-xl:         16px;
  --sh:           0 4px 16px rgba(0,0,0,0.4);
  --sh-lg:        0 8px 32px rgba(0,0,0,0.5);
  --sidebar-w:    250px;
  --topbar-h:     60px;
  --classbar-h:   26px;
  --ease:         cubic-bezier(0.4,0,0.2,1);
}

.light-theme {
  --bg:           #f7f7f8;
  --bg2:          #f0f0f2;
  --card:         #ffffff;
  --card-hover:   #f4f4f5;
  --sidebar:      #f0f0f2;
  --border:       #e2e2e6;
  --border-mid:   #cfcfd6;
  --text-1:       #101114;
  --text-2:       #35373d;
  --text-3:       #71717a;
  --gold-soft:    rgba(178,124,20,0.10);
  --gold-bdr:     rgba(178,124,20,0.35);
  --blue-soft:    rgba(59,110,200,0.08);
  --green-soft:   rgba(22,163,74,0.08);
  --amber-soft:   rgba(217,119,6,0.10);
  --red-soft:     rgba(220,38,38,0.08);
  --purple-soft:  rgba(147,51,234,0.08);
  --orange-soft:  rgba(234,88,12,0.08);
  --sh:           0 4px 16px rgba(0,0,0,0.05);
  --sh-lg:        0 8px 32px rgba(0,0,0,0.08);
}
.light-theme { --gold: #a06f14; --gold-b: #8a5f10; }

/* ─── RESET ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text-1); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow: hidden; }
body, .sidebar, .main-area, .topbar, .card, .kpi-card, .btn-secondary, table, th, td, .nav-item {
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 99px; }

/* ─── CLASSIFICATION BAR ────────────────────────────────────────── */
.classbar {
  height: var(--classbar-h);
  background: linear-gradient(90deg,#14100a,#0a0d14);
  border-bottom: 1px solid var(--gold-bdr);
  color: var(--gold);
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .22em;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.light-theme .classbar { background: linear-gradient(90deg,#f5eeda,#eef1f7); }

/* ─── APP LAYOUT ─────────────────────────────────────────────────── */
.app-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.app-layout { display: flex; flex: 1; overflow: hidden; min-height: 0; }

/* ─── SIDEBAR ───────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  position: relative; z-index: 10;
}
.sidebar-logo {
  padding: 18px 16px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.logo-icon {
  width: 36px; height: 36px; border-radius: var(--r-md);
  background: linear-gradient(135deg, #8a6314, #c4902a);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #0a0a0c; flex-shrink: 0;
  font-family: var(--mono); letter-spacing: -0.5px;
  box-shadow: 0 2px 10px rgba(196,144,42,0.4);
}
.logo-text { flex: 1; overflow: hidden; }
.logo-title { font-size: 11px; font-weight: 700; color: var(--text-1); letter-spacing: 0.5px; line-height: 1.2; }
.logo-sub { font-size: 9.5px; color: var(--text-3); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.nav-section-label { font-size: 10px; font-weight: 600; color: var(--text-3); letter-spacing: 0.8px; text-transform: uppercase; padding: 8px 8px 4px; margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r); color: var(--text-2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.15s var(--ease); position: relative;
  border: 1px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text-1); }
.light-theme .nav-item:hover { background: rgba(0,0,0,0.04); }
.nav-item.active {
  background: var(--gold-soft); color: var(--gold-b);
  border-color: var(--gold-bdr);
}
.nav-item-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item-label { flex: 1; }
.nav-badge {
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 99px; min-width: 18px; text-align: center;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge { 0%,100%{opacity:1} 50%{opacity:.7} }

.sidebar-footer { padding: 12px 8px 14px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #8a6314, #c4902a);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #0a0a0c; flex-shrink: 0; font-family: var(--mono);
}
.user-info { flex: 1; overflow: hidden; }
.user-name { font-size: 12px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: var(--text-3); }

/* ─── MAIN AREA ─────────────────────────────────────────────────── */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ─── TOPBAR ────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h); min-height: var(--topbar-h);
  background: var(--bg2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px;
}
.page-title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.page-subtitle { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.clock-widget { text-align: right; }
.clock-time { font-size: 13px; font-weight: 700; color: var(--text-1); font-variant-numeric: tabular-nums; letter-spacing: 0.5px; font-family: var(--mono); }
.clock-date { font-size: 10px; color: var(--text-3); }

.live-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--gold-soft); border: 1px solid var(--gold-bdr);
  padding: 4px 10px; border-radius: 99px;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); animation: blink 1.8s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.live-text { font-size: 10px; font-weight: 700; color: var(--gold-b); letter-spacing: 0.6px; font-family: var(--mono); }

.notif-btn {
  position: relative; width: 36px; height: 36px; border-radius: var(--r);
  background: transparent; border: 1px solid var(--border); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  transition: all 0.15s;
}
.notif-btn:hover { background: rgba(255,255,255,0.04); border-color: var(--border-mid); color: var(--text-1); }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; border: 1.5px solid var(--bg2); }

/* ─── PAGE CONTENT ──────────────────────────────────────────────── */
.page-content { flex: 1; overflow: hidden; position: relative; }
.page-view { height: 100%; display: none; overflow: hidden; }
.page-view.active { display: flex; flex-direction: column; }
.scroll-area { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }

/* ─── SECTION HEADER ────────────────────────────────────────────── */
.section-header { margin-bottom: 16px; }
.section-label { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--gold); margin-bottom: 4px; }
.section-title { font-size: 16px; font-weight: 700; color: var(--text-1); letter-spacing: -0.2px; }
.section-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; line-height: 1.6; max-width: 860px; }

/* ─── CARDS ─────────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); transition: border-color 0.15s; }
.card:hover { border-color: var(--border-mid); }
.card-p { padding: 16px; }
.card-p-sm { padding: 12px; }
.card-title { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }

/* ─── CALLOUT ───────────────────────────────────────────────────── */
.callout { border-radius: var(--r-md); padding: 14px 18px; margin: 14px 0; font-size: 12.5px; line-height: 1.7; border: 1px solid; color: var(--text-2); }
.callout strong { color: var(--text-1); }
.callout-label { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; margin-bottom: 8px; font-weight: 600; }
.co-gold { background: var(--gold-soft); border-color: var(--gold-bdr); }   .co-gold .callout-label { color: var(--gold-b); }
.co-green { background: var(--green-soft); border-color: rgba(34,197,94,.25); } .co-green .callout-label { color: var(--green); }
.co-red { background: var(--red-soft); border-color: rgba(239,68,68,.25); }   .co-red .callout-label { color: var(--red); }
.co-blue { background: var(--blue-soft); border-color: rgba(74,143,232,.25); } .co-blue .callout-label { color: var(--blue); }

/* ─── KPI CARDS (top strip) ─────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px; cursor: pointer; transition: all 0.2s var(--ease); position: relative; overflow: hidden;
}
.kpi-card::before { content:''; position:absolute; top:0; left:0; right:0; height:2px; background: var(--kpi-color, var(--gold)); opacity:0.7; }
.kpi-card:hover { border-color: var(--border-mid); background: var(--card-hover); transform: translateY(-1px); box-shadow: var(--sh); }
.kpi-label { font-size: 10.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; font-family: var(--mono); }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--text-1); line-height: 1; margin-bottom: 6px; letter-spacing: -0.5px; font-family: var(--mono); }
.kpi-value.red { color: var(--red); }
.kpi-value.amber { color: var(--amber); }
.kpi-value.green { color: var(--green); }
.kpi-sub { font-size: 11px; color: var(--text-3); }
.kpi-icon { position: absolute; top: 14px; right: 14px; font-size: 20px; opacity: 0.16; }

/* ─── BADGES ────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.badge-gold   { background: var(--gold-soft);   color: var(--gold-b); border-color: var(--gold-bdr); }
.badge-green  { background: var(--green-soft);  color: var(--green);  border-color: rgba(34,197,94,0.2); }
.badge-blue   { background: var(--blue-soft);   color: var(--blue);   border-color: rgba(74,143,232,0.2); }
.badge-amber  { background: var(--amber-soft);  color: var(--amber);  border-color: rgba(245,158,11,0.2); }
.badge-purple { background: var(--purple-soft); color: var(--purple); border-color: rgba(168,85,247,0.2); }
.badge-red    { background: var(--red-soft);    color: var(--red);    border-color: rgba(239,68,68,0.2); }
.badge-zinc   { background: rgba(113,113,122,0.1); color: var(--text-2); border-color: var(--border); }

.sev-critical { background: var(--red-soft);    color: var(--red);    border: 1px solid rgba(239,68,68,0.25); padding: 2px 8px; border-radius: 3px; font-size: 10px; font-weight: 700; font-family: var(--mono); letter-spacing: .05em; }
.sev-high     { background: var(--amber-soft);  color: var(--amber);  border: 1px solid rgba(245,158,11,0.25); padding: 2px 8px; border-radius: 3px; font-size: 10px; font-weight: 700; font-family: var(--mono); letter-spacing: .05em; }
.sev-medium   { background: var(--blue-soft);   color: var(--blue);   border: 1px solid rgba(74,143,232,0.25); padding: 2px 8px; border-radius: 3px; font-size: 10px; font-weight: 700; font-family: var(--mono); letter-spacing: .05em; }
.sev-low      { background: var(--green-soft);  color: var(--green);  border: 1px solid rgba(34,197,94,0.25);  padding: 2px 8px; border-radius: 3px; font-size: 10px; font-weight: 700; font-family: var(--mono); letter-spacing: .05em; }

/* ─── RAG ───────────────────────────────────────────────────────── */
.rag-badge { font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 4px; white-space: nowrap; }
.rag-g { background: var(--green-soft); color: var(--green); border: 1px solid rgba(34,197,94,.25); }
.rag-a { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(245,158,11,.25); }
.rag-r { background: var(--red-soft);   color: var(--red);   border: 1px solid rgba(239,68,68,.25); }
.rag-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ─── TABLE ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--card); }
table { width: 100%; border-collapse: collapse; }
thead th { background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border); padding: 10px 14px; text-align: left; font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; font-family: var(--mono); }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.025); }
.light-theme tbody tr:hover { background: rgba(0,0,0,0.02); }
tbody td { padding: 11px 14px; font-size: 12.5px; color: var(--text-1); vertical-align: top; line-height: 1.55; }
.td-muted { color: var(--text-3); font-size: 11.5px; }
.td-mono { font-family: var(--mono); font-size: 11px; }
.td-gold { color: var(--gold-b); font-family: var(--mono); font-size: 11px; font-weight: 600; }
.src-chip { font-family: var(--mono); font-size: 9px; padding: 1px 6px; border-radius: 2px; background: var(--bg); color: var(--text-3); border: 1px solid var(--border); white-space: nowrap; }

/* ─── FILTER PILLS ──────────────────────────────────────────────── */
.filters-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-pill {
  padding: 5px 12px; border-radius: 99px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); background: transparent; color: var(--text-2);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.filter-pill:hover { border-color: var(--border-mid); color: var(--text-1); }
.filter-pill.active { background: var(--gold-soft); border-color: var(--gold-bdr); color: var(--gold-b); }

/* ─── PROGRESS ──────────────────────────────────────────────────── */
.progress-bar { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width 0.6s var(--ease); }

/* ─── ALERT ITEMS ───────────────────────────────────────────────── */
.alert-item {
  padding: 12px 14px; border-radius: var(--r); border-left: 3px solid var(--border);
  background: rgba(255,255,255,0.02); margin-bottom: 8px; cursor: pointer; transition: all 0.15s;
}
.light-theme .alert-item { background: rgba(0,0,0,0.02); }
.alert-item:hover { background: rgba(255,255,255,0.05); }
.alert-item.critical { border-left-color: var(--red); }
.alert-item.review { border-left-color: var(--amber); }
.alert-title { font-size: 12.5px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; line-height: 1.4; }
.alert-meta { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alert-code { font-family: var(--mono); font-size: 10px; font-weight: 700; }

/* ─── PDE CARDS ─────────────────────────────────────────────────── */
.pde-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; margin-bottom: 14px; }
.pde-hdr { padding: 14px 18px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pde-code {
  font-family: var(--mono); font-size: 11px; font-weight: 700; width: 42px; height: 42px;
  border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pde-code.critical { background: var(--red-soft); color: var(--red); border: 1px solid rgba(239,68,68,.3); }
.pde-code.high { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(245,158,11,.3); }
.pde-code.monitor { background: var(--blue-soft); color: var(--blue); border: 1px solid rgba(74,143,232,.3); }
.pde-title { font-size: 13.5px; font-weight: 600; flex: 1; min-width: 240px; line-height: 1.4; }
.pde-esc { font-family: var(--mono); font-size: 9px; padding: 3px 9px; border-radius: 3px; letter-spacing: .06em; white-space: nowrap; }
.esc-boc { background: var(--red-soft); color: var(--red); border: 1px solid rgba(239,68,68,.3); }
.esc-audit { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(245,158,11,.3); }
.esc-mon { background: var(--blue-soft); color: var(--blue); border: 1px solid rgba(74,143,232,.3); }
.pde-body { padding: 14px 18px; }
.pde-stream { font-family: var(--mono); font-size: 10px; color: var(--text-3); letter-spacing: .04em; margin-bottom: 10px; line-height: 1.6; }
.pde-ex { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin-bottom: 12px; }
.pde-trigger { background: var(--bg); border-left: 3px solid var(--gold); border-radius: 0 var(--r) var(--r) 0; padding: 10px 14px; font-size: 12px; color: var(--text-1); line-height: 1.65; }

/* ─── ALERT SAMPLE (mono block) ─────────────────────────────────── */
.alert-sample { background: var(--bg); border: 1px solid var(--gold-bdr); border-radius: var(--r-md); padding: 18px 20px; font-family: var(--mono); font-size: 11px; line-height: 1.85; margin: 16px 0; overflow-x: auto; }
.as-title { color: var(--red); font-weight: 600; margin-bottom: 10px; font-size: 11.5px; letter-spacing: .05em; }
.as-sec { color: var(--gold-b); margin: 10px 0 3px; font-size: 10px; letter-spacing: .1em; }
.as-line { color: var(--text-3); }
.as-find { color: var(--text-1); }

/* ─── MAP PROFILE CARDS ─────────────────────────────────────────── */
.map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.map-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.map-hdr { padding: 14px 18px 10px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.map-name { font-size: 13.5px; font-weight: 600; }
.map-sub { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.map-body { padding: 14px 18px; }
.map-dim { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; }
.map-dl { color: var(--text-3); width: 190px; flex-shrink: 0; font-size: 11px; }
.map-track { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.map-fill { height: 100%; border-radius: 3px; transition: width 0.6s var(--ease); }
.map-dv { font-family: var(--mono); font-size: 10.5px; font-weight: 600; width: 40px; text-align: right; }
.map-note { font-size: 11.5px; color: var(--text-2); border-left: 2px solid var(--border-mid); padding-left: 10px; margin-top: 12px; line-height: 1.6; }

/* ─── TIMELINE / PHASES ─────────────────────────────────────────── */
.phase-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
.phase-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; position: relative; }
.phase-card.active-phase { border-color: var(--gold-bdr); box-shadow: 0 0 0 1px var(--gold-bdr); }
.phase-hdr { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.phase-lbl { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: var(--text-3); margin-bottom: 4px; }
.phase-name { font-size: 13.5px; font-weight: 700; }
.phase-time { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.phase-cost { font-family: var(--mono); font-size: 13px; font-weight: 600; margin-top: 6px; color: var(--gold-b); }
.phase-body { padding: 12px 16px; }
.phase-item { font-size: 11px; color: var(--text-2); padding: 4px 0; border-bottom: 1px dotted var(--border); line-height: 1.5; }
.phase-item:last-child { border: none; }
.phase-item::before { content: '→ '; color: var(--text-3); }
.phase-status { position: absolute; top: 12px; right: 12px; font-family: var(--mono); font-size: 8.5px; padding: 2px 8px; border-radius: 99px; letter-spacing: .08em; }
.ps-done { background: var(--green-soft); color: var(--green); border: 1px solid rgba(34,197,94,.3); }
.ps-active { background: var(--gold-soft); color: var(--gold-b); border: 1px solid var(--gold-bdr); animation: pulse-badge 2s infinite; }
.ps-next { background: var(--blue-soft); color: var(--blue); border: 1px solid rgba(74,143,232,.3); }
.ps-planned { background: rgba(113,113,122,0.1); color: var(--text-3); border: 1px solid var(--border); }

/* ─── RISK ROWS ─────────────────────────────────────────────────── */
.risk-row { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 10px; }
.risk-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.risk-name { font-weight: 600; color: var(--text-1); font-size: 13px; flex: 1; min-width: 240px; }
.risk-badges { display: flex; gap: 6px; flex-shrink: 0; }
.risk-mit { font-size: 12px; color: var(--text-2); line-height: 1.65; }

/* ─── DECISION CARDS ────────────────────────────────────────────── */
.decision-card { display: flex; gap: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; margin-bottom: 12px; }
.decision-no {
  font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--gold-b);
  width: 44px; height: 44px; border-radius: var(--r-md); background: var(--gold-soft);
  border: 1px solid var(--gold-bdr); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.decision-title { font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.decision-desc { font-size: 12px; color: var(--text-2); line-height: 1.65; }

/* ─── SOURCE CARDS ──────────────────────────────────────────────── */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.src-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; }
.src-card-hdr { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.src-card-name { font-size: 12.5px; font-weight: 600; }
.src-card-desc { font-size: 11.5px; color: var(--text-2); line-height: 1.6; }
.tag { font-family: var(--mono); font-size: 8.5px; padding: 2px 8px; border-radius: 2px; letter-spacing: .06em; white-space: nowrap; }
.tag-live { background: var(--green-soft); color: var(--green); border: 1px solid rgba(34,197,94,.25); }
.tag-pub  { background: var(--gold-soft); color: var(--gold-b); border: 1px solid var(--gold-bdr); }
.tag-mou  { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(245,158,11,.25); }
.tag-ph2  { background: var(--blue-soft); color: var(--blue); border: 1px solid rgba(74,143,232,.25); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chip { font-size: 10px; padding: 3px 8px; border-radius: 3px; background: var(--bg); border: 1px solid var(--border); color: var(--text-3); }
.chip-gold { background: var(--gold-soft); color: var(--gold-b); border-color: var(--gold-bdr); }
.chip-blue { background: var(--blue-soft); color: var(--blue); border-color: rgba(74,143,232,.25); }
.chip-green { background: var(--green-soft); color: var(--green); border-color: rgba(34,197,94,.25); }

/* ─── DOMAIN CARDS ──────────────────────────────────────────────── */
.domain-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; transition: all 0.15s; }
.domain-card:hover { border-color: var(--border-mid); transform: translateY(-1px); box-shadow: var(--sh); }
.domain-hdr { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.domain-code { font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 3px; }
.domain-name { font-size: 13px; font-weight: 600; flex: 1; }
.domain-desc { font-size: 11.5px; color: var(--text-2); line-height: 1.6; margin-bottom: 10px; }
.domain-paradox { font-size: 11px; color: var(--amber); background: var(--amber-soft); border: 1px solid rgba(245,158,11,.2); border-radius: var(--r-sm); padding: 7px 10px; line-height: 1.5; margin-bottom: 10px; }

/* ─── CADENCE ───────────────────────────────────────────────────── */
.cadence-row { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 10px; align-items: flex-start; }
.cadence-time { font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--gold-b); width: 150px; flex-shrink: 0; padding-top: 2px; }
.cadence-icon { font-size: 18px; flex-shrink: 0; }
.cadence-name { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.cadence-desc { font-size: 11.5px; color: var(--text-2); line-height: 1.55; }
.cadence-out { font-size: 11px; color: var(--text-3); margin-top: 5px; padding-left: 10px; border-left: 2px solid var(--gold-bdr); line-height: 1.5; }
.cadence-by { font-family: var(--mono); font-size: 9.5px; color: var(--text-3); margin-top: 4px; }

/* ─── FINANCE TABLE ─────────────────────────────────────────────── */
.fin-group td { background: var(--gold-soft); color: var(--gold-b); font-family: var(--mono); font-size: 9px; letter-spacing: .1em; padding: 6px 14px; border-bottom: 1px solid var(--gold-bdr); }
.fin-total td { background: var(--gold-soft); font-weight: 700; font-size: 13px; border-top: 2px solid var(--gold-bdr); border-bottom: none; }
.fn { font-family: var(--mono); font-size: 11.5px; text-align: right; white-space: nowrap; font-weight: 600; color: var(--gold-b); }
.r { text-align: right; }

/* ─── STAT HERO ─────────────────────────────────────────────────── */
.stat-hero { display: flex; gap: 24px; align-items: center; background: var(--card); border: 1px solid var(--gold-bdr); border-radius: var(--r-md); padding: 20px 24px; margin-bottom: 16px; flex-wrap: wrap; }
.stat-hero-val { font-family: var(--mono); font-size: 34px; font-weight: 800; color: var(--gold-b); line-height: 1; }
.stat-hero-lbl { font-size: 12px; color: var(--text-2); line-height: 1.5; max-width: 380px; }

/* ─── MODAL ─────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box { background: var(--card); border: 1px solid var(--border-mid); border-radius: var(--r-xl); width: 640px; max-width: 95vw; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--sh-lg); transform: scale(0.97) translateY(8px); transition: transform 0.2s; }
.modal-overlay.open .modal-box { transform: scale(1) translateY(0); }
.modal-header { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.modal-title { font-size: 15px; font-weight: 700; color: var(--text-1); line-height: 1.4; }
.modal-close { width: 28px; height: 28px; border-radius: var(--r); background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text-2); display: flex; align-items: center; justify-content: center; font-size: 15px; cursor: pointer; flex-shrink: 0; transition: all 0.15s; }
.modal-close:hover { background: rgba(255,255,255,0.08); color: var(--text-1); }
.modal-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-shrink: 0; }

/* ─── BUTTON ────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: var(--r); font-size: 13px; font-weight: 500; border: 1px solid transparent; cursor: pointer; transition: all 0.15s var(--ease); white-space: nowrap; }
.btn-primary { background: var(--gold); color: #0c0a05; font-weight: 600; }
.btn-primary:hover { background: var(--gold-b); }
.btn-secondary { background: rgba(255,255,255,0.05); color: var(--text-2); border-color: var(--border); }
.btn-secondary:hover { background: rgba(255,255,255,0.08); border-color: var(--border-mid); color: var(--text-1); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ─── NOTIFICATION DROPDOWN ─────────────────────────────────────── */
.notif-dropdown { position: absolute; top: calc(100% + 8px); right: 0; width: 340px; z-index: 200; background: var(--card); border: 1px solid var(--border-mid); border-radius: var(--r-lg); box-shadow: var(--sh-lg); overflow: hidden; }
.notif-header { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-1); display: flex; justify-content: space-between; align-items: center; }
.notif-item { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s; display: flex; gap: 10px; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.unread { background: var(--gold-soft); }
.notif-dot-indicator { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.notif-msg { font-size: 12px; color: var(--text-2); line-height: 1.4; flex: 1; }
.notif-time { font-size: 10px; color: var(--text-3); margin-top: 3px; }

/* ─── TOAST ─────────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--card); border: 1px solid var(--border-mid); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--sh-lg); max-width: 340px; pointer-events: all; transform: translateX(110%); transition: transform 0.3s var(--ease); }
.toast.show { transform: translateX(0); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-title { font-size: 13px; font-weight: 600; color: var(--text-1); }
.toast-msg { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ─── CHART ─────────────────────────────────────────────────────── */
.chart-wrap { position: relative; height: 220px; }
.chart-wrap-sm { position: relative; height: 180px; }

/* ─── EMPTY / UTILITY ───────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.text-muted { color: var(--text-3); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.25s var(--ease) forwards; }

/* ─── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .phase-grid { grid-template-columns: repeat(2, 1fr); }
  .map-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .grid3, .grid2 { grid-template-columns: 1fr; }
  .phase-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
