/*
 * steward.revival.tv — application stylesheet.
 *
 * Layered over the shared revival-ui.css (assets.revival.tv), which owns the
 * brand palette, fonts, the app header, and the base card/form/button shapes.
 * This file owns everything Steward-specific, organised as:
 *
 *   1. Tokens        semantic colour roles, type/space/radius/motion/z scales
 *   2. Base          readability overrides, headings, inputs, tables
 *   3. Utilities     spacing, text, layout helpers (the inline-style killers)
 *   4. Components    buttons, badges, notices, empty states, menus, chips,
 *                    tables, cards, progress, toast
 *   5. Patterns      dashboard, request form, request detail, settings,
 *                    approvals, inventory, drop overlays, print
 *   6. Responsive    phone/tablet rules and the .rtable card-stack
 *
 * The contract is docs/DESIGN-SYSTEM.md. scripts/check-styles.js fails the
 * build on any inline hex / font-size / padding / margin in views/.
 */

/* ═══════════════════════════════════════════════════════════════════════════
   1. TOKENS
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* --ink-3 arrives from the shared sheet as #9999aa (2.6:1 on a card — an AA
     failure for text that carries real labels here). #66667a keeps the same
     grey character at 5.3:1. Local override on purpose: re-toning the shared
     palette is a decision for whoever owns it, not a side effect of a
     Steward accessibility fix. Delete when the shared value is raised. */
  --ink-3: #66667a;

  /* Colour roles ----------------------------------------------------------- */
  --color-primary: var(--accent);
  --color-primary-hover: var(--accent-dk);
  --color-primary-soft: var(--accent-lt);
  --color-primary-soft-hover: #cfe2e9;

  --surface-0: var(--bg);
  --surface-1: var(--bg-card);
  --surface-2: #fff;

  --border-strong: rgba(26, 26, 46, 0.18);
  --hover-tint: rgba(26, 26, 46, 0.025);

  --text-1: var(--ink);
  --text-2: var(--ink-2);
  --text-3: var(--ink-3);
  --text-on-primary: #fff;

  --success: var(--green);
  --success-bg: var(--green-lt);
  --success-border: var(--green);

  --warning: #8a5c00;
  --warning-bg: #fff3e0;
  --warning-border: #f0c987;
  --warning-bg-soft: #fffbeb;

  --pending: var(--note-ink);
  --pending-bg: var(--note-bg);
  --pending-border: var(--note-border);

  --danger: var(--error);
  --danger-bg: var(--error-bg);
  --danger-border: var(--error);
  --danger-hover: #a93226;

  /* The shared button set's neutral fills (revival-ui BUTTONS block), named
     so the rules below speak in roles. Keep in step with revival-ui.css. */
  --btn-hover-bg: #f1ede6;

  --neutral: #5a5a6e;
  --neutral-bg: #eceaf0;
  --neutral-strong: #5f5f5f;
  --neutral-bg-strong: #ededed;

  /* Type scale ------------------------------------------------------------- */
  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 28px;
  --lh-tight: 1.2;
  --lh-base: 1.5;

  /* Spacing (4px grid) ----------------------------------------------------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Radius ----------------------------------------------------------------- */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: var(--radius);
  --r-pill: 999px;

  /* Motion ----------------------------------------------------------------- */
  --dur-fast: 0.12s;
  --dur: 0.15s;
  --ease: ease;

  /* "Needs your action" strip, lifted from facilities.revival.tv's banner
     (Aaron, 2026-09-14) -- a soft tint of --accent rather than a card with
     an accent bar. Measured there: #f0f7fa on 1.5px of the accent at 18%. */

  /* Settings rail (on the dark sidebar, where the page's ink tokens would be
     invisible). Values are design.revival.tv's, so the two rails match. */
  --rail-ink: #c9cdd9;
  --rail-ink-strong: #ffffff;
  --rail-ink-group: #e4e7ef;
  --rail-field-ink: #eef0f5;
  --rail-field-bg: rgba(255, 255, 255, 0.07);
  --rail-field-bg-focus: rgba(255, 255, 255, 0.12);
  --rail-hover-bg: rgba(255, 255, 255, 0.06);
  --rail-active-bg: rgba(255, 255, 255, 0.12);
  --rail-muted: rgba(238, 240, 245, 0.5);
  --rail-caption: rgba(238, 240, 245, 0.45);
  --rail-width: 232px;

  /* Layering: the only z-index values allowed in the app ------------------- */
  /* Within one component, not a page layer: lifts a control above a sibling
     stretched link (the launcher card's drop zone over its title link). */
  --z-raised: 1;
  --z-dropdown: 20;
  --z-sticky: 30;
  --z-drop-hint: 60;
  --z-overlay: 70;
  --z-modal: 100;
  --z-toast: 200;

  /* revival-ui's combo menu reads --z-dropdown above for its layer, and this
     for its widest: a menu on a wide field stops at 420px, and never passes a
     phone's edge (ruthless UI review). */
  --combo-menu-max: min(92vw, 420px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. BASE
   ═══════════════════════════════════════════════════════════════════════════ */
/* 28px above the title, as .page-main gives every other Revival app's pages
   (2026-11-14; Aaron: "margins in admin and backups aren't exactly the same").
   It was --sp-6, 24px. */
main.page {
  padding-top: var(--sp-7);
  padding-bottom: var(--sp-12);
}

/* Headings: four roles. Serif for page/section titles, sans for card/sub. */
.page-title {
  margin: 0 0 var(--sp-2);
  font-family: var(--font-serif);
  font-size: var(--fs-3xl);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-1);
}
.section-title {
  margin: var(--sp-8) 0 var(--sp-2);
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 500;
  line-height: var(--lh-tight);
  color: var(--text-1);
}
.section-title:first-child {
  margin-top: 0;
}
.sub-title {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-1);
}
.eyebrow {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  line-height: var(--lh-tight);
}
.stat-num {
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
/* Inline secondary text. Its own name, not revival-ui's .muted: the shared
   class carries a confirmation page's block margins (18px 0 24px), which
   landed on every one of these until this sheet undid them (2026-11-01,
   handbook ui.md "A page's own classes never reuse a revival-ui name"). */
.text-muted {
  color: var(--text-2);
  font-size: inherit;
  margin: 0;
}
p.text-muted {
  font-size: var(--fs-sm);
}
/* A plain text link is revival-ui's (`:where(a)` — the accent's text colour,
   underlined, darker on hover; 2026-11-09). This sheet sets no base `a` rule. */
/* A bare <code> only: revival-ui's .rui-code (the Backups page's file names, the
   error page's reference, the usage report's paths) keeps revival-ui's own look, as
   it has in every other app (2026-11-21, Aaron: the Backups page differed here).
   :where() keeps the old weight (0,0,1), so revival-ui's .rui-prose code still wins
   in Help articles (review, 2026-11-21). */
code:where(:not(.rui-code)) {
  font-size: 0.92em;
  background: var(--neutral-bg);
  padding: 1px 5px;
  border-radius: var(--r-sm);
}

/* Inputs: the look comes from revival-ui.css, whose base covers every
   text-like type (text, email, tel, date, number, select, textarea, and at
   zero weight password, url, search, time, datetime-local, month, week), its
   focus ring and its disabled look (2026-09-29). This sheet used to restate
   all of it with one catch-all over every input — at a weight (five :not()s)
   that also beat its own focus border, disabled grey and error red. Every
   <input> therefore names its type: an input with none matches no shared rule.
   What stays here is only what revival-ui has no rule for. */
/* A field's error message. Its own name, not revival-ui's .error-text (which
   stays hidden until .field.has-error): Steward renders the message
   server-side, so it shows whenever it has text (views hide the empty ones
   with .hidden or an inline display:none the scripts toggle). */
.field-error {
  display: block;
  color: var(--danger);
  font-size: var(--fs-xs);
  margin: var(--sp-1) 0 0;
}
.field-error:empty {
  display: none;
}
/* In-table and inline editing size: revival-ui's .rui-input-sm. */
.w-xs {
  width: 80px !important;
}
.w-sm {
  width: 110px !important;
}
.w-md {
  width: 160px !important;
}
.w-lg {
  width: 240px !important;
}
.w-auto {
  width: auto !important;
}
/* Hide native number-input spinners (Qty, Unit Price, amounts). */
input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Long-content guards: a pasted URL or a 60-char supplier with no spaces must
   not force a table wider than the phone it is on. overflow-wrap only fires
   when a value would otherwise overflow. A combo menu's rows carry the same
   guard in revival-ui (.combo-opt, 2026-11-02). */
td,
.menu-item {
  overflow-wrap: anywhere;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. UTILITIES  (the inline-style replacements; keep this list short)
   ═══════════════════════════════════════════════════════════════════════════ */
.m-0 {
  margin: 0 !important;
}
.mt-0 {
  margin-top: 0 !important;
}
.mb-0 {
  margin-bottom: 0 !important;
}
.p-0 {
  padding: 0 !important;
}
.mt-1 {
  margin-top: var(--sp-1) !important;
}
.mt-2 {
  margin-top: var(--sp-2) !important;
}
.mt-3 {
  margin-top: var(--sp-3) !important;
}
.mt-4 {
  margin-top: var(--sp-4) !important;
}
.mt-5 {
  margin-top: var(--sp-5) !important;
}
.mt-6 {
  margin-top: var(--sp-6) !important;
}
.mt-8 {
  margin-top: var(--sp-8) !important;
}
.mb-1 {
  margin-bottom: var(--sp-1) !important;
}
.mb-2 {
  margin-bottom: var(--sp-2) !important;
}
.mb-3 {
  margin-bottom: var(--sp-3) !important;
}
.mb-4 {
  margin-bottom: var(--sp-4) !important;
}
.mb-5 {
  margin-bottom: var(--sp-5) !important;
}
.mb-6 {
  margin-bottom: var(--sp-6) !important;
}
.ml-auto {
  margin-left: auto !important;
}
/* Vertical rhythm between direct children. */
.stack-2 > * + * {
  margin-top: var(--sp-2);
}
.stack-3 > * + * {
  margin-top: var(--sp-3);
}
.stack-4 > * + * {
  margin-top: var(--sp-4);
}
.stack-6 > * + * {
  margin-top: var(--sp-6);
}

.text-2xs {
  font-size: var(--fs-2xs) !important;
}
.text-xs {
  font-size: var(--fs-xs) !important;
}
.text-sm {
  font-size: var(--fs-sm) !important;
}
.text-base {
  font-size: var(--fs-base) !important;
}
.text-md {
  font-size: var(--fs-md) !important;
}
.text-lg {
  font-size: var(--fs-lg) !important;
}
.text-xl {
  font-size: var(--fs-xl) !important;
}
.text-2 {
  color: var(--text-2) !important;
}
.text-3 {
  color: var(--text-3) !important;
}
.text-primary {
  color: var(--color-primary) !important;
}
.text-success {
  color: var(--success) !important;
}
.text-warning {
  color: var(--warning) !important;
}
.text-danger {
  color: var(--danger) !important;
}
.text-right {
  text-align: right !important;
}
.text-center {
  text-align: center !important;
}
.text-left {
  text-align: left !important;
}
.fw-500 {
  font-weight: 500 !important;
}
.fw-600 {
  font-weight: 600 !important;
}
.fw-700 {
  font-weight: 700 !important;
}
.serif {
  font-family: var(--font-serif) !important;
}
.nowrap {
  white-space: nowrap !important;
}
.break-all {
  word-break: break-all;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}
.block {
  display: block;
}
.inline {
  display: inline;
}
.inline-block {
  display: inline-block;
}
.flex {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.flex-start {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.flex-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
}
.flex-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1 1 auto;
  min-width: 0;
}
.shrink-0 {
  flex: 0 0 auto;
}
.gap-1 {
  gap: var(--sp-1) !important;
}
.gap-2 {
  gap: var(--sp-2) !important;
}
.gap-3 {
  gap: var(--sp-3) !important;
}
.gap-4 {
  gap: var(--sp-4) !important;
}
.gap-6 {
  gap: var(--sp-6) !important;
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-4);
}
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-3);
}
.span-all {
  grid-column: 1 / -1;
}
.w-full {
  width: 100%;
}
.relative {
  position: relative;
}
.max-w-prose {
  max-width: 640px;
}
.max-w-wide {
  max-width: 760px;
}
.overflow-x {
  overflow-x: auto;
}
.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--sp-4) 0;
}
.border-top {
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Buttons ─────────────────────────────────────────────────────────────
   ONE button set, and it lives in revival-ui.css (2026-09-26 — Aaron approved
   the mockup): four kinds (primary · secondary · quiet · danger), three sizes
   (regular 40px · small 32px · large 48px), one 8px corner, 44px on a touch
   screen. Steward used to fork the whole family here, and because this sheet
   loads after revival-ui the fork won everywhere, so Steward's buttons looked
   different from every other Revival app's.

   So the family is NOT restated here. .btn-pill, --filled (primary), --accent
   (the pale "yours" tint), --danger (red-text secondary) and .btn-sm are
   aliases in revival-ui and take its rules untouched. What stays is only what
   revival-ui has no name for — each written to the same spec, never a new
   shape. Don't add a size, radius or weight here: that is how the eleven
   versions happened. */
/* Danger — the solid red kind. Only inside an "are you sure?" step: the
   armed second press of a two-step delete, or --danger-solid in a confirm. */
.btn-pill--danger.is-armed,
.btn-pill--danger-solid {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}
.btn-pill--danger.is-armed:hover,
.btn-pill--danger-solid:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
  color: #fff;
}
/* Approve — the one solid green, primary-shaped. Reject stays --danger so it
   shares the Remove/Withdraw look: red = something goes away. */
