/* Security & IT Executive Dashboard — v2 (Spade brand) */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "NaN SuperX Sans";
  src: url("fonts/NaNSuperXSansText-Light.woff2") format("woff2");
  font-weight: 300; font-display: swap;
}
@font-face {
  font-family: "NaN SuperX Sans";
  src: url("fonts/NaNSuperXSansText-Medium.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "NaN SuperX Sans";
  src: url("fonts/NaNSuperXSansText-Semibold.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: "NaN SuperX Sans";
  src: url("fonts/NaNSuperXSansText-Bold.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}

:root {
  /* Spade brand palette */
  --green-800: #111d0b;
  --green-700: #18280e;   /* Forest — primary dark */
  --green-600: #2d550a;
  --green-500: #3f7308;   /* Moss */
  --green-400: #7bc63e;
  --green-300: #b2eb76;   /* Lemongrass — accent */
  --green-200: #cdefa5;
  --green-100: #e4f6cc;
  --green-50:  #f3fbea;

  --sage-1: #f4faed;
  --sage-2: #f0fae6;
  --sage-3: #d8e5ca;
  --sage-4: #b3c5a0;
  --sage-5: #4a5b38;

  --black-900: #090f05;
  --black-800: #1c2417;
  --black-700: #2b3425;
  --black-500: #56604f;
  --black-400: #737d6c;
  --black-300: #99a190;

  /* Secondary (data viz) */
  --clay:   #c9753d;
  --ochre:  #aa9a33;
  --lagoon: #4fa68f;
  --sun:    #ebe46a;
  --sand:   #f2dfac;
  --stone:  #d0c4a5;
  --rock:   #a0967a;

  /* ==== Semantic — LIGHT theme (default) ==== */
  --bg:            var(--sage-1);
  --bg-elevated:   #ffffff;
  --bg-hover:      var(--sage-2);
  --bg-subtle:     #fbfdf7;
  --bg-inverse:    var(--green-700);

  --fg:            var(--green-700);
  --fg-strong:     var(--black-900);
  --fg-muted:      var(--sage-5);
  --fg-subtle:     var(--black-400);
  --fg-inverse:    #ffffff;

  --border:        var(--sage-3);
  --border-strong: var(--sage-4);
  --divider:       #e4e8e1;

  --accent:        var(--green-300);
  --accent-strong: var(--green-500);
  --accent-bg:     var(--green-50);
  --accent-fg:     var(--green-700);

  --pos:  var(--green-500);
  --pos-bg: var(--green-100);
  --warn: var(--ochre);
  --warn-bg: #fcfbea;
  --neg:  var(--clay);
  --neg-bg: #fcf0e6;
  --info: var(--lagoon);
  --info-bg: #d7efe7;

  /* Fonts */
  --font-display: "NaN SuperX Sans", "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  --font-sans:    "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(24, 40, 14, 0.04);
  --shadow-sm: 0 1px 3px rgba(24, 40, 14, 0.06), 0 1px 2px -1px rgba(24, 40, 14, 0.03);
  --shadow-md: 0 6px 16px rgba(24, 40, 14, 0.08);
  --shadow-lg: 0 12px 28px rgba(24, 40, 14, 0.12);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ==== DARK theme ==== */
[data-theme="dark"] {
  --bg:            #0a110a;
  --bg-elevated:   #111c0f;
  --bg-hover:      #17261a;
  --bg-subtle:     #0e1a0d;
  --bg-inverse:    var(--green-300);

  --fg:            #e4f0d6;
  --fg-strong:     #f4faed;
  --fg-muted:      #9db58a;
  --fg-subtle:     #6e8660;
  --fg-inverse:    var(--green-700);

  --border:        #243a20;
  --border-strong: #365733;
  --divider:       #1a2918;

  --accent-bg:     rgba(178, 235, 118, 0.08);
  --pos-bg:        rgba(178, 235, 118, 0.12);
  --warn-bg:       rgba(170, 154, 51, 0.15);
  --neg-bg:        rgba(201, 117, 61, 0.15);
  --info-bg:       rgba(79, 166, 143, 0.15);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.4);
}

/* ==== reset + base ==== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--fg-strong);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0;
}
.num, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.display {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

a { color: inherit; }

/* ==== App shell ==== */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 200ms var(--ease);
}
.app:has(.sidebar.collapsed) {
  grid-template-columns: 60px 1fr;
}

/* Sidebar */
aside.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand-row {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 18px;
}
.brand-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}
.brand-square {
  width: 32px; height: 32px;
  background: var(--green-700);
  border-radius: 8px;
  display: grid; place-items: center;
}
.brand-square svg { width: 18px; height: 18px; }
.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--fg-strong);
  letter-spacing: -0.02em;
}
.brand-tagline {
  padding: 0 20px 12px;
  font-size: 11px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.nav { flex: 1; padding: 8px 10px; }
.nav-section {
  margin: 14px 10px 6px;
  font-size: 10px;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--fg-muted);
  margin: 2px 0;
  transition: all 120ms var(--ease);
}
.nav a svg { width: 18px; height: 18px; stroke-width: 1.75; flex-shrink: 0; }
.nav a:hover { background: var(--bg-hover); color: var(--fg-strong); }
.nav a.active {
  background: var(--accent);
  color: var(--green-700);
  font-weight: 600;
}
.nav a .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
}
.nav a.active .count { color: var(--green-700); opacity: 0.7; }

