/* Quarteiro Log — componentes e telas */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-base); line-height: 1.5;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
  touch-action: manipulation; transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
::selection { background: var(--brand-soft); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--text-2); } .dim { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: .92em; }
.nowrap { white-space: nowrap; } .grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: var(--s3); }
.row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.grid { display: grid; gap: var(--s4); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 15px; height: 15px; } .ico.lg { width: 22px; height: 22px; }

/* ── Botões ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 40px; padding: 0 var(--s4); border-radius: var(--r); border: 1px solid transparent;
  font-weight: 600; font-size: var(--fs-sm); cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast), border-color var(--t-fast), opacity var(--t-fast);
  background: var(--surface-2); color: var(--text); border-color: var(--line);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn.loading::after { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-primary { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 92%, #fff), var(--brand)); color: #fff; border-color: transparent; box-shadow: 0 6px 18px -6px var(--brand-line); }
.btn-primary:hover { background: var(--brand); filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-ok { background: var(--ok); color: #fff; border-color: transparent; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-lg { min-height: 52px; font-size: var(--fs-base); border-radius: var(--r-lg); padding: 0 var(--s6); }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm { min-height: 32px; padding: 0 var(--s3); font-size: var(--fs-xs); border-radius: var(--r-sm); }

/* ── Formulários ────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); outline: none; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s4); }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: var(--s2); cursor: pointer; font-size: var(--fs-sm); }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ── Cartões / KPI ──────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-pad { padding: var(--s5); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: var(--fs-md); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
@media (min-width: 768px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .kpis.k6 { grid-template-columns: repeat(6, 1fr); } }
.kpi { padding: var(--s4); position: relative; overflow: hidden; }
.kpi .lbl { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi .val { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: var(--fs-xs); color: var(--text-2); margin-top: 2px; }
.kpi.accent::after { content: ''; position: absolute; inset: auto -30px -30px auto; width: 90px; height: 90px; border-radius: 50%; background: var(--brand-soft); }

/* ── Badges / chips ─────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.b-requested { background: var(--warn-soft); color: var(--warn); }
.b-confirmed { background: var(--info-soft); color: var(--info); }
.b-routed, .b-planned, .b-dispatched { background: var(--brand-soft); color: var(--brand); }
.b-in_route, .b-in_progress, .b-arrived { background: var(--cold-soft); color: var(--cold); }
.b-delivered, .b-completed { background: var(--ok-soft); color: var(--ok); }
.b-failed, .b-cancelled { background: var(--danger-soft); color: var(--danger); }
.b-pending { background: var(--surface-3); color: var(--text-2); }
.chip-cold { background: var(--cold-soft); color: var(--cold); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* ── Tabela ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 10px var(--s4); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }
@media (max-width: 767px) {
  .table.cards thead { display: none; }
  .table.cards tr { display: block; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
  .table.cards td { display: flex; justify-content: space-between; gap: var(--s3); border: 0; padding: 4px 0; }
  .table.cards td::before { content: attr(data-l); color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; }
  .table.cards td.actions { justify-content: flex-end; padding-top: var(--s2); }
  .table.cards td.actions::before { display: none; }
}

/* ── Empty / skeleton ───────────────────────────────────── */
.empty { text-align: center; padding: var(--s10) var(--s5); color: var(--text-2); }
.empty .em-ico { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto var(--s4); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty h4 { color: var(--text); margin-bottom: 4px; font-size: var(--fs-md); }
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: var(--r-sm); min-height: 14px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Toasts / modal / banner ────────────────────────────── */
.toasts { position: fixed; z-index: var(--z-toast); left: 50%; transform: translateX(-50%); bottom: calc(var(--s5) + var(--safe-b) + 64px); display: flex; flex-direction: column; gap: var(--s2); width: min(420px, calc(100% - 32px)); pointer-events: none; }
@media (min-width: 1024px) { .toasts { left: auto; right: var(--s6); transform: none; bottom: var(--s6); } }
.toast { pointer-events: auto; display: flex; gap: var(--s3); align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: var(--fs-sm); animation: rise var(--t) var(--spring); }
.toast.ok { border-left: 3px solid var(--ok); } .toast.error { border-left: 3px solid var(--danger); } .toast.warn { border-left: 3px solid var(--warn); } .toast.info { border-left: 3px solid var(--info); }
.toast.out { opacity: 0; transform: translateY(8px); transition: all var(--t) var(--ease); }
.net-banner { position: fixed; z-index: var(--z-toast); top: 0; left: 0; right: 0; padding: calc(6px + var(--safe-t)) 16px 6px; background: var(--warn); color: #1a1205; text-align: center; font-size: var(--fs-xs); font-weight: 600; }

.modal-back { position: fixed; inset: 0; z-index: var(--z-modal); background: rgba(5,5,8,.6); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: fade var(--t) var(--ease); }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-lg); animation: rise var(--t-slow) var(--spring); padding-bottom: var(--safe-b); }
.modal::before { content: ''; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 10px auto 0; }
@media (min-width: 768px) {
  .modal-back { align-items: center; padding: var(--s6); }
  .modal { max-width: 640px; border-radius: var(--r-xl); }
  .modal.wide { max-width: 920px; }
  .modal::before { display: none; }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: var(--fs-lg); }