.btn-pill--approve {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.btn-pill--approve:hover {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  filter: brightness(0.9);
}
/* Large — a form's submit, full width. */
.btn-pill--lg {
  display: flex;
  width: 100%;
  min-height: 48px;
  padding: 8px 22px;
  font-size: 15px;
}
.btn-pill.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-pill.is-loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--text-3) transparent var(--text-3) transparent;
  animation: btn-spin 0.8s linear infinite;
}
.btn-pill--filled.is-loading::after,
.btn-pill--approve.is-loading::after,
.btn-pill--danger-solid.is-loading::after {
  border-color: #fff transparent #fff transparent;
}
@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}
/* Square icon actions (approvals inbox, row actions): the small secondary
   button with an icon in it — 32px, 8px corner, the same outline and hover.
   Each action keeps a colour hint on its ICON only, never a shape or a fill
   of its own. 44px on a touch screen, where a mis-tap rejects a request. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid rgba(26, 26, 46, 0.22);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  margin-left: var(--sp-1);
  text-decoration: none;
  transition:
    background-color 0.12s,
    border-color 0.12s;
}
.icon-btn:first-child {
  margin-left: 0;
}
.icon-btn svg {
  width: 16px;
  height: 16px;
}
.icon-btn:hover {
  background: var(--btn-hover-bg);
  border-color: rgba(26, 26, 46, 0.4);
}
.icon-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.icon-btn--view {
  color: var(--accent);
}
.icon-btn--approve {
  color: var(--success);
}
.icon-btn--reject {
  color: var(--error);
}
.icon-btn--sendback {
  color: var(--warning);
}
.icon-btn--edit {
  color: var(--text-2);
}
.icon-btn--delete {
  color: var(--error);
}
/* Icon actions inside a form cell (the delete button) shouldn't pick up the
   generic button font/padding. */
.tbl-actions form.inline {
  display: inline-flex;
  vertical-align: middle;
}
/* Touch screens: every button here reaches a fingertip (revival-ui does the
   aliased ones). */
@media (pointer: coarse) {
  .icon-btn {
    width: 44px;
    height: 44px;
    margin-left: var(--sp-2);
  }
  .icon-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* Inline SVG icons (partials/icon.ejs). */
.icon {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  flex: 0 0 auto;
}

/* ── Badges (status) ─────────────────────────────────────────────────────
   badgeClass() is the only source of these class names. Five families:
   neutral, pending, warning, success, danger, info. */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
/* A qualifier under the headline status: same colour family, quieter. */
.badge--sub {
  font-size: var(--fs-2xs);
  padding: 1px 8px;
  border-color: transparent !important;
  font-weight: 500;
}
.badge--draft,
.badge--not-received,
.badge--not-billed {
  background: var(--neutral-bg);
  color: var(--neutral);
  border-color: var(--border);
}
.badge--cancelled {
  background: var(--neutral-bg-strong);
  color: var(--neutral-strong);
  border-color: var(--border);
}
.badge--pending,
.badge--pending-approval,
.badge--partially-received {
  background: var(--pending-bg);
  color: var(--pending);
  border-color: var(--pending-border);
}
.badge--awaiting-payment,
.badge--sent-back,
.badge--prepaid,
.badge--low-stock {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-border);
}
.badge--approved,
.badge--fully-received,
.badge--paid {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}
.badge--denied {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}
.badge--fulfilled,
.badge--info {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.badge--accent {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.nav-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 2px;
  background: var(--danger);
  color: var(--text-on-primary);
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* ── Coverage chips (one per backup approver on Settings → Approvers) ──── */
.cov-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
  background: var(--color-primary-soft);
  color: var(--text-1);
}
.cov-chip {
  margin: 2px 4px 2px 0;
}
/* ── Notices (one banner, four tones) ────────────────────────────────────
   Steward's own name for revival-ui's .rui-alert, kept because it has two
   amber tones (pending and warning) where the shared one has one. The shared
   .flash / .form-banner / .note come from revival-ui as they are. */
.notice {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--text-1);
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
  margin: 0 0 var(--sp-4);
}
.notice strong {
  font-weight: 700;
}
.notice--success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}
.notice--warn {
  background: var(--pending-bg);
  border-color: var(--pending-border);
  color: var(--pending);
}
.notice--amber {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}
.notice--danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}
.notice--info {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: var(--text-1);
}
.notice--inline {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-xs);
  margin: var(--sp-2) 0 0;
}
.notice a {
  color: inherit;
  font-weight: 600;
}
/* Callout cards: a card with a 4px stripe, for dashboard notices. */
.callout,
.card--callout {
  margin-bottom: var(--sp-4);
  border-left: 4px solid var(--color-primary);
}
.callout--warn,
.card--callout-warn {
  border-left-color: var(--warning);
}
.card--callout-danger {
  border-left-color: var(--danger);
  background: var(--danger-bg);
}
.card--callout-success {
  border-left-color: var(--success);
}

