/* ============================================================================
   SAMARIA SMS — Premium "Light Operations" design system
   Aviation-grade operations console: dark navy nav rail + crisp light canvas,
   hairline borders, precise shadows, tabular data, restrained semantic accents.
   Loaded globally via shared.js so every page inherits the same language.
   Tokens are CSS variables; component classes are intentionally low-collision.
   ========================================================================== */

:root {
  /* Brand navy ramp (nav rail / command frame) */
  --navy-950:#07121a; --navy-900:#0b1720; --navy-850:#101d27;
  --navy-800:#152632; --navy:#07121a; --navy-700:#165f83;

  /* Primary / structure (interactive) — the brand spine */
  --primary:#217eaa; --primary-600:#165f83; --primary-50:#e8f2f6; --primary-100:#d6e8ee;

  /* Brand accent — the ONLY decorative accent: logo, active nav, primary CTA.
     Single accent (from the orange diamond logo) keeps the UI disciplined. */
  --brand-accent:#c47b30; --brand-accent-600:#9a6127; --brand-accent-50:#f4e5d4;

  /* Semantic status — used ONLY to convey data meaning, never decoration */
  --critical:#b94a48; --critical-600:#8f3735; --critical-50:#f5dddd;
  --warning:#c47b30;  --warning-500:#b06a28;  --warning-50:#f4e5d4;
  --ok:#2f9b73;       --ok-50:#dcefe7;
  --info:#217eaa;     --info-50:#e8f2f6;

  /* Neutral ink + lines (cool slate, not lavender) */
  --ink-900:#07121a; --ink-800:#13232e; --ink-700:#415d67;
  --ink-500:#5f7881; --ink-400:#8ca4ac; --ink-300:#a8bdc4;
  --line:#d6e0e3; --line-soft:#e5ecef;
  --surface:#eeeeee; --surface-2:#f2f2f3; --bg:#f2f2f3;

  /* Geometry */
  --r-lg:16px; --r:13px; --r-sm:9px; --r-pill:999px;
  --shadow-sm:0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.05);
  --shadow-md:0 2px 4px rgba(16,24,40,.04), 0 6px 16px rgba(16,24,40,.07);
  --shadow-lg:0 12px 32px rgba(7,18,26,.14);
  --ring:0 0 0 3px rgba(33,126,170,.20);
}

/* ── Global baseline ──────────────────────────────────────────────────────── */
html, body { -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }
body {
  background:
    radial-gradient(1200px 600px at 78% -10%, rgba(33,126,170,.08), transparent 60%),
    radial-gradient(900px 500px at -5% 0%, rgba(125,156,183,.12), transparent 55%),
    var(--bg) !important;
  color:var(--ink-900);
}
::selection { background:rgba(33,126,170,.18); }

