/* ==========================================================================
   Host An App — admin.css
   --------------------------------------------------------------------------
   Operator console (body.admin, .adm-*): command bar, stat cards, panels,
   tree, charts, reports, sheets, login. Requires core.css.
   See AGENTS.md (CSS: modular stylesheets).
   ========================================================================== */
/* ==========================================================================
   Admin operations dashboard (body.admin)
   --------------------------------------------------------------------------
   Operator-only console served by the Go binary under /admin/. Reuses the
   paper theme tokens above; no second stylesheet, no framework.

   Design (operator-console restyle): a dense, tactile machine-room console —
     • a sticky command bar: brand lockup, section pills, poll chip,
       search with ⌘K, session chip, contrast toggle, operator avatar;
     • stat cards with mono eyebrows, tabular metrics, sparklines and meters;
     • attention banners only when something is wrong (left accent rail);
     • a hover-crosshair area chart for the daily trend;
     • the ownership tree IS the navigation (avatars + chevrons + leaves);
     • the moderation queue as severity-railed incident cards;
     • system telemetry with a donut, worker health and a recessed
       machine terminal for the audit stream.
   One type scale, a 4px spacing grid, semantic status colors only.
   body.admin-dark flips the same tokens to the platform dark palette.
   ========================================================================== */

body.admin {
  --adm-card: #ffffff;
  --adm-low: #f5f3ed;
  --adm-cont: #f0eee8;
  --adm-high: #eae8e2;
  --adm-highest: #e4e2dd;

  --adm-font: var(--sans);
  --adm-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  /* The admin palettes own their accent (they inherit the paper palette via
     body.paper, but the token guard resolves each scope in isolation). */
  --orange: #b53a0a;
  --adm-accent: var(--orange);
  /* Ink that sits on a solid status fill (badges, avatars, toast, danger
     buttons). The fills are mid-tone in the light palette, so white clears
     AA on them; the dark palette brightens the fills and flips this ink to
     the near-black panel colour. */
  --adm-on-fill: #fff;
  --adm-accent-ink: #c23a17;
  --adm-ok: #17804f;
  --adm-ok-ink: #17724b;
  --adm-warn: #9a6416;
  --adm-warn-ink: #8a5a12;
  /* Fill-bearing status colours: white ink must clear AA on them, so the
     light palette uses darkened fills (the --adm-*-ink shades are the
     text-safe inks and stay separate). */
  --adm-bad: #a82c38;
  --adm-danger-ink: #a03218;
  --adm-info: #3f61ff;
  --adm-teal: #0e7c86;
  --adm-violet: #7a4fd0;

  --adm-machine: #181817;
  --adm-machine-2: #232321;
  --adm-machine-border: #30302e;
  --adm-machine-fg: #f3f1eb;
  --adm-machine-dim: #a9a7a0;

  --adm-hover: rgba(23, 23, 21, .05);
  --adm-bright: var(--paper-bright);
  --adm-top-h: 56px;
  --adm-radius: 10px;
  --adm-radius-lg: 14px;
  --adm-shadow-card: 0 1px 2px rgba(23, 23, 21, .05);
  --adm-shadow-pop: 0 12px 40px rgba(23, 23, 21, .16);
  --adm-shadow-sheet: 0 -8px 40px rgba(23, 23, 21, .2);
  --adm-ease: cubic-bezier(.32, .72, 0, 1);

  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--adm-font);
  font-size: 14px;
  line-height: 1.5;
}

/* ----- dark palette (same hue families, tuned for low-light triage) ----- */

body.admin.admin-dark {
  --paper: #0e1013;
  --paper-bright: #15181d;
  --ink: #f3f4f6;
  --muted: #98a1ad;
  --line: rgba(255, 255, 255, .1);
  --orange: #ff6b3d;
  --orange-soft: rgba(255, 79, 25, .16);
  --green: #2fe08d;
  --blue: #7d90ff;

  --adm-card: #15181d;
  --adm-low: #191d23;
  --adm-cont: #1d2229;
  --adm-high: #22272f;
  --adm-highest: #272d36;
  --adm-bright: #15181d;
  --adm-accent: #ff6b3d;
  --adm-on-fill: #0e1013;
  --adm-accent-ink: #ff8a63;
  --adm-ok: #2fe08d;
  --adm-ok-ink: #56e7a4;
  --adm-warn: #ffb547;
  --adm-warn-ink: #ffc670;
  --adm-bad: #ff6b7a;
  --adm-danger-ink: #ff8a95;
  --adm-info: #7d90ff;
  --adm-teal: #3ec3cd;
  --adm-violet: #a98bef;
  --adm-hover: rgba(255, 255, 255, .06);
  --adm-shadow-card: 0 1px 2px rgba(0, 0, 0, .4);
  --adm-shadow-pop: 0 12px 40px rgba(0, 0, 0, .55);
  --adm-shadow-sheet: 0 -8px 40px rgba(0, 0, 0, .6);

  background: var(--paper);
  color: var(--ink);
}

