/* ScanExpress — page-specific leftovers.
 *
 * The shell, the element base and the component vocabulary live in
 * ui.css / ui-tables.css / ui-detail.css / ui-forms.css / ui-auth.css, authored against the canonical tokens
 * in tokens.css. What remains here is the page pieces no feature file owns:
 * the break-glass banner, the dashboard stat tiles, the catalogue photograph.
 *
 * The auth surfaces are NOT here any more: the gate's own vocabulary was split
 * into ui-auth.css by BACKOFFICE-19, and the refusal page (.denied*) followed it
 * during the auth design-parity pass — it is drawn by the same feature, from the
 * same alert pill, and two files describing one screen is the duplication this
 * repository refuses.
 *
 * Phase C is DONE (2026-08-20): the legacy --paper/--ink palette and the
 * --pico-* bridge are deleted — every feature stylesheet and template reads
 * the --se-* tokens directly. Reintroducing a legacy name is a defect, not a
 * convenience: the names resolve to nothing now, and an unresolvable var()
 * fails silently in the browser.
 */

:root {
  /* The one local variable: no font token exists upstream beyond the Jost
   * family, and this stack is deliberately IDENTICAL to reception's
   * (web/styles.css) so a shared component renders in one typeface across
   * both consoles (PLATFORM-22). Change them together or not at all. */
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

/* Tabular figures wherever numbers stack into columns. */
table {
  font-variant-numeric: tabular-nums;
}
table code {
  font-family: var(--mono);
}

/* ---- shared vocabulary -----------------------------------------------------
 * The uppercase microlabel and the lamp, available to every page. */

.microlabel {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--se-color-text-secondary);
}

/* A lamp with no state means there is nothing to report, and it is faint on
 * purpose -- the hairline colour, not a grey invented for it. */
.lamp {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--se-color-border-default);
  flex: 0 0 auto;
}

.lamp[data-state="ready"] {
  background: var(--se-color-status-success);
  box-shadow: 0 0 0 3px rgba(27, 120, 99, 0.16);
}

.lamp[data-state="busy"] {
  background: var(--se-color-primary-60);
  box-shadow: 0 0 0 3px rgba(36, 48, 107, 0.18);
  animation: lamp-pulse 1.5s ease-in-out infinite;
}

/* Alert is the negative one -- a missed call, a disabled account, a section
 * refused -- so it is the cancel pink, not the navy that means "go". */
.lamp[data-state="alert"] {
  background: var(--se-color-accent-pink);
  box-shadow: 0 0 0 3px rgba(239, 66, 110, 0.16);
}

@keyframes lamp-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* ---- the destructive outlined button ---------------------------------------
 * The cancel language as one class, for the buttons that undo something: pink
 * ink on paper, pink edge, and it fills on the way in so the answer to a
 * pointer is unmistakable on the control that cannot be taken back.
 *
 * Self-sufficient on purpose -- background, colour and border all stated.
 * .op-danger, .role-delete and .pac-danger button say the same thing in their
 * own slices and are deliberately left alone until Phase C. */
.danger-outline {
  color: var(--se-color-secondary-60);
  background: transparent;
  border: 1px solid var(--se-color-accent-pink);
}

.danger-outline:hover:not(:disabled),
.danger-outline:focus-visible {
  color: #fff;
  background: var(--se-color-secondary-60);
  border-color: var(--se-color-secondary-60);
}

/* ---- break-glass banner ----------------------------------------------------
 * The cancel pink, edge to edge, on every page of an emergency session. An
 * unmarked back door stops being an emergency measure. */

.breakglass-banner {
  background: rgba(239, 66, 110, 0.12);
  border-bottom: 1px solid rgba(239, 66, 110, 0.45);
  color: var(--se-color-text-title);
  font-size: 0.78rem;
  padding: 0.45rem 1rem;
  text-align: center;
}

.breakglass-banner strong {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--se-color-secondary-60);
}

/* ---- content polish --------------------------------------------------------
 * Stat tiles for the dashboard, in the KPI voice the calls report uses. */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-grid > article {
  margin: 0;
  padding: 0.8rem 0.95rem;
}

.stat-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--se-color-text-secondary);
  display: block;
}

.stat-value {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin: 0.2rem 0 0.05rem;
}

.stat-value a {
  text-decoration: none;
}

.stat-note {
  font-size: 0.72rem;
  color: var(--se-color-text-secondary);
}

.section-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--se-color-text-secondary);
  margin: 2rem 0 0.6rem;
}

/* The catalogue's photograph, in the first cell of every row. Lives here rather
 * than in a stylesheet of its own because the catalogue has never needed one. */
.cat-image {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 4rem;
}

/* Square and cropped, so a row's height does not follow whatever aspect ratio
 * somebody uploaded. The hairline is the same one every panel edge uses. */
.cat-image img {
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  border: 1px solid var(--se-color-border-default);
  border-radius: 2px;
  background: var(--se-color-bg-surface);
}

/* No photograph is a dash and not an empty cell: an empty cell reads as a
 * column that failed to render. */
.cat-image-none {
  display: block;
  font-family: var(--mono);
  color: var(--se-color-text-secondary);
}

.cat-image input[type="file"] {
  margin: 0;
  font-size: 0.6rem;
  padding: 0.15rem;
}

.cat-image-error {
  font-size: 0.68rem;
  color: var(--se-color-secondary-60);
  margin: 0;
}

/* ---- motion discipline ----------------------------------------------------
 * The `.gate button` rule that used to sit here went with the `.gate*` set it
 * belonged to: the selector matched nothing, so it silenced no transition. */

@media (prefers-reduced-motion: reduce) {
  .lamp[data-state="busy"] {
    animation: none;
  }
}
