/* Commercial Safe — design tokens · v2.0 (real-app polish) */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* === Surface system — cool neutral, app-grade =========================== */
  --bg:             #F5F7FB;   /* page background — pale cool blue-grey */
  --surface:        #FFFFFF;   /* card / raised surface */
  --surface-soft:   #F9FAFC;   /* hover, inset, sidebar */
  --surface-warm:   #FBF9F4;   /* warm card variant for editorial moments */
  --surface-dark:   #0F1A2E;   /* dark surface (login hero, status card) */
  --surface-deeper: #0A1322;   /* deepest dark */

  /* === Borders ============================================================ */
  --border:         #D8DDE7;
  --border-soft:    #E8ECF2;
  --border-strong:  #BFC6D2;

  /* === Ink ================================================================ */
  --ink:            #0F1A2E;
  --ink-soft:       #475467;
  --ink-faint:      #98A2B3;
  --ink-mute:       #B7BFCC;

  /* === Brand ============================================================== */
  --navy:           #1E3A8A;
  --navy-deep:      #1E2A56;
  --navy-darker:    #14213F;
  --navy-soft:      #3756B0;
  --navy-tint:      #DCE3F2;

  /* === Status ============================================================= */
  --success:        #047857;
  --success-soft:   #D1FAE5;
  --success-line:   #A7F3D0;
  --warning:        #B45309;
  --warning-soft:   #FEF3C7;
  --warning-line:   #FDE68A;
  --danger:         #B91C1C;
  --danger-deep:    #7F1D1D;
  --danger-soft:    #FEE2E2;
  --danger-line:    #FECACA;

  /* === Premium accent ===================================================== */
  --gold:           #B89460;
  --gold-soft:      #F2EDE0;
  --gold-line:      rgba(184,148,93,0.35);
  --gold-veil:      rgba(184,148,93,0.10);

  /* === Legacy aliases — keep existing classes working ===================== */
  --bone:           var(--surface);
  --bone-soft:      var(--surface-soft);
  --linen:          var(--border-soft);
  --rule:           var(--border);
  --rule-soft:      var(--border-soft);
  --rule-faint:     var(--border-soft);
  --moss:           var(--navy);
  --moss-deep:      var(--surface-dark);
  --moss-shadow:    var(--surface-deeper);
  --leaf:           var(--success);
  --champagne:      var(--gold);
  --champagne-soft: var(--gold-soft);
  --champagne-veil: var(--gold-veil);
  --champagne-line: var(--gold-line);
  --ochre:          var(--warning);
  --ochre-soft:     var(--warning-line);
  --burgundy:       var(--danger);
  --burgundy-deep:  var(--danger-deep);
  --burgundy-soft:  var(--danger-line);
  --sapphire:       var(--navy-soft);

  /* === Typography ========================================================= */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* === Elevation — subtle, layered ======================================== */
  --shadow-xs:    0 1px 2px rgba(15,26,46,0.04);
  --shadow-sm:    0 1px 2px rgba(15,26,46,0.05), 0 1px 3px rgba(15,26,46,0.06);
  --shadow-md:    0 2px 4px rgba(15,26,46,0.05), 0 4px 12px rgba(15,26,46,0.08);
  --shadow-lg:    0 8px 24px rgba(15,26,46,0.10), 0 2px 6px rgba(15,26,46,0.06);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.06);

  /* === Radii ============================================================== */
  --r-sm: 4px;
  --r:    6px;
  --r-md: 8px;
  --r-lg: 12px;

  /* foil compatibility */
  --foil-card:  var(--shadow-xs);
  --foil-edge:  var(--shadow-sm);
  --foil-dark:  inset 0 1px 0 rgba(220,198,143,0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'tnum';
  letter-spacing: -0.005em;
}

/* No more decorative grain — clean app surface */
body::before { display: none; }

/* === Typography ============================================================ */

h1, h2, h3, h4 {
  font-family: var(--font-body);
  color: var(--ink);
  letter-spacing: -0.022em;
}
h1 {
  font-size: 28px; line-height: 1.15; font-weight: 600;
  letter-spacing: -0.028em;
}
h2 {
  font-size: 20px; line-height: 1.25; font-weight: 600;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 16px; line-height: 1.3; font-weight: 600;
}
h4 {
  font-size: 12px; line-height: 1.3; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint);
}

