/* The subcontractor's invoicing page (frontend/invoice.html; govcontract #2130 T7, #2153).
   Brand tokens come from brand.css; this file adds only the page's own layout and the three
   day-status colors, light and dark. (Lisa, 2026-12-04.) */

:root{
  --st-draft-bg:#fbedc9; --st-draft-ink:#7a4f00; --st-draft-edge:#e2b54a;
  --st-sub-bg:#dfe8f3;   --st-sub-ink:#1e3a5f;   --st-sub-edge:#6f93bd;
  --st-bill-bg:#dcefe2;  --st-bill-ink:#1d6438;  --st-bill-edge:#62ad7c;
  --danger:#b00020;
  --radius:14px;
}
@media (prefers-color-scheme: dark){
  :root{
    --st-draft-bg:#3e321a; --st-draft-ink:#f2c867; --st-draft-edge:#a9842f;
    --st-sub-bg:#22344c;   --st-sub-ink:#a9c7ec;   --st-sub-edge:#5c84b5;
    --st-bill-bg:#1d3527;  --st-bill-ink:#8fd6a7;  --st-bill-edge:#4f9a69;
    --danger:#ff7a8a;
  }
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;min-height:100%}
body{
  background:var(--bg);color:var(--ink);font-family:var(--font-body);
  line-height:1.55;-webkit-font-smoothing:antialiased;display:flex;flex-direction:column;min-height:100vh;
}
[hidden]{display:none !important}
main{flex:1;width:100%;max-width:1180px;margin:0 auto;padding:20px 20px 8px}
h1,h2,h3{font-family:var(--font-display);font-weight:600;letter-spacing:-.01em;margin:0}
h1{font-size:clamp(24px,4vw,30px);line-height:1.25;margin-bottom:8px}
h2{font-size:21px;line-height:1.3}
h3{font-size:18px;margin-bottom:12px}
a{color:var(--accent)}
.fine{font-size:12.5px;color:var(--ink-soft);margin:6px 0 0}
.lede{font-size:15px;color:var(--ink-soft);margin:0 0 22px}
.num{text-align:right;font-variant-numeric:tabular-nums}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.card{padding:22px;border-radius:var(--radius)}

