/* App-specific additions on top of ds/styles.css — layout/interaction rules
   that aren't part of the design system itself. */

body { margin: 0; }

/* .card and other author rules set `display` unconditionally, which — at
   equal CSS specificity — beats the UA stylesheet's `[hidden] { display:
   none }`. Without this, `el.hidden = true` on any `class="card"` element
   (e.g. the Assistant tab's disabled-state panel) silently has no visual
   effect. */
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--color-neutral-400); }
::-webkit-scrollbar-track { background: var(--color-neutral-100); }

[data-tab-panel] { display: none; }
[data-tab-panel].is-active { display: block; }

[data-overlay] { display: none; }
/* The worker's page is full screen (dashboard.php styles it). */
[data-overlay="drawer"].is-open { display: block; }
[data-overlay="docDetail"].is-open,
[data-overlay="incidentDetail"].is-open,
[data-overlay="equipmentDetail"].is-open,
[data-overlay="subDetail"].is-open { display: flex; }
[data-overlay="trail"].is-open,
[data-overlay="invite"].is-open,
[data-overlay="photo"].is-open,
[data-overlay="newDocument"].is-open,
[data-overlay="groups"].is-open,
[data-overlay="sendNotification"].is-open,
[data-overlay="addSubcontractor"].is-open,
[data-overlay="deleteCompany"].is-open,
[data-overlay="trainingTypes"].is-open,
[data-overlay="addTraining"].is-open,
[data-overlay="startInspection"].is-open,
[data-overlay="addAttendance"].is-open,
[data-overlay="editAttendance"].is-open { display: grid; }
/* Any dialog-style overlay opens as a grid even if it is missing from the
   list above, so a new dialog can't stay invisible when it is opened.
   Overlays without .dialog-backdrop (the drawers, addAttendance) still need
   their own line above. */
.dialog-backdrop[data-overlay].is-open { display: grid; }

.avatar-sm {
  width: 26px; height: 26px; flex: none; background: var(--color-neutral-200);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 10px;
}
.avatar-md {
  width: 44px; height: 44px; flex: none; background: var(--color-accent-100); color: var(--color-accent-800);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 14px;
}
.stat-icon {
  width: 44px; height: 44px; flex: none; background: var(--color-accent-100); color: var(--color-accent-700);
  display: flex; align-items: center; justify-content: center;
}
.row-line {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 9px 0; border-bottom: 1px solid var(--color-divider);
}
/* In drawers a list is followed by an .hr, so the last row's own border would
   draw a second line just above it. */
[data-overlay] [data-list] > .row-line:last-child { border-bottom: 0; }
.list-empty { color: color-mix(in srgb, var(--color-text) 55%, transparent); padding: var(--space-4) 0; }

/* — per-tenant brand color, scoped to the dashboard shell and on the main
   buttons only (the site board look, 12 Nov): card headings, tags and the
   top bar stay Shamrock's. Logins and the platform area use --color-accent. */
.dashboard-shell .btn-primary { background: var(--brand); color: #fff; box-shadow: none; }
.dashboard-shell .btn-primary:hover { box-shadow: none; filter: brightness(1.08); }
.dashboard-shell :focus-visible {
  outline-color: var(--brand);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 40%, transparent), 0 8px 24px color-mix(in srgb, var(--brand) 35%, transparent);
}
.dashboard-shell input:focus-visible, .dashboard-shell .input:focus-visible { border-color: var(--brand); }

/* — training matrix (dashboard.php) — deliberately spreadsheet-styled
   (full grid lines, frozen header row + frozen name column, dense
   center-aligned cells) rather than the app's normal borderless-row
   .table, per the client's explicit "make it look like Excel" request. */
