:root {
  --bg: #07090d;
  --surface: #0d1117;
  --surface-warm: var(--surface);
  --fg: #f2f5f8;
  --fg-2: var(--fg);
  --muted: #9aa4b2;
  --meta: var(--muted);
  --border: #273142;
  --border-soft: #1c2533;
  --accent: #78a6ff;
  --accent-on: #06111f;
  --accent-hover: color-mix(in oklab, var(--accent), black 8%);
  --accent-active: color-mix(in oklab, var(--accent), black 14%);
  --success: #35c46f;
  --warn: #e4b434;
  --danger: #ef6464;
  --font-display: "Inter", -apple-system, system-ui, sans-serif;
  --font-body: "Inter", -apple-system, system-ui, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", monospace;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 32px;
  --text-3xl: 48px;
  --text-4xl: 64px;
  --leading-body: 1.5;
  --leading-tight: 1.2;
  --tracking-display: -0.01em;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-20: 80px;
  --section-y-desktop: 80px;
  --section-y-tablet: 48px;
  --section-y-phone: 32px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --elev-flat: none;
  --elev-ring: 0 0 0 1px var(--border);
  --elev-raised: 0 2px 8px color-mix(in oklab, var(--fg), transparent 92%);
  --focus-ring: 0 0 0 3px color-mix(in oklab, var(--accent), transparent 70%);
  --motion-fast: 150ms;
  --motion-base: 200ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --container-max: 1200px;
  --container-gutter-desktop: 24px;
  --container-gutter-tablet: 16px;
  --container-gutter-phone: 12px;
  --info: color-mix(in oklab, var(--accent), white 16%);
  --sidebar: color-mix(in oklab, var(--bg), var(--surface) 68%);
  --selected: color-mix(in oklab, var(--accent), transparent 92%);
  --warning-bg: color-mix(in oklab, var(--warn), transparent 88%);
  --danger-bg: color-mix(in oklab, var(--danger), transparent 92%);
  --success-bg: color-mix(in oklab, var(--success), transparent 92%);
}

:root[data-theme="light"] {
  --bg: #fafafa;
  --surface: #ffffff;
  --fg: #111111;
  --muted: #6b6b6b;
  --border: #e5e5e5;
  --border-soft: var(--border);
  --accent: #2f6feb;
  --accent-on: #ffffff;
  --success: #17a34a;
  --warn: #eab308;
  --danger: #dc2626;
  --sidebar: color-mix(in oklab, var(--bg), var(--surface) 68%);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); line-height: var(--leading-tight); letter-spacing: var(--tracking-display); }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
p { margin: 0; color: var(--muted); text-wrap: pretty; }
.muted { color: var(--muted); }
.meta, .mono { color: var(--muted); font-family: var(--font-mono); font-size: var(--text-xs); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.app { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--space-5);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: var(--space-3); font-weight: 700; letter-spacing: var(--tracking-display); }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--fg);
  color: var(--surface);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.nav { display: grid; gap: var(--space-1); margin-top: var(--space-8); }
.nav a {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 550;
}
.nav a.active { background: var(--selected); color: var(--accent); }
.nav a:hover { background: color-mix(in oklab, var(--fg), transparent 96%); color: var(--fg); }
.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}
.user-chip { display: grid; grid-template-columns: 34px 1fr; gap: var(--space-3); align-items: center; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--accent), transparent 86%);
  color: var(--accent);
  font-weight: 700;
}
.main { min-width: 0; display: grid; grid-template-rows: 68px 1fr; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: 0 var(--space-6);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.breadcrumbs { display: flex; align-items: center; gap: var(--space-2); color: var(--muted); font-size: var(--text-xs); }
.breadcrumbs span:last-child { color: var(--fg); font-weight: 650; }
.top-actions, .toolbar, .inline-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.portal-return { white-space: nowrap; }
.portal-return::before { content: "←"; font-weight: 700; }
.portal-return-fixed {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 20;
}
.content { min-width: 0; padding: var(--space-6); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-6); margin-bottom: var(--space-5); }
.page-title { display: grid; gap: var(--space-2); max-width: 860px; }

.btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  font-weight: 650;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), opacity var(--motion-fast) var(--ease-standard);
}
.btn:hover { border-color: color-mix(in oklab, var(--fg), transparent 62%); }
.btn:focus-visible, .input:focus-visible, .select:focus-visible, textarea:focus-visible, .tab:focus-visible { outline: none; box-shadow: var(--focus-ring); border-color: var(--accent); }
.btn[disabled], .disabled { opacity: 0.52; cursor: not-allowed; }
.btn-primary { color: var(--accent-on); background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-on); }
.btn-danger { color: var(--danger); border-color: color-mix(in oklab, var(--danger), transparent 58%); background: var(--danger-bg); }
.btn-ghost { background: transparent; }
.icon-btn { width: 34px; min-width: 34px; padding: 0; }
.notification-btn {
  position: relative;
  min-width: 58px;
  padding: 7px 9px;
  gap: 7px;
  background: color-mix(in oklab, var(--surface), var(--warn) 9%);
  border-color: color-mix(in oklab, var(--warn), transparent 48%);
}
.notification-btn::before {
  content: "!";
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1.5px solid color-mix(in oklab, var(--warn), var(--fg) 28%);
  border-radius: var(--radius-pill);
  color: color-mix(in oklab, var(--warn), var(--fg) 28%);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.notification-count {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  border: 1px solid color-mix(in oklab, var(--warn), black 18%);
  border-radius: var(--radius-pill);
  background: var(--warn);
  color: color-mix(in oklab, black, var(--warn) 18%);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.portal-return {
  min-height: 38px;
  padding: 8px 14px;
  border-color: color-mix(in oklab, var(--accent), var(--border) 38%);
  background: color-mix(in oklab, var(--accent), var(--surface) 86%);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent), transparent 74%);
}
.portal-return:hover {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent), var(--surface) 76%);
  color: var(--fg);
}

.panel, .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.panel-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border);
}
.panel-body { padding: var(--space-4); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.stack { display: grid; gap: var(--space-4); }
.stack-sm { display: grid; gap: var(--space-2); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-5); align-items: start; }

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: var(--space-3);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.field { display: grid; gap: var(--space-1); min-width: 0; }
.field label { color: var(--muted); font-size: var(--text-xs); font-weight: 700; }
.input, .select, textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  background: var(--surface);
  outline: none;
}
textarea { min-height: 84px; resize: vertical; }
.input::placeholder, textarea::placeholder { color: color-mix(in oklab, var(--muted), var(--fg) 16%); }
.field.error .input, .field.error .select { border-color: var(--danger); background: var(--danger-bg); }
.help { color: var(--muted); font-size: var(--text-xs); }

.badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 650;
  white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: var(--radius-pill); background: var(--muted); }
.badge.info::before, .badge.draft::before { background: var(--accent); }
.badge.success::before, .badge.active::before, .badge.paid::before, .badge.approved::before { background: var(--success); }
.badge.warn::before, .badge.review::before, .badge.processing::before { background: var(--warn); }
.badge.danger::before, .badge.rejected::before, .badge.error::before { background: var(--danger); }
.badge.gray::before, .badge.cancelled::before, .badge.archive::before { background: var(--muted); }
.badge.no-dot::before { display: none; }
.badge.role { background: var(--selected); border-color: color-mix(in oklab, var(--accent), transparent 68%); color: var(--accent); }

.table-shell { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.table-top {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border);
}
.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 300px);
  isolation: isolate;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--text-xs); }
.wide-table { min-width: 1180px; }
th, td {
  height: 38px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  background: var(--surface);
}
th {
  position: sticky;
  top: 0;
  z-index: 3;
  color: var(--muted);
  background: color-mix(in oklab, var(--bg), var(--surface) 72%);
  font-weight: 750;
}
tbody tr:hover td { background: color-mix(in oklab, var(--surface), var(--fg) 3%); }
tbody tr.selected td,
tbody tr:focus-within td {
  background: color-mix(in oklab, var(--surface), var(--accent) 9%);
}
td.num, th.num, .money { text-align: right; font-family: var(--font-mono); }
.pin-left {
  position: sticky;
  left: 0;
  z-index: 12;
  width: var(--pin-left-width, 300px);
  min-width: var(--pin-left-width, 300px);
  max-width: var(--pin-left-width, 300px);
  overflow: hidden;
  background: var(--pin-bg, var(--surface));
  box-shadow: 1px 0 0 var(--border), 18px 0 20px -18px color-mix(in oklab, var(--bg), black 40%);
  background-clip: padding-box;
  isolation: isolate;
  transform: translateZ(0);
}
.pin-left > * { position: relative; z-index: 1; }
.pin-left::after {
  content: "";
  position: absolute;
  top: 0;
  right: -18px;
  bottom: 0;
  width: 18px;
  pointer-events: none;
  background: linear-gradient(to right, var(--pin-bg, var(--surface)), transparent);
}
tbody tr:hover .pin-left {
  --pin-bg: color-mix(in oklab, var(--surface), var(--fg) 3%);
  background: var(--pin-bg);
}
tbody tr.selected .pin-left,
tbody tr:focus-within .pin-left {
  --pin-bg: color-mix(in oklab, var(--surface), var(--accent) 9%);
  background: var(--pin-bg);
}
th.pin-left {
  z-index: 16;
  --pin-bg: color-mix(in oklab, var(--bg), var(--surface) 72%);
  background: var(--pin-bg);
}
.row-title { display: grid; gap: 1px; min-width: 0; }
.row-title strong { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: inline-flex; gap: var(--space-1); align-items: center; }

