:root{--bg:#f4f5f7;--card:#fff;--text:#1d2330;--muted:#6b7385;--line:#e3e6ec;--accent:#a80e0e;--ok:#16a34a;--warn:#d97706;--err:#dc2626}
@media (prefers-color-scheme:dark){:root{--bg:#12151c;--card:#1b2029;--text:#e8ebf2;--muted:#9099ad;--line:#2a3140;--accent:#e5484d}}
*{box-sizing:border-box}
body{margin:0;font:15px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--text);display:flex;min-height:100vh}
aside{width:220px;background:#0d0d0f;color:#d9d9de;padding:18px 12px;position:sticky;top:0;height:100vh;flex-shrink:0;overflow-y:auto}
.brand{padding:2px 6px 18px}.brand img{width:100%;max-width:170px;display:block}
aside a{display:flex;justify-content:space-between;align-items:center;padding:9px 12px;border-radius:8px;color:#d9d9de;text-decoration:none;margin-bottom:2px}
aside a:hover{background:#1c1c20} aside a.on{background:var(--accent);color:#fff}
.nb{background:#ff9100;color:#000;border-radius:99px;font-size:11px;font-weight:700;padding:1px 7px}
aside .sp{height:18px}
main{flex:1;padding:24px 28px;min-width:0;max-width:1300px}
h1{font-size:22px;margin:0 0 18px} h2{font-size:16px;margin:26px 0 10px}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:16px;margin-bottom:16px}
.grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));margin-bottom:16px}
.stat{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px}
.stat b{display:block;font-size:26px} .stat span{color:var(--muted);font-size:13px}
table{width:100%;border-collapse:collapse;background:var(--card);border:1px solid var(--line);border-radius:12px;overflow:hidden}
th,td{padding:9px 12px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top}
th{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);background:var(--bg)}
tr:last-child td{border-bottom:0} td.r,th.r{text-align:right}
a{color:var(--accent)} .muted{color:var(--muted)} .small{font-size:13px}
.badge{display:inline-block;padding:2px 9px;border-radius:99px;font-size:12px;font-weight:600;background:var(--line)}
.st-new{background:#fde68a;color:#78350f}.st-assigned{background:#fed7aa;color:#7c2d12}
.st-accepted,.st-picked_up{background:#bfdbfe;color:#1e3a8a}.st-delivered{background:#bbf7d0;color:#14532d}
.st-cancelled{background:#e5e7eb;color:#4b5563}.st-pending{background:#fde68a;color:#78350f}
.st-approved{background:#bbf7d0;color:#14532d}.st-blocked{background:#fecaca;color:#7f1d1d}
form.inline{display:inline} label{display:block;font-size:13px;color:var(--muted);margin:10px 0 4px}
input,select,textarea{width:100%;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--text);font:inherit}
input[type=checkbox]{width:auto} textarea{min-height:64px}
.row{display:grid;gap:14px;grid-template-columns:1fr 1fr} .row3{display:grid;gap:14px;grid-template-columns:1fr 1fr 1fr}
button,.btn{display:inline-block;padding:8px 14px;border-radius:8px;border:1px solid var(--accent);background:var(--accent);color:#fff;font:inherit;cursor:pointer;text-decoration:none}
button.ghost,.btn.ghost{background:transparent;color:var(--accent)} button.danger{background:var(--err);border-color:var(--err)}
button.sm{padding:4px 10px;font-size:13px}
.flash{padding:10px 14px;border-radius:8px;margin-bottom:14px}.flash.ok{background:#dcfce7;color:#14532d}.flash.err{background:#fee2e2;color:#7f1d1d}
.filters{display:flex;gap:10px;flex-wrap:wrap;align-items:end;margin-bottom:14px}.filters>div{min-width:130px}
#map{height:460px;border-radius:12px;border:1px solid var(--line);margin-bottom:16px}
.login{margin:12vh auto;width:340px}.login body{display:block}
.pin{width:18px;height:18px;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.4);color:#fff;font:700 10px/12px system-ui;text-align:center}
.kv{display:grid;grid-template-columns:150px 1fr;gap:6px 12px}.kv div:nth-child(odd){color:var(--muted)}
@media(max-width:800px){body{display:block}aside{width:auto;height:auto;position:static;display:flex;flex-wrap:wrap;gap:4px}.brand{width:100%;padding-bottom:6px}aside .sp{display:none}main{padding:14px}.row,.row3{grid-template-columns:1fr}table{display:block;overflow-x:auto}}

.st-at_pickup,.st-at_drop{background:#c7d2fe;color:#312e81}
.st-processing{background:#bfdbfe;color:#1e3a8a}.st-paid{background:#bbf7d0;color:#14532d}.st-rejected{background:#fecaca;color:#7f1d1d}
.dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:#9ca3af;margin-right:6px}.dot.on{background:#16a34a}.dot.busy{background:#f59e0b}.dot.lost{background:#dc2626}
.feed{list-style:none;margin:0;padding:0;font-size:13px}.feed li{padding:7px 0;border-bottom:1px solid var(--line)}.feed li:last-child{border:0}
.feed time{color:var(--muted);margin-right:8px}
.chat{display:grid;grid-template-columns:280px 1fr;gap:14px;min-height:560px}
.chat .list{background:var(--card);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.chat .list a{display:block;padding:11px 14px;border-bottom:1px solid var(--line);text-decoration:none;color:var(--text)}
.chat .list a.on{background:var(--bg)}.chat .list small{color:var(--muted);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat .pane{background:var(--card);border:1px solid var(--line);border-radius:12px;display:flex;flex-direction:column}
.msgs{flex:1;padding:14px;overflow-y:auto;max-height:520px;display:flex;flex-direction:column;gap:6px}
.msg{max-width:70%;padding:8px 12px;border-radius:12px;background:var(--bg);align-self:flex-start;white-space:pre-wrap;word-break:break-word}
.msg.mine{align-self:flex-end;background:var(--accent);color:#fff}.msg time{display:block;font-size:11px;opacity:.6}
.pane form{display:flex;gap:8px;padding:10px;border-top:1px solid var(--line)}
.tabs a{display:inline-block;padding:5px 12px;border-radius:99px;border:1px solid var(--line);text-decoration:none;margin-right:6px;font-size:13px;color:var(--text)}.tabs a.on{background:var(--accent);color:#fff;border-color:var(--accent)}
.avatar{width:42px;height:42px;border-radius:50%;object-fit:cover;background:var(--line);vertical-align:middle;margin-right:8px}
.map-sm{height:320px;border-radius:12px;border:1px solid var(--line);margin-bottom:16px}
details.card summary{cursor:pointer;font-weight:600}
@media(max-width:800px){.chat{grid-template-columns:1fr}}