.matrix-table { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.matrix-table th, .matrix-table td {
  border-right: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  white-space: nowrap;
}
.matrix-table th {
  position: sticky; top: 0; z-index: 2;
  padding: 7px 10px;
  background: var(--color-neutral-100);
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: none;
  color: var(--color-neutral-700); text-align: left;
}
.matrix-table td { padding: 0; text-align: center; }
.matrix-table td.matrix-cell-text { padding: 7px 10px; text-align: left; }
.matrix-table th:first-child, .matrix-table td:first-child {
  position: sticky; left: 0; z-index: 1;
  background: var(--color-bg);
  border-right: 2px solid var(--color-divider);
}
.matrix-table th:first-child { z-index: 3; background: var(--color-neutral-100); }
.matrix-table tbody tr:hover td:first-child { background: var(--color-neutral-200); }
.matrix-cell-btn {
  display: block; width: 100%; height: 100%; min-height: 38px;
  border: none; cursor: pointer; font: inherit; padding: 6px 10px;
  text-align: center; line-height: 1.25;
}
.matrix-cell-btn:hover { filter: brightness(0.94); }
.matrix-cell-btn:focus-visible { outline: 2px solid var(--color-accent-700); outline-offset: -2px; }

/* The certificate view (dashboard.php trainingCert, opened from a matrix cell). */
.cert-details { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--space-3); margin: 0; font-size: 13px; }
.cert-details dt { color: var(--color-neutral-600); }
.cert-details dd { margin: 0; overflow-wrap: anywhere; }
.cert-preview { display: block; margin-top: var(--space-3); border: 1px solid var(--color-neutral-200); background: var(--color-neutral-50); text-align: center; }
.cert-preview img { display: block; max-width: 100%; max-height: 50vh; margin: 0 auto; object-fit: contain; }

/* — scroll reveal (assets/js/reveal.js) — */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* Roll call: a long visitor/subcontractor label shortens with "…" instead of
   running into the site column (assets/js/dashboard.js, loadAttendance). */
.roll-badge > span { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }

/* Worker and crew portal header: on a phone the name drops out and nothing
   wraps mid-word (worker/index.php, subcontractor/index.php). */
.portal-nav .nav-brand, .portal-nav a, .portal-nav .btn { white-space: nowrap; }
@media (max-width: 520px) {
  .portal-nav { gap: var(--space-2); }
  .portal-nav .portal-user { display: none; }
  .portal-nav .portal-links { gap: var(--space-2); }
  .portal-nav .btn { padding: 6px 10px; font-size: 13px; }
  .portal-nav .portal-links a:not(.btn) { font-size: 12.5px !important; }
}

/* Signature pad (includes/signature.php render_signature_fields,
   assets/js/signature-pad.js) on every signing form. A white box with a
   faint line to sign on, tall enough for a finger on a phone. touch-action
   none so a finger on the pad draws instead of scrolling the page. The
   line is only the box's background: it is not part of the saved image. */
#sig-pad, .sig-pad {
  display: block; width: 100%; height: 180px;
  border: 1px solid var(--color-divider); border-radius: var(--radius-sm);
  background: #fff linear-gradient(#cfd8db, #cfd8db) no-repeat left 16px bottom 40px / calc(100% - 32px) 1px;
  touch-action: none; cursor: crosshair;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
#clear-sig { margin-bottom: var(--space-4); }

/* Tick boxes in a list and the small hint under a field: Plant and
   equipment and the Settings card on the dashboard, and the subcontractor
   office's plant pages (subcontractor/plant.php, plant-item.php). */
.eq-hint { font-size: 11.5px; margin: 4px 0 0; }
.eq-checks { display: flex; flex-direction: column; }
.eq-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-height: 34px; cursor: pointer; }

/* No rule under the last permit type in Settings (assets/js/dashboard.js loadPermitSettings). */
[data-list="permitSettingRows"] > .row-line:last-child { border-bottom: 0; }

/* Privacy notice and terms of use links (login, invite, worker and
   subcontractor home), and the visitor privacy line on the kiosk. */
.policy-links { text-align: center; font-size: 12.5px; color: var(--color-neutral-600); margin: var(--space-5) 0 0; }
.policy-links a { color: inherit; }
.kiosk-privacy { font-size: 12.5px; line-height: 1.45; color: var(--color-neutral-600); margin: 0 0 var(--space-2); }

/* A tip that shows straight away on hover or keyboard focus ([data-tip],
   placed by dashboard.js above everything so a scrolling table can't cut it off). */
