/* ============================================================
   Proxy Player — "Signal" control console
   Dark broadcast-ops aesthetic. Custom design system.
   Fonts: Bricolage Grotesque (display) · Hanken Grotesk (UI) · JetBrains Mono (technical)
   ============================================================ */

:root {
  /* surfaces — cool near-black */
  --bg:        oklch(16% 0.012 260);
  --bg-2:      oklch(19% 0.013 260);
  --surface:   oklch(21.5% 0.015 262);
  --surface-2: oklch(25% 0.017 262);
  --line:      oklch(100% 0 0 / 0.09);
  --line-2:    oklch(100% 0 0 / 0.16);

  /* text */
  --text:   oklch(96% 0.006 260);
  --muted:  oklch(72% 0.015 262);
  --faint:  oklch(56% 0.018 262);

  /* signal lime — the one bold accent ("on air") */
  --accent:      oklch(89% 0.21 124);
  --accent-2:    oklch(82% 0.20 128);
  --accent-press:oklch(75% 0.18 130);
  --on-accent:   oklch(22% 0.05 140);

  /* semantic */
  --ok:     oklch(84% 0.17 150);
  --info:   oklch(82% 0.12 226);
  --warn:   oklch(84% 0.16 80);
  --danger: oklch(70% 0.20 24);

  --glow: oklch(89% 0.21 124 / 0.16);

  --radius:   14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  --sidebar-w: 250px;
  --shadow: 0 1px 0 oklch(100% 0 0 / 0.04) inset, 0 18px 40px -24px oklch(0% 0 0 / 0.8);
  --shadow-lg: 0 40px 90px -30px oklch(0% 0 0 / 0.85);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Bricolage Grotesque', 'Hanken Grotesk', system-ui, sans-serif;
  --font-ui: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* atmosphere: faint grid + accent glow, fixed behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 500px at 12% -8%, var(--glow), transparent 60%),
    radial-gradient(700px 600px at 100% 0%, oklch(82% 0.12 226 / 0.07), transparent 55%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(oklch(100% 0 0 / 0.022) 1px, transparent 1px),
    linear-gradient(90deg, oklch(100% 0 0 / 0.022) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 0%, #000 0%, transparent 78%);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--on-accent); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: content-box; }

/* ============================================================ App shell */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 16px;
  background: linear-gradient(180deg, var(--bg-2), oklch(15% 0.012 260));
  border-right: 1px solid var(--line);
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 10px 22px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--glow);
  animation: pulse 2.4s var(--ease) infinite;
}
.brand small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 2px;
}

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 16px 12px 7px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  position: relative;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav-link svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav-link:hover { background: oklch(100% 0 0 / 0.05); color: var(--text); }
.nav-link.active { background: oklch(100% 0 0 / 0.06); color: var(--text); }
.nav-link.active::before {
  content: "";
  position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}
.nav-link.danger:hover { color: var(--danger); }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }

/* mobile drawer scrim */
.scrim {
  position: fixed; inset: 0; z-index: 49;
  background: oklch(0% 0 0 / 0.55);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity .25s var(--ease), visibility .25s;
}

