/* =========================================================================
   FEDERAL MINISTRY OF POWER — SECTOR INTELLIGENCE DASHBOARD
   Design language: institutional + modern + premium + serious + intelligent.
   Dark "operations centre" mode is the primary register; a full light
   register is also defined and both stay in sync via tokens.
   ========================================================================= */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

/* ---- tokens: light (default) ------------------------------------- */
:root {
  color-scheme: light;
  --bg-0: #f6f6f3;
  --bg-1: #ffffff;
  --bg-2: #eef0ea;
  --bg-raised: #ffffff;
  --border: rgba(13, 17, 13, 0.11);
  --border-strong: rgba(13, 17, 13, 0.20);
  --text-primary: #101511;
  --text-secondary: #4c5148;
  --text-muted: #7d8277;
  --accent: #0c6b3d;
  --accent-strong: #094f2d;
  --accent-soft: rgba(12, 107, 61, 0.11);
  --accent-ink: #ffffff;
  --gold: #a97417;
  --gold-soft: rgba(169, 116, 23, 0.13);
  --gridline: #e2e3dc;
  --axisline: #c6c8bf;

  --status-good: #0ca30c;
  --status-warning: #a97417;
  --status-serious: #c15a2d;
  --status-critical: #d03b3b;
  --status-good-soft: rgba(12, 163, 12, 0.12);
  --status-warning-soft: rgba(169, 116, 23, 0.13);
  --status-serious-soft: rgba(193, 90, 45, 0.13);
  --status-critical-soft: rgba(208, 59, 59, 0.12);

  --series-1: #2a78d6; --series-2: #c85a24; --series-3: #1baf7a; --series-4: #a97417;
  --series-5: #c14c78; --series-6: #007a00; --series-7: #4a3aa7; --series-8: #c23e3d;

  --shadow-sm: 0 1px 2px rgba(15, 20, 15, 0.06);
  --shadow-md: 0 6px 20px -6px rgba(15, 20, 15, 0.16);
  --radius-sm: 3px;
  --radius-md: 5px;
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --scheme-dark: 1; }
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-0: #0a0c0a; --bg-1: #131611; --bg-2: #1a1e17; --bg-raised: #171b15;
    --border: rgba(255, 255, 255, 0.09); --border-strong: rgba(255, 255, 255, 0.17);
    --text-primary: #f3f5f0; --text-secondary: #b7bdaf; --text-muted: #82877b;
    --accent: #2fbb76; --accent-strong: #59d494; --accent-soft: rgba(47, 187, 118, 0.16); --accent-ink: #06150d;
    --gold: #e3a83b; --gold-soft: rgba(227, 168, 59, 0.16);
    --gridline: #23271f; --axisline: #343a2e;
    --status-good: #0ca30c; --status-warning: #fab219; --status-serious: #ec835a; --status-critical: #e4605f;
    --status-good-soft: rgba(12, 163, 12, 0.18); --status-warning-soft: rgba(250, 178, 25, 0.16);
    --status-serious-soft: rgba(236, 131, 90, 0.16); --status-critical-soft: rgba(228, 96, 95, 0.16);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #2fa32f; --series-7: #9085e9; --series-8: #e66767;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-md: 0 10px 28px -8px rgba(0, 0, 0, 0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-0: #0a0c0a; --bg-1: #131611; --bg-2: #1a1e17; --bg-raised: #171b15;
  --border: rgba(255, 255, 255, 0.09); --border-strong: rgba(255, 255, 255, 0.17);
  --text-primary: #f3f5f0; --text-secondary: #b7bdaf; --text-muted: #82877b;
  --accent: #2fbb76; --accent-strong: #59d494; --accent-soft: rgba(47, 187, 118, 0.16); --accent-ink: #06150d;
  --gold: #e3a83b; --gold-soft: rgba(227, 168, 59, 0.16);
  --gridline: #23271f; --axisline: #343a2e;
  --status-good: #0ca30c; --status-warning: #fab219; --status-serious: #ec835a; --status-critical: #e4605f;
  --status-good-soft: rgba(12, 163, 12, 0.18); --status-warning-soft: rgba(250, 178, 25, 0.16);
  --status-serious-soft: rgba(236, 131, 90, 0.16); --status-critical-soft: rgba(228, 96, 95, 0.16);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #2fa32f; --series-7: #9085e9; --series-8: #e66767;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-md: 0 10px 28px -8px rgba(0, 0, 0, 0.55);
}

