/* Evolve Sovereign Admin & Enclave Command Center — v3.0 Executive Design System */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  /* Core Palette — Deep Forest Biosphere + Single Amber Accent */
  --void: #06140e;
  --surface-0: #081a12;
  --surface-1: rgba(13, 36, 26, 0.72);
  --surface-2: rgba(18, 48, 35, 0.65);
  --surface-hover: rgba(24, 62, 45, 0.78);
  --glass: rgba(222, 238, 228, 0.03);
  --edge: rgba(196, 224, 208, 0.11);
  --edge-strong: rgba(196, 224, 208, 0.24);
  --inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.06);

  /* Typography Colors */
  --ink: #f3f7f4;
  --ink-secondary: #c4d4cb;
  --mute: #869c90;
  --faint: #2d4538;

  /* Single Primary Accent (Amber) + Semantic Status (Sage) */
  --amber: #de8a00;
  --amber-hover: #f29b0e;
  --amber-subtle: rgba(222, 138, 0, 0.12);
  --amber-border: rgba(222, 138, 0, 0.38);
  --amber-shadow: rgba(222, 138, 0, 0.22);
  --sage: #9fd8b2;
  --sage-subtle: rgba(159, 216, 178, 0.12);
  --sage-border: rgba(159, 216, 178, 0.32);
  --gold: #dfc478;

  /* Shape Lock */
  --r-card: 14px;
  --r-inner: 10px;
  --r-input: 8px;
  --r-pill: 999px;

  /* Typography Families */
  --sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Tinted Elevation Shadow */
  --shadow-card: 0 14px 34px -8px rgba(2, 10, 6, 0.65), var(--inner-glow);
  --shadow-hover: 0 18px 42px -6px rgba(2, 10, 6, 0.82), 0 0 24px -4px rgba(222, 138, 0, 0.15);
}

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

html, body {
  background-color: var(--void);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.55;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}

code, pre, .mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* Atmospheric Background Canvas */
.bg-atmosphere {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 45% at 50% -15%, rgba(222, 138, 0, 0.08), transparent 70%),
    radial-gradient(ellipse 55% 45% at 88% 55%, rgba(15, 48, 34, 0.55), transparent 70%),
    radial-gradient(circle at 12% 88%, rgba(10, 35, 25, 0.75), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================================
   1. TOP NAVIGATION BAR (Strict 64px Single-Line Desktop Lock)
   ============================================================================ */
nav.site-nav {
  position: relative;
  z-index: 20;
  height: 64px;
  min-height: 64px;
  background: rgba(6, 20, 14, 0.88);
  border-bottom: 1px solid var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  backdrop-filter: blur(16px);
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

.mark-group {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.32em;
  color: var(--ink);
}

.mark-group img {
  height: 22px;
  width: auto;
  display: block;
}

.enclave-tls-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  background: var(--sage-subtle);
  border: 1px solid var(--sage-border);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.enclave-tls-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 6px var(--sage);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.nav-quick-links {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 10px;
  border-right: 1px solid var(--edge);
}

/* Session Switcher in Header */
.session-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(222, 238, 228, 0.04);
  border: 1px solid var(--edge-strong);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.session-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  flex-shrink: 0;
}

.session-control label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mute);
  font-weight: 600;
}

.session-select {
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  padding-right: 4px;
}

.session-select option {
  background: var(--surface-0);
  color: var(--ink);
}

/* ============================================================================
   2. BUTTON SYSTEM (High Contrast, Single-Line Lock, Tactile Push)
   ============================================================================ */
.btn-amber-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--amber);
  color: #06140e;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease, box-shadow 0.18s ease;
}

.btn-amber-pill:hover {
  background: var(--amber-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--amber-shadow);
}

.btn-amber-pill:active {
  transform: translateY(0) scale(0.98);
}

.btn-amber-pill:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: rgba(222, 238, 228, 0.04);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--edge-strong);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.btn-ghost-pill:hover {
  border-color: var(--amber);
  color: var(--amber-hover);
  background: rgba(222, 138, 0, 0.08);
  transform: translateY(-1px);
}

.btn-ghost-pill:active {
  transform: translateY(0) scale(0.98);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}

/* ============================================================================
   3. APPLICATION SHELL & LEFT NAVIGATION RAIL
   ============================================================================ */
.app-shell {
  display: flex;
  flex: 1;
  height: calc(100dvh - 64px);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

aside.service-rail {
  width: 256px;
  background: rgba(6, 20, 14, 0.72);
  border-right: 1px solid var(--edge);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  flex-shrink: 0;
  backdrop-filter: blur(16px);
  overflow-y: auto;
}

.rail-section-header {
  padding: 0 22px 10px 22px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mute);
  font-weight: 600;
}

.rail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 22px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  user-select: none;
  color: var(--mute);
}

.rail-item:hover {
  color: var(--ink);
  background: rgba(222, 238, 228, 0.03);
}

.rail-item.active {
  color: var(--ink);
  background: linear-gradient(90deg, rgba(222, 138, 0, 0.12), rgba(222, 238, 228, 0.02));
  border-left-color: var(--amber);
}