.projects-table {
  --pin-left-width: 360px;
  min-width: 1700px;
  table-layout: fixed;
}
.projects-table col:nth-child(1) { width: 360px; }
.projects-table col:nth-child(2) { width: 250px; }
.projects-table col:nth-child(3) { width: 180px; }
.projects-table col:nth-child(4) { width: 170px; }
.projects-table col:nth-child(5) { width: 170px; }
.projects-table col:nth-child(6) { width: 180px; }
.projects-table col:nth-child(7) { width: 150px; }
.projects-table col:nth-child(8) { width: 210px; }
.projects-table col:nth-child(9) { width: 140px; }
.projects-table col:nth-child(10) { width: 220px; }
.projects-table td:not(.pin-left),
.projects-table th:not(.pin-left) {
  overflow: hidden;
  text-overflow: ellipsis;
}
.projects-table .row-title strong { max-width: 315px; }

.metric {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.metric strong { font-size: var(--text-xl); line-height: var(--leading-tight); }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.kv { display: grid; gap: 2px; min-width: 0; }
.kv span { color: var(--muted); font-size: var(--text-xs); }
.kv strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.masked { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-mono); }
.masked::before { content: ""; width: 13px; height: 13px; border: 1.5px solid currentColor; border-radius: 3px; opacity: 0.62; }

.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); }
.tab {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; padding-top: var(--space-4); }
.tab-panel.active { display: block; }

.stepper { display: grid; gap: var(--space-3); }
.step {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.step-num { width: 30px; height: 30px; border-radius: var(--radius-pill); display: grid; place-items: center; background: var(--selected); color: var(--accent); font-weight: 800; }
.step.active { border-color: color-mix(in oklab, var(--accent), transparent 52%); box-shadow: var(--elev-ring); }

.notice {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--fg), transparent 97%);
}
.notice.warn { border-color: color-mix(in oklab, var(--warn), transparent 40%); background: var(--warning-bg); }
.notice.danger { border-color: color-mix(in oklab, var(--danger), transparent 48%); background: var(--danger-bg); }
.notice.success { border-color: color-mix(in oklab, var(--success), transparent 54%); background: var(--success-bg); }

.dialog-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: var(--space-8);
  background: color-mix(in oklab, black, transparent 35%);
  z-index: 20;
}
.dialog-backdrop.open { display: grid; }
.dialog {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-raised);
}
.dialog-head, .dialog-foot { padding: var(--space-5); border-bottom: 1px solid var(--border); }
.dialog-foot { border-top: 1px solid var(--border); border-bottom: 0; display: flex; justify-content: flex-end; gap: var(--space-2); }
.dialog-body { padding: var(--space-5); display: grid; gap: var(--space-4); }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: flex-end;
  background: color-mix(in oklab, black, transparent 38%);
  z-index: 24;
}
.drawer-backdrop.open { display: flex; }
.side-drawer {
  width: min(720px, 100%);
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 28px color-mix(in oklab, black, transparent 70%);
}
.drawer-head,
.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
}
.drawer-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}
.drawer-body {
  overflow: auto;
  padding: var(--space-5);
}
.form-section {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--surface), var(--fg) 2%);
}
.form-section h3 { font-size: var(--text-base); }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.span-2 { grid-column: span 2; }
.is-new-person td {
  animation: row-confirm var(--motion-base) var(--ease-standard);
}
@keyframes row-confirm {
  from { background: color-mix(in oklab, var(--success), var(--surface) 82%); }
  to { background: color-mix(in oklab, var(--surface), var(--accent) 9%); }
}

