/* ============================================================================
   fos-shell.css — shell glue for the hierarchical navigation & breadcrumb.
   Component structure/tokens live in facilityos-tokens.css §9; this file only
   (a) remaps ink/surface tokens inside the dark chrome surfaces, and
   (b) adds shell-specific layout. Every value is a token reference.
   ============================================================================ */

/* ---- Sidebar tree on dark chrome ------------------------------------------ */
#moduleNavigation {
  --c-text:      var(--c-chrome-text);
  --c-text-2:    var(--c-chrome-text-2);
  --c-text-3:    var(--c-chrome-text-2);
  --c-text-4:    var(--c-chrome-text-2);
  --c-border:    var(--c-chrome-border);
  --c-surface-3: var(--c-chrome);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: calc(var(--space-2) * var(--density-space));
  overflow-y: auto;
}

#moduleNavigation .fos-nav-filter {
  width: 100%;
  height: var(--density-control);
  padding: 0 calc(var(--space-3) * var(--density-space));
  margin-bottom: calc(var(--space-2) * var(--density-space));
  font-family: var(--font-sans);
  font-size: calc(var(--type-sm) * var(--density-type));
  color: var(--c-chrome-text);
  background: var(--c-chrome);
  border: 1px solid var(--c-chrome-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
#moduleNavigation .fos-nav-filter:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-weak);
}

/* ---- Typographic depth scale (§7.5 — checklist item 5) ---------------------
   Depth must be visually apparent at a glance: root anchors semibold/primary,
   groups medium/secondary, leaves+subtabs normal/muted. */
.fos-nav-node[data-depth="0"] > .fos-nav-node__label {
  font-weight: var(--weight-semibold);
  color: var(--c-text);
  font-size: calc(var(--type-base) * var(--density-type));
}
.fos-nav-node[data-depth="1"] > .fos-nav-node__label {
  font-weight: var(--weight-medium);
  color: var(--c-text-2);
  font-size: calc(var(--type-sm) * var(--density-type));
}
.fos-nav-node[data-depth="2"] > .fos-nav-node__label,
.fos-nav-node[data-depth="3"] > .fos-nav-node__label {
  font-weight: var(--weight-normal);
  color: var(--c-text-3);
  font-size: calc(var(--type-sm) * var(--density-type));
}
/* Active state re-asserts accent over the depth colour, at any depth */
.fos-nav-node--active > .fos-nav-node__label { color: var(--c-accent); }

/* Filter states — §7.3: highlight matches, keep hierarchy visible as context */
.fos-nav-node--filter-hit  > .fos-nav-node__label { color: var(--c-accent); font-weight: var(--weight-semibold); }
.fos-nav-node--filter-miss > .fos-nav-node__label { opacity: 0.45; }

/* ---- Sub-tab rows & count badges ------------------------------------------ */
.fos-nav-node--subtab { min-height: calc(var(--density-control) * 0.75); }
.fos-nav-badge {
  flex-shrink: 0;
  padding: 0 calc(var(--space-2) * var(--density-space));
  font-size: calc(var(--type-xs) * var(--density-type));
  font-weight: var(--weight-medium);
  color: var(--c-chrome-text-2);
  background: var(--c-chrome);
  border: 1px solid var(--c-chrome-border);
  border-radius: var(--radius-full);
}
.fos-nav-badge.warning { color: var(--c-warning); border-color: var(--c-warning); }

/* ---- Topbar middle track ----------------------------------------------------
   The topbar carries brand, mega-tabs and actions only. Page identity
   (breadcrumb + title + subtitle) lives in the page zone per the three-zone
   model, so the fixed-height topbar band can never be overflowed by three
   stacked lines of text. */
.topbar-context { display: flex; flex-direction: row; align-items: center; gap: calc(var(--space-2) * var(--density-space)); min-width: 0; white-space: nowrap; }

/* ---- Page zone header (zone 1) ---------------------------------------------
   Breadcrumb, then title + subtitle beside the page-level actions. */
.fos-content-header {
  padding-bottom: calc(var(--space-4) * var(--density-space));
}
.fos-content-header .fos-breadcrumb[hidden] { display: none; }
.fos-content-header__toolbar { flex-wrap: wrap; align-items: flex-start; }
.fos-content-header__actions {
  display: flex;
  align-items: center;
  gap: calc(var(--space-2) * var(--density-space));
  flex-shrink: 0;
}
.fos-content-header #pageSubtitle { color: var(--c-text-2); }

/* Logsheet-structure variant of the checklist builder button. Replaces the legacy
   "teal-button", which had no CSS definition at all. */
.fos-btn--teal {
  border-color: var(--c-info);
  color: var(--c-info);
}
.fos-btn--teal:hover { background: var(--c-surface-2); }

/* Card-level actions are ALWAYS visible. Hover-reveal (.fos-row-actions) is for
   dense table rows; on a card it made Configure / Disable / Hard delete / Purge
   unreachable, because the card is an <article> and never matched the
   tr:hover / .fos-row:hover selectors that reveal them. */
.fos-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--space-2) * var(--density-space));
  margin-top: calc(var(--space-3) * var(--density-space));
}

/* ── Shared record-table parts ─────────────────────────────────────────────
   These are emitted by recordsTable() on EVERY screen and had no definitions, so
   they inherited nothing: action buttons sat flush together, the filter input had
   no field styling, and the mobile card list had no spacing. Structural classes
   with no rules do not fail a probe — they just look wrong to a person. */
.records-view { display: flex; flex-direction: column; gap: calc(var(--space-3) * var(--density-space)); }
.table-actions {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: calc(var(--space-2) * var(--density-space));
}
.table-search {
  width: 100%;
  padding: calc(var(--space-2) * var(--density-space)) calc(var(--space-3) * var(--density-space));
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: calc(var(--type-sm) * var(--density-type));
}
.table-search:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 1px; }
.fos-table { width: 100%; border-collapse: collapse; border-spacing: 0; }
.fos-table th {
  background: var(--c-surface-2);
  color: var(--c-text-3);
  font-size: calc(var(--type-xs) * var(--density-type));
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  padding: calc(var(--space-3) * var(--density-space)) calc(var(--space-4) * var(--density-space));
  border-bottom: 1px solid var(--c-border);
  border-radius: 0 !important;
  text-align: left;
}
.fos-table th.sortable { cursor: pointer; user-select: none; }
.fos-table th.sortable:hover { color: var(--c-text); background: var(--c-surface-3); }
.skeleton-table { width: 100%; border-collapse: collapse; }
.skeleton-table th, .skeleton-table td {
  padding: calc(var(--space-3) * var(--density-space));
  border-bottom: 1px solid var(--c-border);
}

