/* @trace REQ-MAGICFROG-47 AC01/AC02/AC03/AC04/AC05
 * @trace REQ-UED-1 AC01/AC03/AC04/AC06/AC07 <- PRD-REQ-GRAPECAT-58
 *
 * The admin face's own surface: neutral monochrome skeleton, one accent, hairline rules
 * instead of card stacks, and the product interface itself as the proof. Written
 * mobile-first (390x844 base) with the rail appearing only when there is room for it.
 *
 * REQ-UED-1 contracts kept here:
 * - AC03 six-state matrix on every control (hover/active/focus-visible/disabled/busy);
 * - AC04 tokens only: no raw hex/px radii, colors resolve through style/token/color.css;
 * - AC06 touch floors: 44px destructive + primary sign-in, 40px minimum for the rest;
 * - AC07 state badges stay three-channel (tone + glyph + localized label).
 *
 * Visual/IA upgrade note: the CREEM-style rework is delivered inside the live
 * REQ-UED-1 system. Its own PRD clause is still pending (not yet a contract), so every
 * rule below traces to the existing REQ rather than to an invented identifier.
 */

.admin-root {
  --admin-gutter: var(--space-4);
  --admin-rail: 15rem;
  --admin-topbar: var(--space-16);

  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 48rem) {
  .admin-root {
    --admin-gutter: var(--space-8);
  }
}

.admin-root :focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.admin-skip {
  position: absolute;
  left: var(--space-4);
  top: calc(-1 * var(--space-16));
  z-index: 40;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-rule-strong);
  border-radius: var(--border-radius-md);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  text-decoration: none;
  transition: top var(--motion-fast) var(--ease-standard);
}

.admin-skip:focus-visible {
  top: var(--space-4);
}

/* ---------------------------------------------------------------- sign-in gate */
/* One primary action, mobile-first column. The proof panel comes after the form in DOM
 * and in reading order; on wide screens it sits beside it, never in front of it. */

.admin-gate {
  display: grid;
  gap: var(--space-8);
  align-content: start;
  min-height: 100dvh;
  padding: calc(var(--space-10) + env(safe-area-inset-top)) var(--admin-gutter)
    calc(var(--space-12) + env(safe-area-inset-bottom));
  max-width: var(--measure-page);
  margin-inline: auto;
}

@media (min-width: 64rem) {
  .admin-gate {
    grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-16);
  }

  /* The no-access screen has no companion panel, so it centers instead of hugging
   * an empty second column. */
  .admin-gate[data-testid="admin-forbidden"] {
    grid-template-columns: minmax(0, 26rem);
    justify-content: center;
  }
}

.admin-gate-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  max-width: 26rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.admin-gate-eyebrow {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-2xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-gate-card h1 {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-2xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-wrap: balance;
}

.admin-gate-description {
  margin: 0 0 var(--space-2);
  max-width: var(--measure-prose);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.admin-gate-card label {
  margin-top: var(--space-1);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.admin-gate-card input,
.admin-create input,
.admin-filter select,
.admin-panel-field input,
.admin-panel-field select {
  min-height: var(--space-11);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  font: inherit;
  font-size: var(--font-size-sm);
  transition:
    border-color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard);
}

.admin-gate-card input:hover:not(:disabled),
.admin-create input:hover:not(:disabled),
.admin-panel-field input:hover:not(:disabled) {
  border-color: var(--color-text-muted);
}

.admin-gate-card input:focus-visible,
.admin-create input:focus-visible,
.admin-filter select:focus-visible,
.admin-panel-field input:focus-visible,
.admin-panel-field select:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 1px;
  border-color: var(--color-accent);
}

.admin-gate-card button,
.admin-create button,
.admin-toolbar button,
.admin-confirm-actions button,
.admin-load-more,
.admin-sidebar-footer button,
.admin-cell-actions button {
  min-height: var(--space-10);
  border-radius: var(--border-radius-md);
  font: inherit;
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition:
    background-color var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard);
}

