:root {
  /* OXON brand palette — sampled from oxonpower.com (2026-05-22) */
  /* Canvas: warm dark olive, not near-black. Cream + black appear as occasional
     contrast surfaces on the consumer site; here we use cream sparingly. */
  --bg: #3B3D32;             /* page canvas */
  --bg-deep: #2E2F26;        /* login canvas, input wells */
  --surface: #48493C;        /* card, nav, table rows — the literal brand olive */
  --surface-elevated: #55564A;
  --border: #5C5D4F;
  --border-strong: #73746A;

  --fg: #FFFFFF;
  --muted: #BDBEB1;          /* warm muted, reads on olive */
  --muted-dim: #8B8C7E;

  /* Cream contrast surface — used for accent panels (Key generated, summary) */
  --cream: #D1D2D6;
  --cream-text: #48493C;

  /* Electric yellow-green — the OXON lime */
  --accent: #EAFF00;
  --accent-hover: #F4FF66;
  --accent-deep: #C5DE00;
  --accent-soft: rgba(234, 255, 0, 0.16);
  --accent-faint: rgba(234, 255, 0, 0.07);
  /* Logo gradient on the chartreuse bull — kept for the login hero only */
  --accent-gradient: linear-gradient(90deg, #FBFF8A 0%, #EAFF00 50%, #6BC436 100%);

  --danger: #FF4747;
  --danger-soft: rgba(255, 71, 71, 0.18);
  --warning: #FFB02E;
  --warning-soft: rgba(255, 176, 46, 0.18);

  /* Typography — free analogues for the OXON brand pair (Mars + Px-Grotesk).
     Mona Sans is the closest free analogue to Mars: heavier, more squared, and
     more industrial than the alternatives (Space Grotesk reads quirkier;
     Inter reads generic). IBM Plex Mono matches the monospace body voice
     used on oxonpower.com. */
  --font-display: 'Mona Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'IBM Plex Mono', ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.94em;
  letter-spacing: 0;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1.1;
}
h1 { font-size: 2.875rem; letter-spacing: -0.022em; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.25rem; letter-spacing: -0.005em; }
h4 { font-size: 1.0625rem; }

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 72px;
  display: flex;
  align-items: center;
}
.site-header__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  color: var(--fg);
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand__logo {
  height: 28px;
  width: auto;
  display: block;
}
.brand__qualifier {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 0.875rem;
  border-left: 1px solid var(--border-strong);
  line-height: 1;
}

.nav { display: flex; gap: 0.125rem; flex: 1; }
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.15s;
}
.nav-link:hover { color: var(--fg); text-decoration: none; }
.nav-link.is-active { color: var(--accent); }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0.875rem;
  right: 0.875rem;
  bottom: -1.25rem;
  height: 2px;
  background: var(--accent);
}

.nav-right { display: flex; align-items: center; gap: 1rem; }
.session-user {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.session-user strong { color: var(--fg); font-weight: 600; }

/* User menu dropdown */
.user-menu { position: relative; }
.user-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  user-select: none;
}
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary::marker { content: ""; }
.user-menu > summary:hover { border-color: var(--accent); color: var(--accent); }
.user-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.user-menu__label { color: inherit; }
.user-menu__caret {
  transition: transform 0.15s;
  color: var(--muted);
}
.user-menu[open] > summary { border-color: var(--accent); color: var(--accent); }
.user-menu[open] .user-menu__caret { transform: rotate(180deg); color: var(--accent); }

.user-menu__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 220px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.375rem;
  display: flex;
  flex-direction: column;
  z-index: 60;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}
.user-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.625rem 0.875rem;
  font: inherit;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.user-menu__item:hover { background: var(--surface); color: var(--accent); text-decoration: none; }
.user-menu__item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.user-menu__item--danger:hover { color: var(--danger); }

main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2.5rem 32px 5rem;
}
/* Full-bleed override for the login page so the auth-shell can paint
   edge-to-edge — including the radial accent gradient — instead of being
   clipped by main's max-width and side padding. */
main.main--full {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* ============ PAGE HEADER ============ */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.page-header__title { display: flex; flex-direction: column; gap: 0.5rem; }
/* Eyebrows are kept uppercase + tracked as functional category markers —
   they help engineers parse the screen at a glance, which matches the
   "dense + data-first" tone the console needs even when the consumer site
   reads more like marketing copy. */
.page-header__eyebrow {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 600;
}
.page-header__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.section { margin-bottom: 3rem; }
.section-title {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 1rem;
  font-weight: 600;
}

/* Asterisk divider — engineering blueprint feel, also used on oxonpower.com */
.asterisks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 2.5rem 0;
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.5em;
  user-select: none;
}
.asterisks::before, .asterisks::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
.asterisks span { padding: 0 0.25rem; }