/* ── Empty states ────────────────────────────────────────────────────────
   Empty states are revival-ui's .rui-empty, rendered by
   revival-ui's empty-state template (2026-09-27), included from the
   @revival-apps/server package; Steward keeps no copy of its own. (The quick view's "Loading…" line is revival-ui's .rui-drawer-loading
   since 2026-10-06.) */

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card--tight {
  padding: var(--sp-4);
}
.card--flush {
  padding: 0;
  overflow: hidden;
}
.card--flush > .tbl-wrap,
.card--flush > table {
  border-radius: var(--r-lg);
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.page-head .page-title {
  margin-bottom: 0;
}
.page-head-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.tbl-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
}
.tbl th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  background: var(--color-primary-soft);
  color: var(--text-1);
  white-space: nowrap;
}
.tbl th.eyebrow-th {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  background: transparent;
  border-bottom: 1px solid var(--border);
}
.tbl td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
.tbl tbody tr:hover > td {
  background: var(--hover-tint);
}
.tbl--dense th,
.tbl--dense td {
  padding: 8px 12px;
}
.tbl--compact {
  font-size: var(--fs-sm);
}
.tbl--compact th,
.tbl--compact td {
  padding: 6px 8px;
}
.tbl--plain th {
  background: transparent;
  border-bottom: 2px solid var(--border);
}
.tbl .num,
.tbl th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* Money never breaks mid-figure ("$21.5 / 6" -- Aaron, 2026-09-05). */
.tbl td.num {
  white-space: nowrap;
}
.li-name-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border-strong, currentColor);
  text-underline-offset: 3px;
}
.li-name-link:hover {
  color: var(--color-primary);
}
.tbl-total td {
  font-weight: 700;
  border-top: 2px solid var(--border-strong);
  background: var(--surface-0);
}
.tbl tr.is-muted td {
  opacity: 0.7;
}
.tbl tr.is-selected td {
  background: var(--color-primary-soft);
}
/* The Action column: header centred over the icon buttons, which centre in
   their cell too (Aaron, 2026-09-13 -- a right-aligned header over centred
   icons read as a stray word). Never sortable: no data-sort on it. */
th.tbl-actions {
  text-align: center;
}
td.tbl-actions {
  text-align: center;
}
td.tbl-actions > * {
  vertical-align: middle;
}
/* "What is this?" cell on the request lists (Aaron, 2026-09-12, from
   Precoro's Other Details column): event/project, then payment · payable. */
.tbl-details {
  max-width: 260px;
}
.tbl-actions {
  white-space: nowrap;
}
/* Fixed action slots, so a row's first button sits in the same place on
   every row even when rows carry different actions (the Purchasing queue,
   2026-09-27). Centred in the cell as one block; an empty slot holds a
   hidden placeholder the size of a real button. */
.tbl-action-slots {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  vertical-align: middle;
}
.tbl-action-slots > * + * {
  margin-left: 0;
}
.tbl-action-slots .icon-btn {
  margin-left: 0;
}
.icon-btn--placeholder {
  visibility: hidden;
}
.tbl-actions > * + * {
  margin-left: var(--sp-1);
}

/* ── Menus (typeahead / dropdown) ────────────────────────────────────────── */
/* Steward's own dropdown menu (.menu). The type-to-search combos are NOT
   styled here: .combo-menu / .combo-opt / .combo-opt.active / .combo-sub /
   .combo-empty are revival-ui's ("Type-to-search combos"). Steward used to
   style them itself, as members of this family, and under a second class
   name (.combo-list) the shared rules never reached -- so the GL, supplier
   and ministry pickers looked like Steward's menus rather than the combos
   in every other app (stage 1 of the shared-CSS migration, 2026-09-27). */
.menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
  margin-top: var(--sp-1);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  max-height: 240px;
  max-width: min(92vw, 420px);
  overflow: auto;
  box-shadow: var(--shadow-md);
}
.menu.open,
.menu[data-open='true'] {
  display: block;
}
.menu-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-1);
}
.menu-item:hover,
.menu-item.active {
  background: var(--color-primary-soft);
}
.menu-sub {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.menu-empty {
  padding: 8px 12px;
  color: var(--text-3);
  font-size: var(--fs-sm);
  cursor: default;
}

/* The combo menu is revival-ui's, layer and width included (2026-11-02): its
   layer is --z-dropdown and its ceiling --combo-menu-max, both set in :root.
   A line item's GL cell is narrow; its menu needs room for "52900 --
   Children's Ministry" on one line, so the cell (Steward's role class) asks
   for a wider one. */
.li-gl-combo {
  --combo-menu-min: 260px;
}

/* ── Progress (indeterminate) ────────────────────────────────────────────── */
.progress,
.upload-bar,
.scan-progress-bar {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--color-primary-soft);
  overflow: hidden;
}
.upload-bar {
  display: none;
  margin-top: var(--sp-3);
}
.upload-bar.show {
  display: block;
}
.progress::after,
.upload-bar.show::after,
.scan-progress-bar i {
  content: '';
  display: block;
  height: 100%;
  width: 40%;
  border-radius: var(--r-pill);
  background: var(--color-primary);
  animation: progress-sweep 1.1s ease-in-out infinite;
}
@keyframes progress-sweep {
  0% {
    margin-left: -40%;
  }
  100% {
    margin-left: 100%;
  }
}
.scan-progress {
  margin-top: var(--sp-2);
  width: 100%;
}
.upload-status,
.scan-progress-msg {
  margin: var(--sp-1) 0 0;
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.upload-status {
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
}

/* ── Drawer ──────────────────────────────────────────────────────────────
   The slide-out quick view is revival-ui's .rui-drawer + drawer.js since
   2026-10-06 (Aaron: "so if we make changes it is reflected everywhere"). */

/* ── Toast ───────────────────────────────────────────────────────────────── */
/* The .save-toast rules WERE HERE. The "Changes saved" pop-up is revival-ui's
   .rui-toast .rui-toast--auto since 25 Sep 2026 — one toast across every app,
   still CSS-only (no script), still hidden without motion under reduced motion.
   Its stacking stays this app's, from the z tokens. */
.rui-toast {
  z-index: var(--z-toast);
}

/* ── Details/disclosure ─────────────────────────────────────────────────── */
/* A card that folds open: <details class="card card-fold">. The role class
   carries the summary's look, so this sheet never restyles revival-ui's
   .card itself. */
details.card-fold > summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
details.card-fold > summary::-webkit-details-marker {
  display: none;
}
details.card-fold > summary::before {
  content: '▸';
  display: inline-block;
  width: 1em;
  color: var(--text-3);
  transition: transform var(--dur-fast);
}
details.card-fold[open] > summary::before {
  transform: rotate(90deg);
}
details.card-fold > summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. PATTERNS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Dashboard (home) ────────────────────────────────────────────────────── */
.greet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
.greet-id {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.greet-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.greet-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-3xl);
  font-weight: 500;
  line-height: 1.15;
}
.greet-sub {
  margin: 2px 0 0;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.launcher-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 14px 16px;
  box-shadow: none;
  margin: 0;
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}
.launcher-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.launcher-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.launcher-card .icon {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
}
.launcher-card-title {
  font-weight: 700;
  color: var(--text-1);
  margin-top: 6px;
}
.launcher-card-desc {
  font-size: var(--fs-xs);
  color: var(--text-2);
  margin-top: 2px;
}
/* My Requests widget: the shared component (revival-ui "The count-tile
   widget -- steward's My Requests card, shared"). Steward used to carry its
   own full copy of every rule, which is how the two drifted: the same widget
   under two sets of variable names, each able to override the other (stage 1
   of the shared-CSS migration, 2026-09-27).

   What stays here is only what the shared sheet doesn't carry yet -- each an
   upstream candidate, not a restyle: */
.requests-widget-head {
  /* The Scheduled card's heading row; not part of the shared widget. */
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.home-tile {
  /* A fixed box, so nothing inside can change one tile's height (Aaron's
     tile-height fixes, 2026-09-13). Steward's role class on revival-ui's
     .requests-tile (class="requests-tile home-tile"). */
  min-height: 68px;
}
.requests-tile-num.is-warning {
  /* Amber, the colour Awaiting Payment wears as a status badge on /requests.
     The shared sheet has --orange here, which would stop the tile matching
     its badge. */
  color: var(--warning);
}
.draft-callout__open {
  color: var(--color-primary);
  font-weight: 600;
  white-space: nowrap;
  font-size: var(--fs-sm);
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--color-primary);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  text-decoration: none;
  transition: background var(--dur-fast);
}
.draft-callout__open:hover {
  background: var(--color-primary-soft);
}

