:root {
  --sg-bg: #101413;
  --sg-workspace-bg: #151817;
  --sg-surface: rgba(31, 36, 34, 0.92);
  --sg-surface-2: rgba(38, 44, 42, 0.96);
  --sg-surface-3: #242b28;
  --sg-sidebar-bg: #171b1a;
  --sg-topbar-bg: rgba(21, 24, 23, 0.88);
  --sg-input-bg: #202725;
  --sg-input-focus-bg: #252d2a;
  --sg-border: rgba(232, 238, 235, 0.1);
  --sg-border-strong: rgba(74, 229, 167, 0.32);
  --sg-text: #f5f7f6;
  --sg-muted: #9aa6a1;
  --sg-green: #4ae5a7;
  --sg-green-strong: #2edc94;
  --sg-green-soft: rgba(74, 229, 167, 0.08);
  --sg-danger: #ff5f74;
  --sg-danger-soft: rgba(255, 95, 116, 0.08);
  --sg-warning: #f4c466;
  --sg-warning-soft: rgba(244, 196, 102, 0.07);
  --sg-neutral-badge-color: #91aaa1;
  --sg-neutral-badge-bg: rgba(145, 170, 161, 0.06);
  --sg-info: #64b5f6;
  --sg-info-soft: rgba(100, 181, 246, 0.06);
  --sg-sidebar: 265px;
  --sg-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  --sg-ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Card and Progress elements (Dark Theme) */
  --sg-card-bg: #1c2220;
  --sg-card-hover-border: rgba(74, 229, 167, 0.35);
  --sg-card-hover-shadow: 0 18px 36px rgba(0,0,0,.24), 0 0 18px rgba(74, 229, 167, 0.04);
  --sg-metric-heading: #a8b4af;
  --sg-metric-muted: #8d9b95;
  --sg-progress-bg: #2a3430;
  --sg-card-inner-bg: rgba(255, 255, 255, 0.035);
  --sg-card-inner-text: #d1dbd7;
  --sg-pre-bg: #121816;
  --sg-pre-text: #bdd0c8;

  /* Auth / Login theme variables (Dark Theme) */
  --sg-auth-bg: #040a09;
  --sg-auth-brand-bg: radial-gradient(circle at 75% 18%, rgba(42, 224, 150, .15), transparent 32%), linear-gradient(145deg, #071310 0%, #0a1d17 54%, #09231a 100%);
  --sg-auth-form-bg: #091411;
  --sg-auth-text: #f0f7f4;
  --sg-auth-text-muted: #809c91;
  --sg-auth-brand-text: #f0f7f4;
  --sg-auth-brand-muted: #809c91;
  --sg-auth-brand-p: #9bb8ae;
  --sg-auth-label: #cfe0da;
  --sg-auth-hint: #6f8b81;
  --sg-auth-border: rgba(103, 239, 183, 0.12);
  --sg-auth-circle-border: rgba(103, 239, 183, 0.08);
  --sg-auth-input-bg: #0d1b17;
  --sg-auth-input-focus-bg: #0f1f1a;
  --sg-auth-trust-color: #87a49a;
  --sg-auth-note-p: #78958a;
  --sg-auth-note-strong: #a9c2b9;
  --sg-auth-divider: rgba(143, 168, 159, .42);
  --sg-btn-text: #040a09;
  --sg-btn-shadow: rgba(74, 229, 167, 0.12);
  --sg-btn-shadow-hover: rgba(74, 229, 167, 0.25);
}

[data-bs-theme="light"] {
  --sg-bg: #f7f7f5;
  --sg-workspace-bg: #f0f1ef;
  --sg-surface: rgba(255, 255, 255, 0.94);
  --sg-surface-2: rgba(247, 248, 247, 0.98);
  --sg-surface-3: #ecefed;
  --sg-sidebar-bg: #efefee;
  --sg-topbar-bg: rgba(255, 255, 255, 0.86);
  --sg-input-bg: #ffffff;
  --sg-input-focus-bg: #ffffff;
  --sg-border: rgba(28, 35, 32, 0.09);
  --sg-border-strong: rgba(17, 160, 106, 0.28);
  --sg-text: #171d1b;
  --sg-muted: #616b67;
  --sg-green: #11a06a;
  --sg-green-strong: #0c8254;
  --sg-green-soft: rgba(17, 160, 106, 0.08);
  --sg-danger: #d32f2f;
  --sg-danger-soft: rgba(211, 47, 47, 0.08);
  --sg-warning: #b58105;
  --sg-warning-soft: rgba(181, 129, 5, 0.08);
  --sg-neutral-badge-color: #496359;
  --sg-neutral-badge-bg: rgba(73, 99, 89, 0.08);
  --sg-info: #0288d1;
  --sg-info-soft: rgba(2, 136, 209, 0.08);
  --sg-shadow: 0 18px 45px rgba(24, 31, 28, 0.08);

  /* Card and Progress elements (Light Theme) */
  --sg-card-bg: #ffffff;
  --sg-card-hover-border: rgba(17, 160, 106, 0.35);
  --sg-card-hover-shadow: 0 18px 36px rgba(20, 28, 25, 0.1), 0 0 15px rgba(17, 160, 106, 0.04);
  --sg-metric-heading: var(--sg-muted);
  --sg-metric-muted: var(--sg-muted);
  --sg-progress-bg: #e7ebe8;
  --sg-card-inner-bg: #f7f8f7;
  --sg-card-inner-text: #1d382e;
  --sg-pre-bg: #f2f7f5;
  --sg-pre-text: #1d382e;

  /* Auth / Login theme variables (Light Theme) */
  --sg-auth-bg: #f3f7f5;
  --sg-auth-brand-bg: radial-gradient(circle at 75% 18%, rgba(17, 160, 106, 0.08), transparent 35%), linear-gradient(145deg, #eaf2ee 0%, #daebd3 54%, #d1e7dd 100%);
  --sg-auth-form-bg: #ffffff;
  --sg-auth-text: #091713;
  --sg-auth-text-muted: #2d453b;
  --sg-auth-brand-text: #091713;
  --sg-auth-brand-muted: #204035;
  --sg-auth-brand-p: #315044;
  --sg-auth-label: #204035;
  --sg-auth-hint: #2d453b;
  --sg-auth-border: rgba(17, 160, 106, 0.15);
  --sg-auth-circle-border: rgba(17, 160, 106, 0.06);
  --sg-auth-input-bg: #f9fbfb;
  --sg-auth-input-focus-bg: #ffffff;
  --sg-auth-trust-color: #3b5a4f;
  --sg-auth-note-p: #2d453b;
  --sg-auth-note-strong: #204035;
  --sg-auth-divider: rgba(17, 160, 106, 0.25);
  --sg-btn-text: #ffffff;
  --sg-btn-shadow: rgba(17, 160, 106, 0.12);
  --sg-btn-shadow-hover: rgba(17, 160, 106, 0.25);
}

@view-transition { navigation: auto; }

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--sg-text);
  background: var(--sg-workspace-bg);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--sg-green);
  outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6, .brand-name, .brand-product, .eyebrow {
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
}

code, pre, .fingerprint, kbd {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace !important;
}