/* Work-card status line. Had NO css definition at all, so the status pill and the
   work-type label rendered flush against each other and read as one word
   ("Scheduledppm"). Adjacent labels need a real gap, not an inline-block accident. */
.work-card-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: calc(var(--space-2) * var(--density-space));
}

/* In-screen tabs. These belong in the content zone: they are page state, not
   information architecture, and mirroring them into the sidebar tree invented a
   fourth navigation level. */
.fos-tabs {
  display: flex;
  align-items: center;
  gap: calc(var(--space-1) * var(--density-space));
  flex-wrap: wrap;
  border-bottom: 1px solid var(--c-border);
  padding-bottom: var(--space-0);
  margin-bottom: calc(var(--space-4) * var(--density-space));
}
.fos-tab {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--space-2) * var(--density-space));
  padding: calc(var(--space-2) * var(--density-space)) calc(var(--space-3) * var(--density-space));
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) var(--space-0) var(--space-0);
  background: transparent;
  color: var(--c-text-2);
  font-family: var(--font-sans);
  font-size: calc(var(--type-sm) * var(--density-type));
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.fos-tab:hover { color: var(--c-text); background: var(--c-surface-2); }
.fos-tab--active {
  color: var(--c-text);
  border-bottom-color: var(--c-accent);
  font-weight: var(--weight-semibold);
}
.fos-tab .tab-badge,
.fos-tab .fos-nav-badge {
  font-size: calc(var(--type-xs) * var(--density-type));
  padding: 0 calc(var(--space-2) * var(--density-space));
  border-radius: var(--radius-full);
  background: var(--c-surface-2);
  color: var(--c-text-2);
}
.fos-tab--active .tab-badge { background: var(--c-accent); color: var(--c-accent-text); }

/* Wide records tables scroll inside their own container. Never clip: a hidden
   overflow makes the right-hand columns unreachable, which is data loss, not a
   cosmetic crop. */
.fos-table-scroll {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

/* Read-only explanatory note inside a form (openForm type "readonly_note").
   Used for the effective-access summary the enterprise-framework flow requires
   before an admin saves a scope grant. */
.form-readonly-note {
  display: flex;
  gap: calc(var(--space-2) * var(--density-space));
  align-items: flex-start;
  padding: calc(var(--space-3) * var(--density-space));
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface-2);
  color: var(--c-text-2);
  font-size: calc(var(--type-sm) * var(--density-type));
  line-height: var(--leading-normal);
}
.form-readonly-note i { color: var(--c-accent); flex-shrink: 0; }

/* Screen-level action cluster. The screens own their actions; page identity is
   never repeated here (that duplicated every title). Collapses when empty. */
.page-actions-bar {
  display: flex;
  justify-content: flex-end;
  padding-bottom: calc(var(--space-3) * var(--density-space));
}
.page-actions-bar:empty,
.page-actions-bar .page-actions:empty { display: none; }
.page-actions-bar .page-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: calc(var(--space-2) * var(--density-space));
}

/* ---- Content zones (light canvas) ------------------------------------------
   KPI cards, disclosure groups, table hover-actions for rebuilt screens.
   Zone containers (fos-metric-grid, fos-card, fos-table, fos-empty,
   fos-skeleton, fos-status) come from facilityos-tokens.css §8–§10.
   Note: .fos-card carries no padding by design (padding belongs to
   __header/__body or the composing component) — .fos-kpi supplies its own. */
.fos-kpi { padding: calc(var(--space-5) * var(--density-space)); }
.fos-kpi__value {
  font-size: calc(var(--type-2xl) * var(--density-type));
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-tight);
}
.fos-kpi__label {
  font-size: calc(var(--type-xs) * var(--density-type));
  font-weight: var(--weight-medium);
  color: var(--c-text-3);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
.fos-kpi__note {
  font-size: calc(var(--type-sm) * var(--density-type));
  color: var(--c-text-2);
}
.fos-kpi--alert .fos-kpi__value { color: var(--c-danger); }
.fos-kpi--warn  .fos-kpi__value { color: var(--c-warning); }
.fos-kpi--ok    .fos-kpi__value { color: var(--c-success); }

/* Disclosure group — same max-height physics as the nav accordion (§7.3) */
.fos-group {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-1);
}
.fos-group__toggle {
  display: flex; align-items: center; width: 100%;
  gap: calc(var(--space-3) * var(--density-space));
  padding: calc(var(--space-4) * var(--density-space)) calc(var(--space-5) * var(--density-space));
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: var(--font-sans);
}
.fos-group__title {
  flex: 1;
  font-size: calc(var(--type-md) * var(--density-type));
  font-weight: var(--weight-semibold);
  color: var(--c-text);
}
.fos-group__subtitle {
  display: block;
  font-size: calc(var(--type-sm) * var(--density-type));
  font-weight: var(--weight-normal);
  color: var(--c-text-3);
}
.fos-group__chevron {
  color: var(--c-text-3);
  transition: transform var(--nav-transition-dur) var(--ease-fluid);
}
.fos-group--open > .fos-group__toggle .fos-group__chevron { transform: rotate(90deg); color: var(--c-accent); }
.fos-group__body {
  max-height: 0; overflow: hidden; opacity: 0;
  transform: scaleY(0.98); transform-origin: top center;
  transition:
    max-height var(--nav-transition-dur) var(--ease-fluid),
    opacity    var(--nav-transition-dur) var(--ease-fluid),
    transform  var(--nav-transition-dur) var(--ease-fluid);
}
.fos-group--open > .fos-group__body {
  max-height: 4000px; opacity: 1; transform: scaleY(1);
  overflow: visible;
}
.fos-group__content { padding: 0 calc(var(--space-5) * var(--density-space)) calc(var(--space-5) * var(--density-space)); }
.fos-group__actions { display: flex; gap: calc(var(--space-2) * var(--density-space)); }