body.admin { -webkit-tap-highlight-color: transparent; }
body.admin :focus-visible { outline: 2px solid var(--adm-accent); outline-offset: 2px; border-radius: 4px; }
body.admin [hidden] { display: none !important; }
body.admin svg { flex: none; }

@media (prefers-reduced-motion: reduce) { body.admin * { animation: none !important; transition: none !important; } }

/* dot-paper texture (overrides the shared paper grain) */
body.admin::before {
  opacity: 1;
  background-image: radial-gradient(rgba(23, 23, 21, .05) 1px, transparent 1px);
  background-size: 16px 16px;
  mix-blend-mode: multiply;
}

body.admin.admin-dark::before {
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px);
  mix-blend-mode: screen;
}

/* mono + dim helpers (scoped; the shared .mono is 12px only) */
body.admin .mono { font-family: var(--adm-mono); font-size: 12.5px; letter-spacing: -.01em; }
body.admin .dim { color: var(--muted); }
body.admin .adm-eyebrow {
  font-family: var(--adm-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ----- chart tints (one meaning per color) ----- */

.cc-ok { --cc: var(--adm-ok); }
.cc-amber { --cc: var(--adm-warn); }
.cc-red { --cc: var(--adm-bad); }

.cc-muted { --cc: var(--muted); }

/* ==========================================================================
   Command bar: brand, section pills, tools
   ========================================================================== */

.adm-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--adm-top-h);
  padding: 8px 20px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 8px rgba(23, 23, 21, .05);
  transition: box-shadow .2s ease;
}

.admin-dark .adm-top { box-shadow: 0 1px 8px rgba(0, 0, 0, .5); }

/* Scrolled: the resting hairline cast deepens to a real one (app.js toggles
   the class), in each palette's ink. The paired dark rule outranks the plain
   is-scrolled one so dark mode never inherits the light cast. */
.adm-top.is-scrolled { box-shadow: 0 10px 28px rgba(23, 23, 21, .12); }
.admin-dark .adm-top.is-scrolled { box-shadow: 0 10px 28px rgba(0, 0, 0, .6); }

.adm-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  min-width: 0;
  flex: none;
}

.adm-brand__mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--paper-bright);
  box-shadow: var(--adm-shadow-card);
}

.admin-dark .adm-brand__mark { color: #0e1013; }
.adm-brand__mark svg { width: 16px; height: 16px; }

.adm-brand__lockup { display: flex; align-items: baseline; gap: 6px; min-width: 0; overflow: hidden; }

.adm-brand__name {
  font-family: var(--adm-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-brand__tag {
  font-family: var(--adm-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--adm-high);
  color: var(--muted);
  flex: none;
}

/* ----- search + results dropdown ----- */

/* section pills */
.adm-hdrtabs {
  display: flex;
  gap: 2px;
  flex: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 3px;
  background: var(--adm-low);
  border-radius: 9px;
}

.adm-hdrtabs button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all .12s ease;
}

.adm-hdrtabs button:hover { color: var(--ink); background: var(--adm-hover); }
.adm-hdrtabs button.is-on { background: var(--ink); color: var(--paper-bright); box-shadow: var(--adm-shadow-card); }
.admin-dark .adm-hdrtabs button.is-on { color: #0e1013; }

.adm-top__tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex: none;
}

/* live poll chip */
.adm-poll {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 7px;
  background: var(--adm-low);
  font-family: var(--adm-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--adm-ok-ink);
  white-space: nowrap;
}

.adm-poll__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--adm-ok);
  animation: adm-pulse 2.4s ease infinite;
}

.adm-poll.is-paused { color: var(--muted); }
.adm-poll.is-paused .adm-poll__dot { background: var(--muted); animation: none; }

/* reports badge */
.adm-nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--adm-bad);
  color: var(--adm-on-fill);
  font-family: var(--adm-mono);
  font-size: 10px;
  font-weight: 700;
}

/* primary live dot helpers */
.adm-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--adm-ok); }
.adm-dot.is-bad { background: var(--adm-bad); }
.adm-dot.is-warn { background: var(--adm-warn); }

@keyframes adm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ----- icon + chip buttons ----- */

.adm-iconbtn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.adm-iconbtn svg { width: 16px; height: 16px; }

/* The theme button's moon turns with the console's own dark class. */
#theme-btn svg { transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.admin-dark #theme-btn svg { transform: rotate(180deg); }

.adm-iconbtn:hover { background: var(--adm-hover); color: var(--ink); }