/* Unfinished-draft callout: pale primary fill, amber once stale. */
.draft-callout {
  background: var(--color-primary-soft);
  border: 1px solid var(--color-primary);
  padding: var(--sp-4) 18px;
  margin-bottom: var(--sp-4);
}
.draft-callout.is-stale {
  background: var(--warning-bg-soft);
  border-color: var(--warning-border);
}
.draft-callout__head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-1);
}
.draft-callout__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) 0 0;
}
.draft-callout__row + .draft-callout__row {
  margin-top: var(--sp-2);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.draft-callout__title {
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.draft-callout__age {
  font-size: var(--fs-2xs);
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9px;
  background: var(--neutral-bg);
  color: var(--text-3);
  white-space: nowrap;
}
.draft-callout__age.is-stale {
  background: var(--warning-bg);
  color: var(--warning);
}
.draft-callout__delete {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--surface-2);
}
.draft-callout__delete:hover {
  background: var(--danger-bg);
}

/* ── Request form (new-request.ejs) ─────────────────────────────────────── */
.li-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.1fr 58px 90px 78px 150px 30px;
  gap: 6px;
  align-items: center;
}
.li-row {
  margin-bottom: 6px;
}
.li-head {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: var(--sp-1);
}
.li-head > div {
  padding: 0 2px;
}
.li-cell {
  min-width: 0;
}
.po-only-notax {
  display: none;
}
/* Petty Cash: no Product link column (Kristen, 2026-09-10). */
#lineItemsSection.no-url .li-grid {
  grid-template-columns: 1.3fr 1fr 58px 90px 78px 150px 30px;
}
#lineItemsSection.no-url .li-head > div:nth-child(3),
#lineItemsSection.no-url .li-cell[data-label='Product link'] {
  display: none;
}
/* Chosen-but-not-yet-uploaded files on the request form. */
.chosen-files {
  list-style: none;
  padding: 0;
  margin: var(--sp-2) 0 0;
}
.chosen-files li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--border);
}
.chosen-files li:first-child {
  border-top: 0;
}
.chosen-files img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.chosen-state {
  font-size: var(--fs-xs);
  color: var(--text-3);
  white-space: nowrap;
}
.chosen-state.is-error,
.chosen-files li.is-error .chosen-name {
  color: var(--danger);
}
.chosen-files li.is-busy {
  opacity: 0.55;
}
.chosen-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: var(--fs-sm);
}
#lineItemsSection.po-mode .li-grid {
  grid-template-columns: 1.3fr 1fr 1.1fr 58px 90px 78px 56px 150px 30px;
}
#lineItemsSection.po-mode .po-only-notax {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-2xs);
  color: var(--text-3);
  white-space: nowrap;
}
.li-undo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--color-primary-soft);
  font-size: var(--fs-sm);
}
/* Choice pills (request type, priority, category): a .btn-pill wrapping a
   hidden radio. Selected = --filled. */
.type-pill-group,
.pill-group {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
/* Repeating row editors (funding, expenses, equipment, deposits, quotes). */
.row-editor {
  display: grid;
  gap: var(--sp-2);
  align-items: end;
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--border);
}
.row-editor:first-of-type {
  border-top: 0;
}
.quote-slot {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  background: var(--surface-1);
  transition:
    background var(--dur-fast),
    border-color var(--dur-fast);
}
body.is-file-dragging .quote-slot {
  border-color: var(--color-primary) !important;
  border-style: dashed !important;
}
.quote-slot.is-drop-over {
  background: var(--color-primary-soft);
}
.quote-drop-status {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-xs);
}
#dropResult {
  padding: var(--sp-3) 14px;
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-base);
}
#dropResult[data-tone='ok'] {
  background: var(--color-primary-soft);
  border: 1px solid var(--color-primary);
  color: var(--text-1);
}
#dropResult[data-tone='warn'] {
  background: var(--pending-bg);
  border: 1px solid var(--pending-border);
  color: var(--pending);
}

/* ── Whole-page document drop ───────────────────────────────────────────── */
body.is-file-dragging::after {
  content: attr(data-drop-hint);
  position: fixed;
  inset: 12px;
  z-index: var(--z-drop-hint);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--color-primary);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  color: var(--color-primary);
  font-size: var(--fs-lg);
  font-weight: 600;
  pointer-events: none;
}
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 26, 0.45);
  padding: var(--sp-5);
}
.drop-overlay[hidden] {
  display: none;
}
.drop-overlay-card {
  background: var(--surface-2);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.drop-overlay-card h3 {
  margin: 0 0 6px;
  font-size: var(--fs-lg);
}
.drop-overlay-card .drop-file {
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-sm);
  word-break: break-all;
}
.drop-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.drop-overlay-card .drop-status {
  margin: var(--sp-3) 0 0;
  font-size: var(--fs-sm);
  min-height: 1em;
}
/* A launcher card with its own drop zone (views/home.ejs, 2026-09-26).
   The card is a <div>, not a link -- a form inside an <a> is invalid and a
   tap would belong to both -- so the title is a stretched link whose ::after
   covers the card, and the zone sits above that as its own target. Column
   flex with the zone pushed to the bottom keeps zones level across a row
   whatever the description's length. */
.launcher-card.has-drop {
  position: relative;
  display: flex;
  flex-direction: column;
}
.launcher-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.launcher-card-link .launcher-card-title {
  display: block;
}
.launcher-card-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.launcher-card-link:focus-visible {
  outline: none;
}
.launcher-card-link:focus-visible::after {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
/* The box itself is the shared .rui-dropzone (revival-ui, 2026-09-27); these
   rules only seat it in the launcher card. */
.launcher-drop {
  position: relative; /* above the stretched link, so a tap here scans */
  z-index: var(--z-raised);
  margin: 0;
  /* The label is what opens the picker, so it carries the padding: the whole
     box is the tap target, with no dead band round the edge. */
  padding: 0;
}
.launcher-card.has-drop .launcher-card-desc {
  margin-bottom: var(--sp-3);
}
.launcher-card-desc + .launcher-drop {
  margin-top: auto;
}
.launcher-drop + .launcher-drop {
  margin-top: var(--sp-2);
}
.launcher-drop label {
  display: block;
  align-self: stretch; /* the whole box is the tap target */
  padding: 14px 16px;
  cursor: pointer;
  /* The shared form-label style is uppercase and tracked, which made every
     zone shout. These read as a hint, like design.revival.tv's tool cards;
     size and colour come from the zone. */
  margin: 0;
  font-size: inherit;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
}
.launcher-drop input[type='file']:focus-visible + label {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--r-md);
}
.launcher-drop-types {
  white-space: nowrap;
}
/* "Drop a receipt here" on a mouse, "Tap to scan" on a phone: the shared
   .rui-dropzone-hint / .rui-dropzone-coarse pair does the swap. */
body.is-file-dragging .launcher-card.has-drop .launcher-drop {
  border-color: var(--color-primary);
}
.launcher-card.is-drop-over,
.launcher-card.is-drop-over .launcher-drop {
  background: var(--color-primary-soft);
}
/* The drop-zone fields (the launcher zones) are the shared .rui-dropzone in
   revival-ui since 2026-09-27; Steward keeps no copy. */

/* ── Request detail ─────────────────────────────────────────────────────── */
.detail-status-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.attachment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-3);
}
.attachment-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--border);
}
.attachment-list li:first-child {
  border-top: 0;
}
.attachment {
  align-items: flex-start;
}
.attachment-tile {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: var(--surface-0);
  border: 1px solid var(--border);
}
.attachment-tile svg {
  width: 22px;
  height: 22px;
  vertical-align: 0 !important;
}
.attachment-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.attachment-name {
  font-size: var(--fs-base);
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}
a.attachment-name {
  color: var(--text-1);
  text-decoration: none;
}
a.attachment-name:hover {
  color: var(--color-primary);
  text-decoration: underline;
}
.attachment-meta {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.attachment-kind {
  color: var(--text-2);
  font-weight: 600;
}
.attachment--flagged .attachment-name {
  color: var(--text-3);
  text-decoration: line-through;
}
.attach-add > summary {
  list-style: none;
  cursor: pointer;
}
.attach-add > summary::-webkit-details-marker {
  display: none;
}
.attach-add[open] > summary {
  display: none;
}
/* The pill row: closed disclosure + the phone's Take photo pill on one
   baseline; once open, the uploader takes the full row. */
.attach-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}
.attach-add[open] {
  flex-basis: 100%;
}
.attach-drop-hint {
  color: var(--text-3);
}
@media (hover: none) {
  /* No drag-and-drop on touch; don't promise it. */
  .attach-drop-hint {
    display: none;
  }
}
/* Phone stack (Aaron review, 2026-09-05). revival-ui.css puts the whole
   rail above the wide column under 760px, which read as: status, attachments,
   print, change order, submit again, withdraw/delete... and only THEN what
   the request is. Flatten both columns into one flex stack and order it:
   status, attachments, the wide column, then the action cards.
   The columns are revival-ui's .request-layout / .request-main /
   .request-sidebar; the stack rides Steward's role classes beside them
   (rq-layout / rq-main / rq-side, 2026-11-01), so this sheet never restyles
   the shared ones. Every child of .rq-side is a .sidebar-card. */