/* Hover-only tertiary row actions (§7.6 item 16) */
.fos-row-actions {
  display: flex; justify-content: flex-end;
  gap: calc(var(--space-2) * var(--density-space));
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
tr:hover .fos-row-actions,
.fos-row:hover .fos-row-actions,
tr:focus-within .fos-row-actions,
.fos-row:focus-within .fos-row-actions { opacity: 1; }

/* Simple list rows inside groups */
.fos-row {
  display: flex; align-items: center;
  gap: calc(var(--space-3) * var(--density-space));
  padding: calc(var(--space-2) * var(--density-space)) 0;
  border-bottom: 1px solid var(--c-border);
  font-size: calc(var(--type-base) * var(--density-type));
}
.fos-row:last-child { border-bottom: none; }
.fos-row__main { flex: 1; min-width: 0; }
.fos-row__title { font-weight: var(--weight-medium); color: var(--c-text); }
.fos-row__meta {
  font-size: calc(var(--type-sm) * var(--density-type));
  color: var(--c-text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Content clears the floating dock — the last rows must scroll above it */
.app-main #pageContent { padding-bottom: calc(var(--density-control) * 2.5); }

/* Narrow topbar: the centred search pill collides with the context block —
   the page header inside the content already carries title+subtitle, so the
   topbar copy adds nothing below this width. */
@media (max-width: 1080px) {
  .topbar-context { display: none; }
}

/* Closed dialogs must not paint. styles.css converts every <dialog> into a
   right-side drawer with display:flex !important + translateX(100%) even when
   CLOSED — leaving ghost panels off-canvas (document-level horizontal
   overflow, visible at mobile widths; owner-caught). @starting-style keeps
   the slide-in animation without painting closed dialogs. */
dialog:not([open]) { display: none !important; }
dialog[open] { @starting-style { transform: translateX(100%); } }
/* Belt and braces: off-canvas patterns require the document to clip. */
html, body { overflow-x: clip; }

/* Hover-reveal action groups on management cards (framework enterprise queue,
   etc.) — at rest the card shows identity + status only; destructive actions
   (disable / hard-delete / purge) stay hidden until intentional hover. */
.platform-enterprise-card { position: relative; }
.platform-enterprise-card:hover .fos-row-actions,
.platform-enterprise-card:focus-within .fos-row-actions { opacity: 1; }

/* Legacy .status-pill → the design default: a quiet dot + text, no pill
   chrome (DESIGN_LANGUAGE §2.3). Converts all direct .status-pill usages
   that bypass statusPill() without touching 40 call sites. The ::before dot
   and per-status colour are kept; the saturated pill background is removed. */
.status-pill {
  background: transparent !important; /* beats the per-status .status-pill.x two-class rules */
  border-color: transparent !important;
  padding: 0;
  min-height: 0;
  font-weight: var(--weight-medium);
}

/* ── 52-week PPM plan ──────────────────────────────────────────────────────
   Rows are assets, columns are ISO weeks. The grid is wide by nature, so it
   scrolls inside its own container and the asset column stays pinned — a week
   number means nothing once the asset name has scrolled out of view. */
.ppm-matrix-scroll {
  overflow-x: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
}
.ppm-matrix {
  border-collapse: separate;
  border-spacing: 0;
  font-size: calc(var(--type-xs) * var(--density-type));
}
.ppm-matrix th,
.ppm-matrix td {
  padding: var(--space-1);
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid var(--c-border-2);
}
.ppm-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--c-surface-2);
  color: var(--c-text-3);
  font-weight: var(--weight-medium);
}
.ppm-matrix .ppm-matrix__asset {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--c-surface);
  text-align: left;
  padding-inline: var(--space-3);
  min-width: 13rem;
}
.ppm-matrix thead .ppm-matrix__asset { z-index: 4; background: var(--c-surface-2); }
.ppm-matrix__meta {
  display: block;
  color: var(--c-text-3);
}
/* One state per week cell. Colour is never the only signal — each state also
   renders a distinct glyph, so the grid survives colour-blindness and print. */
.ppm-week {
  width: 1.6rem;
  height: 1.6rem;
  line-height: 1.6rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  color: var(--c-text-3);
  /* A week with no PPM due is the common case — ~300 of ~320 cells. Giving it a filled chip would
     bury the handful of cells that matter under a wall of circles, so nothing is drawn at all and
     the eye lands straight on a miss. */
  background: transparent;
}
.ppm-week--completed { background: var(--c-success-weak); color: var(--c-success); }
.ppm-week--missed    { background: var(--c-danger-weak);  color: var(--c-danger); }
.ppm-week--scheduled,
.ppm-week--assigned  { background: var(--c-accent-weak);  color: var(--c-accent); }
.ppm-week--in_progress,
.ppm-week--awaiting_approval { background: var(--c-warning-weak); color: var(--c-warning); }
.ppm-week--blocked   { background: var(--c-danger-weak); color: var(--c-danger); }
.ppm-week--cancelled { opacity: 0.5; }
.ppm-matrix__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-3);
  color: var(--c-text-3);
  font-size: calc(var(--type-xs) * var(--density-type));
}

/* ============================================================================
   SHELL COMPLETION (2026-07-21) — app-shell grid, sidebar, user-menu, brand,
   connection-state, mega-menu, dock. Rebuilt from scratch on tokens to purge
   the legacy equivalents from styles.css. Tokens only; no !important.
   ============================================================================ */