/* Editorial display variants — used sparingly for hero / audit moments */
.h1-display, .display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.03em; }

.eyebrow {
  font-family: var(--font-body); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 600;
}
.eyebrow--gold { color: var(--gold); }
.mono { font-family: var(--font-mono); font-feature-settings: 'tnum', 'zero'; letter-spacing: -0.01em; }
.figure {
  font-family: var(--font-mono); font-weight: 500;
  font-feature-settings: 'tnum'; letter-spacing: -0.025em;
}
.serif-num {
  font-family: var(--font-display); font-weight: 400;
  font-feature-settings: 'lnum', 'tnum'; letter-spacing: -0.04em;
}

/* === Layout primitives ==================================================== */

.shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.shell--sidebar { grid-template-columns: 240px 1fr; grid-template-rows: auto 1fr; }

.topbar {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  z-index: 20;
}

.brand { display: flex; align-items: baseline; gap: 8px; }
.brand__mark {
  font-family: var(--font-body);
  font-size: 16px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--navy);
}
.brand__sub {
  font-family: var(--font-body);
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint); padding-bottom: 1px; font-weight: 500;
}
.brand__rule { display: none; } /* no more inline rule */

/* Sidebar */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 16px 0;
  background: var(--surface-soft);
}
.sidebar__heading {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint); padding: 16px 20px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px;
  margin: 1px 8px;
  font-size: 13px; color: var(--ink-soft);
  border-radius: var(--r);
  cursor: pointer; font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
  border-left: none;
  text-decoration: none;
}
.nav-item:hover { background: var(--border-soft); color: var(--ink); }
.nav-item--active {
  background: var(--navy-tint); color: var(--navy);
  font-weight: 600;
}
.nav-item--active::after { display: none; }
.nav-item--active .nav-item__ico { color: var(--navy); }
.nav-item__count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.nav-item--alert .nav-item__count { color: var(--danger); font-weight: 600; }

.main { padding: 24px 32px 48px; max-width: none; }
.main--wide { max-width: none; }
.main--narrow { max-width: 1080px; margin: 0 auto; }

/* === Page head ============================================================ */

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 0;
  border-bottom: none;
  gap: 24px; flex-wrap: wrap;
}
.page-head::after { display: none; }
.page-head__title { display: flex; flex-direction: column; gap: 4px; }
.page-head__date {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint);
}

/* === Card — proper raised surface with shadow ============================= */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.card::before { display: none; }
.card--inset {
  background: var(--surface-soft);
  box-shadow: none;
}
.card__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
  gap: 16px;
}
.card__title { font-family: var(--font-body); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card__meta {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint);
  letter-spacing: 0.04em; text-transform: uppercase;
}

/* === Stat tile — Inter bold, refined ====================================== */

.stat {
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  position: relative;
}
.stat::before { display: none; }
.stat__label {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 8px; font-weight: 600;
}
.stat__value {
  font-family: var(--font-body); font-size: 28px; font-weight: 600;
  line-height: 1.1; color: var(--ink);
  letter-spacing: -0.025em;
  font-feature-settings: 'tnum';
}
.stat__value--mono {
  font-family: var(--font-mono); font-size: 24px; font-weight: 600;
  letter-spacing: -0.04em;
}
.stat__value--display {
  font-family: var(--font-display); font-size: 36px; font-weight: 400;
  letter-spacing: -0.04em;
}
.stat__delta { font-family: var(--font-body); font-size: 12px; margin-top: 6px; color: var(--ink-soft); }
.stat__delta--up { color: var(--success); }
.stat__delta--down { color: var(--danger); }

/* === Status indicators ==================================================== */