/* ============ CARDS / GRID ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.625rem;
}
.card-tight { padding: 1.25rem; }
.card-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 0.875rem;
  font-weight: 600;
}
.card-value {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}
.card-value--accent { color: var(--accent); }
.card-sub { color: var(--muted); font-size: 0.875rem; margin-top: 0.875rem; }

/* Cream contrast card — for "just generated" key shown once, summary panels */
.card-cream {
  background: var(--cream);
  color: var(--cream-text);
  border-color: var(--cream);
}
.card-cream .card-title { color: var(--cream-text); opacity: 0.7; }
.card-cream a { color: #000; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-tight { gap: 0.5rem; }
.row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.spacer { flex: 1; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.375rem;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.1;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #000; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-elevated); border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; font-weight: 600; }
.btn-danger:hover { background: #FF6363; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { color: var(--fg); text-decoration: none; }
.btn-sm { padding: 0.4375rem 1rem; font-size: 0.875rem; }

/* ============ FORMS ============ */
.form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.2;
}
.field-hint { font-size: 0.8125rem; color: var(--muted-dim); line-height: 1.4; }
/* Action-button cell inside a .form-row. Anchors the button to the input row
   (top of cell + label height + label-input gap) so it visually aligns with
   inputs in sibling cells, regardless of whether those siblings have hints. */
.field-actions {
  align-self: start;
  padding-top: calc(0.75rem * 1.2 + 0.5rem);
}
.input, .select, .textarea {
  background: var(--bg-deep);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.6875rem 0.9375rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.input::placeholder { color: var(--muted-dim); }
.textarea { resize: vertical; min-height: 5rem; font-family: var(--font-mono); }

/* ============ TABLES ============ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
/* Column headers stay uppercase + tracked — they read as small caps,
   which speeds column identification on data-dense screens. */
.table thead th {
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding: 0.9375rem 1.125rem;
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface);
  white-space: nowrap;
}
.table tbody td {
  padding: 0.9375rem 1.125rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--surface-elevated); }
.table tbody tr:last-child td { border-bottom: none; }
.table-empty {
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
}
.table-wrapper {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

/* ============ PAGER ============ */
/* Used by Pages/Shared/_Pager.cshtml.
   See docs/Web_List_Pagination_Spec.md §3.3. */
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.8125rem;
}
.pager__summary strong { color: var(--fg); font-weight: 600; }
.pager__page-of { color: var(--muted-dim); }
.pager__controls { display: flex; gap: 0.5rem; }

/* ============ BADGES ============ */
/* Badges stay compact + uppercase for dense status scanning. */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.badge-inactive { background: rgba(189, 190, 177, 0.16); color: var(--muted); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-pass { background: var(--accent-soft); color: var(--accent); }
.badge-fail { background: var(--danger-soft); color: var(--danger); }
.badge-pending { background: rgba(189, 190, 177, 0.16); color: var(--muted); }

/* ============ FLASH BANNERS ============ */
.flash {
  padding: 0.9375rem 1.25rem;
  border-radius: 8px;
  border-left: 3px solid;
  background: var(--surface);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.flash-success { border-color: var(--accent); color: var(--fg); }
.flash-success::before { content: "✓"; color: var(--accent); font-weight: 700; }
.flash-error { border-color: var(--danger); color: var(--fg); }
.flash-error::before { content: "!"; color: var(--danger); font-weight: 700; font-family: var(--font-mono); }
.flash-warning { border-color: var(--warning); color: var(--fg); }
.flash-warning::before { content: "⚠"; color: var(--warning); }

/* ============ LOGIN ============ */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
}
.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent-faint), transparent 60%);
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}
.auth-logo {
  display: block;
  margin: 0 auto 2.5rem;
  height: 56px;
  width: auto;
}
.auth-card .card { padding: 2.5rem; border-color: var(--border-strong); border-radius: 12px; }
.auth-card h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.015em;
}
.auth-card .sub {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  margin-bottom: 1.875rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
}

/* ============ MISC ============ */
.muted { color: var(--muted); }
.dim { color: var(--muted-dim); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; display: inline-block; vertical-align: bottom; }
.kbd-block {
  background: var(--bg-deep);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 1rem 1.125rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  word-break: break-all;
  user-select: all;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.divider { height: 1px; background: var(--border); margin: 2rem 0; }
details summary {
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
details summary:hover { color: var(--accent); }
.json-view {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--fg);
}
.log-view {
  background: #18190F;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: #D4D4C4;
  max-height: 600px;
  overflow: auto;
  white-space: pre;
}

/* ============ FOOTER ============ */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 2rem 0;
  color: var(--muted-dim);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}
.site-footer__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* ============ MOBILE NAV TOGGLE (hidden on desktop) ============ */
/* The hamburger button only renders below 768px. On desktop it's display:none
   so the existing header layout is untouched. The visual language matches the
   user-menu pill (44×44 olive outline, accent on hover/open) so the chrome
   reads as one family. */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.18s, opacity 0.18s;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ============ RESPONSIVE — TABLET (<=768px) ============ */
