/* S4W Office — design system. Flat, neutral grays/whites with one accent
   (S4W navy). IBM Plex Sans throughout; IBM Plex Mono reserved for genuine
   tabular/data text (timestamps, statement figures). All component class
   names are preserved from the previous stylesheet. */

/* ── Self-hosted fonts (offline) ─────────────────────────────────────────── */
@font-face{font-family:'Fraunces';src:url('/static/fonts/fraunces-400.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap;}
@font-face{font-family:'Fraunces';src:url('/static/fonts/fraunces-400-italic.woff2') format('woff2');font-weight:400;font-style:italic;font-display:swap;}
@font-face{font-family:'Fraunces';src:url('/static/fonts/fraunces-600.woff2') format('woff2');font-weight:600;font-style:normal;font-display:swap;}
@font-face{font-family:'Fraunces';src:url('/static/fonts/fraunces-700.woff2') format('woff2');font-weight:700;font-style:normal;font-display:swap;}
@font-face{font-family:'IBM Plex Sans';src:url('/static/fonts/ibm-plex-sans-400.woff2') format('woff2');font-weight:400;font-display:swap;}
@font-face{font-family:'IBM Plex Sans';src:url('/static/fonts/ibm-plex-sans-500.woff2') format('woff2');font-weight:500;font-display:swap;}
@font-face{font-family:'IBM Plex Sans';src:url('/static/fonts/ibm-plex-sans-600.woff2') format('woff2');font-weight:600;font-display:swap;}
@font-face{font-family:'IBM Plex Sans';src:url('/static/fonts/ibm-plex-sans-700.woff2') format('woff2');font-weight:700;font-display:swap;}
@font-face{font-family:'IBM Plex Mono';src:url('/static/fonts/ibm-plex-mono-400.woff2') format('woff2');font-weight:400;font-display:swap;}
@font-face{font-family:'IBM Plex Mono';src:url('/static/fonts/ibm-plex-mono-500.woff2') format('woff2');font-weight:500;font-display:swap;}
@font-face{font-family:'IBM Plex Mono';src:url('/static/fonts/ibm-plex-mono-600.woff2') format('woff2');font-weight:600;font-display:swap;}

:root {
  --font-display:'IBM Plex Sans','Segoe UI',system-ui,sans-serif;
  --font-ui:'IBM Plex Sans','Segoe UI',system-ui,sans-serif;
  --font-data:'IBM Plex Mono',ui-monospace,'Cascadia Code',Consolas,monospace;

  /* Single interactive accent — S4W brand navy. (Modern styling kept; only the hue.) */
  --accent:      #01004C;
  --accent-600:  #15146a;        /* hover / pressed */
  --accent-weak: rgba(1,0,76,.08);  /* soft tint fills */
  --ring:        rgba(1,0,76,.28);  /* focus glow */
  --brand:  #01004C;     /* S4W brand navy — logo / identity marks */
  --navy:   var(--accent); /* legacy alias of the accent (navy) */

  --ink:    #1d1d1f;     /* body / heading text */
  --muted:  #6b7280;
  --red:    #c0392b;
  --green:  #1f7a52;
  --amber:  #b07d12;
  --blue:   #1f6feb;     /* en-route / live */
  --line:   rgba(0,0,0,.07);   /* hairline */
  --bg:     #F5F5F7;     /* app canvas */
  --paper2: #ECECEF;
  --card:   #ffffff;
  /* Materials (glassmorphism) */
  --glass:     rgba(255,255,255,.72);
  --glass-brd: rgba(0,0,0,.06);
  --blur:      saturate(180%) blur(20px);
  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --shadow:    0 1px 2px rgba(0,0,0,.04), 0 8px 24px -10px rgba(0,0,0,.10);
  --shadow-md: 0 2px 6px rgba(0,0,0,.06), 0 18px 40px -16px rgba(0,0,0,.18);
  --sb:     var(--glass);     /* sidebar is now theme-adaptive glass */
  /* aliases kept for older components */
  --border: var(--line);
  --text:   var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  color: var(--ink); line-height: 1.55;
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .25s ease, color .25s ease;   /* smooth theme switch */
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
h1,h2,h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; }

/* ── macOS-style focus ring (keyboard users) ─────────────────── */
:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); border-radius: var(--radius-sm); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }

/* ── Utility layer (replaces repetitive inline styles in the views) ─ */
.t-right { text-align: right; }
.t-center { text-align: center; }
.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.neg { color: var(--red); font-weight: 600; }
.pos { color: var(--green); font-weight: 600; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.flex1 { flex: 1; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.w100 { width: 100%; }
/* progress/meter fill: set width via the inline custom prop --w (e.g. style="--w:68%") */
.meter { height: 6px; border-radius: 999px; background: var(--accent-weak); overflow: hidden; }
.meter > span { display: block; height: 100%; width: var(--w, 0%); background: var(--accent); border-radius: inherit; }

/* ── Reduced-motion: respect the OS setting ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Top bar (glass material) ─────────────────────────────── */
header.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  color: var(--ink);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px; height: 56px;
  border-bottom: 1px solid var(--glass-brd);
}
.topbar .spacer { flex: 1; }
.topbar .stamp { color: var(--muted); font-size: 11.5px; font-family: var(--font-data);
  letter-spacing: .2px; }
.sb-hamburger { display: none; }

/* ── Sidebar ──────────────────────────────────────────────── */
body.has-sidebar { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: none;
  position: fixed; left: 0; top: 0; bottom: 0;
  background: var(--sb); color: var(--ink);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-right: 1px solid var(--glass-brd);
  display: flex; flex-direction: column;
  overflow: hidden; transition: width .2s ease;
  z-index: 50;
}
.app-body { flex: 1; margin-left: 240px; display: flex; flex-direction: column;
  min-height: 100vh; transition: margin-left .2s ease; }
html.sb-collapsed .sidebar { width: 56px; }
html.sb-collapsed .app-body { margin-left: 56px; }
html.sb-collapsed .sb-label, html.sb-collapsed .sb-group-label { opacity: 0; pointer-events: none; }
html.sb-collapsed .sb-brand span { display: none; }
html.sb-collapsed .sb-logo { display: none; }
html.sb-collapsed .sb-toggle { transform: rotate(180deg); }
.sb-top { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--glass-brd);
  flex-shrink: 0; min-height: 54px; }
