/* =====================================================================
   SecureLobby by Resco — design system
   Same family as RESCO Enterprise Security: navy sidebar, clean white
   cards on a cool grey page, round status chips, orange used only as an
   accent (focus ring, active nav, highlights). Fonts are self-hosted so
   the app looks right on an offline LAN.
   Bootstrap 5 stays underneath for the grid, utilities and dropdowns;
   its components are re-skinned here.
   ===================================================================== */

@font-face { font-family: "Outfit"; src: url("../fonts/outfit-latin.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dmsans-latin.woff2") format("woff2"); font-weight: 100 1000; font-style: normal; font-display: swap; }

:root {
  --navy: #0E1A3D;
  --navy-deep: #0A1330;
  --navy-700: #1A2A5C;
  --navy-50: #EDF0F8;
  --orange: #F17B29;
  --orange-ink: #B4500F;
  --orange-50: #FEF1E7;

  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --surface-2: #F8F9FC;
  --surface-3: #EEF1F6;
  --line: #E2E4EA;
  --line-strong: #CDD1DB;
  --ink: #0E1A3D;
  --text: #2A3350;
  --muted: #5B6170;   /* text: ≥ 5.2:1 on every light surface (WCAG AA) */
  --subtle: #9AA1AE;  /* icons, borders and placeholders only — not for text people must read */

  --crit: #D11A2A; --crit-bg: #FDE8EA; --crit-ink: #9B1220; --crit-line: #F5B8BE;
  --high: #E8590C; --high-bg: #FFEEE3; --high-ink: #A63F06; --high-line: #FBC9A8;
  --med: #D99A00;  --med-bg: #FFF6DB;  --med-ink: #7A5700;  --med-line: #F2DB94;
  --low: #2563EB;  --low-bg: #E8F0FE;  --low-ink: #1A48AE;  --low-line: #B8CEF9;
  --ok: #15803D;   --ok-bg: #E4F5EA;   --ok-ink: #106130;   --ok-line: #A9DDBC;

  --r-lg: 10px; --r: 8px; --r-sm: 6px; --r-xs: 4px;
  --shadow-sm: 0 1px 2px rgba(14, 26, 61, .06);
  --shadow: 0 1px 3px rgba(14, 26, 61, .08), 0 1px 2px rgba(14, 26, 61, .04);
  --shadow-lg: 0 18px 48px rgba(10, 19, 48, .22);
  --focus: 0 0 0 3px rgba(241, 123, 41, .45);

  --sb-w: 248px;
  --tb-h: 64px;
  --pad: 24px;
  --font: "DM Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-head: "Outfit", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;

  /* Bootstrap variables that leak into components */
  --bs-body-font-family: var(--font);
  --bs-body-color: var(--text);
  /* Bootstrap 5.3 paints focused inputs, checkboxes, menus and dialogs with this; the grey page colour is on body. */
  --bs-body-bg: var(--surface);
  --bs-border-color: var(--line);
  --bs-link-color-rgb: 26, 72, 174;
  --bs-link-hover-color-rgb: 14, 26, 61;
}

