:root { --navy:#1F3864; --line:#e3e6ec; --muted:#6b7280; --red:#fde2e2; --redt:#9b1c1c; --amber:#fff4d6; --bg:#f6f7fb; }
* { box-sizing:border-box; }
body { margin:0; font:14px/1.4 "Segoe UI", Arial, sans-serif; color:#1f2937; background:var(--bg); }
header { background:var(--navy); color:#fff; padding:8px 18px; display:flex; align-items:center; gap:18px; position:sticky; top:0; z-index:5; flex-wrap:wrap; }
header h1 { font-size:17px; margin:0; font-weight:600; white-space:nowrap; }
nav { display:flex; flex-wrap:wrap; gap:2px; }
nav button { background:none; border:0; color:#cbd5e1; font:inherit; padding:8px 12px; cursor:pointer; border-radius:6px; }
nav button.on { background:rgba(255,255,255,.15); color:#fff; }
header .user { margin-left:auto; font-size:12px; color:#cbd5e1; display:flex; gap:12px; align-items:center; }
header .user a { color:#fff; text-decoration:none; cursor:pointer; }
main { padding:16px 18px 60px; }
section { display:none; } section.on { display:block; }
.card { background:#fff; border:1px solid var(--line); border-radius:10px; padding:14px 16px; margin-bottom:14px; }
.card h2 { font-size:15px; margin:0 0 10px; color:var(--navy); }
.row { display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; }
label { display:flex; flex-direction:column; font-size:12px; color:var(--muted); gap:3px; }
label.inline { flex-direction:row; align-items:center; gap:6px; }
input, select, textarea { font:inherit; padding:6px 8px; border:1px solid #cfd5df; border-radius:6px; background:#fff; color:#111; }
input:disabled, textarea:disabled, select:disabled { background:#f3f4f6; color:#555; }
textarea { resize:vertical; min-height:60px; width:100%; }
.btn { background:var(--navy); color:#fff; border:0; padding:8px 14px; border-radius:6px; font:inherit; cursor:pointer; text-decoration:none; display:inline-block; }
.btn.light { background:#e8ecf4; color:var(--navy); }
.btn.small { padding:4px 9px; font-size:12px; white-space:nowrap; }
.btn:disabled { opacity:.5; cursor:default; }
table { width:100%; border-collapse:collapse; background:#fff; }
th, td { text-align:left; padding:6px 8px; border-bottom:1px solid var(--line); vertical-align:top; font-size:13px; }
th { background:#f1f3f8; font-weight:600; font-size:12px; color:#374151; }
.tablewrap { overflow:auto; max-height:calc(100vh - 230px); } .tablewrap th { position:sticky; top:0; z-index:1; }
tbody tr.click { cursor:pointer; } tbody tr.click:hover { background:#f5f8ff; }
tr.over { background:var(--red); } tr.over td.days { color:var(--redt); font-weight:700; }
tr.warn { background:var(--amber); }
.chips button { border:1px solid #cfd5df; background:#fff; padding:5px 11px; border-radius:16px; cursor:pointer; font:inherit; font-size:12px; }
.chips button.on { background:var(--navy); color:#fff; border-color:var(--navy); }
.pill { display:inline-block; padding:1px 8px; border-radius:10px; font-size:11px; background:#e8ecf4; color:var(--navy); white-space:nowrap; }
.pill.w { background:#fde68a; color:#78350f; } .pill.r { background:#bfdbfe; color:#1e3a8a; } .pill.m { background:#fecaca; color:#7f1d1d; } .pill.d { background:#dcfce7; color:#14532d; }
.muted { color:var(--muted); font-size:12px; }
.no { font-weight:700; color:var(--navy); white-space:nowrap; }
.msg { padding:10px 14px; border-radius:8px; margin-bottom:12px; display:none; }
.msg.ok { background:#dcfce7; color:#14532d; display:block; } .msg.err { background:#fee2e2; color:#7f1d1d; display:block; }
.lines td { cursor:default; } .lines input, .lines select { width:100%; }
#drawer { position:fixed; top:0; right:0; width:min(560px,100%); height:100%; background:#fff; box-shadow:-6px 0 24px rgba(0,0,0,.15);
          transform:translateX(105%); transition:transform .2s; z-index:20; overflow:auto; padding:18px 20px 40px; }
#drawer.on { transform:none; }
#drawer h3 { margin:0 0 4px; color:var(--navy); }
.grid { display:grid; grid-template-columns:120px 1fr; gap:4px 10px; font-size:13px; margin:10px 0 14px; }
.grid b { color:var(--muted); font-weight:500; }
#drawer label { margin-bottom:10px; } #drawer label input, #drawer label select { width:100%; }
#shade { position:fixed; inset:0; background:rgba(0,0,0,.2); display:none; z-index:15; } #shade.on { display:block; }
.loading { padding:30px; text-align:center; color:var(--muted); }
.count { font-weight:600; color:var(--navy); }
.split { display:grid; grid-template-columns:1fr; gap:14px; } @media (min-width:1150px){ .split { grid-template-columns:440px 1fr; } }
.units { margin:6px 0 14px; } .units button { margin:0 4px 4px 0; }
.units button.on { background:var(--navy); color:#fff; }
body[data-role="viewer"] .edit-only { display:none !important; }
body:not([data-role="admin"]) .admin-only { display:none !important; }
body.login { display:flex; align-items:center; justify-content:center; min-height:100vh; }
.loginbox { background:#fff; border:1px solid var(--line); border-radius:12px; padding:28px; width:min(360px, 92vw); }
.loginbox h1 { margin:0; color:var(--navy); font-size:22px; } .loginbox label { margin:12px 0; } .loginbox input { width:100%; }
