/*
 * SAMARIA runtime brand foundation.
 * Source standard: docs/brand/samaria-brand-tokens.css and the approved
 * orange CTA exception recorded in the migration plan.
 */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@600;700;800&family=IBM+Plex+Mono:wght@500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --samaria-ink-950:#0a0f14;
  --samaria-navy-950:#07111f;
  --samaria-navy-900:#0b1728;
  --samaria-blue-700:#006c9f;
  --samaria-blue-650:#007fba;
  --samaria-blue-500:#00aeef;
  --samaria-orange-700:#c2410c;
  --samaria-orange-600:#ea580c;
  --samaria-orange-500:#f97316;
  --samaria-canvas:#eef1f5;
  --samaria-surface:#ffffff;
  --samaria-ink:#0a0f14;
  --samaria-ink-muted:#56657a;
  --samaria-border:#d6e0e3;
  --samaria-success:#087a55;
  --samaria-warning:#9a5a08;
  --samaria-danger:#b42332;
  --samaria-info:#285ea8;
  --samaria-font-display:Archivo, ui-sans-serif, sans-serif;
  --samaria-font-body:"IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --samaria-font-mono:"IBM Plex Mono", ui-monospace, Consolas, monospace;
  --samaria-action-gradient:linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
  --samaria-action-shadow:0 10px 22px rgba(194,65,12,.26), 0 0 0 1px rgba(249,115,22,.35) inset;
  --samaria-focus-ring:0 0 0 3px rgba(0,108,159,.28);

  /* Compatibility aliases. Pages are migrated away from these over P2–P5. */
  --ui-font:var(--samaria-font-body);
  --ui-mono:var(--samaria-font-mono);
  --ui-canvas:var(--samaria-canvas);
  --ui-surface:var(--samaria-surface);
  --ui-text:var(--samaria-ink);
  --ui-text-muted:var(--samaria-ink-muted);
  --ui-border:var(--samaria-border);
  --ui-logo-blue-700:var(--samaria-blue-700);
  --ui-logo-blue-650:var(--samaria-blue-650);
  --ui-logo-blue-500:var(--samaria-blue-500);
  --ui-action-700:var(--samaria-orange-700);
  --ui-action-600:var(--samaria-orange-600);
  --ui-action-500:var(--samaria-orange-500);
  --ui-action-gradient:var(--samaria-action-gradient);
  --ui-focus:var(--samaria-focus-ring);
}

html { background:var(--samaria-canvas); }
body, button, input, select, textarea { font-family:var(--samaria-font-body) !important; }
body { background:var(--samaria-canvas) !important; color:var(--samaria-ink) !important; }
h1, h2, h3, h4, h5, h6, .page-h1, .card-t { font-family:var(--samaria-font-display) !important; }
.mono, .cell-id, code, pre { font-family:var(--samaria-font-mono) !important; }
#detail-panel .hash-chip, #detail-panel #detail-recid { font-family:var(--samaria-font-mono) !important; }
.report-reference { font-family:var(--samaria-font-mono); font-size:11px; color:var(--samaria-ink-muted); }
a { color:var(--samaria-blue-700); }

/* Inline legacy literals still exist in older family screens. Normalize their
 * visible structural roles at the final foundation layer while those templates
 * are gradually retired. */
[style*="color:#006C9F"], [style*="color: #006C9F"],
[style*="color:#006C9F"], [style*="color: #006C9F"] {
  color:var(--samaria-blue-700) !important;
}
[style*="border-color:#006C9F"], [style*="border:1px solid #006C9F"],
[style*="border:1.5px solid #006C9F"] {
  border-color:var(--samaria-blue-700) !important;
}

/* Shared action contract. The CTA surface stays in the dark-orange part of
 * the approved gradient so white label/icon text retains a 4.5:1+ pair. */
.btn--primary, .btn-primary, .btn-cta, .nav-rail .nav-cta, .ops-primary-action,
.triage-action, .primary-btn, .p-btn--primary, .samaria-button--primary, .sup-btn-primary,
a[style*="background:#006C9F"], button[style*="background:#006C9F"],
a[style*="background:#C2410C"], button[style*="background:#C2410C"],
a[style*="background:#006C9F"], button[style*="background:#006C9F"],
a[style*="background:#b64b66"], button[style*="background:#b64b66"] {
  background:var(--samaria-action-gradient) !important;
  border-color:transparent !important;
  color:#fff !important;
  box-shadow:var(--samaria-action-shadow) !important;
  text-shadow:0 1px 1px rgba(79,24,8,.35);
}
/* Legacy sheets still declare blue `.btn-primary` surfaces with higher
 * specificity. The id-negation lifts this contract above them so every primary
 * action, anchor or button, keeps the orange gradient and white label. */