.tick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border: 1.5px solid var(--success); color: var(--success);
  border-radius: 50%; background: var(--success-soft);
  font-size: 11px; font-weight: 600;
}
.diamond {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  background: var(--danger); color: var(--surface);
  transform: rotate(45deg); border-radius: 3px;
  font-size: 0;
}
.diamond::after { content: ''; width: 5px; height: 5px; background: var(--surface); border-radius: 1px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--green { background: var(--success); }
.dot--ochre { background: var(--warning); }
.dot--red { background: var(--danger); }

/* === Tags · pills ========================================================= */

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-body); font-size: 11px; font-weight: 500;
  letter-spacing: 0; text-transform: none;
  padding: 2px 8px; border: 1px solid var(--border-strong); color: var(--ink-soft);
  background: var(--surface-soft);
  border-radius: var(--r-sm);
  line-height: 1.5;
}
.tag--green { color: var(--success); border-color: var(--success-line); background: var(--success-soft); }
.tag--ochre { color: var(--warning); border-color: var(--warning-line); background: var(--warning-soft); }
.tag--red   { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.tag--gold  { color: var(--gold); border-color: var(--gold-line); background: var(--gold-veil); }

/* === Buttons — refined, with subtle shadow ================================ */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  padding: 8px 14px; border: 1px solid var(--ink); background: var(--ink); color: var(--surface);
  border-radius: var(--r);
  cursor: pointer; letter-spacing: -0.005em;
  transition: all 0.12s ease;
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--navy-darker); border-color: var(--navy-darker); box-shadow: var(--shadow-sm); }
.btn--moss {
  background: var(--navy); border-color: var(--navy); color: var(--surface);
}
.btn--moss:hover { background: var(--navy-deep); border-color: var(--navy-deep); }
.btn--ghost {
  background: var(--surface); color: var(--ink); border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn--ghost:hover { background: var(--surface-soft); border-color: var(--ink-soft); }
.btn--danger {
  background: var(--surface); border-color: var(--danger); color: var(--danger);
  box-shadow: var(--shadow-xs);
}
.btn--danger:hover { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn--danger-solid {
  background: var(--danger); border-color: var(--danger); color: var(--surface);
}
.btn--lg { padding: 10px 18px; font-size: 14px; }
.btn--xl { padding: 12px 20px; font-size: 14px; width: 100%; justify-content: center; }
.btn__hint {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em;
  opacity: 0.7; margin-left: auto;
}
.btn--with-ico { gap: 6px; }
.btn--with-ico svg { color: currentColor; }

/* === Inputs — body font, refined ========================================== */

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field__label {
  font-size: 11px; letter-spacing: 0; text-transform: none;
  color: var(--ink-soft); font-weight: 500;
}
.field__input {
  font-family: var(--font-body); font-size: 14px;
  padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink);
  border-radius: var(--r);
  outline: none; transition: border-color 0.12s, box-shadow 0.12s;
  letter-spacing: -0.005em;
}
.field__input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30,58,138,0.12); }

/* === Tables =============================================================== */

.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11px; letter-spacing: 0; text-transform: none;
  color: var(--ink-faint); font-weight: 600;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}
.tbl th:first-child { border-top-left-radius: var(--r-md); }
.tbl th:last-child { border-top-right-radius: var(--r-md); }
.tbl td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px; color: var(--ink);
}
.tbl td.figure { font-family: var(--font-mono); font-size: 12px; }
.tbl tr:hover td { background: var(--surface-soft); }
.tbl tbody tr:last-child td:first-child { border-bottom-left-radius: var(--r-md); }
.tbl tbody tr:last-child td:last-child { border-bottom-right-radius: var(--r-md); }

/* Wrap tables in surface for app-card feel */
table.tbl { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-xs); overflow: hidden; }

/* === Grid helpers ========================================================= */

.row { display: grid; gap: 14px; }
.row--6 { grid-template-columns: repeat(6, 1fr); }
.row--4 { grid-template-columns: repeat(4, 1fr); }
.row--3 { grid-template-columns: repeat(3, 1fr); }
.row--2 { grid-template-columns: 1fr 1fr; }
.row--asym { grid-template-columns: 2fr 1fr; }

/* === Utility ============================================================== */

.hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.hr-soft { border: none; border-top: 1px solid var(--border-soft); margin: 14px 0; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.center { text-align: center; }

/* page reveal */
@keyframes lift { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.lift { animation: lift 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }
.lift:nth-child(2) { animation-delay: 0.04s; }
.lift:nth-child(3) { animation-delay: 0.08s; }
.lift:nth-child(4) { animation-delay: 0.12s; }
.lift:nth-child(5) { animation-delay: 0.16s; }

/* === Foil seal — kept for editorial moments =============================== */

.seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 50%;
  font-family: var(--font-display); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--gold-soft);
  font-weight: 500;
}