.adm-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--adm-low);
  font-family: var(--adm-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
  white-space: nowrap;
}
.adm-chip:hover { background: var(--adm-high); color: var(--ink); }
.adm-chip svg { width: 14px; height: 14px; }

.adm-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--adm-accent);
  color: var(--adm-on-fill);
}
.adm-avatar svg { width: 16px; height: 16px; }

/* ----- search + results dropdown ----- */

.adm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  background: var(--adm-low);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  transition: border-color .12s ease, background .12s ease;
}

.adm-search:focus-within { border-color: var(--adm-accent); background: var(--adm-card); }
.adm-search > svg { width: 14px; height: 14px; }

.adm-search input {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
}

.adm-search input::placeholder { color: var(--muted); }
/* The search field is the command bar's elastic element: it gives up width
   first so the section pills and the tool cluster never truncate. */
.adm-search--bar { position: relative; flex: 0 1 240px; min-width: 150px; }

.adm-kbd {
  font-family: var(--adm-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--adm-high);
  color: var(--ink);
}

.adm-search__pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 55;
  width: min(360px, 84vw);
  background: var(--adm-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--adm-shadow-pop);
  overflow: hidden;
}

.adm-search__empty { margin: 0; padding: 12px 14px; font-size: 12.5px; color: var(--muted); }

.adm-search__it {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.adm-search__it:last-child { border-bottom: 0; }
.adm-search__it:hover { background: var(--adm-hover); }

.adm-search__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* Header fit is arithmetic, not vibes. Measured widths at the wide layout:
   brand ~230, section pills ~441, tool cluster ~609 (poll 107 + search 234 +
   refresh 31 + session chip 145 + theme 31 + avatar 30 + 30 of gaps), plus
   24 of gaps and 40 of padding — ~1344 total. So:
     >= 1400px  everything fits outright;
     1300-1399  the session chip drops to its icon and the search gives up
                34px, which buys ~145px and keeps one row;
     <= 1299    the pills take a second row before anything gets clipped.
   These must follow the search rules above: the `flex` shorthand there would
   otherwise win on source order regardless of the media query. */
@media (max-width: 1399px) {

  .adm-chip span { display: none; }
  .adm-search--bar { flex-basis: 200px; }
}

@media (max-width: 1299px) {

  .adm-top { flex-wrap: wrap; row-gap: 6px; }
  .adm-brand__tag { display: none; }
  .adm-hdrtabs { order: 3; width: 100%; flex: 1 1 100%; }
}

@media (max-width: 980px) {

  .adm-search--bar { flex-basis: 168px; }
  .adm-kbd { display: none; }
}

/* ==========================================================================
   Content area
   ========================================================================== */

.adm-content { flex: 1; }

.adm-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 56px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* small section heading used by a few views */
.adm-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.adm-section-head__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.04em;
}
.adm-section-head__sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

/* ----- stat cards (the dashboard's at-a-glance row) ----- */

.adm-statstrip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 720px) { .adm-statstrip { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) { .adm-statstrip { grid-template-columns: repeat(5, 1fr); } }

/* Five cards never divide evenly into three columns: let the last one span
   the remainder so the strip reads as a balanced 3 + 2 rather than a row
   with a hole in it. */
@media (min-width: 720px) and (max-width: 979px) { .adm-statstrip > :last-child:nth-child(3n - 1) { grid-column: span 2; } }

.adm-statchip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px 14px;
  background: var(--adm-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--adm-shadow-card);
  transition: box-shadow .15s ease, transform .15s ease;
}

.adm-statchip[role="button"] { cursor: pointer; }
.adm-statchip[role="button"]:hover { box-shadow: 0 6px 20px rgba(23, 23, 21, .1); transform: translateY(-1px); }

