:root { --navy:#0b2540; --teal:#0e8f9a; --line:#d9e0e8; --bg:#f4f6f9; --text:#1c2733; --muted:#6b7a8a; --bad:#b42318; --ok:#067647; }
* { box-sizing: border-box; }
body { margin:0; font:14px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif; color:var(--text); background:var(--bg); }
header.top { background:var(--navy); color:#fff; display:flex; align-items:center; gap:24px; padding:0 20px; height:52px; }
header.top h1 { font-size:16px; margin:0; font-weight:600; white-space:nowrap; }
nav { display:flex; gap:4px; flex:1; }
nav button { background:none; border:0; color:#b9c7d6; padding:15px 12px; cursor:pointer; font:inherit; border-bottom:3px solid transparent; }
nav button.active { color:#fff; border-bottom-color:var(--teal); }
.who { font-size:12px; color:#b9c7d6; display:flex; gap:12px; align-items:center; }
main { padding:20px; }
h2 { margin:0 0 12px; font-size:18px; }
h3 { margin:20px 0 8px; font-size:15px; }
.bar { display:flex; gap:10px; align-items:center; margin-bottom:12px; flex-wrap:wrap; }
.spacer { flex:1; }
button.btn { background:var(--teal); color:#fff; border:0; border-radius:6px; padding:8px 14px; cursor:pointer; font:inherit; }
button.btn.secondary { background:#fff; color:var(--text); border:1px solid var(--line); }
button.btn.link { background:none; color:var(--teal); padding:2px 6px; }
button.btn:disabled { opacity:.5; cursor:default; }
input, select, textarea { font:inherit; padding:7px 9px; border:1px solid var(--line); border-radius:6px; background:#fff; }
input:disabled { background:#eef1f5; color:var(--muted); }
.scroll { overflow:auto; background:#fff; border:1px solid var(--line); border-radius:8px; max-height:calc(100vh - 190px); }
table { border-collapse:separate; border-spacing:0; width:100%; }
th, td { padding:7px 10px; border-bottom:1px solid var(--line); white-space:nowrap; text-align:left; }
th { background:#eef2f7; position:sticky; top:0; z-index:2; font-weight:600; font-size:12px; }
td.n, th.n { text-align:right; font-variant-numeric:tabular-nums; }
tr.inactive td { color:var(--muted); }
tfoot td { background:#eef2f7; font-weight:600; position:sticky; bottom:0; }
.s0, .s1 { position:sticky; background:#fff; z-index:1; }
.s0 { left:0; min-width:300px; width:300px; max-width:300px; overflow:hidden; white-space:nowrap; } .s1 { left:300px; min-width:150px; border-right:2px solid var(--line); }
th.s0, th.s1 { background:#eef2f7; z-index:3; }
tr.prow th { top:0; height:36px; background:#d5e2f0; font-size:13px; }
tr.mrow th { top:36px; height:36px; background:#e3ecf5; font-size:13px; }
tr.frow th { top:72px; height:36px; background:#f6f8fb; font-weight:400; font-size:11px; color:var(--muted); }
tr.hrow th { top:108px; height:36px; }
table.nom tr.frow th { top:36px; }
table.nom tr.hrow th { top:72px; }
.notebtn { border:0; background:none; cursor:pointer; padding:0 2px; font-size:12px; opacity:.35; }
.notebtn.has { opacity:1; }
.hcell { display:flex; align-items:center; gap:2px; justify-content:flex-end; }
td.notecell { max-width:220px; overflow:hidden; text-overflow:ellipsis; font-size:12px; color:var(--muted); }
tr.inactive .s0, tr.inactive .s1 { background:#fff; }
.s0 .btn.link { margin:0; padding:0 2px; font-size:12px; min-width:0; }
.seg { display:inline-flex; border:1px solid var(--line); border-radius:6px; overflow:hidden; background:#fff; }
.seg button { border:0; background:none; padding:7px 14px; cursor:pointer; font:inherit; color:var(--muted); }
.seg button.active { background:var(--navy); color:#fff; }
.summary { font-size:14px; color:var(--muted); } .summary b { color:var(--text); font-size:16px; margin-left:4px; }
td.wrap { white-space:normal; max-width:420px; font-size:12px; }
.hrs { width:70px; text-align:right; padding:4px 6px; }
.hrs.saving { background:#fff8e1; } .hrs.saved { background:#e7f6ec; } .hrs.err { background:#fde8e8; }
.pos { color:var(--ok); } .neg { color:var(--bad); }
.pill { padding:2px 8px; border-radius:10px; font-size:12px; background:#e7f6ec; color:var(--ok); }
.pill.off { background:#eef1f5; color:var(--muted); }
.card { background:#fff; border:1px solid var(--line); border-radius:8px; padding:16px; margin-bottom:16px; }
.row { display:flex; gap:10px; align-items:end; flex-wrap:wrap; }
.field { display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--muted); }
.field input, .field select { color:var(--text); font-size:14px; }
.overlay { position:fixed; inset:0; background:rgba(11,37,64,.55); display:flex; align-items:center; justify-content:center; z-index:50; padding:20px; }
.modal { background:#fff; border-radius:10px; width:720px; max-width:100%; max-height:92vh; overflow:auto; padding:20px; }
.grid2 { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.grid2 .wide { grid-column:span 3; }
.calc { background:#eef2f7; border-radius:8px; padding:10px 12px; display:flex; gap:24px; margin-top:12px; flex-wrap:wrap; }
.calc b { display:block; font-size:16px; color:var(--text); } .calc span { font-size:12px; color:var(--muted); }
.err-text { color:var(--bad); margin:8px 0; min-height:1em; }
.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:var(--navy); color:#fff; padding:10px 16px; border-radius:8px; z-index:99; }
.toast.bad { background:var(--bad); }
.center { max-width:420px; margin:12vh auto; text-align:center; background:#fff; padding:32px; border-radius:12px; border:1px solid var(--line); }
.muted { color:var(--muted); }
.diff { white-space:normal; max-width:520px; font-size:12px; }
thead th.pa { background:#e1ecf7; } thead th.pb { background:#f6e8d3; }
tr.prow th.pa { background:#cfe0f2; } tr.prow th.pb { background:#f0d9b8; }
td.pa { background:#f4f8fc; } td.pb { background:#fdf7ee; }
.pfirst { border-left:2px solid #8aa4c0; }
td.tot { font-weight:600; color:var(--muted); }
.tgl { border:0; background:none; cursor:pointer; font-size:13px; margin-right:4px; padding:0 2px; }
.psub { font-weight:400; color:var(--muted); margin-left:8px; font-size:12px; }
.ptot { margin-left:12px; font-weight:700; color:var(--navy); }
.picker { position:relative; display:inline-block; }
.pop { position:absolute; top:100%; left:0; z-index:60; margin-top:4px; background:#fff; border:1px solid var(--line); border-radius:8px; padding:6px; min-width:260px; max-height:340px; overflow:auto; box-shadow:0 6px 20px rgba(11,37,64,.18); }
.pop label { display:flex; gap:8px; align-items:center; padding:5px 8px; white-space:nowrap; cursor:pointer; }
.pop label:hover { background:#eef2f7; }
.sech { margin:26px 0 8px; font-size:17px; color:var(--navy); }
.fin .scroll { max-height:68vh; }
table.rec { border-collapse:collapse; width:100%; }
table.rec th { position:sticky; top:0; background:#eef2f7; z-index:2; text-align:left; padding:8px 10px; font-size:12px; border-bottom:1px solid var(--line); white-space:nowrap; }
table.rec td { padding:5px 10px; border-bottom:1px solid #eef1f5; white-space:nowrap; }
table.rec th.n, table.rec td.n { text-align:right; }
table.rec tr.pb td { background:#f4f8fc; }
table.rec input { padding:4px 6px; border:1px solid var(--line); border-radius:4px; font:inherit; }
table.rec input.amt { width:120px; text-align:right; }
table.rec input.inv { width:130px; }
table.rec input.note { width:240px; }
td.mt { text-align:center; font-weight:600; min-width:110px; }
tr td.mt.ok { background:#d1fae5; color:#065f46; }
tr td.mt.no { background:#fee2e2; color:#991b1b; }
tr td.mt.pend { background:#eef1f5; color:var(--muted); font-weight:500; }
select.colfilter { display:block; margin-top:3px; font-size:11px; padding:1px 2px; max-width:84px; }
label.fl { display:block; font-size:10px; font-weight:400; color:var(--muted); margin-top:2px; } label.fl input.colfilter { margin-left:3px; max-width:112px; }
button.hist { border:0; background:none; cursor:pointer; padding:0 4px 0 0; font-size:12px; opacity:.45; } button.hist.has { opacity:1; }
button.pencil { font-size:15px; text-decoration:none; }
.modal table.rec { min-width:640px; }
button.fbtn { display:block; border:0; background:none; color:var(--teal); font-size:11px; cursor:pointer; padding:2px 0 0; font-weight:500; }
td.gray { background:#e5e7eb !important; }
td.gray input.hrs { background:transparent; border-color:transparent; }
input.hrs.stray { background:#fff7e0; border-color:#e0a100; }
tr.archived td.s0, tr.archived td.s1 { color:var(--muted); }
.pill.arch { margin-left:6px; }
.warnbox { background:#fff7e0; border:1px solid #f0d58a; border-radius:6px; padding:8px 10px; margin:8px 0; font-size:13px; }

.btn.danger { background:#b42318; border-color:#b42318; color:#fff; }
.confirm-line { margin:6px 0; }
button.pencil.del { margin-left:0; }
input.hrs.tne { width:96px; }

.stbtn { width:18px; height:18px; padding:0; border-radius:50%; border:1px solid #9aa3ad; background:#fff; color:#6b7280; font-size:10px; font-weight:700; line-height:16px; cursor:pointer; }
.stbtn:disabled { cursor:default; opacity:.5; }
.stbtn.st-partial { background:#f5b301; border-color:#d99a00; color:#fff; }
.stbtn.st-received, .stbtn.st-paid { background:#1f9d55; border-color:#1f9d55; color:#fff; }
.stbtn.st-advance { background:#6d4ad8; border-color:#6d4ad8; color:#fff; }
td.st-received { background:#dff3e6 !important; }
td.st-partial { background:#fff1c9 !important; }
button.pencil.note { opacity:.4; margin-right:0; } button.pencil.note.has { opacity:1; }
.cname { margin-left:4px; } td.misc { width:24px; min-width:24px; padding:0; } .s0 .pill.arch { margin-left:6px; padding:0 6px; font-size:11px; }
input.hrs.wk { width:36px; padding:4px 2px; font-size:12px; text-align:center; }
input.hrs::-webkit-outer-spin-button, input.hrs::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; } input.hrs { -moz-appearance:textfield; appearance:textfield; }
.hcell .stk { display:flex; flex-direction:column; gap:1px; } .hcell .stk .stbtn { width:14px; height:14px; font-size:8px; line-height:12px; }
th .wkh { display:inline-block; line-height:1.15; font-size:11px; }