/* ---------- Base ---------- */
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { font-family: var(--font-head); color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
a { color: var(--low-ink); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
a.btn:hover, a.kpi:hover, a.nav-i:hover, a.tile:hover, .card a.name:hover { text-decoration: none; }
:is(p, li, dd, .hint, .form-text, .tip, .small, small, .sub, .alert .grow, .wiz-lead) a:not(.btn):not(.chip):not(.qhint):not(.dropdown-item):not(.list-group-item):not(.name) {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px;
}
code { font-family: var(--mono); font-size: 12px; color: var(--text); background: var(--surface-3); padding: 1px 6px; border-radius: var(--r-xs); }
.text-muted { color: var(--muted) !important; }
.small, small { font-size: 12.5px; }
.tnum, .num { font-variant-numeric: tabular-nums; }
::selection { background: rgba(241, 123, 41, .25); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: var(--r-xs); }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 3000; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--r); }
.skip-link:focus { top: 12px; color: #fff; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.ic.sm { width: 15px; height: 15px; vertical-align: -3px; }
.ic.lg { width: 22px; height: 22px; }
.ic.xl { width: 28px; height: 28px; }

/* ---------- Sidebar ---------- */
.sb {
  position: fixed; inset: 0 auto 0 0; width: var(--sb-w); z-index: 1040;
  display: flex; flex-direction: column; background: var(--navy-deep); color: #fff;
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 18px 20px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); color: #fff; }
.sb-brand:hover { color: #fff; text-decoration: none; }
.sb-brand img { width: 44px; height: auto; flex: none; }
.sb-brand.custom { flex-direction: column; align-items: flex-start; gap: 8px; }
.sb-brand.custom img { width: auto; max-width: 200px; max-height: 40px; }
.sb-brand.custom .t { font-size: 15px; }
.sb-brand .t { font-family: var(--font-head); font-size: 19px; font-weight: 600; line-height: 1.1; letter-spacing: -.01em; }
.sb-brand .s { font-size: 12px; color: rgba(255, 255, 255, .66); margin-top: 2px; }
.sb-nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.sb-nav::-webkit-scrollbar { width: 6px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 3px; }
.sb-label { margin: 18px 10px 6px; color: rgba(255, 255, 255, .64); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.nav-i {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 1px 0;
  border-radius: var(--r-sm); color: rgba(255, 255, 255, .78); font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-i .ic { opacity: .85; }
.nav-i:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-i.on { background: rgba(255, 255, 255, .11); color: #fff; font-weight: 600; }
.nav-i.on .ic { opacity: 1; color: var(--orange); }
.nav-i.on::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--orange); }
.nav-i:focus-visible { outline-offset: -2px; }
.nav-i.danger { color: #FFB3BA; }
.nav-i.danger .ic { color: #FF7A85; opacity: 1; }
.nav-i.danger:hover, .nav-i.danger.on { color: #fff; background: rgba(209, 26, 42, .28); }
.nb { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-align: center; line-height: 18px; }
.nb.red { background: var(--crit); color: #fff; }
.nb.blue { background: rgba(255, 255, 255, .16); color: #fff; }
.sb-foot { padding: 14px 16px 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sb-foot .lbl { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .66); margin-bottom: 6px; }
.sb-foot select {
  width: 100%; background-color: rgba(255, 255, 255, .07); color: #fff; border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--r-sm); padding: 7px 30px 7px 10px; font-size: 13px; appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
}
.sb-foot select option { color: var(--ink); background: #fff; }
.sb-foot select:focus { border-color: var(--orange); box-shadow: var(--focus); outline: none; }
.sb-foot .made { margin-top: 12px; font-size: 12px; color: rgba(255, 255, 255, .64); }
.sb-scrim { display: none; }

/* ---------- Top bar ---------- */
.tb {
  position: fixed; top: 0; left: var(--sb-w); right: 0; height: var(--tb-h); z-index: 1030;
  display: flex; align-items: center; gap: 14px; padding: 0 var(--pad);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.tb-toggle { display: none; width: 40px; height: 40px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }
.tb-title { min-width: 0; }
.tb-h { font-family: var(--font-head); font-size: 19px; font-weight: 600; color: var(--ink); line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.tb-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.tb-right form { margin: 0; }
.tb-div { width: 1px; height: 28px; background: var(--line); }
.chip-pill, .clock, .user-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--text); font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.clock { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.clock .ic { color: var(--muted); }
.clock .d { color: var(--muted); font-weight: 500; }
.chip-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--subtle); }
.chip-pill.ok { color: var(--ok-ink); border-color: var(--ok-line); background: var(--ok-bg); }
.chip-pill.ok::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(21, 128, 61, .18); }
.chip-pill.bad { color: var(--crit-ink); border-color: var(--crit-line); background: var(--crit-bg); }
.chip-pill.bad::before { background: var(--crit); animation: pulse 1.6s ease-in-out infinite; }
.chip-pill.warn { color: var(--med-ink); border-color: var(--med-line); background: var(--med-bg); }
.chip-pill.warn::before { background: var(--med); }
.chip-pill.off { color: var(--muted); background: var(--surface-2); }
a.chip-pill:hover { text-decoration: none; filter: brightness(.98); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(209, 26, 42, .5); } 50% { box-shadow: 0 0 0 5px rgba(209, 26, 42, 0); } }
.user-chip { padding: 0 10px 0 4px; cursor: pointer; }
.user-chip:hover { background: var(--surface-3); }
.user-chip .uav { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; }
.user-chip .nm { font-weight: 600; color: var(--ink); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.user-chip .ic { color: var(--muted); width: 15px; height: 15px; }
.user-chip::after { display: none !important; }

/* ---------- Content ---------- */
.ct { margin-left: var(--sb-w); padding: calc(var(--tb-h) + var(--pad)) var(--pad) 40px; min-height: 100vh; }
.ct > .page { max-width: 1600px; }
.eyebrow { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.section-gap { margin-top: 20px; }
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.page-head .grow { flex: 1 1 auto; min-width: 0; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); --bs-card-border-color: var(--line); --bs-card-inner-border-radius: calc(var(--r-lg) - 1px); }
.card-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: transparent; border-bottom: 1px solid var(--line); padding: 14px 20px;
  font-family: var(--font-head); font-size: 15.5px; font-weight: 600; color: var(--ink);
}
.card-header > .ic { color: var(--muted); }
.card-header .rt { margin-left: auto; font-family: var(--font); font-size: 12.5px; font-weight: 500; color: var(--muted); }
.card-header .count { font-family: var(--font); display: inline-flex; min-width: 22px; justify-content: center; padding: 0 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 20px; }
.card-header .hint { flex-basis: 100%; margin-top: -4px; font-family: var(--font); font-size: 12.5px; font-weight: 400; color: var(--muted); }
.card-header .btn, .card-header .form-control, .card-header .form-select { font-family: var(--font); }
.card-body { padding: 20px; }
.card-footer { background: var(--surface-2); border-top: 1px solid var(--line); padding: 12px 20px; }
.card-footer:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card > .table-responsive:last-child, .card > .list-group:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card-sub { font-size: 12.5px; color: var(--muted); }
.card.danger { border-color: var(--crit-line); }
.card.danger > .card-header { background: var(--crit-bg); color: var(--crit-ink); border-color: var(--crit-line); border-radius: var(--r-lg) var(--r-lg) 0 0; }

/* ---------- KPI tiles ---------- */
.kpi {
  position: relative; display: flex; align-items: flex-start; gap: 14px; height: 100%;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); color: inherit; min-width: 0;
}
a.kpi { transition: border-color .15s, box-shadow .15s; }
a.kpi:hover { border-color: var(--line-strong); box-shadow: var(--shadow); color: inherit; }
.kpi .ki { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy-700); }
.kpi .ki .ic { width: 18px; height: 18px; }
.kpi .kb .k { padding-right: 38px; }
.kpi .kb { min-width: 0; flex: 1 1 auto; align-self: stretch; display: flex; flex-direction: column; }
.kpi .kb .v { margin-top: auto; }
.kpi .k { font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-family: var(--font-head); font-size: 28px; font-weight: 600; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.blue .ki { background: var(--low-bg); color: var(--low); }
.kpi.green .ki { background: var(--ok-bg); color: var(--ok); }
.kpi.amber .ki { background: var(--med-bg); color: var(--med-ink); }
.kpi.grey .ki { background: var(--surface-3); color: var(--muted); }
.kpi.alert-on { background: var(--crit); border-color: var(--crit); }
.kpi.alert-on .k, .kpi.alert-on .v, .kpi.alert-on .d { color: #fff; }
.kpi.alert-on .ki { background: rgba(255, 255, 255, .2); color: #fff; }
.kpi.warn-on { border-color: var(--crit-line); }
.kpi.warn-on .v { color: var(--crit); }
.kpi.warn-on .ki { background: var(--crit-bg); color: var(--crit); }
.kpi.plain { display: block; }
.kpi .t { font-family: var(--font-head); font-size: 15.5px; font-weight: 600; color: var(--ink); }
.kpi .go { position: absolute; right: 14px; top: 16px; color: var(--subtle); }

/* Horizontal bars (on site by category) */
.bars .r { display: grid; grid-template-columns: minmax(80px, 120px) 1fr 32px; align-items: center; gap: 12px; margin: 10px 0; font-size: 13px; }
.bars .t { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bars .f { height: 8px; background: var(--navy-700); border-radius: 999px; }
.bars .n { text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Chips (status) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; border: 1px solid transparent;
  background: var(--surface-3); color: var(--muted); vertical-align: middle;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.nodot::before { display: none; }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip.info { background: var(--low-bg); color: var(--low-ink); }
.chip.warn { background: var(--med-bg); color: var(--med-ink); }
.chip.orange { background: var(--high-bg); color: var(--high-ink); }
.chip.bad { background: var(--crit-bg); color: var(--crit-ink); }
.chip.muted { background: var(--surface-3); color: var(--muted); }
.chip.strike { text-decoration: line-through; }
.chip.solid-bad { background: var(--crit); color: #fff; }
.chip.solid-bad::before { display: none; }
.chip.lg { font-size: 13px; padding: 4px 12px; }
.chip .ic { width: 13px; height: 13px; }
.chip:has(.ic)::before { display: none; }
.sq { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--line-strong); }
.sq.red { background: var(--crit); } .sq.green { background: var(--ok); } .sq.blue { background: var(--low); }

/* Legacy Bootstrap badge names still used in a few places */
.badge { font-weight: 600; border-radius: 999px; padding: 3px 9px; }

/* ---------- Avatars ---------- */
.av {
  position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  width: 36px; height: 36px; border-radius: 50%; background: var(--navy-50); color: var(--navy-700);
  font-family: var(--font-head); font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av.av-1 { background: #E8F0FE; color: #1A48AE; }
.av.av-2 { background: #E4F5EA; color: #106130; }
.av.av-3 { background: #FEF1E7; color: #A63F06; }
.av.av-4 { background: #F1E9FB; color: #5B2A9C; }
.av.av-5 { background: #E3F4F6; color: #0F5E68; }
.av.sm { width: 30px; height: 30px; font-size: 11.5px; }
.av.lg { width: 64px; height: 64px; font-size: 22px; }
.av.xl { width: 120px; height: 140px; border-radius: var(--r-lg); font-size: 40px; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who .w { min-width: 0; }
.who .name { display: block; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .sub { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.name { color: var(--ink); font-weight: 600; }
a.name:hover { color: var(--low-ink); }

/* ---------- Tables ---------- */
.table { margin: 0; color: var(--text); font-size: 13.5px; --bs-table-hover-bg: var(--surface-2); --bs-table-bg: transparent; --bs-table-color: var(--text); }
.table > :not(caption) > * > * { padding: 11px 14px; border-bottom-color: var(--line); vertical-align: middle; }
.table > thead th, .table thead th {
  background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none;
  border-bottom: 1px solid var(--line) !important; white-space: nowrap; padding-top: 10px; padding-bottom: 10px;
}
.table > :not(:first-child) { border-top: 0; }
.table td:first-child, .table th:first-child { padding-left: 20px; }
.table td:last-child, .table th:last-child { padding-right: 20px; }
.table-sm > :not(caption) > * > * { padding: 8px 12px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--surface-2); }
.table tr.row-bad td:first-child { box-shadow: inset 4px 0 0 var(--crit); }
.table tr.row-warn td:first-child { box-shadow: inset 4px 0 0 var(--high); }
.table tr.inactive td { color: var(--muted); }
.table tr.inactive a { color: var(--muted); }
.table .actions { text-align: right; white-space: nowrap; }
.table td.time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table td.time small, .table td .sub { display: block; font-size: 12px; color: var(--muted); }
.report-table { font-size: 13px; }
.report-table td { white-space: nowrap; }
.card .table-responsive { border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* Tables wider than their card scroll inside the card, never the page.
   position:relative keeps the visually-hidden header labels (absolutely positioned) inside the scroll box: without it
   they hung out past the card and the whole page scrolled sideways on tablets and phones. */
.table-responsive { position: relative; max-width: 100%; }
.row > * { min-width: 0; }
/* When a table does scroll (site.js marks it): shadows show there is more, the row actions stay in view on the right. */
.table-responsive.is-scrollable {
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(255, 255, 255, 0)) left center / 32px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, rgba(255, 255, 255, 0)) right center / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(14, 26, 61, .2), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(14, 26, 61, .2), transparent) right center / 12px 100% no-repeat scroll;
}
.table-responsive.is-scrollable .table td.actions, .table-responsive.is-scrollable .table th.actions {
  position: sticky; right: 0; z-index: 1; background-color: var(--surface); box-shadow: -10px 0 10px -10px rgba(14, 26, 61, .25);
}
.table-responsive.is-scrollable .table th.actions { background-color: var(--surface-2); }
.table-responsive:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.scroll-hint { display: none; align-items: center; gap: 6px; padding: 6px 20px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.scroll-hint.on { display: flex; }
/* Wide reports: the first column (who / when) stays put while the rest scrolls. */
.report-scroll.is-scrollable .report-table th:first-child, .report-scroll.is-scrollable .report-table td:first-child {
  position: sticky; left: 0; z-index: 1; background-color: var(--surface); box-shadow: 10px 0 10px -10px rgba(14, 26, 61, .2);
}
.report-scroll.is-scrollable .report-table thead th:first-child { background-color: var(--surface-2); }

/* Toolbar (search/filter row on top of a table card) */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar .grow { flex: 1 1 260px; min-width: 0; }
.toolbar .form-control, .toolbar .form-select { width: auto; }
.toolbar .grow .form-control { width: 100%; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; color: var(--muted); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.pager .btns { display: flex; gap: 6px; }
.pager button { display: inline-grid; place-items: center; width: 32px; height: 30px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }
.pager button:disabled { opacity: .4; }
.pager button:hover:not(:disabled) { background: var(--surface-3); }
.pager .btns { align-items: center; }
.pager a { display: inline-grid; place-items: center; width: 32px; height: 30px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); text-decoration: none; }
.pager a:hover { background: var(--surface-3); }

/* ---------- Lists ---------- */
.list-group { --bs-list-group-border-color: var(--line); --bs-list-group-color: var(--text); }
.list-group-item { border-color: var(--line); padding: 12px 20px; color: var(--text); background: transparent; }
.list-group-flush > .list-group-item:last-child { border-bottom-width: 0; }
.list-group-item-action:hover { background: var(--surface-2); }
.list-group-item-action.active { background: var(--navy-50); color: var(--ink); border-color: var(--line); box-shadow: inset 3px 0 0 var(--orange); }
.list-group-item-action.active .text-muted, .list-group-item-action.active .small { color: var(--text) !important; }
.kv { margin: 0; }
.kv .list-group-item, .kv-row { display: flex; gap: 16px; justify-content: space-between; align-items: baseline; font-size: 13.5px; padding: 10px 20px; }
.kv .list-group-item > .text-muted:first-child, .kv dt { flex: none; color: var(--muted); font-weight: 500; }
.kv .list-group-item > :last-child { text-align: right; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
/* A list row with a status chip and text (System → Health): long setting names wrap instead of widening the page at phone width (FQ-17). */
.list-group-item > .grow { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 575.98px) { #health .list-group-item { flex-wrap: wrap; } #health .chip { min-width: 0 !important; } }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; font-weight: 500; color: var(--muted); }
.facts dd { margin: 1px 0 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.row-list .ri { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.row-list .ri:last-child { border-bottom: 0; }
.row-list .ri .tm { flex: none; width: 48px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  --bs-btn-focus-box-shadow: var(--focus);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 600; font-size: 13.5px; border-radius: var(--r-sm); padding: 8px 14px; line-height: 1.25; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, filter .15s;
}
.btn:focus-visible { box-shadow: var(--focus); outline: none; }
.btn-sm { font-size: 12.5px; padding: 5px 10px; border-radius: var(--r-sm); gap: 5px; }
.btn-sm .ic { width: 15px; height: 15px; }
.btn-lg { font-size: 15.5px; padding: 12px 22px; border-radius: var(--r); gap: 9px; }
.btn-xl { font-size: 17px; padding: 15px 26px; border-radius: var(--r); gap: 10px; }
.btn-xl .ic { width: 22px; height: 22px; }
.btn-brand, .btn-primary { background: var(--navy); border: 1px solid var(--navy); color: #fff; }
.btn-brand:hover, .btn-brand:focus-visible, .btn-primary:hover, .btn-brand:active, .btn-primary:active { background: var(--navy-700) !important; border-color: var(--navy-700) !important; color: #fff !important; }
.btn-go { background: var(--ok); border: 1px solid var(--ok); color: #fff; }
.btn-go:hover, .btn-go:active, .btn-go:focus-visible { background: #11692F !important; border-color: #11692F !important; color: #fff !important; }
.btn-accent { background: var(--orange); border: 1px solid var(--orange); color: #1F1206; }
.btn-accent:hover, .btn-accent:active { background: #E86D18 !important; border-color: #E86D18 !important; color: #1F1206 !important; }
.btn-outline-secondary, .btn-light { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); }
.btn-outline-secondary:hover, .btn-outline-secondary:active, .btn-light:hover { background: var(--surface-3) !important; border-color: var(--line-strong) !important; color: var(--ink) !important; }
.btn-outline-danger { background: var(--surface); border: 1px solid var(--crit-line); color: var(--crit-ink); }
.btn-outline-danger:hover, .btn-outline-danger:active { background: var(--crit-bg) !important; border-color: var(--crit-line) !important; color: var(--crit-ink) !important; }
.btn-danger { background: var(--crit); border: 1px solid var(--crit); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); background: var(--crit); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-link { font-weight: 600; color: var(--low-ink); text-decoration: none; padding-left: 4px; padding-right: 4px; }
.btn-link:hover { color: var(--navy); text-decoration: underline; }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.btn-group > .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-group > .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.btn:disabled, .btn.disabled { opacity: .5; }

/* ---------- Forms ---------- */
.form-label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.form-label .req { color: var(--crit); margin-left: 2px; }
.form-label .opt { font-weight: 400; color: var(--muted); }
.form-control, .form-select {
  min-height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: 14px; padding: 8px 12px; color: var(--ink); background-color: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.form-select { padding-right: 34px; }
.form-control:hover, .form-select:hover { border-color: var(--subtle); }
.form-control:focus, .form-select:focus { border-color: var(--orange); box-shadow: var(--focus); outline: none; }
.form-control::placeholder { color: var(--subtle); }
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background: var(--surface-3); color: var(--muted); }
.form-control-sm, .form-select-sm { min-height: 34px; font-size: 13px; padding: 5px 10px; }
.form-select-sm { padding-right: 30px; }
.form-control-lg { min-height: 52px; font-size: 17px; padding: 12px 16px; border-radius: var(--r); }
.form-text { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.form-check-input { border-color: var(--line-strong); }
.form-check-input:checked { background-color: var(--navy); border-color: var(--navy); }
.form-check-input:focus { border-color: var(--orange); box-shadow: var(--focus); }
.form-check-label { color: var(--text); }
.input-group > .form-control, .input-group > .form-select { border-radius: var(--r-sm); }
.input-group > :not(:first-child) { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.input-group > :not(:last-child) { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-group-text { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }
.input-validation-error, .form-control.input-validation-error:focus { border-color: var(--crit) !important; background-color: #FFFAFA; }
.input-validation-error:focus { box-shadow: 0 0 0 3px rgba(209, 26, 42, .25) !important; }
.field-validation-error, .text-danger { color: var(--crit-ink) !important; font-size: 12.5px; font-weight: 500; }
.field-validation-error { display: block; margin-top: 4px; }
.validation-summary-valid { display: none !important; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.form-section + .form-section { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.form-section-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.form-section-title .ic { color: var(--muted); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; margin-top: 18px; padding: 14px 20px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 -4px 18px rgba(14, 26, 61, .06); }

/* Search + scan boxes */
.search-box { position: relative; }
.search-box > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.search-box > .form-control { padding-left: 38px; }
.scan {
  position: relative; display: flex; align-items: center; flex: 1 1 420px; min-width: 0;
}
.scan > .ic { position: absolute; left: 16px; color: var(--orange); width: 22px; height: 22px; pointer-events: none; }
.scan .form-control { min-height: 52px; padding-left: 50px; font-size: 15.5px; border-radius: var(--r); border-width: 1.5px; box-shadow: var(--shadow-sm); }
.scan kbd { position: absolute; right: 12px; font-family: var(--font); font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--muted); border-radius: var(--r-xs); padding: 3px 7px; pointer-events: none; }
input[type="date"].form-control { min-width: 9.5rem; }
.card-input { font-family: var(--mono); font-size: 20px !important; letter-spacing: .06em; min-height: 56px !important; border-width: 2px !important; border-color: var(--navy-700) !important; background: var(--surface) !important; }
.card-input:focus { border-color: var(--orange) !important; }
.card-field { padding: 16px; border-radius: var(--r); background: var(--navy-50); border: 1px solid #D6DCEC; }
.card-field .form-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }

/* ---------- Alerts / banners / toasts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--r); font-size: 13.5px; padding: 12px 16px; border: 1px solid; }
.alert > .ic { margin-top: 1px; }
.alert .grow { flex: 1 1 auto; min-width: 0; }
.alert-success { color: var(--ok-ink); background: var(--ok-bg); border-color: var(--ok-line); }
.alert-danger { color: var(--crit-ink); background: var(--crit-bg); border-color: var(--crit-line); }
.alert-warning { color: var(--med-ink); background: var(--med-bg); border-color: var(--med-line); }
.alert-info { color: var(--low-ink); background: var(--low-bg); border-color: var(--low-line); }
.alert a:not(.btn) { color: inherit; font-weight: 700; text-decoration: underline; }
.alert .btn { flex: none; align-self: center; }
.alert .btn-close { margin-left: auto; padding: 4px; position: static; }
.alert-dismissible { padding-right: 16px; }
.banner-black {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 18px;
  background: var(--crit); color: #fff; border-radius: var(--r-lg); box-shadow: 0 6px 20px rgba(209, 26, 42, .25);
}
.banner-black .ic { width: 34px; height: 34px; flex: none; }
.banner-black strong { display: block; font-family: var(--font-head); font-size: 20px; font-weight: 700; letter-spacing: .01em; }
.banner-black span { display: block; font-size: 14px; opacity: .95; }
.banner-trust { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 18px; border-radius: var(--r); background: var(--ok-bg); color: var(--ok-ink); border: 1px solid var(--ok-line); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 2500; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 32px)); }
.toast-i {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px 13px 16px; border-radius: var(--r);
  background: var(--navy); color: #fff; box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500;
  border-left: 4px solid var(--ok); animation: toast-in .18s ease-out;
}
.toast-i .ic { color: #5FD48D; margin-top: 1px; }
.toast-i.error { border-left-color: var(--crit); }
.toast-i.error .ic { color: #FF8A94; }
.toast-i .msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-i .x { flex: none; border: 0; background: transparent; color: rgba(255, 255, 255, .7); padding: 0 2px; line-height: 1; }
.toast-i .x:hover { color: #fff; }
.toast-i.out { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Empty states ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 36px 20px; color: var(--muted); }
.empty-state .ei { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 50%; background: var(--surface-3); color: var(--muted); }
.empty-state .ei .ic { width: 22px; height: 22px; }
.empty-state.ok .ei { background: var(--ok-bg); color: var(--ok); }
.empty-state strong { color: var(--ink); font-family: var(--font-head); font-size: 15px; font-weight: 600; }
.empty-state span { font-size: 13px; max-width: 46ch; }
.empty-state .btn { margin-top: 12px; }
.empty-state.compact { padding: 24px 16px; }
td.empty-cell { padding: 0 !important; }

/* ---------- Dashboard ---------- */
.desk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; }
.desk-bar .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.inside-actions .btn { min-width: 108px; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--ok-ink); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: live 2s ease-in-out infinite; }
@keyframes live { 0%, 100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, .45); } 50% { box-shadow: 0 0 0 5px rgba(21, 128, 61, 0); } }

/* ---------- Visit page ---------- */
.profile { display: flex; gap: 18px; align-items: flex-start; }
.profile .pinfo { min-width: 0; flex: 1; }
.profile h2 { font-size: 22px; margin: 0 0 2px; overflow-wrap: anywhere; }
.profile .co { color: var(--muted); font-size: 14px; }
.profile .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ref { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink); background: var(--surface-3); padding: 2px 8px; border-radius: var(--r-xs); letter-spacing: .03em; }
.step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.cam-box { position: relative; width: 100%; aspect-ratio: 4 / 3; background: var(--navy-deep); border-radius: var(--r); overflow: hidden; }
.cam-box video, .cam-box img { width: 100%; height: 100%; object-fit: cover; }
.cam-box .ph { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; color: rgba(255, 255, 255, .7); font-size: 13px; text-align: center; padding: 20px; }
.cam-box .ph .ic { width: 32px; height: 32px; color: rgba(255, 255, 255, .5); }
.cam-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; min-width: 110px; }
.checkout-panel { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.checkout-panel > form:first-child { max-width: 300px; }
.checkout-panel .sep { width: 1px; align-self: stretch; background: var(--line); }

/* Admin tiles */
.tile { display: flex; gap: 14px; align-items: flex-start; height: 100%; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); color: inherit; transition: border-color .15s, box-shadow .15s; }
.tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow); color: inherit; }
.tile .ki { flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy-700); }
.tile .t { font-family: var(--font-head); font-size: 16px; font-weight: 600; color: var(--ink); }
.tile .d { font-size: 13px; color: var(--muted); margin-top: 2px; }
.tile .go { margin-left: auto; color: var(--subtle); align-self: center; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form .form-control, .inline-form .form-select { width: auto; flex: 1 1 140px; }
.edit-rows .er { padding: 10px 20px; border-bottom: 1px solid var(--line); }
.edit-rows .er:last-child { border-bottom: 0; }
.edit-rows .er.new { background: var(--surface-2); }
.edit-rows .head { display: flex; gap: 8px; padding: 8px 20px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); white-space: nowrap; }
.secret { font-family: var(--mono); font-size: 13px; padding: 10px 12px; background: var(--surface); border: 1px dashed var(--med-line); border-radius: var(--r-sm); user-select: all; overflow-wrap: anywhere; }
.role-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.role-legend div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 12.5px; color: var(--muted); }
.role-legend b { display: block; color: var(--ink); font-size: 13px; }

/* ---------- Branding (System → Branding): a logo made for white backgrounds sits on a white plate on navy ---------- */
.logo-plate { display: inline-flex; align-items: center; justify-content: center; background: #fff; border-radius: 6px; padding: 4px 8px; }
.logo-plate img { display: block; }
.brand-preview { display: grid; gap: 16px; align-content: start; }
.brand-preview .bp { margin: 0; display: grid; gap: 6px; }
.brand-preview .bp-box { display: grid; place-items: center; min-height: 96px; padding: 18px; border-radius: var(--r); }
.brand-preview .bp-box.light { background: #fff; border: 1px solid var(--line); }
.brand-preview .bp-box.dark { background: var(--navy-deep); }
.brand-preview img { display: block; max-width: 100%; max-height: 60px; width: auto; height: auto; }
.brand-preview figcaption { font-size: 12.5px; color: var(--muted); }

/* ---------- Center message (error / denied) ---------- */
.center-msg { max-width: 460px; margin: 10vh auto; text-align: center; }
.center-msg .ei { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; background: var(--surface-3); color: var(--muted); }
.center-msg .ei.bad { background: var(--crit-bg); color: var(--crit); }
.center-msg h1, .center-msg h2 { font-size: 20px; margin-bottom: 6px; }

/* ---------- Sign-in ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(400px, .9fr); min-height: 100vh; background: var(--surface); }
.auth-art {
  position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 48px;
  background: var(--navy-deep) url("../img/lobby.jpg") center / cover no-repeat;
}
.auth-art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(10, 19, 48, .92) 0%, rgba(10, 19, 48, .55) 45%, rgba(10, 19, 48, .9) 100%); }
.auth-art > * { position: relative; }
.auth-art .lockup { width: 230px; height: auto; display: block; }
.auth-art .lockup.custom { width: auto; max-width: 280px; max-height: 72px; }
.auth-art .art-title { font-family: var(--font-head); color: #fff; font-size: 38px; line-height: 1.12; font-weight: 600; letter-spacing: -.01em; max-width: 15ch; margin: 0; }
.auth-art .art-title em { font-style: normal; color: var(--orange); }
.auth-art p { color: rgba(255, 255, 255, .78); margin: 14px 0 0; max-width: 46ch; font-size: 15px; }
.auth-art ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; color: rgba(255, 255, 255, .86); font-size: 14px; }
.auth-art li { display: flex; gap: 10px; align-items: center; }
.auth-art li .ic { color: var(--orange); }
.auth-art small { color: rgba(255, 255, 255, .72); font-size: 12.5px; }
.auth-form { display: flex; flex-direction: column; padding: 36px 48px; background: var(--surface); }
.auth-form .inner { width: 100%; max-width: 380px; margin: auto; }
.auth-form .prod { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-form .prod img { width: 52px; height: auto; }
.auth-form .prod .t { font-family: var(--font-head); font-size: 22px; font-weight: 600; color: var(--ink); line-height: 1.1; }
.auth-form .prod .s { font-size: 12.5px; color: var(--muted); }
.auth-form h1 { font-size: 26px; margin: 0 0 6px; }
.auth-form .lead { color: var(--muted); font-size: 14.5px; margin-bottom: 26px; }
.auth-form .mobile-logo { display: none; width: 180px; margin-bottom: 24px; }
.auth-form .mobile-logo.custom { width: auto; max-width: 220px; max-height: 64px; }
.auth-form .foot { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 70px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--low-ink); font-size: 12.5px; font-weight: 600; padding: 4px 8px; border-radius: var(--r-xs); }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
  .tb .clock .d, .tb .user-chip .nm { display: none; }
}
@media (max-width: 991.98px) {
  :root { --pad: 16px; }
  .sb { transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
  body.sb-open .sb { transform: none; box-shadow: var(--shadow-lg); }
  body.sb-open .sb-scrim { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(6, 12, 32, .5); }
  body.sb-open { overflow: hidden; }
  .tb { left: 0; gap: 10px; }
  .tb-toggle { display: inline-grid; }
  .tb-sub { display: none; }
  .ct { margin-left: 0; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-form { padding: 28px 20px; }
  .auth-form .mobile-logo { display: block; }
  .checkout-panel > form:first-child { max-width: 300px; }
.checkout-panel .sep { display: none; }
}
/* List tables fit the room their card has — not the window, since the sidebar takes 248 px on laptops: less important
   columns give way (.hide-lg first, then .hide-md) and cells tighten, so the row and its buttons stay on screen. */
.card:has(> .table-responsive) { container-type: inline-size; }
@container (max-width: 1100px) { .table .hide-lg { display: none !important; } }
@container (max-width: 960px) {
  .table .hide-md { display: none !important; }
  .pool-card { flex-wrap: wrap !important; row-gap: 2px !important; }
  .pool-desk { min-width: 0 !important; width: 8.5rem; }
  .table > :not(caption) > * > * { padding-left: 10px; padding-right: 10px; }
  .table td:first-child, .table th:first-child { padding-left: 16px; }
  .table td:last-child, .table th:last-child { padding-right: 16px; }
  /* A "Blacklisted" / "Trusted" chip goes under the name instead of beside it. */
  .table .who:has(> .chip) { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center; column-gap: 12px; row-gap: 4px; }
  .table .who:has(> .chip) > .chip { grid-column: 2; justify-self: start; }
}
/* Shown only on phones (see .hide-sm); must come before the media rule below. */
.show-sm { display: none !important; }
.nowrap { white-space: nowrap; }
.places-list { display: inline-block; max-width: 16rem; }
@media (max-width: 767.98px) {
  .tb .chip-pill { display: none; }
  .tb-h { font-size: 17px; }
  .facts { grid-template-columns: 1fr; }
  .profile { flex-direction: column; }
  .kpi .v { font-size: 24px; }
  .hide-sm { display: none !important; }
  .show-sm { display: block !important; }
  .who .sub.show-sm { white-space: normal; } /* phone-only detail lines wrap instead of pushing the buttons off */
  /* Icon-only buttons on phones keep their words for screen readers: hidden from view, not from the accessibility tree. */
  .btn .hide-sm {
    display: inline !important; position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
    margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
  }
}
@media (max-width: 575.98px) {
  .tb .clock { display: none; }
  .desk-bar .acts { width: 100%; }
  .desk-bar .acts .btn { flex: 1 1 auto; }
  .table > :not(caption) > * > * { padding: 10px 8px; }
  .table td:first-child, .table th:first-child { padding-left: 14px; }
  .table td:last-child, .table th:last-child { padding-right: 14px; }
  .pool-card .pool-label { width: 6.5rem !important; }
}

.pool-label { width: 7.5rem !important; flex: none; font-weight: 600; }

/* Desk check-out: confirm the visitor card came back. */
.card-return { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); cursor: pointer; }
.card-return .form-check-input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; }
.card-return b { display: block; color: var(--ink); }
.card-return small { display: block; color: var(--muted); font-size: 12px; }
.card-return:has(input:not(:checked)) { border-color: var(--crit-line); background: var(--crit-bg); }

@media print {
  .sb, .tb, .toasts, .sb-scrim, .d-print-none { display: none !important; }
  .ct { margin: 0; padding: 0; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; }
  /* Reports on paper: every column (a scrolling box would clip all but the first few), text wrapped, small type, the
     column names repeated on each page, no row split across pages (scale finding SU-06: the evacuation sheet lost Host,
     Phone, Card, Last seen and Accounted). */
  .table-responsive, .report-scroll { overflow: visible !important; max-height: none !important; box-shadow: none !important; }
  .report-table { font-size: 8pt; width: 100% !important; table-layout: auto; }
  .report-table th, .report-table td { white-space: normal !important; word-break: break-word; padding: 2px 4px !important; position: static !important; }
  .report-table thead { display: table-header-group; }
  .report-table tr { break-inside: avoid; }
  .report-letterhead { margin-bottom: 6mm; color: #000; }
  .report-letterhead .org { font-weight: 600; }
  .report-letterhead h1 { font-size: 15pt; margin: 1mm 0; }
}