.adm-statchip__l {
  font-family: var(--adm-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.adm-statchip__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; min-height: 30px; }

.adm-statchip__v {
  font-family: var(--adm-mono);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

.adm-statchip__spark svg { width: 68px; height: 24px; stroke: var(--cc); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.adm-statchip__spark circle { fill: var(--cc); stroke: none; }

.adm-statchip__d { font-family: var(--adm-mono); font-size: 10.5px; color: var(--muted); }
.adm-statchip--warn .adm-statchip__v { color: var(--adm-warn-ink); }
.adm-statchip--bad .adm-statchip__v { color: var(--adm-danger-ink); }

.adm-meter {
  display: block;
  width: 68px;
  flex: none;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--adm-high);
}
.adm-meter i { display: block; height: 100%; border-radius: 3px; background: var(--adm-ok); }
.adm-meter i.is-warn { background: var(--adm-warn); }
.adm-meter i.is-bad { background: var(--adm-bad); }

/* ----- panels (cards) ----- */

.adm-panel {
  display: flex;
  flex-direction: column;
  background: var(--adm-card);
  border: 1px solid var(--line);
  border-radius: var(--adm-radius-lg);
  box-shadow: var(--adm-shadow-card);
  overflow: hidden;
}

.adm-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  background: var(--adm-low);
  border-bottom: 1px solid var(--line);
}

.adm-panel__id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.adm-panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.adm-panel__title svg { width: 16px; height: 16px; color: var(--muted); }
.adm-panel__sub { margin: 0; font-size: 12px; color: var(--muted); }
.adm-panel__sub b { color: var(--ink); font-variant-numeric: tabular-nums; }
.adm-panel__note { font-family: var(--adm-mono); font-size: 11px; color: var(--muted); }

.adm-panel__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.adm-panel--flush .adm-panel__body,
.adm-panel__body--flush { padding: 0; }

/* two-column grid helper for the dashboard */
.adm-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .adm-grid--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.adm-note { margin: 0; font-size: 12.5px; color: var(--muted); }

/* attention / warning banners */
.adm-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--adm-warn);
  border-radius: var(--adm-radius);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--adm-warn) 10%, transparent), transparent 55%),
    var(--adm-bright);
}

.adm-banner svg {
  box-sizing: content-box;
  width: 18px;
  height: 18px;
  padding: 7px;
  flex: none;
  border-radius: 8px;
  background: var(--adm-high);
  color: var(--adm-warn-ink);
}

.adm-banner__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.adm-banner__tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.adm-banner__tag {
  font-family: var(--adm-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--adm-high);
  color: var(--adm-warn-ink);
}

.adm-banner__code { font-family: var(--adm-mono); font-size: 11px; color: var(--muted); }
.adm-banner__text { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink); }
.adm-banner__text b { font-weight: 650; }

.adm-banner--bad { border-left-color: var(--adm-bad); background: linear-gradient(90deg, color-mix(in srgb, var(--adm-bad) 9%, transparent), transparent 55%), var(--adm-bright); }
.adm-banner--bad svg { color: var(--adm-danger-ink); }
.adm-banner--bad .adm-banner__tag { color: var(--adm-danger-ink); }

.adm-banner__x {
  appearance: none;
  border: 0;
  background: none;
  padding: 4px;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
}
.adm-banner__x:hover { background: var(--adm-hover); color: var(--ink); }
.adm-banner__x svg { width: 15px; height: 15px; padding: 0; background: none; color: inherit; }

/* ==========================================================================
   Components: buttons, inputs, pills, segmented
   ========================================================================== */

.adm-btn {
  /* radius from the shared ramp (--r-sm) */
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm); /* shared ramp */
  background: var(--adm-card);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.adm-btn:hover { border-color: var(--border-active); background: var(--adm-hover); }
.adm-btn:disabled { opacity: .45; cursor: not-allowed; }
.adm-btn svg { width: 14px; height: 14px; }

.adm-btn--sm { min-height: 27px; padding: 0 10px; font-size: 12.5px; }

.adm-btn--primary { background: var(--ink); border-color: var(--ink); color: var(--paper-bright); }
.admin-dark .adm-btn--primary { color: #0e1013; }
.adm-btn--primary:hover { background: var(--ink); border-color: var(--ink); opacity: .88; }

.adm-btn--danger { background: none; border-color: var(--adm-bad); color: var(--adm-danger-ink); }
.adm-btn--danger:hover { background: var(--adm-bad); border-color: var(--adm-bad); color: var(--adm-on-fill); }

/* quiet / mono action button (queue + toolbars) */
.adm-btn--mono {
  font-family: var(--adm-mono);
  font-size: 11.5px;
  font-weight: 500;
}
.adm-btn--ghost { background: none; border-color: transparent; color: var(--muted); }
.adm-btn--ghost:hover { background: var(--adm-hover); border-color: transparent; color: var(--ink); }

.adm-input {
  width: 100%;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}

.adm-input:focus { outline: none; border-color: var(--adm-accent); }
.adm-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }

.adm-fgroup__t {
  font-family: var(--adm-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

/* segmented control (chart range, safety, report status) */
.adm-seg, .adm-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: var(--adm-low);
  border-radius: 9px;
}

.adm-seg button, .adm-tabs button, .adm-seg__btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .12s ease;
}