.eyebrow {
  display: block;
  margin-bottom: .72rem;
  color: var(--sg-green);
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sg-green);
  box-shadow: 0 0 0 4px rgba(74, 229, 167, 0.15);
  animation: status-pulse 2s infinite ease-in-out;
}
@keyframes status-pulse {
  0% { box-shadow: 0 0 0 0px rgba(74, 229, 167, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(74, 229, 167, 0); }
  100% { box-shadow: 0 0 0 0px rgba(74, 229, 167, 0); }
}
.status-dot.muted { background: #78958a; box-shadow: none; }

/* Authentication */
.auth-page { overflow-x: hidden; }
.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 1.2fr) minmax(420px, .8fr);
}
.auth-brand-panel {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  border-right: 1px solid var(--sg-auth-border);
  background: var(--sg-auth-brand-bg);
}
.auth-brand-panel::before,
.auth-brand-panel::after {
  position: absolute;
  content: "";
  border: 1px solid var(--sg-auth-circle-border);
  border-radius: 50%;
}
.auth-brand-panel::before { width: 680px; height: 680px; right: -320px; bottom: -240px; }
.auth-brand-panel::after { width: 430px; height: 430px; right: -190px; bottom: -110px; }
.auth-brand-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  padding: 3.25rem clamp(3rem, 7vw, 8rem);
  flex-direction: column;
  justify-content: space-between;
}
.brand-lockup {
  display: inline-flex;
  width: max-content;
  gap: .55rem;
  align-items: center;
  color: var(--sg-text);
  text-decoration: none;
}
.brand-mark {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}
.brand-name {
  color: var(--sg-text);
  font-size: 1rem;
  font-weight: 760;
  letter-spacing: .19em;
  line-height: 1;
}
.brand-divider {
  width: 1px;
  height: 1rem;
  margin-left: .08rem;
  background: rgba(143, 168, 159, .42);
}
.brand-product {
  color: var(--sg-muted);
  font-size: .65rem;
  font-weight: 680;
  letter-spacing: .16em;
  line-height: 1;
}
.brand-lockup--hero { gap: .75rem; }
.brand-lockup--hero .brand-mark { width: 1.45rem; height: 1.45rem; }
.brand-lockup--hero .brand-name { font-size: 1.45rem; }
.brand-lockup--hero .brand-divider { height: 1.5rem; }
.brand-lockup--hero .brand-product { font-size: .88rem; }

/* Auth page brand text theme overrides */
.auth-page .brand-lockup { color: var(--sg-auth-brand-text); }
.auth-page .brand-name { color: var(--sg-auth-brand-text); }
.auth-page .brand-divider { background: var(--sg-auth-divider); }
.auth-page .brand-product { color: var(--sg-auth-brand-muted); }

.auth-message { max-width: 760px; margin: 5rem 0; }
.auth-message h1 {
  max-width: 700px;
  margin: 0;
  color: var(--sg-auth-brand-text);
  font-size: clamp(3rem, 6vw, 6.4rem);
  font-weight: 650;
  letter-spacing: -.065em;
  line-height: .96;
}
.auth-message p {
  max-width: 580px;
  margin: 2rem 0 0;
  color: var(--sg-auth-brand-p);
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.75;
}
.trust-strip { display: flex; gap: 2rem; color: var(--sg-auth-trust-color); font-size: .75rem; }
.trust-strip span { display: flex; gap: .65rem; align-items: center; }
.auth-form-panel { position: relative; display: grid; min-height: 100vh; padding: 3rem; place-items: center; background: var(--sg-auth-form-bg); }
.auth-form-wrap { width: min(100%, 430px); }
.mobile-brand { display: none; }
.auth-form-wrap h2 { margin: 0; color: var(--sg-auth-text); font-size: 2.35rem; font-weight: 650; letter-spacing: -.04em; }
.auth-intro { margin: .8rem 0 2.2rem; color: var(--sg-auth-text-muted); line-height: 1.65; }
.auth-form { display: grid; gap: 1.45rem; }
.form-label { margin-bottom: .55rem; color: var(--sg-auth-label); font-size: .82rem; font-weight: 620; }
.form-hint { color: var(--sg-auth-hint); font-size: .72rem; }
.form-control {
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  color: var(--sg-text);
  background: var(--sg-input-bg);
  box-shadow: none;
  transition: border-color 140ms var(--sg-ease-out), background-color 140ms var(--sg-ease-out), box-shadow 140ms var(--sg-ease-out);
}
.form-control-lg { min-height: 52px; padding: .8rem 1rem; font-size: .92rem; }
.form-control::placeholder { color: var(--sg-muted); }
.form-control:hover:not(:focus) {
  border-color: var(--sg-border-strong);
}
.form-control:focus {
  border-color: var(--sg-green);
  color: var(--sg-text);
  background: var(--sg-input-focus-bg);
  box-shadow: 0 0 0 3px var(--sg-green-soft);
}

/* Auth page inputs overrides */
.auth-page .form-control {
  border-color: var(--sg-auth-border);
  color: var(--sg-auth-text);
  background: var(--sg-auth-input-bg);
}
.auth-page .form-control:focus {
  background: var(--sg-auth-input-focus-bg);
}