.modal-body { padding: var(--s5); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-foot { display: flex; gap: var(--s3); justify-content: flex-end; padding: var(--s4) var(--s5); border-top: 1px solid var(--line); }
.modal-foot .btn { min-width: 110px; }
@media (max-width: 767px) { .modal-foot .btn { flex: 1; } }

/* ── Shell do gestor ────────────────────────────────────── */
.shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .shell { grid-template-columns: 248px 1fr; } .shell.collapsed { grid-template-columns: 76px 1fr; } }
.sidebar { display: none; }
@media (min-width: 1024px) {
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: var(--s4) var(--s3); border-right: 1px solid var(--line); background: var(--bg-2); }
}
.brand { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s2) var(--s5); }
.brand-logo { width: 38px; height: 38px; border-radius: 12px; flex: none; background: url('/assets/icons/icon-96.png') center/cover; box-shadow: 0 6px 16px -6px var(--brand-line); }
.brand b { display: block; font-size: var(--fs-base); letter-spacing: -.01em; }
.brand small { color: var(--text-3); font-size: var(--fs-xs); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: var(--s3); padding: 10px 12px; border-radius: var(--r); color: var(--text-2); font-weight: 500; font-size: var(--fs-sm); position: relative; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--brand-soft); color: var(--brand); }
.nav a .count { margin-left: auto; background: var(--brand); color: #fff; border-radius: var(--r-full); font-size: 11px; padding: 1px 7px; font-weight: 700; }
.nav .sep { height: 1px; background: var(--line); margin: var(--s3) var(--s2); }
.shell.collapsed .brand div, .shell.collapsed .nav a span, .shell.collapsed .nav a .count, .shell.collapsed .side-foot .who { display: none; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s2) 0; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: var(--fs-xs); flex: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: var(--z-nav); display: flex; align-items: center; gap: var(--s3); padding: calc(var(--s3) + var(--safe-t)) var(--s4) var(--s3); background: var(--glass); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: var(--fs-lg); font-weight: 700; }
.page { padding: var(--s4); padding-bottom: calc(96px + var(--safe-b)); display: flex; flex-direction: column; gap: var(--s4); animation: rise var(--t) var(--ease); }
@media (min-width: 768px) { .page { padding: var(--s6); } }
@media (min-width: 1024px) { .page { padding-bottom: var(--s8); } }
.bottom-nav { position: fixed; z-index: var(--z-nav); left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + var(--safe-b)); background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
@media (min-width: 1024px) { .bottom-nav { display: none; } }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: var(--r); color: var(--text-3); font-size: 10.5px; font-weight: 600; min-height: 48px; justify-content: center; }
.bottom-nav a.on { color: var(--brand); }
.split { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
@media (min-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr) 380px; } .split.wide-side { grid-template-columns: minmax(0, 1fr) 440px; } }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ── Mapa ───────────────────────────────────────────────── */
.map { width: 100%; height: 100%; min-height: 320px; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); z-index: var(--z-map); }
.map-card { height: 62vh; min-height: 380px; padding: 0; overflow: hidden; position: relative; }
.map-card .map { border-radius: 0; height: 100%; }
.leaflet-container { font-family: var(--font); background: var(--bg-2); }
/* Tema escuro do mapa a partir dos tiles claros do OSM */
.map-dark .leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) brightness(.92) contrast(.88) saturate(.55); }
.map-dark.leaflet-container { background: #1a1b1f; }
.login-roles svg { display: block; }
.leaflet-control-attribution { font-size: 10px !important; background: var(--glass) !important; color: var(--text-3) !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-bar a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.leaflet-popup-content { margin: 12px 14px; font-size: var(--fs-sm); }
.mk-truck { width: 46px; height: 46px; position: relative; }
.mk-truck .halo { position: absolute; inset: 0; border-radius: 50%; background: var(--c, var(--brand)); opacity: .25; animation: pulse 2s ease-out infinite; }
.mk-truck .body { position: absolute; inset: 7px; border-radius: 50%; background: var(--c, var(--brand)); border: 3px solid #fff; box-shadow: 0 6px 16px rgba(0,0,0,.35); display: grid; place-items: center; }
.mk-truck .arrow { position: absolute; inset: 0; transition: transform .6s var(--ease); }
.mk-truck .arrow::before { content: ''; position: absolute; left: 50%; top: -3px; transform: translateX(-50%); border: 7px solid transparent; border-bottom: 10px solid var(--c, var(--brand)); filter: drop-shadow(0 -1px 0 #fff); }
.mk-truck svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mk-truck.stale .body { filter: grayscale(.8); } .mk-truck.stale .halo { display: none; }
.mk-stop { width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--c, var(--brand)); border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.3); display: grid; place-items: center; }
.mk-stop b { transform: rotate(45deg); color: #fff; font-size: 12px; font-weight: 800; }
.mk-stop.delivered { background: var(--ok); } .mk-stop.failed { background: var(--danger); } .mk-stop.late { box-shadow: 0 0 0 3px var(--warn); }
.mk-depot { width: 36px; height: 36px; border-radius: 12px; background: #17151A; border: 2px solid var(--brand); display: grid; place-items: center; box-shadow: 0 6px 14px rgba(0,0,0,.35); }
.mk-depot svg { width: 18px; height: 18px; stroke: var(--brand); fill: none; stroke-width: 2; }
.mk-dest { width: 22px; height: 22px; position: relative; }
.mk-dest::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--brand); opacity: .35; animation: pulse 1.8s ease-out infinite; }
.mk-dest::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #fff; border: 4px solid var(--brand); }
.map-legend { position: absolute; z-index: 600; left: 56px; top: 12px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 70px); }
.map-legend .chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--r-full); background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--line); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; }