.adm-seg button:hover, .adm-tabs button:hover, .adm-seg__btn:hover { color: var(--ink); }
.adm-seg button.is-on, .adm-tabs button.is-on, .adm-seg__btn.is-on { background: var(--ink); color: var(--paper-bright); box-shadow: var(--adm-shadow-card); }
.admin-dark .adm-seg button.is-on, .admin-dark .adm-tabs button.is-on, .admin-dark .adm-seg__btn.is-on { color: #0e1013; }
.adm-seg__btn small, .adm-tabs button small {
  font-family: var(--adm-mono);
  font-size: 10.5px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--adm-highest);
  color: var(--muted);
}
.adm-seg__btn.is-on small, .adm-tabs button.is-on small, .adm-seg button.is-on small { background: color-mix(in srgb, var(--paper-bright) 22%, transparent); color: inherit; }
.adm-seg__btn.is-danger { color: var(--adm-bad); }
.adm-seg__btn.is-danger.is-on { background: var(--adm-bad); color: var(--adm-on-fill); }

/* ----- Tenancy view (#420) ----- */

.adm-tenant {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 18px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--adm-card);
  margin-bottom: 8px;
}

.adm-tenant__id {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
}

.adm-tenant__name {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--adm-mono);
  font-size: 12.5px;
}

.adm-tenant__name:hover { text-decoration: underline; }

.adm-tenant__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  color: var(--muted);
  font-size: 12px;
}

.adm-tenant__facts b { color: var(--ink); font-weight: 600; }

.adm-input--sm { min-height: 28px; font-size: 12.5px; width: 190px; }

/* ----- Moderation depth (#421): age, notes, bulk ----- */

.adm-report__age {
  font-family: var(--adm-mono);
  font-size: 10.5px;
  color: var(--adm-warn-ink);
}

.adm-report__age.is-aged {
  font-weight: 700;
  color: var(--adm-danger-ink);
}

.adm-report__pick {
  margin-right: 2px;
}

.adm-report__note {
  margin: 6px 0 0;
  padding: 7px 10px;
  border-left: 2px solid var(--adm-accent);
  background: color-mix(in srgb, var(--adm-accent) 6%, transparent);
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: var(--ink);
}

.adm-bulkbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 13px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--adm-card);
}

.adm-input--note {
  min-height: 28px;
  font-size: 12.5px;
  width: 260px;
  flex: 1 1 200px;
}

/* pills (status) */
.adm-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 19px;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: var(--adm-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  background: var(--adm-hover);
  color: var(--muted);
}

.adm-pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.adm-pill--ok { background: color-mix(in srgb, var(--adm-ok) 12%, transparent); color: var(--adm-ok-ink); }
.adm-pill--warn { background: color-mix(in srgb, var(--adm-warn) 14%, transparent); color: var(--adm-warn-ink); }
.adm-pill--bad { background: color-mix(in srgb, var(--adm-bad) 12%, transparent); color: var(--adm-danger-ink); }
.adm-pill--muted { background: var(--adm-hover); color: var(--muted); }

/* content-type badge */
.adm-type {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--adm-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.adm-flag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--orange-soft);
  color: var(--adm-accent-ink);
  font-family: var(--adm-mono);
  font-size: 10px;
  font-weight: 600;
}

/* grant control (inside an expanded user node) */

/* ==========================================================================
   The tree: users → workspaces → projects → deployments
   ========================================================================== */

.adm-tree { display: flex; flex-direction: column; font-size: 13px; padding: 6px; }

.adm-node {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background .1s ease;
}

.adm-node:hover { background: var(--adm-hover); }

.adm-node__caret { display: inline-flex; color: var(--muted); transition: transform .15s ease; }
.adm-node__caret svg { width: 14px; height: 14px; }
.adm-node.is-open .adm-node__caret { transform: rotate(90deg); color: var(--ink); }

.adm-node__main { display: flex; align-items: baseline; gap: 9px; flex: 1; min-width: 0; flex-wrap: wrap; }
.adm-node__t { font-weight: 650; overflow-wrap: anywhere; }
.adm-node.is-open .adm-node__t { color: var(--ink); }
.adm-node__m { font-family: var(--adm-mono); font-size: 11.5px; color: var(--muted); }
.adm-node__trail { display: inline-flex; align-items: center; gap: 6px; flex: none; }

/* avatar roundel (user roots) */
.adm-avatar-node {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--adm-accent);
  color: var(--adm-on-fill);
  font-family: var(--adm-mono);
  font-size: 10.5px;
  font-weight: 700;
}
.adm-avatar-node--ws { background: var(--adm-teal); }
.adm-avatar-node--machine { background: var(--adm-accent-ink); }
.adm-avatar-node svg { width: 14px; height: 14px; }

