:root {
  --bg: #f3f5f8; --card: #fff; --text: #17202a; --muted: #5f6b7a; --line: #dde3ea; --primary: #1565c0; --primary-d: #0d47a1;
  --green: #2e7d32; --yellow: #f9a825; --red: #c62828; --gray: #78909c; --radius: 12px; --shadow: 0 1px 3px rgba(0,0,0,.12);
  --top: 56px; --bottom: 0px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11161d; --card: #1b222c; --text: #e8edf3; --muted: #9aa7b6; --line: #2c3644; --shadow: 0 1px 3px rgba(0,0,0,.5); }
  .leaflet-tile-pane { filter: brightness(.85) contrast(1.05); }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; }
textarea { resize: vertical; min-height: 64px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; color: var(--text); min-height: 40px; }
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.danger { color: var(--red); border-color: #e5b4b4; }
.btn.big { width: 100%; min-height: 56px; font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
h2 { font-size: 18px; margin: 4px 0 12px; }
h3 { font-size: 15px; margin: 14px 0 8px; }

/* splash */
.splash { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--primary-d); color: #fff; font-size: 20px; font-weight: 600; z-index: 9999; }
.splash img { width: 96px; height: 96px; border-radius: 22px; }

/* topo */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 14px;
  background: var(--primary-d); color: #fff; z-index: 1000; padding-top: env(safe-area-inset-top); }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
#topnav { display: flex; gap: 4px; flex: 1; }
#topnav a { color: #dce8ff; text-decoration: none; padding: 7px 11px; border-radius: 8px; }
#topnav a.on, #topnav a:hover { background: rgba(255,255,255,.16); color: #fff; }
.btn-nova { background: #ffc107; color: #222; font-weight: 800; text-decoration: none; padding: 9px 16px; border-radius: 10px; white-space: nowrap; }
.rt { color: #ffcc80; font-size: 14px; }
.rt.ok { color: #69f0ae; }
main { position: absolute; top: var(--top); left: 0; right: 0; bottom: var(--bottom); overflow: auto; }
main.full { overflow: hidden; }
.page { max-width: 1100px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }

/* navegação inferior (celular) */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; height: 62px; display: none; background: var(--card); border-top: 1px solid var(--line);
  z-index: 1000; padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: var(--muted);
  text-decoration: none; }
.bottomnav a span { font-size: 19px; line-height: 1.1; }
.bottomnav a.on { color: var(--primary); font-weight: 600; }
.bottomnav .bn-nova span { background: #ffc107; color: #222; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 28px; font-weight: 800; margin-top: -20px; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
@media (max-width: 820px) {
  :root { --top: 50px; --bottom: 62px; }
  #topnav, .btn-nova { display: none; }
  .bottomnav { display: flex; }
  .brand span { font-size: 16px; }
  .topbar { justify-content: space-between; }
  .page { padding: 12px; }
}

/* mapa principal */
.mapwrap { position: absolute; inset: 0; display: flex; }
.side { width: 380px; overflow: auto; background: var(--bg); border-right: 1px solid var(--line); padding: 10px; }
#map, .map { flex: 1; height: 100%; }
@media (max-width: 820px) {
  .mapwrap { flex-direction: column; }
  .side { order: 2; width: 100%; height: 46%; border-right: 0; border-top: 1px solid var(--line); }
  .mapwrap.side-min .side { height: 0; padding: 0; overflow: hidden; }
  #map { order: 1; min-height: 0; }
  .sidetoggle { display: flex !important; }
}
.sidetoggle { display: none; position: absolute; right: 10px; bottom: calc(46% + 10px); z-index: 900; }
.mapwrap.side-min .sidetoggle { bottom: 14px; }

.dcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 11px 12px; margin-bottom: 10px;
  border-left: 6px solid var(--gray); cursor: pointer; }
.dcard.sel { outline: 2px solid var(--primary); }
.dcard .nm { font-weight: 800; font-size: 16px; letter-spacing: .4px; text-transform: uppercase; }
.dcard .mt { color: var(--muted); font-size: 13px; }
.dcard .ln { font-size: 13.5px; margin-top: 3px; }
.dcard .today { font-size: 12.5px; color: var(--muted); margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; color: #fff; background: var(--gray); white-space: nowrap; }
.pill.verde { background: var(--green); } .pill.amarelo { background: var(--yellow); color: #222; } .pill.vermelho { background: var(--red); }
.pill.cinza { background: var(--gray); }
.st-enviada { background: #546e7a; } .st-recebida { background: #00838f; } .st-visualizada { background: #6a1b9a; }
.st-em_rota { background: #ef6c00; } .st-concluida { background: var(--green); } .st-cancelada { background: #8d6e63; }
.queue { margin: 6px 0 0; padding-left: 20px; font-size: 13px; }
.queue li { margin: 2px 0; }
.dest { background: rgba(21,101,192,.07); border-radius: 8px; padding: 6px 8px; margin-top: 6px; font-size: 13px; }

.drv-icon { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.45); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; position: relative; }
.drv-icon.off { filter: grayscale(.7); opacity: .75; }
.drv-icon .arrow { position: absolute; top: -12px; left: 50%; width: 0; height: 0; margin-left: -6px; border: 6px solid transparent;
  border-bottom: 9px solid currentColor; transform-origin: 6px 29px; }
.drv-label { position: absolute; top: 36px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.72); color: #fff; padding: 1px 6px;
  border-radius: 6px; font-size: 11.5px; white-space: nowrap; font-weight: 600; }
.ws-icon { font-size: 22px; line-height: 22px; text-align: center; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.dest-icon { font-size: 26px; line-height: 26px; text-align: center; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.leaflet-popup-content { font-size: 13.5px; margin: 10px 12px; }
.leaflet-popup-content h4 { margin: 0 0 4px; font-size: 15px; }
.wlist { max-height: 260px; overflow: auto; }
.witem { padding: 6px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13.5px; display: flex; justify-content: space-between; gap: 8px; }
.witem:hover { background: rgba(21,101,192,.06); }

/* nova entrega */
.nova { max-width: 640px; }
.minimap { height: 240px; border-radius: 10px; margin-top: 8px; border: 1px solid var(--line); }
.drvbtns { display: grid; gap: 8px; }
.drvbtn { display: flex; align-items: center; gap: 10px; text-align: left; border: 2px solid var(--line); background: var(--card); border-radius: 12px;
  padding: 12px; cursor: pointer; min-height: 64px; }
.drvbtn .dot { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.drvbtn.on { border-color: var(--primary); background: rgba(21,101,192,.08); box-shadow: 0 0 0 2px var(--primary) inset; }
.drvbtn b { font-size: 16px; }
.destbox { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 8px; background: rgba(46,125,50,.06); }
.preview img { max-width: 100%; max-height: 220px; border-radius: 8px; margin-top: 8px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 12px; cursor: pointer; }
.tabs button.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* tabelas */
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th, table.t td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 600; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
@media (max-width: 820px) {
  table.t.stack thead { display: none; }
  table.t.stack tr { display: block; background: var(--card); border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 10px; padding: 8px; }
  table.t.stack td { display: flex; gap: 8px; border: 0; padding: 3px 4px; }
  table.t.stack td::before { content: attr(data-l); min-width: 92px; color: var(--muted); font-size: 12px; }
}

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.kpi { background: var(--card); border-radius: 10px; box-shadow: var(--shadow); padding: 10px; }
.kpi b { display: block; font-size: 20px; }
.kpi span { color: var(--muted); font-size: 12px; }
.trajwrap { position: absolute; inset: 0; display: flex; }
.trajwrap .side { width: 360px; }
@media (max-width: 820px) { .trajwrap { flex-direction: column; } .trajwrap .side { order: 2; width: 100%; height: 50%; } }

.code { font-size: 44px; font-weight: 800; letter-spacing: 8px; text-align: center; font-family: ui-monospace, monospace; margin: 10px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.sched td { padding: 4px; }
.sched input[type=time] { width: 120px; }
.banner { background: #fff3cd; color: #5d4500; border: 1px solid #ffe08a; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.banner.err { background: #fde2e2; color: #7a1d1d; border-color: #f5b5b5; }

/* modal / toast */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 12px; }
.modal-box { background: var(--card); border-radius: 14px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 18px; position: relative; }
.modal-x { position: absolute; right: 8px; top: 8px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.modal-box img.full { width: 100%; border-radius: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--bottom) + 18px); transform: translateX(-50%); background: #263238; color: #fff;
  padding: 11px 18px; border-radius: 10px; z-index: 4000; box-shadow: 0 3px 12px rgba(0,0,0,.35); max-width: 92vw; }
.toast.err { background: var(--red); }
.login { max-width: 380px; margin: 8vh auto; }
.login .logo { text-align: center; }
.login .logo img { width: 84px; border-radius: 20px; }

/* ---------- perfil VENDEDOR (somente Nova Entrega): mesma identidade do app Entregas MP (escuro + ciano) ---------- */
.req { color: #f0706a; }
body.seller {
  --bg: #070b12; --card: #0e1624; --text: #f2f6fb; --muted: #8fa0b8; --line: #1e2b40; --primary: #00b4ff; --primary-d: #0086bf;
  --green: #3cc47a; --yellow: #f2b73d; --red: #f0706a; --gray: #5b6b82; --shadow: none; --top: 60px; --bottom: 0px;
  font-family: Figtree, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.sellertop { position: fixed; top: 0; left: 0; right: 0; height: 60px; z-index: 1000; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: #0e1624; border-bottom: 1px solid #1e2b40; }
.sellertop .brandrow { display: flex; align-items: center; gap: 10px; color: #00b4ff; letter-spacing: .14em; font-size: 13.5px; }
.sellertop img { width: 30px; height: 30px; border-radius: 9px; }
.sellertop .who { display: flex; align-items: center; gap: 10px; color: #8fa0b8; font-size: 13px; }
body.seller .page.nova { max-width: 560px; padding-bottom: 40px; }
body.seller .page.nova h2 { font-size: 26px; letter-spacing: -.01em; margin: 8px 0 14px; }
body.seller .card { border: 1px solid #1e2b40; border-radius: 20px; padding: 16px; }
body.seller input, body.seller select, body.seller textarea { background: #141f31; border: 1px solid #2c3e5a; border-radius: 14px; color: #f2f6fb; padding: 12px 14px; }
body.seller input:focus, body.seller textarea:focus { outline: none; border-color: #00b4ff; }
body.seller .btn { background: #141f31; border-color: #2c3e5a; color: #f2f6fb; border-radius: 14px; }
body.seller .btn.primary { background: #00b4ff; border-color: #00b4ff; color: #00121d; font-weight: 800; border-radius: 18px; box-shadow: 0 0 24px rgba(0,180,255,.28); }
body.seller .btn.primary:disabled { box-shadow: none; opacity: .4; }
body.seller .tabs button, body.seller .chip { background: #141f31; border: 1px solid #2c3e5a; color: #c3cedd; border-radius: 99px; padding: 8px 14px; }
body.seller .tabs button.on, body.seller .chip.on { background: #0b2a3f; border-color: #00b4ff; color: #00b4ff; font-weight: 700; }
body.seller .drvbtn { background: #0e1624; border: 2px solid #1e2b40; border-radius: 18px; color: #f2f6fb; }
body.seller .drvbtn.on { border-color: #00b4ff; background: #0b2a3f; box-shadow: none; }
body.seller .destbox { background: #0b2a3f; border-color: #1e2b40; }
body.seller .minimap { border-color: #1e2b40; border-radius: 18px; }
body.seller .muted, body.seller .small.muted { color: #8fa0b8; }
body.seller .chips { display: flex; gap: 8px; flex-wrap: wrap; }
body.seller .leaflet-tile-pane { filter: none; }
.okcard { background: #12301f; border: 1px solid #1e2b40; border-radius: 24px; text-align: center; padding: 32px 20px; margin-bottom: 14px; }
.okcard .okmark { width: 64px; height: 64px; border-radius: 50%; background: #3cc47a; color: #05140c; font-size: 34px; font-weight: 800; display: grid; place-items: center; margin: 0 auto 12px; }
.okcard h2 { margin: 0 0 4px; } .okcard p { margin: 0; color: #c3cedd; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips .chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 7px 14px; cursor: pointer; }
.chips .chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.moto-ic { vertical-align: -3px; margin-right: 4px; opacity: .85; }
.drv-icon svg { display: block; }
