﻿:root {
  --bg: #f6f4ef; --panel: #ffffff; --ink: #2a2622; --muted: #7a7268; --line: #e3ded4;
  --accent: #8a5a2b; --accent-ink: #ffffff; --accent-soft: #f1e6d8;
  --good: #2f7a4b; --bad: #b3372c; --warn: #b7791f; --head: #efe9dd; --input: #fbfaf7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1a17; --panel: #25221e; --ink: #ece7de; --muted: #9d9588; --line: #39342d;
    --accent: #d09a62; --accent-ink: #1c1a17; --accent-soft: #3a2f22;
    --good: #5fbf85; --bad: #ee7b6e; --warn: #e0b04c; --head: #2d2924; --input: #1f1d1a;
  }
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1a17; --panel: #25221e; --ink: #ece7de; --muted: #9d9588; --line: #39342d;
  --accent: #d09a62; --accent-ink: #1c1a17; --accent-soft: #3a2f22;
  --good: #5fbf85; --bad: #ee7b6e; --warn: #e0b04c; --head: #2d2924; --input: #1f1d1a;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.4 "Segoe UI", system-ui, sans-serif; }
.app { display: grid; grid-template-columns: 200px 1fr; height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; padding: 4px 8px 16px; }
.logo { background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 3px 7px; font-size: 13px; letter-spacing: .5px; }
#nav button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--ink); padding: 9px 12px; border-radius: 8px; cursor: pointer; font: inherit; }
#nav button:hover { background: var(--accent-soft); }
#nav button.on { background: var(--accent); color: var(--accent-ink); }
.side-foot { margin-top: auto; padding: 8px; font-size: 12px; }
main { overflow: auto; padding: 22px 26px 40px; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 10px; }
.sub { color: var(--muted); margin: 0 0 16px; }
.muted { color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.bar .grow { flex: 1; }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 6px 12px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.icon { padding: 2px 7px; border-color: transparent; background: none; color: var(--muted); }
button.icon:hover { color: var(--bad); }
button.small { padding: 2px 8px; font-size: 12px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--input); border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { width: 100%; resize: vertical; }
.tablewrap { overflow: auto; max-height: calc(100vh - 230px); border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; }
th { position: sticky; top: 0; background: var(--head); text-align: left; font-weight: 600; font-size: 12px; padding: 7px 6px; white-space: nowrap; z-index: 1; }
td { border-top: 1px solid var(--line); padding: 3px 4px; vertical-align: middle; }
td input, td select { width: 100%; min-width: 0; border-color: transparent; background: transparent; padding: 4px 5px; }
td input:hover, td select:hover { border-color: var(--line); }
td input:focus, td select:focus { background: var(--input); }
td.num, th.num { text-align: right; }
td.num input { text-align: right; }
td.act { white-space: nowrap; text-align: right; }
.calc { padding: 0 6px; white-space: nowrap; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
tr.sec td { background: var(--accent-soft); font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.card .v { font-size: 22px; font-weight: 600; margin-top: 2px; }
.card .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1150px) { .cols { grid-template-columns: 1fr; } }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; }
.form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.form label input, .form label select { color: var(--ink); }
.form .wide { grid-column: 1 / -1; }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tabs button.on { background: var(--accent-soft); border-color: var(--accent); }
.hbar { display: grid; grid-template-columns: 110px 1fr 120px; gap: 8px; align-items: center; margin: 6px 0; }
.hbar .track { background: var(--head); border-radius: 5px; height: 14px; overflow: hidden; }
.hbar .fill { background: var(--accent); height: 100%; }
.totals { margin-left: auto; width: 340px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .grand { font-weight: 700; font-size: 16px; border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 6px; }
.totals .int { color: var(--muted); font-size: 13px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--head); font-size: 12px; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; max-width: 420px; }
tr.bk > td { background: var(--accent-soft); padding: 10px 12px; }
.bk-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; position: sticky; left: 12px; width: 1020px; max-width: calc(100vw - 330px); }
.bk-wrap table { background: var(--panel); }
@media (max-width: 1200px) { .bk-wrap { grid-template-columns: 1fr; } }
.bk-sum > div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; font-size: 13px; }
.bk-strong { font-weight: 600; border-top: 1px solid var(--line); margin-top: 2px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 10; }
.modal { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; width: 520px; max-width: 90vw; }
/* Expanding description / remarks cell */
.xwrap { position: relative; height: 30px; min-width: 100px; }
.xbox { position: absolute; inset: 0; width: 100%; height: 30px; resize: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  border-color: transparent; background: transparent; color: var(--muted); padding: 4px 5px; line-height: 20px; }
.xwrap:hover .xbox { border-color: var(--line); }
.xwrap.open { z-index: 5; }
.xwrap.open .xbox { position: fixed; inset: auto; z-index: 40; width: 380px; max-width: 60vw; height: 112px; white-space: normal; overflow: auto; text-overflow: clip;
  color: var(--ink); background: var(--panel); border: 2px solid var(--accent); border-radius: 8px; padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.xsug { position: fixed; z-index: 41; width: 380px; max-width: 60vw; background: var(--panel); border: 1px solid var(--accent);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.28); overflow: hidden; }
.xopt { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; cursor: pointer; }
.xopt:hover { background: var(--accent-soft); }
.xwrap.rich.open .xbox { width: 460px; height: 170px; }
.xprev { position: fixed; z-index: 41; width: 460px; max-width: 60vw; max-height: 300px; overflow: auto; background: #fff; color: #111;
  border: 1px solid var(--accent); border-radius: 8px; padding: 8px 10px; font: 13px/1.45 Calibri, "Segoe UI", sans-serif; box-shadow: 0 8px 24px rgba(0,0,0,.28); }