/* ── Lista de rotas / alertas ───────────────────────────── */
.route-card { padding: var(--s4); border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--t-fast); }
.route-card:last-child { border-bottom: 0; }
.route-card:hover { background: var(--surface-2); }
.route-card .bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-top: var(--s2); }
.route-card .bar i { display: block; height: 100%; border-radius: 6px; background: var(--c, var(--brand)); transition: width var(--t-slow) var(--ease); }
.stops-mini { display: flex; gap: 3px; margin-top: var(--s2); flex-wrap: wrap; }
.stops-mini i { width: 14px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.stops-mini i.delivered { background: var(--ok); } .stops-mini i.failed { background: var(--danger); } .stops-mini i.arrived { background: var(--cold); } .stops-mini i.late { background: var(--warn); }
.alert { display: flex; gap: var(--s3); padding: 10px var(--s4); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); align-items: flex-start; }
.alert:last-child { border-bottom: 0; }
.alert .ai { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; }
.alert.danger .ai { background: var(--danger-soft); color: var(--danger); }
.alert.warning .ai { background: var(--warn-soft); color: var(--warn); }
.alert.info .ai { background: var(--info-soft); color: var(--info); }
.plan-route { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.plan-route + .plan-route { margin-top: var(--s3); }
.plan-route header { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--surface-2); }
.plan-route .metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); font-size: var(--fs-xs); }
.plan-route .metrics b { display: block; font-size: var(--fs-base); font-variant-numeric: tabular-nums; }
.plan-stop { display: flex; align-items: center; gap: var(--s3); padding: 8px var(--s4); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.plan-stop:last-child { border-bottom: 0; }
.plan-stop .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font-size: 11px; font-weight: 800; flex: none; }
.plan-stop select { max-width: 120px; min-height: 30px; padding: 2px 6px; font-size: var(--fs-xs); }
.meter { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ok); }
.meter i.hi { background: var(--warn); } .meter i.over { background: var(--danger); }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: var(--s3); }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.chart .bar2 { width: 100%; max-width: 28px; border-radius: 6px 6px 2px 2px; background: var(--surface-3); position: relative; overflow: hidden; min-height: 2px; }
.chart .bar2 i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--brand); border-radius: inherit; }
.chart small { font-size: 10px; color: var(--text-3); }