.admin-gate-card button,
.admin-create button,
.admin-toolbar button,
.admin-confirm-actions button,
.admin-load-more,
.admin-sidebar-footer button,
.admin-cell-actions button {
  padding: var(--space-2) var(--space-3-5);
  border: 1px solid var(--color-rule-strong);
  background: var(--color-bg-elevated);
  color: var(--color-text);
}

.admin-gate-card button:hover:not(:disabled),
.admin-create button:hover:not(:disabled),
.admin-toolbar button:hover:not(:disabled),
.admin-confirm-actions button:hover:not(:disabled),
.admin-load-more:hover:not(:disabled),
.admin-sidebar-footer button:hover:not(:disabled),
.admin-cell-actions button:hover:not(:disabled) {
  background: var(--color-bg-surface);
  border-color: var(--color-text-muted);
}

.admin-gate-card button:active:not(:disabled),
.admin-create button:active:not(:disabled),
.admin-toolbar button:active:not(:disabled),
.admin-confirm-actions button:active:not(:disabled),
.admin-load-more:active:not(:disabled),
.admin-sidebar-footer button:active:not(:disabled),
.admin-cell-actions button:active:not(:disabled) {
  background: var(--color-border-muted);
}

.admin-gate-card button:focus-visible,
.admin-create button:focus-visible,
.admin-toolbar button:focus-visible,
.admin-confirm-actions button:focus-visible,
.admin-load-more:focus-visible,
.admin-sidebar-footer button:focus-visible,
.admin-cell-actions button:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.admin-gate-card button:disabled,
.admin-create button:disabled,
.admin-toolbar button:disabled,
.admin-confirm-actions button:disabled,
.admin-load-more:disabled,
.admin-cell-actions button:disabled,
.admin-sidebar-footer button:disabled {
  opacity: 0.55;
  cursor: default;
}

/* The single primary action. One filled surface per screen. */
.admin-gate-card button[type="submit"],
.admin-create button[type="submit"],
.admin-panel-form button[type="submit"] {
  min-height: var(--space-11);
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-primary-text);
  font-weight: 600;
}