.adm-node__kids {
  margin-left: 22px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.adm-node__kids .adm-node { padding: 8px 10px; }
.adm-node__acts { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 10px 12px 22px; }

.adm-tree__group {
  padding: 12px 10px 5px;
  font-family: var(--adm-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.adm-tree__hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 22px;
  font-size: 12.5px;
  color: var(--muted);
}
.adm-tree__hint svg { width: 14px; height: 14px; }

/* deployment leaf row */
.adm-dleaf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 22px;
  border-radius: 8px;
}
.adm-dleaf:hover { background: var(--adm-low); }

.adm-dleaf__slug {
  appearance: none;
  border: 0;
  background: none;
  padding: 2px 4px;
  margin-left: -4px;
  font-family: var(--adm-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  border-radius: 4px;
  cursor: pointer;
}
.adm-dleaf__slug:hover { color: var(--adm-accent-ink); background: var(--adm-hover); }

.adm-dleaf__meta { margin-left: auto; font-family: var(--adm-mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.adm-dleaf__acts { display: inline-flex; gap: 2px; }
.adm-dleaf__acts .adm-iconbtn { width: 26px; height: 26px; }
.adm-dleaf__acts .adm-iconbtn svg { width: 13px; height: 13px; }

/* ==========================================================================
   Charts
   ========================================================================== */

.adm-chart { position: relative; height: 150px; }

.adm-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.adm-chart__grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
.adm-chart__line { stroke: var(--adm-accent); stroke-width: 2.5; fill: none; vector-effect: non-scaling-stroke; }

.adm-chart__x {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
}

.adm-chart__dot {
  position: absolute;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--adm-card);
  opacity: 0;
  pointer-events: none;
}

.adm-chart__tip {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  align-items: baseline;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--paper-bright);
  font-family: var(--adm-mono);
  font-size: 11px;
  white-space: nowrap;
  box-shadow: var(--adm-shadow-pop);
  opacity: 0;
  pointer-events: none;
}

.admin-dark .adm-chart__tip { color: #0e1013; }

.adm-chart:hover .adm-chart__x,
.adm-chart:hover .adm-chart__dot,
.adm-chart:hover .adm-chart__tip { opacity: 1; }

.adm-chart__tip b { font-variant-numeric: tabular-nums; font-weight: 700; }

.adm-axis {
  display: flex;
  justify-content: space-between;
  font-family: var(--adm-mono);
  font-size: 10.5px;
  color: var(--muted);
}

/* grouped daily bars */
.adm-bars { display: flex; align-items: flex-end; gap: 2px; height: 132px; }

.adm-bars__col {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1px;
  height: 100%;
}
.adm-bars__col:hover { opacity: .8; }

.adm-bars__col i { display: block; width: 100%; border-radius: 2px 2px 0 0; }
.adm-bars__col .is-a { background: color-mix(in srgb, var(--cc, var(--muted)) 78%, transparent); }
.adm-bars__col .is-b { background: color-mix(in srgb, var(--cc, var(--muted)) 34%, transparent); }

.adm-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.adm-legend--row { flex-direction: row; flex-wrap: wrap; gap: 14px; }

.adm-legend li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.adm-legend li b { color: var(--ink); font-variant-numeric: tabular-nums; }
.adm-legend li small { font-family: var(--adm-mono); font-size: 10.5px; }

.adm-sw { width: 10px; height: 10px; flex: none; border-radius: 3px; background: var(--cc, var(--muted)); }

/* donut gauge */
.adm-gauge { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.adm-gauge__svg { position: relative; width: 150px; height: 150px; flex: none; }
.adm-gauge__svg svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.adm-gauge__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.adm-gauge__bg { fill: none; stroke: var(--adm-high); stroke-width: 12; }
.adm-gauge__fg { fill: none; stroke: var(--cc, var(--adm-ok)); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset .4s ease; }

.adm-gauge__pct {
  font-family: var(--adm-mono);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--ink);
}
.adm-gauge__cap { font-family: var(--adm-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.adm-gauge__meta { display: flex; flex-direction: column; gap: 7px; min-width: 180px; flex: 1; }
.adm-gauge__row { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.adm-gauge__row:last-child { border-bottom: 0; }
.adm-gauge__row .n { font-family: var(--adm-mono); font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* tiles (cleanup worker) */
.adm-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.adm-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--adm-radius);
  background: var(--adm-low);
}
.adm-tile__v { font-family: var(--adm-mono); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.adm-tile__l { font-family: var(--adm-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.adm-tile--warn { border-color: color-mix(in srgb, var(--adm-warn) 45%, transparent); }
.adm-tile--warn .adm-tile__v { color: var(--adm-warn-ink); }
.adm-tile--bad { border-color: color-mix(in srgb, var(--adm-bad) 45%, transparent); }
.adm-tile--bad .adm-tile__v { color: var(--adm-danger-ink); }

/* health checks (service cards) */
.adm-hchk { display: flex; flex-direction: column; gap: 10px; }
.adm-hchk__it {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--adm-radius);
  transition: box-shadow .15s ease;
}
.adm-hchk__it:hover { box-shadow: 0 4px 14px rgba(23, 23, 21, .07); }
.adm-hchk__ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 8px;
  background: var(--adm-high);
  color: var(--ink);
}
.adm-hchk__ico svg { width: 17px; height: 17px; }
.adm-hchk__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.adm-hchk__it b { font-size: 13px; font-weight: 650; }
.adm-hchk__sub { font-size: 12px; color: var(--muted); }
.adm-hchk__meta { display: flex; gap: 8px; flex-wrap: wrap; font-family: var(--adm-mono); font-size: 10.5px; color: var(--muted); }
.adm-hchk__meta .ok { color: var(--adm-ok-ink); }

.adm-hchk__badge {
  font-family: var(--adm-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--adm-low);
  color: var(--adm-ok-ink);
  white-space: nowrap;
}
.adm-hchk__badge.is-bad { color: var(--adm-danger-ink); }
.adm-hchk__badge.is-warn { color: var(--adm-warn-ink); }

/* machine terminal (audit stream) */
.adm-panel--terminal { background: var(--adm-machine); border-color: var(--adm-machine-border); box-shadow: none; }
.adm-panel--terminal .adm-panel__head {
  background: var(--adm-machine-2);
  border-bottom-color: var(--adm-machine-border);
  color: var(--adm-machine-fg);
}
.adm-panel--terminal .adm-panel__title,
.adm-panel--terminal .adm-panel__sub,
.adm-panel--terminal .adm-panel__note { color: var(--adm-machine-fg); }
.adm-panel--terminal .adm-panel__sub { color: var(--adm-machine-dim); }

.adm-term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--adm-mono);
  font-size: 10.5px;
  color: var(--adm-machine-dim);
}
.adm-term-bar .adm-term-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--adm-accent); }

/* audit timeline (inside terminal) */
.adm-tl { list-style: none; margin: 0; padding: 0; font-family: var(--adm-mono); }

.adm-tl__it {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 16px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--adm-machine-fg);
  border-bottom: 1px solid var(--adm-machine-border);
}
.adm-tl__it:last-child { border-bottom: 0; }
.adm-tl__it:hover { background: var(--adm-machine-2); }

.adm-tl__body { flex: 1; min-width: 0; }
.adm-tl__h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.adm-tl__h time { margin-left: auto; font-size: 11px; color: var(--adm-machine-dim); }
.adm-tl__act { font-weight: 700; letter-spacing: .02em; }
.adm-tl__s { margin-top: 1px; font-size: 11px; color: var(--adm-machine-dim); overflow-wrap: anywhere; }

.adm-tl__dot { width: 8px; height: 8px; flex: none; margin-top: 5px; border-radius: 50%; background: var(--cc, var(--muted)); }
.adm-tl .cc-muted { --cc: var(--adm-machine-dim); }
.adm-tl .cc-red { --cc: #ff6b7a; }
.adm-tl .cc-amber { --cc: #ffb547; }

/* non-terminal timeline (no current producer: the audit list is the only
   .adm-tl, and it always renders inside the terminal panel above) */

/* ==========================================================================
   Reports (moderation queue)
   ========================================================================== */

.adm-reports { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .adm-reports { grid-template-columns: repeat(2, 1fr); } }

.adm-report {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 15px 16px;
  background: var(--adm-card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--adm-radius-lg);
  box-shadow: var(--adm-shadow-card);
  transition: box-shadow .15s ease;
}
.adm-report:hover { box-shadow: 0 6px 20px rgba(23, 23, 21, .08); }

.adm-report.is-open { border-left-color: var(--adm-bad); }

.adm-report__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adm-report__head time { margin-left: auto; font-family: var(--adm-mono); font-size: 10.5px; color: var(--muted); }

.adm-report__sev {
  font-family: var(--adm-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--adm-hover);
  color: var(--muted);
}
.adm-report.is-open .adm-report__sev { background: color-mix(in srgb, var(--adm-bad) 12%, transparent); color: var(--adm-danger-ink); }
.adm-report__id { font-family: var(--adm-mono); font-size: 10.5px; color: var(--muted); }

.adm-report__slug { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -.02em; overflow-wrap: anywhere; }
.adm-report__slug a { color: var(--ink); }
.adm-report__slug a:hover { color: var(--adm-accent-ink); }
.adm-report__slug a svg { width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px; display: inline-block; }
.adm-report__slug .mono { font-size: 15px; }

.adm-report__desc {
  margin: 0;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.adm-report__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-family: var(--adm-mono);
  font-size: 10.5px;
  color: var(--muted);
}
.adm-report__meta span { display: inline-flex; align-items: center; gap: 5px; }
.adm-report__meta svg { width: 13px; height: 13px; }

.adm-report__actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 2px; }

/* ==========================================================================
   Sheets (detail drawers) + confirm modal + toast
   ========================================================================== */

.adm-sheet__bd, .adm-modal__bd { position: fixed; inset: 0; z-index: 59; background: rgba(23, 23, 21, .4); }

.adm-sheet__panel {
  position: fixed;
  z-index: 60;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(480px, 100vw);
  background: var(--adm-card);
  border-left: 1px solid var(--line);
  box-shadow: var(--adm-shadow-sheet);
  transform: translateX(24px);
  opacity: 0;
  transition: transform .22s var(--adm-ease), opacity .18s ease;
}

.adm-sheet.is-open .adm-sheet__panel { transform: none; opacity: 1; }

.adm-sheet__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  background: var(--adm-low);
  border-bottom: 1px solid var(--line);
}

.adm-sheet__title { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }

.adm-sheet__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  overflow-y: auto;
}