.password-field { position: relative; }
.password-field .form-control { padding-right: 4.3rem; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: .85rem;
  border: 0;
  color: var(--sg-green);
  background: transparent;
  font-size: .75rem;
  font-weight: 650;
  transform: translateY(-50%);
}
.btn {
  border-radius: 8px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 180ms var(--sg-ease-out);
}
.btn-saugra {
  display: inline-flex;
  gap: .85rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  color: var(--sg-btn-text);
  background: linear-gradient(135deg, var(--sg-green) 0%, var(--sg-green-strong) 100%);
  box-shadow: 0 4px 12px var(--sg-btn-shadow);
}
.btn-saugra:hover, .btn-saugra:focus {
  color: var(--sg-btn-text);
  background: linear-gradient(135deg, var(--sg-green-strong) 0%, var(--sg-green) 100%);
  box-shadow: 0 6px 18px var(--sg-btn-shadow-hover);
  transform: translateY(-1px);
}
.btn-outline-saugra {
  border: 1px solid var(--sg-border-strong);
  color: var(--sg-green);
  background: transparent;
}
.btn-outline-saugra:hover {
  border-color: var(--sg-green);
  color: var(--sg-green);
  background: var(--sg-green-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 229, 167, 0.05);
}
.btn-outline-danger {
  border: 1px solid rgba(255, 95, 116, 0.3);
  color: var(--sg-danger);
  background: transparent;
}
.btn-outline-danger:hover, .btn-outline-danger:focus {
  border-color: var(--sg-danger);
  color: var(--sg-danger);
  background: var(--sg-danger-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 95, 116, 0.08);
}
.btn-danger {
  border: 1px solid var(--sg-danger);
  color: #ffffff;
  background: var(--sg-danger);
}
.btn-danger:hover, .btn-danger:focus {
  border-color: #ff8093;
  background: #ff8093;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 95, 116, 0.25);
}
.auth-alert { border: 1px solid rgba(255,127,142,.26); color: #ffc3ca; background: rgba(255,127,142,.08); font-size: .84rem; }
.auth-security-note { display: flex; gap: .9rem; margin-top: 2rem; padding: 1rem 0; border-top: 1px solid var(--sg-auth-border); border-bottom: 1px solid var(--sg-auth-border); }
.shield-mark { color: var(--sg-green); font-size: 1.4rem; }
.auth-security-note p { margin: 0; color: var(--sg-auth-note-p); font-size: .74rem; line-height: 1.55; }
.auth-security-note strong { color: var(--sg-auth-note-strong); }
.auth-footer { margin: 1.2rem 0 0; color: var(--sg-auth-text-muted); font-size: .68rem; text-align: center; }
.tenant-choice-list { display: grid; gap: .8rem; }
.tenant-choice { display: flex; width: 100%; padding: 1rem; align-items: center; justify-content: space-between; border: 1px solid var(--sg-border); border-radius: 8px; color: var(--sg-text); background: var(--sg-surface); text-align: left; }
.tenant-choice:hover { border-color: var(--sg-green); }
.tenant-choice span:first-child { display: flex; flex-direction: column; }
.tenant-choice small { margin-top: .25rem; color: var(--sg-muted); }
.admin-shell { width: min(1200px, calc(100% - 2rem)); margin: 0 auto; padding: 3rem 0; }
.admin-heading { display: flex; margin-bottom: 2rem; align-items: center; justify-content: space-between; }
.admin-heading h1 { margin: 0; }
.admin-panel { min-height: 0; margin-bottom: 1rem; padding: 1.35rem; }
.action-panel[hidden] { display: none !important; }
.action-launcher { flex-wrap: wrap; justify-content: flex-end; }
.action-launcher .btn { min-width: 130px; }
.admin-form-grid { display: grid; grid-template-columns: 1.3fr 1fr .7fr auto; gap: .75rem; }
.identity-table { margin: 0; color: var(--sg-text); }
.identity-table td, .identity-table th { padding: .9rem .85rem; border-color: var(--sg-border); vertical-align: middle; }
.identity-table thead th { background: var(--sg-surface-3); }
.identity-table tbody tr { transition: background 160ms ease; }
.identity-table tbody tr:hover { background: var(--sg-card-inner-bg); }
.identity-table td:first-child { display: flex; flex-direction: column; }
.identity-table small { color: var(--sg-muted); }
.inline-action, .action-cell { display: flex; gap: .5rem; align-items: center; }
.tenant-identity-panel { min-height: auto; }
.tenant-identity-grid { display: grid; gap: 1rem; grid-template-columns: minmax(180px, .45fr) minmax(0, 1fr); }
.tenant-identity-grid > div { display: grid; gap: .45rem; }
.field-caption { color: var(--sg-muted); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.copy-value-row { display: flex; min-width: 0; gap: .65rem; align-items: center; }
.copy-value-row code { flex: 1 1 auto; min-width: 0; padding: .65rem .75rem; overflow-wrap: anywhere; border: 1px solid var(--sg-border); border-radius: 6px; color: var(--sg-green); background: rgba(0, 0, 0, .18); }
.copy-value-row .btn { flex: 0 0 auto; min-width: 76px; }
.one-time-secret { display: grid; margin-bottom: 1rem; padding: 1rem; gap: .4rem; border: 1px solid var(--sg-border-strong); border-radius: 8px; background: var(--sg-green-soft); }
.one-time-secret code { overflow-wrap: anywhere; color: var(--sg-green); }
.one-time-secret small { color: var(--sg-muted); }
.credential-list { display: grid; margin: 1rem 0; padding: 0; gap: .5rem; list-style: none; }
.credential-list li { padding: .8rem; border: 1px solid var(--sg-border); border-radius: 7px; background: var(--sg-surface); }
.security-enroll { grid-template-columns: 1fr auto; margin-top: 1rem; }
.provider-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.provider-metadata { min-height: 12rem; grid-column: 1 / -1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; }

/* Console */
.console-layout { display: grid; min-height: 100vh; grid-template-columns: var(--sg-sidebar) minmax(0, 1fr); background: var(--sg-workspace-bg); }
.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sg-sidebar);
  padding: 1.25rem 1rem;
  overflow-y: auto;
  flex-direction: column;
  border-right: 1px solid var(--sg-border);
  background: var(--sg-sidebar-bg);
  view-transition-name: console-sidebar;
}
.sidebar-header { display: flex; min-height: 48px; padding: 0 .55rem 1.1rem; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--sg-border); }
.sidebar-close { display: none; border: 0; color: var(--sg-muted); background: transparent; font-size: 1.6rem; }
.sidebar-nav { display: flex; margin-top: 1.8rem; flex: 1; flex-direction: column; gap: .25rem; }
.nav-label { margin: 1.25rem .65rem .5rem; color: var(--sg-muted); opacity: 0.85; font-size: .61rem; font-weight: 750; letter-spacing: .17em; text-transform: uppercase; }
.nav-link {
  display: flex;
  min-height: 40px;
  padding: .58rem .75rem;
  gap: .8rem;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--sg-muted);
  font-size: .8rem;
  font-weight: 550;
  text-decoration: none;
  transition: all 180ms var(--sg-ease-out);
}
.nav-link:hover {
  color: var(--sg-text);
  background: var(--sg-surface);
  border-color: var(--sg-border);
}
.nav-link.active {
  border-color: var(--sg-border);
  color: var(--sg-text);
  background: var(--sg-surface);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}
.nav-link-disabled { cursor: default; opacity: .45; }
.nav-link-disabled:hover { color: var(--sg-muted); background: transparent; transform: none; border-color: transparent; }
.nav-icon { width: 1.1rem; color: var(--sg-muted); opacity: 0.8; text-align: center; }
.nav-link.active .nav-icon { color: var(--sg-green); opacity: 1; }
.nav-count { margin-left: auto; padding: .08rem .42rem; border-radius: 999px; color: var(--sg-green); background: var(--sg-surface-3); font-size: .64rem; }
.sidebar-footer { padding: 1rem .5rem 0; border-top: 1px solid var(--sg-border); }
.platform-health { display: flex; gap: .7rem; align-items: center; }
.platform-health div { display: flex; flex-direction: column; }
.platform-health strong { color: var(--sg-text); opacity: 0.9; font-size: .7rem; }
.platform-health small { margin-top: .18rem; color: var(--sg-muted); font-size: .6rem; }
.sidebar-version { margin-top: 1.1rem; color: var(--sg-muted); opacity: 0.6; font-size: .57rem; }
.page-column { grid-column: 2; min-width: 0; background: var(--sg-workspace-bg); }
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 72px;
  padding: 0 clamp(1.25rem, 3vw, 2.65rem);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sg-border);
  background: var(--sg-topbar-bg);
  backdrop-filter: blur(18px);
  view-transition-name: console-topbar;
}
.topbar-left { display: flex; gap: 1rem; align-items: center; }
.breadcrumb-label { color: var(--sg-muted); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; }
.topbar h1 { margin: .1rem 0 0; font-size: 1rem; font-weight: 650; }
.mobile-menu { display: none; border: 0; color: var(--sg-text); background: transparent; font-size: 1.2rem; }
.topbar-actions { display: flex; gap: 1rem; align-items: center; }
.command-button {
  display: flex;
  width: 230px;
  height: 36px;
  padding: 0 .7rem 0 .9rem;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--sg-border);
  border-radius: 7px;
  color: var(--sg-muted);
  background: var(--sg-input-bg);
  font-size: .69rem;
}
kbd { padding: .15rem .38rem; border: 1px solid var(--sg-border); border-radius: 4px; color: var(--sg-muted); background: var(--sg-surface-3); box-shadow: none; font-size: .58rem; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--sg-border); border-radius: 7px; color: var(--sg-muted); background: var(--sg-input-bg); }
.user-avatar { display: grid; width: 34px; height: 34px; border: 1px solid var(--sg-border-strong); border-radius: 7px; color: var(--sg-green); background: var(--sg-green-soft); font-size: .72rem; font-weight: 750; place-items: center; }
.user-meta { display: flex; min-width: 90px; flex-direction: column; }
.user-meta strong { color: var(--sg-text); font-size: .68rem; }
.user-meta small { margin-top: .15rem; color: var(--sg-muted); font-size: .58rem; text-transform: capitalize; }
.topbar-link {
  border: 0;
  color: var(--sg-muted);
  background: transparent;
  font-size: .68rem;
  text-decoration: none;
  transition: color 140ms ease;
}
.topbar-link:hover, .topbar-link.active { color: var(--sg-green); }