.admin-gate-card button[type="submit"]:hover:not(:disabled),
.admin-create button[type="submit"]:hover:not(:disabled),
.admin-panel-form button[type="submit"]:hover:not(:disabled) {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.admin-gate-card button[type="submit"]:active:not(:disabled),
.admin-create button[type="submit"]:active:not(:disabled),
.admin-panel-form button[type="submit"]:active:not(:disabled) {
  background: var(--color-primary-active);
  border-color: var(--color-primary-active);
}

.admin-gate-card button[type="submit"]:focus-visible {
  outline-color: var(--color-focus-ring);
}

/* In-flight: spinner rides the button while aria-busy holds (AC03). */
.admin-root button[aria-busy="true"],
.admin-root button[data-busy="true"] {
  position: relative;
  cursor: progress;
}

.admin-root button[aria-busy="true"]::after,
.admin-root button[data-busy="true"]::after {
  content: "";
  display: inline-block;
  width: var(--space-2-5);
  height: var(--space-2-5);
  margin-left: var(--space-1-5);
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: admin-spin 0.8s linear infinite;
}

@keyframes admin-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Product-interface-as-proof: the real admin surface map, not a decorative mock.
 * Mobile keeps it below the form as a compact block; wide screens put it beside. */
.admin-gate-proof {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  max-width: 26rem;
  padding: var(--space-4);
  border-radius: var(--border-radius-lg);
  background: var(--color-bg-inverse);
  color: var(--color-text-inverse);
}

@media (min-width: 64rem) {
  .admin-gate-proof {
    gap: var(--space-4);
    max-width: var(--measure-proof);
    padding: var(--space-6);
  }
}

.admin-gate-proof-title {
  margin: 0;
  color: var(--color-text-inverse);
  font-size: var(--font-size-2xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-gate-proof ul {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-gate-proof li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2-5) 0;
  border-top: 1px solid currentColor;
  border-color: var(--color-text-inverse-muted);
  color: var(--color-text-inverse);
  font-size: var(--font-size-sm);
}

.admin-gate-proof li span:last-child {
  color: var(--color-text-inverse-muted);
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
}

.admin-gate-proof p {
  margin: 0;
  color: var(--color-text-inverse-muted);
  font-size: var(--font-size-xs);
  line-height: 1.6;
}

.admin-gate-note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: 1.6;
}

.admin-gate-identifier {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.admin-error {
  margin: 0;
  padding: var(--space-2-5) var(--space-3);
  border: 1px solid var(--color-danger);
  border-left-width: 3px;
  border-radius: var(--border-radius-md);
  color: var(--color-danger);
  font-size: var(--font-size-sm);
}

/* ------------------------------------------------------------------ managed shell */
/* Mobile: a sticky top bar with a horizontally scrollable section rail. Wide: a
 * vertical rail beside the content. Nothing is hidden behind a hamburger. */

.admin-shell {
  display: block;
  min-height: 100dvh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  /* Two rows on mobile: identity + sign-out, then the section rail. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-1);
  padding: calc(var(--space-2) + env(safe-area-inset-top)) var(--admin-gutter) var(--space-2);
  border-bottom: 1px solid var(--color-rule);
  background: var(--color-bg);
}

/* Placement only: the visual rules live with each selector below. The rail spans both
 * columns on row 2, and sign-out sits beside the identity on row 1. */
.admin-nav-list {
  grid-column: 1 / -1;
  grid-row: 2;
}

.admin-sidebar-footer {
  grid-column: 2;
  grid-row: 1;
}

.admin-sidebar-brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
}

.admin-sidebar-title {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-sidebar-subtitle {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-2xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-nav-list {
  display: flex;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  list-style: none;
}

.admin-nav-list::-webkit-scrollbar {
  display: none;
}

.admin-nav-link {
  /* REQ-UED-1 AC06: every section entry is a 44px touch target. */
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: var(--space-11);
  padding: 0 var(--space-3);
  border-radius: var(--border-radius-md);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard);
}

.admin-nav-link:hover {
  background: var(--color-bg-surface);
  color: var(--color-text);
}

.admin-nav-link.active,
.admin-nav-link[aria-current="page"] {
  background: var(--color-accent-subtle);
  box-shadow: inset 2px 0 0 var(--color-accent);
  color: var(--color-text);
  font-weight: 600;
}

.admin-sidebar-footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  padding-top: var(--space-1);
}

.admin-sidebar-footer button {
  /* REQ-UED-1 AC06: sign-out is a recurring control; keep the 44px floor. */
  min-height: var(--space-11);
}

.admin-session-identity {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-2xs);
  overflow-wrap: anywhere;
}

/* The mobile top bar has no room for the identifier; it stays in the DOM and returns
 * with the rail at 64rem (the signed-in identity is never lost, only unpainted). */
@media (max-width: 47.999rem) {
  .admin-session-identity {
    display: none;
  }
}

.admin-main {
  min-width: 0;
  padding: var(--space-6) var(--admin-gutter) calc(var(--space-12) + env(safe-area-inset-bottom));
}

@media (min-width: 64rem) {
  .admin-shell {
    display: grid;
    grid-template-columns: var(--admin-rail) minmax(0, 1fr);
    align-items: start;
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    gap: var(--space-1);
    padding: var(--space-6) var(--space-4);
    border-right: 1px solid var(--color-rule);
    border-bottom: 0;
  }

  .admin-sidebar-brand {
    margin-bottom: var(--space-4);
    padding: 0 var(--space-2);
  }

  .admin-nav-list {
    flex-direction: column;
    overflow: visible;
  }

  .admin-nav-link {
    padding: 0 var(--space-2);
  }

  .admin-nav-link.active,
  .admin-nav-link[aria-current="page"] {
    box-shadow: inset 2px 0 0 var(--color-accent);
  }

  .admin-sidebar-footer {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    margin-top: auto;
    margin-left: 0;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-rule);
  }

  .admin-main {
    padding: var(--space-10) var(--space-8);
  }
}

