:root{
  --bg:#0C0A0B;--surface:#171214;--surface2:#21191C;--line:#36282D;--fg:#F4EEF0;--muted:#A8979D;
  --accent:#9A3346;--accent-hi:#E8899A;--on:#FFFFFF;--live:#5BC88A;--warn:#F5B83D;--alert:#F0605D;--off:#7A6E72;
  --fb:"Archivo",system-ui,sans-serif;--fm:"DM Mono",ui-monospace,Consolas,monospace;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{background:var(--bg);color:var(--fg);font-family:var(--fb);font-size:15px;line-height:1.5}
a{color:var(--accent-hi)}
:focus-visible{outline:2px solid var(--accent-hi);outline-offset:2px}
.mono{font-family:var(--fm)}
.muted{color:var(--muted)}
button,.btn{font:inherit;font-weight:600;min-height:44px;padding:0 18px;border-radius:12px;border:1px solid var(--line);
  background:var(--surface2);color:var(--fg);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none}
.btn-pri{background:var(--accent);border-color:var(--accent);color:var(--on)}
.btn-pri:hover{background:#852B3C}
.btn-sm{min-height:36px;padding:0 12px;font-size:13px;border-radius:10px}
input,select{font:inherit;color:var(--fg);background:var(--bg);border:1px solid var(--line);border-radius:12px;height:44px;padding:0 12px;width:100%}
label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--muted)}

/* top bar */
.top{display:flex;align-items:center;gap:20px;padding:12px 20px;border-bottom:1px solid var(--line);background:var(--bg);flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:19px;letter-spacing:-.01em;text-decoration:none;color:var(--fg)}
.brand img{width:30px;height:30px}
.brand b{color:var(--accent-hi);font-weight:800}
.nav{display:flex;gap:4px;flex:1}
.nav a{color:var(--muted);text-decoration:none;padding:8px 12px;border-radius:10px;font-weight:600}
.nav a[aria-current="page"]{color:var(--fg);background:var(--surface)}
.top form{margin:0}

/* live */
.live{display:flex;flex-wrap:wrap;height:calc(100vh - 69px);min-height:520px}
#map{flex:999 1 560px;min-width:0;min-height:360px;background:var(--surface)}
.crew{flex:1 1 360px;max-width:100%;border-left:1px solid var(--line);overflow-y:auto;padding:18px;display:flex;flex-direction:column;gap:12px}
.crew h1{font-size:20px;font-weight:800}
.card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:10px}
.card.sel{border-color:var(--accent)}
.card-h{display:flex;align-items:center;gap:10px}
.card-h b{flex:1;font-size:16px;cursor:pointer}
.tag{font-family:var(--fm);font-size:12px;padding:2px 9px;border-radius:999px;border:1px solid currentColor;white-space:nowrap}
.s-live{color:var(--live)}.s-no-signal{color:var(--alert)}.s-off{color:var(--off)}.s-inactive{color:var(--off)}
.facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.fact{background:var(--bg);border-radius:10px;padding:7px 9px}
.fact small{display:block;font-size:11px;color:var(--muted)}
.fact b{font-family:var(--fm);font-size:14px;font-weight:500}
.warn{color:var(--warn)}.alert{color:var(--alert)}
.card-a{display:flex;gap:8px;flex-wrap:wrap}
.setup{background:var(--surface2);border:1px dashed var(--line);border-radius:16px;padding:16px;font-size:14px;display:flex;flex-direction:column;gap:8px}
.setup ol{padding-left:18px;display:flex;flex-direction:column;gap:4px}
.kbd{font-family:var(--fm);background:var(--bg);padding:1px 6px;border-radius:6px;border:1px solid var(--line);white-space:nowrap}
.pin-me{width:18px;height:18px;border-radius:50%;background:var(--live);border:3px solid #fff;box-shadow:0 0 0 6px rgba(91,200,138,.25)}
.pin-me.off{background:var(--off);box-shadow:none}
.pin-me.alert{background:var(--alert);box-shadow:0 0 0 6px rgba(240,96,93,.25)}
.leaflet-container{font-family:var(--fb)}

/* pages */
.page{max-width:1080px;margin:0 auto;padding:28px 16px 64px;display:flex;flex-direction:column;gap:24px}
.page h1{font-size:30px;font-weight:800;letter-spacing:-.01em}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:20px}
.form-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;align-items:end}
.tbl-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:14px}
th{text-align:left;color:var(--muted);font-weight:600;font-size:12px;padding:8px 10px;border-bottom:1px solid var(--line)}
td{padding:12px 10px;border-bottom:1px solid var(--line);vertical-align:middle}
td form{display:inline}
.newcard{background:var(--surface2);border:1px solid var(--accent);border-radius:18px;padding:20px;display:flex;flex-direction:column;gap:10px}
.newcard .big{font-family:var(--fm);font-size:28px;letter-spacing:.06em}
.creds{display:flex;gap:28px;flex-wrap:wrap}