/* ============================================================ Main */
.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px clamp(18px, 4vw, 40px);
  background: oklch(16% 0.012 260 / 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar .eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.topbar .title {
  margin: 1px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.topbar .spacer { flex: 1; }

.icon-btn.nav-toggle { display: none; } /* hidden on desktop; .icon-btn.* beats .icon-btn */

.content {
  padding: clamp(20px, 4vw, 40px);
  flex: 1;
  width: 100%;
  max-width: 1320px;
}

/* staggered entrance */
.stagger > * { opacity: 0; transform: translateY(14px); animation: rise .6s var(--ease) forwards; }
.stagger > *:nth-child(1) { animation-delay: .04s; }
.stagger > *:nth-child(2) { animation-delay: .10s; }
.stagger > *:nth-child(3) { animation-delay: .16s; }
.stagger > *:nth-child(4) { animation-delay: .22s; }
.stagger > *:nth-child(5) { animation-delay: .28s; }
.stagger > *:nth-child(6) { animation-delay: .34s; }

/* ============================================================ Panels */
.panel {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }

/* ============================================================ Stat cards (dashboard) */
.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.stat {
  position: relative;
  padding: 20px;
  background: linear-gradient(160deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.stat:hover { transform: translateY(-3px); border-color: var(--line-2); }
.stat::after {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 160px; height: 160px;
  background: radial-gradient(circle, var(--glow), transparent 70%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.stat:hover::after { opacity: 1; }
.stat .k {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--faint);
}
.stat .k svg { width: 16px; height: 16px; color: var(--accent-2); }
.stat .v {
  font-family: var(--font-display); font-weight: 800;
  font-size: 44px; line-height: 1; letter-spacing: -0.03em;
  margin-top: 14px;
  font-variant-numeric: tabular-nums;
}
.stat .sub { margin-top: 6px; font-size: 13px; color: var(--muted); }
.stat a.more { color: var(--accent-2); font-weight: 600; }

/* ============================================================ Buttons */
.btn {
  --b: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-weight: 600; font-size: 14px;
  line-height: 1; white-space: nowrap;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--b);
  color: var(--text);
  cursor: pointer;
  transition: transform .12s var(--ease), background .18s var(--ease), border-color .18s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--faint); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-accent {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  border-color: transparent;
  box-shadow: 0 8px 24px -10px var(--accent), 0 0 0 1px oklch(89% 0.21 124 / 0.5) inset;
}
.btn-accent:hover { box-shadow: 0 12px 30px -8px var(--accent); border-color: transparent; }

.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: oklch(100% 0 0 / 0.04); }

.btn-danger { background: transparent; border-color: oklch(70% 0.20 24 / 0.4); color: var(--danger); }
.btn-danger:hover { background: oklch(70% 0.20 24 / 0.12); border-color: var(--danger); }

.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border-radius: 8px; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.icon-btn:hover { color: var(--accent-2); border-color: var(--faint); background: oklch(100% 0 0 / 0.04); }
.icon-btn svg { width: 17px; height: 17px; }

.btn-list { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================ Tables */
.table-wrap { width: 100%; overflow-x: auto; }
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.tbl thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: oklch(100% 0 0 / 0.02);
}
table.tbl tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
}
table.tbl tbody tr { transition: background .15s var(--ease); }
table.tbl tbody tr:hover { background: oklch(100% 0 0 / 0.03); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl .muted { color: var(--muted); }
table.tbl a { color: var(--info); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: oklch(82% 0.12 226 / 0.4); }
table.tbl a:hover { text-decoration-color: var(--info); }
.cell-actions { display: flex; gap: 8px; justify-content: flex-end; }
.truncate { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { padding: 48px 20px; text-align: center; color: var(--faint); font-family: var(--font-mono); font-size: 13px; }

/* code / key chips */
code, .mono { font-family: var(--font-mono); font-size: 13px; }
.key {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 12.5px;
  padding: 3px 8px; border-radius: 7px;
  background: oklch(100% 0 0 / 0.05); border: 1px solid var(--line);
  color: var(--accent-2);
}

/* badges / pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 99px;
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.pill.ok     { color: var(--ok);     background: oklch(84% 0.17 150 / 0.12); border-color: oklch(84% 0.17 150 / 0.3); }
.pill.off    { color: var(--danger); background: oklch(70% 0.20 24 / 0.12);  border-color: oklch(70% 0.20 24 / 0.3); }
.pill.info   { color: var(--info);   background: oklch(82% 0.12 226 / 0.12); border-color: oklch(82% 0.12 226 / 0.3); }
.pill.mute   { color: var(--faint);  background: oklch(100% 0 0 / 0.04);     border-color: var(--line); }

/* ============================================================ Forms */
.field { margin-bottom: 16px; }
.field label, .form-label {
  display: block;
  font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  margin-bottom: 7px;
}
.hint { display: block; margin-top: 6px; font-size: 12px; color: var(--faint); line-height: 1.4; }

.input, input.input, select.input, textarea.input,
.form-control, .form-select {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--text);
  /* NOTE: use background-color (not the `background` shorthand) anywhere it is
     re-declared, so the <select> chevron background-image is never wiped. */
  background-color: oklch(16.5% 0.012 262);
  border: 1px solid oklch(100% 0 0 / 0.14);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  /* tactile field: top hairline highlight + soft inner shadow (not a flat void) */
  box-shadow: inset 0 1px 0 oklch(100% 0 0 / 0.04), inset 0 2px 5px oklch(0% 0 0 / 0.22);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background-color .18s;
  appearance: none;
  -webkit-appearance: none;
}
textarea.input, textarea.form-control { resize: vertical; min-height: 78px; }
.input::placeholder, .form-control::placeholder { color: var(--faint); }

.input:hover:not(:focus):not(:disabled),
.form-control:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) { border-color: oklch(100% 0 0 / 0.26); }

.input:focus, .form-control:focus, .form-select:focus, select.input:focus, textarea.input:focus {
  outline: none;
  border-color: var(--accent);
  background-color: oklch(17.5% 0.012 262);
  box-shadow: 0 0 0 3px var(--glow), inset 0 1px 0 oklch(100% 0 0 / 0.05);
}
.input:disabled, .form-control:disabled, select.input:disabled {
  opacity: .55; cursor: not-allowed;
  background-color: oklch(20% 0.008 262);
  box-shadow: none;
}
.font-monospace, textarea.font-monospace { font-family: var(--font-mono); font-size: 13px; }

/* Chrome/Safari autofill: keep the dark field instead of the white default */
input.input:-webkit-autofill,
input.input:-webkit-autofill:hover,
input.input:-webkit-autofill:focus,
.form-control:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px oklch(16.5% 0.012 262) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}

select.input, select.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23aeb8c4' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}
select.input option { background: var(--bg-2); color: var(--text); }

/* ---- Custom select (themed dropdown) ----
   dashboard.js wraps each `select.input` in `.sel` and drives a styled menu,
   keeping the native <select> in the DOM as the value source. On touch devices
   enhancement is skipped (native picker is better there). */
.sel { position: relative; }
.sel > select.input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.sel-trigger {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--font-ui); font-size: 14.5px; line-height: 1.35; text-align: left;
  color: var(--text);
  background-color: oklch(16.5% 0.012 262);
  border: 1px solid oklch(100% 0 0 / 0.14);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  box-shadow: inset 0 1px 0 oklch(100% 0 0 / 0.04), inset 0 2px 5px oklch(0% 0 0 / 0.22);
  cursor: pointer;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background-color .18s;
}
.sel-trigger:hover { border-color: oklch(100% 0 0 / 0.26); }
.sel-trigger .chev { flex: none; color: var(--faint); transition: transform .2s var(--ease); }
.sel.open .sel-trigger { border-color: var(--accent); background-color: oklch(17.5% 0.012 262); box-shadow: 0 0 0 3px var(--glow); }
.sel.open .sel-trigger .chev { transform: rotate(180deg); color: var(--accent-2); }
.sel-value.placeholder { color: var(--faint); }