@media (min-width: 80rem) {
  .admin-main {
    padding-inline: var(--space-12);
  }

  .admin-resource {
    max-width: var(--measure-page);
  }
}

/* --------------------------------------------------------------- resource header */

.admin-resource-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-rule);
}

.admin-resource-head h1 {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-wrap: balance;
}

.admin-resource-subtitle {
  margin: var(--space-1) 0 0;
  max-width: var(--measure-prose);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.admin-resource-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.admin-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
}

.admin-create {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2-5);
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-rule);
  border-radius: var(--border-radius-md);
  background: var(--color-bg-sunken);
}

.admin-create label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
}

/* ------------------------------------------------------------------- notice cards */
/* Every non-success state answers two questions in order: what happened, then what to
 * do next. Tone rides a 3px left rule only, so the surface stays monochrome. */

.admin-notice {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0 0 var(--space-4);
  padding: var(--space-3-5) var(--space-4);
  border: 1px solid var(--color-rule);
  border-left: 3px solid var(--color-rule-strong);
  border-radius: var(--border-radius-md);
  background: var(--color-bg-surface);
}

.admin-notice[data-tone="progress"] {
  border-left-color: var(--color-accent);
}

.admin-notice[data-tone="attention"] {
  border-left-color: var(--color-warning);
}

.admin-notice[data-tone="danger"] {
  border-left-color: var(--color-danger);
}

.admin-notice-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 1.4;
}

.admin-notice-body {
  margin: 0;
  max-width: var(--measure-prose);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  line-height: 1.6;
}

.admin-notice-detail {
  margin: var(--space-1) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  overflow-wrap: anywhere;
}

.admin-notice-detail code {
  padding: 0 var(--space-1);
  border-radius: var(--border-radius-sm);
  background: var(--color-bg-elevated);
  font-family: var(--font-mono);
}

/* AC06: first paint never faces a blank panel. */
.admin-loading::before {
  content: "";
  flex: 0 0 auto;
  width: var(--space-3-5);
  height: var(--space-3-5);
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: admin-spin 0.8s linear infinite;
}

/* ------------------------------------------------------------- confirm (modal) */

.admin-confirm {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-warning);
  border-left-width: 3px;
  border-radius: var(--border-radius-lg);
  background: var(--color-bg-elevated);
}

.admin-confirm p {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.admin-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.admin-confirm-actions .admin-danger {
  min-height: var(--space-11);
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: var(--color-danger-text);
}

.admin-confirm-actions .admin-danger:hover:not(:disabled) {
  background: var(--color-danger-hover);
  border-color: var(--color-danger-hover);
}

.admin-confirm-actions .admin-danger:active:not(:disabled) {
  background: var(--color-danger-active);
  border-color: var(--color-danger-active);
}

@media (min-width: 48rem) {
  .admin-confirm {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 50;
    width: min(30rem, calc(100vw - 4rem));
    margin: 0;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 100vmax var(--color-overlay);
  }

  .admin-confirm-actions {
    margin-left: auto;
  }
}

/* ------------------------------------------------------------------ row panels */

.admin-panel-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2-5);
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-rule);
  border-radius: var(--border-radius-md);
  background: var(--color-bg-sunken);
}

.admin-panel-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
}

.admin-panel-field input,
.admin-panel-field select {
  min-width: 9rem;
}

.admin-panel-target {
  align-self: center;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
}

.admin-load-more {
  margin-top: var(--space-4);
}

