:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1b1f24; --muted: #6a7380; --line: #e2e6eb; --accent: #1f3a5f; --accent-ink: #fff;
  --ok: #e7f5ec; --warn: #fff6dd; --skip: #f1f1f1; --gw: #eaf1fb; --bad: #b42318;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #14171b; --card: #1d2126; --ink: #e8ebef; --muted: #9aa3ae; --line: #2e343b; --accent: #8fb4e3; --accent-ink: #0d1726;
    --ok: #17321f; --warn: #3a3014; --skip: #26292d; --gw: #182a40; }
}
:root[data-theme="dark"] { --bg: #14171b; --card: #1d2126; --ink: #e8ebef; --muted: #9aa3ae; --line: #2e343b; --accent: #8fb4e3; --accent-ink: #0d1726;
  --ok: #17321f; --warn: #3a3014; --skip: #26292d; --gw: #182a40; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--accent); color: var(--accent-ink); }
.brand { font-weight: 700; letter-spacing: .02em; }
.top .muted { color: inherit; opacity: .8; }
main { max-width: 900px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 6px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .bad { color: var(--bad); }
.card, .jobhead { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
button, .btn { font: inherit; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; display: inline-block; }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); }
button.small { padding: 4px 8px; font-size: 13px; }
button:disabled { opacity: .6; cursor: wait; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
textarea { width: 100%; resize: vertical; }
label.notes, label.defect { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
.sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.sum div { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.sum b { display: block; font-size: 17px; } .sum span { font-size: 12px; color: var(--muted); }
.docs { margin-top: 10px; font-size: 14px; }
a { color: var(--accent); }
.pairhead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.num { background: var(--accent); color: var(--accent-ink); border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.pname { font-weight: 700; font-size: 16px; flex: 1; min-width: 160px; }
.strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.thumb { position: relative; padding: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 6px; flex: none; width: 84px; height: 84px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.star { position: absolute; left: 3px; bottom: 3px; background: var(--accent); color: var(--accent-ink); font-size: 10px; padding: 0 4px; border-radius: 4px; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.work .work { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.work .work span { flex: 1; } .work .work b { white-space: nowrap; }
.work input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; }
details.more summary { cursor: pointer; padding: 8px 4px; color: var(--accent); }
.other { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.other [data-other=desc] { flex: 1; min-width: 0; } .other [data-other=price] { width: 90px; }
.x { padding: 4px 8px; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px; border-bottom: 1px solid var(--line); }
td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.r { text-align: right; white-space: nowrap; } td.c { text-align: center; }
tr.st-Approved td { background: var(--ok); } tr.st-Skipped td { background: var(--skip); } tr.st-Goodwill td { background: var(--gw); }
.tag { font-size: 11px; background: var(--warn); padding: 0 5px; border-radius: 4px; }
.addpair { display: flex; gap: 8px; } .addpair input { flex: 1; min-width: 0; }
table.log td { font-size: 12px; }
dialog { border: none; border-radius: 10px; padding: 0; max-width: min(96vw, 900px); width: 100%; background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.6); }
.vhead { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font-weight: 600; margin: 0; }
#vimg { width: 100%; max-height: 65vh; object-fit: contain; background: #000; display: block; }
.vtools { padding: 12px; display: grid; gap: 10px; }
.vtools label { display: flex; gap: 8px; align-items: center; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 99; max-width: 90vw; }
.toast.bad { background: var(--bad); color: #fff; }
@media (max-width: 560px) { main { padding: 10px; } .lines td:nth-child(3) select { max-width: 120px; } }
.danger { color: var(--bad); border-color: var(--bad); }
.removed .rm { flex: none; width: 96px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.removed .thumb { opacity: .6; }
.toast button { margin-left: 8px; color: inherit; border-color: currentColor; }
/* Job page: the bar with the job name, "Go to" and the main buttons stays at the top while scrolling */
.bar { position: sticky; top: 0; z-index: 50; background: var(--card); border: 1px solid var(--line); border-radius: 0 0 10px 10px; padding: 8px 12px; margin: -16px -4px 14px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.barrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.barcode { font-size: 15px; }
.barrow select { margin-left: auto; max-width: 55vw; }
.bar .actions { margin: 8px 0 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.bar .actions > * { flex: none; white-space: nowrap; }
.pair, .jobhead { scroll-margin-top: calc(var(--barh, 100px) + 10px); }
@media (max-width: 600px) { .bar { padding: 6px 10px; } .bar .actions { margin-top: 6px; gap: 6px; } .bar .actions > * { padding: 6px 10px; font-size: 14px; } .barrow .small { display: none; } }
.brand { display: flex; align-items: center; } .brand .logo { width: 28px; height: 28px; margin-right: 9px; border-radius: 7px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