:root {
  --shell-topbar-h: 56px;
  --shell-sidebar-w: 288px;
  --shell-z-topbar: 40; --shell-z-sidebar: 30; --shell-z-dropdown: 60; --shell-z-dock: 50;
}
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid;
  /* The sidebar element's own width is driven by --sidebar-w (the drag-resizer
     writes it). The track MUST resolve from the same variable, or the sidebar
     overflows its track and covers the first pixels of every page title. */
  grid-template-columns: var(--sidebar-w, var(--shell-sidebar-w)) minmax(0, 1fr);
  grid-template-rows: var(--shell-topbar-h) minmax(0, 1fr);
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}
.brand-lockup { display: inline-flex; align-items: center; gap: calc(var(--space-2) * var(--density-space)); text-decoration: none; color: var(--c-text); }
.brand-lockup strong { font-size: calc(var(--type-md) * var(--density-type)); font-weight: var(--weight-semibold); letter-spacing: var(--track-tight); }
.brand-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; }
.enterprise-logo { max-height: 24px; }
.topbar-mega-tabs { display: flex; align-items: center; gap: var(--space-1); flex: 0 0 auto; margin-left: var(--space-2); }
.mega-tab { border: none; background: transparent; cursor: pointer; padding: calc(var(--space-1) * var(--density-space)) calc(var(--space-2) * var(--density-space)); border-radius: var(--radius-sm); font-size: calc(var(--type-sm) * var(--density-type)); font-weight: var(--weight-medium); color: var(--c-text-2); white-space: nowrap; flex-shrink: 0; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.mega-tab:hover { background: var(--c-surface-2); color: var(--c-text); }
.mega-tab.active { background: var(--c-accent-weak); color: var(--c-accent); }
.connection-state { display: inline-flex; align-items: center; gap: var(--space-1); min-height: calc(var(--density-control) - 4px); padding: var(--space-0) calc(var(--space-3) * var(--density-space)); border: 1px solid var(--c-border); background: var(--c-surface-2); color: var(--c-text-2); border-radius: var(--radius-full); font-size: calc(var(--type-xs) * var(--density-type)); font-weight: var(--weight-semibold); }
.icon-button, .notification-button { display: inline-grid; place-items: center; width: var(--density-control); height: var(--density-control); border: 1px solid var(--c-border); border-radius: var(--radius-md); background: var(--c-surface); color: var(--c-text-2); cursor: pointer; position: relative; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.icon-button:hover, .notification-button:hover { background: var(--c-surface-2); color: var(--c-text); }
.notification-button > span { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: var(--radius-full); display: grid; place-items: center; background: var(--c-accent); color: var(--c-accent-text); font-size: 10px; font-weight: var(--weight-bold); }
.user-menu { position: relative; }
.user-button { display: inline-flex; align-items: center; gap: calc(var(--space-2) * var(--density-space)); min-height: var(--density-control); border: 1px solid var(--c-border); border-radius: var(--radius-md); background: var(--c-surface); color: var(--c-text); cursor: pointer; padding: var(--space-1) calc(var(--space-2) * var(--density-space)) var(--space-1) var(--space-1); }
.user-button:hover { background: var(--c-surface-2); }
#userInitials { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--radius-sm); background: var(--c-accent); color: var(--c-accent-text); font-size: calc(var(--type-xs) * var(--density-type)); font-weight: var(--weight-bold); }
.user-button .desktop-only { display: flex; flex-direction: column; text-align: left; line-height: 1.2; justify-content: center; }
.user-button strong { font-size: calc(var(--type-sm) * var(--density-type)); font-weight: var(--weight-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-button small { font-size: calc(var(--type-xs) * var(--density-type)); color: var(--c-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-dropdown { position: absolute; right: 0; top: calc(100% + var(--space-2)); width: 280px; max-height: calc(100vh - 72px); overflow-y: auto; overscroll-behavior: contain; padding: calc(var(--space-2) * var(--density-space)); border: 1px solid var(--c-border); border-radius: var(--radius-md); background: var(--c-surface); box-shadow: var(--elev-1); z-index: var(--shell-z-dropdown); }
.user-dropdown-scope-card { display: flex; flex-direction: column; gap: calc(var(--space-2) * var(--density-space)); padding: calc(var(--space-2) * var(--density-space)); background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius-md); margin-top: var(--space-1); }
.scope-fact { display: flex; flex-direction: column; gap: var(--space-1); }
.scope-fact small { font-size: calc(var(--type-xs) * var(--density-type)); text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-text-3); font-weight: var(--weight-semibold); }
.scope-inline-select { display: flex; flex-direction: column; gap: 2px; max-height: 120px; overflow-y: auto; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 2px; }
.scope-inline-opt { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 4px 8px; border: none; background: transparent; color: var(--c-text-2); font-size: calc(var(--type-xs) * var(--density-type)); border-radius: var(--radius-sm); cursor: pointer; text-align: left; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.scope-inline-opt:hover { background: var(--c-surface-2); color: var(--c-text); }
.scope-inline-opt.selected { background: var(--c-accent-weak); color: var(--c-accent); font-weight: var(--weight-semibold); }
.topbar-scope-pill { display: inline-flex; align-items: center; gap: var(--space-1); padding: calc(var(--space-1) * var(--density-space)) calc(var(--space-2) * var(--density-space)); border: 1px solid var(--c-border); border-radius: var(--radius-full); background: var(--c-surface-2); color: var(--c-text); font-size: calc(var(--type-xs) * var(--density-type)); font-weight: var(--weight-medium); cursor: pointer; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.topbar-scope-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-scope-pill:hover { background: var(--c-surface-3); border-color: var(--c-accent); }
.topbar-scope-pill.active { background: var(--c-accent-weak); color: var(--c-accent); border-color: var(--c-accent); }
.scope-popover { position: fixed; z-index: 10050; background: var(--c-surface-1, #161722) !important; opacity: 1 !important; border: 1px solid var(--c-border-strong, rgba(255, 255, 255, 0.25)); border-radius: var(--radius-md); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85); padding: var(--space-1); min-width: 240px; max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.scope-popover-item { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: var(--space-2) var(--space-3); border: none; background: var(--c-surface-2); color: var(--c-text); font-size: calc(var(--type-xs) * var(--density-type)); border-radius: var(--radius-sm); cursor: pointer; text-align: left; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); opacity: 1; }
.scope-popover-item:hover { background: var(--c-surface-3); color: var(--c-text); }
.scope-popover-item.selected { background: var(--c-accent-weak); color: var(--c-accent); font-weight: var(--weight-semibold); }
.dropdown-item { width: 100%; justify-content: flex-start; margin-top: var(--space-1); text-decoration: none; }
#userDropdownThemeToggle { padding: var(--space-1) var(--space-2); }
#csvDialogContent { min-height: 160px; font-family: var(--font-mono); font-size: calc(var(--type-xs) * var(--density-type)); }
/* The sidebar is a DUAL RAIL: a fixed icon rail beside a scrolling nav panel — a
   row, not a column. This rule previously said column and only lost the cascade
   because styles.css carried !important; once those were removed it started
   winning, which stacked the rail ABOVE the panel. Since .sidebar-primary is
   height:100%, the rail then consumed the entire sidebar and squeezed the whole
   navigation tree into 24px pinned to the bottom — the nav effectively vanished
   at 1360x900. Stated correctly here so the design layer owns the layout. */
.app-sidebar { grid-row: 2; min-height: 0; display: flex; flex-direction: row; border-right: 1px solid var(--c-border); background: var(--c-surface); position: relative; }
.sidebar-primary { display: flex; flex-direction: column; }
.sidebar-primary-hubs { display: flex; flex-direction: column; align-items: center; gap: calc(var(--space-2) * var(--density-space)); padding: calc(var(--space-3) * var(--density-space)) var(--space-0); }
.sidebar-secondary { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-1); padding: calc(var(--space-3) * var(--density-space)) calc(var(--space-2) * var(--density-space)); }
#moduleNavigation { display: flex; flex-direction: column; gap: var(--space-1); }
.sidebar-logout { display: flex; align-items: center; gap: calc(var(--space-2) * var(--density-space)); margin: calc(var(--space-2) * var(--density-space)); padding: calc(var(--space-2) * var(--density-space)) calc(var(--space-3) * var(--density-space)); border: 1px solid var(--c-border); border-radius: var(--radius-md); background: var(--c-surface); color: var(--c-text-2); cursor: pointer; font-size: calc(var(--type-sm) * var(--density-type)); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.sidebar-logout:hover { background: var(--c-surface-2); color: var(--c-text); }
.sidebar-pwa-install { display: flex; align-items: center; gap: calc(var(--space-2) * var(--density-space)); margin: calc(var(--space-2) * var(--density-space)); padding: calc(var(--space-2) * var(--density-space)) calc(var(--space-3) * var(--density-space)); border: 1px solid var(--c-accent-weak); border-radius: var(--radius-md); background: var(--c-surface); color: var(--c-accent); cursor: pointer; font-size: calc(var(--type-sm) * var(--density-type)); font-weight: var(--weight-semibold); transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.sidebar-pwa-install:hover { background: var(--c-accent-weak); }
.sidebar-pwa-install[hidden] { display: none !important; }

/* ─── PWA Install Guide Modal ─────────────────────────────────────────────── */
.pwa-install-card { max-width: 500px; width: 92vw; }
.pwa-guide-lead { margin-bottom: calc(var(--space-3) * var(--density-space)); }
.pwa-guide-lead p { font-size: calc(var(--type-sm) * var(--density-type)); color: var(--c-text-2); margin-top: calc(var(--space-2) * var(--density-space)); line-height: 1.55; }
.pwa-badge { display: inline-flex; align-items: center; gap: calc(var(--space-1) * var(--density-space)); padding: calc(var(--space-1) * var(--density-space)) calc(var(--space-2) * var(--density-space)); background: var(--c-accent-weak); color: var(--c-accent); border-radius: var(--radius-sm); font-size: calc(var(--type-xs) * var(--density-type)); font-weight: var(--weight-bold); }
.pwa-steps { list-style: none; padding: var(--space-0); margin: calc(var(--space-3) * var(--density-space)) var(--space-0); display: flex; flex-direction: column; gap: calc(var(--space-2) * var(--density-space)); }
.pwa-steps li { display: flex; align-items: flex-start; gap: calc(var(--space-3) * var(--density-space)); padding: calc(var(--space-3) * var(--density-space)); background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius-md); font-size: calc(var(--type-sm) * var(--density-type)); color: var(--c-text-2); line-height: 1.5; }
.pwa-steps li strong { color: var(--c-text); }
.pwa-steps li i { font-size: calc(var(--type-base) * var(--density-type)); vertical-align: middle; color: var(--c-accent); }
.step-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: var(--radius-full); background: var(--c-accent); color: var(--c-surface); font-size: calc(var(--type-xs) * var(--density-type)); font-weight: var(--weight-bold); flex-shrink: 0; }
.sidebar-resizer { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; z-index: 1; }
.sidebar-backdrop { display: none; }
.app-main { grid-row: 2; min-height: 0; min-width: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(var(--space-6) * var(--density-space)); }
.topbar-mega-tabs,
.mega-dropdown-panel,
.mega-dropdown-arrow,
.aether-dock,
.aether-dock-wrapper,
.ambient-glow {
  display: none !important;
}

.app-shell:has(.app-sidebar.collapsed),
.app-shell:has(#sidebar.collapsed) {
  grid-template-columns: 64px minmax(0, 1fr);
}
.app-sidebar.collapsed {
  width: 64px;
}
.app-sidebar.collapsed .sidebar-secondary {
  display: none !important;
}
.fos-nav-node__label {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: normal !important;
}

.mobile-only {
  display: none !important;
}
#menuButton {
  display: none !important;
}

@media (min-width: 1024px) {
  .radial-menu-wrapper,
  #radialMenuWrapper,
  .radial-trigger-btn,
  .radial-item,
  #pwaRefreshBanner,
  .pwa-refresh-banner {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

@media (max-width: 1300px) {
  #btnShowCommandPalette kbd { display: none !important; }
  .user-button .desktop-only { display: none !important; }
  .connection-state span { display: none !important; }
  .topbar-actions { gap: var(--space-1) !important; }
  .topbar-mega-tabs { gap: var(--space-0); }
  .mega-tab { padding: calc(var(--space-1) * var(--density-space)) calc(var(--space-2) * var(--density-space)); }
}

@media (max-width: 1100px) {
  .topbar-context { display: none !important; }
}

@media (max-width: 900px) {
  .mobile-only {
    display: inline-grid !important;
  }
  #menuButton {
    display: inline-grid !important;
  }
}

@media (max-width: 1024px) {
  #btnShowCommandPalette span:not(.btn-icon) { display: none !important; }
  .connection-state span { display: none !important; }
  .topbar-context { max-width: 220px; overflow: hidden; }
  .topbar-context strong,
  .topbar-context span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .app-sidebar { position: fixed; top: var(--shell-topbar-h); bottom: 0; left: 0; width: min(86vw, var(--shell-sidebar-w)); transform: translateX(-100%); transition: transform var(--dur) var(--ease-fluid); z-index: var(--shell-z-sidebar); }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: calc(var(--shell-z-sidebar) - 1); }
  .sidebar-backdrop[hidden] { display: none; }
}

@media (max-width: 768px) {
  #pwaInstallButton,
  .sidebar-pwa-install,
  #sidebarInstallPwa { display: none !important; }
  .app-topbar { padding: var(--space-0) calc(var(--space-2) * var(--density-space)); gap: calc(var(--space-1) * var(--density-space)); }
  .topbar-actions { gap: calc(var(--space-1) * var(--density-space)); }
  #btnShowCommandPalette {
    padding: calc(var(--space-1) * var(--density-space)) calc(var(--space-2) * var(--density-space)) !important;
    min-width: 36px !important;
    height: 36px !important;
  }
  #btnShowCommandPalette span:not(.btn-icon),
  #btnShowCommandPalette kbd {
    display: none !important;
  }
  .connection-state span { display: none !important; }
}

.topbar-lead { display: flex; align-items: center; gap: calc(var(--space-3) * var(--density-space)); min-width: max-content; flex: 0 0 auto; }
.topbar-context { display: flex; align-items: center; gap: calc(var(--space-2) * var(--density-space)); flex: 1 1 auto; margin-left: calc(var(--space-3) * var(--density-space)); justify-content: flex-start; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: calc(var(--space-2) * var(--density-space)); flex: 0 0 auto; }
.nav-badge { margin-left: auto; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: var(--space-0) var(--space-1); border-radius: var(--radius-full); background: var(--c-accent-weak); color: var(--c-accent); font-size: calc(var(--type-xs) * var(--density-type)); font-weight: var(--weight-bold); }

.app-topbar { grid-column: 1 / -1; height: var(--shell-topbar-h); display: flex; align-items: center; justify-content: space-between; gap: calc(var(--space-3) * var(--density-space)); padding: var(--space-0) calc(var(--space-4) * var(--density-space)); border-bottom: 1px solid var(--c-border); background: var(--c-surface); position: sticky; top: 0; z-index: var(--shell-z-topbar); width: 100%; box-sizing: border-box; }

/* ============================================================================
   PANEL / CARD FAMILY (2026-07-21) — rebuilt from scratch on tokens, matching
   the golden template's near-flat .fos-card (surface + border + --elev-1).
   Replaces the legacy glass-card block purged from styles.css. Tokens only.
   ============================================================================ */
.page-actions, .panel-header-actions, .result-actions, .journey-controls, .widget-actions {
  display: flex; align-items: center; gap: calc(var(--space-2) * var(--density-space)); flex-wrap: wrap;
}
.panel, .dashboard-panel, .dashboard-section, .role-widget, .module-status-card,
.journey-primary-card, .journey-record-card, .upload-journey-card, .result-card,
.choice-card, .setting-choice-card, .mobile-operation-card, .ticket-mobile-card,
.visit-entry-card, .work-card, .tanker-operation-card, .tanker-brief-card,
.tanker-reading-card, .parking-bay, .space-desk, .audit-overdue-card, .reorder-alert-card {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg, var(--radius-md));
  background: var(--c-surface);
  box-shadow: var(--elev-1);
  /* Padding was missing from this whole family, so every one of these cards drew a
     border and then sat its content flush against it — measured 90 work-cards at
     0px padding on the engineering board alone. A card with no inner space is not
     a card. */
  padding: calc(var(--space-4) * var(--density-space));
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.panel { overflow: hidden; }
.panel:hover, .dashboard-panel:hover, .role-widget:hover, .module-status-card:hover,
.journey-primary-card:hover, .journey-record-card:hover, .mobile-operation-card:hover,
.ticket-mobile-card:hover, .visit-entry-card:hover, .work-card:hover,
.tanker-operation-card:hover, .parking-bay:hover, .space-desk:hover {
  border-color: var(--c-border-strong, var(--c-accent-weak));
  box-shadow: var(--elev-2, var(--elev-1));
}
.panel-grid, .module-panel-gap, .dashboard-analytics-grid, .role-widget-grid,
.module-status-grid, .journey-card-grid, .settings-journey-grid, .tanker-operations-grid {
  display: grid; gap: calc(var(--space-4) * var(--density-space));
  padding: calc(var(--space-4) * var(--density-space));
}
.space-form-grid { display: grid; gap: calc(var(--space-3) * var(--density-space)) calc(var(--space-4) * var(--density-space)); padding: var(--space-0); }
.panel-grid, .dashboard-analytics-grid, .role-widget-grid, .module-status-grid,
.journey-card-grid, .settings-journey-grid, .tanker-operations-grid, .space-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.panel-header, .dashboard-section-heading, .widget-export-header,
.journey-stage-title, .ticket-stage-heading, .space-stage-heading,
.tanker-stage-header, .visitor-stage-header {
  padding: calc(var(--space-5) * var(--density-space)) calc(var(--space-6) * var(--density-space));
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: calc(var(--space-3) * var(--density-space));
}
.journey-stage-body, .ticket-stage-body, .space-stage-body,
.tanker-stage-body, .visitor-stage-body {
  padding: calc(var(--space-5) * var(--density-space)) calc(var(--space-6) * var(--density-space));
}
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: calc(var(--space-3) * var(--density-space)); }
.panel-header p, .dashboard-section-heading p { color: var(--c-text-3); font-size: calc(var(--type-xs) * var(--density-type)); margin-top: var(--space-1); }

/* ============================================================================
   NOW HUB (2026-07-22) — rebuilt from scratch on tokens (golden-template
   three-zone). Replaces legacy now-screen/timeline/pulse/role-console CSS.
   ============================================================================ */
.fos-section { padding: calc(var(--space-5) * var(--density-space)); display: flex; flex-direction: column; gap: calc(var(--space-4) * var(--density-space)); }
.fos-section__head { display: flex; flex-direction: column; gap: var(--space-1); }
.fos-section__title { font-size: calc(var(--type-lg) * var(--density-type)); font-weight: var(--weight-semibold); letter-spacing: var(--track-tight); margin: var(--space-0); }
.fos-section__sub { font-size: calc(var(--type-sm) * var(--density-type)); color: var(--c-text-3); margin: var(--space-0); }

.fos-now-columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: calc(var(--space-4) * var(--density-space)); align-items: start; }
.fos-now-side { display: flex; flex-direction: column; gap: calc(var(--space-4) * var(--density-space)); }
@media (max-width: 900px) { .fos-now-columns { grid-template-columns: minmax(0, 1fr); } }

.fos-attention-list { display: flex; flex-direction: column; }
.fos-attention-row {
  display: flex; align-items: center; gap: calc(var(--space-3) * var(--density-space));
  width: 100%; text-align: left; cursor: pointer;
  padding: calc(var(--space-3) * var(--density-space)) var(--space-0);
  border: none; border-bottom: 1px solid var(--c-border); background: transparent;
  transition: background var(--dur) var(--ease);
}
.fos-attention-row:last-child { border-bottom: none; }
.fos-attention-row:hover { background: var(--c-surface-2); }
.fos-attention-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.fos-attention-row__title { font-size: calc(var(--type-sm) * var(--density-type)); font-weight: var(--weight-medium); color: var(--c-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fos-attention-row__meta { font-size: calc(var(--type-xs) * var(--density-type)); color: var(--c-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fos-attention-row__time { font-size: calc(var(--type-xs) * var(--density-type)); color: var(--c-text-4); white-space: nowrap; flex: none; }

.fos-pulse-list { display: flex; flex-direction: column; }
.fos-pulse-row { display: flex; align-items: center; justify-content: space-between; gap: calc(var(--space-3) * var(--density-space)); padding: calc(var(--space-2) * var(--density-space)) var(--space-0); border-bottom: 1px solid var(--c-border); }
.fos-pulse-row:last-child { border-bottom: none; }
.fos-pulse-row__label { font-size: calc(var(--type-sm) * var(--density-type)); color: var(--c-text-2); }
.fos-pulse-row__val { font-size: calc(var(--type-lg) * var(--density-type)); font-weight: var(--weight-bold); }

.fos-quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: calc(var(--space-2) * var(--density-space)); }
.fos-quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-1);
  padding: calc(var(--space-4) * var(--density-space)) calc(var(--space-2) * var(--density-space));
  border: 1px solid var(--c-border); border-radius: var(--radius-md);
  background: var(--c-surface-2); color: var(--c-text); cursor: pointer;
  font-size: calc(var(--type-sm) * var(--density-type)); font-weight: var(--weight-medium);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.fos-quick-btn:hover { border-color: var(--c-accent); background: var(--c-accent-weak); }
.fos-quick-btn i { font-size: calc(var(--type-xl) * var(--density-type)); color: var(--c-accent); }

/* ============================================================================
   SITES HUB (2026-07-22) — rebuilt from scratch on tokens. Replaces legacy
   site-selector/site-panel/live-item/occupancy/digital-twin/svg-map CSS.
   ============================================================================ */
.fos-site-tabs { display: flex; flex-wrap: wrap; gap: calc(var(--space-2) * var(--density-space)); }
.fos-site-tab {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: calc(var(--space-2) * var(--density-space)) calc(var(--space-3) * var(--density-space));
  border: 1px solid var(--c-border); border-radius: var(--radius-full);
  background: var(--c-surface); color: var(--c-text-2); cursor: pointer;
  font-size: calc(var(--type-sm) * var(--density-type)); font-weight: var(--weight-medium);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.fos-site-tab:hover { border-color: var(--c-accent); }
.fos-site-tab.active { background: var(--c-accent); color: var(--c-accent-text); border-color: var(--c-accent); }
.fos-site-tab__dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--c-success); }
.fos-site-tab.active .fos-site-tab__dot { background: var(--c-accent-text); }

.fos-section__link { margin-left: auto; font-size: calc(var(--type-sm) * var(--density-type)); font-weight: var(--weight-medium); color: var(--c-accent); cursor: pointer; }

/* status dot tone modifiers (shared with Now attention rows) */
.fos-status__dot.red, .fos-status__dot--critical { background: var(--c-danger); }
.fos-status__dot.amber, .fos-status__dot--warning { background: var(--c-warning); }
.fos-status__dot.blue, .fos-status__dot--info { background: var(--c-info); }
.fos-status__dot.green { background: var(--c-success); }

/* digital-twin map card */
.fos-twin__head { display: flex; align-items: center; justify-content: space-between; gap: calc(var(--space-3) * var(--density-space)); flex-wrap: wrap; }
.fos-twin__title { display: inline-flex; align-items: center; font-size: calc(var(--type-md) * var(--density-type)); font-weight: var(--weight-semibold); }
.fos-twin__legend { display: flex; gap: calc(var(--space-3) * var(--density-space)); }
.fos-legend-item { display: inline-flex; align-items: center; gap: var(--space-1); font-size: calc(var(--type-xs) * var(--density-type)); color: var(--c-text-3); }
.fos-legend-dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--c-text-4); }
.fos-legend-dot.ok { background: var(--c-success); }
.fos-legend-dot.warning { background: var(--c-warning); }
.fos-legend-dot.alert { background: var(--c-danger); }
.svg-map { width: 100%; height: auto; }
.svg-map .room-node { fill: var(--c-surface-2); stroke: var(--c-border); stroke-width: 1; cursor: pointer; transition: fill var(--dur) var(--ease); }
.svg-map .room-node:hover { fill: var(--c-surface-3); }
.svg-map .room-node.status-warning { fill: var(--c-warning-weak); stroke: var(--c-warning); }
.svg-map .room-node.status-alert { fill: var(--c-danger-weak); stroke: var(--c-danger); }
.svg-map .room-text { fill: var(--c-text); font-size: calc(var(--type-xs) * var(--density-type)); font-weight: var(--weight-medium); text-anchor: middle; pointer-events: none; }

/* visitor occupancy donut */
.fos-donut-row { display: flex; align-items: center; gap: calc(var(--space-4) * var(--density-space)); }
.fos-donut-meta { display: flex; flex-direction: column; gap: var(--space-1); }
.fos-cap-bar { height: 6px; background: var(--c-surface-3); border-radius: var(--radius-full); overflow: hidden; }
.fos-cap-fill { height: 100%; border-radius: var(--radius-full); background: var(--c-info); }
.fos-cap-fill.red { background: var(--c-danger); }
.fos-cap-fill.amber { background: var(--c-warning); }
.fos-cap-fill.blue { background: var(--c-info); }
.fos-kpi__note { font-size: calc(var(--type-xs) * var(--density-type)); color: var(--c-text-4); margin-top: var(--space-1); }

/* ── People + Reports hubs (2026-07-22) — token-only ─────────────────────── */
.fos-kpi__value.blue { color: var(--c-info); }
.fos-kpi__value.amber { color: var(--c-warning); }
.fos-kpi__value.green { color: var(--c-success); }
.fos-kpi__value.red { color: var(--c-danger); }
.fos-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: calc(var(--space-3) * var(--density-space)); }
.fos-tile { display: flex; flex-direction: column; gap: calc(var(--space-2) * var(--density-space)); padding: calc(var(--space-5) * var(--density-space)); cursor: pointer; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.fos-tile:hover { border-color: var(--c-accent); box-shadow: var(--elev-2, var(--elev-1)); }
.fos-tile__icon { font-size: calc(var(--type-2xl) * var(--density-type)); color: var(--c-accent); }
.fos-tile__label { font-size: calc(var(--type-md) * var(--density-type)); font-weight: var(--weight-semibold); color: var(--c-text); }
.fos-tile__meta { font-size: calc(var(--type-sm) * var(--density-type)); color: var(--c-text-3); line-height: 1.5; }


/* ============================================================================
   ORPHAN SAFETY NET (generated 2026-07-23)
   ---------------------------------------------------------------------------
   These classes are emitted by the app but had NO css rule anywhere, so they
   rendered as bare inline flow: adjacent labels ran together ("Scheduledppm"),
   captions escaped their cards, and chip rows collapsed into one string. A
   structural probe cannot see that — only a person can, which is why these
   surfaced from owner screenshots rather than from the gate.

   Each family gets a token-built structural default by naming convention. This
   is a floor, not a design: a screen that needs more should define its own rule.
   ============================================================================ */

.bulk-hub-card-actions,
.framework-form-actions,
.offline-approval-actions,
.vendor-pass-share-actions,
.vendor-pass-wizard-actions,
.visitor-denial-actions,
.work-card-actions {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: calc(var(--space-2) * var(--density-space));
}

.activity-builder-row,
.bulk-step-row,
.check-option,
.choice-chip,
.choice-chip-row,
.failure-reason-row,
.framework-form-row,
.import-preview-row,
.logsheet-reading-entry,
.scope-chip,
.space-toggle-row,
.vendor-roster-builder-row,
.visitor-choice-row,
.visitor-person-row {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: calc(var(--space-2) * var(--density-space));
}

.activity-builder-rows,
.failure-reason-list,
.manual-roster-results,
.manual-search-results,
.permit-isolation-list,
.qr-action-list,
.roster-list,
.utility-fifo-list,
.widget-drilldown-list,
.work-card-list {
  display: flex; flex-direction: column;
  gap: calc(var(--space-2) * var(--density-space));
}

.engineering-structure-grid,
.optional-fields-grid,
.space-map-canvas,
.space-map-gallery,
.utility-demand-grid,
.visitor-pass-grid,
.visitor-wayfinding-canvas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: calc(var(--space-3) * var(--density-space));
}

