:root {
  --bg: #faf6ef; --card: #fffdf9; --ink: #2a2724; --muted: #6f675f; --line: #e8dfd2;
  --accent: #0f766e; --accent-ink: #fff; --accent-soft: #d9efec;
  --warn: #b4540a; --warn-soft: #fde9d3; --ok: #2f7d3b; --ok-soft: #dff1df; --info-soft: #e3ecf7; --info: #2c5a91;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; font-size: 16px; line-height: 1.45; }
.side { background: #23403d; color: #e9f3f1; padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.brand strong { display: block; font-size: 18px; } .brand small { color: #a9c9c4; }
.logo { width: 40px; height: 40px; background: #f2c14e; border-radius: 12px; display: grid; place-items: center; }
.logo svg { width: 28px; fill: none; stroke: #23403d; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
nav { display: flex; flex-direction: column; gap: 4px; }
.nav { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; color: #d3e7e3; text-decoration: none; font-weight: 500; }
.nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav:hover { background: rgba(255,255,255,.08); }
.nav.on { background: #f2c14e; color: #23403d; }
.live { margin-top: auto; display: flex; gap: 8px; align-items: center; font-size: 13px; color: #a9c9c4; padding: 6px; }
.live i { width: 9px; height: 9px; border-radius: 50%; background: #8a8a8a; }
.live.up i { background: #6fdc8c; } .live.flash i { box-shadow: 0 0 0 5px rgba(111,220,140,.35); transition: box-shadow .3s; }
main { padding: 28px clamp(16px, 4vw, 48px) 60px; max-width: 1100px; width: 100%; }
h1 { margin: 0; font-size: 30px; letter-spacing: -.01em; } h2 { font-size: 19px; margin: 0; } h3 { font-size: 16px; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 4px 0 22px; }
.muted { color: var(--muted); } .fine { color: var(--muted); font-size: 13px; margin-top: 22px; }
.sr { position: absolute; left: -9999px; }
.bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
input { flex: 1; min-width: 220px; font: inherit; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink); }
input:focus-visible, .btn:focus-visible, .chip:focus-visible, .nav:focus-visible { outline: 3px solid #f2c14e; outline-offset: 2px; border-color: var(--accent); }
.btn { font: inherit; font-weight: 600; padding: 14px 22px; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.btn:hover { filter: brightness(1.1); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--ink); }
.chip:hover { background: var(--accent-soft); border-color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.row { display: flex; gap: 14px; align-items: center; }
.rank { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.row .grow { flex: 1; min-width: 0; }
.km { font-size: 24px; font-weight: 700; white-space: nowrap; text-align: right; } .km small { font-size: 14px; font-weight: 500; color: var(--muted); }
.card.first { border-color: var(--accent); background: #f4fbfa; }
.sub { color: var(--muted); font-size: 14px; }
.kpis { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; min-width: 150px; }
.kpi b { display: block; font-size: 28px; line-height: 1.1; } .kpi span { color: var(--muted); font-size: 13px; }
.kpi.bad b { color: var(--warn); }
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 15px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; } tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.Received { background: var(--info-soft); color: var(--info); } .pill.InProgress { background: #fdf0c9; color: #86600a; }
.pill.ReadyForPickup { background: var(--ok-soft); color: var(--ok); } .pill.Completed { background: #eee; color: #555; } .pill.Cancelled { background: #f3dede; color: #8a2b2b; }
.pill.late { background: var(--warn-soft); color: var(--warn); } .pill.kind { background: var(--accent-soft); color: var(--accent); }
.empty { padding: 18px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); }
.error { padding: 14px 16px; border-radius: 12px; background: #f9e3e3; color: #7d2323; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.bars { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 36px; gap: 10px; align-items: center; font-size: 14px; }
.bar-row .track { background: #efe8dc; border-radius: 6px; height: 16px; overflow: hidden; } .bar-row .fill { background: var(--accent); height: 100%; border-radius: 6px; min-width: 3px; }
.bar-row .n { text-align: right; font-weight: 600; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 10; max-width: min(360px, calc(100vw - 32px)); }
.toast { background: #23403d; color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.2); font-size: 14px; animation: in .25s ease-out; }
.toast b { display: block; } .toast ul { margin: 4px 0 0; padding-left: 18px; color: #cfe5e1; }
@keyframes in { from { transform: translateY(8px); opacity: 0; } }
@media (max-width: 760px) {
  body { grid-template-columns: 1fr; padding-bottom: 72px; }
  .side { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; flex-direction: row; padding: 6px; z-index: 5; gap: 0; }
  .brand, .live { display: none; } nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 8px; text-align: center; }
  th.hide, td.hide { display: none; } .bar-row { grid-template-columns: 90px 1fr 30px; }
}
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