/* === Injected fixed sidebar =============================================== */

.sidebar--fixed {
  position: fixed; left: 0; top: 0; bottom: 0; width: 240px;
  border-right: 1px solid var(--border); background: var(--surface-soft);
  overflow-y: auto; padding: 0 0 16px; z-index: 30;
  display: flex; flex-direction: column;
}
body.cs-with-rail { padding-left: 240px; }
body.cs-with-rail .topbar { padding-left: 16px; }

/* sidebar brand block */
.sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  text-decoration: none;
  background: var(--surface);
}
.sidebar__brand-mark {
  width: 28px; height: 28px;
  background: var(--navy); color: var(--surface);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  letter-spacing: 0;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.sidebar__brand-name { font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--ink); letter-spacing: -0.01em; }
.sidebar__brand-sub { font-family: var(--font-body); font-size: 10px; color: var(--ink-faint); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }

.sidebar__role {
  margin: 4px 16px 14px;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
  padding-bottom: 12px; padding-left: 6px;
  border-bottom: 1px solid var(--border-soft);
}
.sidebar__role::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
  margin-right: 8px; vertical-align: middle;
  box-shadow: 0 0 0 2px var(--gold-veil);
}
.sidebar__role::after { display: none; }
.sidebar__foot {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-soft);
}

.nav-item__ico { color: var(--ink-faint); flex-shrink: 0; }
.nav-item:hover .nav-item__ico { color: var(--ink); }
.nav-item__label { flex: 1; display: flex; align-items: center; gap: 10px; }

/* === Breadcrumb (auto-injected) =========================================== */

.cs-crumb {
  font-family: var(--font-body); font-size: 12px; letter-spacing: 0;
  text-transform: none; color: var(--ink-faint); margin-bottom: 14px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.cs-crumb a { color: var(--ink-soft); text-decoration: none; }
.cs-crumb a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.cs-crumb__sep { color: var(--ink-mute); }
.cs-crumb__current { color: var(--ink); font-weight: 500; }

/* === Page-map helper ====================================================== */

.mock-nav {
  position: fixed; bottom: 16px; right: 16px; z-index: 999;
  background: var(--ink); color: var(--surface);
  padding: 8px 14px; font-family: var(--font-body); font-size: 11px;
  font-weight: 500; letter-spacing: 0;
  border: none; border-radius: var(--r-md); cursor: pointer;
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.mock-nav:hover { background: var(--navy-deep); }
.mock-nav__panel {
  position: fixed; bottom: 60px; right: 16px; z-index: 999;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md);
  width: 300px; padding: 14px; display: none;
  box-shadow: var(--shadow-lg);
  max-height: 70vh; overflow-y: auto;
}
.mock-nav__panel--open { display: block; }
.mock-nav__panel h5 {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); margin: 10px 0 4px; font-weight: 600;
}
.mock-nav__panel a {
  display: block; padding: 5px 8px; font-size: 12px;
  color: var(--ink-soft); text-decoration: none; font-weight: 500;
  border-radius: var(--r-sm);
}
.mock-nav__panel a:hover { color: var(--navy); background: var(--surface-soft); }
.mock-nav__panel a.is-current { color: var(--navy); font-weight: 600; }
.mock-nav__versions { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.mock-nav__versions a {
  padding: 6px 10px; font-size: 11px; border: 1px solid var(--rule);
  border-radius: var(--r-sm); background: var(--surface-soft);
}
.mock-nav__versions a.is-current {
  background: var(--navy); color: #fff; border-color: var(--navy);
}

/* === Icons ================================================================ */

.ico {
  width: 1em; height: 1em;
  flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.15em;
  display: inline-block;
}
.ico--sm { width: 14px; height: 14px; stroke-width: 1.6; }
.ico--md { width: 16px; height: 16px; stroke-width: 1.5; }
.ico--lg { width: 20px; height: 20px; stroke-width: 1.5; }
.ico--xl { width: 32px; height: 32px; stroke-width: 1.4; }

/* === Anchor reset ========================================================= */

a { color: inherit; text-decoration: none; }
a.lnk, a:not([class]) { color: var(--navy); text-decoration: none; font-weight: 500; }
a.lnk:hover, a:not([class]):hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--navy-soft); }