.sb-brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none;
  color: var(--ink); white-space: nowrap; overflow: hidden; }
.sb-brand:hover { text-decoration: none; }
.sb-brand b { position: relative; font-family: var(--font-display); font-weight: 700;
  font-size: 19px; letter-spacing: -.01em; padding-bottom: 5px; flex-shrink: 0; }
.sb-brand b::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand) 0 34%, var(--red) 34% 67%, var(--green) 67% 100%); }
.sb-brand span { font-family: var(--font-ui); font-weight: 500; font-size: 10px;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.sb-logo { max-width: 130px; height: auto; display: block; }
.sb-toggle { background: transparent; border: none; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 4px; border-radius: 8px;
  flex-shrink: 0; transition: color .12s, transform .2s ease, background .12s; }
.sb-toggle:hover { color: var(--ink); background: var(--accent-weak); }
.sb-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sb-group { padding-top: 12px; }
.sb-group-label { display: block; padding: 0 18px 6px; font-family: var(--font-ui);
  font-size: 10.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); opacity: .8; white-space: nowrap; overflow: hidden; transition: opacity .15s; }
.sb-link { display: flex; align-items: center; gap: 10px; margin: 1px 8px; padding: 8px 12px;
  border-radius: 10px; color: var(--muted); font-size: 13.5px; font-weight: 500; text-decoration: none;
  transition: background .15s ease, color .15s ease, transform .08s ease; position: relative;
  white-space: nowrap; overflow: hidden; }
.sb-link:hover { background: var(--accent-weak); color: var(--ink); text-decoration: none; }
.sb-link:active { transform: scale(.98); }
.sb-link.active { background: var(--card); color: var(--accent); font-weight: 600;
  box-shadow: var(--shadow); border: 1px solid var(--glass-brd); }
.sb-icon { width: 18px; height: 18px; flex: none; opacity: .7; }
.sb-link.active .sb-icon { opacity: 1; color: var(--accent); }
.sb-link:hover .sb-icon { opacity: 1; }
.sb-label { transition: opacity .15s; }
.sb-bottom { padding: 8px 0 10px; border-top: 1px solid var(--glass-brd); flex-shrink: 0; }

/* ── Layout ──────────────────────────────────────────────── */
main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 36px 40px 80px; }
/* Page header — echoes the branded-document letterhead: a short navy accent tab
   sits under the title, over a light hairline that runs the width of the page. */
.page-head { position: relative; display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 32px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.page-head::after { content: ""; position: absolute; left: 0; bottom: -1px;
  width: 46px; height: 2px; background: var(--accent); border-radius: 2px; }
.page-head h1 { font-size: 27px; margin: 0; color: var(--ink); letter-spacing: -.02em; }
.page-head .count { color: var(--muted); font-weight: 500; font-size: 13px;
  font-family: var(--font-ui); }
.crumb { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; font-family: var(--font-ui); }
.crumb a { color: var(--muted); }

/* ── Cards / grid ────────────────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card { position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
a.card:hover, .card.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi .card { display: flex; flex-direction: column; gap: 6px; }
.kpi .num { font-family: var(--font-display); font-size: 32px; font-weight: 700;
  color: var(--navy); line-height: 1; letter-spacing: -.02em; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 500; font-family: var(--font-ui); }
.kpi a.card:hover { border-color: var(--glass-brd); text-decoration: none; }
.card h2 { font-size: 16px; margin: 0 0 12px; color: var(--ink); }
.card[draggable="true"] > h2 { cursor: grab; user-select: none; }
.card[draggable="true"] > h2::before { content: "⠿"; color: var(--muted); margin-right: 7px;
  font-size: 13px; letter-spacing: -1px; }
.card.dragging { opacity: .4; }
.card.drag-over { outline: 2px dashed var(--navy); outline-offset: 3px; }

/* ── Search ──────────────────────────────────────────────── */
.search { position: relative; flex: 1; max-width: 420px; }
.search input { width: 100%; padding: 11px 14px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }

/* ── Tables ──────────────────────────────────────────────── */
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line);
  font-family: var(--font-ui); font-weight: 600; }
table.list td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 14px;
  vertical-align: top; }
table.list tr:last-child td { border-bottom: none; }
table.list tbody tr:hover { background: var(--paper2); }
.list .name { font-weight: 600; color: var(--navy); }
.list .sub { color: var(--muted); font-size: 13px; }
.list-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; }
.list-card.h-scroll { overflow-x: auto; }
.list-card.h-scroll select { max-width: 220px; }

/* ── Pills — status badges ───────────────────────────────── */
.pill { display: inline-block; padding: 3px 9px; border-radius: var(--radius-sm); font-family: var(--font-ui);
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px;
  border: 1px solid transparent; }