@media (max-width: 760px) {
  .rq-layout {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
  }
  .rq-main,
  .rq-side {
    display: contents;
  }
  .rq-main > * {
    order: 1;
    margin-top: 0;
  }
  .rq-layout .rq-side > * {
    order: 2;
    margin-top: 0;
  }
  .rq-layout .rq-side > :first-child,
  .rq-side > #attachCard {
    order: 0;
  }
}
.receive-row {
  display: grid;
  /* name · ordered/received · today · what about the rest (2026-10-06) */
  grid-template-columns: 1fr 120px 100px 150px;
  gap: var(--sp-2);
  align-items: center;
  margin-bottom: 6px;
}
.receive-row.is-charge {
  opacity: 0.7;
}
.receive-row .receive-note {
  grid-column: 2 / 5;
  text-align: right;
}
/* This delivery's charge + statement reference, side by side. */
.receive-charge {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  align-items: flex-end;
}
/* The Receiving list's "Receive" lands here, clear of the sticky top bar. */
.receiving-card,
#reconcile {
  scroll-margin-top: 68px;
}
/* Cash Advance reconciliation: one purchase per submit, fields in a row. */
.advance-receipt-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  align-items: flex-end;
}
/* Comments thread */
.comment {
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--border);
}
.comment:first-child {
  border-top: 0;
}
.comment-meta {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-bottom: 2px;
}
.comment-body {
  font-size: var(--fs-base);
  white-space: pre-wrap;
}
.mention {
  color: var(--color-primary);
  font-weight: 600;
}
/* Approval flow steps */
.flow {
  list-style: none;
  padding: 0;
  margin: 0;
}
.flow li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 6px 0;
  font-size: var(--fs-sm);
}
.flow-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex: 0 0 auto;
  background: var(--neutral-bg);
  border: 1px solid var(--border-strong);
}
.flow-dot.is-done {
  background: var(--success);
  border-color: var(--success);
}
.flow-dot.is-current {
  background: var(--pending-bg);
  border-color: var(--pending);
}
.flow-dot.is-denied {
  background: var(--danger);
  border-color: var(--danger);
}

/* ── Settings shell ─────────────────────────────────────────────────────── */
/* ── Settings rail ───────────────────────────────────────────────────────
   A port of design.revival.tv's admin sidebar (.settings-rail / .ts-*),
   metrics and all, so an admin moving between the two apps meets the same
   furniture (Aaron, 2026-09-13). Behaviour: public/admin-rail.js. */
.settings-rail {
  position: fixed;
  left: 0;
  bottom: 0;
  top: 0; /* admin-rail.js drops this below the real header height */
  width: var(--rail-width);
  z-index: var(--z-sticky);
  background: var(--bg-sidebar);
  overflow-y: auto;
  padding: 12px 10px 24px;
  box-sizing: border-box;
}
/* The id is load-bearing: the base input rule is
   `input:not([type=checkbox])...` (five :not()s), which outranks a plain
   class selector and left this field white on the dark rail (Aaron,
   2026-09-13). */
#settingsRail .ts-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 11px;
  margin: 0 0 8px;
  border: none;
  border-radius: 10px;
  background: var(--rail-field-bg);
  color: var(--rail-field-ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: none;
}
#settingsRail .ts-search::placeholder {
  color: var(--rail-muted);
}
#settingsRail .ts-search:focus {
  background: var(--rail-field-bg-focus);
  border: none;
  outline: none;
  box-shadow: none;
}
/* Safari paints its own decorations inside a type=search field. */
#settingsRail .ts-search::-webkit-search-decoration,
#settingsRail .ts-search::-webkit-search-cancel-button {
  appearance: none;
}
.settings-rail a.ts-link {
  display: block;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--rail-ink);
  text-decoration: none;
  line-height: 1.35;
}
.settings-rail a.ts-link:hover {
  background: var(--rail-hover-bg);
  color: var(--rail-ink-strong);
}
.settings-rail a.ts-link.active {
  background: var(--rail-active-bg);
  color: var(--rail-ink-strong);
  font-weight: 600;
}
.settings-rail a.ts-link:focus-visible {
  outline: 2px solid var(--rail-ink-strong);
  outline-offset: -2px;
}
.settings-rail .ts-caption {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rail-caption);
  padding: 10px 10px 2px;
}
.settings-rail .ts-group-label {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--rail-ink-group);
  padding: 12px 10px 4px;
}
.settings-rail .ts-grp-icon {
  font-size: 13px;
}
.settings-rail .ts-group-label .ts-chev {
  margin-left: auto;
  font-size: 8px;
  opacity: 0.55;
  transition: transform var(--dur-fast);
}
.settings-rail .ts-grp.collapsed .ts-chev {
  transform: rotate(-90deg);
}
.settings-rail .ts-grp.collapsed .ts-grp-links {
  display: none;
}
.settings-rail .ts-grp .ts-link {
  margin-left: 20px;
}
.settings-rail .ts-empty {
  font-size: 12.5px;
  color: var(--rail-muted);
  padding: 8px 10px;
}
body.has-tools-sidebar main,
body.has-tools-sidebar .steward-footer {
  margin-left: var(--rail-width);
  max-width: calc(100% - var(--rail-width));
}
/* Under 900px the rail stops being a rail: it sits in the flow above the
   page as a wrapped row of pills, groups open. */
@media (max-width: 899px) {
  .settings-rail {
    position: static;
    width: auto;
    padding: 10px 12px;
  }
  .settings-rail .ts-grp.collapsed .ts-grp-links,
  .settings-rail .ts-grp-links {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
  }
  .settings-rail .ts-group-label {
    padding: 10px 6px 3px;
  }
  .settings-rail .ts-group-label .ts-chev {
    display: none;
  }
  .settings-rail a.ts-link {
    display: inline-block;
    padding: 5px 9px;
  }
  .settings-rail .ts-grp .ts-link {
    margin-left: 0;
  }
  body.has-tools-sidebar main,
  body.has-tools-sidebar .steward-footer {
    margin-left: 0;
    max-width: none;
  }
}
.settings-layout > * {
  min-width: 0;
}
/* Settings hub: the tiles WERE HERE (.hub-grid / .hub-tile). They are
   revival-ui's .set-hub-* / .set-tile since 25 Sep 2026, shared by every app's
   admin hub. */
/* Editable list rows (ministries, GL, tiers, approvers...). */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.list-row:first-child {
  border-top: 0;
}
.list-row.is-inactive {
  opacity: 0.6;
}
/* Add-row / edit-row forms: a grid whose tracks are set per form by a
   modifier class, never inline. */
.form-row {
  display: grid;
  gap: 10px;
  align-items: flex-end;
}
.form-row--2 {
  grid-template-columns: 1fr 1fr;
}
.form-row--3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.form-row--auto {
  grid-template-columns: 1fr auto;
}
.form-row--name-code {
  grid-template-columns: 120px 1fr 220px auto;
}
.form-row--approver {
  grid-template-columns: 1fr 1fr 150px 180px;
}
.form-row--method {
  grid-template-columns: 1fr 220px auto auto auto auto;
}
/* Shipping (request page): three short fields and a button on one line
   instead of four stacked full-width rows (Aaron, 2026-09-05). */
.form-row--shipping {
  grid-template-columns: 1fr 1.4fr 170px auto;
}
@media (max-width: 760px) {
  .form-row--shipping {
    grid-template-columns: 1fr;
  }
}
.check-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-sm);
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-1);
  margin: 0;
  cursor: pointer;
}
.check-label input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
}
.gl-add-form {
  display: grid;
  grid-template-columns: 120px 1fr 220px auto;
  gap: 10px;
  align-items: flex-end;
}
.gl-row {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  padding: var(--sp-2) 0;
}
.gl-row-form {
  flex: 1;
  display: grid;
  grid-template-columns: 120px 1fr 220px auto auto;
  gap: var(--sp-2);
  align-items: center;
}
/* Payment-method matrix */
.pm-table-wrap {
  overflow-x: auto;
}
.pm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.pm-table th {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  font-weight: 700;
  text-align: left;
  padding: 6px 8px;
}
.pm-table th.pm-group {
  text-align: center;
  color: var(--color-primary);
  border-bottom: 1px solid var(--border);
}
.pm-table td {
  padding: 8px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
.pm-table td.pm-check,
.pm-table th.pm-check {
  text-align: center;
}
.pm-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}
.pm-drag {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: var(--fs-md);
  line-height: 1;
  padding: var(--sp-1) 6px;
  cursor: grab;
  border-radius: var(--r-sm);
}
.pm-drag:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.pm-drag:active {
  cursor: grabbing;
}
/* Communication matrix reach note */
.sms-reach {
  font-size: var(--fs-2xs);
  line-height: 1.35;
  margin-top: 5px;
  max-width: 230px;
}
.sms-reach--full {
  color: var(--success);
}
.sms-reach--partial {
  color: var(--warning);
}
.sms-reach--none,
.sms-reach--unlikely {
  color: var(--text-3);
}
/* Coverage grid (Approvers) */
.cov-table th {
  padding: 10px 12px;
  font-weight: 700;
  vertical-align: bottom;
}
.cov-table th .cov-ceiling {
  display: block;
  font-weight: 400;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.cov-table td {
  padding: var(--sp-2) var(--sp-3);
  vertical-align: top;
}
.cov-table td.is-gap {
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 600;
}
.cov-table td[data-label='Ministry'] {
  font-weight: 600;
  white-space: nowrap;
}
.cov-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.cov-summary .text-muted {
  font-weight: 400;
  font-size: var(--fs-sm);
}
/* List filter (settings lists) */
.listfilter {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  margin-bottom: var(--sp-3);
}
.listfilter input {
  flex: 1;
}
.listfilter-count {
  font-size: var(--fs-xs);
  color: var(--text-3);
  white-space: nowrap;
}
/* Access & Roles lists */
.role-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.role-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: var(--fs-base);
}
.role-list li:first-child {
  border-top: 0;
}
.lock-note {
  font-size: var(--fs-xs);
  color: var(--text-3);
  white-space: nowrap;
}