/* === Responsive =========================================================== */

@media (max-width: 1024px) {
  .main { padding: 18px 20px 40px; }
  .topbar { padding: 10px 16px; }

  .shell--sidebar { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .sidebar, .sidebar--fixed {
    position: relative; top: 0; width: 100%; height: auto;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 6px 12px; display: flex; gap: 4px; overflow-x: auto;
    flex-wrap: nowrap; white-space: nowrap;
  }
  body.cs-with-rail { padding-left: 0; }
  .sidebar__role, .sidebar__heading, .sidebar__foot { display: none; }
  .nav-item { padding: 7px 12px; flex-shrink: 0; gap: 6px; margin: 0; }

  .row--6 { grid-template-columns: repeat(3, 1fr); }
  .row--4 { grid-template-columns: repeat(2, 1fr); }
  .row--asym { grid-template-columns: 1fr; }
  .row--3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .main { padding: 14px 14px 32px; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; gap: 8px; }

  .row--6 { grid-template-columns: repeat(2, 1fr); }
  .row--4 { grid-template-columns: 1fr 1fr; }
  .row--3 { grid-template-columns: 1fr; }
  .row--2 { grid-template-columns: 1fr; }

  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-head > div:last-child { width: 100%; }

  h1 { font-size: 22px; }
  h2 { font-size: 18px; }

  .card { padding: 14px 16px; }
  .stat { padding: 12px 14px; }
  .stat__value { font-size: 24px; }

  .tabs { overflow-x: auto; gap: 16px; padding-bottom: 4px; }
  .tab { white-space: nowrap; flex-shrink: 0; }

  table.tbl thead { display: none; }
  table.tbl, table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
  table.tbl tr { border: 1px solid var(--border); margin-bottom: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); }
  table.tbl td { border: none; padding: 4px 0; font-size: 12px; }
  table.tbl td::before {
    content: attr(data-label);
    display: inline-block; min-width: 100px;
    font-size: 11px; color: var(--ink-faint); font-weight: 500;
    margin-right: 8px;
  }

  body[data-page="login"] { grid-template-columns: 1fr !important; }
  .hero { padding: 32px 24px !important; }
  .form-side { padding: 32px 24px !important; }

  .ai-shell { grid-template-columns: 1fr !important; }
  .ai-side, .ai-context { display: none; }

  .layout { grid-template-columns: 1fr !important; }
  .pane--right { border-left: none; border-top: 1px solid var(--border); }
  .pane { padding: 24px 20px !important; }

  .evac-main { grid-template-columns: 1fr !important; }
  .evac-strip { grid-template-columns: repeat(2, 1fr) !important; }
  .control-pane { border-left: none !important; border-top: 1px solid var(--border); }

  .summary-row { grid-template-columns: repeat(2, 1fr) !important; }
}