.approval-lock-card,
.approval-queue-card,
.audit-score-preview,
.bulk-error-banner,
.bulk-hub-card,
.capture-card,
.checklist-structure-panel,
.engineering-structure-card,
.framework-form-preview,
.framework-user-scope-preview,
.mobile-callout,
.module-loading-state,
.page-error-state,
.pending-verification-card,
.platform-preconfiguration-banner,
.qr-preview,
.reading-range-state,
.space-confirmation-card,
.space-map-card,
.space-phone-state,
.space-release-card,
.space-reminder-card,
.visitor-blueprint-card {
  display: block;
  padding: calc(var(--space-3) * var(--density-space));
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
}

.activity-builder-heading,
.activity-execution-heading,
.bulk-dialog-header,
.bulk-error-section-header,
.form-header,
.space-map-heading,
.space-phone-title,
.structure-panel-heading,
.tanker-stage-header,
.vendor-pass-wizard-head,
.visitor-stage-header,
.visitor-wayfinding-heading,
.work-card-heading {
  display: block;
  margin-bottom: calc(var(--space-2) * var(--density-space));
  font-weight: var(--weight-semibold);
  color: var(--c-text);
}

.approval-rule-note,
.asset-audit-discrepancy-copy,
.blueprint-hero-copy,
.bulk-dialog-note,
.bulk-error-label,
.bulk-file-label,
.bulk-partial-note,
.bulk-stat-count,
.bulk-stat-label,
.field-help,
.form-hint,
.framework-form-message,
.historical-check-note,
.platform-owner-message,
.roster-check-warning,
.screen-kicker,
.space-inline-message,
.visitor-pass-roster-count {
  display: block;
  color: var(--c-text-2);
  font-size: calc(var(--type-sm) * var(--density-type));
  line-height: var(--leading-normal);
  overflow-wrap: anywhere;
}