/* live-coloured edit box: styled text sits behind a transparent textarea */
.xback { position: fixed; z-index: 39; width: 460px; max-width: 60vw; height: 170px; box-sizing: border-box; overflow: hidden;
  background: var(--panel); border: 2px solid transparent; border-radius: 8px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.28);
  font: inherit; line-height: 20px; white-space: pre-wrap; overflow-wrap: break-word; color: var(--ink); pointer-events: none; }
.xwrap.rich.open .xbox { background: transparent; color: transparent; caret-color: var(--ink); box-shadow: none; overflow-y: scroll;
  white-space: pre-wrap; overflow-wrap: break-word; }
/* full-description review mode */
.xwrap.full { height: auto; min-height: 30px; min-width: 400px; }
.xwrap.full .xbox { display: none; }
.xwrap.full.editing .xbox { display: block; }
.xwrap.full.editing .xview { visibility: hidden; }
.xview { padding: 4px 6px; font-size: 13px; line-height: 1.45; cursor: text; color: var(--ink); overflow-wrap: anywhere; border-radius: 6px; }
.xview:hover { background: var(--accent-soft); }
.xview:focus { outline: 2px solid var(--accent); }
td:has(> .xwrap.full) { vertical-align: top; }
td { vertical-align: top; }
.calc { display: inline-block; padding: 5px 6px 4px; }
.app { grid-template-columns: 176px 1fr; }
main { padding: 22px 16px 40px; }
.xwrap.full { min-width: 320px; }
#main th, #main td { padding-left: 3px; padding-right: 3px; }
.act .small { padding: 2px 6px; }
td.act { white-space: normal; width: 104px; max-width: 104px; }
.xwrap.full { min-width: 230px; }
/* reference image cell */
.imgcell { position: relative; min-height: 56px; width: 96px; border: 1px dashed var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; font-size: 12px; }
.imgcell:hover, .imgcell:focus { border-color: var(--accent); outline: none; }
.imgcell .thumb { display: block; width: 100%; height: auto; }
.imgcell .imgx { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.55); color: #fff; border-radius: 50%; width: 20px; height: 20px; padding: 0; line-height: 18px; display: none; }
.imgcell:hover .imgx { display: block; }
.bk-fields { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.bk-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.bk-fields input { width: 140px; border-color: var(--line); background: var(--input); color: var(--ink); }
.bk-fields input[readonly] { opacity: .6; }
/* several pictures per item */
.imgcell { width: 104px; min-height: 0; border: 0; border-radius: 0; display: block; cursor: auto; overflow: visible; }
.imggrid { display: grid; grid-template-columns: 1fr; gap: 4px; }
.imggrid.many { grid-template-columns: 1fr 1fr; }
.imgtile { position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.imgtile .thumb { display: block; width: 100%; height: auto; cursor: zoom-in; }
.imgtile .imgx { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.6); color: #fff; border-radius: 50%; width: 20px; height: 20px; padding: 0; line-height: 18px; display: none; }
.imgtile:hover .imgx { display: block; }
.imgbtns { display: flex; gap: 4px; margin-top: 4px; }
.imgbtns button { flex: 1; }
.lightimg { max-width: 92vw; max-height: 92vh; border-radius: 8px; background: #fff; }
tr.active > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.imgbtns button { white-space: nowrap; padding: 2px 4px; font-size: 12px; }
/* picture box */
.imgtile { background: #fff; width: 100%; }
.imgtile .thumb { width: 100%; height: 100%; object-fit: contain; }
.pbmodal { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; max-width: 94vw; max-height: 94vh; overflow: auto; }
.pbwrap { display: flex; justify-content: center; padding: 6px 0; }
.pbstage { position: relative; background: #fff; border: 2px solid var(--accent); border-radius: 6px; overflow: hidden; touch-action: none; user-select: none; }
.pbitem { position: absolute; cursor: move; box-sizing: border-box; }
.pbitem img { width: 100%; height: 100%; display: block; pointer-events: none; }
.pbitem.sel { outline: 2px solid #2b7de9; }
.pbgrip { display: none; position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; background: #2b7de9; border: 2px solid #fff; border-radius: 4px; cursor: nwse-resize; }
.pbitem.sel .pbgrip { display: block; }
.pbsize { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pbsize input { width: 120px; }
/* subcontract / supplier items */
tr.x-subcon { background: rgba(142,107,216,.10); }
tr.x-supplier { background: rgba(60,170,150,.10); }
.exec-sel { font-size: 12px; }
.tail { display: flex; align-items: flex-start; gap: 28px; margin-top: 14px; flex-wrap: wrap; }
.split { flex: 1; min-width: 380px; font-size: 13px; }
.split table { margin-top: 4px; }
.split th, .split td { padding: 3px 6px; }
.tail .totals { margin-left: auto; }
a, a:visited { color: var(--accent); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); border-radius: 3px; }
.bk-wrap table th, .bk-wrap table td { padding-left: 3px; padding-right: 3px; }
.split tr.bk-strong td { font-weight: 600; border-top: 1px solid var(--line); }
.tablewrap.free { max-height: none; }
/* polished Breakdown button */
td.act { width: 122px; max-width: 122px; }
.bkbtn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 5px 10px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); font-weight: 600; font-size: 12px; line-height: 1.2;
  letter-spacing: .2px; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: filter .12s, background .12s, color .12s; }
.bkbtn:hover { filter: brightness(1.1); border-color: var(--accent); }
.bkbtn:active { filter: brightness(.92); }
.bkbtn .chev { font-size: 10px; opacity: .85; }
.bkbtn .bkcount { background: rgba(0,0,0,.28); color: inherit; border-radius: 999px; min-width: 18px; padding: 0 6px; font-size: 11px; font-weight: 700; text-align: center; }
.bkbtn.open { background: transparent; color: var(--accent); box-shadow: none; }
.bkbtn.open .bkcount { background: var(--accent-soft); }
.rowtools { display: flex; justify-content: space-between; margin-top: 4px; padding: 0 6px; }
.rowtools .icon { padding: 1px 8px; border-radius: 6px; }
.rowtools .icon:hover { background: var(--accent-soft); color: var(--accent); }
.rowtools .icon:last-child:hover { color: var(--bad); background: transparent; }
/* Breakdown button: centred label, regular weight */
.bkbtn { position: relative; justify-content: center; font-weight: 500; padding: 5px 24px; letter-spacing: .1px; }
.bkbtn .chev { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.bkbtn .bkcount { font-weight: 500; }
.rowtools { justify-content: center; gap: 16px; padding: 0; }
/* every brown button turns a soft, comfortable white while hovered or pressed */
:root { --soft-white: #f6f1e8; --soft-white-ink: #7a4e24; }
button.primary:hover, button.primary:active, .bkbtn:hover, .bkbtn:active, .bkbtn.open:hover {
  background: var(--soft-white); color: var(--soft-white-ink); border-color: var(--accent); filter: none; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
button.primary:hover .bkcount, .bkbtn:hover .bkcount, .bkbtn:active .bkcount { background: rgba(122,78,36,.14); color: var(--soft-white-ink); }
.bkbtn { padding: 5px 10px; gap: 7px; }
.bkbtn .chev { position: static; transform: none; }
/* Breakdown button: the word sits exactly in the middle; the item count is a small corner badge */
.bkbtn { position: relative; display: block; width: calc(100% - 10px); margin: 0 auto; padding: 6px 10px; text-align: center; overflow: visible; }
.bkbtn .bklabel { display: block; text-align: center; }
.bkbtn .bkcount { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; line-height: 16px; padding: 0 5px; box-sizing: border-box;
  background: #5b3a1e; color: #fff; border: 2px solid var(--panel); border-radius: 999px; font-size: 11px; font-weight: 600; text-align: center; }
.bkbtn:hover .bkcount, .bkbtn:active .bkcount, .bkbtn.open .bkcount { background: #5b3a1e; color: #fff; }
.bkbtn .chev { display: none; }
/* undo / redo and confirmation dialogs */
.undo-row { display: flex; gap: 6px; margin-bottom: 8px; }
.undo-row button { flex: 1; padding: 5px 4px; font-size: 12px; }
.undo-row button:disabled { opacity: .4; cursor: default; border-color: var(--line); }
button.danger { background: #a8402f; color: #fff; border-color: #a8402f; font-weight: 500; }
button.danger:hover, button.danger:active { background: #8c3224; border-color: #8c3224; color: #fff; }
.confirm-bg { z-index: 100; }
.confirm-bg .modal h2 { margin-top: 0; }
.confirm-bg .modal button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* numbers are changed by typing or the mouse wheel, so the little step arrows are hidden */
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; display: none; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
/* polished row actions (Estimates list): one tidy line */
td.act.wide { width: auto; max-width: none; white-space: nowrap; }
.rowactions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
button.pill { border-radius: 999px; padding: 5px 16px; font-size: 12px; font-weight: 500; min-width: 64px; text-align: center; line-height: 1.2; }
button.pill.primary { min-width: 64px; }
.rowactions .icon { padding: 3px 8px; border-radius: 6px; font-size: 13px; }
.rowactions .icon:hover { background: transparent; color: var(--bad); }
/* the narrow action column is only for the item rows; ordinary tables get room for their buttons on one line */
.tablewrap:not(.free) td.act { width: auto; max-width: none; white-space: nowrap; }
.tablewrap:not(.free) td.act .pill { margin-right: 6px; }
/* in wide tables (Enquiries, Rate Library, Procurement) keep the row buttons pinned at the right edge */
.tablewrap:not(.free) td.act { position: sticky; right: 0; background: var(--panel); z-index: 2; box-shadow: -8px 0 8px -8px rgba(0,0,0,.45); }
.tablewrap:not(.free) th:last-child { position: sticky; right: 0; z-index: 4; background: var(--head); }
/* Estimates list: one group per project */
tr.grp > td { background: var(--accent-soft); padding: 0; border-top: 2px solid var(--line); }
.grphead { display: flex; align-items: baseline; gap: 12px; padding: 10px 12px; cursor: pointer; user-select: none; }
.grphead:hover { filter: brightness(1.08); }
.gchev { width: 14px; color: var(--accent); font-size: 13px; }
.gnum { font-weight: 700; color: var(--accent); letter-spacing: .2px; }
.gname { font-weight: 600; font-size: 15px; }
.gmeta { color: var(--muted); font-size: 12px; }
.gtotal { font-weight: 600; white-space: nowrap; }
tr.rev td { padding-top: 7px; padding-bottom: 7px; }
td.revcell { padding-left: 38px; white-space: nowrap; }
td.revcell strong { font-weight: 600; margin-right: 8px; }
.pill.latest { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.grphead .grow { flex: 1; }
.grphead .gtotal { padding-right: 14px; }
/* cutting list calculator inside the Breakdown */
.cut { margin: 4px 0 16px; padding: 10px 12px 12px; border: 1px dashed var(--accent); border-radius: 10px; background: rgba(0,0,0,.12); }
.cut .bar { margin-bottom: 6px; }
.cut-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12px; white-space: nowrap; }
.chip.warn { border-color: var(--bad); color: var(--bad); }
.cut-opts { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }
.cut-opts label, .cut-outs label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.cut-opts input { width: 110px; color: var(--ink); background: var(--input); border-color: var(--line); }
.cut-opts select, .cut-outs select { color: var(--ink); background: var(--input); border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; }
.cut-outs { display: flex; flex-wrap: wrap; gap: 18px; }
.cut table input { min-width: 0; }
.cut table td:nth-child(1) input { min-width: 90px; }
.cut table td:nth-child(2) input { min-width: 100px; }
.cut table td:nth-child(n+3):nth-child(-n+5) input { width: 56px; }
.cut table td:nth-child(n+6):nth-child(-n+8) input { width: 54px; text-align: center; }
.bk-wrap td input[readonly] { opacity: .65; cursor: not-allowed; }
.cut table td:nth-child(1) input { min-width: 130px; }
.cut table td:nth-child(2) input { min-width: 140px; }
.cut table td:nth-child(n+6):nth-child(-n+9) input { width: 54px; text-align: center; }

.cut table td:nth-child(n+6):nth-child(-n+9) input { width: 54px; text-align: center; }

/* dropdown cells in the cutting list */
.cut-pick { width: 100%; color: var(--ink); background: var(--input); border: 1px solid var(--line); border-radius: 6px; padding: 4px 5px; font-size: 12.5px; }
.cut table td:nth-child(n+6):nth-child(-n+8) .cut-pick { min-width: 104px; }
.cut table td:nth-child(9) .cut-pick { min-width: 150px; }
.cut-pick:focus { outline: 2px solid var(--accent); }
/* tighter cutting-list columns so the whole row fits */
.cut table td:nth-child(1) input { min-width: 96px; }
.cut table td:nth-child(2) input { min-width: 108px; }
.cut table td:nth-child(n+3):nth-child(-n+5) input { width: 48px; }
.cut table td:nth-child(n+6):nth-child(-n+8) .cut-pick { min-width: 92px; font-size: 12px; padding: 4px 3px; }
.cut table td:nth-child(9) .cut-pick { min-width: 136px; font-size: 12px; padding: 4px 3px; }
.cut table th, .cut table td { padding-left: 2px; padding-right: 2px; }

/* sheet size per board (jumbo sheets) */
.cut-sizes { margin: 4px 0 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.1); }
.cut-size-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.cut-size-row strong { min-width: 150px; font-weight: 600; }
.cut-size-row select { color: var(--ink); background: var(--input); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
.cut-size-row label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cut-size-row input { width: 80px; color: var(--ink); background: var(--input); border: 1px solid var(--line); }
.cut-size-row select { width: auto; min-width: 190px; }
.cut-size-row { flex-wrap: nowrap; }
.cut-size-row strong { flex: 0 0 170px; }
.cut-size-row input { width: 84px; }

.cut-size-row { flex-wrap: wrap; }
.cut-size-row .cut-fb select { min-width: 150px; }

/* finishes used by the item (several paints / veneers / HPLs) */
.cut-finishes { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 10px; }
.cut-finish { flex: 1 1 260px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.1); }
.cut-finish > strong { display: block; margin-bottom: 4px; font-size: 13px; }
.cut-finish-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; flex-wrap: wrap; }
.cut-finish-row select { color: var(--ink); background: var(--input); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; min-width: 170px; }
.cut table td:nth-child(n+6):nth-child(-n+8) .cut-pick { min-width: 150px; }
.cut-finishes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.cut-finish { min-width: 0; flex: none; }
.cut-finish-row select { width: auto; min-width: 140px; max-width: 100%; flex: 1 1 140px; }
.cut-finish-row .muted { font-size: 12px; white-space: nowrap; }
/* keep the cutting-list panel inside the screen when several finishes make the dropdowns longer */
.cut-detail { overflow-x: auto; }
.cut table td:nth-child(n+6):nth-child(-n+8) .cut-pick { min-width: 124px; width: 124px; }
.cut table td:nth-child(9) .cut-pick { min-width: 124px; width: 124px; }
.cut table td:nth-child(1) input { min-width: 88px; }
.cut table td:nth-child(2) input { min-width: 100px; }

/* ---- Privacy mode ---- */
.priv-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; margin-bottom: 8px; border-radius: 8px; font-size: 12.5px; text-align: left; }
.priv-switch { position: relative; width: 30px; height: 17px; border-radius: 999px; background: var(--line); flex: none; transition: background .15s; }
.priv-knob { position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--ink); transition: left .15s, background .15s; }
.priv-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.priv-btn.on .priv-switch { background: rgba(0,0,0,.3); }
.priv-btn.on .priv-knob { left: 15px; background: #fff; }
body.privacy .sens, body.privacy tr.bk, body.privacy .totals .int { display: none !important; }
body.privacy .mask { filter: blur(7px); user-select: none; pointer-events: none; }
body.privacy .side { box-shadow: inset 0 0 0 2px var(--accent); }
.lock { max-width: 640px; margin-top: 8vh; }
/* headings line up with the text under them: header padding = cell padding + input border + input padding */
#main .tablewrap thead th { padding-left: 9px; padding-right: 9px; }
#main .bk-wrap table thead th { padding-left: 9px; padding-right: 9px; }
#main .cut table thead th { padding-left: 8px; padding-right: 8px; }
#main thead th { vertical-align: bottom; }
.imgcell { margin-left: 6px; }

/* ---- polished number columns ---- */
/* one heading style for every table */
#main thead th { font-size: 11.5px; font-weight: 600; letter-spacing: .35px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
/* digits all the same width so figures line up exactly */
.calc, td.num input, .totals span, .split td.num, td.num { font-variant-numeric: tabular-nums; }
/* Cost / Rate / Amount: equal fixed widths, same size text in the heading and the figures */
.tablewrap.free th.amt, .tablewrap.free td.amt { width: 104px; min-width: 104px; max-width: 104px; }
.tablewrap.free td.amt .calc { font-size: 13.5px; }
.tablewrap.free td.amt-total .calc { font-weight: 600; color: var(--ink); }
.tablewrap.free th.amt-total { color: var(--ink); }
/* fit the item table: a narrower description share, slimmer amount columns, and a two-line Contingency heading */
.tablewrap.free th.amt, .tablewrap.free td.amt { width: 96px; min-width: 96px; max-width: 96px; }
#main thead th { letter-spacing: .25px; }
#main thead th.wrap { white-space: normal; line-height: 1.2; min-width: 84px; }
.tablewrap.free th.amt, .tablewrap.free td.amt { width: 92px; min-width: 92px; max-width: 92px; }
.imgcell { width: 92px; }
td.act { width: 110px; max-width: 110px; }
.xwrap.full { min-width: 220px; }
/* picture buttons stacked under the thumbnail, so the picture column stays narrow */
.imgbtns { flex-direction: column; gap: 4px; }
.imgbtns button { flex: none; width: 100%; }
.xwrap:not(.full) { min-width: 56px; }

.pctin { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Estimates list: fixed columns, headings over their figures, project totals under Net / Margin ---- */
.est-table { table-layout: fixed; width: 100%; }
#main .est-table th, #main .est-table td { padding-left: 9px; padding-right: 9px; }
#main .est-table td { vertical-align: middle; }
.est-table tr.grp { cursor: pointer; }
.est-table tr.grp > td { padding-top: 0; padding-bottom: 0; }
.est-table .grphead { padding: 10px 0; }
.est-table td.grp-num { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.est-table td.grp-num.bad { color: var(--bad); } .est-table td.grp-num.good { color: var(--good); }
.est-table tr.grp:hover > td { filter: brightness(1.08); }
.est-table td.revcell { padding-left: 9px; border-left: 3px solid var(--accent-soft); }
.est-table td.num { font-variant-numeric: tabular-nums; }
.est-table td.act { position: static; box-shadow: none; background: transparent; width: auto; max-width: none; }
.est-table td.revcell strong { margin-right: 8px; }

.pill.jb { background: var(--accent); color: var(--accent-ink); font-weight: 600; margin-right: 8px; }
.pill.vo { background: var(--accent-soft); margin-right: 8px; font-weight: 600; }

/* estimate header form: every label one line, inputs on one baseline */
.form.hdr { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); align-items: end; gap: 12px 16px; }
.form.hdr > label { white-space: nowrap; }
.form.hdr > label.wide { white-space: normal; }
.form.hdr > label > input, .form.hdr > label > select { width: 100%; box-sizing: border-box; height: 34px; }
.form.hdr > label > input::placeholder { color: var(--muted); opacity: .7; }

/* ---- Review rate changes dialog ---- */
.modal.wide { width: 980px; max-width: 94vw; }
.rr-scroll { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.rr-scroll table { width: 100%; }
.rr-scroll th { position: sticky; top: 0; background: var(--head); z-index: 1; }
.rr-scroll td, .rr-scroll th { padding: 7px 10px; vertical-align: middle; }
.rr-scroll td .muted { font-size: 11.5px; }
.rr-scroll td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rr-scroll td.bad { color: var(--bad); } .rr-scroll td.good { color: var(--good); }
.rr-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.rr-card { background: var(--head); border-radius: 8px; padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.rr-card strong { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.rr-card strong.bad { color: var(--bad); } .rr-card strong.good { color: var(--good); }

.rr-same td { color: var(--muted); }
.rr-same td strong { font-weight: 500; }
.rr-same td[colspan] { text-align: center; }

/* Review rates button: brown-tinted, between the plain buttons and the solid Add item button */
button.ratebtn { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 500; display: inline-flex; align-items: center; gap: 7px; }
button.ratebtn .ri { font-size: 15px; line-height: 1; }
button.ratebtn:hover { background: var(--accent); color: var(--accent-ink); }

/* "add" buttons sit under the list they add to */
.addrow { display: flex; gap: 8px; margin: 8px 0 14px; }
.addrow.boq-add { margin: 12px 0 6px; }

/* ---- Procurement ---- */
.proc-table { width: 100%; }
.proc-table td, .proc-table th { padding: 7px 9px; vertical-align: middle; }
.proc-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.proc-table td input { width: 100%; box-sizing: border-box; }
.proc-table td.num input { text-align: right; }
.proc-table td.bad { color: var(--bad); }
.proc-table td.act { white-space: nowrap; }
.pbar { height: 7px; border-radius: 4px; background: var(--head); overflow: hidden; }
.pfill { height: 100%; background: var(--accent); }
.pfill.over { background: var(--bad); }
.chip-st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; background: var(--head); white-space: nowrap; }
.chip-st.good { color: var(--good); } .chip-st.bad { color: var(--bad); } .chip-st.warn { color: var(--accent); } .chip-st.muted { color: var(--muted); }
.cards .v.bad { color: var(--bad); }

/* ---- LPOs ---- */
.lpo { padding-bottom: 6px; }
.lpo-head { align-items: flex-end; margin-bottom: 10px; gap: 14px; }
.lpo-head label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.lpo-head strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.lpo-table td input { min-width: 0; }
.lpo-table td.num input { min-width: 70px; }

.lpo-table select.jobsel { min-width: 210px; max-width: 260px; width: 100%; }

/* searchable dropdown */
.lpo-table input.ssel { min-width: 210px; width: 100%; }
.ssel-list { position: fixed; z-index: 50; max-height: 260px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35); padding: 4px; }
.ssel-opt, .ssel-none { padding: 7px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.ssel-opt:hover, .ssel-opt.on { background: var(--accent-soft); color: var(--accent); }
.ssel-opt.cur { font-weight: 600; }
.ssel-none { color: var(--muted); cursor: default; }

.lpo-table td:nth-child(2) input { min-width: 210px; }
.lpo-table td:nth-child(3) input { min-width: 70px; }

.lpo-desc td { padding-top: 0; border-top: 0; }
.lpo-ta { width: 100%; box-sizing: border-box; min-height: 46px; resize: vertical; font: inherit; font-size: 12.5px; }

.lpo-table td:nth-child(2) input { min-width: 190px; }
.lpo-table td:nth-child(3) input { min-width: 200px; }
.lpo-table td:nth-child(4) input { min-width: 64px; }

/* item allocation */
.allocbtn { width: 100%; min-width: 190px; text-align: left; font-weight: 400; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.allocbtn:disabled { opacity: .6; cursor: default; }
.alloc-pop { position: fixed; z-index: 60; width: 390px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.4); padding: 14px; }
.alloc-title { font-weight: 600; margin-bottom: 2px; }
.alloc-rows { max-height: 240px; overflow-y: auto; }
.alloc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 2px; }
.alloc-row label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 13px; color: var(--ink); }
.alloc-row label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alloc-pct { display: flex; align-items: center; gap: 3px; color: var(--muted); }
.alloc-pct input { width: 68px; text-align: right; }
.alloc-total { margin-top: 6px; font-size: 12.5px; }
.alloc-total .bad { color: var(--bad); }

/* LPO lines: keep the table inside the page */
.lpo-table input.ssel { min-width: 150px; }
.lpo-table td:nth-child(2) input, .allocbtn { min-width: 150px; max-width: 200px; }
.lpo-table td:nth-child(3) input { min-width: 150px; }
.lpo-table td:nth-child(4) input { min-width: 56px; }
.lpo-table td.num input { min-width: 56px; }
.lpo-table th, .lpo-table td { padding-left: 6px; padding-right: 6px; }

.alloc-custom { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--ink); cursor: pointer; }

.alloc-pop { width: 340px; padding: 12px 14px; }
.alloc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.alloc-title { margin: 0; }
.alloc-custom { margin: 0; gap: 6px; font-size: 12px; color: var(--muted); }
.alloc-custom input { width: 14px; height: 14px; margin: 0; }
.alloc-total { min-height: 16px; }

/* Store */
.proc-table tr.void td { opacity: .45; text-decoration: line-through; }
.proc-table tr.void td.act { text-decoration: none; }
input.warnin { border-color: var(--bad); }
.modal.wide .form { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* Store tables: action buttons stay inside the panel */
.issue-table th, .issue-table td { padding-left: 7px; padding-right: 7px; }
.issue-table td.act { white-space: nowrap; text-align: right; width: 1%; }
.issue-table td.act .pill { min-width: 0; padding: 4px 12px; margin-left: 5px; }
.issue-table td:nth-child(3), .issue-table td:nth-child(4) { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

label.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
label.inline select { min-width: 260px; }

label.inline input.ssel { min-width: 280px; }

.rategroup { padding-top: 6px; padding-bottom: 8px; }
.rategroup .grphead { padding: 10px 0; }
.rategroup .tablewrap { margin-top: 4px; }

.rr-sub td { background: rgba(255,255,255,.03); font-size: 12.5px; }
.rr-item td { background: var(--head); }
.rr-scroll td input[type=checkbox] { margin: 0; }

/* sliding two-way switch */
.seg { position: relative; display: inline-flex; background: var(--head); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { position: relative; z-index: 1; flex: 1; min-width: 118px; border: 0; background: transparent; color: var(--muted); border-radius: 999px; padding: 6px 16px; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: color .2s; }
.seg button.on { color: var(--accent-ink); }
.seg button:hover:not(.on) { color: var(--ink); background: transparent; }
.seg .thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); background: var(--accent); border-radius: 999px; transition: transform .22s ease; }
.seg[data-mode="item"] .thumb { transform: translateX(100%); }
.seg-gap { width: 1px; height: 22px; background: var(--line); margin: 0 12px; }

.rr-badge { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: rgba(230, 90, 90, .18); color: var(--bad); border: 1px solid rgba(230, 90, 90, .45); font-size: 12px; font-weight: 600; white-space: nowrap; }

.rr-badge.up { background: rgba(230, 90, 90, .18); color: var(--bad); border-color: rgba(230, 90, 90, .45); }
.rr-badge.down { background: rgba(80, 190, 120, .16); color: var(--good); border-color: rgba(80, 190, 120, .45); }

.rr-rate { width: 92px; text-align: right; }
.rr-rate.custom { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.rr-same.edited td { color: var(--ink); }
.rr-scroll td button.icon { padding: 0 4px; }

/* ---- Enquiries & Submissions ---- */
.seg3 .thumb { width: calc((100% - 6px) / 3); }
.seg3[data-i="1"] .thumb { transform: translateX(100%); } .seg3[data-i="2"] .thumb { transform: translateX(200%); }
.seg3 button.on { color: var(--accent-ink); }
.enq-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 12px; }
.enq-kpis .card.clickable { cursor: pointer; } .enq-kpis .card.clickable:hover { border-color: var(--accent); }
.enq-kpis .v.good { color: var(--good); } .enq-kpis .v.bad { color: var(--bad); }
.enq-attn { margin-bottom: 12px; padding: 12px 16px; }
.enq-hot { display: flex; flex-direction: column; gap: 2px; }
.enq-hotrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.enq-hotrow:hover { background: var(--accent-soft); }
.enq-hotrow .num { font-variant-numeric: tabular-nums; margin-right: 6px; }
.enq-filters .bar { margin-bottom: 8px; }
.enq-sel { width: 170px; }
.enq-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip { border-radius: 999px; padding: 4px 12px; font-size: 12px; background: var(--head); border: 1px solid var(--line); color: var(--muted); cursor: pointer; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip:hover:not(.on) { color: var(--ink); }
.enq-pill { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.enq-pill.clickable { cursor: pointer; }
.st-enquiry { background: var(--head); color: var(--muted); }
.st-estimating { background: rgba(224, 170, 80, .16); color: #e0aa50; }
.st-submitted { background: var(--accent-soft); color: var(--accent); }
.st-negotiation { background: rgba(235, 140, 70, .18); color: #eb8c46; }
.st-hold { background: var(--head); color: var(--muted); border: 1px dashed var(--line); }
.st-won { background: rgba(80, 190, 120, .16); color: var(--good); }
.st-lost { background: rgba(230, 90, 90, .16); color: var(--bad); }
.chip.st-enquiry:not(.on), .chip.st-estimating:not(.on), .chip.st-submitted:not(.on), .chip.st-negotiation:not(.on), .chip.st-hold:not(.on), .chip.st-won:not(.on), .chip.st-lost:not(.on) { background: var(--head); }
.enq-age { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; margin-left: 4px; font-variant-numeric: tabular-nums; }
.age-ok { background: rgba(80, 190, 120, .16); color: var(--good); } .age-warn { background: rgba(224, 170, 80, .18); color: #e0aa50; } .age-bad { background: rgba(230, 90, 90, .18); color: var(--bad); }
.enq-table { width: 100%; } .enq-table th, .enq-table td { padding: 9px 10px; vertical-align: middle; }
.enq-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.enq-sub { font-size: 11.5px; } .enq-sub.good { color: var(--good); } .enq-sub.bad { color: var(--bad); }
.enq-next { max-width: 280px; font-size: 12.5px; }
.enq-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px; overflow-x: auto; align-items: start; padding-bottom: 8px; }
.enq-col { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 160px; }
.enq-col.over { border-color: var(--accent); background: var(--accent-soft); }
.enq-colhead { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 8px; margin-bottom: 8px; font-size: 13px; }
.enq-card { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 7px; cursor: grab; }
.enq-card:hover { border-color: var(--accent); }
.enq-card-title { font-weight: 600; font-size: 13px; line-height: 1.3; }
.enq-card-foot { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; }
.enq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.enq-grid .panel { margin: 0; }
.enq-bar { display: grid; grid-template-columns: minmax(120px, 42%) 1fr auto; gap: 10px; align-items: center; padding: 4px 0; font-size: 12.5px; }
.enq-bar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.enq-track { height: 8px; background: var(--head); border-radius: 4px; overflow: hidden; }
.enq-fill { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.enq-bar-v { font-variant-numeric: tabular-nums; color: var(--ink); min-width: 70px; text-align: right; }
.enq-cols { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding-top: 6px; }
.enq-colbar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; min-width: 26px; }
.enq-stack { width: 70%; max-width: 38px; background: var(--accent-soft); border-radius: 4px 4px 0 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; border: 1px solid var(--accent); }
.enq-won { display: block; background: var(--accent); width: 100%; }
.enq-colval, .enq-collab { font-size: 11px; text-align: center; line-height: 1.25; font-variant-numeric: tabular-nums; }
.enq-mini { width: 100%; font-size: 12.5px; } .enq-mini th, .enq-mini td { padding: 5px 7px; } .enq-mini td.num { font-variant-numeric: tabular-nums; }
.enq-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 94vw; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -14px 0 40px rgba(0,0,0,.4); z-index: 40; display: flex; flex-direction: column; }
.enq-dhead { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.enq-dtitle { font-size: 17px; font-weight: 700; }
.enq-dbody { overflow-y: auto; padding: 14px 18px 24px; }
.enq-dform { grid-template-columns: 1fr 1fr; margin: 12px 0; }
.enq-dsec { margin-top: 16px; } .enq-dsec h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .35px; color: var(--muted); }
.enq-log { margin-top: 8px; max-height: 240px; overflow-y: auto; }
.enq-logrow { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center; }
.enq-logrow.auto span:last-child { color: var(--muted); }
.danger-text { color: var(--bad); }

.tablewrap.enq-wrap { max-height: none; overflow-y: visible; overflow-x: auto; }

/* Submitted: grey with white text */
.st-submitted { background: #55524d; color: #ffffff; }
.chip.st-submitted:not(.on) { background: #55524d; color: #ffffff; }
.enq-colhead.st-submitted { background: #55524d; color: #ffffff; }
.enq-colhead.st-submitted .muted { color: #e6e3de; }

.enq-mini td input, .enq-mini td select { padding: 3px 6px; font-size: 12.5px; }
.enq-mini td.act { white-space: nowrap; }

/* Completed: awarded and finished (outlined green; Awarded-ongoing is filled green) */
.st-completed { background: transparent; color: var(--good); border: 1px solid rgba(80, 190, 120, .6); }
.chip.st-completed:not(.on) { background: var(--head); }
.enq-colhead.st-completed { background: transparent; border: 1px solid rgba(80, 190, 120, .5); color: var(--good); }

.enq-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* start-up screen, removed once the data is loaded */
.splash { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: var(--bg); transition: opacity .3s; }
.splash.gone { opacity: 0; pointer-events: none; }
.splash-box { text-align: center; }
.splash .logo { font-size: 22px; padding: 8px 14px; border-radius: 10px; font-weight: 700; }
.splash-name { margin: 12px 0 16px; font-size: 18px; color: var(--ink); letter-spacing: .3px; }
.splash-bar { width: 160px; height: 3px; margin: 0 auto; border-radius: 3px; background: var(--line); overflow: hidden; }
.splash-bar span { display: block; width: 40%; height: 100%; background: var(--accent); border-radius: 3px; animation: splashmove 1.1s ease-in-out infinite; }
@keyframes splashmove { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* ownership notice above the privacy button */
.copyright { margin: 0 0 10px; padding: 8px 6px 9px; text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.45; letter-spacing: 0; opacity: .8; white-space: nowrap; user-select: none; }
.copyright strong { display: block; margin-bottom: 1px; color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: .4px; }

/* ---- Payables ---- */
.seg:not(.seg3)[data-i="1"] .thumb { transform: translateX(100%); }
.pay-table { width: 100%; border-collapse: collapse; }
.pay-table th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--head); }
.pay-table th.num, .pay-table td.num { text-align: right; }
.pay-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pay-table tr.pay-row-paid td { opacity: .6; }
.pay-badge { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pay-badge.pay-overdue { background: rgba(179, 55, 44, .15); color: var(--bad); }
.pay-badge.pay-soon { background: rgba(183, 121, 31, .18); color: var(--warn); }
.pay-badge.pay-later { background: var(--head); color: var(--muted); }
.pay-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--head); color: var(--muted); }
.pay-pill.pay-overdue { background: var(--bad); color: #fff; }
.pay-pill.pay-soon { background: rgba(183, 121, 31, .2); color: var(--warn); }
.pay-pill.pay-paid { background: rgba(47, 122, 75, .18); color: var(--good); }
.pay-instt { width: 100%; border-collapse: collapse; }
.pay-instt th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 5px 8px; }
.pay-instt td { padding: 4px 8px; border-top: 1px solid var(--line); }
.pay-instt th.num, .pay-instt td.num { text-align: right; }
.pay-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; }
.pay-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pay-form .wide { grid-column: 1 / -1; }
.pay-warn { margin-top: 8px; padding: 7px 10px; border-radius: 8px; background: rgba(183, 121, 31, .15); color: var(--warn); font-size: 12.5px; }
.bad { color: var(--bad); }

/* drop-down lists must open above dialogs (dialogs are z-index 100) */
.ssel-list { z-index: 300; }

/* ---- web version only: sign-in, account box, notices ---- */
.jn-login { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 16px; }
.jn-box { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px 26px 22px; box-shadow: 0 10px 40px rgba(0, 0, 0, .18); }
.jn-box h1 { font-size: 20px; margin: 14px 0 12px; }
.jn-box form, .jn-box > div { display: flex; flex-direction: column; gap: 12px; }
.jn-box label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12.5px; }
.jn-box input { padding: 10px 12px; font-size: 15px; }
.jn-box button { padding: 10px 14px; font-size: 14.5px; }
.jn-box p { margin: 0; line-height: 1.5; }
.jn-brand { text-align: left; }
.jn-brand { display: flex; align-items: center; gap: 9px; }
.jn-brand .logo { font-size: 18px; padding: 5px 11px; border-radius: 8px; font-weight: 700; display: inline-block; }
.jn-brandname { font-size: 19px; font-weight: 600; }
.jn-msg { min-height: 18px; color: var(--bad); font-size: 13px; }
.jn-account { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.jn-account strong { color: var(--ink); }
.jn-links { display: flex; gap: 12px; margin-top: 3px; }
.jn-links a { color: var(--accent); text-decoration: none; }
.jn-links a:hover { text-decoration: underline; }
.jn-banner { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 9000; background: var(--panel); color: var(--ink); border: 1px solid var(--accent); border-radius: 999px; padding: 8px 8px 8px 18px; display: flex; gap: 12px; align-items: center; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); font-size: 13.5px; }
