:root {
  --bg: #f8f3f0; --panel: #ffffff; --panel-2: #f7ede9; --line: #e6d9d3; --text: #2b2624; --muted: #6f6560;
  --accent: #9c3317; --accent-text: #ffffff; --danger: #c62828; --ok: #1f9d61; --warn: #c98400;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 4px 14px rgba(20, 30, 50, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191514; --panel: #231d1b; --panel-2: #2c2421; --line: #3d322e; --text: #efe8e5; --muted: #a99d97;
    --accent: #c4512f; --accent-text: #ffffff; --danger: #ff7b6b; --ok: #46c489; --warn: #e3ae3f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 Arial, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.right { text-align: right; }

/* layout */
.shell { display: grid; grid-template-columns: 180px 1fr; height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px; }
.brand { padding: 2px 6px 14px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; }
.logo { display: block; width: 100%; max-width: 230px; height: auto; margin: 0 auto 6px; background: #fff; border-radius: 8px; padding: 8px; }
.side { border-top: 4px solid var(--accent); }
.nav button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.nav button:hover { background: var(--panel-2); }
.nav button.on { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.side .who { margin-top: auto; padding: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.side .who button { margin-top: 6px; }
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.top { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--panel); }
.top h1 { margin-right: auto; }
#main { flex: 1; overflow: auto; padding: 16px 16px; }

/* controls */
.btn { border: 1px solid var(--line); background: var(--panel); padding: 7px 13px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 3px 9px; font-size: 12.5px; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; width: 100%; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.top select { width: auto; max-width: 240px; }
textarea { min-height: 80px; resize: vertical; }

/* cards & tables */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 14px; }
.stat .n { font-size: 24px; font-weight: 700; white-space: nowrap; }
.stat .n.bad { color: var(--danger); }
.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); margin-top: 14px; }
.cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: baseline; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 12px; border: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
.pill.high, .pill.over { color: var(--danger); border-color: var(--danger); }
.pill.medium { color: var(--warn); border-color: var(--warn); }
.pill.done { color: var(--ok); border-color: var(--ok); }
.pill.inv { color: var(--accent); border-color: var(--accent); }
.bar { height: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.bar i.over { background: var(--danger); }
.bar i.ok { background: var(--ok); }
.bar i.warn { background: var(--warn); }
.spend { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 3px; font-size: 12px; }
.spend .bar { flex: 1; min-width: 60px; max-width: 110px; }
.spend .bad { color: var(--danger); font-weight: 700; }
.hbar { display: grid; grid-template-columns: 110px 1fr 36px; gap: 10px; align-items: center; margin: 7px 0; }

/* board */
/* All four columns stay on screen: side by side when there is room, otherwise 2 x 2 (or stacked on a phone). */
/* Compact board: all four columns in one row, small cards so as many as possible fit. */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: stretch; min-height: calc(100vh - 150px); }

.board.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 560px) { .board, .board.five { grid-template-columns: 1fr; } }
.seg { display: flex; align-items: center; gap: 0; margin: 0 0 10px; flex-wrap: wrap; }
.seg button { border: 1px solid var(--line); background: var(--panel); padding: 5px 14px; cursor: pointer; }
.seg button:first-child { border-radius: 7px 0 0 7px; }
.seg button:nth-child(2) { border-radius: 0 7px 7px 0; border-left: 0; margin-right: 12px; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.col { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px; min-height: 160px; min-width: 0; }
.col.over { outline: 2px dashed var(--accent); }
.col h2 { display: flex; justify-content: space-between; padding: 2px 4px 6px; font-size: 13px; margin: 0; position: sticky; top: -16px; background: var(--panel-2); z-index: 1; }
.tcard { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 5px 7px; margin-bottom: 5px; cursor: grab; box-shadow: none; font-size: 12.5px; line-height: 1.3; }
.tcard:hover { border-color: var(--muted); }
.tcard { position: relative; touch-action: none; user-select: none; }
.tcard.lifted { opacity: .35; }
.tcard.ghost { position: fixed; z-index: 40; pointer-events: none; cursor: grabbing; transform: rotate(2deg); box-shadow: 0 12px 30px rgba(0, 0, 0, .25); margin: 0; }
.tcard .mv { float: right; display: flex; gap: 2px; margin: -2px -3px 0 4px; }
.tcard .mv button { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); width: 20px; height: 20px; border-radius: 5px; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.tcard .mv button:hover { border-color: var(--accent); color: var(--accent); }
.tcard.ghost .mv { display: none; }
.tcard .t { font-weight: 600; margin-bottom: 3px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .meta { display: flex; flex-wrap: wrap; gap: 3px 6px; font-size: 11px; color: var(--muted); align-items: center; }
.tcard .meta .pill { font-size: 10.5px; padding: 0 6px; white-space: normal; max-width: 100%; }

/* timeline */
.gantt { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); max-height: calc(100vh - 150px); }
.g-row { display: flex; width: max-content; min-width: 100%; border-bottom: 1px solid var(--line); height: 34px; }
.g-row.head { position: sticky; top: 0; z-index: 3; background: var(--panel-2); height: 30px; font-size: 12px; color: var(--muted); }
.g-label { flex: 0 0 230px; width: 230px; position: sticky; left: 0; z-index: 2; background: var(--panel); border-right: 1px solid var(--line); padding: 0 12px; line-height: 34px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-row.head .g-label { background: var(--panel-2); line-height: 30px; }
.g-row.proj .g-label { font-weight: 700; }
.g-row.task .g-label { padding-left: 26px; }
.g-track { position: relative; flex: 0 0 auto; }
.g-month { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); padding-left: 6px; line-height: 30px; white-space: nowrap; overflow: hidden; }
.g-bar { position: absolute; top: 7px; height: 20px; border-radius: 5px; cursor: pointer; color: #fff; font-size: 11.5px; line-height: 20px; padding: 0 6px; white-space: nowrap; overflow: hidden; }
.g-bar.proj { top: 12px; height: 10px; opacity: .55; padding: 0; }
.g-bar.done { opacity: .45; }
.g-bar.late { box-shadow: 0 0 0 2px var(--danger); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: .7; }

/* modal, auth, toast */
.overlay { position: fixed; inset: 0; background: rgba(10, 14, 22, .5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow: auto; z-index: 20; }
.modal { background: var(--panel); border-radius: 12px; padding: 20px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.modal h2 { font-size: 17px; margin-bottom: 14px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.actions .danger { margin-right: auto; }
.error { color: var(--danger); margin-top: 8px; min-height: 1.3em; }
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth .card { width: 100%; max-width: 380px; padding: 26px; }
.auth h1 { margin-bottom: 4px; }
.auth p { margin: 0 0 18px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
#toast.show { opacity: 1; }
code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; align-items: center; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 10px; } .brand .logo { width: 110px; margin: 0; } .brand small { display: none; }
  .nav { display: flex; }
  .side .who { margin: 0 0 0 auto; border: 0; padding: 0 6px; white-space: nowrap; }
  .side .who div { display: none; }
  .main { height: auto; min-height: 0; }
  .shell { grid-template-rows: auto 1fr; }
  .top { flex-wrap: wrap; padding: 12px 16px; }
  #main { padding: 16px; }
  .row2 { grid-template-columns: 1fr; }
}

/* ---------- quotations & reports: editor ---------- */
.doc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; position: sticky; top: -16px; z-index: 5; background: var(--bg); padding: 8px 0; }
.doc-name { margin-right: auto; }
.doc-form { margin-bottom: 12px; }
.doc-form h2 { margin-top: 0; }
.f { display: block; margin-bottom: 10px; }
.f > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.grid2, .grid3, .grid4 { display: grid; gap: 0 12px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }
.q-sec-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.q-sec-head input { font-weight: 700; }
.q-no { font-weight: 700; color: var(--accent); min-width: 22px; }
.q-items td, .q-items th { padding: 4px 6px; vertical-align: top; }
.q-items textarea { min-height: 34px; resize: vertical; }
.q-items td:nth-child(2) { width: 100%; min-width: 260px; }
.q-items .w-uom { width: 70px; }
.q-items .w-num { width: 110px; text-align: right; }
.q-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.q-add select { width: auto; max-width: 100%; }
.q-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.q-totals table { width: auto; min-width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.q-totals td { text-align: right; }
.q-totals .grand td { font-weight: 700; font-size: 16px; color: var(--accent); }

/* ---------- quotations & reports: the printed page ---------- */
.paper { background: #8a8580; padding: 20px; border-radius: 10px; overflow-x: auto; }
.doc { background: #fff; color: #222; width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto; padding: 14mm; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); font: 10pt/1.4 Arial, sans-serif; }
.doc h3 { color: #9c3317; font-size: 11pt; margin: 16px 0 6px; border-bottom: 1.5px solid #9c3317; padding-bottom: 3px; text-transform: uppercase; letter-spacing: .02em; }
.doc table { width: 100%; border-collapse: collapse; }
.doc .muted { color: #777; }
.doc .pre { white-space: pre-wrap; }
.doc ul { margin: 4px 0 4px 18px; padding: 0; }
.doc-logo { width: 62mm; height: auto; display: block; margin-bottom: 6px; }
.doc-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 10px; }
.doc-co { font-size: 9pt; color: #444; }
.doc-meta { text-align: right; }
.doc-meta table { width: auto; margin-left: auto; }
.doc-meta th { text-align: left; padding: 3px 8px; background: #9c3317; color: #fff; font-size: 8.5pt; }
.doc-meta td { padding: 3px 8px; border: 1px solid #ccc; min-width: 30mm; text-align: left; }
.doc-kind { font-weight: 700; color: #9c3317; letter-spacing: .06em; }
.doc-kind.big { font-size: 22pt; margin-bottom: 8px; }
.doc-cust { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; margin: 8px 0 14px; }
.doc-cust h4 { margin: 0 0 4px; background: #9c3317; color: #fff; padding: 3px 8px; font-size: 9pt; letter-spacing: .05em; }
.doc-info th { text-align: left; width: 38mm; padding: 3px 8px; color: #555; font-weight: 600; vertical-align: top; border-bottom: 1px solid #eee; }
.doc-info td { padding: 3px 8px; border-bottom: 1px solid #eee; vertical-align: top; }
.doc-sum th { width: auto; }
.doc-t th { background: #9c3317; color: #fff; text-align: left; padding: 5px 6px; font-size: 8.5pt; }
.doc-t td { padding: 4px 6px; border-bottom: 1px solid #ddd; vertical-align: top; }
.doc-t .num, .q-doc td:nth-child(n+4) { text-align: right; white-space: nowrap; }
.q-doc th:nth-child(n+4) { text-align: right; }
.doc-t tr.sec td { font-weight: 700; background: #f4ebe7; }
.doc-end { display: grid; grid-template-columns: 1fr auto; gap: 16px; margin-top: 10px; align-items: start; }
.doc-totals table { width: auto; min-width: 70mm; }
.doc-totals td { padding: 4px 8px; border-bottom: 1px solid #ddd; text-align: right; }
.doc-totals .grand td { background: #9c3317; color: #fff; font-weight: 700; font-size: 11pt; }
.doc-rhead { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid #9c3317; padding-bottom: 8px; margin-bottom: 12px; font-size: 8.5pt; color: #555; }
.doc-rhead-r { text-align: right; }
.doc-rhead .doc-logo { width: 48mm; margin: 0; }
.doc-h1 { font-size: 15pt; margin: 6px 0 2px; color: #222; }
.doc-sub { color: #555; margin-bottom: 10px; }
.doc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 6px; }
.sigline { margin-top: 22px; }
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 10mm; }
  html, body { background: #fff !important; height: auto; }
  #app, #modal-root, #toast { display: none !important; }
  #print-root { display: block; }
  #print-root .doc { width: auto; min-height: 0; padding: 0; box-shadow: none; margin: 0; }
  .doc-t tr, .doc-info tr { break-inside: avoid; }
  .doc h3 { break-after: avoid; }
}
/* ---------- tax invoice: copy of invoice BIT3573 ---------- */
.doc.ti { font: 9.5pt/1.35 Calibri, Carlito, "Segoe UI", Arial, sans-serif; color: #000; padding: 18mm 24mm 14mm 26mm; }
.ti-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 4mm; margin-bottom: 9mm; }
.doc.ti td, .doc.ti th { border-bottom: 0; white-space: normal; }
.ti-co { color: #843c29; font-weight: 700; font-size: 9.5pt; line-height: 1.5; }
.ti-logo { width: 56mm; height: auto; margin-top: 1mm; }
.ti-title { text-align: right; color: #808080; font-weight: 700; font-size: 18pt; line-height: 1; padding-right: 4mm; }
.ti-date { width: 28mm; margin: 7mm 0 0 auto; text-align: center; color: #333; font-size: 9pt; font-weight: 400; }
.ti-bar { background: #9d3411; color: #fff; font-weight: 700; font-size: 8pt; padding: 1.2mm 2mm; letter-spacing: .01em; }
.ti-bars { display: grid; grid-template-columns: 54% 1fr; gap: 1.5mm; }
.ti-bars .r { display: grid; grid-template-columns: 1fr 1fr; padding-left: 8mm; }
.ti-bars .r span:last-child { padding-left: 8mm; }
.ti-cust { display: grid; grid-template-columns: 54% 1fr; gap: 1.5mm; border-top: 1.2mm solid #f2f2f2; border-bottom: 1.2mm solid #f2f2f2; margin-bottom: 2mm; }
.ti-info { width: 100%; border-collapse: collapse; border-right: 1.2mm solid #f2f2f2; }
.ti-info th { text-align: left; color: #7f7f7f; font-weight: 700; width: 20mm; font-size: 9pt; padding: 1.2mm 1mm 1.2mm 0; vertical-align: top; border-right: 1.2mm solid #f2f2f2; }
.ti-info td { padding: 1.2mm 0 1.2mm 2mm; vertical-align: top; line-height: 1.75; }
.ti-right { display: grid; grid-template-columns: 64% 36%; padding: 1.2mm 0 1.2mm 8mm; font-size: 8.5pt; }
.ti-no div:first-child { color: #7f7f7f; font-weight: 700; margin-bottom: 1.5mm; }
.ti-grey { color: #7f7f7f; font-weight: 700; margin-bottom: 1.5mm; }
.ti-terms { padding-left: 8mm; color: #555; }
.ti-items { width: 100%; border-collapse: collapse; border: 1px solid #000; }
.ti-items th { background: #9d3411; color: #fff; font-weight: 700; font-size: 8.5pt; padding: 1.2mm 1mm; text-align: center; }
.ti-items th:nth-child(2) { text-align: left; padding-left: 4mm; }
.ti-items td { border-left: 1px solid #000; border-right: 1px solid #000; padding: 2.3mm 1.5mm; vertical-align: top; }
.ti-items tbody tr:first-child td { padding-top: 6mm; }
.ti-items th:nth-child(1), .ti-items td:nth-child(1) { width: 14.5%; }
.ti-items th:nth-child(3), .ti-items td:nth-child(3) { width: 7.5%; }
.ti-items th:nth-child(4), .ti-items td:nth-child(4) { width: 6.5%; }
.ti-items th:nth-child(5), .ti-items td:nth-child(5) { width: 13%; }
.ti-items th:nth-child(6), .ti-items td:nth-child(6) { width: 18.5%; }
.ti-items .c { text-align: center; }
.ti-items .r { text-align: right; }
.ti-uom { font-style: italic; font-size: 7.5pt; color: #595959; }
.ti-r { float: left; }
.ti-v { float: right; }
.ti-sec td { font-weight: 700; }
.ti-fill td { height: 52mm; }
.ti-end { display: grid; grid-template-columns: 14.5% 40% 6.5% 39%; margin-top: 4mm; }
.ti-pay { grid-column: 2; border: 1px solid #eee; box-shadow: 0 0 2px rgba(0, 0, 0, .12); padding: 2mm 1mm; font-size: 7.5pt; }
.ti-pay div { margin-bottom: 3.2mm; }
.ti-pay .ti-pay-h { color: #9d3411; font-style: italic; font-size: 9pt; margin-bottom: 4mm; }
.ti-tot { grid-column: 4; border-collapse: collapse; width: 100%; align-self: start; }
.ti-tot th { background: #f4b19b; color: #333; text-align: left; font-weight: 400; padding: 1.6mm 1.5mm; width: 45%; font-size: 9.5pt; }
.ti-tot td { background: #fad9cd; padding: 1.6mm 1.5mm; }
.ti-tot .ti-vv { text-align: right; }
.ti-tot .big th { color: #9d3411; font-weight: 700; }
.ti-tot .big td { font-weight: 700; font-size: 11pt; }
.ti-notes { margin-top: 6mm; font-size: 8.5pt; color: #444; }
@media print { #print-root .doc.ti { padding: 8mm 14mm 0 16mm; } }

.spend-note { font-size: 12px; color: var(--muted); }
.spend-note.bad { color: var(--danger); font-weight: 700; }

/* Overview job table: compact so the money columns fit */
.ov-t th, .ov-t td { padding: 7px 6px; font-size: 13px; }
.ov-t th { white-space: normal; }
.ov-t td.right, .ov-t td.right strong { white-space: nowrap; }
.ov-t td.right .muted, .ov-t .spend-note { font-size: 11.5px; white-space: normal; }
.ov-t td:first-child { min-width: 170px; }

/* ---------- quotation: copy of quotation BITQ3156 (shares the tax invoice styles) ---------- */
.tq-desc { color: #7f7f7f; font-weight: 700; font-size: 7.5pt; margin-top: 9mm; white-space: nowrap; }
.tq-items { table-layout: fixed; }
.tq-items th, .tq-items td { border-left: 1px solid #000; border-right: 1px solid #000; }
.tq-items .tq-head th { background: #9d3411; color: #fff; font-weight: 700; font-size: 9pt; padding: 1.2mm 1mm; text-align: center; border-color: #9d3411; }
.tq-items .tq-head th:nth-child(2) { text-align: left; padding-left: 3mm; }
.tq-items tbody tr:first-child td { padding-top: 2.3mm; }
.tq-items td { padding: 1.2mm 1mm 3mm; line-height: 1.3; }
.tq-items th:nth-child(1), .tq-items td:nth-child(1) { width: 14.3%; }
.tq-items th:nth-child(2), .tq-items td:nth-child(2) { width: 39%; }
.tq-items th:nth-child(3), .tq-items td:nth-child(3) { width: 5.6%; }
.tq-items th:nth-child(4), .tq-items td:nth-child(4) { width: 8%; }
.tq-items th:nth-child(5), .tq-items td:nth-child(5) { width: 12.8%; }
.tq-items th:nth-child(6), .tq-items td:nth-child(6) { width: 20.3%; }
.tq-items .tq-mid { vertical-align: middle; }
.tq-items .tq-sec td { font-weight: 700; padding-top: 2mm; padding-bottom: 3.5mm; vertical-align: top; }
.tq-items .tq-sec td:first-child { text-align: center; }
.tq-items .tq-pad td { height: 6mm; padding: 0; }
.tq-items tr { break-inside: avoid; }
.tq-end { display: grid; grid-template-columns: 58.9% 41.1%; margin-top: 3mm; align-items: start; }
.tq-notes { box-shadow: 0 0 2px rgba(0, 0, 0, .18); padding: 2mm 3mm 2mm 14.5%; min-height: 26mm; font-size: 7.5pt; }
.tq-notes-h { color: #9d3411; font-style: italic; font-size: 9pt; margin-bottom: 2.5mm; }
.tq-notes p { margin: 0 0 2mm; }
.tq .ti-tot th { width: 52%; }
.tq-end .ti-tot { grid-column: auto; }
.tq .ti-no:only-child { grid-column: 1 / -1; }
/* Quotation table: a border line at the top and bottom of the table on every printed page. */
.tq-items col.c1 { width: 14.3%; } .tq-items col.c2 { width: 39%; } .tq-items col.c3 { width: 5.6%; }
.tq-items col.c4 { width: 8%; } .tq-items col.c5 { width: 12.8%; } .tq-items col.c6 { width: 20.3%; }
.tq-items .tq-edge td { height: 0; padding: 0; border-left: 0; border-right: 0; line-height: 0; font-size: 0; }
.tq-items tfoot .tq-edge td { border-top: 1px solid #000; }
.tq-items thead .tq-edge td { border-bottom: 1px solid #000; }
.tq-items tbody tr:first-child th { border-top: 0; }
/* Always print the document colours (maroon bars and header row, DATE box, salmon totals), even when the
   print window's "Background graphics" box is not ticked. */
.doc, .doc * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
@media print { #print-root, #print-root * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; } }
/* Job documents on the Projects page */
.docs { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.docs-h { font-weight: 600; margin-bottom: 4px; }
.doc-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.doc-row .linkish { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.linkish:hover { text-decoration: underline; }
.docs > .btn { margin-top: 4px; }

/* Load quote tab */
.imp-t td { vertical-align: top; }
.imp-t .imp-sec td { font-weight: 700; background: var(--panel-2); }
.per-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.per-tabs { display: flex; margin-right: 6px; }
.per-tabs button { border: 1px solid var(--line); border-left-width: 0; background: var(--panel); color: var(--text); padding: 6px 16px; cursor: pointer; font: inherit; }
.per-tabs button:first-child { border-left-width: 1px; border-radius: 7px 0 0 7px; }
.per-tabs button:last-child { border-radius: 0 7px 7px 0; }
.per-tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.per-label { min-width: 12ch; text-align: center; }
/* Site (phone) page */
.warn-card { border-left: 4px solid var(--warn); margin-bottom: 12px; }
.site-pick { margin-bottom: 12px; }
.site-pick select { font-size: 16px; padding: 10px; }
.site-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.site-tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.site-tab span { font-size: 24px; }
.site-tab.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
#main .card + .card { margin-top: 12px; }
.site-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.site-row.tight { border: 0; padding: 0; }
.site-row .grow { flex: 1; min-width: 0; }
.btn.big { padding: 12px 18px; font-size: 16px; }
.btn.wide { width: 100%; margin: 6px 0; }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: var(--panel-2); cursor: pointer; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.thumb.big { width: 120px; height: 120px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs figure { margin: 0; width: 120px; }
.thumbs figcaption { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.bad-t { color: var(--danger); }
@media (max-width: 560px) { .site-tab { font-size: 12px; } .site-row .btn.big { padding: 10px 12px; font-size: 15px; } }
.my-head { display: flex; align-items: center; gap: 14px; }
.avatar.big { width: 48px; height: 48px; font-size: 18px; }
.my-task { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.my-task.late .my-task-t strong { color: var(--danger); }
.my-task-t { flex: 1 1 280px; min-width: 0; }
.my-task-r { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
table.kv { width: 100%; margin: 0 0 8px; border-collapse: collapse; }
table.kv th { text-align: left; font-weight: 600; color: var(--muted); width: 38%; padding: 3px 8px 3px 0; vertical-align: top; }
table.kv td { padding: 3px 0; overflow-wrap: anywhere; }
td.bad { color: var(--danger); font-weight: 600; }
.person { border-top: 1px solid var(--line); padding: 12px 0; }
.person-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.person-h h3 { margin: 0; font-size: 16px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
/* Home */
.home-hi { margin: 0 0 14px; }
.home-hi h2 { margin: 0; font-size: 22px; }
.home-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.home-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.home-tile:hover, .home-tile:focus-visible { border-color: var(--accent); }
.home-tile strong { font-size: 16px; }
.home-tile .muted { font-size: 13px; }
.home-ic { font-size: 26px; line-height: 1; margin-bottom: 4px; }
.home-attn { margin-bottom: 14px; }
.home-attn-row { display: flex; justify-content: space-between; width: 100%; padding: 10px 4px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.home-attn-row.over strong { color: var(--danger); }
.home-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.assign-grid td, .assign-grid th { white-space: nowrap; }
.assign-grid .c { text-align: center; }
.assign-grid input[type=checkbox] { width: 18px; height: 18px; }
@media (max-width: 560px) { .home-tiles { grid-template-columns: 1fr 1fr; } .home-tile { padding: 12px; } }
/* Statement of Account: copy of Bitophuti's "Statement of Account October 2026" */
.doc.sa { font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; color: #000; font-size: 10pt; }
.sa-top { display: grid; grid-template-columns: 30% 1fr 25%; align-items: start; margin-bottom: 7mm; }
.sa-co { color: #404040; font-weight: 700; font-size: 10pt; line-height: 1.5; }
.sa-logo { width: 46mm; margin-top: 0; }
.sa-title { text-align: center; }
.sa-h { color: #7f7f7f; font-weight: 700; font-size: 17pt; line-height: 1.2; margin-bottom: 1mm; }
.sa-bar { background: #9d3411; color: #fff; font-weight: 700; font-size: 9.5pt; padding: 1mm 2mm; text-align: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sa-bar.l { text-align: left; }
.sa-date { color: #404040; font-weight: 700; font-size: 9.5pt; padding-top: 0.5mm; }
.sa-boxes { display: grid; grid-template-columns: 54% 46%; border-bottom: 1px solid #e3e3e3; margin-bottom: 7mm; }
.sa-boxes table { width: 100%; border-collapse: collapse; }
.doc.sa .sa-boxes th, .doc.sa .sa-boxes td { border-top: 0; border-bottom: 0; }
.sa-cust { border-right: 1.2mm solid #fff; }
.sa-cust th { text-align: left; color: #595959; font-weight: 700; width: 36%; padding: 1mm 0 1mm 0; border-right: 1px solid #e3e3e3; font-size: 10pt; }
.sa-cust td { padding: 1mm 0 1mm 2mm; font-size: 9pt; }
.sa-sum th { text-align: right; font-weight: 400; font-size: 9pt; padding: 1mm 9mm 1mm 0; white-space: nowrap; }
.sa-sum th.sa-left { text-align: left; font-weight: 700; color: #404040; padding-left: 1mm; }
.sa-sum td { text-align: right; background: #d9d9d9; padding: 1mm 1.5mm; font-size: 10pt; white-space: nowrap; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sa-sum td.sa-plain { background: none; font-size: 9pt; }
.sa-sum .sa-gap td, .sa-sum .sa-gap th { padding: 1.2mm; }
.sa-sum .sa-b th, .sa-sum .sa-b td { font-weight: 700; }
.sa-items { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.sa-items th { background: #9d3411; color: #fff; font-weight: 700; font-size: 8.5pt; padding: 1.5mm 1mm; text-align: center; border-right: 1px solid #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sa-items th:first-child { text-align: left; }
.sa-items td { padding: 1.6mm 1mm; color: #404040; border-right: 1px solid #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sa-items tbody tr:nth-child(odd) td { background: #d9d9d9; }
.sa-items tbody tr:nth-child(even) td { background: #f2f2f2; }
.sa-items .c { text-align: center; }
.sa-items .sa-bld { font-size: 7pt; }
.sa-items .sa-wo, .sa-items .sa-st { font-weight: 700; }
.sa-items .sa-amt { display: flex; justify-content: space-between; padding-left: 2mm; padding-right: 3mm; }
.sa-items th:nth-child(1) { width: 11%; } .sa-items th:nth-child(2) { width: 9.5%; } .sa-items th:nth-child(3) { width: 22%; }
.sa-items th:nth-child(4) { width: 12%; } .sa-items th:nth-child(5) { width: 11%; } .sa-items th:nth-child(6) { width: 15%; } .sa-items th:nth-child(7) { width: 14%; }
.sa-out { display: flex; justify-content: flex-end; align-items: center; gap: 6mm; margin: 1mm 0 10mm; padding-right: 19.5%; font-weight: 700; color: #595959; }
.sa-out .sa-box { background: #d9d9d9; color: #595959; padding: 1.2mm 3mm; min-width: 24mm; text-align: right; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sa-pay { display: grid; grid-template-columns: 18mm 50mm; border: 1px solid #e3e3e3; width: 68mm; line-height: 1.9; font-size: 10pt; }
.sa-pay div:first-child { border-right: 1px solid #e3e3e3; }
.sa-pay div:last-child { padding-left: 2mm; }
.sa-pay em { color: #9d3411; }
/* first statement version (kept for its column helpers) */
.st .st-sum { border-right: 0; }
.st .st-sum th { white-space: nowrap; width: auto; padding-left: 4mm; }
.st .st-sum td { text-align: right; padding-right: 2mm; }
.st .st-items th, .st .st-items td { width: auto !important; white-space: nowrap; }
.st .st-items th:nth-child(2) { text-align: center; padding-left: 1mm; }
.st .st-items td { padding: 1.6mm 1.5mm; }
.st .st-items td:nth-child(3) { white-space: normal; }
.st .st-items tbody tr:first-child td { padding-top: 2.5mm; }
.st .st-total td { border-top: 2px solid #222; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 0; }
.checks label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.checks input { width: auto; }
.doc-t.fin-wide th, .doc-t.fin-wide td { font-size: 9px; padding: 3px 4px; }
.rep-job { border-top: 1px solid var(--line); padding: 10px 0; }
.rep-job-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.rep-job-h .btn { margin-left: auto; }
.rep-job table td { vertical-align: middle; }