.rail-item.disabled {
  opacity: 0.28;
  cursor: not-allowed;
  pointer-events: none;
}

.rail-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rail-item-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-item.active .rail-item-title {
  font-weight: 600;
  color: var(--ink);
}

.rail-item-sub {
  font-size: 11px;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-item.active .rail-item-sub {
  color: var(--ink-secondary);
}

.rail-item-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  transition: all 0.2s;
}

.rail-item.active .rail-item-indicator {
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

/* ============================================================================
   4. MAIN VIEWPORT & VIEW PANELS (No Clipping / Natural Scroll)
   ============================================================================ */
main.service-viewport {
  flex: 1;
  background: transparent;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scroll-behavior: smooth;
}

.view-panel {
  display: none;
  width: 100%;
  min-height: min-content;
}

.view-panel.active {
  display: block;
}

#view-hermes.view-panel.active {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 64px);
}

.service-frame {
  width: 100%;
  flex: 1;
  border: none;
  background: #081a12;
}

.content-wrap {
  max-width: 1340px;
  margin: 0 auto;
  padding: 32px clamp(20px, 3vw, 44px) 64px;
  width: 100%;
}

/* ============================================================================
   5. HERO BANNER & TYPOGRAPHY HIERARCHY
   ============================================================================ */
.hero-banner-card {
  position: relative;
  border-radius: var(--r-card);
  overflow: hidden;
  border: 1px solid var(--edge-strong);
  background: var(--surface-0);
  margin-bottom: 24px;
  min-height: 210px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-card);
}

.hero-banner-img {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 58%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.78;
}

.hero-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #06140e 0%, rgba(6, 20, 14, 0.96) 46%, rgba(6, 20, 14, 0.45) 78%, rgba(6, 20, 14, 0.15) 100%);
}

.hero-banner-content {
  position: relative;
  z-index: 2;
  padding: 28px 34px;
  max-width: 660px;
}

.hero-banner-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-bottom: 8px;
  font-weight: 600;
}

.hero-banner-content h1 {
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 10px;
  text-wrap: balance;
}

.hero-banner-content h1 .amber,
.hero-title .amber,
.section-title .amber {
  color: var(--amber);
}

.hero-banner-content p {
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.55;
  max-width: 58ch;
  margin-bottom: 18px;
}

.hero-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Live Scan Sweep on Hero Banner */
.banner-scan {
  position: absolute;
  right: 10%;
  top: 0;
  bottom: 0;
  width: 38%;
  pointer-events: none;
  z-index: 1;
}

.banner-scan i {
  position: absolute;
  left: 0;
  right: 0;
  top: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber) 25%, var(--amber) 75%, transparent);
  box-shadow: 0 0 16px 2px rgba(240, 158, 24, 0.5);
  animation: sweep 7s cubic-bezier(.45,.05,.55,.95) infinite;
}

@keyframes sweep {
  0% { top: 6%; opacity: 0; }
  6% { opacity: 1; }
  82% { top: 94%; opacity: 1; }
  90%, 100% { top: 94%; opacity: 0; }
}

/* Page View Header (for Secondary Tabs) */
.view-header {
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-wrap: balance;
  margin-bottom: 8px;
  color: var(--ink);
}

.hero-subtitle {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-secondary);
  font-weight: 400;
  max-width: 65ch;
}

/* Section Header Bar (Clean 20px Hierarchy inside Launchpad) */
.section-header-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 32px 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--edge);
  flex-wrap: wrap;
}

.section-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 4px;
}

.section-desc {
  font-size: 13px;
  color: var(--mute);
  max-width: 68ch;
}

/* ============================================================================
   6. KPI STRIP (Tabular Numerals, Crisp 4-Column Bento)
   ============================================================================ */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.kpi-tile {
  background: var(--surface-1);
  border: 1px solid var(--edge);
  border-radius: var(--r-card);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
}

.kpi-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--mute);
}

.kpi-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--sage);
  font-weight: 500;
}

/* ============================================================================
   7. JUMP MATRIX & DEPARTMENT CARDS (Bottom-Pinned Actions, Zero Wrap)
   ============================================================================ */
.jump-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.jump-card {
  background: var(--surface-1);
  border: 1px solid var(--edge);
  border-radius: var(--r-card);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.jump-card:hover {
  transform: translateY(-2px);
  border-color: var(--amber-border);
  box-shadow: var(--shadow-hover);
}

.jump-card.primary-jump {
  background: linear-gradient(155deg, rgba(222, 138, 0, 0.11) 0%, rgba(13, 36, 26, 0.85) 65%);
  border-color: var(--amber-border);
}

.jump-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--amber);
}

.jump-card-title {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 8px 0 6px 0;
  line-height: 1.3;
}

.jump-card-sub {
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.jump-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--edge);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jump-node-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}

.jump-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--sage-subtle);
  color: var(--sage);
  border: 1px solid var(--sage-border);
  white-space: nowrap;
  flex-shrink: 0;
}

.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 5px var(--sage);
}

/* Department Cards */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.dept-card {
  background: var(--surface-1);
  border: 1px solid var(--edge);
  border-radius: var(--r-card);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease;
}