/* auth */
.auth{min-height:100vh;display:grid;place-items:center;padding:16px}
.auth form{width:100%;max-width:380px;display:flex;flex-direction:column;gap:14px;background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:28px}
.auth .brand{justify-content:center;font-size:24px;margin-bottom:6px}
.auth .brand img{width:40px;height:40px}
.err{color:var(--alert);font-size:14px}

/* staff-facing pages (mobile first) */
.stf-top{padding:16px 20px;border-bottom:1px solid var(--line)}
.stf{max-width:520px;margin:0 auto;padding:24px 16px 56px;display:flex;flex-direction:column;gap:18px}
.stf h1{font-size:26px;font-weight:800;line-height:1.2;letter-spacing:-.01em}
.stf h2{font-size:18px;font-weight:800;margin-bottom:8px}
.stf ul{padding-left:20px;display:flex;flex-direction:column;gap:6px}
.stf-form{display:flex;flex-direction:column;gap:14px;background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:20px}
.stf-form input:disabled{opacity:.7}
.btn-big{min-height:56px;font-size:17px;width:100%}
.small{font-size:14px}
.steps-wrap{display:flex;flex-direction:column;gap:14px}
.step{display:flex;gap:14px;background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:18px}
.step>div{flex:1;min-width:0;display:flex;flex-direction:column;gap:10px}
.step-n{flex:0 0 32px;height:32px;border-radius:50%;background:var(--accent);color:var(--on);font-weight:800;display:grid;place-items:center}
.kv{background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:2px}
.kv small{color:var(--muted);font-size:12px}
.kv b{font-size:18px;word-break:break-all;user-select:all}
details summary{cursor:pointer;color:var(--accent-hi)}
.me-head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.me-head b{display:block;font-size:18px}
.timer{font-size:52px;font-weight:500;letter-spacing:.02em}
.door-row{display:grid;grid-template-columns:1fr 2fr 1fr;gap:8px}
.door-row button{min-height:52px}
.banner{background:var(--surface2);border:1px solid var(--warn);border-radius:14px;padding:12px 16px}
.tag.warn{color:var(--warn)}.tag.alert{color:var(--alert)}
[hidden]{display:none!important}