/* === v2 shell ================================================================ */
.v2-side {
  position: fixed; top: 0; left: 0; bottom: 0; width: 240px;
  background: var(--ink); color: #cfd6e3;
  padding: 22px 14px 14px; overflow-y: auto;
  font-family: var(--font-sans);
  z-index: 50;
  display: flex; flex-direction: column;
}
.v2-side__brand {
  display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px;
  color: #fff; text-decoration: none; margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.v2-side__mark {
  width: 30px; height: 30px; border-radius: 6px; background: var(--navy);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: #fff;
}
.v2-side__brand b { display: block; font-size: 13px; color: #fff; font-weight: 600; }
.v2-side__brand i { display: block; font-size: 10px; color: #95a0b5; font-style: normal;
  text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }
.v2-side h6 {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600; color: #6c7790; margin: 18px 8px 6px;
}
.v2-side__item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; margin: 1px 0;
  border-radius: 5px; color: #cfd6e3; text-decoration: none;
  font-size: 13px; font-weight: 500;
}
.v2-side__item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.v2-side__item.is-current { background: var(--navy); color: #fff; }
.v2-side__icon { font-size: 11px; opacity: 0.7; width: 14px; display: inline-block; }
body.has-v2-side { padding-left: 240px; }
body.has-v2-side .v2-hero,
body.has-v2-side .v2-scope,
body.has-v2-side .v2-meta { padding-left: 32px; padding-right: 32px; }

.v2-page { max-width: 1080px; padding: 36px 48px 80px; }
.v2-page h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 32px; margin: 0 0 6px; letter-spacing: -0.01em; color: var(--ink);
}
.v2-page__sub {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-faint); margin-bottom: 22px;
}
.v2-page h2 { font-size: 14px; font-weight: 600; color: var(--ink);
  margin: 28px 0 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.v2-page p { color: var(--ink-soft); font-size: 13.5px; line-height: 1.6; margin: 0 0 10px; }

.v2-panel {
  background: #fff; border: 1px solid var(--rule); border-radius: var(--r-md);
  padding: 18px 22px; margin: 0 0 14px; box-shadow: var(--shadow-sm);
}
.v2-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.v2-tbl th { text-align: left; font-weight: 600; color: var(--ink-faint);
  text-transform: uppercase; font-size: 10px; letter-spacing: 0.08em;
  padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.v2-tbl td { padding: 10px; border-bottom: 1px solid var(--rule); color: var(--ink); }
.v2-tbl tr:last-child td { border-bottom: 0; }
.v2-tbl a { color: var(--navy); text-decoration: none; font-weight: 500; }
.v2-tbl a:hover { text-decoration: underline; }

.pill { display: inline-block; font-family: var(--font-mono); font-size: 10px;
  padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.06em; }
.pill--green  { background: #e3efe6; color: #2f5e3f; }
.pill--amber  { background: #f6e7d2; color: #8a5a18; }
.pill--red    { background: #f3dada; color: #6e1e1e; }
.pill--grey   { background: var(--surface-soft); color: var(--ink-faint); }
.pill--navy   { background: #dde4f1; color: #1f3460; }

a.v2-cta, button.v2-cta, .v2-cta {
  display: inline-block; padding: 8px 14px; background: var(--navy); color: #fff !important;
  border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--navy); cursor: pointer;
}
a.v2-cta:hover, button.v2-cta:hover, .v2-cta:hover { background: #16265a; color: #fff !important; }
a.v2-cta--ghost, button.v2-cta--ghost, .v2-cta--ghost {
  background: #fff; color: var(--navy) !important; border-color: var(--rule);
}
a.v2-cta--ghost:hover, button.v2-cta--ghost:hover, .v2-cta--ghost:hover {
  background: var(--surface-soft); color: var(--navy) !important;
}
.v2-cta + .v2-cta { margin-left: 6px; }

/* Sidebar — persona block + footer */
.v2-side__who {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; margin: 4px 0 10px;
  background: rgba(255,255,255,0.05); border-radius: 6px;
}
.v2-side__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--review); color: #fff; font-size: 11.5px;
  font-weight: 700; letter-spacing: 0.04em;
  display: inline-flex; align-items: center; justify-content: center;
}
.v2-side__whotext b { display: block; font-size: 13px; font-weight: 600; color: #fff; }
.v2-side__whotext i {
  display: block; font-size: 11px; color: #95a0b5; font-style: normal;
  margin-top: 2px;
}
.v2-side__foot {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 4px 4px;
  font-size: 11.5px;
}
.v2-side__foot a {
  display: block; color: #95a0b5; text-decoration: none; padding: 4px 6px;
}
.v2-side__foot a:hover { color: #fff; }

/* Persona picker (login + index "view as") */
.persona-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
@media (max-width: 900px) { .persona-grid { grid-template-columns: 1fr 1fr; } }
.persona-card {
  display: block; padding: 18px 18px 16px; background: #fff;
  border: 1px solid var(--rule); border-radius: var(--r-md);
  text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform 80ms ease, box-shadow 80ms ease;
  cursor: pointer;
}
.persona-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.persona-card__head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.persona-card__avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-soft); color: var(--navy); font-size: 11px;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.persona-card__title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.persona-card__sub  { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.persona-card p { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 8px; line-height: 1.5; }
.persona-card ul {
  margin: 0; padding-left: 0; list-style: none; font-size: 11.5px; color: var(--ink-faint); line-height: 1.7;
}
.persona-card ul li::before { content: '· '; }

/* Modal — used by org switcher and similar */
.v2-modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,26,46,0.45);
  display: none; align-items: center; justify-content: center; z-index: 200;
}
.v2-modal-backdrop.is-open { display: flex; }
.v2-modal {
  background: #fff; border-radius: var(--r-md); width: 520px; max-width: 92vw;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  padding: 22px 24px;
}
.v2-modal h3 { margin: 0 0 14px; font-size: 16px; font-weight: 600; color: var(--ink); }
.v2-modal__close {
  float: right; background: none; border: 0; font-size: 18px; color: var(--ink-faint); cursor: pointer;
}

/* === Pager (lists) ========================================================== */
.v2-pager {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin-top: 8px;
  background: #fff; border: 1px solid var(--rule); border-radius: var(--r-md);
  font-size: 12.5px; color: var(--ink-soft); box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.v2-pager .info { font-family: var(--font-mono); font-size: 11.5px; }
.v2-pager .size { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.v2-pager .size select {
  padding: 4px 8px; border: 1px solid var(--rule); border-radius: 4px; background: #fff;
  font-size: 12px;
}
.v2-pager .pages { display: flex; gap: 4px; align-items: center; }
.v2-pager .pages a, .v2-pager .pages b {
  padding: 4px 9px; border: 1px solid var(--rule); border-radius: 4px;
  text-decoration: none; color: var(--ink-soft); background: #fff;
  font-family: var(--font-mono); font-size: 12px; min-width: 14px; text-align: center;
}
.v2-pager .pages a:hover { background: var(--surface-soft); color: var(--navy); }
.v2-pager .pages b { background: var(--navy); color: #fff; border-color: var(--navy); }
.v2-pager .pages .dots { padding: 4px 4px; color: var(--ink-faint); border: 0; background: transparent; }

/* === Breadcrumbs ============================================================ */
.v2-crumbs {
  font-size: 12px; color: var(--ink-faint); margin-bottom: 6px;
  letter-spacing: 0.02em; font-weight: 500;
}
.v2-crumbs a { color: var(--ink-faint); text-decoration: none; }
.v2-crumbs a:hover { color: var(--navy); }
.v2-crumbs b { color: var(--ink); font-weight: 600; }

/* === Multi-select checkbox dropdown ========================================= */
.ms { position: relative; display: inline-block; }
.ms__btn {
  padding: 7px 26px 7px 11px; border: 1px solid var(--rule); border-radius: var(--r-sm);
  background: #fff; font-size: 12.5px; font-family: var(--font-body); color: var(--ink);
  cursor: pointer; line-height: 1.2; text-align: left; min-width: 140px;
  position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 240px;
}
.ms__btn::after {
  content: '▾'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: var(--ink-faint);
}
.ms__btn.is-active { border-color: var(--navy); color: var(--navy); font-weight: 600; }

.ms__menu {
  position: absolute; top: calc(100% + 4px); left: 0; min-width: 240px;
  background: #fff; border: 1px solid var(--rule); border-radius: var(--r-md);
  box-shadow: var(--shadow-md); padding: 8px; z-index: 60;
  display: none;
}
.ms.is-open > .ms__menu { display: block; }
.ms__search {
  width: 100%; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 4px;
  font-size: 12px; box-sizing: border-box;
}
.ms__head {
  display: flex; gap: 12px; padding: 8px 4px 6px; border-bottom: 1px solid var(--rule);
  margin-bottom: 4px; font-size: 11.5px;
}
.ms__head a { color: var(--navy); text-decoration: none; }
.ms__list {
  list-style: none; max-height: 240px; overflow-y: auto; padding: 0; margin: 0;
}
.ms__list label {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  cursor: pointer; font-size: 12.5px; color: var(--ink); border-radius: 4px;
}
.ms__list label:hover { background: var(--surface-soft); }
.ms__list input { margin: 0; }
.ms__count {
  display: inline-block; background: var(--navy); color: #fff;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  padding: 1px 7px; border-radius: 99px; margin-left: 6px; vertical-align: 1px;
}