/* ── Queue / approvals ──────────────────────────────────────────────────── */
.queue-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.queue-tile {
  /* Flat at rest, lifting on hover -- the same treatment as the home page's
     launcher cards (Aaron, 2026-09-13: the inherited .card drop shadow made
     a row of small tiles look heavy). */
  box-shadow: none;
  /* A grid item's automatic minimum is its min-content width, so a long
     label ("Awaiting Payment") stretched its own track and the row came out
     ragged (Aaron, 2026-09-13). min-width: 0 holds every track at its equal
     1fr share; the label wraps instead, and grid stretch keeps the heights
     level. */
  min-width: 0;
  /* A fixed box, so a wrapped label or the active ring can never make one
     tile taller than its neighbours (Aaron, 2026-09-13). Content is centred
     in it rather than sitting at the top. */
  min-height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
  /* .card's vertical margin doesn't belong on a gapped grid item -- a
     stretched item fills the row minus its margins, so a tile with a
     different margin came out shorter than its neighbours (Aaron,
     2026-09-13/14; measured in Chrome). The grid's gap is the only spacing
     here. */
  margin: 0;
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
  text-decoration: none;
  color: inherit;
  padding: var(--sp-3) 14px;
}
/* An exception tile stands out by its number's colour (.is-danger /
   .is-warning), not by an accent bar -- the bar read as a drop shadow
   (Aaron, 2026-09-13) and every tile carried one, so it distinguished
   nothing. */
.queue-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.queue-tile:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .queue-tile:hover {
    transform: none;
  }
}
.queue-tile-num {
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.queue-tile-label {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-top: 2px;
  overflow-wrap: break-word;
}
.approval-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: center;
}

/* ── Inventory ──────────────────────────────────────────────────────────── */
.stock-bar {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--neutral-bg);
  overflow: hidden;
}
.stock-bar > i {
  display: block;
  height: 100%;
  background: var(--success);
}
.stock-bar.is-low > i {
  background: var(--warning);
}
.stock-bar.is-out > i {
  background: var(--danger);
}

/* ── Reports ────────────────────────────────────────────────────────────── */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}
.report-card {
  display: block;
  text-decoration: none;
  color: inherit;
  margin: 0;
  transition:
    box-shadow var(--dur-fast),
    border-color var(--dur-fast);
}
.report-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}
.report-card-stat {
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.1;
  margin: var(--sp-2) 0 2px;
  font-variant-numeric: tabular-nums;
}
.bar {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--neutral-bg);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--color-primary);
}
.bar.is-over > i {
  background: var(--danger);
}
.bar.is-near > i {
  background: var(--warning);
}
.year-chips {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

/* ── Help page ──
   Moved to revival-ui's shared .rui-help (2026-09-25), so every Revival app's
   /help looks the same. The old .help-toc / .help-section rules were here. */

/* ── Footer: revival-ui's .site-footer. ─────────────────────────────────── */
/* The iOS install strip moved to the shared install card (revival-ui
   .rui-install, 2026-09-27), which hides itself when printing. */

/* ── Print ─────────────────────────────────────────────────────────────────
   The header, the footer and the QR page's buttons carry revival-ui's
   .rui-print-hide, which hides them on paper; this sheet no longer restyles
   .app-header / .site-footer itself (2026-11-01). The printed PO
   (po-print.ejs) is a document of its own and does not load this sheet. */
@media print {
  body::before {
    display: none;
  }
  main.page {
    padding: 0;
  }
  /* A card's edge on paper is revival-ui's print rule (2026-11-02). */
}

/* ═══════════════════════════════════════════════════════════════════════════
   5b. PATTERNS — added during the 2026-09-02 full sweep (per view)
   ═══════════════════════════════════════════════════════════════════════════ */

/* -- partials/approval-flow.ejs: the step timeline is revival-ui's .flow-steps
   (moved there from here, same names). -- */

/* -- camera capture (partials/receipt-upload.ejs, new-request.ejs) -- */
.cam-video {
  max-width: 360px;
  border-radius: var(--r-md);
  background: var(--text-1);
}

.cam-shot {
  max-width: 220px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

/* -- partials/comments.ejs -- */
/* Land below the sticky 52px top bar when an email links to #comments, not
   under it. Layout only; an upstream candidate for revival-ui, since any
   app that links to a section of a page needs the same offset. */
.comments-card {
  scroll-margin-top: 68px;
}

/* -- partials/duplicate-warning.ejs -- */
.dupe-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: var(--fs-sm);
  padding: 6px 0;
}

.dupe-row + .dupe-row {
  border-top: 1px solid var(--danger-border);
}

/* -- home.ejs -- */
/* Scheduled deposits list */
.sched-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: var(--fs-sm);
  padding: 7px 0;
}

.sched-row + .sched-row {
  border-top: 1px solid var(--border);
}

.badge-link {
  text-decoration: none;
}

/* -- approve.ejs / request-detail.ejs: history + activity rows -- */
.log-row {
  padding: var(--sp-1) 0;
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
}

/* -- admin-queue.ejs / my-requests.ejs -- */
/* Summary tile numbers take the tone of the status they count. */
.queue-tile-num.is-pending {
  color: var(--pending);
}

.queue-tile-num.is-warning {
  color: var(--warning);
}

.queue-tile-num.is-success {
  color: var(--success);
}

.queue-tile-num.is-primary {
  color: var(--color-primary);
}

.queue-tile-num.is-muted {
  color: var(--text-2);
}

.queue-tile-num.is-neutral {
  color: var(--neutral);
}

.queue-tile-num.is-danger {
  color: var(--danger);
}

/* The tile whose status filter is currently applied (My Requests). Also
   holds its ring on hover, where the lift alone marks the hover. */
.queue-tile.is-active,
.queue-tile.is-active:hover {
  box-shadow: 0 0 0 2px var(--color-primary) inset;
}

/* A card that is a link (low-stock nudge): keep the text plain. */
.card-link {
  text-decoration: none;
  color: inherit;
}

/* The one-line filter bar on My Requests and the Queue (Aaron, 2026-09-12,
   from Precoro) is revival-ui's .rui-filter-bar, which was drawn from it. */
/* A "and a note" field beside a short number input (petty cash count). */
.min-w-note {
  min-width: 140px;
}

/* A recurring PO in a list: a small repeat mark in its own narrow, sortable
   column (Aaron, 2026-10-20: "a smaller icon", then "in their own column so
   they are sortable"). The hover says how often and when the next draft comes. */
.rec-icon {
  display: inline-flex;
  vertical-align: -2px;
  margin-left: 4px;
  color: var(--color-primary);
}
.rec-icon .icon {
  width: 13px;
  height: 13px;
}
/* The Recurring column: as narrow as its mark, the heading's mark muted. */
th.col-rec,
td.col-rec {
  width: 1%;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}
th.col-rec .icon {
  width: 14px;
  height: 14px;
  color: var(--text-3);
}
td.col-rec .rec-icon {
  margin-left: 0;
}

/* The list filters' chips row and the save box (views/partials/list-filters.ejs).
   The chips themselves are revival-ui's .rui-chip / .rui-chip--applied. */
.list-filter-chips {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: calc(-1 * var(--sp-2));
}
.list-filter-saved {
  color: inherit;
  text-decoration: none;
}
.list-filter-delete {
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

/* -- utilities used by request-detail / new-request (belong in §3) -- */
.ml-1 {
  margin-left: var(--sp-1) !important;
}

.ml-2 {
  margin-left: var(--sp-2) !important;
}

.pointer {
  cursor: pointer;
}

.strike {
  text-decoration: line-through;
}

/* Indented bullet list inside a card (not a notice — that one is .notice-list). */
.list-inset {
  padding-left: var(--sp-5);
}

.max-w-narrow {
  max-width: 420px;
}

/* <summary> styled as a button: hide the disclosure marker. */
.summary-btn {
  cursor: pointer;
  list-style: none;
}

/* A row's action cell mixes bare buttons with buttons inside a <form> or a
   <details> (Edit). Those wrappers are inline boxes that sit on the text
   baseline while the buttons are inline-flex, so on a wide screen the Edit
   and Deactivate buttons sat a few pixels lower than their neighbours
   (Aaron, 2026-09-27). Line them all up by their middles, with a little
   space between rows when the cell wraps. The phone layout (.rtable at the
   breakpoint below) turns the cell into a flex row and is unaffected. */
td.rt-actions > * {
  vertical-align: middle;
  margin-block: 2px;
}

.summary-btn::-webkit-details-marker {
  display: none;
}

/* -- request-detail.ejs -- */
/* Callout card on a soft primary ground (schedule / CapEx / event context). */
.card--callout-soft {
  background: var(--color-primary-soft);
}

/* "Needs your action": moved to revival-ui (.rui-needs, 2026-09-25) so every
   app draws the one bar. Same values it had here. */

/* Headline figures for an event justification: a soft band of stats. */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-lg);
  background: var(--color-primary-soft);
}

/* Action row under a card--flush table (price true-up). */
.tbl-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px var(--sp-3);
  border-top: 1px solid var(--border);
}

/* -- new-request.ejs -- */
/* Soft inset box for a conditional sub-form (petty-cash mode, new supplier,
   recurring options, deposit-schedule nudge, read-only conversation). */
.form-inset {
  background: var(--color-primary-soft);
  padding: var(--sp-3);
  border-radius: var(--r-lg);
}

