:root {
  --bg: #0E0F11; --panel: #121316; --raised: #17191C; --cell: #15171A; --hover: #1F2229;
  --line: #23252A; --line-soft: #1C1E22; --field: #2A2D33;
  --ink: #E6E7EA; --strong: #F6F7F9; --soft: #C8CCD3; --muted: #9097A1; --dim: #5A5F69;
  --blue: #8FA6FF; --blue-hover: #B7C6FF; --blue-bg: #1A1F33;
  --amber: #F0A54A; --amber-ink: #F5BF76; --amber-bg: #3A2A12;
  --green-ink: #6FD6A4; --green-bg: #143326;
  --ooo: #FF9E85; --pto: #B9A8FF; --red-bg: #3D1C18;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 Inter, system-ui, sans-serif; }
a { color: var(--blue); } a:hover { color: var(--blue-hover); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.logo { width: 24px; height: 24px; border-radius: 6px; background: var(--amber); color: var(--panel); display: grid; place-items: center; font: 13px var(--mono); }

/* shell */
.app { min-height: 100vh; display: flex; flex-wrap: wrap; }
.sidebar { flex: 1 1 220px; max-width: 100%; padding: 16px 12px; display: flex; flex-direction: column; gap: 20px; border-right: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 600; color: var(--ink); text-decoration: none; }
.navlist { display: flex; flex-direction: column; gap: 2px; }
.navlist .heading { padding: 0 10px 6px; font-size: 12px; color: var(--muted); }
.navlink { min-height: 32px; padding: 0 10px; border-radius: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--soft); text-decoration: none; }
.navlink:hover { background: var(--hover); color: var(--strong); }
.navlink[aria-current="page"] { background: var(--hover); color: var(--strong); }
.navlink .bal { font: 12px var(--mono); }
.pos { color: var(--green-ink); } .neg { color: var(--amber-ink); }
.sidebar .foot { margin-top: auto; padding: 0 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--blue); font-size: 12px; text-align: left; }

.content { flex: 999 1 860px; min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 52px; padding: 8px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.topbar .left { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.topbar h1 { font-size: 15px; }
.tabs { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line); }
.tabs a { min-height: 28px; padding: 0 12px; border-radius: 6px; display: flex; align-items: center; font-size: 13px; color: var(--muted); text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--field); color: var(--strong); }
.actions { display: flex; gap: 8px; }
.btn { min-height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--field); background: var(--raised); color: var(--ink); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 13px; }
.btn:hover { color: var(--strong); border-color: var(--dim); }
.btn.primary { border: 0; background: var(--ink); color: var(--panel); font-weight: 600; }
.btn.primary:hover { background: var(--strong); color: var(--panel); }

.body { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: stretch; }
.main { flex: 999 1 520px; min-width: 0; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.inspector { flex: 1 1 320px; min-width: 0; padding: 20px; display: flex; flex-direction: column; gap: 18px; border-left: 1px solid var(--line); background: var(--panel); }
.alert { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--red-bg); color: var(--ooo); }