.sel-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 120;
  max-height: 260px; overflow-y: auto;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: none;
  animation: pop .16s var(--ease);
}
.sel.open .sel-menu { display: block; }
.sel-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; border-radius: 8px;
  color: var(--text); font-size: 14px; cursor: pointer;
  transition: background .12s var(--ease);
}
.sel-opt:hover, .sel-opt.active { background: oklch(100% 0 0 / 0.06); }
.sel-opt[aria-selected="true"] { color: var(--accent-2); }
.sel-opt[aria-selected="true"]::after { content: "✓"; margin-left: auto; font-family: var(--font-mono); }
.sel-opt.placeholder { color: var(--faint); }

/* ============================================================ Modal */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: flex-start; justify-content: center;
  padding: clamp(16px, 6vh, 80px) 16px;
  overflow-y: auto;
}
.modal.open { display: flex; }
.modal-backdrop-el {
  position: fixed; inset: 0;
  background: oklch(8% 0.01 260 / 0.6);
  backdrop-filter: blur(6px);
  animation: fade .25s var(--ease);
}
.modal-dialog {
  position: relative;
  width: 100%; max-width: 580px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: pop .3s var(--ease);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.modal-body { padding: 20px 22px; }
.modal-footer { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 14px 22px 20px; }
.modal-close {
  background: transparent; border: none; cursor: pointer; color: var(--faint);
  width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
.modal-close:hover { color: var(--text); background: oklch(100% 0 0 / 0.06); }

/* ============================================================ Toast */
.toast-wrap {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(380px, calc(100vw - 36px));
}
.toast {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 15px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  animation: toastIn .35s var(--ease);
}
.toast.hide { animation: toastOut .3s var(--ease) forwards; }
.toast.success { border-left-color: var(--ok); }
.toast.danger  { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warn); }
.toast.info    { border-left-color: var(--info); }
.toast .tx { flex: 1; }
.toast .tc { background: none; border: none; color: var(--faint); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }
.toast .tc:hover { color: var(--text); }

/* ============================================================ Login */
.auth {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
  animation: pop .5s var(--ease);
}
.auth-brand {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--font-display); font-weight: 800; font-size: 22px;
  letter-spacing: -0.02em; margin-bottom: 4px;
}
.auth-card .eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 28px;
}
.auth-card h1 { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -0.025em; margin: 0 0 22px; }
.alert {
  margin-bottom: 18px; padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: oklch(70% 0.20 24 / 0.12);
  border: 1px solid oklch(70% 0.20 24 / 0.35);
  color: var(--danger); font-size: 13.5px;
}

/* ============================================================ Animations */
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--glow); }
  50% { box-shadow: 0 0 0 6px oklch(89% 0.21 124 / 0); }
}
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ============================================================ Responsive */
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .3s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { opacity: 1; visibility: visible; }
  .main { margin-left: 0; }
  .icon-btn.nav-toggle { display: inline-flex; }
}

@media (max-width: 720px) {
  /* tables collapse to stacked cards */
  table.tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.tbl, table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
  table.tbl tbody tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 6px 4px;
    background: oklch(100% 0 0 / 0.02);
  }
  table.tbl tbody td {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    border-bottom: 1px dashed var(--line);
    padding: 10px 16px;
    text-align: right;
  }
  table.tbl tbody td::before {
    content: attr(data-label);
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--faint);
    text-align: left; flex: none;
  }
  table.tbl tbody td:last-child { border-bottom: none; }
  .truncate { max-width: 60vw; }
  .cell-actions { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .stagger > * { opacity: 1; transform: none; }
}