.pill.paid     { background: #e3f1e9; color: var(--green); border-color: #bfe0cd; }
.pill.unpaid   { background: #f8e7e4; color: var(--red);   border-color: #ecc5be; }
.pill.due      { background: #f6eed8; color: var(--amber); border-color: #e4d4a6; }
.pill.quoted   { background: #e6e6f0; color: var(--navy);  border-color: #c9c9de; }
.pill.accepted { background: #e3f1e9; color: var(--green); border-color: #bfe0cd; }
.pill.complete { background: #ebe8df; color: var(--muted); border-color: #d8d1c0; }
.pill.contract { background: #e4ecfa; color: #1a4fb0;      border-color: #c2d4f1; }
.pill.type     { background: #e6e6f0; color: var(--navy);  border-color: #c9c9de; }
.pill.active   { background: #e3f1e9; color: var(--green); border-color: #bfe0cd; }
.pill.soon     { background: #f6eed8; color: var(--amber); border-color: #e4d4a6; }
.pill.overdue  { background: #f8e7e4; color: var(--red);   border-color: #ecc5be; }
.pill.expired  { background: #ebe8df; color: var(--muted); border-color: #d8d1c0; }
.pill.cancelled{ background: #ebe8df; color: var(--muted); border-color: #d8d1c0; }
/* visit / dispatch statuses */
.pill.scheduled{ background: #e6e6f0; color: var(--navy);  border-color: #c9c9de; }
.pill.en_route { background: #e4ecfa; color: var(--blue);  border-color: #c2d4f1; }
.pill.on_site  { background: #e3f1e9; color: var(--green); border-color: #bfe0cd; }
.pill.completed{ background: #ebe8df; color: var(--muted); border-color: #d8d1c0; }
.pill.no_access{ background: #f8e7e4; color: var(--red);   border-color: #ecc5be; }

/* ── Filter chips ────────────────────────────────────────── */
.chips { display: flex; gap: 6px; }
.chip { display: inline-block; padding: 5px 12px; border-radius: var(--radius-sm); font-size: 12.5px;
  font-weight: 500; color: var(--muted); border: 1px solid var(--line); background: var(--card);
  font-family: var(--font-ui); }
.chip:hover { color: var(--accent); text-decoration: none; border-color: var(--glass-brd); }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── Forms — letterhead-matching refresh ─────────────────── */
form.form { display: block; }
/* Give a form rendered as a card more breathing room + a subtle navy top edge
   so on-screen forms read like the branded documents they produce. */
form.form.card { padding: 26px 28px; }
form.form.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--accent); border-radius: var(--radius) var(--radius) 0 0; opacity: .9; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px 20px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.fld > span { color: var(--ink); font-weight: 600; font-size: 12px; letter-spacing: .01em; }
.fld input, .fld select, form.form textarea { padding: 10px 12px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.fld input:hover, .fld select:hover, form.form textarea:hover { border-color: var(--glass-brd); }
.fld input:focus, .fld select:focus, form.form textarea:focus { outline: none;
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.fld input:disabled, .fld select:disabled, form.form textarea:disabled {
  background: var(--paper2); color: var(--muted); cursor: not-allowed; }
.fld input::placeholder, form.form textarea::placeholder { color: var(--muted); opacity: .7; }
form.form textarea { width: 100%; resize: vertical; }
.fld.check { flex-direction: row; align-items: center; gap: 9px; }
.fld.check input { width: auto; }
.fld.check span { color: var(--ink); font-weight: 500; }

/* ── Checklist ───────────────────────────────────────────── */
.checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.chk { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; background: var(--card); }
.chk input { width: auto; }

/* ── Command Center ──────────────────────────────────────── */
.grid.widgets { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.kpi .card .sub { color: var(--muted); font-size: 12px; font-weight: 500; font-family: var(--font-ui); }
svg.chart { display: block; margin: 4px 0 2px; }
svg.chart .bl { fill: var(--muted); font-size: 11px; font-family: var(--font-data); }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 70px; text-align: center; padding: 12px 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--card); }
.stat .num { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--navy);
  line-height: 1; }
.stat .label { color: var(--muted); font-size: 10.5px; font-weight: 500; margin-top: 4px;
  font-family: var(--font-ui); }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
svg.donut { flex: none; }
.legend { display: grid; gap: 6px; font-size: 13px; min-width: 150px; }
.leg { display: flex; align-items: center; gap: 8px; }
.leg .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }

/* ── Inline add-forms ────────────────────────────────────── */
details.addform { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
details.addform summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--navy);
  list-style: none; display: inline-block; padding: 4px 0; font-family: var(--font-ui); }
details.addform summary::-webkit-details-marker { display: none; }
details.addform summary:hover { text-decoration: underline; }
details.addform[open] summary { margin-bottom: 8px; }
form.mini { margin-top: 4px; }
form.mini .form-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
form.mini .fld span { font-size: 12px; }
form.mini input, form.mini select { padding: 7px 9px; font-size: 13px; }
.addrow { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; }
.addrow details.addform { flex: 1; min-width: 220px; border-top: none; padding-top: 0; }

/* ── Inline row edit/delete ──────────────────────────────── */
.rowact { display: inline-flex; gap: 8px; margin-left: 8px; font-size: 12px; white-space: nowrap; }
.rowact a { color: var(--muted); font-weight: 600; }
.rowact a:hover { color: var(--navy); }
.linkbtn { background: none; border: none; padding: 0; cursor: pointer; color: var(--muted);
  font-weight: 600; font-size: 12px; font-family: inherit; }
.linkbtn:hover { color: var(--red); text-decoration: underline; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: #f8e7e4; border-color: #ecc5be; }

/* ── Detail ──────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 14px; font-size: 14px; }
.kv .k { color: var(--muted); font-weight: 500; font-family: var(--font-ui); font-size: 12.5px; }
.section-title { font-family: var(--font-ui); font-size: 13px; color: var(--ink);
  margin: 18px 0 12px; font-weight: 600; letter-spacing: .01em;
  padding-left: 10px; border-left: 3px solid var(--accent); line-height: 1.2; }
.empty { color: var(--muted); font-style: italic; padding: 8px 0; }
.doclink { display: block; padding: 6px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.doclink:last-child { border-bottom: none; }
.doc-kind { color: var(--muted); font-size: 11.5px; margin-left: 6px; font-family: var(--font-ui); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn { display: inline-block; padding: 8px 15px; border-radius: var(--radius-sm); font-size: 13px;
  font-weight: 500; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  cursor: pointer; text-decoration: none; font-family: var(--font-ui);
  transition: background .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease; }
.btn:hover { background: var(--paper2); border-color: var(--glass-brd); text-decoration: none;
  transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 2px 10px -2px var(--ring); }
.btn.primary:hover { background: var(--accent-600); border-color: var(--accent-600); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--accent-weak); border-color: var(--glass-brd); }
.btn:disabled, .btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed;
  pointer-events: none; box-shadow: none; transform: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
form.inline { display: inline; margin: 0; }
.flash { background: #e3f1e9; color: var(--green); border: 1px solid #bfe0cd; padding: 10px 14px;
  border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 600; border-left: 4px solid var(--green); }
.flash.warn { background: #fbf2dd; color: #8a6d00; border-color: #ecd9a3; border-left-color: var(--amber); }
:root[data-theme="dark"] .flash.warn { background: #2b2410; color: #f0c860; border-color: #4a3d16; }
.mail { white-space: pre-wrap; font-family: var(--font-data); font-size: 13px; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 16px; line-height: 1.6; }

/* ── Top-bar search ──────────────────────────────────────── */
.topsearch { margin: 0; }
.topsearch input { width: 220px; padding: 8px 13px; font-size: 13px; color: var(--ink);
  background: var(--accent-weak); border: 1px solid transparent; border-radius: var(--radius-sm);
  font-family: var(--font-ui); transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.topsearch input::placeholder { color: var(--muted); }
.topsearch input:focus { outline: none; background: var(--card); border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring); }

@media (max-width: 820px) {
  .detail-grid { grid-template-columns: 1fr; }
  .topbar { gap: 10px; padding: 0 14px; }
  .topsearch input { width: 120px; }
  .stamp { display: none; }
  .list-card { overflow-x: auto; }
  table.list { min-width: 560px; }
  main { padding: 18px 14px 48px; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease, width .2s ease; }
  body.sb-open .sidebar { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.4); }
  .app-body { margin-left: 0 !important; }
  .sb-hamburger { display: flex !important; }
}

/* ── "Today" workboard ───────────────────────────────────── */
/* ── Dashboard overnight brief (scheduler + live queue) ───────────────────── */
.overnight-brief { margin-bottom: 16px; padding: 14px 18px; border-left: 3px solid var(--navy);
  background: var(--paper2); }
.ob-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.ob-list { margin: 0; padding-left: 18px; }
.ob-list li { margin: 4px 0; font-size: 14px; }
.ob-list a { font-weight: 500; }

.grid.work { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card.wb { padding: 0; overflow: hidden; display: flex; flex-direction: column;
  border-left: 3px solid var(--muted); }
.card.wb.overdue { border-left-color: var(--red); }
.card.wb.soon    { border-left-color: var(--amber); }
.card.wb.active  { border-left-color: var(--green); }
.card.wb.type    { border-left-color: var(--navy); }
.wb-head { display: flex; align-items: center; gap: 8px; padding: 13px 16px 10px;
  border-bottom: 1px solid var(--line); }
.wb-icon { font-size: 16px; }
.wb-title { font-weight: 600; font-size: 14px; font-family: var(--font-display); }
.wb-count { background: var(--navy); color: #fff; font-size: 11px; font-weight: 600; border-radius: 4px;
  padding: 1px 7px; font-family: var(--font-ui); }
.wb.overdue .wb-count { background: var(--red); }
.wb.soon    .wb-count { background: var(--amber); }
.wb.active  .wb-count { background: var(--green); }
.wb-total { margin-left: auto; font-weight: 700; color: var(--navy); font-size: 16px;
  font-family: var(--font-display); }
.wb-items { display: flex; flex-direction: column; padding: 4px 0; flex: 1; }
a.wb-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 16px; color: var(--ink);
  text-decoration: none; border-bottom: 1px solid var(--line); }
a.wb-item:last-child { border-bottom: none; }
a.wb-item:hover { background: var(--paper2); text-decoration: none; }
.wb-it-text { font-weight: 500; font-size: 13.5px; }
.wb-more { padding: 6px 16px; }
.wb-foot { padding: 10px 16px; border-top: 1px solid var(--line); }
.wb-foot:empty { display: none; }
.card.allclear { display: flex; align-items: center; gap: 16px; }
.ac-tick { font-size: 26px; color: var(--green); font-weight: 800; width: 46px; height: 46px; flex: none;
  border-radius: 50%; background: #e3f1e9; display: flex; align-items: center; justify-content: center; }

/* ── Notes & tasks ───────────────────────────────────────── */
.tasks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.task { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--card); }
.task.overdue { border-color: #ecc5be; background: #faf0ee; }
.task.done { opacity: .55; }
.task.done .task-title { text-decoration: line-through; }
.task-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.task-title { font-weight: 500; font-size: 13.5px; }
.task-act { display: flex; align-items: center; gap: 8px; }
.notes { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 8px; }
.note { border-left: 3px solid var(--accent); padding: 2px 0 2px 10px; }
.note-body { font-size: 13.5px; white-space: pre-wrap; }
.note-meta { display: flex; align-items: center; gap: 10px; }

/* ── Document builder ────────────────────────────────────── */
fieldset.dg-sec { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 0 0 16px;
  background: var(--card); }
fieldset.dg-sec legend { font-family: var(--font-display); font-weight: 600; color: var(--navy);
  padding: 0 8px; font-size: 15px; }
.dg-rep { margin-top: 6px; }
.dg-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.dg-cell { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 110px; }
.dg-cell span { font-size: 11px; color: var(--muted); font-family: var(--font-ui); }
.dg-cell input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }

/* ── Reports filter ──────────────────────────────────────── */
.docfilter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.docfilter select, .docfilter input[type=search] { padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 13px; font-family: inherit; }

/* ── Health card ─────────────────────────────────────────── */
.health-card { border-left: 4px solid var(--red); }

/* ── Topbar icon button ──────────────────────────────────── */
.gear { color: var(--muted); font-size: 18px; text-decoration: none; padding: 0 4px; }
.gear:hover { color: var(--navy); text-decoration: none; }

/* ── Finance ─────────────────────────────────────────────── */
.payform { display: inline-flex; gap: 6px; align-items: center; }
.payform input[type=number] { width: 84px; padding: 5px 7px; font-size: 13px; font-family: var(--font-data);
  border: 1px solid var(--line); border-radius: 6px; }

/* ── Statement ───────────────────────────────────────────── */
.statement { max-width: 820px; }
.st-head { display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 2px solid var(--navy); padding-bottom: 12px; margin-bottom: 14px; }
.st-co { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--navy); }
.st-title { text-align: right; }
.st-title h2 { margin: 0; color: var(--navy); }
.st-to { margin-bottom: 14px; }
.st-table tfoot td { border-top: 2px solid var(--line); padding-top: 8px; }
.st-foot { margin-top: 16px; }

/* ── Timeline ────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 26px 92px 1fr; align-items: baseline; gap: 8px;
  padding: 6px 0; border-bottom: 1px dashed var(--line); }
.tl-item:last-child { border-bottom: none; }
.tl-icon { text-align: center; }
.tl-date { color: var(--muted); font-size: 12px; font-family: var(--font-data); }
.tl-text { font-size: 13.5px; }

/* ── Quick-add + icon button ─────────────────────────────── */
.quickadd { position: relative; }
.quickadd > summary { list-style: none; cursor: pointer; }
.quickadd > summary::-webkit-details-marker { display: none; }
.qa-menu { position: absolute; right: 0; top: 46px; background: var(--glass); color: var(--ink);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-brd); border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 185px; padding: 6px; z-index: 60; display: flex; flex-direction: column;
  animation: pop .14s ease; transform-origin: top right; }
.qa-menu a { padding: 8px 10px; border-radius: 9px; color: var(--ink); font-size: 14px;
  transition: background .12s ease; }
.qa-menu a:hover { background: var(--accent-weak); color: var(--accent); text-decoration: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.iconbtn { background: transparent; border: none; color: var(--muted); font-size: 16px; cursor: pointer;
  padding: 0 4px; border-radius: 9px; transition: color .12s ease, transform .08s ease; }
.iconbtn:hover { color: var(--accent); }
.iconbtn:active { transform: scale(.9); }

/* ── Calendar ────────────────────────────────────────────── */
.cal-legend { display: flex; gap: 8px; margin-bottom: 12px; }
table.cal { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--card); }
table.cal th { background: var(--paper2); color: var(--muted); font-family: var(--font-ui); font-weight: 600;
  font-size: 11px; letter-spacing: .6px; text-transform: uppercase; padding: 7px; }
table.cal td { border: 1px solid var(--line); vertical-align: top; height: 98px; padding: 4px; }
table.cal td.other { background: var(--paper2); }
table.cal td.other .cal-num { color: #b3b8c2; }
table.cal td.today { background: #eef0fb; }
.cal-num { font-size: 12px; font-weight: 600; color: var(--muted); text-align: right;
  font-family: var(--font-data); }
td.today .cal-num { color: var(--navy); }
.cal-evs { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
a.cal-ev { display: block; font-size: 11px; padding: 2px 5px; border-radius: 4px; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
a.cal-ev:hover { text-decoration: none; opacity: .9; }
a.cal-ev.soon { background: var(--amber); }
a.cal-ev.type { background: var(--navy); }
a.cal-ev.overdue { background: var(--red); }
a.cal-ev.active { background: var(--green); }

/* ── Motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Dark mode — pure black + elevated grays (Apple HIG) ──── */
:root[data-theme="dark"] {
  --ink: #f5f5f7; --muted: #98989d; --line: rgba(255,255,255,.10);
  --bg: #000000; --paper2: #2C2C2E; --card: #1C1C1E;
  /* Pure navy is invisible on black — use a lighter periwinkle-navy for the dark accent. */
  --accent: #8aa0e6; --accent-600: #a6b6ef;
  --accent-weak: rgba(138,160,230,.16); --ring: rgba(138,160,230,.45);
  --glass: rgba(28,28,30,.66); --glass-brd: rgba(255,255,255,.10);
  --shadow: 0 1px 0 rgba(0,0,0,.4), 0 14px 40px -12px rgba(0,0,0,.7);
  --shadow-md: 0 10px 30px -8px rgba(0,0,0,.7);
  --sb: var(--glass);
}
:root[data-theme="dark"] body { color: var(--ink); }
/* navy-as-text uses get a pale ink in dark mode (navy stays a dark bg) */
:root[data-theme="dark"] a, :root[data-theme="dark"] .list .name,
:root[data-theme="dark"] .kpi .num, :root[data-theme="dark"] .stat .num,
:root[data-theme="dark"] .page-head h1, :root[data-theme="dark"] .card h2,
:root[data-theme="dark"] .wb-total, :root[data-theme="dark"] details.addform summary,
:root[data-theme="dark"] .survey-card .flabel, :root[data-theme="dark"] fieldset.dg-sec legend,
:root[data-theme="dark"] .st-co, :root[data-theme="dark"] .st-title h2,
:root[data-theme="dark"] .crumb a, :root[data-theme="dark"] .gear:hover,
:root[data-theme="dark"] .iconbtn:hover { color: #adc6ff; }
:root[data-theme="dark"] .btn { color: var(--ink); border-color: var(--line); background: var(--paper2); }
:root[data-theme="dark"] .btn:hover { background: #242832; border-color: #323845; }
:root[data-theme="dark"] .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary:hover { background: var(--accent-600); border-color: var(--accent-600); }
:root[data-theme="dark"] .fld input, :root[data-theme="dark"] .fld select,
:root[data-theme="dark"] .fld textarea, :root[data-theme="dark"] textarea,
:root[data-theme="dark"] .search input, :root[data-theme="dark"] .topsearch input,
:root[data-theme="dark"] .payform input[type=number] {
  background: #12141a; color: var(--ink); border-color: var(--line); }
:root[data-theme="dark"] table.list tbody tr:hover,
:root[data-theme="dark"] a.wb-item:hover { background: rgba(255,255,255,.05); }
:root[data-theme="dark"] .qa-menu a:hover { background: var(--paper2); }
:root[data-theme="dark"] table.cal td.other { background: rgba(255,255,255,.03); }
:root[data-theme="dark"] table.cal td.today { background: #18223a; }
:root[data-theme="dark"] td.today .cal-num { color: #9db8ff; }
:root[data-theme="dark"] .flash { background: #0e3a2a; border-color: #1f7a52; color: #9fe6c2; }

/* ── Login — title sheet ─────────────────────────────────── */
body.login-body { display:flex; align-items:center; justify-content:center; min-height:100vh;
  background: var(--bg); }
.login-box { background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:36px 34px 28px; width:100%; max-width:360px; box-shadow:var(--shadow);
  text-align:center; }
.login-brand { display:inline-flex; align-items:baseline; gap:9px; color:var(--brand); }
.login-brand b { position:relative; font-family:var(--font-display); font-size:32px; font-weight:700;
  letter-spacing:-.01em; padding-bottom:7px; }
.login-brand b::after { content:""; position:absolute; left:0; right:0; bottom:0; height:2px; border-radius:2px;
  background:linear-gradient(90deg,var(--brand) 0 34%,var(--red) 34% 67%,var(--green) 67% 100%); }
.login-brand span { font-family:var(--font-ui); font-size:12px; font-weight:500; letter-spacing:1px;
  text-transform:uppercase; color:var(--muted); }
.login-sub { margin:14px 0 22px; font-size:.9rem; color:var(--muted); }
.login-label { display:flex; flex-direction:column; gap:6px; font-size:.8rem; font-weight:600;
  color:var(--muted); margin-bottom:18px; text-align:left; font-family:var(--font-ui); }
.login-input { padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-sm); font-size:1rem;
  background:var(--bg); color:var(--text); width:100%; box-sizing:border-box; font-family:var(--font-ui);
  transition:border-color .15s ease, box-shadow .15s ease; }
.login-input:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 4px var(--ring); }
.login-btn { width:100%; padding:12px; font-size:1rem; }
.login-error { background:#f8e7e4; border:1px solid #ecc5be; border-radius:8px; color:var(--red);
  padding:9px 12px; font-size:.85rem; margin-bottom:16px; text-align:left; }
.login-foot { margin:22px 0 0; font-size:.72rem; color:var(--muted); letter-spacing:.2px;
  font-family:var(--font-ui); }

/* ── Public acceptance page ──────────────────────────────── */
body.accept-body { display:flex; align-items:flex-start; justify-content:center; min-height:100vh;
  padding:32px 16px; background: var(--bg); }
.accept-card { background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:30px 30px 24px; width:100%; max-width:520px; box-shadow:var(--shadow);
  text-align:center; }
.accept-brand { display:inline-flex; align-items:baseline; gap:9px; color:var(--brand); margin-bottom:8px; }
.accept-brand b { position:relative; font-family:var(--font-display); font-size:26px; font-weight:700;
  letter-spacing:-.01em; padding-bottom:6px; }
.accept-brand b::after { content:""; position:absolute; left:0; right:0; bottom:0; height:2px; border-radius:2px;
  background:linear-gradient(90deg,var(--brand) 0 34%,var(--red) 34% 67%,var(--green) 67% 100%); }
.accept-brand span { font-family:var(--font-ui); font-size:12px; font-weight:500; letter-spacing:.6px;
  text-transform:uppercase; color:var(--muted); }
.accept-title { font-family:var(--font-display); font-size:1.6rem; margin:18px 0 6px; color:var(--navy); }
.accept-sub { margin:0 0 14px; color:var(--muted); font-size:.95rem; }
.accept-job { display:inline-block; background:var(--bg); border:1px solid var(--line); border-radius:8px;
  padding:10px 16px; margin-bottom:16px; font-size:1rem; color:var(--ink); font-family:var(--font-data); }
.accept-view, .accept-btn { width:100%; padding:13px; font-size:1rem; margin-bottom:14px; }
.accept-lead { margin:4px 0 14px; color:var(--ink); font-size:.95rem; }
.accept-note { color:var(--muted); font-size:.9rem; margin:14px 0; }
.accept-questions { margin:16px 0 0; font-size:.85rem; color:var(--muted); }
.accept-questions b { color:var(--navy); }
.accept-fineprint { color:var(--muted); font-size:.72rem; margin:12px 0 0; }
.accept-foot { margin:22px 0 0; font-size:.7rem; color:var(--muted); letter-spacing:.2px;
  font-family:var(--font-ui); }
.accept-tick { width:64px; height:64px; margin:6px auto 0; border-radius:50%; background:var(--green);
  color:#fff; font-size:34px; line-height:64px; }
.sig-label { text-align:left; font-size:.78rem; font-weight:600; color:var(--muted); margin:4px 0 6px;
  font-family:var(--font-ui); text-transform:uppercase; letter-spacing:.5px; }
.sig-pad { width:100%; height:200px; border:1px dashed var(--line); border-radius:8px; background:#fff;
  touch-action:none; cursor:crosshair; display:block; }
.sig-clear { margin:8px 0 16px; }
.sig-thumb { max-width:240px; max-height:120px; border:1px solid var(--line); border-radius:8px;
  margin:6px auto 4px; display:block; background:#fff; }
.share-url { width:100%; margin-top:6px; padding:8px 10px; font-size:13px; border:1px solid var(--line);
  border-radius:8px; background:var(--bg); color:var(--ink); font-family:var(--font-data); }
.accepted-note { color:var(--green); font-weight:700; font-size:14px; margin-bottom:6px; }
.accept-pdf-wrap { margin:0 -10px 16px; }
.accept-pdf { width:100%; height:500px; border:1px solid var(--line); border-radius:8px; display:block;
  background:#f5f5f5; }
.accept-pdf-link { display:block; text-align:center; margin-top:8px; font-size:12px; color:var(--muted); }
@media (max-width:600px) { .accept-pdf { height:320px; } }

/* ── Survey booking card ─────────────────────────────────── */
.survey-card { border-left:3px solid var(--navy); }
.survey-card .form-grid { display:grid; gap:10px; grid-template-columns:1fr 1fr; }
.survey-card .flabel { display:flex; flex-direction:column; font-size:13px; font-weight:600;
  color:var(--navy); gap:4px; }
.survey-card .flabel input, .survey-card .flabel textarea { width:100%; padding:9px 10px;
  border:1px solid var(--line); border-radius:8px; font-size:14px; font-family:inherit; }
.survey-submitted { display:flex; align-items:center; flex-wrap:wrap; gap:8px; background:#e3f1e9;
  border-radius:8px; padding:8px 12px; margin-bottom:12px; font-weight:700; color:var(--green); font-size:14px; }
.survey-submitted .sub { color:var(--muted); font-weight:400; font-size:13px; margin-left:4px; }

/* ── Contract prompt card ────────────────────────────────── */
.contract-prompt { border-left:3px solid var(--amber); }
.contract-prompt .section-title { color:var(--amber); }

/* ── Survey status pill ──────────────────────────────────── */
.pill.survey { background:var(--navy); color:#fff; border-color:var(--navy); }

/* ── Quote builder (Phase 42) ────────────────────────────── */
.qb-grid { display:grid; grid-template-columns:minmax(280px,1fr) minmax(320px,1.3fr); gap:18px; align-items:start; }
@media (max-width:900px){ .qb-grid { grid-template-columns:1fr; } }
.qb-palette { position:sticky; top:72px; max-height:calc(100vh - 96px); display:flex; flex-direction:column; }
.qb-search { width:100%; padding:9px 12px; font-size:14px; font-family:inherit; margin-bottom:10px;
  border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--card); color:var(--ink);
  transition:border-color .15s ease, box-shadow .15s ease; }
.qb-search:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 4px var(--ring); }

/* ── Form builder (Phase 3) ──────────────────────────────── */
.fb-toolbar { display:flex; align-items:center; gap:8px; padding:10px 0 14px; flex-wrap:wrap; }
.fb-toolbar .spacer { flex:1; }
.fb-working { font-size:12px; color:var(--muted); }
.fb-root { display:flex; flex-direction:column; gap:14px; margin-top:6px; }
.fb-section { border:1px solid var(--line); border-radius:var(--radius); background:var(--card); }
.fb-section-head { display:flex; align-items:center; gap:8px; padding:10px 12px;
  background:var(--bg); border-bottom:1px solid var(--line); border-radius:var(--radius) var(--radius) 0 0; }
.fb-section-head input { flex:1; font-size:14px; font-weight:600; border:none; background:transparent;
  color:var(--ink); outline:none; }
.fb-section-head input:focus { background:var(--field-bg,#f8f8fb); border-radius:4px; padding:0 4px; }
.fb-field-list { display:flex; flex-direction:column; gap:0; }
.fb-field { border-top:1px solid var(--line); padding:10px 12px; display:grid;
  grid-template-columns:1fr auto auto; gap:8px; align-items:start; }
.fb-field:first-child { border-top:none; }
.fb-field-meta { display:flex; flex-direction:column; gap:6px; }
.fb-field-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.fb-field-row label { font-size:12px; color:var(--muted); display:flex; align-items:center; gap:4px; }
.fb-field-row input[type=text], .fb-field-row select, .fb-field-row textarea {
  font-size:13px; padding:4px 7px; border:1px solid var(--line); border-radius:5px;
  background:var(--field-bg,#f8f8fb); color:var(--ink); font-family:inherit; }
.fb-field-row input[type=text]:focus, .fb-field-row select:focus {
  outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--ring); }
.fb-field-row input.slug { font-family:var(--font-data); font-size:12px; }
.fb-opts { display:flex; flex-direction:column; gap:4px; margin-top:4px; padding-left:2px; }
.fb-opts-row { display:flex; gap:6px; align-items:center; }
.fb-opts-row input { flex:1; font-size:12px; }
.fb-add-opt { font-size:12px; color:var(--accent); background:none; border:none; cursor:pointer;
  padding:2px 0; text-align:left; }
.fb-add-opt:hover { text-decoration:underline; }
.fb-add-section { display:flex; justify-content:center; padding:10px 0 4px; }
.fb-empty { text-align:center; color:var(--muted); font-size:13px; padding:14px; }
.fb-meta-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:14px; }
@media (max-width:700px){ .fb-meta-grid { grid-template-columns:1fr; } }
.fb-warn { background:#fff8e1; border:1px solid #ffe57f; border-radius:6px;
  padding:8px 12px; font-size:13px; color:#7a5c00; margin-bottom:10px; }
.fb-err  { background:#fff0f0; border:1px solid #ffc0c0; border-radius:6px;
  padding:8px 12px; font-size:13px; color:#c00; margin-bottom:10px; }
.qb-pal-list { overflow-y:auto; flex:1; display:flex; flex-direction:column; gap:4px; }
.qb-pgroup { font-size:10.5px; font-weight:600; text-transform:uppercase; letter-spacing:.06em;
  color:var(--muted); padding:10px 4px 4px; position:sticky; top:0; background:var(--card); }
.qb-tile { display:flex; align-items:center; gap:10px; padding:9px 11px; border:1px solid var(--line);
  border-radius:var(--radius-sm); background:var(--card); cursor:grab; user-select:none;
  transition:background .15s ease, border-color .15s ease, transform .08s ease; }
.qb-tile:hover { background:var(--accent-weak); border-color:var(--glass-brd); transform:translateY(-1px); }
.qb-tile:active { cursor:grabbing; transform:scale(.99); }
.qb-tile.labour { border-left:3px solid var(--accent); }
.qb-tile-main { flex:1; min-width:0; }
.qb-tile-t { font-weight:600; font-size:13.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.qb-tile-s { font-size:11.5px; color:var(--muted); }
.qb-tile-p { font-weight:700; font-size:13px; color:var(--accent); font-variant-numeric:tabular-nums; white-space:nowrap; }
.qb-cart { display:flex; flex-direction:column; }
.qb-drop { min-height:120px; border:1.5px dashed var(--line-2, var(--glass-brd)); border-radius:var(--radius-sm);
  padding:6px; transition:border-color .15s ease, background .15s ease; }
.qb-drop.over { border-color:var(--accent); background:var(--accent-weak); }
.qb-empty { color:var(--muted); font-style:italic; text-align:center; padding:34px 12px; }
.qb-lines { width:100%; border-collapse:collapse; }
.qb-lines th { font-size:10.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted);
  text-align:left; padding:6px 6px; border-bottom:1px solid var(--line); }
.qb-lines td { padding:4px 6px; border-bottom:1px solid var(--line); vertical-align:middle; }
.qb-ltotal { font-variant-numeric:tabular-nums; font-weight:600; white-space:nowrap; }
.qb-in { width:100%; padding:6px 8px; font-size:13px; font-family:inherit; border:1px solid var(--line);
  border-radius:8px; background:var(--card); color:var(--ink); }
.qb-in:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--ring); }
.qb-in.qb-num { width:84px; text-align:right; font-variant-numeric:tabular-nums; }
.qb-totals { margin-top:14px; border-top:1px solid var(--line); padding-top:10px; }
.qb-trow { display:flex; justify-content:space-between; font-size:14px; padding:3px 0; color:var(--muted); }
.qb-trow b { color:var(--ink); font-variant-numeric:tabular-nums; }
.qb-grand { font-size:17px; font-weight:700; margin-top:4px; }
.qb-grand span, .qb-grand b { color:var(--ink); }
.qb-grand b { color:var(--accent); }
.qb-inline .qb-pal-list { max-height:300px; }

/* ── Print ───────────────────────────────────────────────── */
@media print {
  body { background: #fff !important; color: #000; }
  .no-print, header.topbar, .sidebar, .quickadd, .topsearch, .gear, .iconbtn,
  .row-actions, .addform, form.inline, .crumb, .wb-foot { display: none !important; }
  .app-body { margin-left: 0 !important; }
  main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}
