/* KC Field Forms — mobile-first, built for iPad and phones in the field.
   Large touch targets, high contrast, safe-area aware, dark-mode aware. */

:root {
  --brand: #e8471b;
  --brand-2: #c93a12;
  --brand-tint: #fdeee9;
  --ink: #14171d;
  --muted: #5d6675;
  --bg: #eef0f3;
  --card: #ffffff;
  --input: #ffffff;
  --line: #d9dde4;
  --line-strong: #b9c0cc;
  --ok: #18844f;
  --ok-tint: #e3f5ec;
  --warn: #a35f00;
  --warn-tint: #fff2d9;
  --bad: #c4291f;
  --bad-tint: #fde8e6;
  --shadow: 0 1px 2px rgba(20, 23, 29, 0.06), 0 4px 14px rgba(20, 23, 29, 0.05);
  --r: 14px;
  --sig-ink: #0a0a1a;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --bar: 56px;
  --tabs: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #ff6a3d;
    --brand-2: #ff8258;
    --brand-tint: #3a211a;
    --ink: #eef0f4;
    --muted: #9aa3b2;
    --bg: #0f1216;
    --card: #181c22;
    --input: #10141a;
    --line: #2b313b;
    --line-strong: #434c59;
    --ok: #4fd08d;
    --ok-tint: #143324;
    --warn: #f0b04a;
    --warn-tint: #38290f;
    --bad: #ff7b70;
    --bad-tint: #3b1b18;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; touch-action: manipulation; overscroll-behavior-y: none;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 16px; }
.pad-x { padding: 4px 4px 12px; }
.ico { display: inline-flex; vertical-align: middle; flex: none; }

/* ---------- shell ---------- */
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px;
  padding: calc(var(--sat) + 6px) 10px 6px 8px; min-height: calc(var(--bar) + var(--sat));
  background: var(--card); border-bottom: 1px solid var(--line);
}
.tb-left { display: flex; align-items: center; min-width: 44px; }
.tb-logo { border-radius: 4px; margin-left: 6px; }
.tb-title { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.tb-title h1 { font-size: 19px; font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sub:empty { display: none; }
.tb-right { display: flex; align-items: center; gap: 6px; }
.main { flex: 1; padding-bottom: calc(var(--tabs) + var(--sab) + 16px); outline: none; }
.no-tabs .main { padding-bottom: calc(84px + var(--sab)); }
.page { max-width: 900px; margin: 0 auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; }

.tabnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--sab);
}
.no-tabs .tabnav { display: none; }
.tab-link { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tabs); font-size: 12px; font-weight: 600; color: var(--muted); }
.tab-link.on { color: var(--brand); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--card); font-weight: 600; font-size: 16px; white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:active { background: var(--brand-2); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ok { background: var(--ok-tint); border-color: var(--ok); color: var(--ok); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger-text { border-color: transparent; color: var(--bad); }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.lg { min-height: 54px; font-size: 17px; }
.btn.wide { width: 100%; }
.btn.grow { flex: 1; }
.btn.add { border-style: dashed; color: var(--brand); border-color: var(--brand); background: transparent; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 50%; color: inherit; }
.icon-btn:active { background: var(--line); }
.icon-btn.sm { width: 36px; height: 36px; }
.link-btn { border: 0; background: none; color: var(--brand); font-weight: 600; padding: 12px 4px; text-align: left; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.card-h { padding: 14px 16px 0; display: flex; flex-direction: column; gap: 4px; }
.card-h.between { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 2px; }
.card-h h3 { font-size: 17px; font-weight: 700; }
.card-h p { font-size: 13.5px; }
.card-b { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.card-b.flush, .card.flush { padding: 0; gap: 0; }
.card-sub { border-top: 1px dashed var(--line-strong); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.card-sub h4 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.form-body { display: flex; flex-direction: column; gap: 14px; }
.tool-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.lbl b { color: var(--brand); }
.hint { font-size: 12.5px; color: var(--muted); }
.input {
  width: 100%; min-height: 46px; padding: 9px 12px; border: 1.5px solid var(--line-strong); border-radius: 10px;
  background: var(--input); font-size: 17px; line-height: 1.3; -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 60%, transparent); }
.input:focus { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
textarea.input { resize: none; overflow: hidden; }
input[type='date'].input, input[type='time'].input { display: block; min-width: 0; }
input[type='date'].input::-webkit-date-and-time-value, input[type='time'].input::-webkit-date-and-time-value { text-align: left; }
input[type='search'].input { -webkit-appearance: none; }
select.input { padding-right: 30px; }
.search { margin-bottom: 2px; }
.count { font-size: 12.5px; color: var(--muted); }
.count.warn { color: var(--warn); font-weight: 600; }
.count.bad { color: var(--bad); font-weight: 700; }
.count:empty { display: none; }
.form-error { color: var(--bad); font-weight: 600; min-height: 0; }
.form-error:empty { display: none; }

.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 480px) { .grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 640px) { .grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.form-body .g3 > .stepper, .form-body .g3 > .readout { min-width: 0; }
/* Field coordinator / Superintendent / Project manager drop-downs: one per row on a phone so full names show */
.grid.g3.team-row { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.g3.team-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.stepper .step { display: grid; grid-template-columns: 46px 1fr 46px; gap: 6px; }
.step-in { text-align: center; padding: 0 4px; font-weight: 700; font-size: 18px; }
.step-btn { min-height: 46px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--card); font-size: 22px; font-weight: 700; color: var(--brand); }
.step-btn:active { background: var(--brand-tint); }

.readout { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; background: var(--bg); border-radius: 10px; min-width: 0; }
.readout-v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.readout.inline { flex-direction: row; align-items: baseline; justify-content: space-between; }
.readout.big { background: var(--brand-tint); }
.readout.big .readout-v { font-size: 22px; color: var(--brand); }
.totals { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chk { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 16px 0 12px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--card); font-weight: 600; user-select: none; }
.chk input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chk-box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; color: transparent; flex: none; }
.chk input:checked ~ .chk-box { background: var(--brand); border-color: var(--brand); color: #fff; }
.chk:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.chk input:focus-visible ~ .chk-box { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); }

.seg { display: flex; border: 1.5px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--card); }
.seg.stack { flex-direction: column; }
.seg-btn { flex: 1; min-height: 46px; padding: 0 10px; border: 0; border-right: 1px solid var(--line); background: transparent; font-weight: 600; font-size: 15px; }
.seg-btn:last-child { border-right: 0; }
.seg-btn.on { background: var(--brand); color: #fff; }
@media (max-width: 479px) { /* 4 long options -> 2 x 2 on phones */
  .seg.auto-wrap { display: grid; grid-template-columns: repeat(2, 1fr); }
  .seg.auto-wrap .seg-btn { border-right: 0; border-bottom: 1px solid var(--line); }
  .seg.auto-wrap .seg-btn:nth-child(odd) { border-right: 1px solid var(--line); }
  .seg.auto-wrap .seg-btn:nth-last-child(-n + 2) { border-bottom: 0; }
}

.sig-box {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 92px; padding: 8px;
  border: 2px dashed var(--line-strong); border-radius: 12px; background: #fff; color: #5d6675; font-weight: 600;
}
.sig-box.compact { min-height: 68px; font-size: 14px; }
.sig-box.signed { border-style: solid; border-color: var(--ok); }
.sig-box img { max-width: 100%; max-height: 76px; object-fit: contain; }
.sig-box.compact img { max-height: 54px; }
.sig-preview { display: flex; align-items: center; justify-content: center; min-height: 90px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.sig-preview img { max-height: 80px; max-width: 100%; }

.notice { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 14px; }
.notice.warn { background: var(--warn-tint); color: var(--warn); }
.notice .ico { margin-top: 1px; }

/* ---------- repeating rows ---------- */
.rows { display: flex; flex-direction: column; gap: 10px; }
.row-card { position: relative; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; background: color-mix(in srgb, var(--bg) 40%, var(--card)); }
.row-h { display: flex; align-items: center; justify-content: space-between; margin: -4px -4px 8px 0; }
.row-n { font-weight: 700; }
.row-card > .icon-btn { position: absolute; top: 4px; right: 4px; }
.rows-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rows-bar .btn { flex: 1 1 160px; }

.hours { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.hr { display: flex; flex-direction: column; align-items: stretch; gap: 1px; text-align: center; }
.hr span { font-size: 12px; font-weight: 700; color: var(--muted); }
.hr small { font-size: 10.5px; color: var(--muted); min-height: 13px; }
.hr .input { padding: 0 2px; text-align: center; font-size: 17px; font-weight: 600; min-height: 46px; }
.totals-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; text-align: center; }
.tc span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.tv { padding: 8px 0; background: var(--bg); border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- tabs ---------- */
.tabbar { display: flex; gap: 6px; background: var(--card); padding: 6px; border: 1px solid var(--line); border-radius: 14px; position: sticky; top: calc(var(--bar) + var(--sat) + 6px); z-index: 5; box-shadow: var(--shadow); }
.tab { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: transparent; font-weight: 700; color: var(--muted); }
.tab.on { background: var(--brand); color: #fff; }
.tab-panels > .tab-panel { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.tab-panels > .tab-panel.hidden { display: none !important; }

/* ---------- inspection matrix ---------- */
.mx-wrap { display: flex; flex-direction: column; gap: 10px; }
.mx-tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mx-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--card); font-weight: 700; font-size: 14px; padding: 2px; }
.mx-tab small { font-weight: 500; font-size: 11px; color: var(--muted); }
.mx-tab.today { border-color: var(--brand); }
.mx-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.mx-tab.on small { color: #ffe9e1; }
.mx-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.mx-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.mx { width: 100%; border-collapse: collapse; }
.mx th { position: sticky; top: 0; background: var(--bg); font-size: 12px; text-align: center; padding: 8px 2px; color: var(--muted); }
.mx th.item { text-align: left; padding-left: 12px; }
.mx td { border-top: 1px solid var(--line); padding: 6px 3px; text-align: center; vertical-align: middle; }
.mx td.item { text-align: left; padding: 8px 10px; min-width: 0; }
.item-label { font-size: 14.5px; font-weight: 500; line-height: 1.3; }
.mx td.item .input { min-height: 36px; margin-top: 6px; padding: 4px 9px; font-size: 14px; }
.cell { width: 46px; height: 46px; border: 2px solid var(--line-strong); border-radius: 10px; background: var(--card); color: transparent; }
.cell.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.yn { display: flex; gap: 4px; justify-content: center; }
.yn-btn { min-width: 54px; min-height: 46px; padding: 0 6px; border: 2px solid var(--line-strong); border-radius: 10px; background: var(--card); font-weight: 700; font-size: 15px; }
.yn-btn.y.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.yn-btn.n.on { background: var(--bad); border-color: var(--bad); color: #fff; }
/* phones: only the selected weekday is shown */
@media (max-width: 759px) {
  .mx-wrap[data-day='0'] .dcol:not(.d0), .mx-wrap[data-day='1'] .dcol:not(.d1), .mx-wrap[data-day='2'] .dcol:not(.d2),
  .mx-wrap[data-day='3'] .dcol:not(.d3), .mx-wrap[data-day='4'] .dcol:not(.d4), .mx-wrap[data-day='5'] .dcol:not(.d5),
  .mx-wrap[data-day='6'] .dcol:not(.d6) { display: none; }
  /* list layout: item + note on the left, the day's big button on the right */
  .mx-scroll { overflow: visible; border: 0; border-radius: 0; }
  .mx, .mx tbody { display: block; width: 100%; }
  .mx thead { display: none; }
  .mx tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center;
    padding: 10px 12px; margin-bottom: 8px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card);
  }
  .mx td, .mx td.item { border: 0; padding: 0; min-width: 0; }
  .mx td.item { grid-column: 1; grid-row: 1; }
  .mx td.dcol { grid-column: 2; grid-row: 1; }
  .cell { width: 60px; height: 56px; }
  .yn-btn { min-width: 62px; min-height: 56px; }
}
@media (min-width: 760px) {
  .mx td.dcol { width: 64px; }
  .mx-wrap[data-day='0'] .d0, .mx-wrap[data-day='1'] .d1, .mx-wrap[data-day='2'] .d2, .mx-wrap[data-day='3'] .d3,
  .mx-wrap[data-day='4'] .d4, .mx-wrap[data-day='5'] .d5, .mx-wrap[data-day='6'] .d6 { background: color-mix(in srgb, var(--brand) 9%, transparent); }
  .yn-btn { min-width: 30px; font-size: 12px; padding: 0 3px; }
  .cell { width: 40px; height: 40px; }
}
.day-sign-list { display: flex; flex-direction: column; gap: 10px; }
.day-sign { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.day-sign-h { display: flex; justify-content: space-between; align-items: baseline; }

/* ---------- photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.photo { position: relative; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.photo img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; }
.photo .input { min-height: 38px; font-size: 14px; }
.photo-x { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, 0.6); color: #fff; }

/* ---------- lists ---------- */
.job-list { display: flex; flex-direction: column; gap: 10px; }
.job-card { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.job-card:active { background: var(--brand-tint); }
.job-num { min-width: 78px; padding: 8px 10px; border-radius: 10px; background: var(--brand-tint); color: var(--brand); font-weight: 800; text-align: center; font-size: 15px; }
.job-name { font-weight: 700; font-size: 17px; }
.job-sub { font-size: 13.5px; color: var(--muted); }
.job-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
@media (max-width: 560px) {
  .job-card { grid-template-columns: auto 1fr auto; }
  .job-meta { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .job-card > .ico { display: none; }
}
.archived { opacity: 0.7; }
.empty { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty h2 { font-size: 22px; }
.empty p { color: var(--muted); max-width: 460px; }
.empty img { border-radius: 10px; }

.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.ok { background: var(--ok-tint); color: var(--ok); }
.pill.warn { background: var(--warn-tint); color: var(--warn); }

.job-head .jh-top { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 16px 0; }
.jh-num { font-size: 13px; font-weight: 800; color: var(--brand); letter-spacing: 0.04em; }
.jh-name { font-size: 22px; font-weight: 800; line-height: 1.2; }
.job-head > .muted, .job-head > dl, .job-head > p { margin: 8px 16px 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

.date-tools { display: flex; gap: 8px; align-items: center; }
.date-pick { min-height: 38px; width: auto; padding: 4px 8px; font-size: 15px; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.quick-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; min-height: 96px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--card); text-align: left; }
.q-ico { color: var(--brand); }
.q-name { font-weight: 700; font-size: 15px; }
.q-state { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: auto; }
.quick-btn.draft { border-color: var(--warn); background: var(--warn-tint); }
.quick-btn.draft .q-state, .quick-btn.draft .q-ico { color: var(--warn); }
.quick-btn.done { border-color: var(--ok); background: var(--ok-tint); }
.quick-btn.done .q-state, .quick-btn.done .q-ico { color: var(--ok); }
.quick-btn:active { transform: scale(0.98); }

.filter { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px 4px; scrollbar-width: none; }
.filter::-webkit-scrollbar { display: none; }
.filter-btn { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--card); font-size: 13.5px; font-weight: 600; }
.filter-btn.on { background: var(--ink); border-color: var(--ink); color: var(--card); }
.month { padding: 12px 16px 4px; font-size: 12.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.rec-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--line); min-height: 64px; }
.rec-row:active { background: var(--brand-tint); }
.rec-ico { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--brand-tint); color: var(--brand); flex: none; }
.rec-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rec-main strong { font-size: 16px; }
.rec-main .muted { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-cb { display: flex; align-items: center; }
.rec-cb input { width: 24px; height: 24px; accent-color: var(--brand); }
.select-bar { position: sticky; bottom: calc(var(--tabs) + var(--sab)); display: flex; gap: 6px; align-items: center; padding: 10px 12px; background: var(--card); border-top: 1px solid var(--line-strong); flex-wrap: wrap; }
.sel-n { font-weight: 700; margin-right: auto; }

.person-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; min-height: 62px; }
.person-row:first-child { border-top: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex: none; }

/* ---------- action bar (record) ---------- */
.action-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; gap: 10px; padding: 10px 14px calc(10px + var(--sab)); background: var(--card); border-top: 1px solid var(--line); }
.action-bar .btn { min-height: 50px; }
.save-state { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.save-state.ok { color: var(--ok); }
.save-state.bad { color: var(--bad); }

/* ---------- sheets ---------- */
.sheet-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(8, 10, 14, 0.5); animation: fade 0.15s ease-out; }
.sheet-overlay.closing { opacity: 0; transition: opacity 0.12s; }
.sheet { width: 100%; max-width: 620px; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; background: var(--card); border-radius: 20px 20px 0 0; animation: up 0.2s ease-out; }
.sheet.wide { max-width: 780px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 4px 20px; }
.sheet-title { font-size: 19px; font-weight: 800; }
.sheet-body { padding: 8px 20px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; padding: 12px 20px calc(14px + var(--sab)); border-top: 1px solid var(--line); }
.sheet-actions .btn { flex: 1 1 130px; }
@media (min-width: 700px) { .sheet-overlay { align-items: center; } .sheet { border-radius: 20px; max-height: 88vh; max-height: 88dvh; } }
.dialog-msg { font-size: 16.5px; line-height: 1.45; padding: 4px 0 8px; }
@keyframes up { from { transform: translateY(24px); opacity: 0.6; } }
@keyframes fade { from { opacity: 0; } }

.menu { display: flex; flex-direction: column; margin: 0 -8px; }
.menu-item { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 12px; border: 0; background: transparent; font-size: 17px; font-weight: 600; text-align: left; border-radius: 12px; }
.menu-item:active { background: var(--bg); }
.menu-item.danger { color: var(--bad); }
.form-picker { display: flex; flex-direction: column; gap: 8px; }
.form-pick { display: flex; align-items: center; gap: 14px; padding: 12px; min-height: 68px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); text-align: left; }
.form-pick:active { background: var(--brand-tint); }
.fp-ico { width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-tint); color: var(--brand); border-radius: 12px; flex: none; }
.fp-text { flex: 1; display: flex; flex-direction: column; }
.fp-text .muted { font-size: 13.5px; }

.pick-list { display: flex; flex-direction: column; margin-top: 8px; max-height: 50vh; max-height: 50dvh; overflow-y: auto; }
.pick-row { display: flex; align-items: center; gap: 12px; min-height: 54px; border-bottom: 1px solid var(--line); }
.pick-row input { width: 24px; height: 24px; accent-color: var(--brand); }
.pick-row.dim { opacity: 0.5; }

/* subs assigned to a job */
.job-subs { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.job-subs .js-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.job-subs .subs-list { display: flex; flex-wrap: wrap; gap: 6px; }
.job-subs .subs-list .pill { font-size: 13px; padding: 4px 11px; }

.pick-list.nomax { max-height: none; overflow: visible; }

/* crew positions */
.pos-row { display: flex; align-items: center; gap: 10px; min-height: 58px; border-bottom: 1px solid var(--line); }
.pos-row .pick-name { flex: 1; min-width: 0; font-weight: 600; }
.pos-row select { width: 180px; flex: none; min-height: 44px; }
.pos-bulk { display: flex; gap: 8px; align-items: center; }
.pos-bulk select { flex: 1; min-height: 44px; }
.pos-banner { align-items: center; flex-wrap: wrap; margin: 0 16px 12px; }
.pos-banner > div { flex: 1; min-width: 200px; }

/* crew picker filters */
.pp-controls { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pp-filter { padding: 0; align-items: center; }
.pp-sortlbl { flex: none; font-size: 13px; padding-right: 2px; }
.pp-co { min-height: 44px; }
.pp-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13px; }
.pp-group { position: sticky; top: 0; z-index: 1; padding: 10px 2px 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--card); }

/* fill timesheets from the sign-in sheets */
details.opts { border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--bg); }
details.opts summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--muted); }
details.opts[open] { padding-bottom: 12px; }
details.opts[open] summary { color: var(--ink); }
.fl-main .fn .pill.wk { margin-left: 8px; font-size: 11.5px; padding: 2px 8px; vertical-align: 1px; }
.fill-head .pill.wk { font-size: 12.5px; }
.fill-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.fill-list { display: flex; flex-direction: column; max-height: 40vh; max-height: 40dvh; overflow-y: auto; border-top: 1px solid var(--line); }
.fill-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.fl-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.fl-main .fn { font-weight: 600; }
.fl-main .fd { font-size: 12.5px; color: var(--muted); }
.fl-main .fd.warn { color: var(--warn); }
.fill-row .fh { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pick-row.fill-pick { align-items: flex-start; padding: 8px 0; }
.pick-row.fill-pick input { margin-top: 2px; flex: none; }
.pick-name { flex: 1; font-weight: 600; }

.pdf-frame { width: 100%; height: 52vh; height: 52dvh; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-top: 10px; }
.pdf-meta { display: flex; gap: 10px; align-items: center; color: var(--ok); }
.pdf-meta strong { color: var(--ink); word-break: break-all; }

/* ---------- signature pad ---------- */
.sig-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: stretch; justify-content: center; background: rgba(8, 10, 14, 0.6); }
.sig-sheet { width: 100%; max-width: 1000px; display: flex; flex-direction: column; background: var(--card); padding-top: var(--sat); padding-bottom: var(--sab); }
@media (min-width: 800px) and (min-height: 600px) { .sig-overlay { align-items: center; } .sig-sheet { height: min(640px, 86dvh); border-radius: 20px; padding: 0; } }
.sig-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; gap: 8px; border-bottom: 1px solid var(--line); }
.sig-title { font-weight: 800; font-size: 18px; text-align: center; display: flex; flex-direction: column; }
.sig-title small { font-weight: 500; color: var(--muted); font-size: 13px; }
.sig-pad { position: relative; flex: 1; margin: 12px; border: 2px solid var(--line-strong); border-radius: 14px; background: #fff; overflow: hidden; min-height: 200px; }
.sig-canvas { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.sig-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #b3b9c4; font-size: 20px; pointer-events: none; }
.sig-line { position: absolute; left: 24px; right: 24px; bottom: 26%; border-bottom: 2px solid #d5d9e0; pointer-events: none; }
.sig-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 4px 12px 12px; }
.sig-remember { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.sig-remember input { width: 22px; height: 22px; accent-color: var(--brand); }

/* ---------- misc ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--tabs) + var(--sab) + 18px); transform: translate(-50%, 20px); max-width: min(92vw, 520px); z-index: 90; padding: 12px 18px; border-radius: 12px; background: #1c2027; color: #fff; font-weight: 600; opacity: 0; pointer-events: none; transition: 0.2s; text-align: center; }
.no-tabs #toast { bottom: calc(96px + var(--sab)); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); }
.busy { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(8, 10, 14, 0.55); color: #fff; font-weight: 700; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.3); border-top-color: #fff; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.boot { display: flex; align-items: center; justify-content: center; min-height: 60vh; min-height: 60dvh; color: var(--muted); }
/* ---------- accounts, sync, team ---------- */
.auth-mode .topbar, .auth-mode .tabnav { display: none; }
.auth-mode .main { padding-bottom: 24px; }
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: calc(var(--sat) + 20px) 16px 24px; }
.auth-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 14px; padding: 26px 22px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.auth-card h2 { font-size: 24px; }
.auth-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.auth-logo img { border-radius: 8px; }
.auth-logo div { display: flex; flex-direction: column; line-height: 1.25; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.notice.ok { background: var(--ok-tint); color: var(--ok); }

.sync-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 11px; border: 0; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.sync-pill.idle { background: var(--ok-tint); color: var(--ok); }
.sync-pill.syncing .ico { animation: spin 1s linear infinite; }
.sync-pill.offline, .sync-pill.rejected { background: var(--warn-tint); color: var(--warn); }
.sync-pill.auth, .sync-pill.error { background: var(--bad-tint); color: var(--bad); }
@media (max-width: 420px) { .sync-pill span { display: none; } .sync-pill { padding: 0 9px; } .sync-pill.offline span, .sync-pill.rejected span { display: inline; } }
.sync-status { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--bg); }
.sync-status.idle { background: var(--ok-tint); color: var(--ok); }
.sync-status.offline, .sync-status.rejected { background: var(--warn-tint); color: var(--warn); }
.sync-status.auth, .sync-status.error { background: var(--bad-tint); color: var(--bad); }
.sync-status strong { color: var(--ink); }
.sync-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rej-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.legacy { border-color: var(--brand); background: var(--brand-tint); }
.person-row.static { cursor: default; }
h4.sec { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }
.btn-row.tight { gap: 6px; flex-wrap: nowrap; }
.kv.cred { font-size: 16px; }
.kv.cred dd.pw { font: 700 22px/1.3 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.06em; user-select: all; word-break: break-all; }
pre.invite-msg { margin: 0; padding: 12px; border-radius: 10px; background: var(--bg); white-space: pre-wrap; font: 14px/1.45 ui-monospace, Menlo, Consolas, monospace; user-select: all; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- dashboards (views/dashboard.js, dashui.js, jobteamui.js) ---------- */
.notice.info { background: var(--brand-tint); color: var(--ink); }
.page.dash { max-width: 1120px; }

.dx-hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px 18px 16px; border-radius: var(--r);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2, var(--brand)) 100%); color: #fff; box-shadow: var(--shadow);
}
.dx-hello { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.dx-sub { font-size: 14px; opacity: 0.92; margin-top: 2px; }
.dx-date { font-size: 13px; font-weight: 600; opacity: 0.9; white-space: nowrap; }

.dx-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .dx-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.dx-kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 1px; border-top: 4px solid var(--brand); }
.dx-kpi.ok { border-top-color: var(--ok); } .dx-kpi.warn { border-top-color: var(--warn); } .dx-kpi.bad { border-top-color: var(--bad); }
.dx-kpi strong { font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.dx-kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.dx-kpi em { font-style: normal; font-size: 12.5px; color: var(--muted); }

.dx-sec { display: flex; flex-direction: column; gap: 10px; }
.dx-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 0 2px; }
.dx-sec-h h2 { font-size: 18px; font-weight: 800; }
.dx-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 900px) { .dx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.dx-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px 14px; display: flex; flex-direction: column; gap: 12px; border-left: 5px solid var(--line-strong); min-width: 0; }
.dx-card[data-status="good"], .dx-card[data-status="done"] { border-left-color: var(--ok); }
.dx-card[data-status="watch"] { border-left-color: var(--warn); }
.dx-card[data-status="over"] { border-left-color: var(--bad); }
.dx-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dx-job { display: flex; align-items: baseline; gap: 8px; min-width: 0; color: inherit; text-decoration: none; }
.dx-num { font-weight: 800; color: var(--brand); white-space: nowrap; }
.dx-name { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-loc { margin-top: -8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-card-b { display: flex; gap: 16px; align-items: center; }
@media (max-width: 420px) { .dx-card-b { flex-direction: column; align-items: stretch; } .dx-card-ring { flex-direction: row; justify-content: flex-start; gap: 14px; } }
.dx-card-ring { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.dx-card-meters { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 0; }
.dx-hero-card { border-left-width: 6px; padding: 16px 18px; gap: 14px; }
.dx-rings { display: flex; justify-content: space-around; gap: 12px; flex-wrap: wrap; padding: 4px 0; }
.dx-ringbox { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; max-width: 180px; }
.dx-rl { font-weight: 700; font-size: 14px; }
.dx-mine { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dx-mine > div { background: var(--bg); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.dx-mine strong { font-size: 24px; font-weight: 800; }
.dx-mine span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.dx-h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 2px 0 -6px; }

/* rings */
.dx-ring { position: relative; flex: none; }
.dx-ring svg { display: block; }
.dx-ring-bg { stroke: var(--line); }
.dx-ring-fg { stroke: var(--brand); transition: stroke-dasharray 0.5s ease; }
.dx-ring.tone-ok .dx-ring-fg { stroke: var(--ok); } .dx-ring.tone-warn .dx-ring-fg { stroke: var(--warn); } .dx-ring.tone-bad .dx-ring-fg { stroke: var(--bad); }
.dx-ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.dx-ring-c strong { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.dx-ring-c span { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* hours vs budget bar */
.dx-meter { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dx-meter-h { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.dx-meter-hint, .dx-meter-none { font-size: 13px; color: var(--muted); font-weight: 500; }
.dx-track { position: relative; height: 14px; border-radius: 999px; background: var(--line); overflow: visible; }
.dx-fill { height: 100%; border-radius: 999px; background: var(--brand); min-width: 4px; transition: width 0.5s ease; }
.dx-fill.ok { background: var(--ok); } .dx-fill.warn { background: var(--warn); } .dx-fill.bad { background: var(--bad); } .dx-fill.muted { background: var(--line-strong); }
.dx-mark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; }
.dx-meter-f { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.dx-meter-over { font-size: 13px; font-weight: 700; color: var(--bad); }
.dx-meter-proj { font-size: 12.5px; color: var(--muted); }
.dx-meter-proj.bad { color: var(--warn); font-weight: 600; }

/* status pill */
.dx-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--bg); color: var(--muted); }
.dx-pill.ok { background: var(--ok-tint); color: var(--ok); } .dx-pill.warn { background: var(--warn-tint); color: var(--warn); } .dx-pill.bad { background: var(--bad-tint); color: var(--bad); }

/* money, team, actions */
.dx-money { display: flex; flex-direction: column; gap: 4px; background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.dx-money-row { display: grid; grid-template-columns: 96px auto 1fr auto; gap: 8px; align-items: baseline; font-size: 14px; }
.dx-money-row strong { font-size: 16px; }
.dx-money-row .muted { font-size: 12.5px; }
@media (max-width: 480px) { .dx-money-row { grid-template-columns: 92px auto 1fr; } .dx-money-row > :last-child { grid-column: 2 / -1; } }
.dx-team { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.dx-who em { font-style: normal; font-weight: 700; color: var(--muted); margin-right: 5px; text-transform: uppercase; font-size: 11px; letter-spacing: 0.04em; }
.dx-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dx-attn-list { display: flex; flex-wrap: wrap; gap: 6px; }
.dx-chip { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: var(--warn-tint); color: var(--warn); font-weight: 600; }
.dx-chip.bad { background: var(--bad-tint); color: var(--bad); }

/* needs attention */
.dx-attn { display: flex; flex-direction: column; gap: 8px; }
.dx-attn-row { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.dx-attn-j { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* compact rows */
.dx-minis { display: flex; flex-direction: column; gap: 8px; }
.dx-mini { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; color: inherit; text-decoration: none; text-align: left; font: inherit; width: 100%; }
.dx-mini-btn { cursor: pointer; }
.dx-mini-m { display: flex; flex-direction: column; align-items: flex-end; font-weight: 800; line-height: 1.1; }
.dx-mini-m em { font-style: normal; font-weight: 600; font-size: 11px; color: var(--muted); }
@media (max-width: 560px) { .dx-mini { grid-template-columns: auto minmax(0, 1fr) auto; } .dx-mini-m { display: none; } }

/* charts */
.dx-chart { max-width: 480px; margin: 0 auto; width: 100%; }
.dx-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.dx-gl { stroke: var(--line); stroke-width: 1; } .dx-gl-100 { stroke: var(--line-strong); stroke-dasharray: 4 3; }
.dx-axis { fill: var(--muted); font-size: 10px; }
.dx-line { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.dx-line-used { stroke: var(--brand); } .dx-line-done { stroke: var(--ok); }
.dx-dot-used { fill: var(--brand); } .dx-dot-done { fill: var(--ok); }
.dx-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; margin-top: 4px; }
.dx-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dx-sw.used { background: var(--brand); } .dx-sw.done { background: var(--ok); }
.dx-weeks { min-height: 40px; }
.dx-bars { display: flex; align-items: flex-end; justify-content: center; gap: 8px; height: 110px; }
.dx-bar { flex: 1; min-width: 0; max-width: 64px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 3px; }
.dx-bar-f { background: var(--brand); border-radius: 5px 5px 2px 2px; opacity: 0.9; min-height: 2px; }
.dx-bar-v { font-size: 10.5px; font-weight: 700; text-align: center; height: 13px; overflow: hidden; }
.dx-bar-l { font-size: 10px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; }

/* empty state, suggestion banner */
.dx-empty { align-items: center; text-align: center; padding: 28px 16px; color: var(--muted); }
.dx-suggest-banner { align-items: center; }
.dx-suggest-banner > div { flex: 1; }
.dx-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* job page card */
.dx-jobcard .card-b { gap: 12px; }

/* sheets: team, budget, progress */
.team-list { display: flex; flex-direction: column; }
.team-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 210px); gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.team-row.hidden { display: none; }
.team-who { display: flex; flex-direction: column; min-width: 0; }
.team-who strong { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .team-row { grid-template-columns: 1fr; gap: 6px; } }
.dx-bsec { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.dx-bsec h4 { font-size: 15px; }
.dx-hoursout { font-size: 14px; min-height: 20px; }
/* CORs (change orders) in the budget sheet */
.dx-bh { font-size: 16px; margin: 6px 0 -2px; }
.dx-cors { display: flex; flex-direction: column; gap: 12px; }
.dx-cor { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-left: 6px solid var(--brand); border-radius: 12px; background: var(--card, transparent); }
.dx-cor-h { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.dx-cor-no { font-size: 16px; white-space: nowrap; }
.dx-cor .dx-bsec { background: var(--bg); border-color: transparent; }
.dx-cor-total { display: flex; flex-direction: column; gap: 4px; background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.dx-cor-total h4 { font-size: 15px; }
.dx-cor-total .dx-money-row { grid-template-columns: 96px auto 1fr; }
.dx-money-cor { margin-top: 2px; }
.dx-pctbig { font-size: 52px; font-weight: 800; text-align: center; letter-spacing: -0.02em; color: var(--brand); line-height: 1.1; }
input[type=range] { width: 100%; accent-color: var(--brand); height: 32px; }
.pct-in { max-width: 140px; }
.dx-history { display: flex; flex-direction: column; }
.dx-hrow { display: grid; grid-template-columns: 110px 56px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }

/* ---------- production tracking (views/production.js, productionui.js, dashui.js productionBars) ---------- */
.dx-prod { display: flex; flex-direction: column; gap: 10px; }
.dx-prod-g { display: flex; flex-direction: column; gap: 4px; }
.dx-prod-gh { display: flex; justify-content: space-between; font-size: 14px; }
.page.prod { max-width: 900px; }
.prod-hero { padding: 16px; display: flex; flex-direction: column; gap: 14px; border-left: 6px solid var(--brand); }
.prod-hero-b { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.prod-hero-t { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
.prod-hero-t h2 { font-size: 20px; }
.prod-gsum { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.prod-gsum strong { font-size: 20px; }
.prod-item { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.prod-item:first-child { border-top: 0; }
.prod-item:active { background: var(--bg); }
.prod-item-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.prod-item-h strong { font-size: 15px; min-width: 0; }
.prod-item-p { font-weight: 800; font-size: 16px; white-space: nowrap; }
.prod-item-p.done { color: var(--ok); }
.prod-item-m { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.prod-foot { padding: 0 4px; }

/* the "update production" sheet */
.prod-preview { position: sticky; top: -8px; z-index: 2; background: var(--brand-tint); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-size: 16px; }
.prod-new { color: var(--ok); font-size: 18px; }
.prod-gh { margin-top: 6px; }
.prod-up-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prod-up-row.focus { background: var(--brand-tint); border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.prod-up-name { display: flex; flex-direction: column; min-width: 0; }
.prod-up-in { display: flex; align-items: center; gap: 8px; }
.qty-in { width: 120px; text-align: right; }
.qty-in.bad { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad-tint); }
.prod-live { min-width: 52px; text-align: right; font-weight: 700; font-size: 14px; color: var(--muted); }
.prod-live.changed { color: var(--ok); }
@media (max-width: 560px) { .prod-up-row { grid-template-columns: 1fr; } .prod-up-in { justify-content: flex-end; } }
.prod-hrow { display: grid; grid-template-columns: 110px 130px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.prod-hrow strong.neg { color: var(--bad); }

/* the scope editor */
.scope-list { display: flex; flex-direction: column; gap: 10px; }
.scope-row { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.scope-r1 { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.scope-r2 { display: grid; grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr); gap: 8px; }
@media (max-width: 560px) { .scope-r1 { grid-template-columns: 1fr auto; } .scope-r1 > :first-child { grid-column: 1 / -1; } }
.scope-totals { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.scope-tot-h { margin-right: 8px; }
.scope-totals p { flex-basis: 100%; }
.scope-warn, .prod-warn { margin: 2px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--warn-tint); color: var(--warn); font-size: 14px; }
