:root {
  --ink: #1d2433; --quiet: #5d6778; --line: #d9dee7; --bg: #f6f7f9; --card: #fff;
  --accent: #1f5fbf; --ok: #1e7b45; --warn: #a15c00; --err: #b3261e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 10px 20px; background: var(--ink); color: #fff; }
.topbar a { color: #fff; }
.brand { font-weight: 700; letter-spacing: .5px; }
.mainnav { display: flex; gap: 14px; flex-wrap: wrap; }
.tools { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.tools select { padding: 2px 4px; }
.who { color: #c9d1e0; font-size: 13px; }
button.link { background: none; border: 0; color: #fff; cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.page { max-width: 1180px; margin: 0 auto; padding: 20px; }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.narrow { max-width: 460px; margin: 40px auto; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.spacer { flex: 1; }
.btn, button.btn, input[type=submit] { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 8px 14px; font: inherit; cursor: pointer; }
.btn.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.danger { background: var(--err); }
.btn:hover { text-decoration: none; opacity: .92; }
.field { display: flex; flex-direction: column; margin-bottom: 12px; }
.field label { font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.field input, .field select, .field textarea { padding: 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; max-width: 100%; }
.field.has-error input, .field.has-error select { border-color: var(--err); }
.help { color: var(--quiet); }
.error { color: var(--err); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 20px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { background: #eef1f6; font-weight: 600; white-space: nowrap; }
td.n, th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.msg { padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; background: #e9f0fb; }
.msg-success { background: #e5f4e9; } .msg-error { background: #fbeaea; } .msg-warning { background: #fdf2e1; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 12px; background: #eef1f6; color: var(--quiet); }
.badge.error { background: #fbeaea; color: var(--err); } .badge.warning { background: #fdf2e1; color: var(--warn); }
.badge.ok, .badge.active, .badge.approved, .badge.confirmed { background: #e5f4e9; color: var(--ok); }
.badge.locked { background: #e3e8f4; color: #2f4a7a; }
.badge.draft, .badge.proposed, .badge.previewed, .badge.submitted, .badge.pm_approved { background: #fdf2e1; color: var(--warn); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--quiet); font-size: 13px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; padding: 0; list-style: none; }
.steps li { padding: 4px 10px; border-radius: 14px; background: #eef1f6; color: var(--quiet); font-size: 13px; }
.steps li.on { background: var(--accent); color: #fff; }
.tree-node > td { background: #f3f5f9; font-weight: 600; }
.tree-node.lvl-zone > td { background: #fafbfc; font-weight: 600; font-style: italic; }
.muted { color: var(--quiet); }
.inline { display: inline; }
code.link { word-break: break-all; background: #eef1f6; padding: 6px; display: block; border-radius: 4px; }
@media (max-width: 640px) {
  .page { padding: 12px; }
  .tools { margin-left: 0; }
  th, td { padding: 6px; font-size: 13px; }
}
.qr svg { width: 200px; height: 200px; display: block; margin: 8px 0; background: #fff; }
.codes { columns: 2; font-size: 16px; }
tr.changed td { background: #fdf2e1; }

.testbanner { background: #ffd84d; color: #222; padding: 8px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-bottom: 2px solid #c79a00; }
.testbanner .muted { color: #555; }
tr.line-assigned td { background: #fff4c2; }
tr.line-done td { background: #d9f2dc; }
table.timesheet td, table.timesheet th { padding: 4px 6px; }
table.timesheet .wk { background: #f1f1f1; }
table.timesheet input[size="3"] { width: 3.2em; text-align: right; }
.n.neg { color: #b00020; font-weight: 600; }
.day-block { margin-top: 22px; padding-top: 6px; border-top: 2px solid #c9d3e3; }
.day-block .day-head h2 { margin: 0; text-transform: capitalize; }
.day-block h3 { margin: 10px 0 4px; font-size: 1rem; }
tr.day-sep td { background: #eef2f8; font-weight: 600; text-transform: capitalize; }
.page.wide { max-width: 1680px; }
table.boq-progress { font-size: .88rem; }
table.boq-progress td:nth-child(2) { min-width: 240px; }
table.perf td small { white-space: nowrap; }
.badge.on_hold { background: #fff4e0; color: #8a5a00; }
tr.boq-full td { background: #e5f4e9; }
tr.boq-over td { background: #fde8ea; }
.badge.pm_review, .badge.admin_review { background: #fff4e0; color: #8a5a00; }
table.dash td { vertical-align: top; }
table.dash .badge { font-size: 11px; margin-bottom: 2px; display: inline-block; }
span.neg, .v.neg { color: #b00020; }
.dash-choices { margin: 0 0 14px; gap: 14px; font-size: 14px; }
.dash-choices select { margin-left: 4px; padding: 4px; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; margin-bottom: 8px; }
.chart-card { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 4px; }
.chart-card figcaption { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 14px; margin-bottom: 4px; }
.chart-card .legend { color: var(--quiet); font-size: 12px; display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.chart-card .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: -6px; }
.chart-card .legend i.tick { height: 2px; width: 12px; background: #1c2733; border-radius: 0; }
.chart-card .legend i.dash { height: 0; width: 14px; border-top: 2px dashed #5a6878; border-radius: 0; }
svg.chart { width: 100%; height: auto; display: block; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart-table { margin: 0 0 16px; font-size: 14px; }
.chart-table summary { cursor: pointer; color: var(--accent); margin-bottom: 6px; }
@media (max-width: 860px) { .charts { grid-template-columns: 1fr; } }
.badge.left { background: #fbeaea; color: var(--err); }
/* opening balance (2026-11-11) */
input.num { width: 7.5em; text-align: right; }
tr.row-error td { background: #fde8ea; }
.summary-bar { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.summary-bar > div { display: flex; flex-direction: column; }
.summary-bar strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.summary-bar .grow { flex: 1; min-width: 200px; }
.summary-bar .grow input { width: 100%; }
[data-sticky] { position: sticky; top: 0; z-index: 5; }
tr.boq-above td { background: #e6effa; }   /* unit rate: above the BOQ is allowed */