.adm-sheet__foot {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--adm-card);
  border-top: 1px solid var(--line);
}

.adm-sheet__foot .adm-btn--danger { margin-right: auto; }

/* <720px: the drawer becomes a bottom sheet */
@media (max-width: 719px) {

  .adm-sheet__panel {
    inset: auto 0 0 0;
    width: 100vw;
    max-height: 88vh;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    transform: translateY(24px);
  }
  .adm-sheet.is-open .adm-sheet__panel { transform: none; }
}

/* key-value grid (detail sheet) */
.adm-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 16px;
  margin: 0;
  font-size: 13px;
}
.adm-kv dt { color: var(--muted); white-space: nowrap; }
.adm-kv dd { margin: 0; overflow-wrap: anywhere; text-align: right; font-family: var(--adm-mono); font-size: 12.5px; }

/* one-time token */
.adm-token {
  padding: 12px;
  border: 1px dashed var(--adm-accent);
  border-radius: var(--adm-radius);
  background: var(--orange-soft);
  font-family: var(--adm-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* centered confirm modal */
.adm-modal__card {
  position: fixed;
  z-index: 70;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(440px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 32px));
  overflow-y: auto;
  padding: 20px;
  background: var(--adm-card);
  border: 1px solid var(--line);
  border-radius: var(--adm-radius-lg);
  box-shadow: var(--adm-shadow-pop);
}

.adm-modal__title { margin: 0; font-size: 16px; font-weight: 700; }
.adm-modal__p { margin: 0; font-size: 13px; color: var(--muted); }
.adm-modal__p strong { color: var(--ink); }
.adm-modal__ul { margin: 0; padding-left: 20px; font-size: 13px; color: var(--muted); }
.adm-modal__acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* toast */
.adm-toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 12px);
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--adm-machine-fg);
  font-family: var(--adm-mono);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--adm-shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.admin-dark .adm-toast { color: #0e1013; }
.adm-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.adm-toast.is-err { background: var(--adm-bad); color: var(--adm-on-fill); }

.adm-empty-line { margin: 0; padding: 16px; font-size: 13px; color: var(--muted); }
.adm-panel--terminal .adm-empty-line { color: var(--adm-machine-dim); }

/* ==========================================================================
   Login
   ========================================================================== */

.adm-login {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--paper);
}