/* ---- reset / base -------------------------------------------------- */
* { box-sizing: border-box; }
body {
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-inline: 0;
}
h1, h2, h3, h4 { margin: 0; text-wrap: balance; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font-family: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
.tabular { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.mono { font-family: var(--font-mono); }

/* ---- app shell ------------------------------------------------------ */
#app { min-height: 100%; display: flex; }
.sidebar {
  width: 244px; flex: none; background: var(--bg-1); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0; overflow-y: auto;
}
.sidebar-brand { padding: 20px 18px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.brand-mark {
  width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none;
}
.brand-text .t1 { font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.brand-text .t2 { font-size: 13.5px; font-weight: 600; line-height: 1.2; }

.env-switch { padding: 12px 14px 6px; }
.env-switch-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.role-pill-btn {
  width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-2); cursor: pointer; font-size: 12.5px; display: flex; flex-direction: column; gap: 1px;
}
.role-pill-btn strong { font-size: 12.5px; font-weight: 600; }
.role-pill-btn span { color: var(--text-muted); font-size: 11px; }

/* ---- entry / identity gate ------------------------------------------ */
/* Fixed-brand identity screen: always renders in its own light register
   regardless of the app's theme setting, like a real sign-in page. */
.login-shell { display: flex; min-height: 100vh; width: 100%; background: #ffffff; flex-wrap: wrap; }
.login-left {
  flex: 1 1 420px; min-width: 320px; position: relative; overflow: hidden;
  background-color: #163d24;
  background-image: repeating-conic-gradient(from 0deg, rgba(255,255,255,0.035) 0% 25%, transparent 0% 50%);
  background-size: 44px 44px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: 60px 40px;
}
.login-left::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(9,79,45,0.18), rgba(6,21,13,0.4)); pointer-events: none; }
.login-crest { width: 108px; height: auto; margin-bottom: 22px; position: relative; z-index: 1; flex: none; border-radius: 10px; box-shadow: 0 4px 18px rgba(0,0,0,0.35); }
.login-title { font-size: 25px; font-weight: 800; letter-spacing: -0.005em; color: #ffffff; position: relative; z-index: 1; }
.login-subtitle { font-size: 11.5px; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(255,255,255,0.75); margin-top: 7px; position: relative; z-index: 1; }
.login-desc { max-width: 380px; margin: 22px auto 0; font-size: 13px; line-height: 1.65; color: rgba(255,255,255,0.82); position: relative; z-index: 1; }
.login-motto { margin-top: 28px; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.55); position: relative; z-index: 1; }

.login-right { flex: 1 1 420px; min-width: 320px; display: flex; flex-direction: column; justify-content: center; padding: 60px 56px; background: #ffffff; }
.login-right-inner { max-width: 400px; width: 100%; margin: 0 auto; }
.login-welcome { font-size: 23px; font-weight: 800; color: #141d15; }
.login-welcome-sub { font-size: 13px; color: #5b6259; margin-top: 6px; line-height: 1.5; }
.login-iam-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #8b9186; margin: 26px 0 10px; }
.login-id-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.login-id-card { border: 1px solid #dfe3dc; border-radius: 8px; padding: 24px 14px; text-align: center; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s; }
.login-id-card:hover { border-color: #0c6b3d; box-shadow: 0 2px 12px rgba(12,107,61,0.13); }
.login-id-icon { font-size: 25px; margin-bottom: 8px; }
.login-id-label { font-size: 12.5px; font-weight: 700; color: #141d15; line-height: 1.3; }
.login-back-link { font-size: 12px; color: #5b6259; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; margin-bottom: 18px; }
.login-back-link:hover { color: #0c6b3d; }
.login-note { margin-top: 24px; background: #eef7ee; border: 1px solid #d3e8d5; border-radius: 8px; padding: 13px 16px; font-size: 11.5px; line-height: 1.6; color: #2f4a34; }
.login-footer { margin-top: 26px; text-align: center; font-size: 10.5px; color: #9aa199; line-height: 1.6; }
.login-footer .sep { margin: 0 6px; }

.login-role-list { max-height: 52vh; overflow-y: auto; padding-right: 4px; margin-right: -4px; }
.login-role-card { border: 1px solid #e2e5de; border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s; background: #fff; }
.login-role-card:hover { border-color: #0c6b3d; }
.login-role-title { font-size: 12.5px; font-weight: 700; color: #141d15; }
.login-role-desc { font-size: 11px; color: #6b7268; margin-top: 2px; line-height: 1.4; }

.nav-group { padding: 10px 10px; }
.nav-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); font-weight: 600; padding: 8px 8px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-secondary); text-decoration: none; font-size: 13px; font-weight: 500; cursor: pointer;
  border-left: 2px solid transparent; margin-bottom: 1px;
}
.nav-item:hover { background: var(--bg-2); color: var(--text-primary); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-strong); border-left-color: var(--accent); font-weight: 600; }
.nav-item .ic { width: 15px; text-align: center; flex: none; opacity: 0.85; }
.sidebar-foot { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted); }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; flex: none; border-bottom: 1px solid var(--border); background: var(--bg-1);
  display: flex; align-items: center; gap: 14px; padding: 0 20px; position: sticky; top: 0; z-index: 20;
}
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; cursor: pointer; }
.breadcrumb a:hover { color: var(--accent-strong); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--text-primary); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex: none; }
.data-freshness { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.data-freshness .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--status-good); }

.icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-1);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-secondary); font-size: 13px;
}
.icon-btn:hover { background: var(--bg-2); color: var(--text-primary); }

.main { flex: 1; padding: 22px 26px 60px; max-width: 1520px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 21px; font-weight: 700; letter-spacing: -0.015em; }
.page-sub { color: var(--text-secondary); font-size: 13px; margin-top: 3px; max-width: 640px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- buttons ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-1); color: var(--text-primary); font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--bg-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-sm { padding: 5px 9px; font-size: 11.5px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-2); color: var(--text-primary); }

/* ---- cards / grids --------------------------------------------------- */
.card { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.card-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.card-sub { font-size: 11.5px; color: var(--text-muted); margin-bottom: 12px; }
.grid { display: grid; gap: 14px; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: 1.4fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1180px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---- KPI tile -------------------------------------------------------- */
.kpi-tile { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.kpi-tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; }
.kpi-value { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-value .unit { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-left: 3px; }
.kpi-delta { font-size: 11.5px; display: flex; align-items: center; gap: 5px; font-weight: 600; }
.kpi-delta.up { color: var(--status-good); }
.kpi-delta.down { color: var(--status-critical); }
.kpi-delta.flat { color: var(--text-muted); }
.kpi-context { font-size: 11px; color: var(--text-muted); }
.kpi-status { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 20px; width: fit-content; }

/* ---- pills / badges --------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; padding: 2.5px 8px; border-radius: 20px; white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.pill-good { background: var(--status-good-soft); color: var(--status-good); }
.pill-warning { background: var(--status-warning-soft); color: var(--status-warning); }
.pill-serious { background: var(--status-serious-soft); color: var(--status-serious); }
.pill-critical { background: var(--status-critical-soft); color: var(--status-critical); }
.pill-neutral { background: var(--bg-2); color: var(--text-secondary); }
:root:not([data-theme="light"]) .pill-good .dot, :root[data-theme="dark"] .pill-good .dot { background: var(--status-good); }

/* classification pills reuse status roles: Performing=good Watch=warning At Risk=serious Critical=critical */

/* ---- tables ------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
table.dt { width: 100%; border-collapse: collapse; font-size: 12.5px; background: var(--bg-1); }
table.dt th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--bg-1); }
table.dt td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
table.dt tbody tr:last-child td { border-bottom: none; }
table.dt tbody tr:hover { background: var(--bg-2); cursor: pointer; }
table.dt td.num, table.dt th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.row-link { color: var(--accent-strong); font-weight: 600; text-decoration: none; }

/* ---- breadcrumbs / section nav ---------------------------------------- */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.subnav a { padding: 9px 4px; margin-right: 18px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; cursor: pointer; }
.subnav a:hover { color: var(--text-primary); }
.subnav a.active { color: var(--accent-strong); border-bottom-color: var(--accent); }

/* ---- insight / intelligence panel -------------------------------- */
.insight-panel { background: linear-gradient(180deg, var(--accent-soft), transparent 140%); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-md); padding: 13px 15px; display: flex; gap: 10px; }
.insight-panel .ic { color: var(--accent-strong); flex: none; font-size: 15px; margin-top: 1px; }
.insight-panel .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-strong); font-weight: 700; margin-bottom: 3px; }
.insight-panel .body { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }
.insight-panel .body b { color: var(--text-primary); }

/* ---- alerts list -------------------------------------------------- */
.alert-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.alert-row:last-child { border-bottom: none; }
.alert-row:hover { background: var(--bg-2); }
.alert-badge { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex: none; }
.alert-badge.critical { background: var(--status-critical); }
.alert-badge.attention { background: var(--status-warning); }
.alert-badge.positive { background: var(--status-good); }
.alert-title { font-size: 12.5px; font-weight: 600; }
.alert-detail { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

/* ---- progress / bullet ---------------------------------------------- */
.progress-track { height: 6px; border-radius: 4px; background: var(--gridline); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: var(--accent); }

/* ---- charts shared ---------------------------------------------------- */
.chart-wrap { position: relative; }
.linechart .gridline { stroke: var(--gridline); stroke-width: 1; }
.linechart .axisline { stroke: var(--axisline); stroke-width: 1; }
.linechart .axis-label { fill: var(--text-muted); font-size: 9.5px; font-family: var(--font-mono); }
.linechart .crosshair { stroke: var(--axisline); stroke-width: 1; stroke-dasharray: 2 2; }
.linechart .hover-dot { fill: var(--bg-1); stroke: var(--accent); stroke-width: 2; }
.hover-target { cursor: crosshair; }
.chart-legend { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-secondary); }
.legend-item i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.donut-label { fill: var(--text-primary); font-size: 16px; font-weight: 700; font-family: var(--font-mono); }
.hbar-chart { display: flex; flex-direction: column; gap: 9px; }
.hbar-row { display: grid; grid-template-columns: 128px 1fr 64px; align-items: center; gap: 10px; }
.hbar-label { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 9px; background: var(--gridline); border-radius: 3px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 3px; }
.hbar-value { font-size: 11.5px; text-align: right; font-family: var(--font-mono); color: var(--text-primary); font-weight: 600; }

/* ---- financial cascade / waterfall ---------------------------------- */
.cascade { display: flex; flex-direction: column; }
.cascade-row { display: grid; grid-template-columns: 190px 1fr 130px; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.cascade-row:hover { background: var(--bg-2); }
.cascade-label { font-size: 12.5px; font-weight: 600; display: flex; flex-direction: column; }
.cascade-sub { font-size: 10.5px; color: var(--text-muted); font-weight: 500; }
.cascade-track { height: 20px; background: var(--gridline); border-radius: 4px; overflow: hidden; }
.cascade-fill { height: 100%; border-radius: 4px; }
.cascade-value { font-family: var(--font-mono); font-weight: 700; font-size: 13px; text-align: right; }
.cascade-arrow { padding: 2px 10px 2px 200px; font-size: 10.5px; color: var(--text-muted); }
.cascade-arrow span { margin-left: 6px; }

/* liquidity snapshot panel */
.liquidity-panel { display: grid; grid-template-columns: 120px 1fr; gap: 22px; align-items: center; }
.liq-gauge-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.liq-gauge-status { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 999px; }
.liq-gauge-status.critical { background: var(--status-critical-soft); color: var(--status-critical); }
.liq-gauge-status.warning { background: var(--status-warning-soft); color: var(--status-warning); }
.liq-gauge-status.good { background: var(--status-good-soft); color: var(--status-good); }
.liq-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.liq-stat { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; }
.liq-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.liq-stat-value { font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--text-primary); margin-top: 2px; }
.liq-stat-sub { font-size: 10.5px; color: var(--text-secondary); margin-top: 1px; }

/* scenario lever */
.scenario-row { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.scenario-row input[type="range"] { flex: 1; accent-color: var(--accent); height: 4px; }
.scenario-val { font-family: var(--font-mono); font-weight: 600; color: var(--accent); min-width: 52px; text-align: right; }
.scenario-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.scenario-out .liq-stat-value { font-size: 15px; }

/* agency data collection: milestones, activity feed, comments */
.mb-16 { margin-bottom: 16px; }
.milestone-list { display: flex; flex-direction: column; gap: 2px; }
.milestone-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--border); }
.milestone-item:last-child { border-bottom: none; }
.ms-dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--text-muted); background: var(--bg-1); margin-top: 2px; flex-shrink: 0; }
.ms-dot.done { border-color: var(--status-good); background: var(--status-good); }
.ms-body { flex: 1; min-width: 0; }
.ms-label { font-size: 12.5px; font-weight: 600; }
.ms-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.activity-feed { display: flex; flex-direction: column; gap: 0; max-height: 360px; overflow-y: auto; }
.activity-item { padding: 9px 2px; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-meta { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 2px; }
.activity-text { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.comment-composer textarea { width: 100%; padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-0); font-size: 12.5px; min-height: 60px; resize: vertical; font-family: inherit; }
.field-error { font-size: 11.5px; color: var(--status-critical); }

/* global hover tooltip (delegated) */
.g-tooltip { position: fixed; z-index: 999; background: var(--text-primary); color: var(--bg-1); font-size: 11.5px; padding: 6px 9px; border-radius: 4px; pointer-events: none; max-width: 260px; line-height: 1.4; box-shadow: var(--shadow-md); display: none; }
:root:not([data-theme="light"]) .g-tooltip, :root[data-theme="dark"] .g-tooltip { background: var(--bg-2); color: var(--text-primary); border: 1px solid var(--border-strong); }

/* metric-definition info icon */
.info-icon { display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--text-muted); color: var(--text-muted); font-size: 9px; font-weight: 700; font-style: italic; font-family: Georgia, "Times New Roman", serif; margin-left: 5px; cursor: help; vertical-align: middle; position: relative; top: -1px; }
.info-icon:hover, .info-icon:focus { border-color: var(--accent); color: var(--accent); outline: none; }