/* Theme Switcher and Alignment */
.topbar-divider {
  width: 1px;
  height: 18px;
  background: var(--sg-border);
  margin: 0 0.15rem;
}
.user-profile {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}
.topbar-nav-links {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}
.topbar-nav-links form {
  margin: 0;
  display: flex;
}
.theme-toggle-btn {
  display: grid;
  width: 36px;
  height: 36px;
  border: 1px solid var(--sg-border);
  border-radius: 7px;
  color: var(--sg-muted);
  background: var(--sg-input-bg);
  place-items: center;
  cursor: pointer;
  transition: all 180ms var(--sg-ease-out);
}
.theme-toggle-btn:hover {
  border-color: var(--sg-green);
  color: var(--sg-text);
  background: var(--sg-input-focus-bg);
  box-shadow: 0 0 10px var(--sg-green-soft);
}
[data-bs-theme="light"] .theme-icon-light { display: none; }
[data-bs-theme="light"] .theme-icon-dark { display: block; }

/* Time Range Selector */
.time-range-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.time-range-select {
  height: 38px;
  padding: 0 2.2rem 0 1rem;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  color: var(--sg-muted);
  background: var(--sg-surface);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23809c91'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 0.85rem;
  transition: all 180ms var(--sg-ease-out);
}
.time-range-select:hover, .time-range-select:focus {
  border-color: var(--sg-green);
  color: var(--sg-text);
  outline: none;
  background-color: var(--sg-input-focus-bg);
  box-shadow: 0 0 12px var(--sg-green-soft);
}