html body :is(.btn--primary, .btn-primary, .btn-cta, .ops-primary-action, .triage-action,
  .primary-btn, .p-btn--primary, .samaria-button--primary, .sup-btn-primary,
  .filing-primary, .reporting-button-primary):not(#samaria-cta) {
  background:var(--samaria-action-gradient) !important;
  border-color:transparent !important;
  color:#fff !important;
  box-shadow:var(--samaria-action-shadow) !important;
}
.btn--primary:hover, .btn-primary:hover, .btn-cta:hover, .nav-rail .nav-cta:hover,
.ops-primary-action:hover, .triage-action:hover, .primary-btn:hover { filter:brightness(1.06); }
.btn--primary:active, .btn-primary:active, .btn-cta:active, .nav-rail .nav-cta:active,
.ops-primary-action:active, .triage-action:active, .primary-btn:active { transform:translateY(1px); box-shadow:0 4px 10px rgba(194,65,12,.22) !important; }

/* Structure controls are blue, not hidden legacy indigo or crimson. */
.btn--secondary, .btn-secondary, .btn--ghost, .btn-ghost {
  border-color:var(--samaria-blue-700) !important;
  color:var(--samaria-blue-700) !important;
  background:#fff !important;
}

/* Tabs are controls, not muted text links: every visible tab has a solid
 * SAMARIA structural surface and white text. The active state moves to navy,
 * avoiding an additional decorative colour and keeping its contrast. */
.seg button, .tab-btn, .ev-tab, #detail-panel .dt-tab, #detail-panel .an-subtab {
  background:var(--samaria-blue-700) !important;
  border:1px solid var(--samaria-blue-700) !important;
  color:#fff !important;
  text-shadow:0 1px 1px rgba(7,17,31,.24);
}
html body .seg button.on, html body .tab-btn.active, html body .ev-tab.active,
html body #detail-panel .dt-tab.active, html body #detail-panel .an-subtab.active {
  background:var(--samaria-navy-950) !important;
  border-color:var(--samaria-navy-950) !important;
  color:#fff !important;
  box-shadow:0 5px 14px rgba(7,17,31,.18) !important;
}
.ev-tab:hover, #detail-panel .dt-tab:hover, #detail-panel .an-subtab:hover { filter:brightness(1.08); color:#fff !important; }

/* Semantic states carry meaning only. */
.status-danger, .badge-danger, .pill-danger { color:var(--samaria-danger) !important; }
.status-warning, .badge-warning, .pill-warning { color:var(--samaria-warning) !important; }
.status-success, .badge-success, .pill-success { color:var(--samaria-success) !important; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible { outline:0 !important; box-shadow:var(--samaria-focus-ring) !important; }

@media (max-width: 390px) {
  .btn--primary, .btn-primary, .btn-cta, .nav-rail .nav-cta, .ops-primary-action, .triage-action, .primary-btn { min-height:44px; }
  html body .section-tab { min-width:0 !important; max-width:none !important; flex:1 1 0 !important; padding-inline:6px !important; white-space:normal; }
}

/* Persistent register primitive. Record inspection belongs in the page flow;
 * only short confirmations and recovery actions may remain dialogs. */
.samaria-list-detail {
  display:grid;
  grid-template-columns:minmax(280px, 0.78fr) minmax(420px, 1.22fr);
  gap:24px;
  align-items:start;
  min-width:0;
}
.samaria-list-detail__queue,
.samaria-list-detail__detail {
  min-width:0;
  background:var(--samaria-surface);
  border:1px solid var(--samaria-border);
  border-radius:14px;
  box-shadow:0 8px 24px rgba(7,17,31,.06);
}
.samaria-list-detail__queue { overflow:hidden; }
.samaria-list-detail__detail { min-height:480px; }
.samaria-list-detail__row {
  display:block;
  width:100%;
  min-height:68px;
  padding:14px 16px;
  border:0;
  border-bottom:1px solid var(--samaria-border);
  background:transparent;
  color:var(--samaria-ink);
  text-align:left;
  cursor:pointer;
}
.samaria-list-detail__row:hover { background:#f5f9fb; }
.samaria-list-detail__row[aria-selected="true"] {
  background:#e8f3f8;
  box-shadow:inset 4px 0 var(--samaria-blue-700);
}
.samaria-list-detail__row:focus-visible { box-shadow:var(--samaria-focus-ring); }
.samaria-list-detail__detail-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:20px 22px;
  border-bottom:1px solid var(--samaria-border);
}
.samaria-list-detail__detail-body { padding:22px; }
.samaria-list-detail__empty { padding:48px 24px; color:var(--samaria-ink-muted); }
@media (max-width: 900px) {
  .samaria-list-detail { grid-template-columns:1fr; }
  .samaria-list-detail__detail { min-height:0; }
}
@media (max-width: 390px) {
  .samaria-list-detail { gap:12px; }
  .samaria-list-detail__detail-head,
  .samaria-list-detail__detail-body { padding:16px; }
}

