* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f4f5f7;
  color: #1c1f24;
}

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #fff;
  padding: 2.5rem 2.5rem 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  width: 340px;
}

.login-card h1 {
  font-size: 1.3rem;
  margin: 0 0 0.25rem;
}
.login-card p.sub {
  margin: 0 0 1.5rem;
  color: #666;
  font-size: 0.85rem;
}

.field { margin-bottom: 0.55rem; }
.field label { display: block; font-size: 0.8rem; margin-bottom: 0.15rem; color: #444; }
.field input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid #d7d9dd;
  border-radius: 8px;
  font-size: 0.95rem;
}

button.primary {
  width: 100%;
  padding: 0.65rem;
  border: none;
  border-radius: 8px;
  background: #1c1f24;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 0.5rem;
}
button.primary:hover { background: #33383f; }

.error-box {
  background: #fdecea;
  color: #c0392b;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.demo-hint {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: #999;
  line-height: 1.4;
}

/* Dashboard - background reflects compliance status colour */
body.status-red { background: linear-gradient(180deg, #f7d9d6, #f4f5f7 240px); }
body.status-amber { background: linear-gradient(180deg, #fbe6c4, #f4f5f7 240px); }
body.status-green { background: linear-gradient(180deg, #d3ecdd, #f4f5f7 240px); }
body.status-blue { background: linear-gradient(180deg, #d3e2f2, #f4f5f7 240px); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
}
.topbar .brand { font-weight: 700; font-size: 1.1rem; }
.topbar form button {
  background: none;
  border: 1px solid #999;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}

.dash-wrap { max-width: 760px; margin: 0 auto; padding: 0 2rem 3rem; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 1.5rem;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; }

.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.05);
  margin-bottom: 1.25rem;
}
.card h2 { margin: 0 0 1rem; font-size: 1rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1.5rem; }
.row-label { font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 0.03em; }
.row-value { font-size: 0.95rem; margin-bottom: 0.5rem; }

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}
.check-list li:last-child { border-bottom: none; }
.badge-yes { color: #2e9e5b; font-weight: 600; }
.badge-no { color: #c0392b; font-weight: 600; }
.link-btn { background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline; width: auto; }

/* App-wide status colour convention: red / green / amber / blue - use these four
   consistently everywhere a status badge or pill is needed (staff, documents,
   leads, suppliers, etc). Red = attention needed/expired/pending, Green = good/
   complete/active, Amber = due soon/in progress, Blue = informational/neutral. */
.status-pill { display:inline-block; padding:0.15rem 0.55rem; border-radius:999px; font-size:0.78rem; font-weight:600; white-space:nowrap; }
.badge-green, .status-pill.status-green { color:#2e9e5b; background:#e8f8ef; }
.badge-red, .status-pill.status-red { color:#c0392b; background:#fdecea; }
.badge-amber, .status-pill.status-amber { color:#a5690a; background:#fff4e0; }
.badge-blue, .status-pill.status-blue { color:#1a5fb4; background:#e8f1fc; }

/* Admin capture-sheet form */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1.5rem;
}
.form-grid .field-full { grid-column: 1 / -1; }
/* Sprint 9 (P2-6 mobile pass) - .form-grid is the shared two-column
   capture-sheet layout used across ~60 admin forms (Incidents, Sites,
   Customers, Equipment, etc). Fixed 1fr 1fr never collapsed on a phone,
   so every one of those forms squeezed two ~180px columns onto a 390px
   screen. Purely additive - only applies under 700px, desktop is
   untouched. */
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
}
.field textarea {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid #d7d9dd;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
}
.field select {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid #d7d9dd;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
}
.field-hint { font-size: 0.72rem; color: #999; margin-top: 0.15rem; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.checkbox-row input { width: auto; }
.section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}
button.secondary {
  background: #fff;
  color: #1c1f24;
  border: 1px solid #ccc;
}
button.secondary:hover { background: #f4f4f4; }

/* Shared grouped navigation (replaces the old flat per-page topbar link list) */
.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 2rem;
  background: #fff;
  border-bottom: 1px solid #e8e8ea;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: relative;
  z-index: 20;
}
.app-topbar .brand { font-weight: 700; font-size: 1.05rem; margin-right: 0.5rem; }
.nav-groups { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.nav-groups a.nav-link {
  font-size: 0.85rem;
  color: #444;
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}
.nav-groups a.nav-link:hover { background: #f2f2f4; }
.nav-groups a.nav-link.active { color: #1c1f24; font-weight: 700; background: #eef0f3; }

.nav-groups details.nav-group { position: relative; }
.nav-groups details.nav-group > summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: #444;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-groups details.nav-group > summary::-webkit-details-marker { display: none; }
.nav-groups details.nav-group > summary::after { content: "\25BE"; font-size: 0.65rem; margin-left: 0.1rem; }
.nav-groups details.nav-group:hover > summary,
.nav-groups details.nav-group[open] > summary { background: #f2f2f4; color: #1c1f24; }
.nav-groups details.nav-group.active-group > summary { font-weight: 700; color: #1c1f24; }
.nav-group-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #e8e8ea;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.1);
  padding: 0.4rem;
  min-width: 190px;
  display: flex;
  flex-direction: column;
}
.nav-group-menu a {
  font-size: 0.85rem;
  color: #333;
  text-decoration: none;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
}
.nav-group-menu a:hover { background: #f2f2f4; }
.nav-group-menu a.active { font-weight: 700; background: #eef0f3; }
.nav-right { display: flex; align-items: center; gap: 0.6rem; }
.nav-right form button {
  background: none;
  border: 1px solid #999;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.breadcrumb-bar {
  padding: 0.6rem 2rem;
  font-size: 0.8rem;
  color: #777;
  background: #fafafb;
  border-bottom: 1px solid #eee;
}
.breadcrumb-bar a { color: #444; text-decoration: none; }
.breadcrumb-bar a:hover { text-decoration: underline; }

/* Logo branding */
.brand-logo { display: block; height: 84px; width: auto; margin: 0 auto 0.75rem; }
.brand-logo-nav { display: block; height: 52px; width: auto; }
.brand-sub {
  font-size: 0.75rem;
  color: #888;
  margin-left: 0.6rem;
  padding-left: 0.6rem;
  border-left: 1px solid #ddd;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Toggle switch - used on the Rules page (Company > Rules) to turn a rule
   option on/off in place of separate Add/Remove controls. */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex: none;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 22px;
  transition: background-color 0.15s ease;
}
.toggle-slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.toggle-switch input:checked + .toggle-slider { background-color: #2e9e5b; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-switch input:focus-visible + .toggle-slider { outline: 2px solid #1c1f24; outline-offset: 2px; }

/* Floating support button (bottom of the screen, staff side) - opens the
   chat/ticket page from wherever the user is. */
.support-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1c1f24;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  z-index: 999;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.support-fab:hover { background: #33383f; transform: scale(1.06); }

/* BIG dashboard-switcher tabs (admin side) - jump straight to each role's
   own dashboard. Deliberately larger/bolder than the regular nav-links. */
.dash-switcher {
  display: flex;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  background: #eef0f3;
  border-bottom: 1px solid #dde0e5;
}
.dash-switch-tab {
  flex: 1;
  text-align: center;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #d7d9dd;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1c1f24;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.dash-switch-tab:hover { background: #f4f5f7; transform: translateY(-1px); }
.dash-switch-tab.active-group { background: #1c1f24; color: #fff; border-color: #1c1f24; }

/* Sprint 9 (P1-5 mobile Attendance investigation) - this switcher's 8
   flex:1 tabs have no flex-wrap and no min-width:0, so on a narrow phone
   viewport the flex box cannot shrink items below their text content and
   was forcing the ENTIRE page (every admin screen, since this partial is
   shared app-wide) to scroll horizontally at ~1025px wide inside a 390px
   viewport - discovered while confirming the rebuilt mobile Attendance
   page had no horizontal scroll. Contained to the switcher bar itself
   (the standard mobile app tab-bar pattern - swipe the tab strip, not the
   whole page) rather than blown out across the page; the underlying page
   content below it is unaffected and unchanged. */
@media (max-width: 700px) {
  .dash-switcher { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .dash-switch-tab { flex: 0 0 auto; white-space: nowrap; }
}

/* ==========================================================================
   SPRINT 4 - Shared Dashboard/Tab framework.
   Per your instruction "Use the Customer Dashboard pattern as the design
   standard... Development should create reusable UI components... Do not
   independently design every module." Extracted from the tab-strip/tile/
   dot/doc-card pattern already proven on views/admin/site-dashboard.ejs
   (the "Customer Dashboard") so every new Sprint 4 screen (Company, Sales,
   Commission, Suppliers) reuses the same look instead of redefining this
   CSS inline each time. Pair with public/js/dash-tabs.js.
   ========================================================================== */

/* Tab strip - one row of tab buttons, one .dash-tab-panel shown at a time.
   Use data-dash-tabs="<group>" on the strip and data-dash-panels="<group>"
   on the panel container so a page can host more than one independent tab
   group if it ever needs to (rare, but keeps this generic). */
.dash-tab-strip { display:flex; gap:0.25rem; flex-wrap:wrap; border-bottom:2px solid #eee; margin:1rem 0 1.25rem; }
.dash-tab-btn { border:none; background:none; padding:0.5rem 0.75rem; font-size:0.82rem; color:#666; cursor:pointer; border-bottom:3px solid transparent; margin-bottom:-2px; white-space:nowrap; border-radius:6px 6px 0 0; }
.dash-tab-btn:hover { background:#f5f6f8; }
.dash-tab-btn.active { color:#1c1f24; font-weight:700; border-bottom-color:#3346c9; background:#eef0fb; }
.dash-tab-panel { display:none; }
.dash-tab-panel.active { display:block; }

/* Summary tiles - coloured KPI cards at the top of a dashboard. */
.dash-tile-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:0.7rem; margin:0.6rem 0 1.1rem; }
.dash-tile { border-radius:12px; padding:0.8rem 0.9rem; color:#fff; box-shadow:0 2px 6px rgba(0,0,0,0.1); }
.dash-tile .dash-tile-label { font-size:0.68rem; opacity:0.9; text-transform:uppercase; letter-spacing:0.03em; font-weight:600; }
.dash-tile .dash-tile-figure { font-size:1.5rem; font-weight:700; line-height:1.2; margin-top:0.35rem; }
.dash-tile .dash-tile-sub { font-size:0.7rem; opacity:0.85; margin-top:0.3rem; }
.dash-tile.blue { background:linear-gradient(135deg,#3346c9,#5a6fe0); }
.dash-tile.teal { background:linear-gradient(135deg,#0891b2,#22b8d8); }
.dash-tile.purple { background:linear-gradient(135deg,#6d28d9,#8b5cf6); }
.dash-tile.green { background:linear-gradient(135deg,#2c7a2c,#4caf50); }
.dash-tile.amber { background:linear-gradient(135deg,#a86a00,#c98a1f); }
.dash-tile.red { background:linear-gradient(135deg,#a52a2a,#c0392b); }
.dash-tile.grey { background:linear-gradient(135deg,#555,#777); }

/* Status colour language (Section 2 of the Sprint 4 brief) - Red = action
   required/failed/overdue, Amber = in progress/warning, Green = completed/
   normal, Blue = accepted/approved/confirmed, Grey = closed/inactive.
   Use .dash-dot-* for a small inline dot, .dash-status-badge.dash-status-*
   for a pill with text. */
.dash-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:0.35rem; }
.dash-dot-red { background:#c0392b; } .dash-dot-amber { background:#e2a03f; } .dash-dot-green { background:#2e9e5b; } .dash-dot-blue { background:#2f6fb3; } .dash-dot-grey { background:#999; }
.dash-status-badge { display:inline-block; padding:0.15rem 0.6rem; border-radius:10px; font-size:0.72rem; font-weight:700; }
.dash-status-red { background:#fdecea; color:#c0392b; }
.dash-status-amber { background:#fff4d6; color:#8a6100; }
.dash-status-green { background:#eaf6ea; color:#2e7d32; }
.dash-status-blue { background:#e3f2fd; color:#0d47a1; }
.dash-status-grey { background:#eee; color:#777; }

/* Sprint 8A - shared "visible choice" button, used wherever a major
   workflow choice (quote type, opportunity stage, etc.) needs to be a
   clickable card/button instead of hidden inside a <select> dropdown. */
.qt-card-grid { display:flex; flex-wrap:wrap; gap:0.5rem; margin-top:0.3rem; }
.qt-card { padding:0.55rem 1rem; border:1.5px solid #d7d9dd; border-radius:8px; background:#fff; font-size:0.85rem; font-weight:600; color:#444; cursor:pointer; }
.qt-card:hover { border-color:#9aa0aa; }
.qt-card.selected { border-color:#1c1f24; background:#1c1f24; color:#fff; }

/* Document/record cards - used for file lists, history rows etc. */
.dash-doc-card { border:1px solid #eee; border-radius:8px; padding:0.75rem 0.9rem; margin-bottom:0.6rem; display:flex; justify-content:space-between; align-items:flex-start; gap:0.75rem; flex-wrap:wrap; }
.dash-doc-card .dash-doc-icon { width:38px; height:38px; border-radius:6px; background:#f0f0f0; display:flex; align-items:center; justify-content:center; font-size:1.1rem; flex:0 0 auto; }

/* Field rows - label/value pairs on an Overview-style tab. */
.dash-field-row { display:flex; gap:0.5rem; padding:0.35rem 0; border-bottom:1px solid #f5f5f5; font-size:0.87rem; }
.dash-field-row .dash-fl { width:200px; color:#777; flex:0 0 auto; }

/* Empty state - used whenever a list/tab has nothing to show yet. */
.dash-empty-state { text-align:center; padding:2rem 1rem; color:#999; }
.dash-empty-state .dash-empty-icon { font-size:1.8rem; margin-bottom:0.4rem; }

/* Filter bar - a simple row of search/select controls above a table. */
.dash-filter-bar { display:flex; gap:0.5rem; flex-wrap:wrap; align-items:center; margin-bottom:0.75rem; }
.dash-filter-bar input, .dash-filter-bar select { padding:0.4rem 0.6rem; border:1px solid #d7d9dd; border-radius:6px; font-size:0.85rem; }

/* Measure grid - label/value pairs for technical readouts (System Health,
   Storage & Database). Not the same as .dash-tile - this is for a denser
   grid of many small measurements rather than 4-5 headline KPIs. */
.dash-measure-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:0.75rem; }
.dash-measure-box { border:1px solid #eee; border-radius:10px; padding:0.75rem 0.9rem; }
.dash-measure-box .dash-measure-label { font-size:0.72rem; color:#888; text-transform:uppercase; letter-spacing:0.02em; }
.dash-measure-box .dash-measure-figure { font-size:1.35rem; font-weight:700; margin-top:0.25rem; }
.dash-measure-box .dash-measure-sub { font-size:0.72rem; color:#999; margin-top:0.15rem; }

/* Sprint 9 (P2-6 mobile pass) - wide multi-column data tables (Employee
   Profile's Required Training/Certificates, External Competencies, etc,
   and the same .emp-table class reused on Safety File Competency Matrix
   and the Staff list) don't fit a phone width no matter how the columns
   are sized. Rather than redesigning each table into cards (a much larger
   change, and these are reference/drill-down tables rather than the
   primary tap-driven workflow Attendance needed), this contains the
   horizontal scroll to the table itself so the surrounding page/nav does
   not scroll sideways - the accepted mobile pattern for dense reference
   tables (same approach the App Store, GitHub, etc use for wide tables on
   phones), not the "add scroll to the huge table" anti-pattern the brief
   warns against (that referred to solving the whole Attendance *workflow*
   this way instead of rebuilding it as tap-driven cards, which Sprint 9
   already did separately). */
@media (max-width: 700px) {
  .emp-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}


/* Sprint 14 / Portrait Printing - global document print baseline (Master
   Brief SS15). Default My Safety File document orientation is A4 Portrait
   for every generated/previewed/printed/downloaded document, unless a
   specific document has Product Owner approval for Landscape - opt a
   printed element into Landscape with the .print-landscape class rather
   than omitting this rule per page. This establishes the page SIZE/
   ORIENTATION baseline only; existing per-view @media print rules (hiding
   chrome, page-break-after, etc.) are untouched and keep working alongside
   it - this is additive, not a redesign of any existing print output. */
@page {
  size: A4 portrait;
  margin: 15mm;
}
@page landscape-approved {
  size: A4 landscape;
}
.print-landscape {
  page: landscape-approved;
}

/* Sprint 14 Chapter O Part B - Capture Form UX standard (2026-09-17).
   Shared vocabulary for the "capture" family of forms (Site Capture,
   audit-checkin, audits, stock-take, cleaning surveys, incidents,
   follow-ups, quotes/costings, payroll capture) so each one stops
   inventing its own status pill / warning box / read-only-computed-row /
   subtotal styling. Reuses the EXISTING Sprint 4 status colour language
   above (.dash-status-badge/.dash-status-*) rather than adding a second
   status system - payroll-draft-edit's own local .status-badge/.status-*
   predates this and is being migrated onto these classes, not replaced
   with a third one.

   - .capture-source-tag: a small pill next to a field showing WHERE its
     current value came from - system-of-record vs a human override.
     Modifiers: .source-system (blue, e.g. "Attendance", "Stock system",
     "QR/NFC scan") and .source-manual (amber, a human-entered override -
     pair this with a required reason field and audit-trail entry, the
     existing payroll convention).
   - .capture-exception-row: a warning/error banner inside a capture
     screen (a validation problem, an out-of-range value, a blocked
     action). Put a .dash-status-red/.dash-status-amber class on it for
     severity - reuses the Sprint 4 colours, doesn't invent new ones.
   - .capture-calc-row / .capture-calc-grid: a read-only, computed
     (client-side, UX-only - the server remains the source of truth)
     preview of a total/subtotal so the person can see the effect of what
     they just typed before saving.
   - .capture-subtotal-grid: section subtotals (per site/per area/per
     category) using the same label/value tile shape as .capture-calc-grid
     so a subtotal and a live preview look like family, not two designs.
   - .capture-field-row / .capture-add-row-btn: shared spacing/sizing for
     a labelled input row and the "+ Add X" button under a repeatable
     section, so every form's repeatable rows line up the same way even
     though each form's row FIELDS stay specialised (no flattening into
     one generic form - only the shell is shared).
   - Minimum 44px touch target on capture-family buttons/inputs, and a
     capture-card layout that stacks to one column under 700px - the same
     breakpoint the rest of the app already uses. */
.capture-source-tag { display:inline-block; padding:0.1rem 0.5rem; border-radius:8px; font-size:0.68rem; font-weight:700; text-transform:uppercase; letter-spacing:0.02em; margin-left:0.4rem; vertical-align:middle; }
.capture-source-tag.source-system { background:#e3f2fd; color:#0d47a1; }
.capture-source-tag.source-manual { background:#fff4d6; color:#8a6100; }

.capture-exception-row { border-radius:8px; padding:0.55rem 0.8rem; margin:0.4rem 0; font-size:0.85rem; border:1px solid transparent; }
.capture-exception-row.dash-status-red { border-color:#f3c8c3; }
.capture-exception-row.dash-status-amber { border-color:#f0dba0; }

.capture-calc-grid, .capture-subtotal-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(120px, 1fr)); gap:0.5rem; padding:0.6rem 0.7rem; border-radius:8px; background:#f7f8fa; margin:0.4rem 0; }
.capture-calc-grid .cc-lbl, .capture-subtotal-grid .cc-lbl { font-size:0.68rem; color:#777; text-transform:uppercase; letter-spacing:0.02em; }
.capture-calc-grid .cc-val, .capture-subtotal-grid .cc-val { font-size:0.95rem; font-weight:700; color:#222; }
.capture-subtotal-grid { background:#eef2f6; }

.capture-field-row { margin-bottom:0.6rem; }
.capture-add-row-btn { min-height:44px; padding:0.5rem 1rem; border-radius:8px; border:1.5px dashed #b9bdc4; background:#fff; color:#444; font-weight:600; cursor:pointer; }
.capture-add-row-btn:hover { border-color:#8a8f99; }
.capture-remove-row-btn { min-height:36px; min-width:36px; border-radius:8px; border:1px solid #e2c4c1; background:#fdecea; color:#c0392b; cursor:pointer; }

@media (max-width: 700px) {
  .capture-card { padding:0.75rem; }
  .capture-calc-grid, .capture-subtotal-grid { grid-template-columns:repeat(2, 1fr); }
  .capture-add-row-btn, .capture-remove-row-btn, .capture-field-row input, .capture-field-row select, .capture-field-row textarea { min-height:44px; font-size:1rem; }
}

/* ===================================================================
   SPRINT 14 - Commercial Costing / Quotation Sheet standard (2026-09-18).
   Per Product Owner instruction: the quotation/costing screens (Hygiene,
   Carpet, Floor, Contract Cleaning, One-Off/Deep Clean) must look like a
   professional commercial estimating system, not developer forms or large
   raw data tables. Reuses the EXISTING design language (Sprint 4's
   .dash-status-badge colour convention, the Sprint 14 Chapter O
   .capture-source-tag origin-tag pattern) rather than inventing a new one -
   these classes are the shared "read-only costing/quotation document" skin,
   the counterpart to .capture-* which already covers the data-ENTRY side of
   the same forms. Presentation only - every number/condition below is
   whatever the caller's own already-computed totals object already
   contains; nothing here recalculates anything.
   ========================================================================== */

/* Document wrapper - replaces the near-identical local <style> block each
   costing/quote view used to define for itself (.doc / .quote-doc). Kept as
   both class names (existing markup uses one or the other) so no template
   had to rename its wrapper div. */
.doc, .quote-doc { max-width:980px; margin:0 auto; background:#fff; }
.doc h1, .quote-doc h1 { font-size:1.35rem; margin:0 0 0.2rem; }
.doc h3, .quote-doc h3 { font-size:0.95rem; margin:1.5rem 0 0.6rem; color:#1c1f24; }
.doc table, .quote-doc table { width:100%; border-collapse:collapse; font-size:0.86rem; margin-bottom:1rem; }
.doc th, .quote-doc th { text-align:left; padding:0.5rem 0.6rem; border-bottom:2px solid #e2e4e8; font-size:0.72rem; text-transform:uppercase; letter-spacing:0.02em; color:#777; font-weight:700; }
.doc td, .quote-doc td { padding:0.5rem 0.6rem; border-bottom:1px solid #f0f1f3; vertical-align:top; }
.doc tbody tr:hover td, .quote-doc tbody tr:hover td { background:#fafbfc; }
.doc .sub-total-row, .quote-doc .sub-total-row { font-weight:700; background:#f5f6f8 !important; }
.doc .sub-total-row td, .quote-doc .sub-total-row td { border-top:2px solid #e2e4e8; }
.doc .grand-total, .quote-doc .grand-total { font-weight:700; font-size:1.08rem; }
.doc .grand-total td, .quote-doc .grand-total td { border-top:2px solid #1c1f24; padding-top:0.65rem; }
.no-print { margin-bottom:1rem; }
@media print { .no-print { display:none; } .app-topbar { display:none; } }

/* Meta strip - customer/site/consultant/reference context, right under the
   H1. Replaces the old plain two-column <table> with borderless rows. */
.cq-meta-strip { display:flex; flex-wrap:wrap; gap:1.25rem; padding:0.75rem 0 1rem; margin-bottom:0.25rem; border-bottom:1px solid #eee; }
.cq-meta-strip .cq-meta-item { min-width:130px; }
.cq-meta-strip .cq-meta-label { font-size:0.68rem; text-transform:uppercase; letter-spacing:0.03em; color:#888; }
.cq-meta-strip .cq-meta-value { font-size:0.92rem; font-weight:600; color:#1c1f24; margin-top:0.1rem; }

/* Section card - one commercial section (Equipment/Consumables/Carpet
   Areas/etc), replacing a bare <h3> + full-bleed table. */
.cq-section { background:#fff; border:1px solid #eee; border-radius:12px; padding:1.1rem 1.25rem; margin-bottom:1.1rem; }
.cq-section-head { display:flex; justify-content:space-between; align-items:baseline; gap:0.75rem; margin-bottom:0.6rem; flex-wrap:wrap; }
.cq-section-head h3 { margin:0; }
.cq-section-subtotal { font-size:0.95rem; font-weight:700; color:#1c1f24; white-space:nowrap; text-align:right; }
.cq-section-subtotal .cq-subtotal-label { font-size:0.68rem; font-weight:600; text-transform:uppercase; letter-spacing:0.02em; color:#888; display:block; }

/* Area group - groups surveyed rows by the surveyed area/location
   (areaName), the primary "where on site" lens the Product Owner asked
   for on Hygiene. A row with no areaName (a manually-added row) falls into
   a final, clearly-labelled "General / manually added" group instead of
   being grouped under a blank heading. */
.cq-area-group { border:1px solid #eef0f3; border-radius:10px; margin-bottom:0.75rem; overflow:hidden; }
.cq-area-group:last-child { margin-bottom:0; }
.cq-area-head { display:flex; align-items:center; justify-content:space-between; gap:0.6rem; padding:0.55rem 0.85rem; background:#f4f6fa; font-weight:700; font-size:0.85rem; color:#33384a; flex-wrap:wrap; }
.cq-area-head .cq-area-sub { font-weight:600; font-size:0.78rem; color:#666; }
.cq-area-head.cq-area-general { background:#f7f7f8; color:#666; }

/* Line table - the actual item/qty/rate/total rows inside a section or
   area group. Wrapped in .cq-table-wrap so a genuinely wide table (many
   commercial columns - frequency, rate, escalation years) scrolls within
   itself on a narrow screen instead of blowing out the whole page, the
   same accepted "contained horizontal scroll" pattern already used for
   .emp-table. */
.cq-table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.cq-line-table { width:100%; border-collapse:collapse; font-size:0.83rem; }
.cq-line-table th { text-align:left; padding:0.45rem 0.6rem; font-size:0.68rem; text-transform:uppercase; letter-spacing:0.02em; color:#888; font-weight:700; border-bottom:2px solid #eef0f3; white-space:nowrap; }
.cq-line-table td { padding:0.5rem 0.6rem; border-bottom:1px solid #f4f5f7; vertical-align:top; }
.cq-line-table tbody tr:last-child td { border-bottom:none; }
.cq-line-table .cq-num { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.cq-line-table .cq-item-name { font-weight:600; color:#1c1f24; }
.cq-line-table .cq-item-sub { font-size:0.72rem; color:#888; margin-top:0.1rem; }
.cq-line-table tr.cq-row-flagged td { background:#fdecea; }
.cq-line-table .cq-subtotal-row td { font-weight:700; background:#f5f6f8; border-top:2px solid #e2e4e8; }
.cq-empty-row td { color:#999; text-align:center; padding:1rem; }

/* Column priority - on tablet/laptop widths and narrower (<=1024px), hide
   the least-essential columns (multi-year escalation, depreciation detail)
   rather than crushing every column or forcing the whole page to scroll;
   the figures stay available via Edit/full view. Item/qty/rate/total -
   the core "what am I paying for" columns - are never hidden. Widened from
   an original 760px breakpoint after tablet-width (900px) review showed
   the Source/Status column being pushed out of view on the 10-column
   Hygiene equipment table. */
@media (max-width: 1024px) {
  .cq-col-hide-sm { display:none; }
}
@media (max-width: 760px) {
  .cq-meta-strip { gap:0.75rem 1.25rem; }
  .cq-section { padding:0.85rem 0.9rem; }
}

/* Totals card - the commercial bottom line, made visually obvious without
   turning the page into a KPI dashboard (one card, not a tile grid). */
.cq-totals-card { background:#f7f8fa; border-radius:12px; padding:1rem 1.25rem; margin-top:0.5rem; }
.cq-totals-card .cq-t-row { display:flex; justify-content:space-between; padding:0.2rem 0; font-size:0.88rem; color:#444; }
.cq-totals-card .cq-t-row.cq-t-grand { font-weight:700; font-size:1.15rem; color:#1c1f24; border-top:1px solid #dde0e5; margin-top:0.4rem; padding-top:0.6rem; }
.cq-totals-card .cq-t-row .cq-t-val { font-variant-numeric:tabular-nums; }

/* Warning / status banners - reuses the Sprint 4 status colours
   (.dash-status-red/-amber) rather than the old per-view inline
   background/border/emoji combinations, so a stale-survey warning looks
   the same everywhere it appears (Hygiene, Carpet, Floor, One-Off,
   Contract Cleaning quotes) instead of each view inventing its own. */
.cq-warning-banner { border-radius:10px; padding:0.7rem 1rem; margin-bottom:1rem; font-size:0.85rem; font-weight:600; display:flex; gap:0.5rem; align-items:flex-start; }
.cq-warning-banner.dash-status-amber { background:#fff4d6; color:#6b5200; }
.cq-warning-banner.dash-status-red { background:#fdecea; color:#a5271b; }
.cq-warning-banner.dash-status-green { background:#eaf6ea; color:#1e7e34; }
.cq-warning-banner .cq-warning-icon { flex:0 0 auto; }

/* Internal-only tag - a section visible to staff but never sent to the
   customer (Labour cost, Commission, Management Review). Same visual
   weight as .capture-source-tag so it reads as the same design language,
   not a new one. */
.cq-internal-tag { display:inline-block; padding:0.1rem 0.5rem; border-radius:8px; font-size:0.66rem; font-weight:700; text-transform:uppercase; letter-spacing:0.02em; margin-left:0.5rem; vertical-align:middle; background:#e9eaee; color:#555; }

/* Primary/secondary action bar - one obvious next action, the rest kept
   visually secondary (per instruction "avoid large collections of equally
   prominent buttons"). */
.cq-action-bar { display:flex; justify-content:flex-end; align-items:center; gap:0.5rem; margin-bottom:1rem; flex-wrap:wrap; }
.cq-action-bar button, .cq-action-bar a button { width:auto; padding:0.5rem 1.1rem; }

@media (max-width: 760px) {
  .cq-action-bar { justify-content:flex-start; }
}

/* Sprint 14 - Staff Loans UX redesign (2026-09-18). Product Owner rejected
   the raw wide table/busy inline forms, not the underlying loan maths -
   see lib/staffLoans.js. Reuses the existing .dash-tile-grid/.dash-status-
   badge/.dash-field-row/.dash-tab-strip vocabulary above rather than
   inventing a Staff-Loans-only design. .loan-row-card replaces the old
   12-column .emp-table on the landing/report page with a responsive
   card-per-loan row (no forced horizontal scroll on a normal desktop/
   laptop/tablet width) while a properly structured table remains fine
   elsewhere (e.g. the ledger inside Loan Detail's Transaction History
   tab, which is naturally narrow-column). */
.loan-row-card { border:1px solid #eee; border-radius:10px; padding:0.85rem 1rem; margin-bottom:0.75rem; }
.loan-row-head { display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; gap:0.6rem; }
.loan-row-head .loan-row-employee { font-weight:700; font-size:0.98rem; }
.loan-row-head .loan-row-employee a { color:#1c1f24; text-decoration:none; }
.loan-row-head .loan-row-employee a:hover { text-decoration:underline; }
.loan-row-head .loan-row-sub { color:#777; font-size:0.78rem; margin-top:0.15rem; }
.loan-row-balance { text-align:right; }
.loan-row-balance .loan-row-balance-figure { font-weight:700; font-size:1.05rem; }
.loan-row-balance .loan-row-balance-sub { color:#777; font-size:0.76rem; }
.loan-row-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:0.5rem 0.9rem; margin:0.6rem 0; font-size:0.82rem; }
.loan-row-grid .lrl { color:#888; font-size:0.68rem; text-transform:uppercase; letter-spacing:0.02em; }
.loan-row-grid .lrv { margin-top:0.1rem; }
.loan-row-actions { display:flex; gap:0.5rem; flex-wrap:wrap; margin-top:0.5rem; border-top:1px solid #f5f5f5; padding-top:0.5rem; }
@media (max-width:700px) {
  .loan-row-head { flex-direction:column; }
  .loan-row-balance { text-align:left; }
}
/* Shared capture-sheet presentation */
/* SPRINT 14 ACCEPTANCE CORRECTION H (2026-10-03) - Global app-wide UI /
   look-and-feel standardisation.
   Investigation finding: data-entry capture sheets across the app (audits,
   incidents, leave, stock, assets, training, site capture, etc.) each grew
   their own inline <style> blocks and ad-hoc inline style="" attributes
   independently - there was never one canonical set of classes for a
   capture form's card/section/label/input/button, so the same kind of
   element (e.g. a primary Save button, or a section sub-heading) can look
   slightly different from one form to the next. These classes are the
   single canonical standard every capture-sheet form should converge on
   going forward: a .form-card wraps a section, .form-section-title is the
   sub-heading inside it, .form-field/.form-field-label/.form-field-input
   are the label+input pair, and .btn/.btn-primary/.btn-secondary/
   .btn-danger are the three button treatments every form should reuse
   instead of inventing a new inline color. This is additive only - no
   existing page's current classes/inline styles are removed or
   overridden by adding these, so nothing already Green regresses. Rolling
   every existing inline-styled view over to these classes is a larger,
   page-by-page follow-on (tracked in FEATURE_TRACKER.md under
   "Standardised capture sheets") - this establishes the one standard that
   follow-on work converges on, rather than each future page inventing its
   own look again. */
.form-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  margin-bottom: 1.25rem;
}
.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #222;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}
.form-field { margin-bottom: 0.9rem; }
.form-field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
}
.form-field-input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: #2c7a2c; color: #fff; }
.btn-secondary { background: #eee; color: #333; }
.btn-danger { background: #a83232; color: #fff; }