/* ---- breadcrumb drill path chips --------------------------------- */
.drill-path { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.drill-chip { padding: 5px 11px; border-radius: 20px; background: var(--bg-2); font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer; border: 1px solid transparent; }
.drill-chip.active { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); }
.drill-arrow { color: var(--text-muted); font-size: 11px; }

/* ---- onboarding panel ------------------------------------------------ */
.onboard { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px 20px; margin-bottom: 18px; }
.onboard-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.onboard-title { font-size: 15px; font-weight: 700; }
.onboard-sub { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 14px; max-width: 720px; }
.onboard-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
@media (max-width: 1180px) { .onboard-steps { grid-template-columns: repeat(2, 1fr); } }
.onboard-step { display: flex; flex-direction: column; gap: 4px; }
.onboard-step .num { font-family: var(--font-mono); font-size: 10.5px; color: var(--accent-strong); font-weight: 700; }
.onboard-step .t { font-size: 12.5px; font-weight: 700; }
.onboard-step .d { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }

/* ---- ministerial action / modal --------------------------------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(6, 8, 6, 0.55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--bg-1); border: 1px solid var(--border-strong); border-radius: var(--radius-md); width: 480px; max-width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.modal-head { padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.field label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-0); font-size: 13px; }
.field textarea { resize: vertical; min-height: 64px; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ---- Ask the Sector ------------------------------------------------- */
.ask-shell { display: flex; flex-direction: column; gap: 14px; }
.ask-input-row { display: flex; gap: 8px; }
.ask-input-row input { flex: 1; padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: var(--bg-1); font-size: 14px; }
.ask-suggestions { display: flex; flex-wrap: wrap; gap: 7px; }
.ask-chip { padding: 6px 12px; border-radius: 20px; background: var(--bg-1); border: 1px solid var(--border); font-size: 12px; cursor: pointer; color: var(--text-secondary); }
.ask-chip:hover { border-color: var(--accent); color: var(--accent-strong); }
.ask-answer { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.ask-answer .section { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ask-answer .section:last-child { border-bottom: none; }
.ask-answer .section h4 { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 6px; }
.ask-answer .section p { font-size: 13px; color: var(--text-primary); line-height: 1.55; }
.ask-tag { display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 4px; background: var(--bg-2); color: var(--text-secondary); margin: 2px 5px 0 0; font-family: var(--font-mono); }

/* ---- geo map ------------------------------------------------------- */
.geo-wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
@media (max-width: 1180px) { .geo-wrap { grid-template-columns: 1fr; } }
.geo-cell { fill: var(--bg-2); stroke: var(--bg-0); stroke-width: 2; cursor: pointer; transition: fill .1s; }
.geo-cell:hover { fill: var(--accent-soft); }
.geo-cell.selected { fill: var(--accent); }
.geo-legend { display: flex; gap: 12px; margin-top: 10px; font-size: 11px; color: var(--text-muted); flex-wrap:wrap; }

/* ---- executive display mode -------------------------------------- */
.exec-mode { position: fixed; inset: 0; background: var(--bg-0); z-index: 200; padding: 48px 64px 32px; display: flex; flex-direction: column; }
.exec-mode .exec-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; flex: none; }
.exec-mode .exec-title { font-size: 34px; font-weight: 700; }
.exec-mode .exec-clock { font-family: var(--font-mono); color: var(--text-muted); font-size: 16px; }
.exec-mode .exec-body { flex: 1; display: flex; align-items: center; }
.exec-mode .exec-body .grid-kpi { width: 100%; }
.exec-mode .kpi-tile { padding: 28px 26px; cursor: default; gap: 12px; }
.exec-mode .kpi-label { font-size: 13px; letter-spacing: 0.06em; }
.exec-mode .kpi-value { font-size: 46px; }
.exec-mode .kpi-value .unit { font-size: 20px; }
.exec-mode .alert-row { padding: 16px 6px; }
.exec-mode .alert-title { font-size: 17px; }
.exec-mode .alert-detail { font-size: 14px; }
.exec-mode .alert-badge { width: 10px; height: 10px; margin-top: 5px; }
.exec-progress { display: flex; gap: 5px; margin-top: 18px; flex: none; }
.exec-progress i { flex: 1; height: 3px; background: var(--gridline); border-radius: 2px; overflow: hidden; }
.exec-progress i.done { background: var(--accent); }
.exec-progress i span { display: block; height: 100%; background: var(--accent); }

/* ---- misc ----------------------------------------------------------- */
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-8 { margin-bottom: 8px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.scroll-x { overflow-x: auto; }
.section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); font-weight: 700; margin-bottom: 10px; }
.risk-dot-row { display: flex; gap: 3px; }
.risk-dot { width: 7px; height: 12px; border-radius: 1px; background: var(--gridline); }
.risk-dot.on { background: var(--status-critical); }
.data-quality-tag { font-size: 10.5px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.data-quality-tag .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--status-good); }