/* Header collapses to a hamburger; main gutter tightens; page-header stacks;
   primary CTA in page-header__actions spans the row. Desktop look is
   unchanged above this breakpoint. */
@media (max-width: 768px) {
  .site-header { height: 64px; }
  .site-header__inner { padding: 0 20px; gap: 1rem; }
  .brand__qualifier { display: none; }

  /* The desktop horizontal nav becomes a vertical drawer that drops out of
     the header. Hidden until JS toggles .is-open on it. */
  .nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    flex: none;
    background: var(--surface-elevated);
    border-bottom: 1px solid var(--border-strong);
    padding: 0.75rem 1.25rem 1.25rem;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s, opacity 0.18s;
    z-index: 40;
  }
  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-link {
    padding: 0.9375rem 0.875rem;
    border-left: 2px solid transparent;
    border-radius: 0;
  }
  .nav-link.is-active { color: var(--accent); border-left-color: var(--accent); }
  /* Drawer item is full-width and uses a left active-bar instead of the
     desktop's underline. Suppress the desktop ::after underline. */
  .nav-link.is-active::after { display: none; }

  .nav-toggle { display: inline-flex; margin-left: auto; }

  /* Tighten user-menu pill to free space next to the hamburger. */
  .user-menu > summary { padding: 0.4375rem 0.75rem; gap: 0.375rem; }

  main { padding: 1.75rem 20px 4rem; }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }
  .page-header__actions { width: 100%; }
  .page-header__actions .btn { flex: 1 1 auto; }

  h1 { font-size: 2rem; }
  .card { padding: 1.25rem; }
  .card-value { font-size: 2.25rem; }

  .site-footer__inner {
    padding: 0 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
  }
}

/* ============ RESPONSIVE — PHONE (<=600px) ============ */
/* Tables transform into card-per-row stacks (selected pattern). Inputs bump
   to 16px so iOS Safari doesn't zoom on focus; pill buttons enlarge to 44px
   touch targets. */
@media (max-width: 600px) {
  /* --- TABLE → CARD TRANSFORM ---
     Contract: every <td> carries data-label="<column header>" (empty string
     for action cells). The thead is hidden on mobile; each tr becomes an
     olive card; each td becomes a label/value row inside that card. */
  .table-wrapper {
    border: none;
    background: transparent;
    border-radius: 0;
    overflow: visible;
  }
  .table { font-size: 0.9375rem; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.125rem;
    margin-bottom: 0.875rem;
  }
  .table tbody tr:hover { background: var(--surface); }
  .table tbody tr:last-child { margin-bottom: 0; }
  .table td {
    padding: 0.4375rem 0;
    border-bottom: none;
    display: grid;
    grid-template-columns: minmax(7rem, 35%) 1fr;
    gap: 0.875rem;
    align-items: baseline;
  }
  .table td::before {
    content: attr(data-label);
    font-family: var(--font-display);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.3;
  }
  /* First cell = card title: full-width, larger font, lime hairline below. */
  .table tr td:first-child {
    display: block;
    padding: 0 0 0.625rem;
    margin-bottom: 0.625rem;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
  }
  .table tr td:first-child::before { display: none; }
  /* Last cell = action: full-width button, separated by extra top padding. */
  .table tr td:last-child {
    display: block;
    padding: 0.75rem 0 0;
  }
  .table tr td:last-child::before { display: none; }
  .table tr td:last-child .btn { width: 100%; }
  /* If the action cell is empty (no button), don't carve out space for it. */
  .table tr td:last-child:empty { display: none; }
  /* Don't show a label-cell layout for the empty-state row. */
  .table tr td.table-empty {
    display: block;
    padding: 2rem 1rem;
    text-align: center;
  }
  .table tr td.table-empty::before { display: none; }

  /* --- TOUCH + FORM POLISH --- */
  .input, .select, .textarea {
    font-size: 16px; /* prevents iOS zoom-on-focus */
    padding: 0.8125rem 1rem;
  }
  .btn { padding: 0.8125rem 1.375rem; min-height: 44px; font-size: 0.9375rem; }
  .btn-sm { padding: 0.5625rem 1rem; min-height: 40px; font-size: 0.875rem; }
  .user-menu__panel {
    right: 0;
    left: auto;
    max-width: calc(100vw - 32px);
  }
  .auth-card .card { padding: 1.75rem; }
  .auth-card h1 { font-size: 1.5rem; }
  .auth-shell { padding: 1.25rem; }
  /* The header-logo wordmark+bull is wider than a narrow phone viewport at
     its desktop 56px height; cap the height and clamp width to stay inside
     the auth-shell padding. Desktop size in the base rule above is preserved. */
  .auth-logo { height: 40px; max-width: 100%; margin-bottom: 2rem; }

  /* Slightly tighter section rhythm on phones. */
  .section { margin-bottom: 2rem; }
  .page-header { margin-bottom: 1.5rem; padding-bottom: 1rem; }
  .asterisks { margin: 1.75rem 0; }
}
