
:root { --bg:#f5f6f8; --fg:#1c2330; --muted:#5f6b7a; --line:#e2e5ea; --accent:#0b62c4; --danger:#b42318; --card:#fff; --changed:#fff3c4; }
* { box-sizing: border-box; }
body { margin:0; font:15px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; color:var(--fg); background:var(--bg); }
header.top { background:#14213d; color:#fff; padding:.5rem 1rem; display:flex; flex-wrap:wrap; gap:.2rem 1rem; align-items:center; }
header.top a { color:#fff; text-decoration:none; opacity:.8; padding:.2rem 0; border-bottom:2px solid transparent; }
header.top a.on, header.top a:hover { opacity:1; border-bottom-color:#ffd166; }
header.top .brand { font-weight:700; opacity:1; margin-right:.5rem; }
header.top .user { margin-left:auto; font-size:.8rem; opacity:.7; }
main { max-width:1100px; margin:0 auto; padding:1rem; }
h1 { font-size:1.3rem; margin:.25rem 0 .75rem; } h2 { font-size:1rem; margin:0 0 .5rem; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:1rem; margin-bottom:1rem; }
.flash { background:#e7f6ec; border:1px solid #b7e1c3; color:#14532d; padding:.6rem .9rem; border-radius:8px; margin-bottom:1rem; }
.error { background:#fdecec; border:1px solid #f5c2c2; color:#7f1d1d; padding:.6rem .9rem; border-radius:8px; margin-bottom:1rem; }
table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:.45rem .5rem; border-bottom:1px solid var(--line); vertical-align:middle; }
th { font-size:.75rem; text-transform:uppercase; letter-spacing:.03em; color:var(--muted); font-weight:600; }
tbody tr:last-child td { border-bottom:0; }
td { overflow-wrap:anywhere; }
table.lines { table-layout:fixed; }
table.lines th:nth-child(2) { width:5.5rem; } table.lines th:nth-child(3) { width:8rem; } table.lines th:nth-child(4) { width:7rem; }
.num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.meta { display:block; font-size:.8rem; color:var(--muted); }
.muted { color:var(--muted); }
a { color:var(--accent); }
button, .btn { display:inline-block; font:inherit; border:1px solid var(--accent); background:var(--accent); color:#fff; padding:.45rem .9rem; border-radius:8px; cursor:pointer; text-decoration:none; line-height:1.3; }
button.secondary, .btn.secondary { background:#fff; color:var(--accent); }
button.danger { background:#fff; color:var(--danger); border-color:var(--danger); }
button.link { background:none; border:0; color:var(--accent); padding:0; text-decoration:underline; }
input, select, textarea { font:inherit; padding:.4rem .5rem; border:1px solid #c5cbd3; border-radius:6px; background:#fff; width:100%; color:var(--fg); }
label { display:block; font-size:.85rem; color:var(--muted); }
label > input, label > select, label > textarea { margin-top:.2rem; }
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:.75rem; }
.grid .wide { grid-column:1 / -1; }
.row { display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; }
.actions { display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; margin-top:1rem; }
.actions form { margin:0; }
.toolbar { position:sticky; top:0; z-index:5; background:var(--bg); padding:.5rem 0; display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; border-bottom:1px solid var(--line); margin-bottom:.75rem; }
.toolbar .total { font-size:1.15rem; margin-right:auto; }
section.cat { background:#fff; border:1px solid var(--line); border-radius:10px; margin-bottom:1rem; overflow:hidden; }
section.cat > header { display:flex; justify-content:space-between; align-items:baseline; padding:.55rem .75rem; background:#eef2f7; }
section.cat > header h2 { margin:0; }
input.qty { width:6.5rem; text-align:right; font-size:1rem; padding:.45rem; }
input.qty.changed { background:var(--changed); border-color:#d9b440; }
input.qty.bad { border-color:var(--danger); background:#fdecec; }
.u { display:block; font-size:.7rem; color:var(--muted); text-align:right; }
.tag { display:inline-block; font-size:.72rem; padding:.1rem .45rem; border-radius:999px; background:#e8edf4; color:#334155; vertical-align:middle; font-weight:500; }
.tag.warn { background:#fff3c4; color:#6b5000; } .tag.off { background:#eee; color:#666; }
fieldset { border:1px solid var(--line); border-radius:8px; padding:.75rem; margin:0 0 1rem; }
legend { padding:0 .3rem; font-weight:600; }
.hint { font-size:.85rem; color:var(--muted); margin:.4rem 0 0; }
details.card > summary { cursor:pointer; list-style:none; display:flex; gap:.75rem; flex-wrap:wrap; align-items:baseline; }
details.card > summary::before { content:"▸"; color:var(--muted); }
details.card[open] > summary::before { content:"▾"; }
details.card[open] > summary { margin-bottom:.75rem; }
.big { font-size:1.6rem; font-weight:600; }
main.narrow { max-width:26rem; padding-top:2rem; }
.narrow-box { max-width:34rem; margin:0 auto; }
.stack > * + * { margin-top:.75rem; }
header.top form.inline { display:inline; margin:0 0 0 .75rem; }
header.top button.link { color:#fff; text-decoration:none; opacity:.8; font-size:inherit; }
header.top button.link:hover { opacity:1; }
button:disabled { opacity:.55; cursor:default; }
[hidden] { display:none !important; }
@media (max-width:640px) {
  main { padding:.6rem; }
  .hide-s { display:none; }
  input.qty { width:100%; }
  table.lines th:nth-child(2) { width:3.9rem; } table.lines th:nth-child(3) { width:5.4rem; } table.lines th:nth-child(4) { width:4.9rem; }
  table.lines td.num { font-size:.85rem; }
  table.lines td.item { font-size:.92rem; }
  th, td { padding:.4rem .3rem; }
}