/* Sidebar collapse */
.sidebar { transition: width 200ms var(--ease); }
.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .nav a { justify-content: center; padding: 9px; }
.sidebar.collapsed .nav a svg { margin: 0; }
.sidebar.collapsed .brand-row { flex-direction: column; align-items: center; padding: 14px 6px 10px; gap: 6px; }
.sidebar.collapsed .brand-logo { width: 28px; height: 28px; }
.sidebar-toggle {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--fg-muted); border-radius: 4px; margin-left: auto;
  display: flex; align-items: center; justify-content: center;
  transition: background 120ms var(--ease);
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--fg-strong); }
.sidebar.collapsed .sidebar-toggle { margin: 0 auto; }

.sidebar-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  color: var(--fg-muted);
}
.sidebar.collapsed .sidebar-foot { padding: 14px 0; }
.avatar {
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--sage-3);
  display: grid; place-items: center;
  color: var(--fg);
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}

/* ==== Topbar ==== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(8px);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.breadcrumb {
  color: var(--fg-muted);
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.breadcrumb .sep { color: var(--fg-subtle); }
.breadcrumb .cur { color: var(--fg-strong); font-weight: 500; }

.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 13px; }

.period-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  background: var(--bg-elevated);
}
.period-switch button {
  background: transparent; border: none; color: var(--fg-muted);
  padding: 5px 12px; font-size: 12px; cursor: pointer;
  font-family: inherit; font-weight: 500;
  border-radius: 6px;
  transition: all 120ms var(--ease);
}
.period-switch button.active {
  background: var(--green-700); color: var(--fg-inverse);
}

.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 12px;
  color: var(--fg-muted);
}
.live-pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-strong);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }

.btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg);
  padding: 7px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 120ms var(--ease);
}
.btn:hover { background: var(--bg-hover); }
.btn.primary {
  background: var(--green-700); color: var(--fg-inverse); border-color: var(--green-700);
}
.btn.primary:hover { background: var(--black-900); }
.btn.accent {
  background: var(--accent); color: var(--green-700); border-color: var(--accent);
}
.btn svg { width: 14px; height: 14px; }

/* ==== Main ==== */
.main {
  padding: 32px 40px 80px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.page-hdr {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 24px;
  gap: 32px;
}
.page-hdr h1 { font-size: 30px; font-weight: 700; }
.page-hdr .sub { margin-top: 6px; color: var(--fg-muted); font-size: 14px; }
.page-hdr .sub b { color: var(--fg); font-weight: 500; }

/* ==== Section ==== */
.section { margin-top: 40px; }
.section:first-of-type { margin-top: 0; }

.section-hdr {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  display: flex; align-items: baseline; gap: 16px;
}
.section-title .idx {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-subtle);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.section-title h2 {
  font-size: 22px; font-weight: 700;
}
.section-title .note {
  color: var(--fg-muted);
  font-size: 13px;
}
.section-actions { display: flex; align-items: center; gap: 10px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--fg);
  font-weight: 500;
}
.chip.ok { background: var(--pos-bg); border-color: transparent; color: var(--pos); }
.chip.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.chip.neg { background: var(--neg-bg); border-color: transparent; color: var(--neg); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ==== Card ==== */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-pad { padding: 22px; }
.card-head {
  padding: 16px 20px;
  display: flex; align-items: flex-start; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.card-head-plain {
  padding: 20px 22px 14px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-strong);
  letter-spacing: -0.01em;
}
.card-sub {
  color: var(--fg-muted);
  font-size: 12px;
  margin-top: 3px;
}
.caps {
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Source badge — distinctive and trustworthy */
.source {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-subtle);
  white-space: nowrap;
}
.source::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-strong);
  flex-shrink: 0;
}

