*{box-sizing:border-box}
html{color-scheme:dark}
body{margin:0;font:14px/1.4 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:#f4f6f8;background:#121418}
.hidden{display:none!important}.muted{color:#c5ced9}.err{color:#ff8a80;min-height:1em}
a{color:#ff8a9a}
button{background:#c8102e;color:#fff;border:0;border-radius:6px;padding:7px 12px;cursor:pointer;font:inherit}button.ghost{background:#1b212b;color:#f4f6f8;border:1px solid #5c6778}
button.small{padding:3px 7px;font-size:12px}input,select,textarea{font:inherit;padding:6px 8px;border:1px solid #5c6778;border-radius:6px;width:100%;background:#12161c;color:#f4f6f8}
::placeholder{color:#9aa6b5}
header{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;background:#1b212b;border-bottom:3px solid #c8102e;gap:12px}
header .controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}header .controls input{width:auto}
.brand{display:flex;align-items:center;gap:12px}.brand img{height:46px;width:auto;display:block}.brand strong{font-size:16px}.live{font-size:12px;font-weight:600}.live.on{color:#7dffa1}.live.off{color:#9aa6b5}
.login img.logo{height:72px;width:auto;align-self:center}
main{display:flex;height:calc(100vh - 112px)}.runs{width:380px;overflow:auto;padding:12px;border-right:1px solid #323a46;background:#121418}.map{flex:1}
footer{padding:4px 16px;font-size:11px;background:#1b212b;border-top:1px solid #323a46;color:#c5ced9}
.run{background:#1b212b;border:1px solid #3a4452;border-radius:8px;margin-bottom:12px;overflow:hidden}
.run .hd{padding:10px 12px;display:flex;justify-content:space-between;gap:8px;align-items:flex-start}
.run h3{margin:0;font-size:15px}.run .sub{font-size:12px}.ex{background:#3d2e00;color:#ffe08a;font-size:10px;border-radius:4px;padding:1px 5px;font-weight:600;margin-left:4px}
.bar{height:6px;background:#2a3140;display:flex}.bar i{display:block;height:100%}.bar .d{background:#43a047}.bar .f{background:#ef5350}.bar .a{background:#ffb300}
.stop{display:flex;gap:8px;padding:8px 12px;border-top:1px solid #323a46;align-items:flex-start}.stop .n{width:22px;height:22px;border-radius:50%;color:#fff;font-size:12px;display:flex;align-items:center;justify-content:center;flex:none;font-weight:700;box-shadow:0 0 0 2px #f4f6f8}
.stop .body{flex:1;min-width:0}.stop .body b{display:block}.stop .meta{font-size:12px;color:#c5ced9}.stop .btns{display:flex;flex-direction:column;gap:3px}
.st-pending{background:#90a4ae}.st-arrived{background:#ffb300}.st-delivered{background:#43a047}.st-failed{background:#ef5350}
.chip{font-size:11px;padding:1px 6px;border-radius:10px;color:#fff;font-weight:600;text-transform:uppercase}
.login{display:flex;height:100vh;align-items:center;justify-content:center;background:#121418}.card{background:#1b212b;padding:24px;border-radius:10px;width:320px;display:flex;flex-direction:column;gap:10px;box-shadow:0 4px 18px #0008;border:1px solid #3a4452}
dialog{border:1px solid #3a4452;border-radius:10px;padding:18px;max-width:1100px;width:95vw;box-shadow:0 10px 40px #000a;background:#1b212b;color:#f4f6f8}dialog::backdrop{background:#000a}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px}.grid4{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin-top:8px}label{font-size:12px;color:#c5ced9}
.actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}table.stopsEdit{width:100%;border-collapse:collapse}table.stopsEdit td{padding:2px}
.tbl{width:100%;border-collapse:collapse}.tbl td,.tbl th{border-bottom:1px solid #323a46;padding:5px;text-align:left}
.pod img.sig{border:1px solid #5c6778;background:#fff;max-width:320px}.pod .photos img{max-width:240px;max-height:180px;margin:4px;border-radius:4px;border:1px solid #5c6778}
.drvlabel{background:#1b212b;color:#f4f6f8;border:1px solid #f4f6f8;font-weight:600}.stopIcon{border-radius:50%;color:#fff;font-weight:700;text-align:center;line-height:22px;border:2px solid #f4f6f8;box-shadow:0 0 0 1px #0e1116,0 1px 4px #000}
.truck{font-size:22px;filter:drop-shadow(0 1px 2px #000)}

.st-next{background:#ffb300}.link{cursor:pointer;color:#ff8a9a}.link:hover{text-decoration:underline}
.truckDot{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:16px;border:3px solid #f4f6f8;box-shadow:0 0 0 1px #0e1116,0 1px 4px #000}
.leaflet-control-attribution{background:rgba(255,255,255,.94);color:#1d2430;font-size:11px;max-width:420px;line-height:1.3}
.leaflet-control-attribution a{color:#0b57d0}
.leaflet-bar a{background:#1b212b;color:#f4f6f8;border-bottom-color:#3a4452}
.leaflet-bar a:hover{background:#2a3140}
.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#1b212b;color:#f4f6f8}
.slipCard{display:grid;grid-template-columns:160px 1fr;gap:12px;border:1px solid #3a4452;border-radius:8px;padding:10px;margin:8px 0;background:#12161c}
.slipCard img{width:160px;max-height:220px;object-fit:contain;background:#0e1116;border-radius:6px}
.slipCard .warn{color:#ffe08a;font-size:12px;margin:0 0 6px}
pre.crash{white-space:pre-wrap;max-height:280px;overflow:auto;background:#0e1116;border:1px solid #3a4452;border-radius:6px;padding:10px;font-size:12px}
.filebtn{display:inline-block;background:#1b212b;color:#f4f6f8;border:1px solid #5c6778;border-radius:6px;padding:7px 12px;cursor:pointer}
@media(max-width:720px){.slipCard{grid-template-columns:1fr}.runs{width:100%}}
.pulse{animation:pulse 1.6s infinite}@keyframes pulse{0%{box-shadow:0 0 0 0 #ffb300cc}70%{box-shadow:0 0 0 12px #ffb30000}100%{box-shadow:0 0 0 0 #ffb30000}}
.legend{background:#1b212b;color:#f4f6f8;padding:10px 12px;border-radius:8px;box-shadow:0 2px 10px #0008;border:1px solid #3a4452;width:310px;font-size:12px;max-height:60vh;overflow:auto}
.legend .lg{display:flex;gap:8px;margin-top:8px;cursor:pointer}.legend .lg>i,.legend .keys i{width:12px;height:12px;border-radius:50%;display:inline-block;flex:none;margin-top:3px;box-shadow:0 0 0 2px #f4f6f8}
.pbar{position:relative;background:#2a3140;height:16px;border-radius:8px;overflow:hidden;margin:3px 0;width:250px}.pbar span{display:block;height:100%;background:#43a047}.pbar em{position:absolute;left:8px;top:0;font-style:normal;font-size:11px;line-height:16px;font-weight:600;color:#f4f6f8;text-shadow:0 0 3px #000,0 0 3px #000}
.legend .keys{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;border-top:1px solid #323a46;padding-top:6px}.legend .keys i{margin:0 3px 0 0;vertical-align:-1px}