/* hours */
.balance { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 32px; }
.big { display: flex; flex-direction: column; gap: 2px; }
.big .label { font-size: 12px; color: var(--muted); }
.big .value { font: 40px/1.1 var(--mono); color: var(--strong); }
.progress { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.progress .row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.progress .track { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress .fill { height: 100%; background: var(--blue); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 4px 10px; border-radius: 999px; font-size: 13px; background: var(--hover); color: var(--soft); }
.pill.good { background: var(--green-bg); color: var(--green-ink); }
.pill.warn { background: var(--amber-bg); color: var(--amber-ink); }

.sheet { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.sheet table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
.sheet th { padding: 10px 6px; font-weight: 500; color: var(--muted); text-align: left; border-bottom: 1px solid var(--line); }
.sheet th:first-child { padding-left: 12px; }
.sheet th.num, .sheet td.num { text-align: right; padding-right: 12px; font-family: var(--mono); white-space: nowrap; }
.sheet tbody th { border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.sheet td { padding: 6px; border-bottom: 1px solid var(--line-soft); }
.cell { min-width: 96px; min-height: 64px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--cell); display: flex; flex-direction: column; justify-content: space-between; gap: 4px; color: var(--ink); text-decoration: none; }
.cell:hover { border-color: var(--dim); color: var(--ink); }
.cell[aria-current="date"] { border-color: var(--blue); background: var(--blue-bg); }
.cell .top { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.cell .val { font: 15px var(--mono); }
.cell .bar { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.cell .bar span { display: block; height: 100%; background: var(--blue); }
.cell.short .val, .cell.short .tag { color: var(--amber-ink); } .cell.short .bar span { background: var(--amber); }
.cell.today .tag { color: var(--blue); }
.cell.plan .val { color: var(--muted); } .cell.plan .bar span { background: var(--dim); }
.cell.dim .val { color: var(--dim); }
.cell.ooo .val, .cell.ooo .tag { color: var(--ooo); }
.cell.pto .val, .cell.pto .tag { color: var(--pto); }
.cell.missing { border-style: dashed; border-color: var(--ooo); } .cell.missing .val, .cell.missing .tag { color: var(--ooo); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 3px; display: inline-block; }

/* deliveries */
.list { display: flex; flex-direction: column; }
.list .head { display: flex; justify-content: space-between; padding: 0 4px 8px; font-size: 12px; color: var(--muted); }
.issue { min-height: 40px; padding: 6px 10px; border-radius: 6px; border-bottom: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--ink); text-decoration: none; }
.issue:hover { background: var(--raised); color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.merged { background: var(--green-ink); } .dot.review { background: var(--blue); }
.issue .key { font: 12px var(--mono); color: var(--muted); min-width: 104px; }
.issue .sum { flex: 1 1 260px; min-width: 0; }
.issue .imp { font-size: 12px; color: var(--muted); }
.issue .imp.ok { color: var(--green-ink); } .issue .imp.no { color: var(--amber-ink); }
.issue .day { font-size: 12px; color: var(--muted); min-width: 44px; text-align: right; }

/* summary */
.summary { max-width: 720px; font-size: 15px; line-height: 1.6; color: #D3D6DB; }
.summary h1 { display: none; } .summary h2 { font-size: 17px; margin: 18px 0 8px; color: var(--strong); }
.summary h3 { font-size: 15px; margin: 14px 0 6px; } .summary table { border-collapse: collapse; }
.summary td, .summary th { border: 1px solid var(--line); padding: 4px 8px; }
.notice { margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--amber-bg); color: var(--amber-ink); }

/* inspector */
.ins-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ins-head .wd { font-size: 12px; color: var(--muted); }
.ins-head h2 { font-size: 18px; }
.ins-head .v { font: 22px var(--mono); color: var(--strong); }
.ins-head .v.short { color: var(--amber-ink); } .ins-head .v.ooo { color: var(--ooo); } .ins-head .v.pto { color: var(--pto); }
.seg { display: flex; padding: 2px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line); }
.seg button { flex: 1 1 0; min-height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--soft); font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); font-weight: 600; }
.seg button.ooo[aria-pressed="true"] { background: var(--ooo); } .seg button.pto[aria-pressed="true"] { background: var(--pto); }
.seg button:disabled { cursor: not-allowed; color: var(--dim); }
.sec { display: flex; flex-direction: column; gap: 8px; }
.sec h3 { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0.04em; }
.tl { display: flex; align-items: center; gap: 12px; }
.tl .t { font: 12px var(--mono); color: var(--muted); min-width: 40px; }
.tl .d { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.tl .d.in { background: var(--green-ink); } .tl .d.out { background: var(--amber); }
.iss { display: flex; gap: 10px; align-items: baseline; }
.iss a { font: 12px var(--mono); min-width: 96px; }
.note { padding: 10px 12px; border-radius: 8px; background: #1B1D21; display: flex; flex-direction: column; gap: 4px; }
.note header { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--amber-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; }
.chips legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips label { min-height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--field); display: inline-flex; align-items: center; font-size: 12px; color: var(--soft); cursor: pointer; }
.chips input:checked + label { border-color: var(--amber); background: var(--amber-bg); color: var(--amber-ink); }
.chips input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); }
select, textarea, input[type=email], input[type=password] { width: 100%; padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; background: var(--raised); color: var(--ink); font: inherit; }
select { min-height: 40px; } textarea { min-height: 84px; resize: vertical; line-height: 1.5; }

/* login */
.login { min-height: 100vh; padding: 48px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; }
.login .intro { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.login .logo { width: 40px; height: 40px; border-radius: 10px; font-size: 18px; }
.login h1 { font-size: 22px; }
.login form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 14px; }
.login input[type=email], .login input[type=password] { min-height: 44px; font-size: 15px; }
.login .btn.primary { min-height: 44px; justify-content: center; font-size: 15px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--soft); }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }

@media (max-width: 760px) {
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .inspector { border-left: 0; border-top: 1px solid var(--line); }
  .big .value { font-size: 32px; }
}