/* ==== Hero / Program Impact ==== */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.hero-card { position: relative; padding: 20px; min-width: 0; overflow: hidden; }
.hero-card .hero-value { flex-wrap: wrap; }
.hero-card .hero-sub { word-wrap: break-word; overflow-wrap: break-word; }
.hero-card.primary {
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-800) 100%);
  color: var(--fg-inverse);
  border-color: var(--green-700);
}
.hero-card.primary .caps { color: rgba(255,255,255,0.65); }
.hero-card.primary .hero-value { color: var(--accent); }
.hero-card.primary .hero-sub { color: rgba(255,255,255,0.75); }
.hero-card.primary .hero-sub b { color: #fff; }
.hero-card.primary .delta { background: rgba(178,235,118,0.15); color: var(--accent); }
.hero-card.primary .source { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); color: rgba(255,255,255,0.7); }

.hero-row-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; min-width: 0; }
.hero-row-top .caps { flex-shrink: 1; min-width: 0; }
.hero-row-top .source { white-space: normal; line-height: 1.3; max-width: 120px; text-align: right; flex-shrink: 0; font-size: 9px; }
.hero-value {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-top: 14px;
  color: var(--fg-strong);
  display: flex; align-items: baseline; gap: 6px;
  font-variant-numeric: tabular-nums;
}
.hero-value.md { font-size: 34px; }
.hero-value .unit { font-size: 18px; color: var(--fg-muted); font-weight: 400; }
.delta {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--pos-bg);
  color: var(--pos);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
  white-space: nowrap;
}
.delta.neg { background: var(--neg-bg); color: var(--neg); }
.delta.flat { background: var(--bg-hover); color: var(--fg-muted); }
.hero-sub {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--fg-muted);
  line-height: 1.5;
}
.hero-sub b { color: var(--fg); font-weight: 500; }
.hero-spark { margin-top: 14px; height: 32px; }