.sc-tip {
  position: fixed; z-index: 70; max-width: 260px; pointer-events: none;
  background: var(--color-neutral-900, #1f2a24); color: #fff; font-size: 12.5px; font-weight: 500; line-height: 1.4;
  padding: 8px 10px; border-radius: 8px; box-shadow: var(--shadow-lg);
}

/* A dialog never grows past the screen: it scrolls inside instead, so its
   buttons can always be reached (the upload form with a long list of people
   to choose from, 5 Nov). */
.dialog-backdrop .dialog { max-height: calc(100dvh - 2 * var(--space-4)); overflow-y: auto; }

/* ── Dashboard frame (dashboard.php): the Shamrock green bar across the top
   with the menu along it, each group dropping its pages down; under 900px the
   menu is the buttons along the bottom and a sheet above them. --sb-bottom is
   the room those take, --sb-top (dashboard.js) where the page starts; record.css, the
   Ask button and the toast keep clear of them. ── */
:root:has(.sb-frame) { --sb-bottom: 0px; --sb-over: var(--sb-top, 58px); }
.sb-frame { flex: 1; min-height: 0; display: grid; grid-template: auto auto minmax(0, 1fr) / minmax(0, 1fr); }
.sb-top { display: contents; }
.sb-main { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.sb-green { background: #0f5c3b; color: #fff; padding: 8px 20px; display: flex; align-items: center; gap: 12px; }
.sb-co { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 320px; margin-right: 8px; }
.sb-co-mark { width: 34px; height: 34px; flex: none; border-radius: 10px; object-fit: contain; background: #fff; }
.sb-co-letter { display: grid; place-items: center; color: #0f5c3b; font: 700 15px var(--font-heading); }
.sb-co-name { font: 600 16px/1.2 var(--font-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-co-sub { font-size: 12px; color: #c4e1cf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-green .input { border-color: transparent; }
.sb-green .dash-search { min-width: 150px; }
.dash-own-induction .btn-label { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.sb-green .dash-actions .btn-secondary { background: #1a7049; color: #fff; border-color: transparent; box-shadow: none; }
.sb-green .dash-actions .btn-secondary:hover { background: #23805a; }
.sb-green .dash-actions .btn-primary { background: var(--color-mint); color: #10231a; }
.sb-green :focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: none; }
.sb-me { position: relative; flex: none; }
.sb-me summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 12px 4px 4px; border-radius: 999px; background: #1a7049; font: 600 13px var(--font-heading); }
.sb-me summary::-webkit-details-marker { display: none; }
.sb-me-mark { width: 30px; height: 30px; border-radius: 50%; background: var(--color-mint); color: #10231a; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.sb-me-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 210px; background: #fff; color: var(--color-text); border-radius: 14px; padding: 8px; box-shadow: 0 10px 30px rgba(16, 35, 26, 0.18); display: flex; flex-direction: column; }
.sb-me-menu a { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: inherit; font-size: 14px; }
.sb-me-menu a:hover { background: var(--color-bg); }
.sb-me-menu a:focus-visible { outline-color: var(--color-accent); outline-offset: -2px; }
.sb-me-role { padding: 6px 12px 8px; font-size: 12px; color: var(--color-muted); border-bottom: 1px solid var(--color-divider); margin-bottom: 4px; }
.sb-brand { flex: none; width: 158px; height: 30px; background: url(../icons/logo-horizontal-reversed.svg) left center / contain no-repeat; }
.sb-brand + .sb-co { border-left: 1px solid rgba(255, 255, 255, 0.25); padding-left: 14px; }
.sb-menu { background: #0f5c3b; display: flex; gap: 4px; padding: 0 20px 8px; position: relative; z-index: 21; } /* over an open record (20) */
.sb-menu:has(.is-open) { margin-bottom: 46px; } /* room for the strip */
.sb-h { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 92px; min-height: 56px; padding: 6px 12px; border: 0; border-radius: 14px; background: none; color: #dcefe4; font: 600 13.5px/1.2 var(--font-heading); text-decoration: none; cursor: pointer; white-space: nowrap; }
.sb-h:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.sb-h[aria-current="page"], .sb-group.is-open > .sb-h { background: #fff; color: #0f5c3b; }
/* How many things in the group need attention. */
.sb-h[data-count]::after { content: attr(data-count); position: absolute; top: 4px; left: calc(50% + 6px); min-width: 19px; box-sizing: border-box; padding: 0 5px; border-radius: 999px; background: #f2b600; color: #2b2000; font: 700 12px/19px var(--font-heading); text-align: center; }
.sb-h[data-tone="red"]::after { background: #b3261e; color: #fff; }
.sb-h:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: none; }
.sb-list { display: none; position: absolute; left: 0; right: 0; top: 100%; height: 46px; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--color-divider); align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; box-sizing: border-box; }
.sb-group.is-open > .sb-list { display: flex; }
.sb-list a { flex: none; display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15px; color: var(--color-text); }
.sb-list a:hover { background: var(--color-bg); }
.sb-list a[aria-current="page"] { background: #e2f3e9; color: #0f5c3b; font-weight: 700; }
.sb-list a:focus-visible { outline: 2px solid #0f5c3b; outline-offset: -2px; box-shadow: none; }
.sb-n { display: inline-block; flex: none; min-width: 20px; box-sizing: border-box; text-align: center; font: 700 12px/1.6 var(--font-heading); border-radius: 999px; padding: 0 7px; background: var(--color-warning-100); color: var(--color-warning-800); }
.sb-n-red { background: var(--color-danger-100); color: var(--color-danger-700); }
.sb-bottom, .sb-sheet-back { display: none; }
@media (max-width: 1150px) {
  .sb-brand { width: 34px; background-image: url(../icons/logo-icon-reversed.svg); }
  /* Sign in on site and Add person are icon buttons here; each keeps its aria-label. */
  .dash-actions .btn-label { display: none; }
  .sb-me-name { display: none; }
  .sb-me summary { padding: 4px; }
}
@media (max-width: 899px) {
  :root:has(.sb-frame) { --sb-over: 0px; --sb-gap: 12px; --sb-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  .sb-frame { grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr); }
  .sb-green { flex-wrap: wrap; padding: 6px 16px 8px; gap: 6px 8px; }
  .sb-co { flex: 1; max-width: none; margin: 0; }
  .sb-me summary { padding: 7px; margin-right: -7px; background: none; }
  .sb-me-menu a { padding: 12px; }
  .sb-green .dash-search { order: 1; flex-basis: 140px; max-width: none; }
  .sb-green .dash-actions { order: 1; }
  .sb-green .dash-actions .btn:not([data-switch-company]) { padding: 0; width: 44px; height: 44px; justify-content: center; }
  .sb-green .input { min-height: 44px; }
  /* Switch company as an icon, its words for a screen reader. */
  .sb-green .dash-actions [data-switch-company] { width: 44px; height: 44px; padding: 0; font-size: 0; justify-content: center; }
  .sb-green .dash-actions [data-switch-company]::before { content: "\21C4"; font-size: 18px; }
  .sb-bottom { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: var(--sb-bottom); padding-bottom: env(safe-area-inset-bottom, 0px); box-sizing: border-box; background: #fff; border-top: 1px solid var(--color-divider); }
  .sb-bottom > * { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; padding: 0; border: 0; background: none; text-decoration: none; cursor: pointer; font: 600 12px/1.3 var(--font-heading); color: var(--color-muted); }
  .sb-bottom > [aria-current="page"], .sb-bottom > .is-current, .sb-bottom > [aria-expanded="true"] { color: #0f5c3b; font-weight: 700; }
  .sb-bottom:has([aria-expanded="true"]) > :not([aria-expanded="true"]) { color: var(--color-muted); font-weight: 600; }
  .sb-bottom:has([aria-expanded="true"]) > :not([aria-expanded="true"]) svg { background: none !important; }
  .sb-bottom svg { box-sizing: content-box; padding: 2px 14px; border-radius: 999px; }
  .sb-bottom > [aria-current="page"] svg, .sb-bottom > .is-current svg, .sb-bottom > [aria-expanded="true"] svg { background: #e2f3e9; }
  .sb-bottom > :focus-visible { outline: 2px solid #0f5c3b; outline-offset: -4px; border-radius: 12px; box-shadow: none; }
  /* Over an open record (20), under every dialog (24 and up). */
  .sb-sheet-back:not([hidden]) { display: block; position: fixed; inset: 0 0 var(--sb-bottom) 0; z-index: 21; background: rgba(16, 35, 26, 0.35); }
  .sb-menu { display: none; position: fixed; left: 0; right: 0; bottom: var(--sb-bottom); z-index: 22; max-height: calc(80vh - 60px); overflow-y: auto; box-sizing: border-box; border: 0; border-radius: 18px 18px 0 0; padding: 8px 12px 12px; background: #fff; box-shadow: 0 -8px 30px rgba(16, 35, 26, 0.18); }
  .sb-menu[data-sheet]:not([data-sheet=""]) { display: block; }
  .sb-menu > a, .sb-group:not(.is-in-sheet) { display: none; }
  .sb-menu, .sb-menu:has(.is-open) { margin: 0; }
  .sb-list, .sb-group.is-open > .sb-list { display: block; position: static; height: auto; padding: 0; border: 0; overflow: visible; }
  .sb-list a { display: flex; justify-content: space-between; min-height: 46px; padding: 0 14px; font-size: 16px; border-radius: 12px; }
  /* The group's name is only a heading here. */
  .sb-group > .sb-h, .sb-group.is-open > .sb-h { display: block; min-height: 0; padding: 10px 14px 4px; background: none; color: var(--color-muted); font-size: 14px; text-align: left; pointer-events: none; }
  .sb-h svg, .sb-h::after { display: none; }
  /* More holds three groups: two columns, so all of it shows at once. */
  .sb-menu[data-sheet="more"] .sb-list { display: grid; grid-template-columns: 1fr 1fr; }
  .sb-menu[data-sheet="more"] .sb-list a, .sb-menu[data-sheet="more"] .sb-h { padding-inline: 10px; }
}
@media (max-width: 640px) {
  .sb-co { flex-basis: calc(100% - 130px); } /* the search and the buttons go on their own line */
}

/* boards */
/* ── Boards (the site board, 12 Nov 2026): cards in columns, a coloured
   strip saying each card's state. Shared by Today (the Overview's
   Stop / Do today / This week) and Attendance (the manpower board).
   .bd is the row of columns; .bd-col a column with a header and a count;
   .bd-card a card with a 5px strip on top (add .bd-card-left for a strip
   down the left). Strips: .is-ok on site / done, .is-warn look at this,
   .is-stop stop, .is-off left / later. ── */
.bd { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.bd-col { background: #e6eee8; border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bd-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px; }
.bd-col-head h3 { margin: 0; font: 600 15px/1.3 var(--font-heading); color: var(--color-text); }
.bd-count { flex: none; min-width: 24px; text-align: center; font: 600 12px/1.6 var(--font-heading); border-radius: 999px; padding: 1px 9px; background: var(--color-surface); color: var(--color-muted); font-variant-numeric: tabular-nums; }
.bd-card { background: var(--color-surface); color: var(--color-text); border-radius: 12px; padding: 12px 14px; border-top: 5px solid var(--color-divider); min-width: 0; overflow-wrap: anywhere; }
.bd-card.bd-card-left { border-top: 0; border-left: 5px solid var(--color-divider); }
.bd-card.is-ok { border-color: var(--color-accent); }
.bd-card.is-warn { border-color: #f2b600; }
.bd-card.is-stop { border-color: var(--color-danger-700); }
.bd-card.is-off { border-color: #a9bcb0; }
.bd-card[data-go-tab], .bd-card[data-open-worker], .bd-card[data-cover-go] { cursor: pointer; }
.bd-card[data-go-tab]:hover, .bd-card[data-open-worker]:hover, .bd-card[data-cover-go]:hover { box-shadow: 0 0 0 1px var(--color-divider); }
.bd-empty, .bd-more { margin: 0; padding: 4px 6px; font-size: 13.5px; color: var(--color-muted); }
@media (max-width: 900px) {
  .bd { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); }
}

/* ── Today (dashboard.php section[data-tab-panel="overview"], dashboard.js
   loadOverview): the header, the four figures, the board's cards and the
   live cards below. ── */
.td-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-5); }
.td-title { margin: 0; font: 700 28px/1.15 var(--font-heading); }
.td-sub { margin: var(--space-1) 0 0; color: var(--color-muted); }
.td-head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); }
.td-rollcall { color: var(--color-danger-700); box-shadow: inset 0 0 0 1px #f0bdb6; border-color: transparent; }
.td-rollcall:hover { background: var(--color-danger-100); color: var(--color-danger-700); }
.td-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.td-fig { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 18px 20px; text-decoration: none; color: var(--color-text); }
.td-fig:hover { text-decoration: none; box-shadow: 0 0 0 1px var(--color-divider); }
.td-fig:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.td-fig-value { font: 700 34px/1.1 var(--font-heading); font-variant-numeric: tabular-nums; }
.td-fig-label { font-weight: 600; color: var(--color-muted); }
.td-fig.is-none .td-fig-label { font: 600 17px/1.3 var(--font-heading); color: var(--color-text); padding-top: 6px; }
.td-fig-detail { font-size: 13px; color: var(--color-muted); }
.td-fig.is-live { background: var(--color-mint); color: #10231a; }
.td-fig.is-live .td-fig-label, .td-fig.is-live .td-fig-detail { color: #10231a; }
.td-board-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.td-h2 { margin: 0; font: 600 19px/1.25 var(--font-heading); }
.td-board-empty { flex: 1 1 100%; margin: 0; font-size: 13.5px; color: var(--color-muted); }
.td-board { margin-bottom: 22px; }
.td-col-stop .bd-count { background: var(--color-danger-100); color: var(--color-danger-700); }
.td-col-today .bd-count { background: #ffe9b8; color: #10231a; }
.bd-card-title { font-weight: 700; font-size: 14.5px; line-height: 1.35; }
.bd-card-detail { font-size: 13.5px; color: var(--color-muted); margin-top: 2px; }
.bd-card-btn { margin-top: 10px; padding: 6px 14px; font-size: 13px; }
.td-cards { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; margin-bottom: var(--space-4); }
.td-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: var(--space-3); }
.td-card-title { margin: 0; font: 600 17px/1.3 var(--font-heading); color: var(--color-text); }
.td-card-link { margin-left: auto; font-size: 13px; }
.td-live { display: inline-flex; align-items: center; gap: 5px; }
.td-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-accent); }
.td-people { display: flex; flex-direction: column; gap: 16px; }
.td-stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.td-stat-label { font-weight: 600; color: var(--color-muted); font-size: 13.5px; }
.td-stat-num { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.td-stat-value { font: 700 26px/1.1 var(--font-heading); font-variant-numeric: tabular-nums; }
.td-stat-suffix { font-size: 13px; color: var(--color-muted); }
.td-stat-bar { margin-top: 8px; height: 6px; border-radius: 6px; background: var(--color-divider); overflow: hidden; }
.td-stat-bar > div { height: 100%; border-radius: 6px; }
@media (max-width: 1100px) {
  .td-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .td-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .td-title { font-size: 24px; }
  .td-head-actions { width: 100%; }
  .td-head-actions .td-rollcall { flex: 1 1 auto; }
  .td-figs { gap: 10px; }
  .td-fig { padding: 14px 16px; }
  .td-fig-value { font-size: 28px; }
}

/* Add person dialog: what kind of person (dashboard.php). */
.add-roles{border:0;padding:0;margin:0 0 var(--space-3);display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,135px),1fr));gap:6px}
.add-roles legend{font-size:13px;font-weight:600;margin-bottom:var(--space-1);padding:0}
.add-role{display:flex;gap:8px;align-items:flex-start;font-size:13px;border:1px solid var(--color-divider);border-radius:10px;padding:8px 10px;cursor:pointer}
.add-role:has(input:checked){border-color:var(--brand,#0E5B33);background:var(--color-neutral-100)}
.add-role input{margin-top:2px;flex:none}
.add-role .text-muted{display:block;font-size:11.5px}

[data-talk-key][hidden], [data-section="docKey"][hidden] { display: none !important; }
@media (min-width: 641px) and (max-width: 899px) {
  .sb-me { order: 2; }
  .sb-me summary { margin-right: 0; }
}
/* Printing a page or an open record: all of it, without the menu. */
@media print {
  .sb-menu, .sb-green, .sb-bottom { display: none !important; }
  .dashboard-shell, .sb-frame, .sb-main, .dash-content { display: block !important; height: auto !important; overflow: visible !important; }
  body:has(.rec-overlay.is-open) .dash-content { display: none !important; }
  .rec-overlay.is-open { position: static !important; overflow: visible !important; }
}