/* Type-to-search box with an inline clear (✕) button. The search input
   leaves room on the right; the JS hook .combo-clear is only ever toggled
   between display:none and block by public/new-request.js's wireCombo (the
   Supplier box, the one search the shared combo can't take: it asks the
   server as you type). */
.combo-search {
  padding-right: 26px;
}

.combo-clear {
  position: absolute;
  right: var(--sp-2);
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}

/* A checkbox/radio label whose text is a sentence, not a word. */
.check-label--wrap {
  white-space: normal;
  align-items: flex-start;
}

.check-label--wrap input {
  flex: 0 0 auto;
  margin-top: 2px;
}

/* -- utilities (shared by several settings views) -- */
/* Flex row whose children bottom-align (a labelled field beside a button). */
.items-end {
  align-items: flex-end !important;
}

/* Single-column settings forms (Mileage, Fulfillment, Accounting Export). */
.max-w-form {
  max-width: 520px;
}

/* Every disclosure summary is a click target. */
.settings-content summary {
  cursor: pointer;
}

/* Same trap, more grids (Aaron, 2026-09-14; measured in Chrome). The My
   Requests tiles were a third, until they stopped carrying .card and took
   the shared tile's own border instead (2026-09-27). Steward's old
   `.card + .card` rule (gone 2026-11-02) gave every tile but the first a
   16px top margin, so the first stretched taller than its siblings; the
   gap owns the spacing. Each tile is named by its own role class
   (2026-11-01), never as a bare .card. */
.queue-tiles > .queue-tile,
.launcher-grid > .launcher-card,
.launcher-grid > .card.requests-widget {
  margin: 0;
}

/* -- settings/_listfilter -- */
/* Client-side list filter hides via a class so a row's own display survives. */
.filter-hidden {
  display: none !important;
}

/* -- settings (shared): sectioned cards, rules, list rows -- */
/* A card split into bands (Notifications: sender band / matrix / save band). */
.card-section {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.card-section--foot {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 0;
  border-top: 1px solid var(--border);
}

/* A hairline above a sub-section inside a card (Form Options, Supplier edit). */
.section-rule {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-3);
}

.section-title.section-rule {
  padding-top: var(--sp-4);
}

/* Editable list rows whose content is multi-line (pending supplier review). */
.list-row--top {
  align-items: flex-start;
}

/* A bordered, rounded table wrapper inside a card (coverage grid). */
.tbl-wrap--bordered {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

/* A nested (child) code/method input steps in one unit. */
.input-indent {
  margin-left: var(--sp-4) !important;
}

/* Add-row checkbox labels sit level with the inputs beside them. */
.form-row--method > .check-label {
  padding-bottom: 9px;
}

.check-label--top {
  align-items: flex-start;
  white-space: normal;
}

/* A fieldset that is only a grouping, not a box. */
.fieldset-plain {
  border: 0;
  margin: 0;
  padding: 0 0 6px;
  min-width: 0;
}

/* Warning list inside a notice (import results). */
.notice-list {
  margin: var(--sp-2) 0 0;
  padding-left: var(--sp-5);
}

/* -- settings/tiers -- */
.form-row--tier {
  grid-template-columns: 1fr 140px 90px auto;
}

.form-row--tier-edit {
  grid-template-columns: 1fr 140px 90px auto auto;
  align-items: center;
}

/* -- settings/petty-cash -- */
.form-row--fund {
  grid-template-columns: 1fr 1fr 1fr 1fr 110px 1fr auto;
}

.form-row--fund-edit {
  grid-template-columns: 1fr 1fr 1fr 1fr 100px 1fr auto auto;
  align-items: center;
}

/* -- settings/approvers -- */
.form-row--approver-edit {
  grid-template-columns: 1fr 1fr 150px 160px auto;
  align-items: center;
}

.ministry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-1);
}

/* -- settings/gl -- */
.gl-row + .gl-row {
  border-top: 1px solid var(--border);
}

/* -- settings/payment-methods -- */
.pm-name-input {
  min-width: 130px;
}

/* -- settings/supplier-edit -- */
.doc-list {
  margin: 0 0 var(--sp-3);
  padding-left: var(--sp-4);
}

@media (max-width: 900px) {
  .form-row--tier,
  .form-row--tier-edit,
  .form-row--fund,
  .form-row--fund-edit,
  .form-row--approver-edit {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .form-row--tier,
  .form-row--tier-edit,
  .form-row--fund,
  .form-row--fund-edit,
  .form-row--approver-edit {
    grid-template-columns: 1fr !important;
  }
}
/* wave3a additions — merge into public/styles.css, section 5. PATTERNS.
   Every rule uses tokens only. Groups are labelled with the view they serve. */

/* ── Admin subnav (reports, budgets, admin-queue) ────────────────────────── */
/* The strip bleeds to the card edges of main.page; 6. RESPONSIVE already
   resets these margins to 0 under 640px. Was an inline margin on every page. */
/* The strip is revival-ui's .admin-subnav; the bleed rides Steward's role
   class beside it (class="admin-subnav admin-strip", 2026-11-01). */
.admin-strip {
  margin: calc(-1 * var(--sp-6)) calc(-1 * var(--sp-6)) var(--sp-5);
}

/* ── Reports (reports.ejs, my-reports.ejs, budgets.ejs, event-report.ejs) ── */
/* Headline stat tiles in a row. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-3);
}

/* Filter row: fields side by side, bottoms aligned. */
.report-filters {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.report-filters-hint {
  align-self: center;
  max-width: 240px;
}

/* Band header + body for a card--flush that is not a table (charts, lists). */
.card-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-primary-soft);
  font-weight: 700;
  font-size: var(--fs-base);
  color: var(--text-1);
}

.card-band-aside {
  font-weight: 400;
  font-size: var(--fs-xs);
}

.card-band-body {
  padding: var(--sp-2) var(--sp-4);
}

/* Horizontal bar list rows (spend by ministry / GL). */
.bar-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-1) 0;
}

