/* ═══════════════════════════════════════════════════════════════
   ADMIN SHELL — topbar + sidebar + content
   Adapted from the Admin deck's .desktop frame to a fluid full-viewport
   layout (the prototype used a fixed 1440×900 device frame).
   ═══════════════════════════════════════════════════════════════ */
.admin-shell {
  --topbar-height: 56px;
  --sidebar-width: 240px;
  height: 100dvh;
  background: var(--bg-canvas);
  overflow: hidden;
  display: grid;
  grid-template-rows: var(--topbar-height) 1fr;
  position: relative;
}

/* ── Topbar ─────────────────────────────────────────── */
.topbar { background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); display: grid; grid-template-columns: var(--sidebar-width) 1fr auto; align-items: center; height: var(--topbar-height); }
.topbar__brand { display: flex; align-items: center; gap: 8px; padding: 0 var(--space-6); border-right: 1px solid var(--border-subtle); height: 100%; text-decoration: none; }
.topbar__logo { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, var(--brand-golden) 0%, var(--brand-orange) 50%, var(--brand-red) 100%); display: flex; align-items: center; justify-content: center; color: var(--wine-400); font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: -0.04em; flex-shrink: 0; }
.topbar__app-name { font-family: var(--font-display); font-size: 18px; font-weight: 500; letter-spacing: -0.01em; color: var(--text-primary); line-height: 1; }
.topbar__center { padding: 0 var(--space-6); display: flex; align-items: center; gap: var(--space-4); }
.topbar__breadcrumb { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; color: var(--text-tertiary); }
.topbar__breadcrumb svg { width: 12px; height: 12px; opacity: 0.5; }
.topbar__breadcrumb .current { color: var(--text-primary); font-weight: 500; }
.topbar__right { padding: 0 var(--space-6); display: flex; align-items: center; gap: var(--space-4); margin-left: auto; }
.topbar__user { display: flex; align-items: center; gap: var(--space-2); padding: 4px 10px 4px 4px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-full); }
.topbar__user-avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-orange), var(--brand-red)); color: white; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 11px; font-weight: 700; }
.topbar__user-name { font-family: var(--font-display); font-size: 12px; font-weight: 500; display: flex; flex-direction: column; line-height: 1.2; }
.topbar__user-name small { font-family: var(--font-mono); font-size: 9px; color: var(--text-tertiary); letter-spacing: 0.04em; font-weight: 400; }
.topbar__signout { display: inline-flex; }
.topbar__signout button { height: 30px; padding: 0 var(--space-3); border: 1px solid var(--border-default); background: var(--bg-elevated); color: var(--text-secondary); border-radius: var(--radius-md); font-family: var(--font-mono); font-size: 11px; }
.topbar__signout button:hover { color: var(--text-primary); border-color: var(--border-strong); }

/* ── Main split: sidebar + content ──────────────────── */
.main { display: grid; grid-template-columns: var(--sidebar-width) 1fr; overflow: hidden; height: calc(100dvh - var(--topbar-height)); }
.sidebar { background: var(--bg-surface); border-right: 1px solid var(--border-subtle); padding: var(--space-4) 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-4); }
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-section__head { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-tertiary); font-weight: 500; padding: var(--space-2) var(--space-5); }
.nav-item { display: grid; grid-template-columns: 18px 1fr auto; gap: var(--space-3); align-items: center; padding: 8px var(--space-5); font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; border-left: 2px solid transparent; text-decoration: none; }
.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item[aria-current="page"] { background: var(--bg-elevated); color: var(--text-primary); border-left-color: var(--accent-emphasis); }
.nav-item__icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.nav-item__icon svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sidebar__footer { margin-top: auto; padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: var(--space-2); font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); letter-spacing: 0.04em; }
.sidebar__footer-row { display: flex; justify-content: space-between; }
.sidebar__footer-row strong { color: var(--text-secondary); font-weight: 600; }

/* ── Content area ───────────────────────────────────── */
.content { display: flex; flex-direction: column; overflow: hidden; }
.content__head { padding: var(--space-5) var(--space-6) var(--space-4); display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--space-6); border-bottom: 1px solid var(--border-subtle); }
.content__head-title { display: flex; flex-direction: column; gap: var(--space-1); }
.content__head-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-tertiary); }
.content__head-h1 { font-family: var(--font-display); font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; color: var(--text-primary); }
.content__head-h1 strong { font-weight: 600; }
.content__head-actions { display: flex; align-items: center; gap: var(--space-2); }