.external-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-8);
  background: var(--bg);
}
.external-card {
  width: min(480px, 100%);
  display: grid;
  gap: var(--space-5);
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.state-list { display: grid; gap: var(--space-2); }
.state-item { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--border-soft); }
.mini-progress { height: 8px; overflow: hidden; border-radius: var(--radius-pill); background: color-mix(in oklab, var(--fg), transparent 92%); }
.mini-progress i { display: block; height: 100%; width: 68%; background: var(--accent); }
.person-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  min-width: 260px;
}
.person-card strong,
.person-card .meta {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.person-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--accent), transparent 84%);
  color: var(--accent);
  font-weight: 800;
}
.person-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.people-directory-table {
  min-width: 1420px;
  table-layout: fixed;
}
.people-directory-table col:nth-child(1) { width: 360px; }
.people-directory-table col:nth-child(2) { width: 160px; }
.people-directory-table col:nth-child(3) { width: 160px; }
.people-directory-table col:nth-child(4) { width: 180px; }
.people-directory-table col:nth-child(5) { width: 150px; }
.people-directory-table col:nth-child(6) { width: 130px; }
.people-directory-table col:nth-child(7) { width: 200px; }
.people-directory-table col:nth-child(8) { width: 180px; }
.people-directory-table col:nth-child(9) { width: 140px; }
.people-directory-table .pin-left {
  width: 360px;
  min-width: 360px;
  max-width: 360px;
}
.people-directory-table td:not(.pin-left),
.people-directory-table th:not(.pin-left) {
  overflow: hidden;
  text-overflow: ellipsis;
}
.audit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-5); align-items: start; }
.audit-feed { display: grid; gap: var(--space-3); }
.audit-event {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: start;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.audit-event.selected { border-color: color-mix(in oklab, var(--accent), transparent 54%); background: var(--selected); }
.audit-event strong { display: block; margin-bottom: 2px; }
.audit-side { position: sticky; top: 88px; display: grid; gap: var(--space-4); }
.severity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
}
.severity.high { color: var(--danger); border-color: color-mix(in oklab, var(--danger), transparent 50%); background: var(--danger-bg); }
.severity.medium { color: var(--warn); border-color: color-mix(in oklab, var(--warn), transparent 44%); background: var(--warning-bg); }
.severity.low { color: var(--success); border-color: color-mix(in oklab, var(--success), transparent 56%); background: var(--success-bg); }
.density-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; }

.overview-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.overview-header { height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-8); border-bottom: 1px solid var(--border); background: var(--surface); }
.overview-main { width: min(1240px, 100%); margin: 0 auto; padding: var(--space-12) var(--space-6); }
.overview-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr); gap: var(--space-8); align-items: end; margin-bottom: var(--space-8); }
.command-hero { align-items: stretch; }
.overview-status {
  align-self: stretch;
  min-height: 100%;
}
.overview-band { display: grid; gap: var(--space-4); margin-bottom: var(--space-8); }
.route-index {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.button-groups {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.8fr;
  gap: var(--space-4);
}
.button-group {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  min-width: 0;
}
.button-group-title {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
}
.button-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.button-list .btn {
  min-height: 36px;
  padding-block: 8px;
}
.action-buttons .btn {
  min-width: 148px;
}
.section-title { display: flex; align-items: end; justify-content: space-between; gap: var(--space-5); }
.section-title p { max-width: 58ch; }
.product-map { padding: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.map-row { display: grid; grid-template-columns: 120px 1fr 90px; gap: var(--space-2); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--border-soft); }
.map-row:last-child { border-bottom: 0; }
.function-matrix {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.function-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 110px;
  gap: var(--space-4);
  align-items: center;
  min-height: 54px;
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border-soft);
}
.function-row:last-child { border-bottom: 0; }
.function-row span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.function-row a { color: var(--accent); font-weight: 750; text-align: right; }

@media (max-width: 1280px) {
  body { min-width: 1024px; }
  .app { grid-template-columns: 220px minmax(0, 1fr); }
  .split { grid-template-columns: 1fr; }
  .audit-layout { grid-template-columns: 1fr; }
  .audit-side { position: static; }
  .overview-hero, .button-groups { grid-template-columns: 1fr; }
  .function-row { grid-template-columns: 150px minmax(0, 1fr) 90px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; scroll-behavior: auto !important; }
}