.bar-row-label {
  flex: 0 0 120px;
  font-size: var(--fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-row-value {
  flex: 0 0 80px;
  text-align: right;
  font-size: var(--fs-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bar-row .bar {
  height: 14px;
  border-radius: var(--r-sm);
}

.bar-row .bar > i {
  min-width: 2px;
  border-radius: var(--r-sm);
}

/* Column chart (spend by month): bar heights are computed per column. */
.col-chart {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  height: 140px;
  padding: var(--sp-4) var(--sp-4) var(--sp-2);
  box-sizing: border-box;
}

.col-chart-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.col-chart-bar {
  width: 100%;
  max-width: 42px;
  background: var(--color-primary);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}

/* ── Budgets (budgets.ejs) ───────────────────────────────────────────────── */
/* Add-budget row: Ministry, GL combo, amount, Set. */
.form-row--budget {
  grid-template-columns: 1fr 1fr 140px auto;
}

/* ── Forms shared (event-new.ejs, capex-new.ejs, schedule-new.ejs) ───────── */
/* A soft primary panel that groups optional fields a choice reveals
   (travel details, deposit terms). Display is toggled by the page script. */
.soft-panel {
  background: var(--color-primary-soft);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-4);
}

/* Plain <details> summary that is not a card. */
.summary-toggle {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-base);
}

.summary-toggle .text-muted {
  font-weight: 400;
}

/* Live totals: the computed panel on a form, one tile per figure. */
.totals-panel {
  background: var(--color-primary-soft);
  border: 1px solid var(--color-primary);
  padding: var(--sp-4);
}

/* Row-editor track lists (one per repeating editor). */
.form-row--travel {
  grid-template-columns: 1fr 160px;
}

.row-editor--fund {
  grid-template-columns: 1.2fr 1fr 130px 34px;
}

.row-editor--exp {
  grid-template-columns: 1.1fr 1.1fr 170px 130px 34px;
  align-items: start;
}

/* ── Event report (event-report.ejs) ────────────────────────────────────── */
/* revival-ui's .kv-table (funding sources, projected lines); the total row
   under it is .tbl-total. */
.kv-table .tbl-total td {
  background: transparent;
  border-top: 1px solid var(--border);
}

.row-editor--eq {
  grid-template-columns: 1fr 90px 130px 34px;
  align-items: center;
}

.form-row--quote {
  grid-template-columns: 1fr 140px;
  gap: var(--sp-2);
}

.combo-clear:hover {
  color: var(--text-1);
}

/* ── Backup approver (delegations.ejs) ──────────────────────────────────── */
.form-row--delegate {
  grid-template-columns: 1fr 150px 150px auto;
}
/* wave3b additions — merge into public/styles.css, section 5. PATTERNS */

/* -- inventory.ejs -- (under "── Inventory") */
/* Single-select filter / search box above the list: one field, capped. */
.inv-filter {
  max-width: 280px;
}

/* The add-item form's four short numeric fields on one row. */
.inv-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}

/* Low-stock rows get the soft warning wash instead of an inline hex. */
.tbl tr.is-low td {
  background: var(--warning-bg-soft);
}

/* Inside the item's Edit dialog. */
.inv-edit-form {
  text-align: left;
}

/* Recent-activity list under the edit form. */
.inv-activity {
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
  text-align: left;
}

.inv-activity ul {
  margin: 0;
  padding-left: var(--sp-4);
  font-size: var(--fs-xs);
}

@media (max-width: 640px) {
  .inv-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

/* -- inventory-adjust.ejs -- (under "── Inventory") */
/* Phone-first single-item counter: a narrow centred card with a big stepper. */
.qty-card,
.qr-sheet {
  max-width: 420px;
  margin: 0 auto;
  padding: var(--sp-6);
}

.qty-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
}

.qty-stepper-btn {
  width: 52px;
  height: 52px;
  font-size: var(--fs-2xl);
  line-height: 1;
  flex: 0 0 auto;
}

.qty-stepper-input,
input.qty-stepper-input {
  width: 90px;
  text-align: center;
  font-size: var(--fs-2xl);
  padding: var(--sp-2) 6px;
  font-variant-numeric: tabular-nums;
}

/* -- inventory-qr.ejs -- (under "── Inventory"; .qr-sheet shares .qty-card) */
.qr-img {
  display: block;
  margin: 0 auto var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.qr-actions,
.actions-center {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* -- error.ejs / email-approve.ejs -- (new heading "── Standalone pages") */
/* A lone message card (error page, email one-tap result). */
.card--narrow {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* .error-card: retired 2026-09-25 — error.ejs uses revival-ui's shared .rui-error. */

.pre-wrap {
  white-space: pre-wrap;
}

/* -- legacy-list.ejs / legacy-detail.ejs -- (new heading "── Legacy archive")
   Moved out of the two views' <style> blocks; hex replaced by role tokens. */
/* Document-type badges (replaces the inline legacyBadgeStyle() helper):
   PO = info, invoice = success, expense = warning, receipt = pending. */
.badge--legacy {
  background: var(--neutral-bg);
  color: var(--neutral);
  border-color: var(--border);
  vertical-align: middle;
}

.badge--legacy-purchase_order {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.badge--legacy-invoice {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

.badge--legacy-expense {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-border);
}

.badge--legacy-receipt {
  background: var(--pending-bg);
  color: var(--pending);
  border-color: var(--pending-border);
}

/* "from PO" / "from receipt" provenance tag next to a supplier name. */
.lg-ocr {
  display: inline-block;
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
  vertical-align: middle;
}

/* A link that reads as body text (supplier name in the archive table). */
.link-inherit {
  color: inherit;
}

/* Detail page: two-column key/value meta grid. */
.lg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4) var(--sp-7);
}

.lg-k {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.lg-v {
  font-size: var(--fs-base);
  margin-top: 2px;
  word-break: break-word;
}

.lg-note {
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

/* Plain bulleted lists inside a card (attachments, approval chain). */
.lg-list {
  margin: 0;
  padding-left: 18px;
  font-size: var(--fs-base);
}

/* Raw Precoro JSON: dark code block behind a <details>. */
.lg-raw-toggle {
  cursor: pointer;
}

.lg-raw {
  margin-top: var(--sp-3);
  background: var(--text-1);
  color: var(--surface-0);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  overflow: auto;
  max-height: 480px;
  font-size: var(--fs-xs);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .lg-grid {
    grid-template-columns: 1fr;
  }
}

/* -- new-request.ejs: rows built in JS -- */
.li-line-total {
  display: block;
  text-align: right;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.js-use-supplier {
  margin: var(--sp-1) var(--sp-1) 0 0;
}
.draw-pick {
  margin: var(--sp-1) 0;
  font-weight: 400;
}

/* -- gift-cards.ejs / gift-card.ejs (2026-09-02) -- */
.gc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.gc-tile {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.gc-tile.is-retired {
  opacity: 0.7;
}
.gc-balance {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
}
.form-row--load {
  grid-template-columns: 120px 150px 110px 1fr 1fr auto;
  align-items: end;
}
@media (max-width: 900px) {
  .form-row--load {
    grid-template-columns: 1fr 1fr;
  }
}

/* -- gift-card-new.ejs: the purchase form's line grid (no GL column) -- */
.gc-li-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.1fr 58px 90px 78px 30px;
  gap: 6px;
  align-items: center;
}
.gc-li-grid.li-row {
  margin-bottom: 6px;
}
.gc-items {
  margin: var(--sp-1) 0 0;
  padding-left: var(--sp-4);
  font-size: var(--fs-sm);
}
@media (max-width: 720px) {
  .gc-li-grid {
    grid-template-columns: 1fr 1fr;
  }
  .gc-li-grid.li-head {
    display: none;
  }
}

/* -- settings/ai-usage.ejs -- */
.form-row--balance {
  grid-template-columns: 160px 170px 150px auto;
  align-items: end;
}
.p-3 {
  padding: var(--sp-3) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   6. RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Settings forms with fixed pixel tracks overflow a tablet's content column. */
  .settings-content .form-row,
  .settings-content .gl-add-form,
  .settings-content .gl-row-form {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
  .form-row--method,
  .form-row--approver {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 720px) {
  .li-grid {
    grid-template-columns: 1fr 1fr;
  }
  .li-head {
    display: none;
  }
  .li-cell::before {
    content: attr(data-label);
    display: block;
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-3);
    margin-bottom: 2px;
  }
  .li-cell--del::before {
    display: none;
  }
  #lineItemsSection.po-mode .li-grid,
  #lineItemsSection.no-url .li-grid {
    grid-template-columns: 1fr 1fr;
  }
  #lineItemsSection.po-mode .po-only-notax {
    justify-content: flex-start;
  }
  .cov-table td[data-label='Ministry'] {
    white-space: normal;
  }
}
@media (max-width: 700px) {
  .gl-add-form,
  .gl-row-form,
  .form-row,
  .form-row--method,
  .form-row--approver,
  .form-row--name-code {
    grid-template-columns: 1fr 1fr;
  }
  .gl-add-form > :nth-child(3),
  .gl-add-form > :nth-child(4),
  .gl-row-form > select {
    grid-column: 1 / -1;
  }
  .gl-row {
    flex-wrap: wrap;
  }
}
@media (max-width: 640px) {
  /* .grid-stack rides revival-ui's .grid-2 (class="grid-2 grid-stack"):
     the shared grid stacks at 560px, Steward's forms at 640px like its own
     .grid-3 and .form-row. */
  .grid-stack,
  .grid-3,
  .form-row,
  .form-row--2,
  .form-row--3,
  .form-row--auto {
    grid-template-columns: 1fr !important;
  }
  /* Data tables wider than a phone scroll in place instead of clipping, and
     keep rounded corners as the scrolling box (a table is only rounded once
     it is a block: a collapsed table ignores border-radius). */
  table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    border-radius: var(--r-lg);
  }
  .admin-strip {
    overflow-x: auto;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .admin-strip-inner {
    width: max-content;
    min-width: 100%;
  }
  .receive-row {
    grid-template-columns: 1fr;
  }
  .receive-row .receive-note {
    grid-column: 1;
    text-align: left;
  }
  .page-head-actions {
    width: 100%;
  }

  /* Stacked tables on a phone are revival-ui's .rtable (moved there from
     here). What stays is Steward's .rt-actions: an actions cell's buttons in
     a row. Each button carries the role class .rt-btn beside the shared
     .btn-pill (2026-11-01). */
  .rtable td.rt-actions::before {
    display: none;
  }
  .rtable td.rt-actions {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
    margin-top: var(--sp-2);
  }
  .rtable td.rt-actions .rt-btn {
    flex: 1;
    text-align: center;
    min-width: 90px;
  }
  /* Size stays the shared icon button's (32px, 44px on touch); only the
     spacing changes when the row stacks. */
  .rtable td.rt-actions .icon-btn {
    margin-left: 0;
  }
}
@media (max-width: 560px) {
  .draft-callout__row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-1);
  }
  .page-title {
    font-size: var(--fs-2xl);
  }
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .launcher-card,
  .launcher-card:hover {
    transition: none;
    transform: none;
  }
  .progress::after,
  .upload-bar.show::after,
  .scan-progress-bar i {
    animation: none;
    width: 100%;
    opacity: 0.6;
  }
  .btn-pill.is-loading::after {
    animation: none;
  }
}

/* A request's tags (partials/request-tags.ejs, 2026-10-28): the Add form sits
   in the chip row, its pick list and name box at the chips' height. */
.request-tags-add {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}
.request-tags-add select,
.request-tags-add input {
  width: auto;
  min-width: 10rem;
  padding-top: 4px;
  padding-bottom: 4px;
}
/* A list row's tags, under its details (admin-queue / my-requests). */
.row-tags {
  margin-top: 4px;
}
/* A PO's "Record a bid" (partials/po-bids.ejs): the opened form takes the
   table foot's whole width, not one flex slot of it. */
.po-bids-add {
  flex: 1 1 100%;
}
.po-bids-add > summary {
  list-style: none;
  display: inline-flex;
}
.po-bids-add > summary::-webkit-details-marker {
  display: none;
}
/* A return's next step (partials/return-actions.ejs): each small form on one
   line, wrapping under the others on a narrow screen. */
.return-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.return-actions form {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
}
.return-actions input {
  width: 8.5rem;
  padding-top: 4px;
  padding-bottom: 4px;
}
/* On a request's page a return's next step opens from one Update button. */
.return-update > summary {
  list-style: none;
}
.return-update > summary::-webkit-details-marker {
  display: none;
}
.return-update[open] > .return-actions {
  margin-top: var(--sp-2);
  flex-direction: column;
  align-items: flex-start;
}