/* ---------- Top bar ---------- */
.topbar{background:var(--surface);border-bottom:1px solid var(--line)}
.topbar-inner{max-width:1180px;margin:0 auto;padding:12px 20px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.topbar .mark{width:46px;height:30px}
.topbar .brand-name{font-size:19px}
.who{display:flex;align-items:center;gap:12px;min-width:0}
.who-name{font-size:14px;color:var(--ink-soft);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:40vw}

/* ---------- Buttons and fields ---------- */
button,.btn-secondary{font:inherit;cursor:pointer}
.btn-primary,.btn-secondary,.btn-quiet{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  border-radius:9px;font-weight:600;font-size:15px;padding:11px 18px;min-height:44px;
  transition:background .15s,opacity .15s,border-color .15s;
}
.btn-primary{background:var(--accent);color:#fff;border:1px solid var(--accent)}
@media (prefers-color-scheme: dark){.btn-primary{color:#10161f}}
.btn-secondary{background:var(--surface);color:var(--accent);border:1px solid var(--line)}
.btn-quiet{white-space:nowrap;background:transparent;color:var(--ink-soft);border:1px solid transparent;padding:8px 12px;min-height:38px;font-size:14px}
.btn-quiet:hover{color:var(--ink);border-color:var(--line)}
.btn-secondary:hover{border-color:var(--accent)}
.btn-primary:not(:disabled):hover{opacity:.92}
button:disabled{opacity:.45;cursor:not-allowed}
.btn-block{width:100%}
.btn-icon{
  width:40px;height:40px;border-radius:50%;border:1px solid var(--line);background:var(--surface);
  display:inline-flex;align-items:center;justify-content:center;color:var(--ink);
}
.btn-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.btn-icon:hover{border-color:var(--accent);color:var(--accent)}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

label{display:block;font-size:13.5px;font-weight:600;margin:0 0 6px}
input[type="text"],input[type="password"],select{
  width:100%;padding:11px 13px;font-size:16px;font-family:inherit;
  border:1px solid var(--line);border-radius:9px;background:var(--bg);color:var(--ink);
}
input[type="text"],input[type="password"]{margin-bottom:16px}
.form-error{color:var(--danger);font-size:14px;margin:12px 0 0}
.form-note{font-size:13.5px;color:var(--ink-soft);margin:10px 0 0;min-height:1.2em}

/* ---------- Loading and sign in ---------- */
.loading{display:flex;flex-direction:column;align-items:center;gap:10px;padding:80px 0;color:var(--ink-soft)}
.spinner{width:30px;height:30px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--accent);animation:spin 0.8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.login{display:flex;justify-content:center;padding:6vh 0 4vh}
.login-card{width:100%;max-width:420px;padding:32px}

/* ---------- Contract bar ---------- */
.contract-bar{display:grid;grid-template-columns:minmax(220px,340px) 1fr auto;gap:18px 28px;align-items:end;margin-bottom:18px}
.contract-meta{display:flex;flex-wrap:wrap;gap:6px 28px;margin:0}
.contract-meta div{min-width:0}
.contract-meta dt{font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-soft)}
.contract-meta dd{margin:2px 0 0;font-size:14.5px}
.rates summary{cursor:pointer;font-weight:600;color:var(--accent);font-size:14px;padding:10px 0;list-style:none}
.rates summary::-webkit-details-marker{display:none}
.rates summary::after{content:" ▾";font-size:12px}
.rates[open] summary::after{content:" ▴"}
.rates[open]{grid-column:1 / -1}
.rates-table{width:100%;max-width:440px;border-collapse:collapse;font-size:14px}
.rates-table th,.rates-table td{padding:6px 0;border-bottom:1px solid var(--line);text-align:left}
.rates-table .num{text-align:right}

/* ---------- Workspace ---------- */
.workspace{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:18px;align-items:start}
.day-card{position:sticky;top:16px}

/* ---------- Calendar ---------- */
.cal-head{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.cal-head h2{flex:1;text-align:center}
.cal-dow{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;margin-bottom:6px}
.cal-dow span{font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-soft);text-align:center}
.cal-days{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.day{
  position:relative;aspect-ratio:1 / .86;min-height:46px;border-radius:10px;
  border:1px solid var(--line);background:var(--bg);color:var(--ink);
  display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;
  padding:6px 7px;text-align:left;font:inherit;cursor:pointer;
  transition:transform .12s,box-shadow .12s,border-color .12s;
}
.day:hover{border-color:var(--accent);transform:translateY(-1px)}
.day .dnum{font-size:14px;font-weight:600;line-height:1}
.day .damt{font-size:11.5px;font-variant-numeric:tabular-nums;font-weight:600;align-self:flex-end;line-height:1}
.day .marks{position:absolute;top:5px;right:6px;display:flex;gap:3px;align-items:center}
.day .wx{font-size:11px;line-height:1;color:var(--accent)}
.day .lock svg,.glyph-lock svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}
.day .lock{color:var(--ink-soft);display:inline-flex}
.day.st-draft{background:var(--st-draft-bg);border-color:var(--st-draft-edge);color:var(--st-draft-ink)}
.day.st-submitted{background:var(--st-sub-bg);border-color:var(--st-sub-edge);color:var(--st-sub-ink)}
.day.st-billed{background:var(--st-bill-bg);border-color:var(--st-bill-edge);color:var(--st-bill-ink)}
.day.st-draft .wx,.day.st-submitted .wx,.day.st-billed .wx{color:inherit}
.day.is-outside{opacity:.38}
.day.is-closed:not(.st-draft){background:var(--surface);color:var(--ink-soft)}
.day.is-unbillable{background:repeating-linear-gradient(135deg,var(--bg) 0 6px,var(--line) 6px 7px);color:var(--ink-soft);cursor:default}
.day.is-unbillable:hover{transform:none;border-color:var(--line)}
.day.is-today .dnum{background:var(--rust);color:#fff;border-radius:999px;padding:3px 6px;margin:-3px 0 0 -3px}
.day.is-selected{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--accent);border-color:var(--accent)}
.cal-status{font-size:13px;color:var(--ink-soft);min-height:1.2em;margin:10px 0 0}

.key{list-style:none;margin:14px 0 0;padding:14px 0 0;border-top:1px solid var(--line);display:flex;flex-wrap:wrap;gap:8px 18px;font-size:13px;color:var(--ink-soft)}
.key li{display:flex;align-items:center;gap:7px}
.sw{width:16px;height:16px;border-radius:5px;border:1px solid var(--line);display:inline-block}
.sw-draft{background:var(--st-draft-bg);border-color:var(--st-draft-edge)}
.sw-submitted{background:var(--st-sub-bg);border-color:var(--st-sub-edge)}
.sw-billed{background:var(--st-bill-bg);border-color:var(--st-bill-edge)}
.sw-today{background:var(--rust);border-color:var(--rust);border-radius:999px}
.glyph{display:inline-flex;width:16px;justify-content:center;color:var(--accent);font-size:12px}
.glyph-lock{color:var(--ink-soft)}
.key-note{margin-top:10px}

/* ---------- Day panel ---------- */
.day-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.eyebrow{margin:0 0 2px;font-size:11.5px;font-weight:600;letter-spacing:.09em;text-transform:uppercase;color:var(--ink-soft)}
.chip{font-size:12.5px;font-weight:700;border-radius:999px;padding:4px 11px;border:1px solid var(--line);white-space:nowrap}
.chip.st-draft{background:var(--st-draft-bg);color:var(--st-draft-ink);border-color:var(--st-draft-edge)}
.chip.st-submitted{background:var(--st-sub-bg);color:var(--st-sub-ink);border-color:var(--st-sub-edge)}
.chip.st-billed{background:var(--st-bill-bg);color:var(--st-bill-ink);border-color:var(--st-bill-edge)}
.chip.st-none{background:var(--bg);color:var(--ink-soft)}
.day-window{font-size:13.5px;color:var(--ink-soft);margin:6px 0 16px;display:flex;align-items:center;gap:6px}
.day-window svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;flex:none}
.day-window.is-locked{color:var(--ink)}

.qtys{display:flex;flex-direction:column;border-top:1px solid var(--line)}
.qty{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 0;border-bottom:1px solid var(--line)}
.qty-label{display:flex;flex-direction:column;min-width:0}
.qty-name{font-weight:600;font-size:15px}
.qty-hint{font-size:12.5px;color:var(--ink-soft)}
.src{align-self:flex-start;margin-top:5px;font-size:11.5px;font-weight:600;border-radius:6px;padding:2px 7px;background:var(--accent-soft);color:var(--accent)}
.src:empty{display:none}
.src.src-sub{background:var(--bg);color:var(--ink-soft);border:1px solid var(--line)}
.stepper{display:flex;align-items:center;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:var(--bg);flex:none}
.stepper .step{width:42px;height:44px;border:none;background:transparent;color:var(--accent);font-size:20px;font-weight:600}
.stepper .step:hover:not(:disabled){background:var(--accent-soft)}
.stepper input{
  width:46px;height:44px;border:none;border-left:1px solid var(--line);border-right:1px solid var(--line);
  text-align:center;font-size:17px;font-weight:600;background:var(--surface);color:var(--ink);font-family:inherit;
  -moz-appearance:textfield;appearance:textfield;
}
.stepper input::-webkit-outer-spin-button,.stepper input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.stepper input:disabled{color:var(--ink-soft)}
.qty.is-changed .stepper{border-color:var(--accent)}

.weather{margin:14px 0 0;padding:10px 12px;border-radius:10px;background:var(--accent-soft);font-size:13px;color:var(--ink)}
.weather b{font-weight:600}
.weather ul{margin:4px 0 0;padding:0;list-style:none;display:flex;flex-wrap:wrap;gap:2px 16px}

.lines{width:100%;border-collapse:collapse;margin:16px 0 0;font-size:14px}
.lines th,.lines td{padding:7px 0;border-bottom:1px solid var(--line);text-align:left}
.lines thead th{font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-soft)}
.lines .num{text-align:right;padding-left:10px}
.lines tfoot th,.lines tfoot td{border-bottom:none;font-weight:700;font-size:15.5px;padding-top:10px}
.lines .empty td{color:var(--ink-soft);font-style:italic}

.actions{display:flex;gap:10px;margin-top:18px;flex-wrap:wrap}
.actions > *{flex:1}
.actions .btn-quiet{flex:0 0 auto}

/* ---------- Certification ---------- */
.certify{margin-top:20px;padding:18px;border-radius:12px;border:1px solid var(--accent);background:var(--bg)}
.scope{border:none;padding:0;margin:0 0 10px;display:flex;flex-direction:column;gap:6px}
.radio{display:flex;gap:9px;align-items:center;font-weight:500;font-size:14px;margin:0;cursor:pointer}
.radio input{width:18px;height:18px;margin:0;accent-color:var(--accent)}
.submit-list{list-style:none;margin:6px 0 14px;padding:0;font-size:13.5px}
.submit-list li{display:flex;justify-content:space-between;padding:5px 0;border-bottom:1px dashed var(--line)}
.submit-list li.total{border-bottom:none;font-weight:700}
.cert-box{display:flex;gap:12px;align-items:flex-start;padding:14px;border-radius:10px;background:var(--surface);border:1px solid var(--line)}
.cert-box input{width:20px;height:20px;margin:2px 0 0;flex:none;accent-color:var(--accent)}
.cert-box label{font-weight:400;font-size:14px;line-height:1.5;margin:0;cursor:pointer}

/* ---------- Uploads ---------- */
.uploads-card{margin-top:18px}
.uploads-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.upload-btn{margin:0;white-space:nowrap}
.progress{margin-top:14px}
.progress-row{display:flex;justify-content:space-between;gap:10px;font-size:13.5px;margin-bottom:6px}
.progress-row span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bar{height:8px;border-radius:999px;background:var(--line);overflow:hidden}
.bar span{display:block;height:100%;width:0;background:var(--accent);border-radius:999px;transition:width .15s}
.upload-list{list-style:none;margin:14px 0 0;padding:0}
.upload-list li{display:grid;grid-template-columns:1fr auto;gap:2px 12px;padding:10px 0;border-top:1px solid var(--line);font-size:14px}
.upload-list .uname{font-weight:600;overflow-wrap:anywhere}
.upload-list .umeta{grid-column:1;font-size:12.5px;color:var(--ink-soft)}
.upload-list .ustatus{grid-row:1 / span 2;grid-column:2;align-self:center;font-size:12px;font-weight:600;color:var(--ink-soft)}
.upload-list .ustatus.filed{color:var(--st-bill-ink)}
.upload-list .none{color:var(--ink-soft);font-style:italic;display:block}

/* ---------- Footer and toast ---------- */
.foot{max-width:1180px;width:100%;margin:0 auto;padding:18px 20px 28px;display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px 18px;font-size:12.5px;color:var(--ink-soft)}
.toast{
  position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:20;
  background:var(--ink);color:var(--bg);padding:11px 18px;border-radius:10px;font-size:14px;font-weight:600;
  box-shadow:var(--shadow);max-width:calc(100vw - 32px);
}

/* ---------- Narrow screens ---------- */
@media (max-width:900px){
  .workspace{grid-template-columns:1fr}
  .day-card{position:static}
  .contract-bar{grid-template-columns:1fr}
  .rates[open]{grid-column:auto}
}
@media (max-width:560px){
  main{padding:12px 12px 4px}
  .card{padding:16px}
  .topbar-inner{padding:10px 12px}
  .topbar .brand-name small{display:none}
  .who{gap:4px}
  .who-name{max-width:34vw;font-size:13px}
  .cal-days,.cal-dow{gap:4px}
  .day{aspect-ratio:1 / 1;min-height:40px;padding:5px;border-radius:8px}
  .day .damt{display:none}
  .day .marks{top:3px;right:3px}
  .cal-head h2{font-size:18px}
  .uploads-head{flex-direction:column}
  .upload-btn{width:100%}
  .actions{flex-direction:column}
  .actions .btn-quiet{order:2}
}
@media (prefers-reduced-motion: reduce){
  *{transition:none !important;animation:none !important}
}