.adm-login__card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(370px, 100%);
  padding: 28px;
  background: var(--adm-card);
  border: 1px solid var(--line);
  border-radius: var(--adm-radius-lg);
  box-shadow: var(--adm-shadow-pop);
}

.adm-login__heading h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.adm-login__heading p { margin: 2px 0 0; font-family: var(--adm-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.adm-login__error { margin: 0; font-size: 12.5px; color: var(--adm-danger-ink); }
.adm-login__hint { margin: 0; font-family: var(--adm-mono); font-size: 11px; color: var(--muted); }

/* ==========================================================================
   Small screens
   ========================================================================== */

@media (max-width: 719px) {

  .adm-top { gap: 8px; padding: 8px 12px; }
  .adm-brand__lockup { display: none; }
  .adm-hdrtabs button { flex: 1; justify-content: center; }
  .adm-poll { display: none; }
  .adm-search--bar { display: none; } /* the tree is the navigation on small screens */
  .adm-page { padding: 14px 12px 44px; gap: 14px; }
  .adm-panel__head, .adm-panel__body { padding: 12px; }
  .adm-statstrip { gap: 8px; }
  .adm-statchip__v { font-size: 20px; }
  .adm-statchip__spark svg { width: 54px; height: 20px; }
  .adm-meter { width: 52px; }
  .adm-node__kids { margin-left: 12px; padding-left: 8px; }
  .adm-dleaf { flex-wrap: wrap; }
  .adm-dleaf__meta { margin-left: 0; flex-basis: 100%; order: 5; }
}