/* ------------------------------------------------------------------------ table */
/* Wide: a real table with column priorities folding out on tight widths.
 * Narrow: every row becomes a labelled stack, so no cell is pushed off-screen. */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
}

.admin-table th {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-rule-strong);
  color: var(--color-text-muted);
  font-size: var(--font-size-2xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-rule);
  text-align: left;
  vertical-align: top;
}

.admin-table tbody tr:hover {
  background: var(--color-bg-sunken);
}

@media (min-width: 48rem) and (max-width: 71.999rem) {
  .admin-table [data-priority="secondary"] {
    display: none;
  }
}

.admin-cell-id {
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: var(--font-size-2xs);
  overflow-wrap: anywhere;
}

.admin-cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1-5);
}

.admin-cell-actions button {
  min-height: var(--space-10);
  padding: var(--space-1) var(--space-2-5);
  border-color: var(--color-rule-strong);
  background: var(--color-bg-elevated);
  font-size: var(--font-size-2xs);
  white-space: nowrap;
}

.admin-cell-actions .admin-danger {
  /* REQ-UED-1 AC06: destructive row actions keep the 44px floor. */
  min-height: var(--space-11);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.admin-cell-actions .admin-danger:hover:not(:disabled) {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: var(--color-danger-text);
}

.admin-cell-actions .admin-danger:active:not(:disabled) {
  background: var(--color-danger-active);
  border-color: var(--color-danger-active);
  color: var(--color-danger-text);
}

/* AC07: state badges stay three-channel (tone color + glyph + localized label). */
.admin-state {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  padding: var(--space-0-5) var(--space-2);
  border-radius: var(--border-radius-pill);
  font-size: var(--font-size-2xs);
  line-height: 1.4;
  white-space: nowrap;
}

.admin-state svg {
  flex-shrink: 0;
  width: var(--space-3);
  height: var(--space-3);
}

.admin-tone-neutral {
  background: var(--color-bg-surface);
  color: var(--color-text-secondary);
}

.admin-tone-progress {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.admin-tone-attention {
  background: var(--color-warning);
  color: var(--color-warning-text);
}

.admin-tone-occupied {
  background: var(--color-primary-active);
  color: var(--color-primary-text);
}

.admin-tone-success {
  background: var(--color-success);
  color: var(--color-success-text);
}

.admin-tone-danger {
  background: var(--color-danger);
  color: var(--color-danger-text);
}

.admin-cell-egress {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
}

.admin-egress-mode {
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: var(--font-size-2xs);
}

.admin-egress-sep {
  color: var(--color-text-muted);
}

.admin-cell-time {
  white-space: nowrap;
}

.admin-cell-time-utc {
  color: var(--color-text-muted);
  font-size: var(--font-size-2xs);
}

.admin-cell-none-dot {
  inline-size: 4px;
  block-size: 4px;
  border-radius: var(--border-radius-pill);
  background: var(--color-text-weak);
  display: inline-block;
}

.admin-cell-none {
  color: var(--color-text-muted);
}

/* Narrow screens: labelled stacks. */
@media (max-width: 47.999rem) {
  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .admin-table tr {
    padding: var(--space-2) 0 var(--space-3);
    border-bottom: 1px solid var(--color-rule);
  }

  .admin-table td {
    display: grid;
    grid-template-columns: minmax(6rem, 38%) minmax(0, 1fr);
    gap: var(--space-2);
    padding: var(--space-1) 0;
    border-bottom: 0;
  }

  .admin-table td::before {
    content: attr(data-label);
    color: var(--color-text-muted);
    font-size: var(--font-size-2xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .admin-table td.admin-cell-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding-top: var(--space-2);
  }

  .admin-table td.admin-cell-actions::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-loading::before,
  .admin-root button[aria-busy="true"]::after,
  .admin-root button[data-busy="true"]::after {
    animation: none;
  }

  .admin-skip {
    transition: none;
  }
}