/* ---- Mission 300 ------------------------------------------------------ */
.crossref-note { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 9px 13px; font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; }
.crossref-note a { margin-left: 4px; font-weight: 600; white-space: nowrap; }
.pillar-card { cursor: pointer; transition: border-color .12s, transform .12s; }
.pillar-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.pillar-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.pillar-ic { font-size: 15px; flex: none; color: var(--accent-strong); }
.pillar-mini-kpi { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; padding: 5px 0; border-top: 1px solid var(--border); }
.pillar-mini-kpi span { color: var(--text-secondary); }
.pillar-mini-kpi b { font-size: 13px; }
.pillar-card-foot { margin-top: 10px; font-size: 11.5px; font-weight: 600; color: var(--accent-strong); }
@media (max-width: 1180px) { .m300-pillar-grid { grid-template-columns: 1fr; } }
@media (min-width: 1181px) and (max-width: 1440px) { .m300-pillar-grid { grid-template-columns: repeat(2, 1fr); } }

.nav-toggle { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 980px) {
  .sidebar { position: fixed; left: -244px; top: 0; bottom: 0; z-index: 60; transition: left .18s; box-shadow: var(--shadow-md); }
  .sidebar.open { left: 0; }
  .nav-toggle { display: flex; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(6, 8, 6, 0.45); z-index: 55; }
  .main { padding: 16px 14px 60px; }
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .exec-mode { padding: 24px 20px 20px; }
  .exec-mode .exec-title { font-size: 24px; }
  .exec-mode .kpi-value { font-size: 30px; }
  .cascade-row { grid-template-columns: 1fr; gap: 4px; }
  .cascade-arrow { padding-left: 0; }
  .hbar-row { grid-template-columns: 90px 1fr 54px; }
  .liquidity-panel { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .login-left { padding: 40px 28px; min-height: 260px; }
  .login-right { padding: 40px 24px; }
  .login-id-grid { grid-template-columns: 1fr; }
}

/* ---- NGIP embed (Generation tab) ------------------------------------- */
.ngip-card { margin-bottom: 16px; padding: 0; overflow: hidden; }
.ngip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ngip-head .btn { text-decoration: none; }
.ngip-sub { font-size: 12px; color: var(--text-muted); }
.ngip-frame { display: block; width: 100%; height: 75vh; min-height: 520px; border: 0; background: var(--bg-1); }

/* ---- About Platform (Ministry) --------------------------------------- */
.modal.modal-about { width: 780px; }
.about-head { position: relative; padding: 26px 28px 20px; border-bottom: 1px solid var(--border); }
.about-head h2 { font-size: 22px; margin: 0 36px 6px 0; letter-spacing: -0.01em; }
.about-head p { margin: 0; color: var(--text-muted); font-size: 13.5px; }
.about-eyebrow { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--accent-strong); margin-bottom: 8px; }
.about-x { position: absolute; top: 20px; right: 20px; }
.about-body { padding: 20px 28px 8px; }
.about-body h3 { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); font-weight: 700; margin: 0 0 10px; }
.about-body > p { font-size: 13.5px; line-height: 1.7; color: var(--text-secondary); margin: 0 0 20px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.about-grid article { padding: 16px; border-radius: var(--radius-md); background: var(--bg-2); border: 1px solid var(--border); }
.about-grid article > span { font-size: 18px; color: var(--accent-strong); }
.about-grid h4 { font-size: 13.5px; margin: 8px 0 4px; }
.about-grid p { font-size: 12px; line-height: 1.55; color: var(--text-muted); margin: 0; }
.about-coverage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.about-coverage div { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 2px; }
.about-coverage strong { font-size: 20px; font-family: var(--font-mono); color: var(--accent-strong); }
.about-coverage span { font-size: 11.5px; color: var(--text-muted); }
@media (max-width: 640px) {
  .about-head, .about-body { padding-left: 18px; padding-right: 18px; }
  .about-grid, .about-coverage { grid-template-columns: 1fr 1fr; }
  .about-head h2 { font-size: 19px; }
}
@media (max-width: 420px) { .about-grid { grid-template-columns: 1fr; } }

/* ---- Add project notice + toast -------------------------------------- */
.form-notice { font-size: 11.5px; line-height: 1.5; color: var(--text-secondary); background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 200; background: var(--text-primary); color: var(--bg-1); padding: 10px 16px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow-md); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