/* ── Buttons ────────────────────────────────────────── */
.btn { height: 32px; padding: 0 var(--space-4); border: 1px solid var(--border-default); background: var(--bg-elevated); color: var(--text-primary); border-radius: var(--radius-md); font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; flex-shrink: 0; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--border-strong); }
.btn svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.btn--primary { background: var(--accent-emphasis); border-color: var(--accent-emphasis); color: white; }
.btn--primary:hover { background: var(--brand-red); border-color: var(--brand-red); }
.btn--danger { background: transparent; border-color: var(--fail-border); color: var(--fail-color); }
.btn--danger:hover { background: var(--fail-bg); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn--ghost:hover { color: var(--text-primary); background: var(--bg-elevated); }
.btn--danger-ghost { background: transparent; border-color: transparent; color: var(--text-tertiary); }
.btn--danger-ghost:hover { color: var(--fail-color); background: var(--fail-bg); }
.btn--sm { height: 26px; padding: 0 var(--space-3); font-size: 11px; }
/* button_to renders a <form> wrapper; keep inline so buttons sit in a row */
form.button_to { display: inline; }

/* ── Filter bar ─────────────────────────────────────── */
.filter-bar { padding: var(--space-3) var(--space-6); background: var(--bg-sunken); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.filter-search { flex: 1; min-width: 280px; max-width: 480px; height: 32px; display: flex; align-items: center; gap: var(--space-2); background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 0 var(--space-3); color: var(--text-tertiary); }
.filter-search svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.filter-search input { flex: 1; background: transparent; border: 0; color: var(--text-primary); font-family: var(--font-body); font-size: 12px; outline: none; }
/* Self-contained rather than reusing .field__select: detail-panel.css loads after
   this file, so at equal specificity its width:100% wins and the select takes a
   whole flex line, stacking the search and the radio group under it. Sized to
   match .filter-search (32px, 12px) rather than the 36px panel-form fields. */
.filter-select { height: 32px; min-width: 200px; padding: 0 var(--space-6) 0 var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md); color: var(--text-primary); font-family: var(--font-body); font-size: 12px; outline: none; cursor: pointer; appearance: none; background-color: var(--bg-elevated); background-image: linear-gradient(45deg, transparent 50%, var(--text-tertiary) 50%), linear-gradient(135deg, var(--text-tertiary) 50%, transparent 50%); background-position: right 14px top 50%, right 9px top 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.filter-select:focus { border-color: var(--accent-emphasis); box-shadow: 0 0 0 3px rgba(233, 114, 76, 0.15); }

/* Radio-driven segmented control — the status filter submits its GET form, so
   the active choice is browser-maintained (input:checked) rather than a
   server-rendered aria-pressed that a frame-only reload would leave stale. */
.view-toggle input[type="radio"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.view-toggle label { height: 26px; padding: 0 var(--space-3); border-radius: 6px; font-family: var(--font-display); font-size: 11px; font-weight: 600; letter-spacing: 0.05em; color: var(--text-tertiary); display: inline-flex; align-items: center; cursor: pointer; }
.view-toggle label:hover { color: var(--text-secondary); }
.view-toggle input:focus-visible + label { outline: 2px solid var(--accent-emphasis); outline-offset: 1px; }
.view-toggle input:checked + label { background: var(--bg-canvas); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }

/* ── Keyset pagination ──────────────────────────────── */
.pagination { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-6); border-top: 1px solid var(--border-subtle); background: var(--bg-sunken); }
.pagination__disabled { opacity: 0.4; pointer-events: none; cursor: default; }

/* ── Notify pill (deferred live updates for engaged viewers) ── */
.notify-pill { display: flex; width: fit-content; margin: var(--space-3) auto 0; position: sticky; top: var(--space-3); z-index: 5; align-items: center; gap: var(--space-2); height: 28px; padding: 0 var(--space-4); border: 1px solid var(--accent-border); background: var(--accent-bg); color: var(--accent-emphasis); border-radius: 999px; font-family: var(--font-display); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
.notify-pill svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.notify-pill[hidden] { display: none; }

/* ── Summary strip ──────────────────────────────────── */
.summary-strip { padding: var(--space-4) var(--space-6); display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); border-bottom: 1px solid var(--border-subtle); background: var(--bg-canvas); }
.summary-card { padding: var(--space-3) var(--space-4); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.summary-card::before { content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 3px; background: var(--accent-emphasis); }
.summary-card--info::before { background: var(--info-color); }
.summary-card--pass::before { background: var(--pass-color); }
.summary-card--warn::before { background: var(--warn-color); }
.summary-card--fail::before { background: var(--fail-color); }
.summary-card__label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-tertiary); font-weight: 500; }
.summary-card__value { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.summary-card__sub { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); letter-spacing: 0.04em; }