/* ==== KPI row ==== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.kpi { padding: 20px 22px; }
.kpi-value {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.025em;
  font-size: 36px;
  line-height: 1;
  color: var(--fg-strong);
  margin-top: 10px;
  display: flex; align-items: baseline; gap: 6px;
  font-variant-numeric: tabular-nums;
}
.kpi-value .unit { font-size: 16px; color: var(--fg-muted); font-weight: 400; }
.kpi-sub { font-size: 12.5px; color: var(--fg-muted); margin-top: 10px; line-height: 1.5; }
.kpi-sub b { color: var(--fg); font-weight: 500; }

/* ==== Framework rows ==== */
.fw-row {
  display: grid;
  grid-template-columns: 150px 1fr 60px 130px;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.fw-row:last-child { border-bottom: none; }
.fw-name { font-weight: 500; color: var(--fg-strong); display: flex; align-items: center; gap: 8px; }
.fw-name .badge {
  font-size: 10px; padding: 1px 6px; border-radius: 4px;
  background: var(--bg-hover); color: var(--fg-muted); font-weight: 500;
  font-family: var(--font-mono);
}
.fw-bar {
  position: relative; height: 6px;
  background: var(--bg-hover);
  border-radius: 999px; overflow: hidden;
}
.fw-fill {
  height: 100%;
  background: var(--accent-strong);
  border-radius: 999px;
  transition: width 0.6s var(--ease);
}
.fw-fill.warn { background: var(--ochre); }
.fw-fill.neg { background: var(--clay); }
.fw-target {
  position: absolute; top: -2px; bottom: -2px; width: 2px;
  background: var(--fg-subtle);
  opacity: 0.4;
}
.fw-pct { text-align: right; font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--fg-strong); }
.fw-meta { text-align: right; color: var(--fg-muted); font-size: 11px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ==== Pipeline table ==== */
.pipe-row {
  display: grid;
  grid-template-columns: 18px 1.4fr 110px 1fr 100px 80px;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 120ms var(--ease);
}
.pipe-row:hover { background: var(--bg-hover); }
.pipe-row:last-child { border-bottom: none; }
.pipe-chev {
  color: var(--fg-subtle); transition: transform 0.2s;
  font-family: var(--font-mono); font-size: 14px;
}
.pipe-row.open .pipe-chev { transform: rotate(90deg); color: var(--accent-strong); }
.pipe-name { font-weight: 500; color: var(--fg-strong); }
.pipe-name .seats { font-weight: 400; color: var(--fg-muted); font-size: 11px; display: block; margin-top: 2px; }
.pipe-value {
  font-family: var(--font-display); font-weight: 500;
  color: var(--fg-strong);
  font-variant-numeric: tabular-nums; font-size: 16px;
}
.pipe-stages {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px;
}
.pipe-stage {
  height: 3px; border-radius: 99px; background: var(--border);
}
.pipe-stage.done { background: var(--green-400); }
.pipe-stage.current { background: var(--accent-strong); }
.pipe-stage-label {
  margin-top: 4px; font-size: 10px; color: var(--fg-muted); font-family: var(--font-mono);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.pipe-eta { color: var(--fg-muted); font-size: 12px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pipe-risk {
  text-align: right; font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 999px;
  display: inline-block;
}
.pipe-risk.low { background: var(--pos-bg); color: var(--pos); }
.pipe-risk.med { background: var(--warn-bg); color: var(--warn); }
.pipe-risk.high { background: var(--neg-bg); color: var(--neg); }

.pipe-detail {
  padding: 16px 22px 20px 56px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.pipe-detail .k { color: var(--fg-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; margin-bottom: 4px; }
.pipe-detail .v { color: var(--fg-strong); font-size: 13px; font-weight: 500; }

/* ==== Exposure ==== */
.exp-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}
.exp-sum-cell {
  padding: 20px 22px;
  border-right: 1px solid var(--border);
}
.exp-sum-cell:last-child { border-right: none; }
.exp-sum-v {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 500;
  letter-spacing: -0.025em;
  margin-top: 8px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 4px;
}
.exp-sum-v .unit { font-size: 16px; color: var(--fg-muted); }
.exp-sum-v.inherent { color: var(--clay); }
.exp-sum-v.reduced { color: var(--pos); }
.exp-sum-v.residual { color: var(--fg-strong); }
.exp-sum-s { font-size: 12px; color: var(--fg-muted); margin-top: 8px; }
.exp-sum-s b { color: var(--fg); font-weight: 500; }

.exp-table-head, .exp-table-row {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr 1fr 0.9fr;
  gap: 12px;
  align-items: center;
  padding: 12px 22px;
  font-size: 13px;
}
.exp-table-head {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-muted); font-weight: 500;
  border-bottom: 1px solid var(--border);
  padding: 12px 22px;
}
.exp-table-head > *:not(:first-child), .exp-table-row > *:not(:first-child) { text-align: right; }
.exp-table-row { border-bottom: 1px solid var(--border); }
.exp-table-row:last-child { border-bottom: none; }
.exp-table-row.total {
  background: var(--bg-subtle);
  font-weight: 500;
  border-top: 2px solid var(--border-strong);
}
.exp-scenario-name { color: var(--fg-strong); font-weight: 500; }
.exp-scenario-desc { color: var(--fg-muted); font-size: 11px; margin-top: 2px; font-weight: 400; }
.exp-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.exp-num.residual { color: var(--accent-strong); font-weight: 600; }
.exp-num.dim { color: var(--fg-muted); }
.exp-bar-inline {
  display: inline-block; height: 5px;
  background: linear-gradient(90deg, #e6a47d, var(--clay));
  border-radius: 99px; margin-right: 8px;
  vertical-align: middle;
}

/* Waterfall */
.wf { padding: 6px 22px 20px; }
.wf-row {
  display: grid;
  grid-template-columns: 110px 1fr 90px;
  align-items: center;
  gap: 16px;
  height: 36px;
  font-size: 12.5px;
}
.wf-label { color: var(--fg); font-weight: 500; }
.wf-label.total { color: var(--fg-strong); font-weight: 600; }
.wf-track {
  position: relative; height: 18px;
  background: var(--bg-subtle); border-radius: 3px;
  border: 1px solid var(--border);
}
.wf-bar {
  position: absolute; top: 2px; bottom: 2px;
  border-radius: 2px;
  transition: width 0.6s var(--ease);
}
.wf-value { text-align: right; font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--fg-strong); }

/* Response KPI */
.resp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.resp-cell {
  padding: 22px;
  border-right: 1px solid var(--border);
  display: grid; grid-template-columns: 80px 1fr; gap: 18px; align-items: center;
}
.resp-cell:last-child { border-right: none; }
.resp-val {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg-strong);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.resp-val .unit { font-size: 15px; color: var(--fg-muted); margin-left: 4px; }
.resp-label {
  font-size: 11px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.resp-desc { font-size: 11.5px; color: var(--fg-muted); margin-top: 4px; }
.resp-target {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--pos);
  margin-top: 6px; font-family: var(--font-mono); font-weight: 500;
}
.resp-target.warn { color: var(--warn); }

/* Savings bars */
.sv-row {
  display: grid;
  grid-template-columns: 220px 1fr 70px 90px;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  font-size: 13px;
}
.sv-name { color: var(--fg-strong); font-weight: 500; font-size: 13px; }
.sv-name .src { font-size: 10px; color: var(--fg-muted); font-weight: 400; display: block; margin-top: 2px; font-family: var(--font-mono); }
.sv-bar { position: relative; height: 18px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.sv-fill { position: absolute; top: 0; bottom: 0; left: 0; background: linear-gradient(90deg, var(--green-400), var(--accent-strong)); border-radius: 3px; transition: width 0.6s var(--ease); }
.sv-val { text-align: right; font-family: var(--font-display); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--fg-strong); font-size: 14px; }
.sv-sub { text-align: right; color: var(--fg-muted); font-size: 11px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Benchmark strip */
.bm {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--fg-muted);
}
.bm b { color: var(--fg); font-weight: 500; }
.bm .tag {
  background: var(--accent-bg); color: var(--accent-strong);
  padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 600;
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em;
}

/* Footer */
footer {
  padding: 24px 40px;
  border-top: 1px solid var(--border);
  max-width: 1600px; margin: 40px auto 0;
  display: flex; justify-content: space-between;
  color: var(--fg-subtle); font-size: 11px;
  font-family: var(--font-mono);
}
footer a { color: var(--accent-strong); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Roadmap table — all columns left-aligned */
.roadmap-head, .roadmap-row {
  display: grid;
  grid-template-columns: 60px 2fr 100px 90px 1fr 130px 100px;
  gap: 12px;
  align-items: center;
  padding: 12px 22px;
  font-size: 13px;
  text-align: left;
}
.roadmap-head {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-muted); font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.roadmap-row {
  border-bottom: 1px solid var(--border);
}
.roadmap-row:last-child { border-bottom: none; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.grid-exp { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Tweaks panel */
.tweaks {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 300px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 18px;
  z-index: 1000;
  font-size: 12.5px;
}
.tweaks-hdr {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.tweaks-hdr h4 { font-size: 13px; }
.tweaks-sub { color: var(--fg-subtle); font-size: 10px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.tw-group { margin-bottom: 14px; }
.tw-group .caps { margin-bottom: 6px; display: block; font-size: 10px; }
.tw-options { display: flex; gap: 6px; }
.tw-opt {
  flex: 1; padding: 7px 0;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  cursor: pointer;
  font-size: 11.5px; font-family: inherit;
  color: var(--fg);
  text-align: center;
  font-weight: 500;
  transition: all 120ms var(--ease);
}
.tw-opt.active { background: var(--accent); border-color: var(--accent); color: var(--green-700); }
.tw-swatch {
  width: 28px; height: 28px; border-radius: 6px;
  cursor: pointer; border: 2px solid var(--border);
  transition: all 120ms var(--ease);
}
.tw-swatch.active { border-color: var(--fg-strong); box-shadow: 0 0 0 2px var(--bg-elevated) inset; }
