/* BahiaSat PWA — cores iguais ao app nativo */
:root {
  --teal: #0E7490; --teal-dark: #0A566B; --teal-btn: #0F9F97; --teal-btn2: #2BB8AE;
  --red: #E2231A; --navy: #1E3A8A; --ink: #0F2A33; --muted: #52646C;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bot: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color: var(--ink); background: #EAF6F4; overscroll-behavior: none; }
button { font: inherit; cursor: pointer; }
#app { height: 100%; }
[hidden] { display: none !important; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(110px + var(--safe-bot)); transform: translate(-50%, 20px); max-width: 86vw;
  background: rgba(15,42,51,.92); color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 1000; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- login ---------- */
.login { min-height: 100%; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center;
  padding: calc(64px + var(--safe-top)) 28px calc(28px + var(--safe-bot));
  background: linear-gradient(180deg, #EAF6F4, #F4F9F9); }
.login-glow { position: absolute; top: -120px; left: 50%; width: 520px; height: 420px; margin-left: -260px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(43,184,174,.22), rgba(43,184,174,0)); pointer-events: none; }
.logo-card { position: relative; width: 250px; height: 140px; border-radius: 22px; padding: 2px;
  background: linear-gradient(135deg, #22D3EE, var(--teal)); box-shadow: 0 10px 28px rgba(14,116,144,.18); }
.logo-inner { height: 100%; border-radius: 20px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.logo-name { font-size: 28px; font-weight: 800; letter-spacing: -.5px; color: var(--teal-dark); }
.logo-name span { color: var(--teal-btn); }
.logo-sub { font-size: 11px; font-weight: 600; letter-spacing: 1.6px; color: #5B6B73; }
.login h1 { position: relative; margin: 34px 0 4px; font-size: 24px; font-weight: 800; }
.login-hint { position: relative; margin: 0 0 26px; font-size: 14px; color: var(--muted); }
.login-form { position: relative; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #34474F; }
.field { height: 54px; border-radius: 14px; background: #fff; border: 1.5px solid #D3E2E4; display: flex; align-items: center; gap: 10px;
  padding: 0 8px 0 14px; color: #7C8B93; transition: border-color .15s, box-shadow .15s; }
.field:focus-within { border: 2px solid var(--teal-btn); box-shadow: 0 0 0 4px rgba(15,159,151,.12); color: var(--teal-btn); }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; font: 500 16px Inter, sans-serif; color: var(--ink); background: transparent; }
.eye { width: 44px; height: 44px; border: 0; background: transparent; color: #7C8B93; display: flex; align-items: center; justify-content: center; }
.remember { display: flex; align-items: center; justify-content: space-between; padding: 2px; font-size: 14px; font-weight: 600; color: #34474F; }
.switch { width: 48px; height: 28px; border-radius: 14px; border: 0; background: #C9D6D9; position: relative; padding: 0; transition: background .2s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .2s; }
.switch[aria-checked="true"] { background: var(--teal-btn); }
.switch[aria-checked="true"] span { left: 23px; }
.btn-enter { height: 54px; border: 0; border-radius: 14px; background: linear-gradient(90deg, var(--teal-btn), var(--teal-btn2)); color: #fff;
  font-weight: 800; font-size: 16px; letter-spacing: 1.2px; box-shadow: 0 8px 20px rgba(15,159,151,.30); }
.btn-enter:disabled { opacity: .7; }
.or { display: flex; align-items: center; gap: 12px; color: #7C8B93; font-size: 13px; }
.or span { flex: 1; height: 1px; background: #D3E2E4; }
.btn-finger { height: 52px; border-radius: 14px; border: 1.5px solid var(--teal-btn); background: #fff; color: var(--teal-dark);
  font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.secure { position: relative; margin-top: auto; padding-top: 24px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--teal-dark); }
.secure span { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; }

/* ---------- mapa ---------- */
.map-screen { position: fixed; inset: 0; overflow: hidden; }
.map { position: absolute; inset: 0; background: #E5E9E4; }
.top { position: absolute; top: calc(14px + var(--safe-top)); left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.top > * { pointer-events: auto; }
.fab { width: 46px; height: 46px; flex: none; border-radius: 14px; border: 0; background: #fff; box-shadow: 0 4px 14px rgba(15,42,51,.18);
  display: flex; align-items: center; justify-content: center; margin-left: 0; }
.fab.teal { background: var(--teal); box-shadow: 0 4px 14px rgba(14,116,144,.35); margin-left: auto; }
.fab.teal.on { background: #22C55E; }
.name-card { position: absolute; left: 50%; transform: translateX(-50%); max-width: calc(100% - 132px); min-width: 0; height: 38px; border-radius: 19px; background: #fff; color: #1F6E80; display: flex; align-items: center;
  justify-content: center; padding: 0 20px; font-size: 15.5px; font-weight: 700; letter-spacing: .4px; box-shadow: 0 2px 8px rgba(15,42,51,.16); }
.nc-dot { display: none; }
.nc-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-menu { position: absolute; right: 12px; bottom: calc(98px + var(--safe-bot)); width: 52px; border-radius: 26px; background: #fff;
  box-shadow: 0 6px 18px rgba(15,42,51,.2); display: flex; flex-direction: column-reverse; align-items: center; padding: 4px 0; }
.side-menu button { width: 48px; height: 46px; border: 0; background: transparent; color: var(--teal-dark); display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.side-menu button:active { background: #E6F2F3; }
.sm-items { display: flex; flex-direction: column; align-items: center; }
.sm-toggle { height: 44px !important; border-radius: 50% !important; }

.addr-bar { position: absolute; left: 12px; right: 12px; bottom: calc(18px + var(--safe-bot)); min-height: 62px; border-radius: 24px;
  background: linear-gradient(90deg, #1E40AF, #1E3A8A); color: #fff; text-decoration: none; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; box-shadow: 0 8px 20px rgba(30,58,138,.4); }
.addr-text { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(255,255,255,.95); padding: 12px 18px;
  border-radius: 14px; font-weight: 600; font-size: 14px; color: var(--teal-dark); box-shadow: 0 6px 18px rgba(15,42,51,.18); }

/* velocímetro */
.speed-dial { position: absolute; left: 12px; bottom: calc(104px + var(--safe-bot)); width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #1D4274, #0A1730); border: 3px solid #fff; box-shadow: 0 8px 22px rgba(10,23,48,.45); color: #fff; }
.speed-dial svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.speed-dial path { fill: none; stroke-linecap: round; }
.speed-dial .track { stroke: #3A5BC9; stroke-width: 9; opacity: .55; }
.speed-dial .glow { stroke: var(--sd); stroke-width: 16; opacity: .3; }
.speed-dial .fill { stroke: var(--sd); stroke-width: 9; }
.sd-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.sd-num { font-size: 26px; font-weight: 800; font-style: italic; }
.sd-unit { font-size: 11px; font-weight: 600; color: #9FB3CC; }
.sd-time, .sd-date { font-size: 9px; font-weight: 600; color: #D6E2F0; }
.sd-odo { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); white-space: nowrap; background: #0A1730; border: 2px solid #fff;
  border-radius: 10px; padding: 2px 8px; font-size: 10px; font-weight: 800; letter-spacing: .5px; }

/* marcadores */
.veh-layer { position: absolute; left: 0; top: 0; }
.veh { position: absolute; left: 0; top: 0; width: 0; height: 0; padding: 0; border: 0; background: none; will-change: transform; }
.veh .pic { position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.veh .pic img, .veh .pic .arrow { max-width: 40px; max-height: 40px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.veh .arrow { width: 30px; height: 30px; }
.veh .dot { position: absolute; left: 10px; top: -22px; width: 11px; height: 11px; border-radius: 50%; background: var(--st); border: 2px solid #fff; }
.veh.sel { z-index: 5; }
.veh .pic.big { left: -30px; top: -30px; width: 60px; height: 60px; }
.veh .pic.big img, .veh .pic.big .arrow { max-width: 60px; max-height: 60px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
.veh .pic.big .arrow { width: 42px; height: 42px; }
.veh .drop { position: absolute; left: -32px; top: -78px; width: 64px; height: 64px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--st); box-shadow: 0 6px 16px rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; }
.veh .drop-in { transform: rotate(45deg); width: 50px; height: 50px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.veh .drop-in img, .veh .drop-in .arrow { max-width: 38px; max-height: 38px; }
.veh .pin-ph { position: absolute; left: -32px; top: -82px; width: 64px; height: 82px; }
.veh .pin-ph svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 1px 1.5px rgba(255,255,255,.9)); }
.veh .pin-ph path { fill: rgba(255,255,255,.18); stroke: #111; stroke-width: 3.2; stroke-linejoin: round; }
.veh .pin-ph img { position: absolute; left: 11px; top: 12px; width: 42px; height: 36px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.veh .drop-shadow { position: absolute; left: -7px; top: -4px; width: 14px; height: 6px; border-radius: 50%; background: rgba(0,0,0,.28); }
.cluster { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #fff; background: var(--navy);
  color: #fff; font-weight: 800; font-size: 16px; box-shadow: 0 4px 12px rgba(30,58,138,.4); padding: 0; }
.cluster.big { left: -30px; top: -30px; width: 60px; height: 60px; font-size: 17px; }

/* menu lateral (drawer) */
.scrim { position: absolute; inset: 0; background: rgba(10,23,48,.45); z-index: 20; }
.drawer { position: absolute; top: 0; bottom: 0; left: 0; width: min(380px, calc(100vw - 44px)); background: #F4F7FA; z-index: 21; display: flex; flex-direction: column;
  box-shadow: 8px 0 28px rgba(0,0,0,.25); animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(-100%); } }
.dr-tabs { display: flex; background: #fff; border-bottom: 1px solid #E2E8F0; padding-top: var(--safe-top); flex: none; }
.dr-tabs button { flex: 1; border: 0; background: none; height: 50px; font-size: 14px; font-weight: 700; color: #64748B; border-bottom: 3px solid transparent;
  display: flex; align-items: center; justify-content: center; }
.dr-tabs button[data-tab="search"] { flex: 0 0 64px; }
.dr-tabs button.on { color: var(--teal); border-bottom-color: var(--teal); }
.dr-nav, .dr-dev { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dr-head { position: relative; background: linear-gradient(135deg, var(--teal), var(--teal-dark)); color: #fff; padding: 20px; }
.dr-x { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; }
.dr-x:active { background: rgba(255,255,255,.3); }
.dr-logo { display: flex; align-items: center; gap: 8px; font-size: 22px; }
.dr-user { margin-top: 6px; font-size: 13px; opacity: .85; overflow: hidden; text-overflow: ellipsis; }
.nav-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.nav-list button { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 14px; border: 0; border-radius: 14px; background: #fff;
  font-size: 15px; font-weight: 700; color: var(--ink); text-align: left; box-shadow: 0 1px 3px rgba(15,42,51,.06); }
.nav-list button span { flex: 1; }
.nav-list button:active { background: #E6F2F3; }
.dr-logout { margin: 8px 16px calc(16px + var(--safe-bot)); height: 48px; border-radius: 14px; border: 1.5px solid #F4C7C5; background: #FFF5F5; color: var(--red);
  font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; flex: none; }

/* SUA FROTA */
.fl-head { flex: none; display: flex; align-items: center; gap: 4px; padding: calc(8px + var(--safe-top)) 6px 8px; background: linear-gradient(135deg, #13306A, #0B1E3F); color: #fff; }
.fl-head button { border: 0; color: #fff; background: none; padding: 0; }
.fl-all { font-size: 12.5px; font-weight: 800; letter-spacing: .4px; display: flex; align-items: center; gap: 5px; padding: 5px 6px !important; border-radius: 10px; white-space: nowrap; }
.fl-all b { background: #fff; color: #0B1E3F; border-radius: 8px; padding: 1px 6px; font-size: 12px; }
.fl-chip { display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 7px !important; border-radius: 14px; background: rgba(255,255,255,.12) !important; font-size: 12.5px; font-weight: 800; }
.fl-all.on, .fl-chip.on { box-shadow: inset 0 0 0 2px #fff; }
.fl-dot { width: 9px; height: 9px; border-radius: 50%; position: relative; }
.fl-dot.run { background: #22C55E; animation: run 1.2s ease-in-out infinite; }
.fl-dot.stop { background: #F59E0B; animation: blink 2s ease-in-out infinite; }
.fl-dot.off { background: #EF4444; }
.fl-dot.run::after, .fl-dot.off::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: ping 1.6s ease-out infinite; }
.fl-dot.run::after { color: #22C55E; } .fl-dot.off::after { color: #EF4444; animation-duration: 2.4s; }
@keyframes run { 0%,100% { transform: translateX(-1.5px); } 50% { transform: translateX(1.5px); } }
@keyframes blink { 50% { opacity: .45; } }
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
.fl-upd { margin-left: auto; font-size: 19px; font-weight: 700; opacity: .9; white-space: nowrap; padding: 0 4px !important; line-height: 1; }
.fl-opts { flex: none; width: 28px; height: 30px; display: flex; align-items: center; justify-content: center; }
.fl-optmenu, .vc-menu { position: absolute; z-index: 5; background: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(11,30,63,.28); padding: 6px; min-width: 190px; }
.fl-optmenu { right: 10px; top: calc(52px + var(--safe-top)); }
.fl-tab { flex: none; width: 32px; height: 32px; border-radius: 10px !important; display: grid; place-items: center; background: rgba(255,255,255,.1) !important; }
.fl-tab.on { background: var(--teal-btn) !important; box-shadow: 0 0 0 2px rgba(255,255,255,.5); }
.fl-opt-title { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: #64748B; padding: 6px 10px 4px; }
.fl-optmenu button, .fl-optmenu label, .vc-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 10px; border: 0; background: none;
  border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--ink); text-align: left; }
.fl-optmenu button.on { color: var(--teal); background: #E6F4F7; }
.fl-optmenu label { border-top: 1px solid #EEF2F3; border-radius: 0; margin-top: 4px; }
.fl-optmenu input { width: 18px; height: 18px; accent-color: var(--teal); }
.vc-menu button:active, .fl-optmenu button:active { background: #E6F2F3; }
.fl-search[hidden] { display: none; }
.fl-search { flex: none; margin: 10px 10px 0; height: 44px; border-radius: 12px; background: #fff; border: 1px solid #E2E8F0; display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.fl-search:focus-within { border-color: var(--teal-btn); box-shadow: 0 0 0 3px rgba(15,159,151,.12); }
.fl-search input { flex: 1; min-width: 0; border: 0; outline: none; font: 500 15px Inter, sans-serif; background: none; color: var(--ink); }
.fl-list { flex: 1; overflow-y: auto; padding: 10px 10px calc(14px + var(--safe-bot)); display: flex; flex-direction: column; gap: 6px; }
.fl-group { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: #64748B; padding: 6px 4px 0; text-transform: uppercase; }
.fl-empty { text-align: center; color: #64748B; font-size: 14px; }

/* cartão do veículo */
.vc { position: relative; flex: none; border-radius: 15px; overflow: hidden; box-shadow: 0 6px 16px rgba(29,78,216,.28), 0 2px 4px rgba(11,30,63,.12); background: #fff; }
.vc-top { display: flex; align-items: center; gap: 0; padding: 5px 6px 4px 2px; min-height: 58px; color: #fff;
  position: relative;
  background: linear-gradient(165deg, #2F6BFF 0%, #1D4ED8 50%, #1838B8 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -8px 14px rgba(8,20,80,.35); }
.vc.st-offline .vc-top, .vc.st-never .vc-top { background: linear-gradient(165deg, #5B85F0, #3F66D6 60%, #3556C4); }
.vc-sel { position: absolute; left: 4px; top: 4px; z-index: 2; width: 17px; height: 17px; padding: 0; border-radius: 50%; border: 2px solid #0B1E3F;
  background: rgba(11,30,63,.35); display: grid; place-items: center; box-shadow: 0 0 0 1.5px rgba(255,255,255,.55) inset; }
.vc-sel[aria-pressed="true"] { background: #22C55E; box-shadow: none; }
.vc-ph { flex: none; width: 42px; height: 34px; margin: 15px 0 0; align-self: flex-start; border: 0; background: none; padding: 0 0 0 4px; display: flex; align-items: center; justify-content: flex-start; }
.vc-ph img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 4px 5px rgba(0,0,0,.3)); }
.vc-ph.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; border: 2px solid rgba(255,255,255,.8); filter: none; }
.vc-sel[aria-pressed="false"] ~ .vc-top .vc-ph img { opacity: .55; }
.vc-main { flex: 1; min-width: 0; border: 0; background: none; color: #fff; padding: 1px 0 0 4px; text-align: left; display: flex; flex-direction: column; gap: 3px; }
.vc-name { font-weight: 800; font-size: 14px; letter-spacing: .4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; padding-left: 2px; line-height: 1.1; }
.vc-p { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.9); min-width: 0; }
.vc-p svg { flex: none; }
.vc-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-pw { flex: none; display: flex; color: rgba(255,255,255,.45); margin-right: 4px; }
.vc-pw.on { color: #4ADE80; }
.vc-pl { font-size: 11.5px; opacity: .75; margin-top: -4px; padding-left: 2px; }
.vc-g { flex: none; position: relative; width: 54px; height: 54px; text-align: center; }
.vc-g svg { position: absolute; left: 2px; top: 0; width: 50px; height: 40px; }
.vc-g path { fill: none; stroke-linecap: round; }
.vc-g .tr { stroke: rgba(255,255,255,.16); stroke-width: 5; }
.vc-g .gl { stroke: var(--st); stroke-width: 9; opacity: .3; }
.vc-g .fi { stroke: var(--st); stroke-width: 5; }
.vc-g .dt { fill: #60A5FA; }
.vc-g b { position: absolute; left: 0; right: 0; top: 9px; font-size: 16px; font-weight: 800; font-style: italic; line-height: 1; }
.vc-g small { position: absolute; left: -12px; right: -12px; top: 30px; font-size: 8px; font-weight: 600; opacity: .85; white-space: nowrap; }
.vc-odo { position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; display: flex; gap: 2px; padding: 2px 3px; border-radius: 5px; background: #0B0F19; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.vc-odo i { font-style: normal; font: 800 8.5px/1 ui-monospace, Menlo, monospace; color: #fff; background: linear-gradient(#2A2F3A, #111); border-radius: 2px; width: 8.5px; padding: 1px 0; }
.vc-odo i.dec { background: linear-gradient(#EF4444, #B91C1C); }
.vc-odo.wait i { opacity: .5; }
.vc-bot { display: flex; align-items: center; gap: 5px; padding: 3px 2px 3px 10px; font-size: 11.5px; font-weight: 500; color: #1E293B; }
.vc-a { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-more { flex: none; width: 30px; height: 24px; border: 0; background: none; display: flex; align-items: center; justify-content: center; border-radius: 8px; }

/* detalhe do veículo */
.detail { position: absolute; left: 0; right: 0; bottom: 0; height: calc(100% - 64px - var(--safe-top)); z-index: 15; background: #F4F7FA; border-radius: 26px 26px 0 0;
  box-shadow: 0 -8px 28px rgba(0,0,0,.25); display: flex; flex-direction: column; transform: translateY(42%); transition: transform .25s ease; animation: up .25s ease-out; }
.detail.full { transform: translateY(0); }
.detail.drag { transition: none; }
.dt-grab { flex: none; height: 26px; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; }
.dt-grab span { width: 44px; height: 5px; border-radius: 3px; background: #CBD5E1; }
.dt-body { flex: 1; overflow-y: auto; padding: 0 12px calc(24px + 42vh + var(--safe-bot)); overscroll-behavior: contain; }
.detail.full .dt-body { padding-bottom: calc(24px + var(--safe-bot)); }
/* detalhe aberto dentro da lista (quando só há um veículo) */
.detail.inline { position: static; height: auto; transform: none; animation: none; transition: none; box-shadow: none; background: transparent; border-radius: 0; z-index: auto; }
.detail.inline .dt-grab, .detail.inline .dt-hero { display: none; }
.detail.inline .dt-body { overflow: visible; padding: 0; }
.fl-single { margin-top: -2px; }
.dt-hero { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: linear-gradient(135deg, #1E40AF, #0B1E3F); color: #fff; position: relative; }
.dt-ph { flex: none; width: 66px; height: 66px; border-radius: 14px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 6px; }
.dt-ph img { max-width: 100%; max-height: 100%; }
.dt-ph.photo { padding: 0; overflow: hidden; }
.dt-ph.photo img { width: 100%; height: 100%; object-fit: cover; }
.dt-hd { flex: 1; min-width: 0; }
.dt-hd h2 { margin: 0; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 30px; }
.dt-hd p { margin: 3px 0 0; font-size: 12px; opacity: .8; }
.dt-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700;
  background: color-mix(in srgb, var(--st) 22%, transparent); color: color-mix(in srgb, var(--st) 55%, #fff); }
.dt-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
.dt-x { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; }
.dt-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 12px 0; }
.dt-stats div { background: #fff; border-radius: 12px; padding: 10px 4px; text-align: center; box-shadow: 0 1px 4px rgba(15,42,51,.06); }
.dt-stats b { display: block; font-size: 16px; font-weight: 800; color: #0B1E3F; white-space: nowrap; }
.dt-stats small { display: block; margin-top: 2px; font-size: 10.5px; color: #64748B; }
.dt-wait { color: #94A3B8; animation: blink 1.2s infinite; }
.dt-sec { background: #fff; border-radius: 14px; padding: 12px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(15,42,51,.06); }
.dt-sec h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: 1px; color: var(--teal-dark); }
.dt-addr { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; }
.dt-meta { margin: 4px 0 0; font-size: 12px; color: #64748B; }
.dt-btns { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.dt-sec h3 + .dt-btns { margin-top: 0; }
.dt-btn { flex: 1 1 0; min-width: 76px; min-height: 52px; border: 0; border-radius: 12px; background: #E6F4F7; color: var(--teal-dark); font-size: 12px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; padding: 6px 4px; }
.dt-btn.red { background: #FDECEC; color: var(--red); }
.dt-btn:active { filter: brightness(.95); }
.dt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F1F5F9; font-size: 13px; }
.dt-row:last-child { border-bottom: 0; }
.dt-row span { display: flex; align-items: center; gap: 6px; min-width: 0; color: #334155; }
.dt-row b { font-weight: 700; color: #0B1E3F; text-align: right; }
.dt-row time { flex: none; color: #94A3B8; font-size: 12px; }
.dt-row a { color: var(--teal); font-weight: 700; text-decoration: none; }

/* folha de utilitários */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 22; background: #fff; border-radius: 22px 22px 0 0; padding: 10px 18px calc(18px + var(--safe-bot));
  box-shadow: 0 -8px 28px rgba(0,0,0,.2); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(100%); } }
.sheet-grab { display: block; width: 40px; height: 5px; padding: 0; border: 0; border-radius: 3px; background: #CBD5DA; margin: 0 auto 10px; cursor: pointer; position: relative; }
.sheet-grab::before { content: ''; position: absolute; inset: -14px -40px; }
.sheet h2 { margin: 0; font-size: 17px; }
.sheet .ov-head { margin-bottom: 6px; }
.sheet .row { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid #EEF2F3; background: none;
  padding: 0 4px; font-size: 15px; font-weight: 600; color: var(--ink); text-align: left; }
.sheet label.row { justify-content: space-between; }
.sheet input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--teal-btn); }
.sheet-note { font-size: 12px; color: var(--muted); margin: 12px 4px 0; }

/* =================== Etapa 3 =================== */
/* páginas por cima do mapa */
.page { position: absolute; inset: 0; z-index: 40; background: #F4F7FA; display: flex; flex-direction: column; animation: pgin .2s ease-out; }
@keyframes pgin { from { transform: translateX(30px); opacity: 0; } }
.page.right { left: auto; width: min(420px, 100%); box-shadow: -8px 0 28px rgba(0,0,0,.25); }
.pg-head { flex: none; display: flex; align-items: center; gap: 6px; padding: calc(8px + var(--safe-top)) 8px 8px; background: linear-gradient(135deg, #13306A, #0B1E3F); color: #fff; min-height: 60px; }
.pg-back { width: 44px; height: 44px; border: 0; background: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.pg-title { flex: 1; min-width: 0; }
.pg-title h2 { margin: 0; font-size: 17px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-title small { display: block; font-size: 12px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-actions { display: flex; gap: 4px; }
.pg-act { height: 40px; min-width: 40px; border: 0; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; font-weight: 700; font-size: 13px; }
.pg-body { flex: 1; overflow-y: auto; padding: 12px 12px calc(20px + var(--safe-bot)); overscroll-behavior: contain; }
.pg-foot { flex: none; padding: 10px 12px calc(10px + var(--safe-bot)); background: #fff; border-top: 1px solid #E2E8F0; }
.pg-close { width: 100%; height: 48px; border: 0; border-radius: 14px; background: #E6F4F7; color: var(--teal-dark); font-weight: 800; font-size: 15px; }

/* folhas e diálogos */
.ov-wrap { position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; justify-content: flex-end; }
.ov-wrap.center { justify-content: center; align-items: center; padding: 20px; }
.ov-scrim { position: absolute; inset: 0; background: rgba(10,23,48,.45); }
.ov-sheet { position: relative; max-height: 86%; display: flex; flex-direction: column; background: #fff; border-radius: 22px 22px 0 0; padding: 10px 16px calc(16px + var(--safe-bot));
  box-shadow: 0 -8px 28px rgba(0,0,0,.2); animation: up .2s ease-out; }
.ov-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ov-head h2 { flex: 1; margin: 0; font-size: 17px; }
.ov-x { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #F1F5F9; display: flex; align-items: center; justify-content: center; }
.ov-body { overflow-y: auto; overscroll-behavior: contain; }
.dlg { position: relative; width: min(380px, 100%); background: #fff; border-radius: 20px; padding: 20px; box-shadow: 0 20px 40px rgba(0,0,0,.3); animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.dlg h2 { margin: 0 0 8px; font-size: 18px; }
.dlg p { margin: 0 0 18px; color: #475569; font-size: 14.5px; line-height: 1.45; }
.dlg-btns { display: flex; gap: 10px; }
.dlg-btns button { flex: 1; height: 48px; border: 0; border-radius: 14px; font-weight: 800; font-size: 15px; }
.dlg-no { background: #F1F5F9; color: #334155; }
.dlg-ok { background: var(--teal); color: #fff; }
.dlg-ok.danger { background: #DC2626; }
.pick-q { width: 100%; height: 44px; border: 1px solid #E2E8F0; border-radius: 12px; padding: 0 12px; font: 500 15px Inter, sans-serif; margin-bottom: 8px; }
.pick-list { display: flex; flex-direction: column; }
.pick-it { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 50px; justify-content: center; border: 0; border-bottom: 1px solid #F1F5F9; background: none; padding: 8px 6px; text-align: left; font-size: 15px; }
.pick-it small { color: #64748B; font-size: 12px; }
.row-sub { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.iw { font: 500 13px Inter, sans-serif; color: #0F2A33; max-width: 220px; }

/* histórico */
.hist .pg-body { padding-top: 0; }
.hist.map-tab .pg-body { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.h-period { padding: 10px 0 6px; display: flex; flex-direction: column; gap: 6px; }
.h-dev { align-self: flex-start; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid #CFE3E7; border-radius: 18px; background: #fff; font-weight: 700; color: var(--teal-dark); }
.h-chips { display: flex; gap: 8px; }
.h-chips button { height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid #E2E8F0; background: #fff; font-weight: 700; font-size: 13.5px; color: #334155; display: flex; align-items: center; gap: 6px; }
.h-chips button.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.h-custom { display: flex; flex-direction: column; gap: 8px; background: #fff; border-radius: 14px; padding: 12px; }
.h-custom label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #334155; }
.h-custom label input { flex: 1; min-width: 0; height: 40px; border: 1px solid #E2E8F0; border-radius: 10px; padding: 0 8px; font: 500 14px Inter, sans-serif; }
.h-custom label input[type="time"] { flex: 0 0 96px; }
.h-custom small { color: #64748B; font-size: 12px; }
.h-go, .cm-send, .zn-save { height: 46px; border: 0; border-radius: 14px; background: linear-gradient(90deg, var(--teal-btn), var(--teal-btn2)); color: #fff; font-weight: 800; font-size: 15px; width: 100%; }
.h-go:disabled, .cm-send:disabled, .zn-save:disabled { opacity: .6; }
.h-tabs { position: sticky; top: 0; z-index: 2; display: flex; background: #F4F7FA; padding: 6px 0; gap: 6px; flex: none; }
.h-tabs button { flex: 1; height: 38px; border: 0; border-radius: 12px; background: #E2E8F0; font-weight: 700; font-size: 13px; color: #475569; }
.h-tabs button.on { background: #13306A; color: #fff; }
.h-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 10px; flex: none; }
.h-sum:empty { display: none; }
.h-sum div, .pr-sum div { background: #fff; border-radius: 12px; padding: 8px 4px; text-align: center; box-shadow: 0 1px 4px rgba(15,42,51,.06); }
.h-sum b, .pr-sum b { display: block; font-size: 15px; font-weight: 800; color: #0B1E3F; white-space: nowrap; }
.h-sum small, .pr-sum small { font-size: 10.5px; color: #64748B; }
.h-wait { text-align: center; color: #64748B; font-size: 14px; padding: 18px 8px; margin: 0; }
.h-list { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: 14px; box-shadow: 0 1px 4px rgba(15,42,51,.06); }
.h-list li { display: flex; gap: 12px; padding: 11px 12px; border-bottom: 1px solid #F1F5F9; align-items: flex-start; }
.h-list li:last-child { border-bottom: 0; }
.h-list li > svg { flex: none; margin-top: 2px; }
.h-list li div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.h-list b { font-size: 14px; }
.h-list small { font-size: 12px; color: #64748B; }
.h-list .k-drive, .h-list .k-stop { cursor: pointer; }
.h-addr:empty { display: none; }
.ch-card { background: #fff; border-radius: 14px; padding: 12px 8px; box-shadow: 0 1px 4px rgba(15,42,51,.06); }
.ch-title { font-size: 12px; font-weight: 800; color: var(--teal-dark); letter-spacing: .5px; padding: 0 6px 6px; display: flex; justify-content: space-between; }
.ch-tip { color: #1E40AF; }
.ch { width: 100%; height: 240px; touch-action: pan-y; }
.ch-grid line { stroke: #E2E8F0; stroke-width: 1; vector-effect: non-scaling-stroke; }
.ch-grid text { font-size: 18px; fill: #94A3B8; font-family: Inter, sans-serif; }
.ch-line { fill: none; stroke: #1E40AF; stroke-width: 2; vector-effect: non-scaling-stroke; }
.ch-area { fill: rgba(30,64,175,.12); }
.ch-cur { stroke: #E2231A; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.h-map { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0 -12px; }
.h-map[hidden] { display: none !important; }
.h-mapbox { flex: 1; min-height: 280px; background: #E5E9E4; }
.h-replay { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px calc(10px + var(--safe-bot)); background: #0B1E3F; color: #fff; }
.h-play { flex: none; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--teal-btn); display: flex; align-items: center; justify-content: center; }
.h-play svg path { fill: #fff; }
.h-seek { flex: 1; min-width: 0; accent-color: var(--teal-btn2); }
.h-speed { flex: none; height: 34px; min-width: 44px; border: 0; border-radius: 10px; background: rgba(255,255,255,.14); color: #fff; font-weight: 800; }
.h-rinfo { flex: none; display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; min-width: 62px; }
.h-rinfo b { font-size: 14px; }
.tr-card { background: #fff; border-radius: 14px; padding: 6px 12px; box-shadow: 0 1px 4px rgba(15,42,51,.06); }
.tr-h, .cm-h { margin: 16px 2px 8px; font-size: 11px; letter-spacing: 1px; color: var(--teal-dark); }
.tr-it { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 14px; background: #fff; margin-bottom: 8px; text-align: left; box-shadow: 0 1px 4px rgba(15,42,51,.06); }
.tr-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #1E40AF; color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.tr-tx { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tr-tx small { color: #64748B; font-size: 12px; }

/* eventos */
.ev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ev-it { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 14px; background: #fff; text-align: left; box-shadow: 0 1px 4px rgba(15,42,51,.06); }
.ev-ic { flex: none; width: 36px; height: 36px; border-radius: 12px; background: color-mix(in srgb, var(--c) 12%, #fff); display: flex; align-items: center; justify-content: center; }
.ev-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ev-tx b { font-size: 14px; }
.ev-tx small { font-size: 12px; color: #64748B; }
.ev-more { display: block; margin: 12px auto 0; height: 42px; padding: 0 20px; border: 1px solid #CFE3E7; border-radius: 21px; background: #fff; font-weight: 700; color: var(--teal-dark); }

/* comandos */
.cm-big { display: flex; gap: 10px; }
.cm-big button { flex: 1; min-height: 92px; border: 0; border-radius: 16px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px; }
.cm-big b { font-size: 16px; }
.cm-big small { font-size: 11px; opacity: .85; }
.cm-lock { background: linear-gradient(135deg, #EF4444, #B91C1C); box-shadow: 0 8px 18px rgba(220,38,38,.3); }
.cm-unlock { background: linear-gradient(135deg, #22C55E, #15803D); box-shadow: 0 8px 18px rgba(34,197,94,.3); }
.cm-list { display: flex; flex-direction: column; }
.cm-it { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 6px; border: 0; border-bottom: 1px solid #F1F5F9; background: none; text-align: left; font-size: 15px; font-weight: 600; }
.cm-it span { flex: 1; }
.cm-form { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.cm-f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: #334155; margin-bottom: 10px; }
.cm-f input { height: 46px; border: 1.5px solid #D3E2E4; border-radius: 12px; padding: 0 12px; font: 500 15px Inter, sans-serif; }
.cm-f small { font-weight: 500; color: #64748B; white-space: pre-line; }

/* alertas rápidos e listas com chave */
.qa-note { margin: 2px 2px 10px; font-size: 13px; color: #64748B; }
.qa-row { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid #F1F5F9; }
.qa-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; border: 0; background: none; padding: 0; text-align: left; }
.qa-tx b { font-size: 14.5px; }
.qa-tx small { font-size: 12px; color: #64748B; }
.qa-val { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #475569; }
.qa-val input { width: 70px; height: 32px; border: 1px solid #D3E2E4; border-radius: 8px; padding: 0 6px; font: 600 14px Inter, sans-serif; }
.tl-del { flex: none; width: 38px; height: 38px; border: 0; border-radius: 10px; background: #FFF1F1; display: flex; align-items: center; justify-content: center; }
.tl-sw { flex: none; width: 14px; height: 14px; border-radius: 4px; }
.tl-pane .qa-row, .tl-pane .cm-it { background: #fff; }
.tl-pane { background: #fff; border-radius: 14px; padding: 4px 10px; box-shadow: 0 1px 4px rgba(15,42,51,.06); }

/* zona */
.zn-name { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: #334155; }
.zn-name input { height: 44px; border: 1.5px solid #D3E2E4; border-radius: 12px; padding: 0 12px; font: 600 15px Inter, sans-serif; }
.zn-r { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 2px 4px; font-weight: 700; }
.zn-rv { font-size: 22px; color: var(--teal); }
.zn-range { width: 100%; accent-color: var(--teal); }
.zn-scale { display: flex; justify-content: space-between; color: #94A3B8; margin-bottom: 8px; }
.zn-chk { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 600; }
.zn-chk input { width: 22px; height: 22px; accent-color: var(--teal); }
.zn-save { margin-top: 10px; }

/* manutenção */
.mt-list { display: flex; flex-direction: column; gap: 6px; }
.mt-it { background: #fff; border-radius: 14px; padding: 12px; border-left: 5px solid #22C55E; box-shadow: 0 1px 4px rgba(15,42,51,.06); }
.mt-it.exp { border-left-color: #DC2626; }
.mt-hd { display: flex; justify-content: space-between; align-items: center; }
.mt-st { font-size: 10.5px; font-weight: 800; letter-spacing: .5px; padding: 3px 8px; border-radius: 10px; background: #DCFCE7; color: #15803D; }
.mt-it.exp .mt-st { background: #FEE2E2; color: #B91C1C; }
.mt-nm { margin: 4px 0 2px; font-weight: 600; }
.mt-it small { color: #64748B; font-size: 12px; }

/* ajuda */
.hp-q { background: #fff; border-radius: 14px; margin-bottom: 8px; padding: 0 14px; box-shadow: 0 1px 4px rgba(15,42,51,.06); }
.hp-q summary { min-height: 52px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.hp-q p { margin: 0 0 14px; color: #475569; line-height: 1.5; }
.lock .login-form { margin-top: 10px; }

/* impressão / PDF */
#print-root { display: none; }
@media print {
  body.printing #app, body.printing #toast { display: none !important; }
  body.printing { background: #fff; }
  body.printing #print-root { display: block; font: 11pt Inter, Arial, sans-serif; color: #0F2A33; }
  .pr-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 3px solid #0E7490; padding-bottom: 8px; margin-bottom: 12px; }
  .pr-brand b { font-size: 20pt; color: #0A566B; } .pr-brand span { font-size: 20pt; font-weight: 800; color: #0F9F97; }
  .pr-brand small { display: block; font-size: 7pt; letter-spacing: 2px; color: #52646C; }
  .pr-title { text-align: right; } .pr-title h1 { margin: 0; font-size: 14pt; } .pr-title p { margin: 2px 0 0; font-size: 8pt; color: #64748B; }
  .pr-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
  .pr-sum div { border: 1px solid #E2E8F0; box-shadow: none; }
  .pr-chart svg { width: 100%; height: 160px; }
  .pr-table { width: 100%; border-collapse: collapse; font-size: 9pt; }
  .pr-table th { background: #0E7490 !important; color: #fff; text-align: left; padding: 5px 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pr-table td { padding: 4px 6px; border-bottom: 1px solid #E2E8F0; vertical-align: top; }
  .pr-table tr { break-inside: avoid; }
}
.qa-row .switch { flex: none; }
@media print { .pr-table td:nth-child(3) { width: 46%; } .pr-table td:nth-child(1) { white-space: nowrap; } }

/* histórico: linha do tempo */
.tl { list-style: none; margin: 0; padding: 4px 0 4px 6px; position: relative; }
.tl::before { content: ''; position: absolute; left: 21px; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: #CBD5E1; }
.tl li { position: relative; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.tl li > div { flex: 1; min-width: 0; background: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: 0 1px 4px rgba(15,42,51,.07); display: flex; flex-direction: column; gap: 3px; }
.tl b { font-size: 14px; }
.tl small { font-size: 12px; color: #64748B; }
.tl-dot { position: relative; z-index: 1; flex: none; width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; border: 3px solid #F4F7FA; }
.tl-drive .tl-dot { background: #1E40AF; }
.tl-drive > div { border-left: 4px solid #1E40AF; cursor: pointer; }
.tl-stop .tl-dot { background: #F59E0B; }
.tl-stop > div { border-left: 4px solid #F59E0B; cursor: pointer; }
.tl-ev > svg { position: relative; z-index: 1; flex: none; width: 32px; height: 32px; padding: 7px; border-radius: 50%; background: #FEE2E2; border: 3px solid #F4F7FA; }
.tl-ev > div { border-left: 4px solid #E2231A; }
.h-addr { display: block; font-size: 12.5px; color: #334155; line-height: 1.4; }
.h-addr i { font-style: normal; font-weight: 800; color: var(--teal-dark); margin-right: 4px; }
.h-addr em { font-style: normal; color: #94A3B8; }
.tr-tx .h-addr { font-size: 12px; }

/* relatório de percurso (PDF) */
@media print {
  .rp-veh { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #13306A, #0B1E3F) !important; color: #fff; border-radius: 14px; padding: 12px 16px; margin-bottom: 10px;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-veh img { width: 54px; height: 54px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
  .rp-veh h2 { margin: 0; font-size: 17pt; }
  .rp-veh p { margin: 2px 0 0; font-size: 9.5pt; opacity: .85; }
  .rp-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 10px; }
  .rp-cards div { border: 1px solid #E2E8F0; border-radius: 10px; padding: 8px 4px; text-align: center; border-top: 4px solid #0E7490; }
  .rp-cards b { display: block; font-size: 12.5pt; color: #0B1E3F; }
  .rp-cards small { font-size: 7.5pt; color: #64748B; text-transform: uppercase; letter-spacing: .5px; }
  .rp-visual { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 6px; break-inside: avoid; }
  .rp-visual figure { margin: 0; }
  .rp-visual figcaption { font-size: 8pt; color: #64748B; margin: 3px 2px; }
  .rp-route { width: 100%; height: auto; max-height: 92mm; display: block; }
  .rp-route .bg { fill: #EEF4F8; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-route .gr line { stroke: #DCE6EE; stroke-width: 1; }
  .rp-route .halo { fill: none; stroke: #fff; stroke-width: 9; stroke-linejoin: round; stroke-linecap: round; }
  .rp-route .ln { fill: none; stroke: #1E40AF; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
  .rp-route circle { stroke: #fff; stroke-width: 3; }
  .rp-route .ra { fill: #16A34A; } .rp-route .rb { fill: #DC2626; } .rp-route .rs { fill: #F59E0B; }
  .rp-route text { fill: #fff; font: 800 13px Inter, Arial, sans-serif; text-anchor: middle; }
  .rp-route .sc line { stroke: #0F2A33; stroke-width: 3; }
  .rp-route .sc text, .rp-route .n { fill: #0F2A33; font-size: 15px; }
  .rp-visual figcaption span { display: inline-block; width: 14px; height: 14px; border-radius: 50%; color: #fff; font-size: 7pt; font-weight: 800; text-align: center; line-height: 14px;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-visual figcaption .a { background: #16A34A; } .rp-visual figcaption .b { background: #DC2626; } .rp-visual figcaption .p { background: #F59E0B; }
  .rp-chart svg { width: 100%; height: 42mm; }
  .rp-chart .ch-grid line { stroke: #E2E8F0; } .rp-chart .ch-grid text { font-size: 16px; fill: #94A3B8; }
  .rp-chart .ch-line { fill: none; stroke: #1E40AF; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
  .rp-chart .ch-area { fill: rgba(30,64,175,.12); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-h { font-size: 9pt; letter-spacing: 1.5px; color: #0A566B; margin: 10px 0 6px; border-bottom: 2px solid #0E7490; padding-bottom: 3px; }
  .rp-tl { position: relative; padding-left: 4px; }
  .rp-item { display: flex; gap: 10px; break-inside: avoid; margin-bottom: 5px; }
  .rp-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 8.5pt; display: flex; align-items: center; justify-content: center; margin-top: 4px;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-item.drive .rp-dot { background: #1E40AF; } .rp-item.stop .rp-dot { background: #F59E0B; } .rp-item.ev .rp-dot { background: #DC2626; }
  .rp-body { flex: 1; border: 1px solid #E2E8F0; border-radius: 9px; padding: 5px 9px; }
  .rp-item.drive .rp-body { border-left: 4px solid #1E40AF; } .rp-item.stop .rp-body { border-left: 4px solid #F59E0B; background: #FFFBEB; }
  .rp-item.ev .rp-body { border-left: 4px solid #DC2626; background: #FEF2F2; }
  .rp-top { display: flex; justify-content: space-between; gap: 10px; }
  .rp-top b { font-size: 10pt; } .rp-top time { font-size: 9pt; color: #475569; white-space: nowrap; font-weight: 600; }
  .rp-tags { display: flex; gap: 5px; margin: 2px 0; }
  .rp-tags span { font-size: 7.5pt; background: #EEF2FF; color: #1E40AF; border-radius: 6px; padding: 1px 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-body p { margin: 1px 0; font-size: 9pt; color: #334155; }
  .rp-body p i { font-style: normal; font-weight: 800; color: #0A566B; display: inline-block; min-width: 34px; }
  .rp-note { margin-top: 10px; font-size: 7.5pt; color: #94A3B8; text-align: center; }
}

/* manutenção: cadastro e apagar */
.mt-ft { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mt-del { flex: none; width: 34px; height: 34px; border: 0; border-radius: 10px; background: #FEF2F2; display: grid; place-items: center; }
.sv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sv-chip { border: 1.5px solid #D3E2E4; background: #fff; border-radius: 18px; padding: 7px 12px; font: 600 13px Inter, sans-serif; color: #334155; }
.sv-chip.on { background: #0E7490; border-color: #0E7490; color: #fff; }
.sv-by { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.sv-b { height: 40px; border: 1.5px solid #D3E2E4; background: #fff; border-radius: 12px; font: 700 12.5px Inter, sans-serif; color: #334155; }
.sv-b.on { background: #E0F2F4; border-color: #0E7490; color: #0E7490; }
.sv-hint { display: block; color: #0E7490; font-size: 12px; margin: -4px 0 10px; }
.ov-wrap .zn-name { margin-bottom: 10px; }

/* foto / ícone do veículo */
.ph-prev { width: 140px; height: 100px; margin: 0 auto 14px; border-radius: 16px; background: linear-gradient(160deg, #2F5BE0, #1E3A9E); display: grid; place-items: center; padding: 8px; }
.ph-prev img { max-width: 100%; max-height: 100%; }
.ph-prev.photo { padding: 0; overflow: hidden; }
.ph-prev.photo img { width: 100%; height: 100%; object-fit: cover; }
.ph-btns { display: flex; flex-direction: column; gap: 6px; }
.ph-b { height: 46px; border-radius: 14px; border: 1.5px solid #D3E2E4; background: #fff; font: 700 14px Inter, sans-serif; color: #334155; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.ph-b.main { border: 0; color: #fff; background: linear-gradient(90deg, var(--teal-btn), var(--teal-btn2)); }
.ph-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ph-ic { aspect-ratio: 1; border-radius: 12px; border: 2px solid #E2E8F0; background: #F1F5F9; padding: 6px; display: grid; place-items: center; }
.ph-ic.on { border-color: #0E7490; background: #E0F2F4; }
.ph-ic img { max-width: 100%; max-height: 100%; }

.ov-wrap .ph-btns .zn-chk { margin-top: 2px; }

/* cards maiores quando há poucos carros na lista */
.fl-list.sz-m { gap: 8px; }
.fl-list.sz-m .vc-top { min-height: 66px; padding: 7px 8px 6px 3px; }
.fl-list.sz-m .vc-ph { width: 48px; height: 38px; margin-top: 17px; }
.fl-list.sz-m .vc-name { font-size: 15.5px; }
.fl-list.sz-m .vc-p { font-size: 13px; }
.fl-list.sz-m .vc-g { transform: scale(1.1); transform-origin: right center; }
.fl-list.sz-m .vc-bot { font-size: 12.5px; padding: 4px 2px 4px 10px; }
.fl-list.sz-l { gap: 10px; }
.fl-list.sz-l .vc { border-radius: 17px; }
.fl-list.sz-l .vc-top { min-height: 76px; padding: 9px 10px 8px 4px; }
.fl-list.sz-l .vc-sel { width: 20px; height: 20px; }
.fl-list.sz-l .vc-ph { width: 56px; height: 44px; margin-top: 18px; }
.fl-list.sz-l .vc-name { font-size: 17px; }
.fl-list.sz-l .vc-p { font-size: 14px; }
.fl-list.sz-l .vc-g { transform: scale(1.22); transform-origin: right center; margin-left: 10px; }
.fl-list.sz-l .vc-bot { font-size: 13.5px; padding: 6px 2px 6px 12px; }

/* botão flutuante Instalar app */
.pwa-install { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + var(--safe-bot)); display: flex; align-items: center; gap: 8px;
  padding: 11px 18px; border: 0; border-radius: 24px; background: linear-gradient(135deg, #0E7490, #0B5566);
  color: #fff; font-size: 14.5px; font-weight: 700; box-shadow: 0 8px 22px rgba(14,116,144,.45); }
.pwa-install[hidden] { display: none; }
.pwa-install:active { transform: translateX(-50%) scale(.96); }
.pwa-tip { position: fixed; inset: 0; z-index: 70; background: rgba(8,20,40,.55);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.pwa-tip-box { background: #fff; border-radius: 18px; padding: 20px; max-width: 320px; text-align: center; }
.pwa-tip-box b { color: #0B1E3F; font-size: 16px; }
.pwa-tip-box p { color: #334155; font-size: 14px; line-height: 1.5; margin: 10px 0 16px; }
.pwa-tip-box button { border: 0; background: #0E7490; color: #fff; font-weight: 700; font-size: 14px;
  padding: 10px 22px; border-radius: 12px; }

/* setas de manobra (curvas) do efeito Uber */
.veh-turn { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 4; pointer-events: none; }
.veh-turn svg { position: absolute; left: -13px; top: -32px; width: 26px; height: 26px; stroke: #FFB020; stroke-width: 4;
  filter: drop-shadow(0 0 6px #FF9500) drop-shadow(0 0 2px #FFC14D); animation: turnblink 0.5s steps(1) infinite; }
.veh-turn.right svg, .veh-turn.left svg { stroke: #FFB020; }
@keyframes turnblink { 0%,49% { opacity: 1; } 50%,100% { opacity: .12; } }

/* pisca (seta) no próprio veículo selecionado — âmbar aceso, como pisca de carro */
.veh-sig { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 6; pointer-events: none; opacity: 0; }
.veh-sig.on { opacity: 1; }
.veh-sig svg { position: absolute; top: -16px; width: 32px; height: 32px; stroke: #FFB020; stroke-width: 4.5;
  filter: drop-shadow(0 0 7px #FF9500) drop-shadow(0 0 3px #FFD37A); }
.veh-sig.right svg { left: 24px; }
.veh-sig.left svg { left: -56px; }

/* veículo andando: parece vivo (vibração do motor + sombra pulsando) */
.veh.mv .pic { animation: bs-drive .42s ease-in-out infinite; transform-origin: 50% 85%; }
.veh.mv .pic.big { animation-duration: .5s; }
@keyframes bs-drive {
  0%   { transform: translateY(0)     rotate(-1.1deg); }
  25%  { transform: translateY(-1.4px) rotate(0deg); }
  50%  { transform: translateY(0)     rotate(1.1deg); }
  75%  { transform: translateY(-1.4px) rotate(0deg); }
  100% { transform: translateY(0)     rotate(-1.1deg); }
}
.veh.mv::after { content: ""; position: absolute; left: -9px; top: 16px; width: 18px; height: 5px;
  background: radial-gradient(ellipse, rgba(0,0,0,.33), transparent 70%); border-radius: 50%;
  animation: bs-shadow .42s ease-in-out infinite; }
.veh.mv.sel::after { left: -14px; top: 28px; width: 28px; height: 7px; }
@keyframes bs-shadow { 0%,100% { transform: scaleX(1); opacity: .6; } 50% { transform: scaleX(.8); opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .veh.mv .pic, .veh.mv::after { animation: none; } }