/* ── Login ──────────────────────────────────────────────── */
.page-login { min-height: 100vh; display: grid; place-items: center; padding: var(--s6) var(--s4);
  background-image: radial-gradient(60% 50% at 85% 0%, var(--brand-soft), transparent 60%), radial-gradient(50% 40% at 0% 100%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 60%); }
.login-card { width: 100%; max-width: 400px; padding: var(--s8) var(--s6); }
.login-card h1 { font-size: var(--fs-xl); margin: var(--s5) 0 6px; }
.login-roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-top: var(--s6); }
.login-roles div { text-align: center; padding: var(--s3) var(--s2); border-radius: var(--r); background: var(--surface-2); font-size: 11px; color: var(--text-2); }
.login-roles svg { margin: 0 auto 4px; color: var(--brand); }

/* ── App do motorista ───────────────────────────────────── */
.page-driver { overscroll-behavior: none; }
.drv { min-height: 100vh; display: flex; flex-direction: column; }
.drv-top { position: sticky; top: 0; z-index: var(--z-nav); display: flex; align-items: center; gap: var(--s3); padding: calc(10px + var(--safe-t)) var(--s4) 10px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.gps { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--r-full); font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.gps i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.gps.on { background: var(--ok-soft); color: var(--ok); } .gps.on i { background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: blink 1.6s infinite; }
.gps.weak { background: var(--warn-soft); color: var(--warn); } .gps.weak i { background: var(--warn); }
.gps.off { background: var(--danger-soft); color: var(--danger); } .gps.off i { background: var(--danger); }
@keyframes blink { 50% { opacity: .35; } }
.drv-map { height: 34vh; min-height: 220px; position: relative; }
.drv-map .map { border-radius: 0; min-height: 0; }
.drv-body { flex: 1; padding: var(--s4); padding-bottom: calc(var(--s8) + var(--safe-b)); display: flex; flex-direction: column; gap: var(--s4); margin-top: -18px; position: relative; z-index: 2; background: var(--bg); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.next-card { padding: var(--s5); border: 1px solid var(--brand-line); background: linear-gradient(180deg, var(--brand-soft), transparent 70%), var(--surface); }
.next-card h2 { font-size: var(--fs-xl); margin: 4px 0; }
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s4); }
.big-actions .btn { min-height: 56px; font-size: var(--fs-base); border-radius: var(--r-lg); }
.big-actions .full { grid-column: 1 / -1; }
.stop-item { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); align-items: center; }
.stop-item:last-child { border-bottom: 0; }
.stop-item .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 800; font-size: var(--fs-xs); flex: none; }
.stop-item.delivered .n { background: var(--ok); color: #fff; } .stop-item.failed .n { background: var(--danger); color: #fff; } .stop-item.current .n { background: var(--brand); color: #fff; }
.stop-item.delivered, .stop-item.failed { opacity: .6; }
.sig-pad { width: 100%; height: 180px; border-radius: var(--r); border: 1px dashed var(--line-2); background: #fff; touch-action: none; display: block; }
.photo-drop { display: grid; place-items: center; gap: 6px; min-height: 140px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--bg-2); color: var(--text-2); cursor: pointer; text-align: center; overflow: hidden; position: relative; }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.temp-input { display: flex; align-items: center; gap: var(--s2); }
.temp-input .input { font-size: var(--fs-lg); font-weight: 700; text-align: center; }
.queue-pill { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: var(--r-full); background: var(--warn-soft); color: var(--warn); }

/* ── Rastreio do cliente (estilo Uber) ──────────────────── */
.page-track { overflow: hidden; height: 100vh; height: 100dvh; }
.trk { position: fixed; inset: 0; }
.trk .map { position: absolute; inset: 0; border-radius: 0; min-height: 0; }
.trk-top { position: absolute; z-index: 700; top: calc(12px + var(--safe-t)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; gap: var(--s2); pointer-events: none; }
.trk-top > * { pointer-events: auto; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-full); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 700; box-shadow: var(--shadow); }
.pill .brand-logo { width: 22px; height: 22px; border-radius: 7px; }
.sheet { position: absolute; z-index: var(--z-sheet); left: 0; right: 0; bottom: 0; max-height: 78vh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: 0 -12px 40px rgba(0,0,0,.35); transition: transform var(--t-slow) var(--ease); padding-bottom: var(--safe-b); }
@media (min-width: 768px) { .sheet { left: 24px; right: auto; bottom: 24px; width: 400px; border-radius: var(--r-xl); max-height: calc(100vh - 48px); } }
.sheet-grip { padding: 10px 0 4px; cursor: grab; touch-action: none; }
.sheet-grip::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 5px; background: var(--line-2); margin: 0 auto; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px var(--s5) var(--s5); }
.sheet.collapsed { transform: translateY(calc(100% - 214px - var(--safe-b))); }
.sheet.collapsed .sheet-body { overflow: hidden; }
@media (min-width: 768px) { .sheet.collapsed { transform: none; } }
.eta-big { display: flex; align-items: baseline; gap: var(--s2); }
.eta-big .num { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.eta-big .unit { font-size: var(--fs-md); font-weight: 600; color: var(--text-2); }
.trk-headline { font-size: var(--fs-lg); font-weight: 700; }
.progress-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: var(--s4) 0 6px; }
.progress-steps i { height: 5px; border-radius: 5px; background: var(--surface-3); position: relative; overflow: hidden; }
.progress-steps i.on { background: var(--brand); }
.progress-steps i.now::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: sweep 1.6s infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.progress-labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: 10.5px; color: var(--text-3); font-weight: 600; }
.progress-labels span.on { color: var(--text); }
.driver-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) 0; border-top: 1px solid var(--line); margin-top: var(--s4); }
.driver-row .avatar { width: 48px; height: 48px; font-size: var(--fs-md); background: var(--brand-soft); color: var(--brand); }
.plate { font-family: var(--mono); font-weight: 700; font-size: var(--fs-xs); padding: 3px 8px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--line-2); letter-spacing: .06em; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 var(--s4) 22px; font-size: var(--fs-sm); }
.tl li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.tl li::after { content: ''; position: absolute; left: 7px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl time { display: block; color: var(--text-3); font-size: var(--fs-xs); }
.section-title { font-size: var(--fs-xs); font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin: var(--s5) 0 var(--s3); }
.proof { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.proof img { border-radius: var(--r); aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); width: 100%; }
.done-hero { text-align: center; padding: var(--s4) 0; }
.done-hero .check-big { width: 64px; height: 64px; margin: 0 auto var(--s3); border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; animation: rise var(--t-slow) var(--spring); }

/* ── Portal da hamburgueria ─────────────────────────────── */
.portal { max-width: 760px; margin: 0 auto; padding: calc(var(--s4) + var(--safe-t)) var(--s4) calc(var(--s10) + var(--safe-b)); display: flex; flex-direction: column; gap: var(--s4); }
.hero-live { padding: var(--s5); background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero-live::after { content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero-live .btn { background: #fff; color: var(--brand-2); border: 0; }
.order-card { padding: var(--s4); }
.order-card + .order-card { border-top: 1px solid var(--line); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.qty button { width: 38px; height: 38px; border: 0; background: var(--surface-2); font-size: 18px; cursor: pointer; }
.qty input { width: 52px; height: 38px; border: 0; text-align: center; background: var(--bg-2); font-weight: 700; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