/* RoadKeep driver tabs + deliveries (#1312) */
body.has-tabs{padding-bottom:84px}
.tabbar{position:fixed;left:0;right:0;bottom:0;display:grid;grid-template-columns:1fr 1fr;background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom);z-index:10}
.tabbar a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:64px;color:var(--muted);text-decoration:none;font-weight:600;font-size:13px}
.tabbar a[aria-current="page"]{color:var(--fg);box-shadow:inset 0 3px 0 var(--accent)}
.tabbar svg,.dact svg,.photo-btn svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tabbar a[aria-current="page"] svg{stroke:var(--accent-hi)}
.empty{background:var(--surface);border:1px dashed var(--line);border-radius:18px;padding:22px;display:flex;flex-direction:column;gap:4px;text-align:center}
.dcard{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:16px;display:flex;flex-direction:column;gap:10px}
.dcard.picked{border-color:var(--accent)}
.dcard-h{display:flex;align-items:center;gap:10px}
.dcard-h b{flex:1;font-size:17px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dno{color:var(--accent-hi);font-size:15px}
.daddr{font-size:19px;font-weight:600;line-height:1.3}
.dnote{background:var(--surface2);border-left:3px solid var(--warn);border-radius:8px;padding:8px 10px}
.dact{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px}
.dact .btn{min-height:56px;font-size:16px}
.geo{display:inline-flex;align-items:center;min-height:44px;align-self:flex-start}
.proof{display:flex;flex-direction:column;gap:10px;background:var(--bg);border:1px solid var(--line);border-radius:14px;padding:14px}
.photo-btn{flex-direction:row;color:var(--fg);font-size:17px;border-style:dashed}
.proof-img{width:100%;max-height:260px;object-fit:cover;border-radius:12px}
.thumbs{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.thumb{display:flex;flex-direction:column;gap:4px;color:var(--muted);text-decoration:none}
.thumb img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:10px;background:var(--bg)}
.tthumb{width:72px;height:54px;object-fit:cover;border-radius:8px;display:block;margin-bottom:4px}
img{-webkit-user-drag:none;user-select:none}
/* Traccar build (#1454): events list, arrival hint, customer tracking page */
.events{display:flex;flex-direction:column;gap:8px}
.events h2{font-size:16px;font-weight:800}
.ev-list{list-style:none;display:flex;flex-direction:column;gap:6px}
.ev-list li{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:8px 10px;font-size:14px;display:grid;grid-template-columns:auto 1fr;gap:2px 10px;min-width:0}
.ev-list .t{font-family:var(--fm);color:var(--muted);font-size:13px}
.ev-list .w{min-width:0;overflow-wrap:anywhere}
.ev-list .d{grid-column:2;color:var(--muted);font-size:13px;overflow-wrap:anywhere}
.dcard.arrived{border-color:var(--live)}
.arrive-hint{display:flex;gap:8px;align-items:flex-start;background:var(--surface2);border:1px solid var(--live);border-radius:12px;padding:10px 12px;font-size:14px}
.arrive-hint svg{flex:0 0 20px;width:20px;height:20px;fill:none;stroke:var(--live);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.dcard.arrived .step-btn{box-shadow:0 0 0 3px var(--live)}
.fact .ok{color:var(--live)}
body.track{display:flex;flex-direction:column;min-height:100vh}
.track-h{display:flex;align-items:center;gap:10px;padding:12px 16px;background:var(--surface);border-bottom:1px solid var(--line)}
.track-h b{flex:1;font-size:17px}
#tmap{flex:1;min-height:60vh}
.track-note{padding:12px 16px}
.bolt{width:13px;height:13px;vertical-align:-1px;fill:none;stroke:var(--warn);stroke-width:2;stroke-linejoin:round}
.ok{color:var(--live)}
.tiles-dark{filter:invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.6)}
/* Distribution Team crew pages + admin Jobs (#1454, 2026-11-17). Card fill #2F2529 = 1.33:1 on the page, border #4E3C43 = 1.93:1 */
.crew-body{--c-card:#2F2529;--c-line:#4E3C43;--c-muted:#B8A9AE;--c-err:#FF8A85;min-height:100%}
.crew-body .muted{color:var(--c-muted)}
.crew-top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid var(--c-line);background:#130F11;flex-wrap:wrap}
.crew-tag{font-size:13px;font-weight:600;color:var(--c-muted)}
.crew-main{max-width:520px;margin:0 auto;padding:24px 16px 48px;display:flex;flex-direction:column;gap:16px;min-width:0}
.crew-main h1{font-size:26px;font-weight:800;line-height:1.2;letter-spacing:-.01em;overflow-wrap:anywhere}
.crew-card{background:var(--c-card);border:1px solid var(--c-line);border-radius:18px;padding:18px;display:flex;flex-direction:column;gap:16px;min-width:0;box-shadow:0 2px 10px rgba(0,0,0,.35)}
.crew-center{align-items:center;text-align:center}
.crew-center .btn{align-self:stretch}
.crew-ico{width:48px;height:48px;fill:none;stroke:var(--accent-hi);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.crew-ico.ok{stroke:var(--live)}
.crew-form{display:flex;flex-direction:column;gap:16px}
.fld{display:flex;flex-direction:column;gap:6px;min-width:0}
.fld label{display:block;font-size:14px;font-weight:600;color:var(--fg)}
.crew-body input,.crew-body textarea{background:var(--bg);border:1px solid #6B5560;border-radius:12px;color:var(--fg);font:inherit;font-size:16px;width:100%;min-width:0}
.crew-body input{height:48px;padding:0 14px}
.crew-body textarea{padding:10px 14px;resize:vertical;min-height:88px}
.crew-body input:focus,.crew-body textarea:focus{outline:2px solid var(--accent-hi);outline-offset:1px}
.fld-e{font-size:14px;color:var(--c-err);min-height:0}
.fld-e:empty{display:none}
.fld.bad input,.fld.bad textarea,input.bad{border-color:var(--c-err);box-shadow:0 0 0 1px var(--c-err)}
.big-num{font-family:var(--fm);font-size:24px!important;height:56px!important;letter-spacing:.02em}
.crew-alert,.crew-okmsg{display:flex;gap:10px;align-items:flex-start;background:#1E1518;border:1px solid var(--c-err,#FF8A85);color:var(--c-err,#FF8A85);border-radius:12px;padding:12px 14px;font-size:15px}
.crew-okmsg{border-color:var(--live);color:var(--live)}
.crew-alert svg,.crew-note svg,.crew-links svg,.btn svg,.btn-pri svg,.btn-quiet svg,.ico{flex:0 0 22px;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.crew-note{display:flex;gap:12px;align-items:flex-start;background:var(--bg);border:1px solid var(--c-line);border-radius:14px;padding:14px;font-size:15px;line-height:1.45}
.crew-note svg{color:var(--accent-hi);margin-top:1px}
.crew-note.is-live{border-color:var(--live)}.crew-note.is-live svg{color:var(--live)}
.crew-note.is-warn{border-color:var(--warn)}.crew-note.is-warn svg{color:var(--warn)}
.crew-note span{min-width:0;overflow-wrap:anywhere}
.btn-start{width:100%;min-height:96px;font-size:24px;font-weight:800;border-radius:20px;gap:12px}
.btn-start svg{width:30px;height:30px;flex-basis:30px;fill:currentColor;stroke:none}
.btn-end{background:var(--accent);border-color:var(--accent);color:var(--on)}
.btn-end:hover,.btn-start:hover{background:#852B3C}
.btn-end svg{fill:currentColor;stroke:none}
.crew-body .btn-big{width:100%;min-height:56px;font-size:17px}
.crew-body .btn{border-color:var(--c-line)}
.btn-quiet{background:transparent;border-color:var(--c-line);color:var(--fg);width:100%}
button,.btn{transition:background-color .12s,border-color .12s,transform .12s}
button:active,.btn:active{transform:translateY(1px)}
button:disabled{opacity:.5;cursor:not-allowed}
.crew-who{display:flex;justify-content:space-between;align-items:center;gap:12px;min-width:0}
.crew-who>div{min-width:0}
.crew-who b{display:block;font-size:19px;overflow-wrap:anywhere}
.crew-body .s-off{color:var(--c-muted)}
.crew-links{display:grid;grid-template-columns:1fr;gap:12px}
.crew-links .btn{width:100%}
.crew-links form{margin:0}
.crew-confirm{margin-top:12px;background:var(--c-card);border:1px solid var(--accent-hi);border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:12px}
.crew-row,.crew-row2{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.crew-row .btn,.crew-row2 .btn{width:100%;min-height:48px}
.crew-or{display:flex;align-items:center;gap:12px;color:var(--c-muted);font-size:14px}
.crew-or::before,.crew-or::after{content:"";flex:1;height:1px;background:var(--c-line)}
.gbtn{display:flex;align-items:center;justify-content:center;gap:12px;min-height:52px;border-radius:12px;background:#FFFFFF;color:#1F1F1F;font-weight:600;text-decoration:none;border:1px solid #DADCE0}
.gbtn:hover{background:#F2F2F2}
.crew-steps{list-style:none;display:flex;flex-direction:column;gap:16px;padding:0}
.crew-steps .crew-card{flex-direction:row;align-items:flex-start;gap:14px}
.crew-steps .crew-card>div{flex:1;min-width:0;display:flex;flex-direction:column;gap:10px}
.crew-body .kv{background:var(--bg);border-color:var(--c-line);display:grid;grid-template-columns:1fr auto;align-items:center;gap:2px 12px}
.crew-body .kv small{grid-column:1;color:var(--c-muted)}
.crew-body .kv b{grid-column:1;font-size:16px;overflow-wrap:anywhere;word-break:break-all}
.crew-body .kv button{grid-column:2;grid-row:1/span 2}
.crew-qr{background:#fff;border-radius:14px;padding:10px;align-self:center;max-width:100%}
.crew-qr svg{display:block;width:220px;max-width:100%;height:auto}
.crew-facts{grid-template-columns:1fr 1fr;width:100%}
.crew-body .fact{background:var(--bg);text-align:left}
.crew-body .fact small{color:var(--c-muted);font-size:12px}
.crew-body .timer{font-size:48px;line-height:1.1}
@media (orientation:landscape) and (max-height:500px){.btn-start{min-height:72px}.crew-main{padding-top:16px}}
/* admin Jobs */
.jobs-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.jobs-head h1{min-width:0;overflow-wrap:anywhere}
.jobs-filter{display:flex;flex-direction:column;gap:16px}
.jobs-total{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.jobs-total .fact{background:var(--surface);border:1px solid var(--line);padding:12px 14px;border-radius:14px}
.jobs-total .fact b{font-size:20px}
.jobs-gh{display:flex;align-items:baseline;justify-content:space-between;gap:8px 16px;flex-wrap:wrap;margin-bottom:12px}
.jobs-gh h2,.jobs-h2{font-size:18px;font-weight:800}
.jobs-h2{margin-bottom:12px}
.fg{color:var(--fg)}
.jobs-fly{display:flex!important;gap:8px;align-items:center}
.jobs-fly input{width:96px;height:36px;font-family:var(--fm);font-size:14px}
.jobs-fly input.bad{border-color:var(--alert)}
.jobs-note{display:block;margin-top:4px;max-width:260px;overflow-wrap:anywhere}
.jobs-map{height:60vh;min-height:320px;border-radius:16px;border:1px solid var(--line);background:var(--surface)}
@media (max-width:640px){
  .jobs-total{grid-template-columns:repeat(2,minmax(0,1fr))}
  .jobs-tbl thead{display:none}
  .jobs-tbl,.jobs-tbl tbody,.jobs-tbl tr,.jobs-tbl td{display:block;width:100%}
  .jobs-tbl tr{border:1px solid var(--line);border-radius:14px;padding:8px 12px;margin-bottom:12px}
  .jobs-tbl td{border:0;padding:6px 0;display:grid;grid-template-columns:84px 1fr;gap:8px;align-items:center}
  .jobs-tbl td::before{content:attr(data-l);color:var(--muted);font-size:13px}
  .jobs-tbl td>*{min-width:0}
  .page .top,.top{gap:12px}
}
.jobs-tbl td .jobs-note{grid-column:2}
.nav{min-width:0}
@media (max-width:640px){.top{gap:8px 12px}.nav{order:3;flex:1 1 100%;overflow-x:auto;scrollbar-width:none}.nav a{white-space:nowrap}.top form{margin-left:auto}}
.crew-body input::placeholder,.crew-body textarea::placeholder,.jobs-fly input::placeholder{color:#A8979D;opacity:1}