.dept-card:hover {
  transform: translateY(-2px);
  border-color: var(--edge-strong);
}

.dept-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.dept-slug-badge {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-subtle);
  border: 1px solid var(--amber-border);
  padding: 2px 8px;
  border-radius: 6px;
}

.kb-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.kb-pill {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--edge);
  color: var(--ink-secondary);
}

.kb-pill strong {
  color: var(--ink);
}

.kb-pill.review {
  border-color: var(--amber-border);
  color: var(--amber);
  background: var(--amber-subtle);
}

.kb-pill.done {
  border-color: var(--sage-border);
  color: var(--sage);
  background: var(--sage-subtle);
}

.task-mini-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2px 0;
  padding-top: 10px;
  border-top: 1px solid var(--edge);
  font-size: 12px;
  color: var(--mute);
}

.task-mini-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.task-mini-title {
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dept-actions-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--edge);
  flex-wrap: wrap;
}

/* ============================================================================
   8. GLASS CARDS, TESTBENCH, TABLES & MODALS
   ============================================================================ */
.evolve-card {
  background: var(--surface-1);
  border: 1px solid var(--edge);
  border-radius: var(--r-card);
  padding: 26px 28px;
  margin-bottom: 24px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  position: relative;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card-title-row h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-row h3::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  flex-shrink: 0;
}

/* Testbench Grid */
.testbench-controls {
  display: grid;
  grid-template-columns: 300px 1fr auto;
  gap: 12px;
  margin-top: 14px;
  align-items: center;
}

/* Directive Callout */
.directive-box {
  background: rgba(222, 238, 228, 0.025);
  border: 1px solid var(--edge);
  border-left: 3px solid var(--amber);
  padding: 14px 18px;
  border-radius: 0 var(--r-inner) var(--r-inner) 0;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.directive-item {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.directive-item strong {
  color: var(--amber);
  text-transform: uppercase;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  margin-right: 8px;
  font-weight: 600;
}

/* Tables */
.v2-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.v2-table th, .v2-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--edge);
  text-align: left;
  vertical-align: middle;
}

.v2-table th {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--mute);
  font-weight: 600;
  background: rgba(6, 20, 14, 0.85);
  position: sticky;
  top: 0;
  z-index: 2;
}

.v2-table tr:hover td {
  background: rgba(222, 238, 228, 0.03);
}

.v2-table td strong {
  font-weight: 500;
  color: var(--ink);
  font-size: 13.5px;
}

.v2-slot-code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--amber-subtle);
  border: 1px solid var(--amber-border);
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
}

.v2-badge-verified {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  background: var(--sage-subtle);
  color: var(--sage);
  border: 1px solid var(--sage-border);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Form Controls */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}

.form-prompt {
  font-size: 12px;
  color: var(--mute);
  margin-bottom: 8px;
}

.form-control-input, .form-control-select, .form-control-textarea {
  width: 100%;
  background: rgba(6, 20, 14, 0.85);
  border: 1px solid var(--edge-strong);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: var(--r-input);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control-input:focus, .form-control-select:focus, .form-control-textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(222, 138, 0, 0.18);
}

.form-control-textarea {
  min-height: 90px;
  resize: vertical;
}

/* Admin Switchboard Matrix & Toggle Switches */
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.matrix-table th, .matrix-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--edge);
  text-align: center;
}

.matrix-table th:first-child, .matrix-table td:first-child {
  text-align: left;
}

.matrix-table th {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mute);
  background: rgba(6, 20, 14, 0.65);
  font-weight: 600;
}

/* Unified Toggle Switch (supports both .switch and .toggle-switch) */
.switch, .toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

.switch input, .toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider, .toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--faint);
  border: 1px solid var(--edge-strong);
  transition: 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 22px;
}

.slider::before, .toggle-slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: var(--ink);
  transition: 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 50%;
}

input:checked + .slider,
input:checked + .toggle-slider {
  background-color: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 10px rgba(222, 138, 0, 0.35);
}

input:checked + .slider::before,
input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background-color: #06140e;
}

/* Hermes Studio Top Sub-Bar */
.hermes-studio-bar {
  padding: 12px 24px;
  background: rgba(6, 20, 14, 0.94);
  border-bottom: 1px solid var(--edge);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Document Reader Modal */
.doc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 10, 7, 0.84);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.doc-modal-backdrop.open {
  display: flex;
}

.doc-modal-card {
  background: #081c13;
  border: 1px solid var(--edge-strong);
  border-radius: var(--r-card);
  max-width: 960px;
  width: 100%;
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
}

.doc-modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--edge);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.doc-modal-body {
  padding: 24px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  color: var(--ink);
}

/* Notification Toast */
.portal-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #081c13;
  border: 1px solid var(--amber);
  color: var(--ink);
  padding: 12px 22px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 0 15px rgba(222, 138, 0, 0.2);
  transform: translateY(120px);
  opacity: 0;
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 120;
}

.portal-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive Breakpoints */
@media (max-width: 1180px) {
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .testbench-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  aside.service-rail {
    width: 210px;
  }
  .nav-quick-links {
    display: none;
  }
}