.access-scope,
.action-dialog,
.activation-complete,
.activity-builder,
.activity-department-field,
.activity-failure-inputs,
.activity-flags,
.activity-structure,
.ai-action-handoff,
.ai-chat-bubble,
.ai-five-question-chain,
.ai-inline-trigger,
.ai-query-response,
.ai-question-marker,
.amber-button,
.asset-audit-discrepancy,
.bulk-dialog-footer,
.bulk-error-more,
.bulk-error-table,
.bulk-file-input,
.bulk-hub-card-body,
.bulk-preview-stats,
.bulk-step-content,
.bulk-step-num,
.bulk-steps-body,
.bulk-success-icon,
.bulk-upload-dialog,
.bulk-upload-hub,
.choice,
.cmd-item-name,
.desktop-records,
.dialog-body,
.error,
.escalation-audit-detail,
.escalation-audit-trail,
.failure-reason-remove,
.failure-reasons-field,
.form-dialog,
.form-footer,
.form-input,
.fos-nav-subtabs,
.fos-nav-tree,
.fos-quick,
.fos-twin,
.framework-annotation-inside,
.framework-golive-btn,
.framework-tree-caret,
.framework-user-assignment,
.gate,
.gate-roster-search,
.heading,
.hierarchy-facility-fields,
.hierarchy-guidance,
.import-preview-table,
.incident-commander-button,
.journey-stage,
.loader,
.logsheet-structure,
.manual-search-bar,
.optional-fields,
.permit,
.permit-dual-check,
.platform-owner-container,
.ppm-structure,
.qr-scan-action,
.reading-unit,
.recurring-button,
.result-next-steps,
.roster-denial-path,
.scan-success,
.setup-overview,
.small-button,
.space-empty-action,
.space-map-file,
.space-switch,
.static,
.success-button,
.table-scroll,
.tanker-stage-body,
.teal-button,
.unified-checklist-builder,
.vendor-pass-issued,
.vendor-pass-stepper,
.vendor-pass-wizard-form,
.vendor-roster-builder,
.visitor-destination-pin,
.visitor-roster-example,
.visitor-stage-body,
.visitor-wayfinding-map,
.wide-dialog,
.work-board,
.work-card-main,
.work-open-button {
  display: block;
  overflow-wrap: anywhere;
}