/* Refined, quiet scrollbars */
* { scrollbar-width:thin; scrollbar-color:#cdd2df transparent; }
*::-webkit-scrollbar { width:10px; height:10px; }
*::-webkit-scrollbar-thumb { background:#cdd2df; border-radius:99px; border:2px solid transparent; background-clip:content-box; }
*::-webkit-scrollbar-thumb:hover { background:#aab2c5; background-clip:content-box; }

/* Visible keyboard focus everywhere (a11y) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline:none; box-shadow:var(--ring); border-radius:var(--r-sm);
}

.tnum { font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; }
.mono { font-family:"JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

/* ============================================================================
   NAV RAIL (dark navy command frame) — markup built in shared.js renderNav()
   #sidebar.nav-rail beats the per-page `#sidebar{background:#f8fafc}` rule.
   ========================================================================== */
#sidebar.nav-rail {
  position:fixed;
  inset:0 auto 0 0;
  z-index:100;
  width:256px;
  height:100dvh;
  display:flex;
  flex-direction:column;
  background:linear-gradient(185deg, var(--navy-900) 0%, var(--navy-850) 46%, var(--navy-800) 100%);
  border-right:1px solid rgba(255,255,255,.06);
  box-shadow:1px 0 0 rgba(10,8,40,.4), 14px 0 40px -28px rgba(10,8,40,.5);
  padding:20px 0 18px;
  overflow:hidden;
}
.nav-rail .nav-brand { padding:2px 22px 22px; display:flex; align-items:center; gap:12px; }
.nav-rail .nav-brand__mark {
  width:42px; height:42px; border-radius:11px; flex-shrink:0;
  background:radial-gradient(120% 120% at 30% 20%, #15123a, #0A0F14);
  display:flex; align-items:center; justify-content:center;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08), 0 4px 10px rgba(0,0,0,.35);
}
.nav-rail .nav-brand__name { font-size:16px; font-weight:800; letter-spacing:.14em; color:#fff; line-height:1.1; }
.nav-rail .nav-brand__sub  { font-size:10.5px; font-weight:600; letter-spacing:.04em; color:#8ca4ac; margin-top:3px; }

.nav-rail .nav-section {
  padding:0 16px 4px; margin:6px 8px 4px; font-size:10px; font-weight:700;
  letter-spacing:.14em; text-transform:uppercase; color:#8ca4ac;
}
.nav-rail #nav-items { flex:1; padding:6px 12px; display:flex; flex-direction:column; gap:3px; overflow-y:auto; }

.nav-rail .nav-link {
  position:relative; display:flex; align-items:center; gap:10px;
  min-height:44px; padding:8px 11px; border-radius:10px; font-size:13.5px; font-weight:500;
  color:#c7d4d8; text-decoration:none; transition:background .15s, color .15s;
}
.nav-rail .nav-link .material-symbols-outlined {
  width:28px; height:28px; border-radius:8px;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:18px; color:#8ca4ac;
  background:rgba(140,164,172,.10);
  border:1px solid rgba(140,164,172,.16);
  transition:color .15s, background .15s, border-color .15s, transform .15s;
}
.nav-rail .nav-link:hover { background:rgba(255,255,255,.06); color:#fff; }
.nav-rail .nav-link:hover .material-symbols-outlined {
  color:#fff; background:rgba(33,126,170,.18); border-color:rgba(33,126,170,.28);
}
.nav-rail .nav-link.is-active {
  background:rgba(255,255,255,.08); color:#fff; font-weight:600;
}
.nav-rail .nav-link.is-active::before {
  content:""; position:absolute; left:-12px; top:50%; transform:translateY(-50%);
  width:3px; height:20px; border-radius:0 3px 3px 0; background:#c47b30;
}
.nav-rail .nav-link.is-active .material-symbols-outlined {
  color:#fff; background:linear-gradient(135deg, rgba(33,126,170,.48), rgba(196,123,48,.28));
  border-color:rgba(196,123,48,.38); font-variation-settings:'FILL' 1,'wght' 520,'GRAD' 0,'opsz' 24;
}
.nav-rail .nav-sep { height:1px; margin:8px 14px; background:rgba(255,255,255,.07); }

.nav-rail .nav-foot { padding:14px 16px 2px; display:flex; flex-direction:column; gap:9px; }
.nav-rail .nav-cta {
  width:100%; border:none; cursor:pointer; border-radius:10px; padding:11px;
  font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  display:flex; align-items:center; justify-content:center; gap:8px; color:#fff;
  background:linear-gradient(180deg, #217eaa, #165f83);
  box-shadow:0 6px 16px -4px rgba(33,126,170,.38), inset 0 1px 0 rgba(255,255,255,.18);
  transition:transform .12s, box-shadow .15s, filter .15s;
}
.nav-rail .nav-cta:hover { filter:brightness(1.05); box-shadow:0 8px 20px -4px rgba(33,126,170,.44); }
.nav-rail .nav-cta:active { transform:translateY(1px); }
.nav-rail .nav-signout {
  width:100%; cursor:pointer; border-radius:10px; padding:9px;
  font-size:12px; font-weight:600; display:flex; align-items:center; justify-content:center; gap:8px;
  color:#a8bdc4; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.09);
  transition:background .15s, color .15s;
}
.nav-rail .nav-signout:hover { background:rgba(255,255,255,.09); color:#fff; }
.tenant-session { display:flex; flex-direction:column; gap:8px; }
.tenant-session:empty { display:none; }
.tenant-session-card {
  display:grid; grid-template-columns:28px minmax(0, 1fr); gap:9px; align-items:center;
  padding:10px; border-radius:10px; color:#e8eef5;
  background:rgba(255,255,255,.06); border:1px solid rgba(196,123,48,.28);
}
.tenant-session-card .material-symbols-outlined {
  color:#f3b56f; font-size:18px; width:28px; height:28px; display:grid; place-items:center;
  border-radius:8px; background:rgba(196,123,48,.12);
}
.tenant-session-card__label {
  font-size:10px; line-height:1.1; text-transform:uppercase; letter-spacing:.08em; color:#a8bdc4;
}
.tenant-session-card__name {
  margin-top:2px; font-size:12px; line-height:1.2; font-weight:700; color:#fff;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.tenant-session-exit { color:#f0c9a4 !important; border-color:rgba(196,123,48,.28) !important; }

/* ============================================================================
   TOP BAR
   ========================================================================== */
.app-topbar {
  background:rgba(255,255,255,.85); backdrop-filter:saturate(140%) blur(8px);
  border-bottom:1px solid var(--line); height:62px; display:flex; align-items:center;
  justify-content:space-between; padding:0 26px; position:sticky; top:0; z-index:10;
}
.app-topbar__crumb { font-size:12.5px; color:var(--ink-500); }
.live-pill {
  display:inline-flex; align-items:center; gap:7px; font-size:12px; font-weight:600;
  color:var(--ok); background:var(--ok-50); border:1px solid #b6ecd2;
  padding:5px 11px; border-radius:var(--r-pill);
}
.live-pill .dot { width:7px; height:7px; border-radius:50%; background:var(--ok); animation:pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ============================================================================
   BUTTONS
   ========================================================================== */
.btn { min-height:44px; display:inline-flex; align-items:center; justify-content:center; gap:7px; cursor:pointer; border:1px solid transparent;
  font-size:13px; font-weight:600; padding:8px 15px; border-radius:10px; text-decoration:none;
  transition:background .15s, box-shadow .15s, transform .1s, filter .15s; line-height:1; }
.btn:active { transform:translateY(1px); }
.btn--primary { background:var(--primary); color:#fff; box-shadow:0 4px 12px -4px rgba(33,126,170,.45); }
.btn--primary:hover { background:var(--primary-600); }
.btn--ghost { background:var(--surface); color:var(--primary); border-color:var(--line); box-shadow:var(--shadow-sm); }
.btn--ghost:hover { background:var(--surface-2); border-color:var(--ink-300); }

/* ============================================================================
   PAGE HEADER
   ========================================================================== */
.page-h1 { font-size:26px; font-weight:750; letter-spacing:-.02em; color:var(--ink-900); margin:0; }
.page-sub { color:var(--ink-500); font-size:13.5px; margin:5px 0 0; }

/* ============================================================================
   PANELS / CARDS
   ========================================================================== */
.panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  box-shadow:var(--shadow-sm); }
.panel__head { display:flex; justify-content:space-between; align-items:center;
  padding:17px 22px; border-bottom:1px solid var(--line-soft); }
.panel__title { font-size:14.5px; font-weight:700; letter-spacing:-.01em; color:var(--ink-900);
  margin:0; display:flex; align-items:center; gap:9px; }
.panel__title .material-symbols-outlined { font-size:19px; color:var(--primary); }
.panel__body { padding:20px 22px; }
.panel__link { font-size:12.5px; font-weight:600; color:var(--primary); text-decoration:none; }
.panel__link:hover { text-decoration:underline; }

/* ============================================================================
   KPI CARDS — status-driven top accent, tabular value, delta row
   ========================================================================== */
.kpi-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:18px; }
@media (max-width:1100px){ .kpi-grid{ grid-template-columns:repeat(2,1fr);} }
@media (max-width:560px){ .kpi-grid{ grid-template-columns:1fr;} }

.kpi { position:relative; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:20px 20px 18px; box-shadow:var(--shadow-sm);
  overflow:hidden; transition:box-shadow .18s, transform .18s, border-color .18s; }
.kpi:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); border-color:var(--ink-300); }
.kpi::before { content:""; position:absolute; inset:0 0 auto 0; height:3px;
  background:var(--accent, var(--primary)); opacity:.9; }
.kpi__top { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:14px; }
.kpi__label { font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-500); }
.kpi__chip { width:34px; height:34px; border-radius:10px; display:flex; align-items:center; justify-content:center;
  background:var(--accent-soft, var(--primary-50)); color:var(--accent, var(--primary)); flex-shrink:0; }
.kpi__chip .material-symbols-outlined { font-size:19px; }
.kpi__value { font-size:38px; font-weight:760; letter-spacing:-.025em; line-height:1; color:var(--ink-900);
  font-variant-numeric:tabular-nums; }
.kpi__sub { font-size:12px; color:var(--ink-500); margin-top:9px; display:flex; align-items:center; gap:6px; }
.kpi__delta { display:inline-flex; align-items:center; gap:2px; font-weight:700; font-size:11.5px; padding:1px 7px;
  border-radius:var(--r-pill); }
.kpi__delta .material-symbols-outlined { font-size:14px; }
.kpi__delta.up { color:var(--critical); background:var(--critical-50); }
.kpi__delta.down { color:var(--ok); background:var(--ok-50); }
.kpi__delta.flat { color:var(--ink-500); background:var(--surface-2); }

/* Status palettes for KPI / accents */
.s-primary  { --accent:var(--primary);  --accent-soft:var(--primary-50); }
.s-critical { --accent:var(--critical); --accent-soft:var(--critical-50); }
.s-warning  { --accent:var(--warning);  --accent-soft:var(--warning-50); }
.s-ok       { --accent:var(--ok);       --accent-soft:var(--ok-50); }
.s-info     { --accent:var(--info);     --accent-soft:var(--info-50); }

/* ============================================================================
   CHART BOX — the critical fix: constrain canvas height so doughnuts/bars
   never inflate. Pair with Chart.js {responsive:true, maintainAspectRatio:false}.
   ========================================================================== */
.chart-box { position:relative; width:100%; height:260px; }
.chart-box--tall { height:300px; }
.chart-legend { display:flex; flex-wrap:wrap; gap:14px 20px; margin-top:16px; }
.chart-legend__item { display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ink-700); }
.chart-legend__dot { width:10px; height:10px; border-radius:3px; flex-shrink:0; }
.chart-legend__val { margin-left:auto; font-weight:700; color:var(--ink-900); font-variant-numeric:tabular-nums; }

/* ============================================================================
   DATA TABLE
   ========================================================================== */
.dtable { width:100%; border-collapse:collapse; }
.dtable thead th { position:sticky; top:0; background:var(--surface-2); text-align:left;
  font-size:10.5px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--ink-500);
  padding:11px 22px; border-bottom:1px solid var(--line); white-space:nowrap; }
.dtable tbody td { padding:13px 22px; font-size:13px; color:var(--ink-700); border-bottom:1px solid var(--line-soft); }
.dtable tbody tr { transition:background .12s; }
.dtable tbody tr:hover { background:var(--primary-50); }
.dtable tbody tr:last-child td { border-bottom:none; }
.cell-id { font-family:"JetBrains Mono", ui-monospace, monospace; font-size:12.5px; font-weight:600; color:var(--primary); }

/* ============================================================================
   PILLS / BADGES
   ========================================================================== */
.pill { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:var(--r-pill);
  font-size:11px; font-weight:700; letter-spacing:.01em; line-height:1.5; white-space:nowrap; }
.pill .material-symbols-outlined { font-size:13px; }
.pill--ok { background:var(--ok-50); color:#047857; }
.pill--warn { background:var(--warning-50); color:#b45309; }
.pill--crit { background:var(--critical-50); color:var(--critical-600); }
.pill--info { background:var(--info-50); color:#312e81; }
.pill--muted { background:var(--surface-2); color:var(--ink-500); }

/* ============================================================================
   Legacy card hook — pages still using .bento-shadow inherit the refined
   shadow + radius without per-page edits. (Inline border/bg on those cards may
   still win; this lifts the elevation language globally.)
   ========================================================================== */
.bento-shadow { box-shadow:var(--shadow-sm) !important; border-radius:var(--r-lg); }
.bento-shadow:hover { box-shadow:var(--shadow-md) !important; }

/* ==========================================================================
   Root Causes (5-Whys) — discrete, scannable finding cards (record drawer +
   anywhere shared.js renders an analysis). Mirrors the CAPA card language so
   each cause reads as its own finding instead of a cramped list item, and the
   HFACS / failed-barrier taxonomy gets its own labeled fields.
   ========================================================================== */
.rc-list { display:flex; flex-direction:column; gap:12px; }
.rc-item { border:1px solid var(--line); border-radius:10px; padding:13px 15px;
  background:var(--surface); border-left:4px solid var(--primary); break-inside:avoid; }
.rc-top { display:flex; align-items:center; gap:9px; margin-bottom:8px; }
.rc-num { flex-shrink:0; width:22px; height:22px; border-radius:50%; background:var(--primary-50);
  color:var(--primary); font-size:11px; font-weight:800; display:flex; align-items:center; justify-content:center; }
.rc-top-label { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-400); }
.rc-chain { font-size:13px; color:var(--ink-900); line-height:1.6; margin:0 0 11px; }
.rc-arrow { color:var(--ink-300); font-weight:700; padding:0 4px; }
.rc-acts { display:flex; flex-wrap:wrap; gap:7px; margin-top:11px;
  border-top:1px dashed var(--line); padding-top:10px; }
.rc-similar { text-decoration:none; color:var(--primary); }
.rc-similar:hover { background:var(--primary-50); border-color:currentColor; }

/* ==========================================================================
   Corrective Actions (CAPA) — structured, reviewable cards (record drawer +
   anywhere shared.js renders an analysis). Mirrors report.html so the AI's
   proposed actions read clearly and a Safety Officer can dispose of each one.
   ========================================================================== */
.capa-note { font-size:12px; color:var(--ink-500); line-height:1.5; margin:0 0 12px;
  padding:9px 11px; background:var(--surface-2); border:1px dashed var(--line); border-radius:8px; }
.capa-note b { color:var(--ink-900); }
.capa-list { display:flex; flex-direction:column; gap:12px; }
.capa-item { border:1px solid var(--line); border-radius:10px; padding:13px 15px; background:var(--surface);
  break-inside:avoid; border-left:4px solid var(--st-color,#c5cad6); transition:opacity .15s; }
.capa-item.is-removed { opacity:.55; }
.capa-item.is-removed .capa-action { text-decoration:line-through; color:var(--ink-500); }
.capa-top { display:flex; align-items:center; gap:9px; margin-bottom:7px; }
.capa-num { flex-shrink:0; width:22px; height:22px; border-radius:50%; background:var(--primary-50);
  color:var(--primary); font-size:11px; font-weight:800; display:flex; align-items:center; justify-content:center; }
.capa-badge { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.04em;
  padding:3px 10px; border-radius:999px; background:var(--st-bg,#eee); color:var(--st-color,#555); }
.capa-action { font-size:13.5px; font-weight:600; line-height:1.55; color:var(--ink-900); margin:0 0 11px; }
.capa-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:9px; margin-bottom:10px; }
.capa-field { background:var(--surface-2); border:1px solid var(--line); border-radius:7px; padding:7px 10px; }
.capa-flabel { display:block; font-size:9.5px; text-transform:uppercase; letter-spacing:.06em;
  color:var(--ink-400); font-weight:800; margin-bottom:2px; }
.capa-fval { font-size:12.5px; color:var(--ink-900); font-weight:600; line-height:1.4; }
.capa-verify { font-size:12.5px; color:var(--ink-900); line-height:1.5; background:var(--ok-50);
  border:1px solid #c6f0d6; border-radius:7px; padding:8px 11px; }
.capa-verify .capa-flabel { color:var(--ok); }
.capa-decision { margin-top:9px; font-size:11.5px; color:var(--ink-500); line-height:1.45;
  border-top:1px dashed var(--line); padding-top:8px; }
.capa-decision b { color:var(--ink-900); font-weight:700; }
.capa-acts { display:flex; flex-wrap:wrap; gap:7px; margin-top:11px; }
.capa-btn { appearance:none; border:1px solid var(--line); background:var(--surface); cursor:pointer;
  font-family:inherit; font-size:11.5px; font-weight:700; padding:6px 12px; border-radius:8px;
  display:inline-flex; align-items:center; gap:5px; color:var(--ink-500); transition:all .12s; }
.capa-btn:hover { border-color:currentColor; }
.capa-btn.b-accept { color:var(--ok); } .capa-btn.b-accept:hover { background:var(--ok-50); }
.capa-btn.b-reject { color:var(--critical); } .capa-btn.b-reject:hover { background:var(--critical-50); }
.capa-btn.b-defer { color:var(--warning); } .capa-btn.b-defer:hover { background:var(--warning-50); }
.capa-btn.b-delete { color:var(--ink-500); } .capa-btn.b-delete:hover { background:var(--surface-2); }
.capa-btn[aria-pressed="true"] { background:currentColor; border-color:currentColor; }
.capa-btn[aria-pressed="true"] span { color:#fff; }
/* Reason modal for reject / defer / remove (created on demand by shared.js) */
.capa-ov { display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:1000;
  align-items:center; justify-content:center; padding:24px; }
.capa-ov.open { display:flex; }
.capa-modal { background:var(--surface); max-width:440px; width:100%; border-radius:12px;
  box-shadow:0 20px 60px rgba(0,0,0,.3); padding:22px 24px; }
.capa-modal h3 { margin:0 0 4px; font-size:16px; color:var(--ink-900); }
.capa-modal .hint { font-size:12.5px; color:var(--ink-500); margin:0 0 16px; line-height:1.5; }
.capa-modal label { display:block; font-size:12px; font-weight:700; color:var(--ink-500); margin-bottom:5px; }
.capa-modal textarea, .capa-modal input { width:100%; font-family:inherit; font-size:14px;
  padding:9px 11px; border:1px solid var(--line); border-radius:8px; color:var(--ink-900); }
.capa-modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }

/* ── App dialog — unified confirm / prompt / alert (built on demand by shared.js).
   Replaces the browser's native window.confirm/prompt/alert with an on-brand,
   accessible modal. One look for every popup in the product. ──────────────── */
.adlg-ov { position:fixed; inset:0; z-index:2000; display:flex; align-items:center;
  justify-content:center; padding:24px; background:rgba(15,18,34,.48);
  -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px);
  opacity:0; transition:opacity .16s ease; }
.adlg-ov.open { opacity:1; }
.adlg { width:100%; max-width:440px; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); box-shadow:var(--shadow-lg); padding:24px 24px 20px;
  transform:translateY(8px) scale(.98); opacity:0; transition:transform .18s cubic-bezier(.2,.8,.2,1), opacity .18s ease; }
.adlg-ov.open .adlg { transform:translateY(0) scale(1); opacity:1; }
.adlg-head { display:flex; gap:14px; align-items:flex-start; }
.adlg-ic { flex-shrink:0; width:42px; height:42px; border-radius:12px; display:flex;
  align-items:center; justify-content:center; background:var(--primary-50); color:var(--primary); }
.adlg-ic .material-symbols-outlined { font-size:24px; }
.adlg.is-danger  .adlg-ic { background:var(--critical-50); color:var(--critical-600); }
.adlg.is-warning .adlg-ic { background:var(--warning-50);  color:var(--warning); }
.adlg.is-success .adlg-ic { background:var(--ok-50);       color:var(--ok); }
.adlg-body { flex:1; min-width:0; }
.adlg-title { margin:2px 0 0; font-size:16.5px; font-weight:700; letter-spacing:-.01em; color:var(--ink-900); }
.adlg-msg { margin:7px 0 0; font-size:13.5px; line-height:1.55; color:var(--ink-500); }
.adlg-msg strong { color:var(--ink-800); font-weight:650; }
.adlg-list { margin:12px 0 0; padding:0; list-style:none; display:flex; flex-direction:column; gap:8px; }
.adlg-list li { position:relative; padding-left:22px; font-size:13px; line-height:1.5; color:var(--ink-700); }
.adlg-list li::before { content:""; position:absolute; left:6px; top:8px; width:6px; height:6px;
  border-radius:50%; background:var(--primary); opacity:.75; }
.adlg.is-danger  .adlg-list li::before { background:var(--critical-600); }
.adlg.is-warning .adlg-list li::before { background:var(--warning); }
.adlg-field { margin:16px 0 0; }
.adlg-field label { display:block; font-size:11.5px; font-weight:700; letter-spacing:.03em;
  text-transform:uppercase; color:var(--ink-500); margin-bottom:6px; }
.adlg-field textarea, .adlg-field input { width:100%; font-family:inherit; font-size:14px;
  padding:10px 12px; border:1px solid var(--line); border-radius:var(--r-sm); color:var(--ink-900);
  background:var(--surface-2); transition:border-color .15s, box-shadow .15s; }
.adlg-field textarea { resize:vertical; min-height:76px; }
.adlg-field textarea:focus, .adlg-field input:focus { outline:none; border-color:var(--primary);
  background:var(--surface); box-shadow:var(--ring); }
.adlg-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:22px; }
.adlg-actions .btn { min-height:40px; }
.btn--danger { background:var(--critical); color:#fff; border-color:transparent;
  box-shadow:0 4px 12px -4px rgba(220,38,38,.55); }
.btn--danger:hover { background:var(--critical-600); }
@media (max-width:480px){ .adlg-actions { flex-direction:column-reverse; } .adlg-actions .btn { width:100%; } }
@media (prefers-reduced-motion:reduce){
  .adlg-ov, .adlg { transition:none; }
  .adlg { transform:none; }
}

/* Info "(i)" affordance — contextual help next to a heading/section title.
   Pair with a data-tip attribute; the tooltip engine in shared.js handles
   hover, tap and keyboard. Indigo = "info" per the design system. */
.info-i { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px;
  border:none; background:transparent; color:var(--ink-400); cursor:help; padding:0; border-radius:50%;
  vertical-align:middle; flex-shrink:0; -webkit-tap-highlight-color:transparent;
  transition:color .15s, background .15s; }
.info-i .material-symbols-outlined { font-size:18px; }
.info-i:hover, .info-i.is-open { color:var(--primary); background:var(--primary-50); }
.info-i:focus-visible { outline:none; color:var(--primary); background:var(--primary-50);
  box-shadow:0 0 0 3px rgba(33,126,170,.20); }

/* Reduced-motion guard */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:.001ms !important; transition-duration:.001ms !important; }
}

/* ============================================================================
   Legacy Shell Rescue
   Many older pages still use inline layout styles. These guarded overrides keep
   those screens usable while they are gradually migrated to the shared classes.
   ========================================================================== */
button, a, input, select, textarea { touch-action:manipulation; }
button, [role="button"], a[href] { -webkit-tap-highlight-color:transparent; }
html, body { max-width:100%; overflow-x:hidden; }
*, *::before, *::after { box-sizing:border-box; }
img, svg, canvas, video { max-width:100%; }
table { max-width:100%; }

button:not(.info-i):not(.ev-tab):not(.reporting-step):not(.reporting-summary-toggle),
a.btn,
a[style*="background:#1b0088"],
a[style*="background:#b64b66"] {
  min-height:44px;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-height:44px;
}

.app-mobile-bar { display:none; }
.mobile-nav { display:none; }

@media (max-width:900px) {
  body {
    width:100%;
    overflow-x:hidden;
  }
  body.min-h-screen.flex {
    display:block !important;
  }
  #sidebar {
    display:none !important;
  }
  body > .flex-1,
  body > div.flex-1,
  body > [style*="margin-left:256px"],
  .filing-shell,
  .ops-page-shell {
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-left:0 !important;
  }
  .app-topbar {
    min-height:58px; height:auto; gap:12px; padding:10px 16px; flex-wrap:wrap;
  }
  .app-topbar > div,
  header[style*="height:64px"] > div {
    min-width:0;
  }
  main {
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    padding:18px !important;
    overflow-x:hidden;
  }
  main > * {
    max-width:100%;
  }
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns:1.15fr .85fr"],
  [style*="grid-template-columns:1fr 1fr 1fr"],
  [style*="grid-template-columns:repeat(5,1fr)"] {
    grid-template-columns:1fr !important;
  }
  [style*="display:flex"][style*="gap"],
  [style*="display: flex"][style*="gap"] {
    min-width:0;
  }
  .card,
  .bento-shadow,
  [class*="card"] {
    max-width:100%;
  }
}

@media (max-width:720px) {
  body {
    padding-bottom:calc(72px + env(safe-area-inset-bottom));
  }
  #sidebar {
    display:none !important;
  }
  .mobile-nav {
    position:fixed; left:0; right:0; bottom:0; z-index:1200;
    display:grid; grid-template-columns:repeat(5, minmax(0, 1fr));
    min-height:64px; padding:6px 6px calc(6px + env(safe-area-inset-bottom));
    background:rgba(255,255,255,.96); border-top:1px solid var(--line);
    -webkit-backdrop-filter:saturate(140%) blur(10px); backdrop-filter:saturate(140%) blur(10px);
    box-shadow:0 -10px 30px -24px rgba(15,18,34,.45);
  }
  .mobile-nav__link {
    min-width:0; min-height:52px; display:flex; flex-direction:column; align-items:center;
    justify-content:center; gap:2px; border-radius:10px; color:var(--ink-500);
    text-decoration:none; font-size:10.5px; font-weight:700; line-height:1.1;
  }
  .mobile-nav__link .material-symbols-outlined {
    font-size:21px;
  }
  .mobile-nav__link.is-active {
    color:var(--primary); background:var(--primary-50);
  }
  body > .flex-1,
  body > div.flex-1,
  .filing-shell {
    margin-left:0 !important;
  }
  header[style*="height:64px"] {
    min-height:58px !important; height:auto !important; padding:10px 14px !important;
    gap:10px; flex-wrap:wrap;
  }
  header[style*="height:64px"] > div {
    width:100%;
    min-width:0;
  }
  header[style*="height:64px"] span,
  header[style*="height:64px"] a,
  header[style*="height:64px"] button {
    max-width:100%;
  }
  header [data-tenant-name] {
    display:none !important;
  }
  [style*="display:flex"][style*="gap:20px"],
  [style*="display:flex"][style*="gap:22px"],
  [style*="display:flex"][style*="gap:14px"],
  [style*="display:flex"][style*="gap:10px"],
  [style*="display:flex"][style*="gap:8px"],
  [style*="display: flex"][style*="gap:20px"],
  [style*="display: flex"][style*="gap:22px"],
  [style*="display: flex"][style*="gap:14px"],
  [style*="display: flex"][style*="gap:10px"],
  [style*="display: flex"][style*="gap:8px"] {
    flex-wrap:wrap !important;
  }
  [style*="flex:1"],
  [style*="flex: 1"] {
    min-width:0 !important;
  }
  input,
  select,
  textarea,
  .btn-primary,
  .btn-ghost,
  .btn-cta {
    max-width:100%;
  }
  .btn-primary,
  .btn-ghost,
  .btn-cta {
    justify-content:center;
    white-space:normal;
  }
  .seg {
    width:100%;
    display:grid !important;
    grid-template-columns:1fr 1fr;
  }
  .seg button {
    min-width:0;
  }
  .copy-input {
    flex-basis:100% !important;
  }
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:repeat(auto-fit,minmax(170px,1fr))"],
  [style*="grid-template-columns:repeat(auto-fit,minmax(200px,1fr))"] {
    grid-template-columns:1fr !important;
  }
  .slide-panel {
    top:0 !important; left:0 !important; right:0 !important; width:100% !important;
    max-width:none !important; height:100dvh !important;
  }
  #detail-panel {
    top:0 !important; left:0 !important;
  }
  .chart-box {
    height:220px;
  }
  .dtable,
  [id$="-table"] table,
  [id*="table"] table,
  #team-body table,
  #corpus-body table {
    min-width:640px;
  }
  .table-scroll,
  [id$="-table"],
  [id*="table"],
  #team-body,
  #corpus-body {
    overflow-x:auto;
  }
  #team-body,
  #corpus-body,
  [id$="-table"],
  [id*="table"] {
    max-width:100%;
    -webkit-overflow-scrolling:touch;
  }
  #portal-row {
    flex-wrap:wrap !important;
  }
  #portal-url {
    flex:1 1 100% !important;
  }
}

