:root {
  --bg: #f3f3f3; --card: #fff; --text: #111; --muted: #666; --line: #ddd;
  --red: #d71920; --red-d: #a90f15; --green: #11883a; --green-bg: #e3f6e8; --red-bg: #fde6e6;
  --amber: #b86e00; --amber-bg: #fff3d6; --blue: #1756a9;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
body { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.15; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 12px 16px 80px; }
.topbar { background: #111; color: #fff; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; position: sticky; top: 0; z-index: 50; flex-wrap: wrap; }
.topbar .brand { font-weight: 800; letter-spacing: .02em; }
.topbar .brand b { color: var(--red); }
.topbar .sp { flex: 1; }
.topbar a, .topbar button.link { color: #ddd; text-decoration: none; font-size: 14px; background: none; border: 0;
  cursor: pointer; padding: 4px 6px; }
.topbar a:hover { color: #fff; }
.topbar .who { font-size: 13px; color: #aaa; }

.card { background: var(--card); border-radius: 12px; padding: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.08);
  margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

button, .btn { font: inherit; border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer;
  background: #e6e6e6; color: #111; font-weight: 600; text-decoration: none; display: inline-block;
  touch-action: manipulation; user-select: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--red); color: #fff; }
button.green { background: var(--green); color: #fff; }
button.dark { background: #222; color: #fff; }
button.ghost { background: transparent; border: 2px solid var(--line); }
button.big { font-size: 22px; padding: 18px 20px; border-radius: 14px; }
button.huge { font-size: 30px; padding: 28px 20px; border-radius: 18px; font-weight: 800; }
button.sm { padding: 6px 10px; font-size: 14px; border-radius: 8px; }
button.busy { position: relative; color: transparent !important; }
button.busy::after { content: "…"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff;
  font-size: 1.2em; }
input, select, textarea { font: inherit; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px;
  background: #fff; color: #111; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #888; }
label.f { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
label.f > input, label.f > select, label.f > textarea { margin-top: 3px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 12px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: #eee; color: #333; white-space: nowrap; }
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.bad { background: var(--red-bg); color: var(--red); }
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.dark { background: #222; color: #fff; }

table.t { width: 100%; border-collapse: collapse; background: #fff; }
table.t th, table.t td { padding: 7px 8px; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover { background: #fafafa; }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap; }
tr.void td { color: #999; text-decoration: line-through; }

.check { display: flex; align-items: center; gap: 12px; padding: 12px; border: 2px solid var(--line);
  border-radius: 12px; margin-bottom: 8px; cursor: pointer; background: #fff; user-select: none; font-size: 17px; }
.check .box { width: 32px; height: 32px; border-radius: 8px; border: 3px solid #bbb; flex: none; display: grid;
  place-items: center; font-size: 22px; font-weight: 900; color: #fff; }
.check.on { border-color: var(--green); background: var(--green-bg); }
.check.on .box { background: var(--green); border-color: var(--green); }
.check.on .box::after { content: "✓"; }
.check.req:not(.on) { border-color: #f1b3b3; }

.plate-ok { background: var(--green); color: #fff; font-size: 28px; font-weight: 900; padding: 14px; border-radius: 12px;
  text-align: center; letter-spacing: .05em; }
.plate-bad { background: var(--red-bg); color: var(--red); border: 2px solid var(--red); padding: 10px 14px;
  border-radius: 12px; }
.plate-bad b { font-size: 20px; }
.plate-grey { background: #eee; color: #555; padding: 12px; border-radius: 12px; text-align: center; font-weight: 800;
  font-size: 22px; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100; display: flex;
  align-items: flex-start; justify-content: center; overflow-y: auto; padding: 20px 10px; }
.modal { background: #fff; border-radius: 14px; padding: 18px; width: 100%; max-width: 560px; margin: auto; }
.modal.wide { max-width: 1000px; }
.modal h2 { margin-bottom: 12px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 300; display: flex;
  flex-direction: column; gap: 8px; width: min(94vw, 520px); pointer-events: none; }
.toast { background: #222; color: #fff; padding: 12px 16px; border-radius: 10px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { background: #fff; border: 2px solid var(--line); }
.tabs button.on { background: #111; color: #fff; border-color: #111; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { background: #fff; border-radius: 12px; padding: 12px; }
.kpi .v { font-size: 26px; font-weight: 800; }
.kpi .l { font-size: 12px; color: var(--muted); text-transform: uppercase; }
@media print {
  .noprint, .topbar { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; padding: 0; }
}