/* ============================================================================
   SYSTEM CONFIGURATION CARD (2026-07-27)
   ============================================================================ */
.system-config-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: calc(var(--space-5) * var(--density-space));
  max-width: 680px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: calc(var(--space-4) * var(--density-space));
}

.system-config-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: calc(var(--type-lg) * var(--density-type));
  font-weight: var(--weight-semibold);
  color: var(--c-text);
  margin-bottom: var(--space-2);
}

.system-config-card__list {
  display: flex;
  flex-direction: column;
}

.system-config-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: calc(var(--space-3) * var(--density-space)) 0;
  border-bottom: 1px solid var(--c-border);
}

.system-config-card__row:last-child {
  border-bottom: none;
}

.system-config-card__label {
  font-size: calc(var(--type-sm) * var(--density-type));
  font-weight: var(--weight-semibold);
  color: var(--c-text);
}

.system-config-card__input {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: calc(var(--space-2) * var(--density-space)) calc(var(--space-3) * var(--density-space));
  font-size: calc(var(--type-sm) * var(--density-type));
  color: var(--c-text);
  min-width: 180px;
  text-align: right;
}

.system-config-card__input:focus {
  outline: none;
  border-color: var(--c-accent);
}

.system-config-card__btn {
  background: var(--c-accent);
  color: var(--c-surface);
  border: none;
  border-radius: var(--radius-md);
  padding: calc(var(--space-3) * var(--density-space)) calc(var(--space-5) * var(--density-space));
  font-size: calc(var(--type-sm) * var(--density-type));
  font-weight: var(--weight-semibold);
  cursor: pointer;
  align-self: flex-start;
  transition: opacity var(--dur) var(--ease);
}

.system-config-card__btn:hover {
  opacity: 0.92;
}

.system-config-card__security-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: calc(var(--space-2.5) * var(--density-space)) calc(var(--space-3.5) * var(--density-space));
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  font-size: calc(var(--type-xs) * var(--density-type));
  color: var(--c-text-3);
  font-weight: var(--weight-medium);
  margin-top: var(--space-2);
}

.system-config-card__security-badge i {
  color: var(--c-accent);
  font-size: calc(var(--type-sm) * var(--density-type));
}