@media (max-width:480px) {
  .page-h1 {
    font-size:23px;
  }
  .page-sub {
    font-size:13px;
  }
  .kpi__value {
    font-size:32px;
  }
}

/* ============================================================================
   Ops Console Theme - Bitacora-inspired, SAMARIA palette
   ========================================================================== */
:root {
  --ops-bg:#050814;
  --ops-bg-2:#090f24;
  --ops-surface:rgba(13,18,36,.82);
  --ops-surface-2:rgba(18,25,49,.88);
  --ops-elevated:rgba(22,31,60,.94);
  --ops-line:rgba(148,163,184,.18);
  --ops-line-strong:rgba(33,126,170,.34);
  --ops-text:#f8fafc;
  --ops-muted:#94a3b8;
  --ops-dim:#64748b;
  --ops-indigo:#7d9cb7;
  --ops-indigo-strong:#217eaa;
  --ops-crimson:#217eaa;
  --ops-crimson-2:#165f83;
  --ops-amber:#c47b30;
  --ops-green:#22c55e;
  --ops-danger:#b94a48;
}

body {
  background:
    radial-gradient(circle at 18% -10%, rgba(33,126,170,.22), transparent 34rem),
    radial-gradient(circle at 88% 6%, rgba(196,123,48,.10), transparent 30rem),
    linear-gradient(135deg, var(--ops-bg), var(--ops-bg-2) 58%, #070712) !important;
  color:var(--ops-text);
}

#sidebar.nav-rail, #sidebar {
  background:linear-gradient(180deg, rgba(7,10,24,.96), rgba(12,18,38,.94)) !important;
  border-right:1px solid var(--ops-line) !important;
  box-shadow:18px 0 60px rgba(0,0,0,.22) !important;
}
.nav-rail .brand-text, .nav-rail .brand-subtitle { color:var(--ops-text) !important; }
.nav-rail .nav-section-title { color:var(--ops-muted) !important; }
.nav-rail .nav-link { color:#cbd5e1 !important; border-radius:8px !important; }
.nav-rail .nav-link:hover { background:rgba(33,126,170,.14) !important; color:#fff !important; }
.nav-rail .nav-link.is-active {
  background:linear-gradient(90deg, rgba(33,126,170,.24), rgba(33,126,170,.10)) !important;
  color:#fff !important;
  box-shadow:inset 3px 0 0 var(--ops-amber), 0 12px 30px rgba(0,0,0,.18) !important;
}
.nav-rail .nav-link.is-active::before { display:none !important; }
.nav-rail .nav-cta {
  background:linear-gradient(135deg, var(--ops-crimson), var(--ops-crimson-2)) !important;
  color:#fff !important;
  box-shadow:0 18px 42px rgba(33,126,170,.24) !important;
}

.ops-page-shell {
  min-height:100dvh;
  color:var(--ops-text);
}
.ops-topbar {
  position:sticky;
  top:0;
  z-index:20;
  min-height:68px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:12px 24px;
  background:rgba(5,8,20,.72);
  border-bottom:1px solid var(--ops-line);
  -webkit-backdrop-filter:blur(18px) saturate(130%);
  backdrop-filter:blur(18px) saturate(130%);
}
.ops-tenant {
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
}
.ops-tenant__icon {
  width:34px;
  height:34px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  background:linear-gradient(135deg, var(--ops-indigo-strong), #165f83);
  box-shadow:0 12px 30px rgba(33,126,170,.28);
}
.ops-tenant__name {
  color:#fff;
  font-size:15px;
  font-weight:800;
  letter-spacing:0;
  white-space:nowrap;
}
.ops-tenant__section {
  color:var(--ops-muted);
  font-size:13px;
  font-weight:650;
  padding-left:10px;
  border-left:1px solid var(--ops-line);
}
.ops-topbar__actions {
  display:flex;
  align-items:center;
  gap:10px;
}
.ops-icon-action,
.ops-primary-action,
.ops-ghost-action,
.ops-tab,
.ops-pagination button,
.ops-card-action {
  min-height:44px;
  cursor:pointer;
  transition:background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.ops-icon-action {
  width:44px;
  border:1px solid var(--ops-line);
  border-radius:8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#cbd5e1;
  text-decoration:none;
  background:rgba(15,23,42,.72);
}
.ops-icon-action:hover {
  color:#fff;
  border-color:var(--ops-line-strong);
  background:rgba(33,126,170,.16);
}
.ops-primary-action {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:0 18px;
  border-radius:8px;
  color:#fff;
  text-decoration:none;
  font-size:13px;
  font-weight:800;
  background:linear-gradient(135deg, var(--ops-indigo-strong), #165f83);
  box-shadow:0 16px 36px rgba(33,126,170,.26);
}
.ops-primary-action:hover {
  transform:translateY(-1px);
  box-shadow:0 20px 46px rgba(33,126,170,.30);
}
.ops-main {
  width:min(1280px, 100%);
  margin:0 auto;
  padding:24px;
}
.ops-page-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}
.ops-kicker {
  margin:0 0 6px;
  color:var(--ops-amber);
  font-size:12px;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.ops-page-head h1 {
  margin:0;
  color:#fff;
  font-size:34px;
  line-height:1.08;
  letter-spacing:0;
}
.ops-page-head p {
  max-width:720px;
  margin:8px 0 0;
  color:var(--ops-muted);
  font-size:14px;
  line-height:1.55;
}
.ops-status-chip {
  min-height:44px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:0 14px;
  border-radius:8px;
  border:1px solid rgba(47,155,115,.42);
  color:#ffffff;
  background:rgba(47,155,115,.84);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.ops-hero,
.ops-filter-panel,
.ops-register {
  border:1px solid var(--ops-line);
  background:linear-gradient(180deg, rgba(18,25,49,.84), rgba(10,15,32,.86));
  box-shadow:0 24px 70px rgba(0,0,0,.24);
  -webkit-backdrop-filter:blur(18px);
  backdrop-filter:blur(18px);
}
.ops-hero {
  position:relative;
  overflow:hidden;
  display:grid;
  grid-template-columns:minmax(0,1.3fr) minmax(320px,.7fr);
  gap:22px;
  border-radius:12px;
  padding:24px;
  margin-bottom:18px;
}
.ops-hero::before {
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(120deg, rgba(33,126,170,.18), transparent 44%),
    radial-gradient(circle at 92% 12%, rgba(249,115,22,.24), transparent 18rem);
  pointer-events:none;
}
.ops-hero__copy,
.ops-metric-grid { position:relative; z-index:1; }
.ops-hero__eyebrow {
  color:#c7d2fe;
  font-size:12px;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.ops-hero h2 {
  margin:8px 0 8px;
  color:#fff;
  font-size:42px;
  line-height:1;
  letter-spacing:0;
}
.ops-hero p {
  max-width:620px;
  margin:0;
  color:#cbd5e1;
  font-size:14px;
  line-height:1.55;
}
.ops-metric-grid {
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px;
}
.ops-metric {
  min-height:118px;
  border-radius:10px;
  padding:14px;
  background:rgba(5,8,20,.46);
  border:1px solid rgba(148,163,184,.16);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.ops-metric__label {
  color:var(--ops-muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.ops-metric strong {
  color:#fff;
  font-size:34px;
  line-height:1;
}
.ops-filter-stack {
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-bottom:18px;
}
.ops-tabs {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.ops-tab {
  border:1px solid var(--ops-line);
  border-radius:8px;
  padding:0 16px;
  background:rgba(15,23,42,.68);
  color:#cbd5e1;
  font:inherit;
  font-size:13px;
  font-weight:800;
}
.ops-tab:hover {
  color:#fff;
  border-color:var(--ops-line-strong);
}
.ops-tab.is-active {
  color:#fff;
  background:linear-gradient(135deg, rgba(33,126,170,.34), rgba(125,156,183,.18));
  border-color:rgba(33,126,170,.55);
  box-shadow:inset 0 -2px 0 var(--ops-amber);
}
.ops-filter-panel {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  border-radius:12px;
  padding:14px;
}
.ops-search-field {
  flex:1;
  min-width:260px;
  display:flex;
  align-items:center;
  gap:8px;
  min-height:46px;
  padding:0 12px;
  border-radius:8px;
  border:1px solid rgba(148,163,184,.20);
  background:rgba(5,8,20,.54);
  color:var(--ops-muted);
}
.ops-search-field input {
  min-height:42px;
  width:100%;
  padding:0;
  border:none;
  box-shadow:none;
  color:#fff;
  background:transparent;
}
.ops-search-field input:focus { outline:none; box-shadow:none; }
.ops-filter-panel select {
  width:auto;
  min-width:160px;
  border-color:rgba(148,163,184,.20);
  background:rgba(5,8,20,.58);
  color:#fff;
}
.ops-filter-panel select:focus,
.ops-search-field:focus-within {
  border-color:var(--ops-indigo);
  box-shadow:0 0 0 3px rgba(33,126,170,.20);
}
.ops-ghost-action {
  display:inline-flex;
  align-items:center;
  gap:7px;
  border:1px solid var(--ops-line);
  border-radius:8px;
  padding:0 13px;
  color:#cbd5e1;
  background:rgba(15,23,42,.50);
  font:inherit;
  font-size:12px;
  font-weight:800;
}
.ops-ghost-action:hover,
.ops-ghost-action.is-active {
  color:#fff;
  border-color:rgba(249,115,22,.55);
  background:rgba(249,115,22,.12);
}
.ops-register {
  overflow:hidden;
  border-radius:12px;
}
.ops-register__head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:18px 20px;
  border-bottom:1px solid var(--ops-line);
}
.ops-register__head h2 {
  margin:0 0 4px;
  color:#fff;
  font-size:16px;
  letter-spacing:0;
}
.ops-register__head span,
.ops-register__hint {
  color:var(--ops-muted);
  font-size:12px;
  font-weight:650;
}
.ops-report-list {
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:14px;
}
.ops-loading {
  margin:0;
  padding:28px;
  color:var(--ops-muted);
}
.ops-report-card {
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px;
  align-items:center;
  min-height:112px;
  padding:16px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.16);
  background:rgba(5,8,20,.48);
  cursor:pointer;
  overflow:hidden;
}
.ops-report-card::before {
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:4px;
  background:var(--ops-indigo);
}
.ops-report-card.sev-A::before,
.ops-report-card.sev-B::before { background:var(--ops-crimson); }
.ops-report-card.sev-C::before { background:var(--ops-amber); }
.ops-report-card:hover {
  transform:translateY(-1px);
  border-color:var(--ops-line-strong);
  background:rgba(17,24,48,.72);
}
.ops-report-card.is-annulled {
  opacity:.58;
}
.ops-report-card__main { min-width:0; }
.ops-report-card__route {
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:9px;
  color:var(--ops-muted);
  font-size:11px;
  font-weight:850;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.ops-report-line {
  width:28px;
  height:1px;
  background:rgba(148,163,184,.28);
}
.ops-report-source {
  display:inline-flex;
  align-items:center;
  gap:5px;
}
.ops-report-source .material-symbols-outlined {
  font-size:15px;
  color:var(--ops-amber);
}
.ops-report-card h3 {
  margin:0;
  color:#fff;
  font-size:15px;
  line-height:1.45;
  letter-spacing:0;
}
.ops-report-meta {
  display:flex;
  flex-wrap:wrap;
  gap:8px 14px;
  margin-top:10px;
  color:var(--ops-muted);
  font-size:12px;
}
.ops-report-meta span {
  min-width:0;
}
.ops-report-card__side {
  min-width:220px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:16px;
}
.ops-card-badges {
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:6px;
}
.ops-mini-badge {
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:0 8px;
  border-radius:999px;
  font-size:10.5px;
  font-weight:850;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:#fff;
  background:rgba(33,126,170,.20);
  border:1px solid rgba(33,126,170,.28);
}
.ops-mini-badge.is-severity { color:#ffffff; background:rgba(33,126,170,.76); border-color:rgba(33,126,170,.88); }
.ops-mini-badge.is-review {
  color:#ffffff;
  background:rgba(154,97,39,.86);
  border-color:rgba(154,97,39,.92);
}
.ops-mini-badge.is-clear {
  color:#bbf7d0;
  background:rgba(34,197,94,.12);
  border-color:rgba(34,197,94,.24);
}
.ops-mini-badge.is-version {
  color:#fff;
  background:rgba(33,126,170,.78);
  border-color:rgba(33,126,170,.88);
}
.ops-mini-badge.is-muted {
  margin-right:8px;
  color:#cbd5e1;
  background:rgba(100,116,139,.20);
  border-color:rgba(148,163,184,.18);
}
.ops-card-actions {
  display:flex;
  align-items:center;
  gap:6px;
}
.ops-card-action {
  width:44px;
  border:1px solid transparent;
  border-radius:8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--ops-muted);
  background:transparent;
}
.ops-card-action.is-danger:hover {
  color:#fff;
  border-color:rgba(185,74,72,.34);
  background:rgba(185,74,72,.14);
}
.ops-card-chevron { color:var(--ops-muted); }
.ops-pagination {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 18px;
  border-top:1px solid var(--ops-line);
  background:rgba(5,8,20,.44);
}
.ops-pagination > span {
  color:var(--ops-muted);
  font-size:12px;
  font-weight:700;
}
.ops-pagination div {
  display:flex;
  gap:8px;
}
.ops-pagination button {
  display:inline-flex;
  align-items:center;
  gap:4px;
  border:1px solid var(--ops-line);
  border-radius:8px;
  padding:0 12px;
  color:#dbeafe;
  background:rgba(15,23,42,.66);
  font:inherit;
  font-size:12px;
  font-weight:800;
}
.ops-pagination button:hover:not(:disabled) {
  color:#fff;
  border-color:var(--ops-line-strong);
  background:rgba(33,126,170,.16);
}
.ops-pagination button:disabled {
  opacity:.42;
  cursor:not-allowed;
}
.ops-empty-state {
  padding:48px 20px;
  text-align:center;
  color:var(--ops-muted);
}
.ops-empty-state .material-symbols-outlined {
  display:block;
  margin:0 auto 12px;
  color:var(--ops-indigo);
  font-size:40px;
}
.ops-empty-state h3 {
  margin:0 0 6px;
  color:#fff;
  font-size:16px;
}
.ops-empty-state p {
  margin:0;
  font-size:13px;
}

#annul-overlay { background:rgba(2,6,23,.72) !important; -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
#annul-overlay [role="dialog"] {
  background:var(--ops-elevated) !important;
  border:1px solid var(--ops-line) !important;
  color:var(--ops-text) !important;
  box-shadow:0 28px 80px rgba(0,0,0,.42) !important;
}
#annul-overlay h2 { color:#fff !important; }
#annul-overlay p,
#annul-overlay label,
#annul-overlay div { color:var(--ops-muted) !important; }
#annul-overlay input,
#annul-overlay select,
#annul-overlay textarea {
  background:rgba(5,8,20,.58) !important;
  color:#fff !important;
  border-color:var(--ops-line) !important;
}

@media (max-width:900px) {
  .ops-page-shell { margin-left:0 !important; }
  .ops-topbar { padding:10px 16px; }
  .ops-main { padding:18px; }
  .ops-hero { grid-template-columns:1fr; }
  .ops-register__head { align-items:flex-start; flex-direction:column; }
}

@media (max-width:720px) {
  .mobile-nav {
    background:rgba(5,8,20,.96) !important;
    border-top:1px solid var(--ops-line) !important;
    box-shadow:0 -16px 42px rgba(0,0,0,.34) !important;
  }
  .mobile-nav__link { color:var(--ops-muted) !important; }
  .mobile-nav__link.is-active {
    color:#fff !important;
    background:rgba(33,126,170,.18) !important;
  }
  .ops-topbar { position:relative; flex-wrap:wrap; }
  .ops-tenant__name { display:none; }
  .ops-tenant__section { border-left:none; padding-left:0; }
  .ops-main { padding:16px; }
  .ops-page-head { flex-direction:column; }
  .ops-page-head h1 { font-size:28px; }
  .ops-status-chip { width:100%; justify-content:center; }
  .ops-hero { padding:18px; }
  .ops-hero h2 { font-size:34px; }
  .ops-metric-grid { grid-template-columns:1fr; }
  .ops-filter-panel { align-items:stretch; flex-direction:column; }
  .ops-search-field,
  .ops-filter-panel select,
  .ops-ghost-action { width:100%; min-width:0; justify-content:center; }
  .ops-report-card {
    grid-template-columns:1fr;
    gap:14px;
  }
  .ops-report-card__side {
    min-width:0;
    justify-content:space-between;
  }
  .ops-card-badges { justify-content:flex-start; }
  .ops-pagination {
    align-items:stretch;
    flex-direction:column;
  }
  .ops-pagination div {
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .ops-pagination button {
    justify-content:center;
  }
}

@media (prefers-reduced-motion:reduce) {
  .ops-icon-action,
  .ops-primary-action,
  .ops-ghost-action,
  .ops-tab,
  .ops-report-card,
  .ops-pagination button,
  .ops-card-action {
    transition:none;
  }
}

/* ============================================================================
   Unified Ops Polish
   Final cascade layer for legacy pages: restrained palette, one font system,
   scrollable tabs, calmer actions, and bounded type scale.
   ========================================================================== */
:root {
  --sam-font:"Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sam-bg:#070b16;
  --sam-bg-2:#0a1020;
  --sam-panel:#101827;
  --sam-panel-2:#151f33;
  --sam-panel-soft:rgba(16,24,39,.86);
  --sam-ink:#f8fafc;
  --sam-muted:#a3aec2;
  --sam-faint:#718096;
  --sam-line:rgba(148,163,184,.18);
  --sam-line-strong:rgba(148,163,184,.30);
  --sam-primary:#217eaa;
  --sam-primary-2:#165f83;
  --sam-action:#217eaa;
  --sam-action-2:#165f83;
  --sam-warn:#c47b30;
  --sam-ok:#2f9b73;
  --sam-danger:#b94a48;
  --sam-radius:10px;
}

html, body, button, input, select, textarea {
  font-family:var(--sam-font) !important;
}
body {
  background:
    radial-gradient(900px 460px at 18% -12%, rgba(33,126,170,.18), transparent 62%),
    radial-gradient(760px 420px at 92% 4%, rgba(196,123,48,.09), transparent 58%),
    linear-gradient(145deg, var(--sam-bg), var(--sam-bg-2) 56%, #080b13) !important;
  color:var(--sam-ink) !important;
}

body,
.ops-page-shell,
body > .flex-1,
body > div.flex-1 {
  min-width:0 !important;
}

.page-h1,
h1[style*="font-size:28px"],
.ops-page-head h1 {
  font-size:clamp(24px, 3.2vw, 32px) !important;
  line-height:1.12 !important;
  letter-spacing:0 !important;
}
.ops-hero h2,
#compliance-pct,
.kpi__value {
  font-size:clamp(30px, 5vw, 42px) !important;
  line-height:1.05 !important;
  letter-spacing:0 !important;
}
.material-symbols-outlined[style*="font-size:56px"],
.material-symbols-outlined[style*="font-size:48px"],
.material-symbols-outlined[style*="font-size:46px"],
.material-symbols-outlined[style*="font-size:44px"],
.material-symbols-outlined[style*="font-size:40px"] {
  font-size:clamp(32px, 8vw, 42px) !important;
}
h2, .card-t, .panel__title, .ops-register__head h2 {
  letter-spacing:0 !important;
}

#sidebar.nav-rail,
#sidebar {
  background:linear-gradient(180deg, #080d19 0%, #0e1627 100%) !important;
  border-right:1px solid var(--sam-line) !important;
  box-shadow:12px 0 42px rgba(0,0,0,.20) !important;
}
.nav-rail .nav-link.is-active,
.mobile-nav__link.is-active {
  background:rgba(33,126,170,.18) !important;
  box-shadow:inset 3px 0 0 var(--sam-warn) !important;
}
.nav-rail .nav-section {
  color:#9ca3d7 !important;
}
.nav-rail .nav-cta,
.btn-cta,
.ops-primary-action,
a[style*="background:#b64b66"],
button[style*="background:#b64b66"] {
  background:linear-gradient(135deg, var(--sam-action), var(--sam-action-2)) !important;
  color:#fff !important;
  box-shadow:0 14px 32px rgba(33,126,170,.26) !important;
}
.nav-rail .nav-cta:hover,
.ops-primary-action:hover {
  filter:brightness(1.04);
  box-shadow:0 16px 38px rgba(33,126,170,.32) !important;
}

.btn--primary,
.btn-primary:not(.btn-cta),
a[style*="background:#1b0088"],
button[style*="background:#1b0088"],
.seg button.on {
  background:var(--sam-primary) !important;
  color:#fff !important;
  box-shadow:0 10px 24px rgba(33,126,170,.22) !important;
}
.btn--primary:hover,
.btn-primary:not(.btn-cta):hover {
  background:var(--sam-primary-2) !important;
}

.card,
.panel,
.bento-shadow,
.ops-hero,
.ops-filter-panel,
.ops-register,
[style*="background:#fff"] {
  border-radius:var(--sam-radius) !important;
}

.ops-topbar,
.app-topbar {
  background:rgba(8,13,25,.78) !important;
  color:var(--sam-ink) !important;
  border-bottom:1px solid var(--sam-line) !important;
  box-shadow:none !important;
  -webkit-backdrop-filter:blur(16px) saturate(130%);
  backdrop-filter:blur(16px) saturate(130%);
}
.app-topbar [data-tenant-name],
.app-topbar span,
.ops-topbar [data-tenant-name],
.ops-tenant__name {
  color:var(--sam-ink) !important;
}
.app-topbar__crumb,
.ops-tenant__section,
.page-sub {
  color:var(--sam-muted) !important;
}

.ops-hero,
.ops-filter-panel,
.ops-register {
  background:linear-gradient(180deg, rgba(16,24,39,.90), rgba(11,17,29,.92)) !important;
  border-color:var(--sam-line) !important;
  box-shadow:0 18px 48px rgba(0,0,0,.20) !important;
}
.ops-hero::before {
  background:
    linear-gradient(120deg, rgba(33,126,170,.14), transparent 46%),
    radial-gradient(circle at 92% 12%, rgba(196,123,48,.14), transparent 16rem) !important;
}
.ops-tenant__icon {
  background:linear-gradient(135deg, var(--sam-primary), #165f83) !important;
  box-shadow:0 10px 24px rgba(33,126,170,.22) !important;
}
.ops-kicker,
.ops-hero__eyebrow,
.ops-report-source .material-symbols-outlined {
  color:var(--sam-warn) !important;
}

.ops-tabs,
.ev-tabs,
.seg,
[role="tablist"] {
  display:flex !important;
  flex-wrap:nowrap !important;
  gap:8px !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  -webkit-overflow-scrolling:touch;
  scroll-snap-type:x proximity;
  scrollbar-width:thin;
  padding-bottom:4px;
}
.ops-tabs::after,
.ev-tabs::after,
.seg::after,
[role="tablist"]::after {
  content:"";
  flex:0 0 1px;
}
.ops-tab,
.ev-tab,
.seg button,
[role="tab"] {
  flex:0 0 auto !important;
  white-space:nowrap !important;
  scroll-snap-align:start;
}
.ops-tab,
.ev-tab,
.seg button {
  background:rgba(16,24,39,.72) !important;
  border:1px solid var(--sam-line) !important;
  color:#d8deea !important;
  border-radius:var(--sam-radius) !important;
}
.ops-tab.is-active,
.ev-tab.is-active,
.seg button.on,
[aria-selected="true"] {
  background:rgba(33,126,170,.22) !important;
  border-color:rgba(33,126,170,.46) !important;
  color:#fff !important;
  box-shadow:inset 0 -2px 0 var(--sam-warn) !important;
}

.ops-metric,
.ops-report-card,
.kpi,
.panel,
.card {
  box-shadow:0 12px 32px rgba(0,0,0,.12) !important;
}
.ops-report-card::before {
  background:var(--sam-primary) !important;
}
.ops-report-card.sev-A::before,
.ops-report-card.sev-B::before {
  background:var(--sam-danger) !important;
}
.ops-report-card.sev-C::before {
  background:var(--sam-warn) !important;
}
.ops-mini-badge.is-review {
  color:#ffffff !important;
  background:rgba(154,97,39,.86) !important;
  border-color:rgba(154,97,39,.92) !important;
}
.ops-mini-badge.is-clear {
  color:#a7dbc7 !important;
  background:rgba(47,155,115,.14) !important;
  border-color:rgba(47,155,115,.26) !important;
}
.ops-mini-badge.is-version {
  background:rgba(33,126,170,.78) !important;
  border-color:rgba(33,126,170,.88) !important;
}

.ops-card-action.is-danger:hover,
.btn--danger,
button[style*="background:#8f3735"],
a[style*="color:#8f3735"],
button[style*="color:#8f3735"] {
  color:#fff !important;
  background:var(--sam-danger) !important;
  border-color:rgba(185,74,72,.42) !important;
}

/* Light-surface contrast rescue for legacy white cards inside the dark theme. */
.filing-shell,
.filing-shell .filing-top,
.filing-shell .filing-list,
.filing-shell .filing-detail,
.filing-shell .filing-item,
[style*="background:#fff"],
[style*="background: #fff"],
[style*="background:white"],
[style*="background: white"] {
  color:#101828 !important;
}
.filing-shell h1,
.filing-shell h2,
.filing-shell h3,
.filing-shell strong,
.filing-shell label,
[style*="background:#fff"] h1,
[style*="background:#fff"] h2,
[style*="background:#fff"] h3,
[style*="background:#fff"] strong,
[style*="background: #fff"] h1,
[style*="background: #fff"] h2,
[style*="background: #fff"] h3,
[style*="background: #fff"] strong {
  color:#101828 !important;
}
.filing-shell p,
.filing-shell small,
.filing-shell .filing-empty,
.filing-shell .filing-list-head span,
.filing-shell .filing-meta,
[style*="background:#fff"] p,
[style*="background:#fff"] small,
[style*="background: #fff"] p,
[style*="background: #fff"] small {
  color:#667085 !important;
}
.filing-shell .filing-top p,
.filing-shell .filing-link,
.filing-shell .filing-status {
  color:#165f83 !important;
}
.filing-shell .filing-empty .material-symbols-outlined {
  color:#667085 !important;
}
.filing-shell .filing-primary,
.filing-shell .filing-primary *,
.filing-shell .filing-primary:disabled {
  color:#fff !important;
}
.card:not(.ops-report-card),
.panel:not(.ops-register),
.bento-shadow,
.card:not(.ops-report-card) .card-t,
.card:not(.ops-report-card) .field-v,
.panel:not(.ops-register) .panel__title {
  color:#101828 !important;
}
.card:not(.ops-report-card) p,
.card:not(.ops-report-card) small,
.card:not(.ops-report-card) .field-l,
.card:not(.ops-report-card) th,
.card:not(.ops-report-card) [style*="color:#787584"],
.card:not(.ops-report-card) [style*="color:#94a3b8"],
.card:not(.ops-report-card) [style*="color:#9aa0ab"],
.card:not(.ops-report-card) [style*="color:#9aa0ad"],
.panel:not(.ops-register) p,
.panel:not(.ops-register) small {
  color:#475467 !important;
}
.card:not(.ops-report-card) .material-symbols-outlined[style*="color:#c8c4d5"],
.card:not(.ops-report-card) .material-symbols-outlined[style*="color:#94a3b8"],
.card:not(.ops-report-card) .material-symbols-outlined[style*="color:#9aa0ab"] {
  color:#667085 !important;
}
.group-h,
.group-h .material-symbols-outlined {
  color:#b8c1d8 !important;
}
.seg button.on,
.card:not(.ops-report-card) .seg button.on {
  background:#217eaa !important;
  color:#fff !important;
}
.btn-primary,
.btn-cta,
.card:not(.ops-report-card) .btn-primary,
.card:not(.ops-report-card) .btn-cta {
  color:#fff !important;
}

/* Dark-surface contrast guard. Keep the operations console readable even when
   legacy white-card rescue rules or inline styles leak dark ink into dark UI. */
.ops-page-shell,
.ops-topbar,
.ops-hero,
.ops-filter-panel,
.ops-register,
.ops-report-card,
.ops-metric,
.ops-pagination,
.ops-empty-state {
  color:var(--sam-ink) !important;
}
.ops-page-shell h1,
.ops-page-shell h2,
.ops-page-shell h3,
.ops-page-shell strong,
.ops-register__head h2,
.ops-report-card h3,
.ops-report-card [style*="color:#1b1b22"],
.ops-report-card [style*="color:#101828"],
.ops-hero [style*="color:#1b1b22"],
.ops-filter-panel [style*="color:#1b1b22"] {
  color:#f8fafc !important;
}
.ops-page-shell p,
.ops-page-shell small,
.ops-page-shell .ops-report-meta,
.ops-page-shell .ops-register__hint,
.ops-page-shell .ops-register__head span,
.ops-page-shell .ops-loading,
.ops-page-shell .ops-empty-state p,
.ops-page-shell [style*="color:#787584"],
.ops-page-shell [style*="color:#667085"],
.ops-page-shell [style*="color:#475467"] {
  color:#a3aec2 !important;
}
.ops-filter-panel input,
.ops-filter-panel select,
.ops-search-field input {
  color:#f8fafc !important;
  background:rgba(5,8,20,.55) !important;
}
.ops-filter-panel input::placeholder,
.ops-search-field input::placeholder {
  color:#a3aec2 !important;
}
.ops-report-source .material-symbols-outlined,
.ops-kicker,
.ops-hero__eyebrow {
  color:var(--sam-warn) !important;
}
.ops-mini-badge,
.ops-card-action,
.ops-pagination button,
.ops-tab {
  color:#d8deea !important;
}
.ops-tab.is-active,
.ops-pagination button:hover:not(:disabled),
.ops-card-action:hover {
  color:#fff !important;
}

.mobile-nav {
  background:rgba(8,13,25,.96) !important;
  border-top:1px solid var(--sam-line) !important;
  color:var(--av-on-dark) !important;
}
.mobile-nav__link {
  color:var(--sam-muted) !important;
}
.mobile-nav__link.is-active {
  color:#fff !important;
  box-shadow:none !important;
}

.ui-icon,
.inline-ui-icon {
  font-size:18px !important;
  line-height:1;
  vertical-align:-4px;
  flex-shrink:0;
}
.ui-icon--sm {
  font-size:16px !important;
  vertical-align:-3px;
}
.ui-icon-label,
.inline-icon-label {
  display:inline-flex;
  align-items:center;
  gap:6px;
}

.slide-panel {
  max-width:100vw !important;
}
.slide-panel:not(.open) {
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}
.slide-panel.open {
  display:block !important;
  visibility:visible !important;
  pointer-events:auto !important;
}

@media (max-width:900px) {
  .ops-tabs,
  .ev-tabs,
  .seg,
  [role="tablist"] {
    margin-left:-2px;
    margin-right:-2px;
    padding-left:2px;
    padding-right:24px;
  }
}

@media (max-width:720px) {
  .page-h1,
  h1[style*="font-size:28px"],
  .ops-page-head h1 {
    font-size:clamp(22px, 7vw, 28px) !important;
  }
  .ops-hero h2,
  #compliance-pct,
  .kpi__value {
    font-size:clamp(28px, 10vw, 36px) !important;
  }
  .ops-metric {
    min-height:96px !important;
  }
  .ops-filter-panel {
    flex-direction:row !important;
    align-items:center !important;
    overflow-x:auto !important;
    flex-wrap:nowrap !important;
    padding-bottom:12px !important;
  }
  .ops-search-field {
    flex:0 0 min(320px, 86vw) !important;
  }
  .ops-filter-panel select,
  .ops-filter-panel .ops-ghost-action {
    flex:0 0 auto !important;
    width:auto !important;
  }
}

/* Premium contrast + navigation icon polish */
body > .flex-1 .page-h1,
body > div.flex-1 .page-h1,
.ops-page-shell .page-h1,
.ops-page-shell h1,
.ops-page-head h1 {
  color:#f8fafc !important;
  text-shadow:0 1px 0 rgba(0,0,0,.18);
}
body > .flex-1 .page-sub,
body > div.flex-1 .page-sub,
.ops-page-shell .page-sub {
  color:#c3ccda !important;
}
.nav-rail .nav-link {
  gap:13px !important;
  padding:9px 13px !important;
  border-radius:9px !important;
}
.nav-rail .nav-link .material-symbols-outlined {
  width:22px !important;
  height:22px !important;
  border-radius:0 !important;
  background:transparent !important;
  border:0 !important;
  color:#9ba6da !important;
  font-size:21px !important;
  font-variation-settings:'FILL' 0,'wght' 360,'GRAD' 0,'opsz' 24 !important;
}
.nav-rail .nav-link:hover .material-symbols-outlined {
  color:#dbe2ff !important;
  transform:translateX(1px);
}
.nav-rail .nav-link.is-active .material-symbols-outlined {
  color:#ffffff !important;
  background:transparent !important;
  border:0 !important;
  font-variation-settings:'FILL' 0,'wght' 520,'GRAD' 0,'opsz' 24 !important;
}
.nav-rail .nav-link.is-active::after {
  content:"";
  position:absolute;
  left:15px;
  top:50%;
  width:4px;
  height:4px;
  border-radius:999px;
  background:var(--sam-warn);
  box-shadow:0 0 0 4px rgba(196,123,48,.14);
  transform:translate(-10px,-50%);
}
.kpi__chip {
  width:36px !important;
  height:36px !important;
  border-radius:999px !important;
  background:rgba(33,126,170,.10) !important;
  border:1px solid rgba(33,126,170,.16) !important;
  box-shadow:none !important;
}
.kpi__chip .material-symbols-outlined {
  font-size:20px !important;
  font-variation-settings:'FILL' 0,'wght' 420,'GRAD' 0,'opsz' 24 !important;
}
.kpi.s-critical .kpi__chip {
  background:rgba(185,74,72,.10) !important;
  border-color:rgba(185,74,72,.18) !important;
}
.kpi.s-ok .kpi__chip {
  background:rgba(47,155,115,.11) !important;
  border-color:rgba(47,155,115,.20) !important;
}

/* ============================================================================
   Aviation Teal Global Theme
   Palette source:
   #eeeeee surface, #f2f2f3 canvas, #8ca4ac muted steel,
   #7d9cb7 secondary steel-blue, #217eaa primary aviation teal.
   Dark navy is added for accessible shell/text contrast.
   ========================================================================== */
:root {
  --av-navy-950:#07121a;
  --av-navy-900:#0b1720;
  --av-navy-850:#101d27;
  --av-surface:#eeeeee;
  --av-canvas:#f2f2f3;
  --av-muted:#8ca4ac;
  --av-secondary:#7d9cb7;
  --av-primary:#217eaa;
  --av-primary-700:#165f83;
  --av-primary-readable:#165f83;
  --av-primary-50:#e8f2f6;
  --av-line:rgba(140,164,172,.34);
  --av-line-strong:rgba(140,164,172,.56);
  --av-text:#07121a;
  --av-text-soft:#364f59;
  --av-on-dark:#f2f2f3;
  --av-on-dark-muted:#b8c8ce;

  --navy-950:var(--av-navy-950);
  --navy-900:var(--av-navy-900);
  --navy-850:var(--av-navy-850);
  --navy-800:#132838;
  --navy:var(--av-navy-950);
  --navy-700:var(--av-primary);
  --primary:var(--av-primary);
  --primary-600:var(--av-primary-700);
  --primary-50:var(--av-primary-50);
  --primary-100:#dbe9ee;
  --brand-accent:var(--av-secondary);
  --brand-accent-600:#5f7f99;
  --brand-accent-50:#e7eef1;
  --info:var(--av-primary);
  --info-50:var(--av-primary-50);
  --ink-900:var(--av-text);
  --ink-800:#132838;
  --ink-700:#263f4a;
  --ink-500:#5f7881;
  --ink-400:var(--av-muted);
  --ink-300:#b4c4ca;
  --line:#d6e0e3;
  --line-soft:#e5ebed;
  --surface:var(--av-surface);
  --surface-2:var(--av-canvas);
  --bg:var(--av-canvas);
  --ring:0 0 0 3px rgba(33,126,170,.22);
  --ops-bg:var(--av-navy-950);
  --ops-bg-2:var(--av-navy-900);
  --ops-surface:rgba(16,29,39,.88);
  --ops-surface-2:rgba(19,40,56,.84);
  --ops-elevated:rgba(18,36,49,.96);
  --ops-line:rgba(140,164,172,.22);
  --ops-line-strong:rgba(140,164,172,.42);
  --ops-text:var(--av-on-dark);
  --ops-muted:var(--av-on-dark-muted);
  --ops-dim:#78919a;
  --ops-indigo:var(--av-primary);
  --ops-indigo-strong:var(--av-primary);
  --ops-crimson:var(--av-primary);
  --ops-crimson-2:var(--av-primary-700);
  --ops-amber:var(--av-secondary);
  --sam-bg:var(--av-navy-950);
  --sam-bg-2:var(--av-navy-900);
  --sam-panel:var(--av-navy-850);
  --sam-panel-2:#132838;
  --sam-line:rgba(140,164,172,.22);
  --sam-line-strong:rgba(140,164,172,.42);
  --sam-ink:var(--av-on-dark);
  --sam-muted:var(--av-on-dark-muted);
  --sam-faint:#78919a;
  --sam-primary:var(--av-primary);
  --sam-primary-2:var(--av-primary-700);
  --sam-action:var(--av-primary);
  --sam-action-2:var(--av-primary-700);
  --sam-warn:var(--av-secondary);
}

body {
  background:
    radial-gradient(900px 460px at 16% -12%, rgba(33,126,170,.18), transparent 62%),
    radial-gradient(720px 420px at 92% 4%, rgba(125,156,183,.12), transparent 58%),
    linear-gradient(145deg, var(--av-navy-950), var(--av-navy-900) 58%, #081017) !important;
  color:var(--av-on-dark) !important;
}
::selection { background:rgba(33,126,170,.24) !important; color:#fff !important; }

#sidebar.nav-rail,
#sidebar {
  background:linear-gradient(180deg, var(--av-navy-950) 0%, var(--av-navy-900) 100%) !important;
  border-right:1px solid rgba(140,164,172,.18) !important;
  box-shadow:12px 0 42px rgba(0,0,0,.22) !important;
}
.nav-rail .nav-brand__mark {
  background:linear-gradient(145deg, #0b1720, #101d27) !important;
  box-shadow:inset 0 0 0 1px rgba(140,164,172,.20), 0 8px 22px rgba(0,0,0,.28) !important;
}
.nav-rail .nav-link {
  color:#c7d3d7 !important;
}
.nav-rail .nav-link:hover {
  background:rgba(33,126,170,.12) !important;
  color:#fff !important;
}
.nav-rail .nav-link .material-symbols-outlined {
  color:#9db3ba !important;
}
.nav-rail .nav-link.is-active {
  background:rgba(33,126,170,.18) !important;
  color:#fff !important;
  box-shadow:inset 3px 0 0 var(--av-secondary) !important;
}
.nav-rail .nav-link.is-active::after {
  background:var(--av-secondary) !important;
  box-shadow:0 0 0 4px rgba(125,156,183,.16) !important;
}
.nav-rail .nav-link.is-active .material-symbols-outlined,
.nav-rail .nav-link:hover .material-symbols-outlined {
  color:#fff !important;
}

.app-topbar,
header.app-topbar,
header[style*="height:64px"] {
  background:rgba(7,18,26,.86) !important;
  border-bottom:1px solid rgba(140,164,172,.20) !important;
  color:var(--av-on-dark) !important;
  box-shadow:none !important;
  -webkit-backdrop-filter:blur(14px) saturate(130%);
  backdrop-filter:blur(14px) saturate(130%);
}
.app-topbar [data-tenant-name],
.app-topbar span,
header[style*="height:64px"] [data-tenant-name],
header[style*="height:64px"] span {
  color:var(--av-on-dark) !important;
}
.app-topbar__crumb,
header[style*="height:64px"] span[style*="color:#787584"] {
  color:var(--av-on-dark-muted) !important;
}
[data-tenant-logo] {
  color:var(--av-surface) !important;
}

.page-h1,
h1[style*="font-size:28px"],
.ops-page-head h1,
body > .flex-1 .page-h1,
body > div.flex-1 .page-h1 {
  color:var(--av-on-dark) !important;
  text-shadow:none !important;
}
.page-sub,
h1[style*="font-size:28px"] + p,
body > .flex-1 .page-sub,
body > div.flex-1 .page-sub {
  color:var(--av-on-dark-muted) !important;
}

.panel,
.card,
.bento-shadow,
.kpi,
.sec-card,
[style*="background:#fff"],
[style*="background: #fff"],
[style*="background:white"],
[style*="background: white"] {
  background:var(--av-surface) !important;
  border-color:var(--av-line) !important;
  color:var(--av-text) !important;
}
.panel h1, .panel h2, .panel h3,
.card h1, .card h2, .card h3,
.bento-shadow h1, .bento-shadow h2, .bento-shadow h3,
.kpi h1, .kpi h2, .kpi h3,
[style*="background:#fff"] h1,
[style*="background:#fff"] h2,
[style*="background:#fff"] h3,
[style*="background: #fff"] h1,
[style*="background: #fff"] h2,
[style*="background: #fff"] h3,
.panel__title,
.card-t,
.kpi__value {
  color:var(--av-text) !important;
}
.panel p, .card p, .bento-shadow p,
.panel small, .card small,
[style*="background:#fff"] p,
[style*="background: #fff"] p,
.kpi__sub,
.page-sub {
  color:var(--av-text-soft) !important;
}
.kpi__label,
.field-l,
[style*="color:#787584"],
[style*="color:#94a3b8"],
[style*="color:#9aa0ab"],
[style*="color:#667085"],
[style*="color:#475467"] {
  color:var(--av-text-soft) !important;
}

.btn--primary,
.btn-primary,
.btn-cta,
.nav-rail .nav-cta,
.ops-primary-action,
.triage-action,
a[style*="background:#1b0088"],
button[style*="background:#1b0088"],
a[style*="background:#217eaa"],
button[style*="background:#217eaa"],
a[style*="background:#e80044"],
button[style*="background:#e80044"],
a[style*="background:#b64b66"],
button[style*="background:#b64b66"] {
  background:linear-gradient(135deg, var(--av-primary), var(--av-primary-700)) !important;
  color:#fff !important;
  border-color:transparent !important;
  box-shadow:0 14px 32px rgba(33,126,170,.22) !important;
}
.btn--primary:hover,
.btn-primary:hover,
.btn-cta:hover,
.ops-primary-action:hover {
  filter:brightness(1.04) !important;
}
.btn--ghost,
.btn-ghost,
button[style*="background:#f0ecf6"],
a[style*="color:#1b0088"],
button[style*="color:#1b0088"] {
  color:var(--av-primary-readable) !important;
  border-color:var(--av-line) !important;
}

a:not(.btn):not(.nav-link):not(.nav-cta):not(.nav-signout):not(.ops-primary-action):not([style*="background:#217eaa"]),
.panel__link,
.cell-id,
[style*="color:#217eaa"] {
  color:var(--av-primary-readable) !important;
}

[style*="color:#5f7881"],
[style*="color: #5f7881"],
.reporting-helper,
.reporting-counter,
.reporting-summary dt,
.reporting-missing ul,
.reporting-template-card span {
  color:var(--av-text-soft) !important;
}

input,
select,
textarea,
.triage-input,
.copy-input,
input.copy-input {
  background:var(--av-canvas) !important;
  color:var(--av-text) !important;
  border-color:var(--av-muted) !important;
}
input:focus,
select:focus,
textarea:focus {
  border-color:var(--av-primary) !important;
  box-shadow:0 0 0 3px rgba(33,126,170,.18) !important;
}
input::placeholder,
textarea::placeholder {
  color:#6e858d !important;
}

.material-symbols-outlined[style*="color:#1b0088"],
.material-symbols-outlined[style*="color:#3e34a6"],
.panel__title .material-symbols-outlined,
.kpi__chip,
.ops-report-source .material-symbols-outlined,
.info-i {
  color:var(--av-primary) !important;
}
.kpi::before,
.s-primary,
.s-info,
.ops-report-line {
  --accent:var(--av-primary) !important;
}
.kpi__chip {
  background:var(--av-primary-50) !important;
  border-color:rgba(33,126,170,.18) !important;
}

.pill[style*="background:#e3dfff"],
span[style*="background:#e3dfff"],
span[style*="background:#f0ecf6"],
span[style*="background:#f1efff"],
.triage-status {
  background:var(--av-primary-50) !important;
  color:var(--av-primary-700) !important;
}
[style*="border-left:3px solid #1b0088"],
[style*="border-left:4px solid #1b0088"] {
  border-left-color:var(--av-primary) !important;
}

.live-pill,
.live-pill * {
  color:#236d51 !important;
}
.app-topbar .live-pill,
.app-topbar .live-pill *,
header[style*="height:64px"] .live-pill,
header[style*="height:64px"] .live-pill * {
  color:#236d51 !important;
}
.live-pill {
  background:#dcefe7 !important;
  border-color:rgba(47,155,115,.34) !important;
}

.chart-box canvas {
  color:var(--av-text-soft);
}
.mobile-nav {
  background:rgba(7,18,26,.96) !important;
  border-top:1px solid rgba(140,164,172,.22) !important;
}
.mobile-nav__link {
  color:var(--av-on-dark-muted) !important;
}
.mobile-nav__link.is-active {
  color:#fff !important;
  background:rgba(33,126,170,.18) !important;
}

/* Preserve semantic meaning: status colors remain distinct from the brand palette. */
.s-critical { --accent:var(--critical) !important; --accent-soft:var(--critical-50) !important; }
.s-warning { --accent:var(--warning) !important; --accent-soft:var(--warning-50) !important; }
.s-ok { --accent:var(--ok) !important; --accent-soft:var(--ok-50) !important; }
.live-pill,
span[style*="background:#d1fae5"] {
  color:#236d51 !important;
  background:#dcefe7 !important;
  border-color:rgba(47,155,115,.26) !important;
}
span[style*="background:#f5dddd"],
span[style*="background:#ffdad3"] {
  color:#8f3735 !important;
}

@media (max-width:720px) {
  .page-h1,
  h1[style*="font-size:28px"],
  .ops-page-head h1 {
    color:var(--av-on-dark) !important;
  }
}