.page-content {
  width: min(100%, 1760px);
  margin: 0 auto;
  padding: 2.1rem clamp(1.5rem, 3vw, 3rem) 4rem;
  animation: console-content-enter 280ms var(--sg-ease-out) both;
  view-transition-name: console-content;
}
.page-intro {
  display: flex;
  margin-bottom: 1.35rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  animation: console-item-enter 300ms 30ms var(--sg-ease-out) both;
}
.page-intro h2 { margin: 0; font-size: clamp(1.45rem, 2.4vw, 2.05rem); font-weight: 700; letter-spacing: -.03em; }
.page-intro p { margin: .7rem 0 0; color: var(--sg-muted); font-size: .83rem; }
.intro-actions { display: flex; gap: .7rem; align-items: center; }
.intro-actions .btn { padding: .65rem 1.15rem; font-size: .72rem; }
.metric-grid { display: grid; margin-bottom: 1rem; gap: 1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card, .panel {
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  background: var(--sg-card-bg);
  box-shadow: var(--sg-shadow);
  transition: all 250ms var(--sg-ease-out);
}
.metric-card:hover, .panel:hover {
  border-color: var(--sg-card-hover-border);
  box-shadow: var(--sg-card-hover-shadow);
}
.metric-card { min-height: 144px; padding: 1.15rem 1.25rem; }
.metric-card { animation: console-item-enter 320ms var(--sg-ease-out) both; }
.metric-card:nth-child(1) { animation-delay: 45ms; }
.metric-card:nth-child(2) { animation-delay: 75ms; }
.metric-card:nth-child(3) { animation-delay: 105ms; }
.metric-card:nth-child(4) { animation-delay: 135ms; }
.metric-card.accent { border-color: rgba(74,229,167,.25); }
.metric-heading { display: flex; align-items: center; justify-content: space-between; color: var(--sg-metric-heading); font-size: .72rem; }
.metric-icon { display: grid; width: 27px; height: 27px; border: 1px solid var(--sg-border); border-radius: 6px; color: var(--sg-green); place-items: center; }
.metric-value { display: block; margin: .8rem 0 .65rem; font-size: 2.05rem; font-weight: 700; letter-spacing: -.03em; }
.metric-card p { margin: 0; color: var(--sg-metric-muted); font-size: .65rem; }
.metric-card p .status-dot { margin-right: .38rem; }
.trend-neutral { margin-right: .3rem; color: var(--sg-muted); }
.thin-progress { height: 4px; margin: -.1rem 0 .65rem; background: var(--sg-progress-bg); border-radius: 2px; }
.thin-progress .progress-bar { background: var(--sg-green); border-radius: 2px; }
.operations-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); }
.operations-grid > * { animation: console-item-enter 340ms 150ms var(--sg-ease-out) both; }
.operations-grid > :nth-child(2) { animation-delay: 185ms; }
.panel { min-height: 390px; padding: 1.25rem; }
.panel.compact { min-height: auto; }
.panel-header { display: flex; align-items: start; justify-content: space-between; }
.panel-header h3 { margin: 0; font-size: .93rem; font-weight: 620; }
.panel-header .eyebrow { margin-bottom: .4rem; font-size: .57rem; }
.panel-action { border: 0; color: var(--sg-green); background: transparent; font-size: .66rem; text-decoration: none; transition: color 150ms ease; }
.panel-action:hover { color: #8af5ca; }
.empty-state { display: grid; max-width: 410px; min-height: 300px; margin: 0 auto; text-align: center; place-content: center; }
.empty-radar {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border: 1px solid rgba(74, 229, 167, 0.18);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 229, 167, 0.12), transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-radar::before {
  position: absolute;
  content: "";
  inset: 6px;
  border: 1px solid rgba(74, 229, 167, 0.12);
  border-radius: 50%;
  animation: radar-pulse 3s infinite linear;
}
.empty-radar::after {
  position: absolute;
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sg-green);
  box-shadow: 0 0 20px var(--sg-green);
  animation: radar-glow 2s infinite ease-in-out;
}
@keyframes radar-pulse {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.2); opacity: 0; }
}
@keyframes radar-glow {
  0%, 100% { box-shadow: 0 0 15px var(--sg-green); transform: scale(0.9); }
  50% { box-shadow: 0 0 25px var(--sg-green); transform: scale(1.1); }
}
.empty-state h4 { margin: 0; font-size: .9rem; font-weight: 700; }
.empty-state p { margin: .6rem 0 1rem; color: var(--sg-muted); font-size: .69rem; line-height: 1.65; }
.empty-state .btn { justify-self: center; font-size: .65rem; }
.step-count { padding: .25rem .55rem; border-radius: 999px; color: var(--sg-muted); background: var(--sg-card-inner-bg); font-size: .6rem; }
.readiness-list { display: grid; margin: 1.3rem 0 0; padding: 0; gap: 0; list-style: none; }
.readiness-list li { position: relative; display: flex; min-height: 72px; gap: 0.95rem; padding-bottom: 0.5rem; }
.readiness-list li:not(:last-child)::after { position: absolute; top: 30px; bottom: 3px; left: 14px; width: 1px; content: ""; background: var(--sg-border); }
.readiness-list li > span {
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid var(--sg-border);
  border-radius: 50%;
  color: var(--sg-muted);
  background: rgba(15, 29, 26, 0.8);
  font-size: 0.7rem;
  font-weight: 700;
  place-items: center;
  transition: all 200ms ease;
}
.readiness-list li.complete > span {
  border-color: var(--sg-green);
  color: #040a09;
  background: var(--sg-green);
  box-shadow: 0 0 10px rgba(74, 229, 167, 0.25);
}
.readiness-list li div { display: flex; padding-top: .15rem; flex-direction: column; }
.readiness-list strong { color: var(--sg-text); font-size: .7rem; font-weight: 600; }
.readiness-list small { margin-top: .3rem; color: var(--sg-muted); font-size: .61rem; }
.sidebar-backdrop { display: none; }
.node-table code.fingerprint { color: var(--sg-green); font-size: .65rem; }
.node-table td { vertical-align: middle; }
.admin-content .panel + .panel { margin-top: 1rem; }
.admin-content > .panel { animation: console-item-enter 320ms var(--sg-ease-out) both; }
.admin-content > .panel:nth-of-type(1) { animation-delay: 55ms; }
.admin-content > .panel:nth-of-type(2) { animation-delay: 90ms; }
.admin-content > .panel:nth-of-type(3) { animation-delay: 125ms; }
.admin-content .table-responsive { margin: 1rem -.25rem -.25rem; }
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-responsive .identity-table {
  min-width: 760px;
}
.response-table,
.audit-table,
.policy-table,
.node-table {
  min-width: 920px;
}
.admin-content .identity-table th {
  color: #6f8c82;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.admin-content .identity-table td { color: var(--sg-muted); font-size: .75rem; }
.admin-content .identity-table td:first-child strong { color: var(--sg-text); }
.admin-content .form-control { min-height: 40px; font-size: .78rem; }
.admin-content .btn { white-space: nowrap; }
.action-panel {
  border-color: var(--sg-border-strong);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--sg-green-soft);
}
.action-panel .panel-action {
  padding: .35rem .7rem;
  border: 1px solid var(--sg-border);
  border-radius: 7px;
  color: var(--sg-muted);
  background: var(--sg-input-bg);
}
.action-panel .panel-action:hover {
  border-color: var(--sg-border-strong);
  color: var(--sg-text);
  background: var(--sg-input-focus-bg);
}
.status-badge {
  display: inline-flex;
  padding: .25rem .5rem;
  align-items: center;
  border: 1px solid var(--sg-border);
  border-radius: 999px;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.status-badge.healthy { border-color: var(--sg-green-soft); color: var(--sg-green); background: var(--sg-green-soft); }
.status-badge.danger { border-color: var(--sg-danger-soft); color: var(--sg-danger); background: var(--sg-danger-soft); }
.status-badge.warning { border-color: var(--sg-warning-soft); color: var(--sg-warning); background: var(--sg-warning-soft); }
.status-badge.neutral { border-color: var(--sg-border); color: var(--sg-neutral-badge-color); background: var(--sg-neutral-badge-bg); }
.list-toolbar {
  display: flex;
  min-height: 42px;
  margin: 0 0 .8rem;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  color: var(--sg-muted);
  font-size: .72rem;
}
.pagination-controls {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}
.page-count {
  color: var(--sg-card-inner-text);
  font-size: .68rem;
}
.btn.disabled {
  opacity: .48;
  pointer-events: none;
}
.record-title {
  display: block;
  color: var(--sg-text);
  font-size: .88rem;
}
.record-meta {
  color: var(--sg-muted);
  font-size: .76rem;
}
.metadata-row {
  display: flex;
  margin-top: .3rem;
  gap: .45rem;
  align-items: center;
  color: var(--sg-muted);
  font-size: .7rem;
  flex-wrap: wrap;
}
.metadata-row span:not(:last-child)::after {
  margin-left: .45rem;
  color: var(--sg-border-strong);
  content: "/";
}
.action-strip {
  display: grid;
  max-width: 520px;
  gap: .55rem;
}
.empty-state.compact {
  min-height: 150px;
}
.one-time-secret {
  border: 1px solid var(--sg-green);
  border-radius: 8px;
  background: var(--sg-green-soft);
}
.one-time-secret strong {
  color: var(--sg-text);
  font-size: .95rem;
}
.one-time-secret small {
  color: var(--sg-muted);
  font-size: .72rem;
}
.one-time-secret-icon {
  color: var(--sg-green);
}
.one-time-secret-value {
  border: 1px solid var(--sg-border);
  border-radius: 4px;
  color: var(--sg-green);
  background: rgba(0, 0, 0, .2);
  font-size: .95rem;
  word-break: break-all;
}
.telemetry-context-column {
  min-height: 10rem;
  padding: 1rem;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  background: var(--sg-card-inner-bg);
}
.telemetry-facet {
  min-height: 2.25rem;
  gap: .75rem;
  padding: .45rem .6rem;
  border: 1px solid var(--sg-border);
  border-radius: 6px;
  color: var(--sg-card-inner-text);
  font-size: .78rem;
}
.telemetry-facet span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.policy-warning { border: 1px solid var(--sg-warning-soft); color: var(--sg-warning); background: var(--sg-warning-soft); }
.policy-warning p { color: var(--sg-warning); font-size: .8rem; line-height: 1.5; }
.code-editor-pane {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 0.78rem !important;
  line-height: 1.5 !important;
  background-color: var(--sg-pre-bg) !important;
  color: var(--sg-pre-text) !important;
  border: 1px solid var(--sg-border) !important;
  border-radius: 8px !important;
  padding: 0.75rem !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  transition: all 180ms var(--sg-ease-out);
}
.code-editor-pane:focus {
  border-color: var(--sg-green) !important;
  box-shadow: 0 0 0 3px var(--sg-green-soft), inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  background-color: var(--sg-input-focus-bg) !important;
  color: var(--sg-text) !important;
}
.policy-editor-grid { display: grid; margin-bottom: 1rem; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.policy-editor-grid.compact { margin: 1rem 0 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.policy-form { display: grid; gap: .75rem; }
.policy-form-row { display: grid; gap: .65rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.policy-json { min-height: 9rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; }
.policy-check { display: flex; min-height: 40px; gap: .5rem; align-items: center; color: var(--sg-muted); font-size: .72rem; }
.policy-actions { min-width: 300px; }
.policy-table code.fingerprint { color: var(--sg-green); font-size: .65rem; }
.queue-filter, .investigation-create { display: grid; margin-bottom: 1rem; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.queue-action { display: flex; margin-bottom: .45rem; gap: .4rem; align-items: center; }
.queue-case { margin-bottom: 0; }
.severity-critical {
  border-color: rgba(255, 95, 116, 0.3);
  color: #ff8093;
  background: rgba(255, 95, 116, 0.08);
}
.severity-high {
  border-color: rgba(255, 143, 92, 0.3);
  color: #ffaa80;
  background: rgba(255, 143, 92, 0.08);
}
.severity-medium {
  border-color: rgba(244, 196, 102, 0.25);
  color: #f5d07a;
  background: rgba(244, 196, 102, 0.06);
}
.severity-low {
  border-color: rgba(100, 181, 246, 0.25);
  color: #90caf9;
  background: rgba(100, 181, 246, 0.06);
}
.investigation-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.investigation-card {
  display: grid;
  min-height: 260px;
  padding: 1.2rem;
  gap: 1rem;
  align-content: space-between;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  color: inherit;
  background: var(--sg-card-bg);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.investigation-card:hover,
.investigation-card:focus-visible {
  border-color: var(--sg-card-hover-border);
  color: inherit;
  transform: translateY(-1px);
  box-shadow: var(--sg-card-hover-shadow);
}
.investigation-card h3 {
  margin: .55rem 0 0;
  color: var(--sg-text);
  font-size: 1rem;
  line-height: 1.35;
}
.investigation-card p {
  margin: .75rem 0 0;
  color: var(--sg-muted);
  font-size: .78rem;
  line-height: 1.55;
}
.case-next-action {
  padding: .65rem .75rem;
  border: 1px solid var(--sg-border);
  border-radius: 7px;
  color: var(--sg-card-inner-text);
  background: var(--sg-card-inner-bg);
  font-size: .72rem;
  font-weight: 650;
}
.case-meta {
  display: flex;
  padding-top: .8rem;
  gap: .7rem;
  border-top: 1px solid var(--sg-border);
  color: var(--sg-muted);
  font-size: .65rem;
  flex-wrap: wrap;
}
.case-empty {
  grid-column: 1 / -1;
  max-width: 520px;
}
.case-layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) 340px; }
.case-primary, .case-sidebar { display: grid; align-content: start; gap: 1rem; }
.investigation-detail .page-intro p {
  max-width: 820px;
}
.case-id-row {
  max-width: 720px;
  margin-top: .8rem;
}
.case-tags { display: flex; margin-top: .8rem; gap: .4rem; flex-wrap: wrap; }
.case-fact-strip {
  display: grid;
  margin-bottom: 1rem;
  gap: .75rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.case-fact-strip div {
  min-width: 0;
  padding: .85rem;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  background: var(--sg-card-bg);
}
.case-fact-strip span,
.compact-label {
  color: var(--sg-muted);
  font-size: .62rem;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.case-fact-strip strong {
  display: block;
  margin-top: .25rem;
  overflow-wrap: anywhere;
  color: var(--sg-text);
  font-size: .78rem;
}
.evidence-list { display: grid; margin-top: 1rem; gap: .75rem; }
.evidence-list.compact { max-height: 500px; overflow-y: auto; }
.evidence-item { padding: 1rem; border: 1px solid var(--sg-border); border-radius: 8px; background: var(--sg-card-inner-bg); }
.evidence-heading,
.related-event-item {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
}
.evidence-heading > div {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.evidence-heading strong,
.related-event-item strong {
  color: var(--sg-text);
  font-size: .78rem;
}
.evidence-item p { margin: .55rem 0; color: var(--sg-muted); font-size: .72rem; }
.compact-metadata {
  display: flex;
  margin: .7rem 0;
  gap: .5rem;
  align-items: center;
  color: var(--sg-muted);
  font-size: .68rem;
  flex-wrap: wrap;
}
.compact-metadata code {
  color: var(--sg-green);
}
.evidence-entities { display: flex; margin: .75rem 0; gap: .35rem; flex-wrap: wrap; }
.evidence-details-block summary {
  cursor: pointer;
  display: inline-block;
}
.evidence-item pre, .timeline pre { max-height: 260px; margin: .7rem 0 0; padding: .75rem; overflow: auto; color: var(--sg-pre-text); background: var(--sg-pre-bg); border: 1px solid var(--sg-border); border-radius: 6px; font-size: .65rem; white-space: pre-wrap; }
.comment-form { display: grid; margin: 1rem 0; gap: .7rem; grid-template-columns: 1fr auto; }
.timeline { display: grid; margin-top: 1rem; }
.timeline article { position: relative; display: grid; min-height: 64px; padding-left: 1.8rem; grid-template-columns: 1fr; }
.timeline article::before { position: absolute; top: 10px; bottom: -5px; left: 5px; width: 1px; content: ""; background: var(--sg-border); }
.timeline-dot { position: absolute; z-index: 1; top: 7px; left: 1px; width: 9px; height: 9px; border-radius: 50%; background: var(--sg-green); }
.timeline strong, .timeline small { display: block; }
.timeline small { color: var(--sg-muted); font-size: .62rem; }
.timeline summary {
  width: max-content;
  color: var(--sg-muted);
  cursor: pointer;
  font-size: .68rem;
}
.case-comment, .summary-card, .linked-alert { display: grid; margin: .8rem 0 0; padding: .9rem; gap: .35rem; border: 1px solid var(--sg-border); border-radius: 8px; background: var(--sg-card-inner-bg); }
.case-comment {
  border-left: 3px solid var(--sg-green);
  border-radius: 0 8px 8px 0;
}
.case-comment strong,
.summary-card strong,
.linked-alert strong {
  color: var(--sg-text);
  font-size: .78rem;
}
.case-comment p, .summary-card p { margin: 0; color: var(--sg-card-inner-text); font-size: .76rem; line-height: 1.6; }
.case-comment small, .summary-card small, .linked-alert small { color: var(--sg-muted); font-size: .62rem; }
.summary-card code {
  color: var(--sg-green);
  font-size: .62rem;
}
.panel-note {
  margin: 0;
  color: var(--sg-muted);
  font-size: .78rem;
  line-height: 1.5;
}
.panel-divider {
  border-color: var(--sg-border);
}
.readonly-facts {
  color: var(--sg-card-inner-text);
  font-size: .82rem;
}
.case-tag-form { margin-top: 1rem; }
.response-create-grid { display: grid; gap: .75rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.response-reason { min-height: 84px; grid-column: span 2; }
.response-safety-note { margin: 1rem 0 0; color: var(--sg-warning); font-size: .72rem; }
.response-policy-grid { display: flex; flex-wrap: wrap; gap: .8rem; }
.response-policy-card { padding: 1rem; border: 1px solid var(--sg-border); border-radius: 8px; background: transparent; width: calc(20% - 0.64rem); }
.response-policy-card > div { display: flex; margin-bottom: .8rem; align-items: center; justify-content: space-between; }
.response-policy-bounds { display: grid; gap: .5rem; grid-template-columns: 1fr 1fr; }
.response-table p { min-width: 220px; margin: 0 0 .35rem; color: var(--sg-card-inner-text); font-size: .7rem; }
.response-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.response-review-panel {
  display: grid;
  padding: 1rem;
  gap: 1rem;
  grid-template-columns: minmax(220px, .75fr) minmax(0, 1.25fr) auto;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  background: var(--sg-card-inner-bg);
}
.response-review-panel h4 {
  margin: 0 0 .45rem;
  color: var(--sg-text);
  font-size: .95rem;
}
.response-review-panel p {
  margin: 0;
  color: var(--sg-muted);
  font-size: .72rem;
  line-height: 1.55;
}
.compact-facts {
  display: grid;
  margin: 0;
  gap: .55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.compact-facts div {
  min-width: 0;
}
.compact-facts dt {
  color: var(--sg-muted);
  font-size: .58rem;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.compact-facts dd {
  margin: .12rem 0 0;
  color: var(--sg-card-inner-text);
  font-size: .72rem;
  overflow-wrap: anywhere;
}
.response-review-actions {
  display: flex;
  gap: .5rem;
  align-items: start;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.relay-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.relay-card { padding: 1.25rem; }
.relay-metrics { display: grid; margin: 1rem 0; gap: .7rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.relay-metrics div { padding: .75rem; border: 1px solid var(--sg-border); border-radius: 7px; background: var(--sg-card-inner-bg); }
.relay-metrics strong, .relay-metrics small { display: block; }
.relay-metrics strong { color: var(--sg-green); font-size: 1.1rem; }
.relay-metrics small { color: var(--sg-muted); font-size: .62rem; }
.relay-revoke-form { margin-top: .75rem; }

/* Dashboard cockpit */
.dashboard-intro {
  margin-bottom: 1rem;
  align-items: flex-end;
}
.dashboard-intro h2 {
  font-size: clamp(2rem, 3vw, 3.15rem);
  letter-spacing: 0;
  line-height: 1.05;
}
.dashboard-intro p {
  max-width: 720px;
  font-size: .92rem;
}
.dashboard-toolbar {
  display: grid;
  margin-bottom: 1rem;
  padding: .95rem;
  gap: .75rem;
  grid-template-columns: repeat(5, minmax(135px, 1fr)) minmax(220px, 1.4fr);
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  background: var(--sg-card-bg);
  box-shadow: var(--sg-shadow);
}
.dashboard-toolbar label {
  display: grid;
  gap: .38rem;
  margin: 0;
}
.dashboard-toolbar label > span {
  color: var(--sg-muted);
  font-size: .6rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dashboard-toolbar .form-control {
  min-height: 38px;
  color: var(--sg-text);
  font-size: .72rem;
}
.dashboard-toolbar .toolbar-search input {
  padding-left: .9rem;
}
.dashboard-metrics {
  grid-template-columns: minmax(240px, 1.25fr) repeat(5, minmax(170px, 1fr));
  gap: .9rem;
  margin-bottom: .9rem;
}
.dashboard-metrics .metric-card {
  min-height: 166px;
  display: flex;
  flex-direction: column;
}
.metric-card-score {
  border-color: rgba(74, 229, 167, .24);
  background: linear-gradient(180deg, rgba(74, 229, 167, .08), transparent 70%), var(--sg-card-bg);
}
.metric-value span {
  margin-left: .25rem;
  color: var(--sg-muted);
  font-size: .95rem;
  font-weight: 650;
}
.metric-status-row {
  display: flex;
  min-height: 26px;
  gap: .55rem;
  align-items: center;
  justify-content: space-between;
}
.metric-trend {
  color: var(--sg-muted);
  font-size: .62rem;
  text-align: right;
}
.metric-icon.healthy { color: var(--sg-green); background: var(--sg-green-soft); }
.metric-icon.info { color: var(--sg-info); background: var(--sg-info-soft); }
.metric-icon.warning { color: var(--sg-warning); background: var(--sg-warning-soft); }
.metric-icon.critical { color: var(--sg-danger); background: var(--sg-danger-soft); }
.metric-icon.neutral { color: var(--sg-neutral-badge-color); background: var(--sg-neutral-badge-bg); }
.score-progress {
  width: 100%;
  height: 7px;
  margin-top: auto;
  overflow: hidden;
  border-radius: 999px;
  background: var(--sg-progress-bg);
}
.score-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--sg-green);
}
.score-progress.info span { background: var(--sg-info); }
.score-progress.warning span { background: var(--sg-warning); }
.score-progress.danger span { background: var(--sg-danger); }
.mini-sparkline {
  display: flex;
  height: 26px;
  margin-top: auto;
  gap: 4px;
  align-items: end;
}
.mini-sparkline span {
  flex: 1;
  min-width: 5px;
  border-radius: 999px 999px 0 0;
  background: rgba(255, 95, 116, .28);
}
.mini-sparkline span:nth-child(1) { height: 35%; }
.mini-sparkline span:nth-child(2) { height: 48%; }
.mini-sparkline span:nth-child(3) { height: 42%; }
.mini-sparkline span:nth-child(4) { height: 72%; }
.mini-sparkline span:nth-child(5) { height: 64%; }
.mini-sparkline span:nth-child(6) { height: 88%; background: var(--sg-danger); }
.dashboard-grid {
  display: grid;
  gap: .9rem;
  grid-template-columns: minmax(0, 1.7fr) minmax(340px, .7fr);
}
.dashboard-grid-secondary {
  margin-top: .9rem;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .55fr);
}
.alert-panel,
.health-panel,
.ai-summary-card,
.trend-panel,
.telemetry-panel {
  min-height: 0;
}
.dashboard-table-wrap {
  margin-top: 1rem;
}
.dashboard-list-controls {
  display: grid;
  margin-top: .9rem;
  gap: .65rem;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}
.dashboard-list-controls label:first-child {
  grid-column: span 2;
}
.dashboard-list-controls label {
  display: grid;
  gap: .35rem;
  margin: 0;
}
.dashboard-list-controls label > span {
  color: var(--sg-muted);
  font-size: .58rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dashboard-list-controls .form-control {
  min-height: 36px;
  font-size: .7rem;
}
.dashboard-list-pagination {
  margin: .85rem 0 0;
}
.dashboard-list-empty {
  color: var(--sg-muted);
  font-size: .74rem;
  text-align: center;
}
tr.dashboard-list-empty td {
  padding: 1rem;
}
.dashboard-alert-table {
  min-width: 980px;
}
.dashboard-alert-table th {
  color: var(--sg-muted);
  font-size: .62rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.dashboard-alert-table td {
  padding: 1rem .85rem;
  font-size: .75rem;
}
.dashboard-alert-table td:first-child strong,
.dashboard-alert-table td:first-child small {
  display: block;
}
.dashboard-alert-table code {
  color: var(--sg-green);
  overflow-wrap: anywhere;
  font-size: .68rem;
}
.critical-row {
  background: linear-gradient(90deg, rgba(255, 95, 116, .09), transparent 44%);
}
.badge-icon {
  margin-right: .32rem;
  font-weight: 900;
}
.sla-breached {
  box-shadow: 0 0 0 3px rgba(255, 95, 116, .08);
}
.node-chip {
  display: inline-flex;
  max-width: 190px;
  padding: .28rem .48rem;
  overflow: hidden;
  border: 1px solid var(--sg-border);
  border-radius: 999px;
  color: var(--sg-card-inner-text);
  background: var(--sg-card-inner-bg);
  font-size: .66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.risk-meter {
  display: grid;
  min-width: 118px;
  gap: .25rem;
  grid-template-columns: 1fr auto;
  align-items: center;
}
.risk-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--sg-progress-bg);
}
.risk-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sg-warning), var(--sg-danger));
}
.risk-meter strong {
  color: var(--sg-text);
  font-size: .72rem;
}
.risk-meter small {
  grid-column: 1 / -1;
  color: var(--sg-muted);
  font-size: .58rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.status-badge.info {
  border-color: var(--sg-info-soft);
  color: var(--sg-info);
  background: var(--sg-info-soft);
}
.health-card-list {
  display: grid;
  margin-top: 1rem;
  gap: .75rem;
}
.health-card {
  display: grid;
  padding: .9rem;
  gap: .55rem;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  background: var(--sg-card-inner-bg);
}
.health-card > div:first-child {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
}
.health-card strong {
  color: var(--sg-text);
  font-size: .78rem;
}
.health-card span {
  color: var(--sg-green);
  font-size: .82rem;
  font-weight: 750;
}
.health-card small {
  color: var(--sg-muted);
  font-size: .63rem;
  line-height: 1.5;
}
.ai-summary-card p {
  margin: 1rem 0;
  color: var(--sg-card-inner-text);
  font-size: .82rem;
  line-height: 1.7;
}
.next-action-grid {
  display: grid;
  gap: .55rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.next-action-grid a {
  min-height: 42px;
  padding: .7rem .75rem;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  color: var(--sg-text);
  background: var(--sg-card-inner-bg);
  font-size: .72rem;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}
.next-action-grid a:hover,
.next-action-grid a:focus {
  border-color: var(--sg-border-strong);
  color: var(--sg-green);
  outline: none;
}
.trend-bars {
  display: flex;
  height: 150px;
  margin: 1.2rem 0 1rem;
  gap: .55rem;
  align-items: end;
}
.trend-bars span {
  flex: 1;
  min-width: 14px;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, var(--sg-info), rgba(100, 181, 246, .22));
}
.widget-list {
  display: grid;
  gap: .5rem;
}
.widget-list div {
  display: flex;
  padding: .65rem 0;
  gap: .7rem;
  justify-content: space-between;
  border-top: 1px solid var(--sg-border);
}
.widget-list strong {
  color: var(--sg-text);
  font-size: .72rem;
}
.widget-list span {
  color: var(--sg-muted);
  font-size: .66rem;
  text-align: right;
}
.telemetry-timeline {
  display: grid;
  margin-top: 1rem;
}
.telemetry-timeline article {
  position: relative;
  display: grid;
  padding-left: 1.5rem;
}
.telemetry-timeline article:not(:last-child) {
  padding-bottom: .75rem;
}
.telemetry-timeline article:not(:last-child)::before {
  position: absolute;
  top: 12px;
  bottom: -2px;
  left: 5px;
  width: 1px;
  content: "";
  background: var(--sg-border);
}
.telemetry-timeline .timeline-dot {
  top: .9rem;
}
.severity-dot-critical { background: var(--sg-danger); }
.severity-dot-high { background: #ff8f5c; }
.severity-dot-medium { background: var(--sg-warning); }
.severity-dot-low { background: var(--sg-info); }
.timeline-card {
  display: grid;
  min-height: 72px;
  padding: .85rem .95rem;
  gap: .75rem;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  background: var(--sg-card-inner-bg);
}
.timeline-main strong {
  display: block;
  color: var(--sg-text);
  font-size: .82rem;
}
.timeline-main small {
  color: var(--sg-muted);
  font-size: .64rem;
}
.timeline-badges {
  display: flex;
  gap: .4rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.risk-pill {
  display: inline-flex;
  padding: .25rem .5rem;
  border: 1px solid rgba(244, 196, 102, .18);
  border-radius: 999px;
  color: var(--sg-warning);
  background: var(--sg-warning-soft);
  font-size: .6rem;
  font-weight: 750;
  text-transform: uppercase;
}


@keyframes console-content-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes console-item-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

::view-transition-group(console-sidebar),
::view-transition-group(console-topbar) {
  animation-duration: 160ms;
}

::view-transition-old(console-content) {
  animation: 110ms ease both console-view-old;
}

::view-transition-new(console-content) {
  animation: 220ms var(--sg-ease-out) both console-view-new;
}

@keyframes console-view-old {
  to { opacity: 0; transform: translateY(-3px); }
}

@keyframes console-view-new {
  from { opacity: 0; transform: translateY(5px); }
}

.auth-theme-toggle {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10;
}
.auth-page .theme-toggle-btn {
  border-color: var(--sg-auth-border);
  color: var(--sg-auth-text-muted);
  background: var(--sg-auth-input-bg);
}
.auth-page .theme-toggle-btn:hover {
  border-color: var(--sg-green);
  color: var(--sg-auth-text);
  background: var(--sg-auth-input-focus-bg);
}

@media (max-width: 1120px) {
  .auth-shell { grid-template-columns: 1fr 480px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .response-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .response-review-panel { grid-template-columns: 1fr; }
  .dashboard-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-list-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid,
  .dashboard-grid-secondary { grid-template-columns: 1fr; }
  .operations-grid { grid-template-columns: 1fr; }
  .admin-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .policy-editor-grid.compact { grid-template-columns: 1fr; }
  .policy-form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-layout { grid-template-columns: 1fr; }
  .case-fact-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .queue-filter, .investigation-create { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .response-policy-card { width: calc(33.33% - 0.54rem); }
  .relay-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .auth-shell { display: block; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { min-height: 100vh; padding: 2rem 1.4rem; }
  .mobile-brand { display: flex; margin-bottom: 4rem; align-items: center; }
  .console-layout { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .mobile-menu { display: block; }
  .page-column { width: 100%; }
  .sidebar-backdrop { position: fixed; z-index: 30; inset: 0; background: rgba(0,0,0,.58); }
  .sidebar-backdrop.visible { display: block; }
  .command-button, .user-meta { display: none; }
  .provider-form-grid { grid-template-columns: 1fr; }
  .provider-metadata { grid-column: auto; }
  .policy-editor-grid { grid-template-columns: 1fr; }
  .investigation-grid { grid-template-columns: 1fr; }
  .relay-grid { grid-template-columns: 1fr; }
  .response-create-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .response-policy-card { width: calc(50% - 0.4rem); }
  .timeline-card { grid-template-columns: 1fr; }
  .timeline-badges { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .topbar { height: 66px; padding: 0 1rem; }
  .page-content { padding: 2rem 1rem 3rem; }
  .page-intro { align-items: start; flex-direction: column; }
  .intro-actions { width: 100%; margin-top: 1.4rem; }
  .intro-actions .btn { flex: 1; }
  .dashboard-intro h2 { font-size: 2rem; }
  .dashboard-toolbar,
  .dashboard-list-controls,
  .dashboard-metrics,
  .response-metrics,
  .next-action-grid { grid-template-columns: 1fr; }
  .dashboard-list-controls label:first-child { grid-column: auto; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 145px; }
  .topbar-actions .icon-button { display: none; }
  .user-menu { margin-left: 0; }
  .topbar-link { padding: .5rem 0; }
  .admin-form-grid, .security-enroll, .tenant-identity-grid { grid-template-columns: 1fr; }
  .action-cell, .inline-action { align-items: stretch; flex-direction: column; }
  .policy-form-row { grid-template-columns: 1fr; }
  .case-fact-strip { grid-template-columns: 1fr; }
  .queue-filter, .investigation-create, .comment-form { grid-template-columns: 1fr; }
  .queue-action { align-items: stretch; flex-direction: column; }
  .response-create-grid { grid-template-columns: 1fr; }
  .response-policy-card { width: 100%; }
  .response-reason { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }

  .nav-link:hover,
  .metric-card:hover,
  .panel:hover {
    transform: none;
  }
}
