/* Controle Kyrios – Campinas · estilos da aplicação (v1.6.0 · identidade laranja, vidro e luz)
   Organização: fontes → tokens (escuro/claro) → base e tipografia → atmosfera → vidro → componentes
   → moldura (menu, barra superior, navegação do celular) → telas → responsividade → impressão.
   Regras de dimensionamento: nenhum componente com texto tem altura fixa (só mínima); textos longos quebram
   em até 2 linhas em vez de serem cortados com reticências; alvos de toque com 44 px no celular e no tablet. */

/* ---------- Fontes (arquivos locais, licença SIL OFL 1.1; o sistema funciona com as fontes do aparelho se faltarem) ---------- */
@font-face { font-family: "Sora"; src: url("../fonts/sora-latin-wght-normal.woff2?v=1.7.0") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-wght-normal.woff2?v=1.7.0") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2?v=1.7.0") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }

/* ---------- Tokens: tema escuro (padrão do desenho) ---------- */
:root {
  --brand: #fc6105;
  --brand-2: #ffa25c;
  --brand-3: #d94a0a;
  --grad: linear-gradient(120deg, #ffa25c 0%, #fc6105 52%, #d94a0a 100%);
  --logo: url("../img/logo-kyrios.jpg?v=1.7.0");

  --bg: #0a0706;
  --bg-1: #1c120b;
  --aur-a: rgba(252, 97, 5, .36); --aur-b: rgba(255, 140, 50, .18); --aur-c: rgba(160, 52, 12, .30);
  --grid-dot: rgba(255, 180, 130, .09);
  --surface: rgba(30, 20, 14, .62);          /* vidro (cartões) */
  --surface-solid: #1a120d;                   /* vidro opaco: menus, janelas */
  --surface-2: rgba(255, 255, 255, .045);    /* área interna */
  --surface-3: rgba(255, 255, 255, .085);    /* área interna em destaque / hover */
  --field: rgba(10, 7, 5, .45);              /* campos */
  --glass-1: rgba(255, 255, 255, .075); --glass-2: rgba(255, 255, 255, .022);
  --edge-a: rgba(255, 180, 130, .50); --edge-b: rgba(252, 120, 40, .26); --edge-mid: rgba(255, 255, 255, .06);
  --text: #fff6ef;
  --text-2: #dccbbd;
  --muted: #a8917f;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --ok: #34e3a0; --ok-soft: rgba(52, 227, 160, .14);
  --warn: #ffc04d; --warn-soft: rgba(255, 192, 77, .15);
  --danger: #ff6b81; --danger-soft: rgba(255, 107, 129, .15);
  --info: #6fd3ff; --info-soft: rgba(111, 211, 255, .14);
  --load: #b49cff; --load-soft: rgba(180, 156, 255, .15);
  --gray-soft: rgba(255, 255, 255, .07);
  --accent: #fc6105;
  --accent-text: #ff9a4d;                     /* laranja para texto sobre fundo escuro (contraste) */
  --accent-strong: #e35604;
  --accent-soft: rgba(252, 97, 5, .16);
  --accent-contrast: #fff;
  --glow: rgba(252, 97, 5, .55); --glow-soft: rgba(252, 97, 5, .18);
  --shadow: 0 24px 48px -28px rgba(0, 0, 0, .8), 0 10px 22px -14px rgba(0, 0, 0, .55);
  --shadow-lg: 0 40px 80px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 180, 130, .08), 0 0 40px -12px rgba(252, 97, 5, .22);
  --map-bg: #0e0a08;
  --blur: 22px;
  --radius: 22px; --radius-md: 16px; --radius-sm: 12px;
  --header-h: 64px;
  --side-w: 272px;
  --side-w-collapsed: 84px;
  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-disp: "Sora", "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Escala tipográfica: 11 · 12 · 13 · 14 · 16 · 20 · título */
  --fs-cap: 11px; --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px;
  --fs-h1: clamp(24px, 1.05rem + 1.25vw, 32px);
  --tap: 44px;
  --e-out: cubic-bezier(.16, 1, .3, 1); --e-std: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
:root[data-theme="dark"] { color-scheme: dark; }
/* ---------- Tokens: tema claro ---------- */
:root[data-theme="light"] {
  --bg: #fff3ea;
  --bg-1: #ffe2cc;
  --aur-a: rgba(252, 97, 5, .20); --aur-b: rgba(255, 170, 110, .26); --aur-c: rgba(255, 120, 60, .14);
  --grid-dot: rgba(160, 70, 20, .10);
  --surface: rgba(255, 255, 255, .68);
  --surface-solid: #fffaf6;
  --surface-2: rgba(255, 255, 255, .55);
  --surface-3: rgba(255, 236, 222, .85);
  --field: rgba(255, 255, 255, .82);
  --glass-1: rgba(255, 255, 255, .80); --glass-2: rgba(255, 255, 255, .52);
  --edge-a: rgba(255, 255, 255, .95); --edge-b: rgba(252, 97, 5, .22); --edge-mid: rgba(160, 80, 30, .08);
  --text: #1d140e;
  --text-2: #4a3628;
  --muted: #7a6150;
  --line: rgba(110, 55, 20, .12);
  --line-strong: rgba(110, 55, 20, .24);
  --ok: #0f8a5a; --ok-soft: rgba(15, 138, 90, .12);
  --warn: #a5620a; --warn-soft: rgba(230, 150, 20, .16);
  --danger: #c4243f; --danger-soft: rgba(196, 36, 63, .11);
  --info: #0778a8; --info-soft: rgba(7, 120, 168, .11);
  --load: #6d4fd6; --load-soft: rgba(109, 79, 214, .12);
  --gray-soft: rgba(110, 55, 20, .07);
  --accent-text: #c24a00;
  --accent-soft: rgba(252, 97, 5, .12);
  --glow: rgba(252, 97, 5, .40); --glow-soft: rgba(252, 97, 5, .12);
  --shadow: 0 22px 44px -28px rgba(110, 55, 20, .35), 0 8px 18px -12px rgba(110, 55, 20, .18);
  --shadow-lg: 0 34px 70px -30px rgba(110, 55, 20, .42), 0 0 0 1px rgba(110, 55, 20, .06);
  --map-bg: #f6ece4;
  color-scheme: light;
}

/* ---------- Base e tipografia ---------- */
* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: 500 var(--fs-md)/1.5 var(--font); color: var(--text); background: transparent; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-family: var(--font-disp); text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: var(--fs-h1); font-weight: 700; line-height: 1.12; letter-spacing: -.03em; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 650; letter-spacing: -.005em; }
p { margin: 0 0 8px; text-wrap: pretty; }
code, .mono { font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-xs); line-height: 1.45; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.eyebrow { font: 700 var(--fs-cap)/1.35 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
::selection { background: rgba(252, 97, 5, .35); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ---------- Vidro ---------- */
.glass, .card, .kpi, .route-card, .drv-card, .city-btn, .stat, .modal, .dropdown, .sheet, .toast, .topbar, .sidebar, .bottom-nav, .login-box, .stg, .yl-box {
  --edge-angle: 140deg;
}
.glass, .card, .kpi, .route-card, .drv-card {
  position: relative; isolation: isolate; background: linear-gradient(150deg, var(--glass-1), var(--glass-2)), var(--surface);
  border: 0; border-radius: var(--radius); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .10);
}
/* Borda luminosa (degradê) e luz que segue o cursor */
.glass::before, .card::before, .route-card::after, .drv-card::after, .modal::before, .login-box::before, .topbar::before, .sidebar::before, .dropdown::before, .sheet::before, .bottom-nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(var(--edge-angle, 140deg), var(--edge-a), var(--edge-mid) 32%, var(--edge-mid) 64%, var(--edge-b));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.card::after, .glass::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s var(--e-std);
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--glow-soft), transparent 45%); }
.card.lit::after, .glass.lit::after { opacity: 1; }
/* Desfoque de fundo só nas camadas que flutuam (custa caro em listas grandes no celular) */
.topbar, .sidebar, .bottom-nav, .modal, .dropdown, .sheet, .toast, .search-results, .combo-list, .login-box, .glass.blur {
  -webkit-backdrop-filter: blur(var(--blur)) saturate(170%); backdrop-filter: blur(var(--blur)) saturate(170%);
}
@media (prefers-reduced-transparency: reduce) { :root { --surface: var(--surface-solid); } }

/* ---------- Cabeçalho das páginas ---------- */
.page-head { display: flex; align-items: flex-end; gap: 12px 16px; margin: 4px 0 20px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; flex: 1 1 22rem; }
.page-head h1 { margin-top: 2px; }
.page-head .eyebrow { display: block; margin-bottom: 8px; }
.page-head .sub { color: var(--muted); margin-top: 8px; max-width: 72ch; text-wrap: pretty; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Cartões ---------- */
.card-head { display: flex; align-items: center; gap: 10px 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2, .card-head h3 { min-width: 0; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card-body { padding: 16px 18px; }
.card-body.tight { padding: 0; }
.card > .card-body.tight:last-child, .card > .table-wrap:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.hico { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--accent-text); background: linear-gradient(150deg, rgba(255, 150, 70, .2), rgba(252, 97, 5, .06)); box-shadow: inset 0 0 0 1px rgba(255, 180, 130, .22); flex: none; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1fr) 360px; }
.grid.side-left { grid-template-columns: 380px minmax(0, 1fr); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

/* ---------- Indicadores ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; color: var(--text); overflow: hidden; border-radius: var(--radius-md); }
a.kpi { transition: transform .25s var(--e-out), box-shadow .3s; }
a.kpi:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow), 0 0 0 1px var(--edge-b), 0 14px 30px -18px var(--glow); }
.kpi .label { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; display: flex; gap: 6px; align-items: center; line-height: 1.3; }
.kpi .value { font: 750 26px/1.15 var(--font-disp); font-variant-numeric: tabular-nums; letter-spacing: -.02em; overflow-wrap: anywhere; }
.kpi .hint { font-size: var(--fs-xs); color: var(--muted); line-height: 1.4; }
.kpi::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--kpi-color, var(--brand)); box-shadow: 0 0 12px var(--kpi-color, var(--brand)); }

/* ---------- Botões ---------- */
.btn {
  --h: 40px; position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--h); padding: 7px 16px; border-radius: 13px;
  border: 0; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-strong), inset 0 1px 0 rgba(255, 255, 255, .07); color: var(--text);
  font: 700 13.5px/1.2 var(--font); cursor: pointer; text-decoration: none; text-align: center; text-wrap: balance;
  transition: transform .18s var(--e-out), box-shadow .3s var(--e-std), background-color .2s, color .2s;
}
.btn:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--edge-b), 0 8px 22px -12px var(--glow); }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; filter: saturate(.4); }
.btn.primary { color: #fff; background: linear-gradient(120deg, #ffa25c, #fc6105 55%, #d94a0a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 26px -12px var(--glow), 0 0 0 1px rgba(255, 180, 130, .35); }
.btn.primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 14px 34px -10px var(--glow), 0 0 0 1px rgba(255, 180, 130, .6); }
.btn.primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .32) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s var(--e-out); pointer-events: none; }
.btn.primary:hover::after { transform: translateX(120%); }
.btn.danger { color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-soft); }
.btn.danger.solid { background: linear-gradient(120deg, #ff8a9b, #e23a57); color: #fff; box-shadow: 0 10px 24px -12px rgba(226, 58, 87, .7); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); box-shadow: none; }
.btn.sm { --h: 34px; padding: 6px 12px; font-size: 12.5px; border-radius: 11px; }
.btn.icon-only { padding: 0; width: var(--h); min-width: var(--h); }
.btn.lg { --h: 50px; font-size: 15px; padding: 10px 20px; border-radius: 16px; }
.btn.on { color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 40%, transparent); }
.btn .spinner { width: 14px; height: 14px; }
.btn .rip { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .35); transform: scale(0); pointer-events: none; animation: rip .6s var(--e-out) forwards; }
@keyframes rip { to { transform: scale(4); opacity: 0; } }
select.btn { appearance: auto; padding-right: 8px; }
/* Grupo de botões = seletor segmentado com luz deslizante */
.btn-group { position: relative; display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 2px; padding: 4px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); isolation: isolate; }
.btn-group .btn { box-shadow: none; background: transparent; color: var(--muted); border-radius: 12px; }
.btn-group .btn:hover { color: var(--text); box-shadow: none; }
.btn-group .btn.active { color: #fff; background: linear-gradient(120deg, #ffa25c, #fc6105 60%, #d94a0a); box-shadow: 0 6px 18px -8px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .35); z-index: 1; }
.icon-btn { position: relative; width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 14px; border: 0; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-2); cursor: pointer; transition: color .2s, box-shadow .3s, transform .18s var(--e-out); }
.icon-btn:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--edge-b), 0 0 20px -6px var(--glow); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .dot { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 10px var(--danger); }

/* ---------- Campos ---------- */
label.field, .field { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); min-width: 0; line-height: 1.35; }
.field .hint, .hint { font-weight: 500; color: var(--muted); font-size: var(--fs-xs); }
input, select, textarea {
  font: 500 var(--fs-md)/1.35 var(--font); color: var(--text); background: var(--field); border: 0; box-shadow: inset 0 0 0 1px var(--line-strong);
  border-radius: 12px; padding: 9px 12px; min-height: 42px; width: 100%; transition: box-shadow .25s;
}
select { padding-right: 30px; }
select option { color: #1d140e; background: #fff; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; padding: 0; box-shadow: none; accent-color: var(--brand); flex: none; }
input[type="color"] { padding: 3px; width: 52px; }
input[type="date"] { min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px rgba(255, 160, 100, .75), 0 0 0 4px var(--glow-soft); }
input.invalid, select.invalid, textarea.invalid { box-shadow: inset 0 0 0 1.5px var(--danger), 0 0 0 4px var(--danger-soft); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.check { display: inline-flex; gap: 9px; align-items: center; font-weight: 600; cursor: pointer; line-height: 1.35; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 140px; }
.toolbar .search { min-width: 220px; flex: 1; max-width: 340px; }
kbd { font: 600 11px var(--mono); padding: 2px 7px; border-radius: 7px; color: var(--text-2); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- Selos, avisos ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; min-height: 22px; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-cap); line-height: 1.2; font-weight: 750; background: var(--gray-soft); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.badge::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge:empty::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 30%, transparent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 30%, transparent); }
.badge.danger { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 30%, transparent); }
.badge.info { background: var(--info-soft); color: var(--info); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 30%, transparent); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent); }
.badge.load { background: var(--load-soft); color: var(--load); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--load) 30%, transparent); }
.dotc { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; box-shadow: 0 0 8px currentColor; flex: none; }
.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 0; align-items: flex-start; color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); line-height: 1.45; }
.alert.info { background: var(--info-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 30%, transparent); }
.alert.warn { background: var(--warn-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 32%, transparent); }
.alert.danger { background: var(--danger-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 32%, transparent); }
.alert.ok { background: var(--ok-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 30%, transparent); }
.alert > .icon { margin-top: 1px; }
.alert.info > .icon { color: var(--info); } .alert.warn > .icon { color: var(--warn); } .alert.danger > .icon { color: var(--danger); } .alert.ok > .icon { color: var(--ok); }
a.alert:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--edge-b), 0 8px 22px -14px var(--glow); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th { text-align: left; font-size: var(--fs-cap); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 750; padding: 11px 12px; border-bottom: 1px solid var(--line); background: var(--surface-solid); position: sticky; top: 0; z-index: 1; line-height: 1.3; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th .sort { opacity: .6; margin-left: 4px; color: var(--accent-text); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; line-height: 1.4; }
.tbl tbody tr { transition: background-color .2s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tr.selected { background: var(--accent-soft) !important; }
.tbl tfoot td { font-weight: 750; background: var(--surface-2); }
.tbl .actions { white-space: nowrap; text-align: right; }
.tbl .actions .btn { margin-left: 2px; }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager .info { color: var(--muted); font-size: var(--fs-xs); margin-right: auto; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); display: grid; justify-items: center; gap: 4px; }
.empty > .icon { width: 44px; height: 44px; color: var(--accent-text); margin-bottom: 8px; padding: 10px; border-radius: 15px; background: var(--accent-soft); box-sizing: content-box; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }
.progress { height: 7px; background: var(--surface-3); border-radius: 99px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.progress > span { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .6s var(--e-out); box-shadow: 0 0 10px var(--glow); }
.progress.warn > span { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.progress.danger > span { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.progress.ok > span { background: linear-gradient(90deg, #1fbf83, #5cf0b6); box-shadow: 0 0 10px var(--ok); }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(100deg, var(--surface-2) 20%, var(--surface-3) 40%, var(--surface-2) 60%); background-size: 300% 100%; animation: sk 1.4s linear infinite; border-radius: 10px; min-height: 16px; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.loading-block { display: grid; place-items: center; padding: 56px 20px; color: var(--muted); gap: 12px; font-weight: 700; }
/* Carregador em órbita com a logo no centro */
.orbit { position: relative; width: 56px; height: 56px; }
.orbit::before, .orbit::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.orbit::before { background: conic-gradient(from 0deg, transparent 0 55%, var(--brand-2) 85%, transparent); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); animation: spin 1.1s linear infinite; }
.orbit::after { inset: 10px; background: conic-gradient(from 180deg, transparent 0 60%, var(--brand-3) 90%, transparent); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px)); animation: spin 1.6s linear infinite reverse; }
.orbit b { position: absolute; inset: 17px; border-radius: 6px; background: #fc6105 var(--logo) center / cover no-repeat; }

/* ---------- Janelas, menus suspensos e avisos ---------- */
.modal.wide { width: min(900px, 100%); }
.modal .table-wrap { max-width: 100%; overflow: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(14px) scale(.97); opacity: 0; filter: blur(6px); } }
.dropdown { position: absolute; top: calc(100% + 10px); right: 0; min-width: 270px; max-width: calc(100vw - 24px); background: linear-gradient(150deg, var(--glass-1), var(--glass-2)), var(--surface-solid); border-radius: 20px; box-shadow: var(--shadow-lg); z-index: 85; overflow: hidden; isolation: isolate; animation: pop .28s var(--e-out); }
.dropdown .dd-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dropdown .dd-item { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 44px; padding: 10px 16px; border: 0; background: none; color: var(--text); font: 600 var(--fs-md) var(--font); text-align: left; cursor: pointer; }
.dropdown .dd-item:hover { background: var(--surface-3); text-decoration: none; }
.notif-list { max-height: 420px; overflow: auto; width: min(380px, 92vw); }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif.unread { background: var(--accent-soft); }
.notif .sev { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex: none; box-shadow: 0 0 8px currentColor; }
.sev-info { background: var(--info); color: var(--info); } .sev-warning { background: var(--warn); color: var(--warn); } .sev-danger { background: var(--danger); color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); filter: blur(6px); } }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 1400; background: linear-gradient(90deg, #e23a57, #ff6b81); color: #fff; text-align: center; padding: 7px 12px; font-size: var(--fs-sm); font-weight: 700; }

/* ---------- Login ---------- */
.login-wrap { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 40px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); overflow: hidden; }
.ribbons { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.ribbons g.rb { animation: ribDrift 18s var(--e-std) infinite alternate; transform-origin: 50% 50%; }
.ribbons g.rb:nth-child(2n) { animation-duration: 24s; animation-direction: alternate-reverse; }
@keyframes ribDrift { from { transform: translate(-2%, 1%) rotate(-1deg); } to { transform: translate(2%, -2%) rotate(1.2deg); } }
.ribbons .rim { fill: none; stroke: url(#rimG); stroke-linecap: round; }
.ribbons .body { fill: none; stroke: var(--bg); stroke-linecap: round; }
.ribbons .spec { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 80 900; animation: specRun 7s linear infinite; }
@keyframes specRun { to { stroke-dashoffset: -980; } }
.login-stage { position: relative; z-index: 1; width: min(440px, 100%); }
.login-box { position: relative; isolation: isolate; width: 100%; padding: 36px 32px 28px; border-radius: 28px; background: linear-gradient(150deg, var(--glass-1), var(--glass-2)), var(--surface); box-shadow: var(--shadow-lg); animation: pop .6s var(--e-out); }
.login-box .lbrand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-box .lbrand b { display: block; font: 700 14px var(--font-disp); letter-spacing: .16em; }
.login-box .lbrand span { display: block; font-size: var(--fs-xs); color: var(--muted); }
.login-box h1, .login-box h2 { font-size: clamp(26px, 6vw, 32px); margin-bottom: 8px; }
.login-box .lead { color: var(--muted); margin-bottom: 4px; }
.login-box form { display: grid; gap: 14px; margin-top: 22px; }
.login-box input { min-height: 50px; font-size: 16px; }
.login-box .lfoot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 18px; color: var(--muted); font-size: var(--fs-xs); }
.login-art, .route-art { display: none; }
.login-panel { position: relative; z-index: 1; display: grid; place-items: center; padding: 32px 16px; min-height: 100dvh; }

/* ---------- Marca ---------- */
.brand-logo { width: 40px; height: 40px; border-radius: 11px; flex: none; overflow: hidden; display: grid; place-items: center; background: #fc6105 var(--logo) center / cover no-repeat; color: transparent; font-size: 0; box-shadow: 0 8px 24px -8px var(--glow), 0 0 0 1px rgba(255, 255, 255, .12); }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Moldura: menu lateral flutuante ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; z-index: 1000; top: calc(14px + env(safe-area-inset-top)); bottom: calc(14px + env(safe-area-inset-bottom)); left: calc(14px + env(safe-area-inset-left)); width: var(--side-w);
  display: flex; flex-direction: column; color: var(--text-2); border-radius: 28px; overflow: hidden; isolation: isolate;
  background: linear-gradient(170deg, var(--glass-1), var(--glass-2)), var(--surface); box-shadow: var(--shadow); transition: width .5s var(--e-out), transform .45s var(--e-out), box-shadow .4s; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 12px; min-height: 0; border-bottom: 0; }
.brand-text { line-height: 1.2; min-width: 0; }
.brand-text strong { display: block; color: var(--text); font: 700 14px var(--font-disp); letter-spacing: .16em; }
.brand-text span { display: block; font-size: var(--fs-xs); color: var(--muted); }
.nav { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 12px 12px; scrollbar-width: none; overscroll-behavior: contain; }
.nav::-webkit-scrollbar { display: none; }
.nav-section { display: flex; align-items: center; gap: 10px; font: 700 var(--fs-cap)/1.2 var(--font); text-transform: uppercase; letter-spacing: .16em; color: var(--muted); padding: 16px 10px 8px; }
.nav-section .icon { color: var(--warn); }
.nav-section .stn { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font: 700 11px var(--mono); letter-spacing: 0; color: var(--text-2); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line); }
.nav-section.cur .stn { color: #fff; background: var(--grad); box-shadow: 0 0 14px -2px var(--glow); }
.nav a {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 5px 8px; border-radius: 14px; color: var(--text-2);
  font-size: 13.5px; line-height: 1.25; font-weight: 650; text-decoration: none; transition: color .25s, background-color .25s;
}
.nav a > .icon { width: 32px; height: 32px; padding: 7px; border-radius: 11px; box-sizing: border-box; flex: none; transition: color .3s, background-color .3s, box-shadow .3s; }
.nav a > span { min-width: 0; flex: 1; text-wrap: balance; overflow-wrap: break-word; }
.nav a:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.nav a:hover > .icon { background: var(--surface-3); }
.nav a.active { color: var(--text); background: linear-gradient(90deg, var(--glow-soft), transparent 85%); box-shadow: inset 0 0 0 1px rgba(255, 180, 130, .16); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 12px var(--brand-2); }
.nav a.active > .icon { color: #fff; background: linear-gradient(145deg, #ffa25c, #fc6105 60%, #d94a0a); box-shadow: 0 6px 18px -6px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .4); }
.nav a .fav-toggle { margin-left: auto; opacity: 0; color: var(--muted); background: none; border: 0; padding: 0; width: 30px; height: 30px; cursor: pointer; border-radius: 9px; display: grid; place-items: center; flex: none; }
.nav a:hover .fav-toggle, .nav a .fav-toggle.on, .nav a .fav-toggle:focus-visible { opacity: 1; }
.nav a .fav-toggle:hover { background: var(--surface-3); }
.nav a .fav-toggle.on { color: var(--warn); }
.nav a .fav-toggle.on svg { fill: currentColor; }
.nav .badge { margin-left: auto; }
.side-foot { padding: 12px 18px 16px; font-size: var(--fs-xs); color: var(--muted); border-top: 1px solid var(--line); line-height: 1.4; }
body.side-collapsed { --side-w: var(--side-w-collapsed); }
body.side-collapsed .sidebar:not(:hover) .brand-text, body.side-collapsed .sidebar:not(:hover) .nav a > span, body.side-collapsed .sidebar:not(:hover) .nav-section .txt,
body.side-collapsed .sidebar:not(:hover) .side-foot, body.side-collapsed .sidebar:not(:hover) .nav a .fav-toggle { opacity: 0; pointer-events: none; }
body.side-collapsed .sidebar .nav a > span, body.side-collapsed .sidebar .nav-section { white-space: nowrap; }
body.side-collapsed .sidebar:hover { width: 312px; box-shadow: var(--shadow-lg); }
body.side-collapsed .sidebar:not(:hover) .nav-section { padding-left: 16px; }
.brand-text, .nav a > span, .nav-section .txt, .side-foot { transition: opacity .3s .05s; }

/* ---------- Moldura: área principal e barra superior flutuante ---------- */
.main { flex: 1; min-width: 0; max-width: 100%; margin-left: calc(var(--side-w) + 28px + env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); display: flex; flex-direction: column; transition: margin-left .5s var(--e-out); }
.topbar { position: sticky; top: calc(14px + env(safe-area-inset-top)); z-index: 900; display: flex; align-items: center; gap: 10px; min-height: var(--header-h); padding: 10px 10px 10px 18px; margin: 14px 0 0; border-radius: 22px; isolation: isolate;
  background: linear-gradient(150deg, var(--glass-1), var(--glass-2)), var(--surface); box-shadow: var(--shadow); min-width: 0; }
.topbar .mmark { display: none; }
.topbar .ttl { min-width: 7.5em; flex: 0 1 auto; }
.topbar .ttl .eyebrow { white-space: nowrap; }
.topbar .title { display: block; font: 700 var(--fs-lg)/1.2 var(--font-disp); letter-spacing: -.01em; text-wrap: balance; }
.search-box { position: relative; flex: 0 1 340px; min-width: 0; margin-left: auto; display: flex; align-items: center; height: 42px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); transition: box-shadow .3s, flex-basis .5s var(--e-out); }
.search-box:focus-within { flex-basis: 420px; box-shadow: inset 0 0 0 1px rgba(255, 180, 130, .5), 0 0 24px -8px var(--glow); }
.search-box > .icon { margin: 0 8px 0 13px; flex: none; }
.search-box input { flex: 1; min-width: 0; min-height: 0; height: 100%; padding: 0; border: 0; box-shadow: none !important; background: transparent; font-size: var(--fs-sm); font-weight: 600; }
.search-box kbd { margin-right: 9px; }
.search-box .s-open { display: none; }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: 300px; background: linear-gradient(150deg, var(--glass-1), var(--glass-2)), var(--surface-solid); border-radius: 18px; box-shadow: var(--shadow-lg); max-height: 420px; overflow: auto; z-index: 85; padding: 6px; }
.search-results a { display: flex; gap: 10px; padding: 10px 12px; min-height: 44px; color: var(--text); border-radius: 12px; align-items: center; font-weight: 600; }
.search-results a:hover, .search-results a.sel { background: var(--accent-soft); text-decoration: none; }
.search-results .type { font-size: var(--fs-cap); font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); min-width: 84px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.qa-top { display: inline-flex; flex: none; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px 0 12px; border-radius: 14px; border: 0; color: #fff; font: 800 13px var(--font); cursor: pointer;
  background: linear-gradient(120deg, #ffa25c, #fc6105 60%, #d94a0a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 26px -12px var(--glow); transition: transform .18s var(--e-out), box-shadow .3s; }
.qa-top:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 14px 32px -10px var(--glow); }
.qa-top:active { transform: scale(.97); }
.qa-top kbd { color: #fff; background: rgba(255, 255, 255, .22); box-shadow: none; }
.user-chip { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 4px 10px 4px 4px; border-radius: 14px; border: 0; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; color: var(--text); font: inherit; }
.user-chip:hover { box-shadow: inset 0 0 0 1px var(--edge-b); }
.avatar { width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center; font: 800 12.5px var(--font-disp); color: #fff; background: linear-gradient(145deg, #d94a0a, #fc6105); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 6px 18px -8px var(--glow); }
.user-chip .who { line-height: 1.15; text-align: left; font-weight: 700; font-size: var(--fs-sm); }
.user-chip .who small { display: block; color: var(--muted); font-size: var(--fs-cap); font-weight: 600; }
.content { position: relative; padding: 24px 0 120px; max-width: 1560px; width: 100%; min-width: 0; }
.content > * { min-width: 0; }
.content:focus { outline: none; }
#mig-banner { margin: 18px 0 0 !important; }
/* Entrada das telas */
.content.enter > * { animation: enter .6s var(--e-out) both; }
.content.enter > *:nth-child(2) { animation-delay: .05s; } .content.enter > *:nth-child(3) { animation-delay: .1s; } .content.enter > *:nth-child(4) { animation-delay: .15s; } .content.enter > *:nth-child(n+5) { animation-delay: .2s; }
@keyframes enter { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }

/* Ações rápidas: painel no computador, folha no celular */
.qa-pop { position: fixed; z-index: 1150; top: calc(84px + env(safe-area-inset-top)); right: max(18px, env(safe-area-inset-right)); width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 110px); overflow: auto; padding: 10px; border-radius: 24px; isolation: isolate;
  background: linear-gradient(150deg, var(--glass-1), var(--glass-2)), var(--surface-solid); box-shadow: var(--shadow-lg); animation: pop .35s var(--e-out); -webkit-backdrop-filter: blur(var(--blur)) saturate(170%); backdrop-filter: blur(var(--blur)) saturate(170%); }
.qa-pop::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(140deg, var(--edge-a), var(--edge-mid) 32%, var(--edge-mid) 64%, var(--edge-b)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.qa-pop h3, .sheet h3 { font: 750 var(--fs-cap) var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 8px; }
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.qa-grid a { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font-weight: 750; font-size: var(--fs-sm); line-height: 1.25; transition: box-shadow .25s, transform .2s var(--e-out); }
.qa-grid a:hover, .qa-grid a:focus-visible { text-decoration: none; box-shadow: inset 0 0 0 1px var(--edge-b), 0 8px 22px -12px var(--glow); transform: translateY(-1px); }
.qa-grid a .icon { width: 34px; height: 34px; padding: 8px; border-radius: 11px; box-sizing: border-box; color: var(--accent-text); background: var(--glow-soft); }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 5, 2, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 1100; animation: fade .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; isolation: isolate; background: linear-gradient(150deg, var(--glass-1), var(--glass-2)), var(--surface-solid); border-radius: 28px 28px 0 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); z-index: 1101; box-shadow: var(--shadow-lg); animation: up .4s var(--e-out); max-height: 86dvh; overflow: auto; }
.sheet .grab { width: 46px; height: 5px; border-radius: 5px; background: var(--edge-a); opacity: .6; margin: 4px auto 12px; }
.sheet .qa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@keyframes up { from { transform: translateY(100%); } }

/* ---------- Navegação inferior do celular ---------- */
.bottom-nav { display: none; }
.fab { display: none; }

/* ---------- Recebimento ---------- */
.entry-bar { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 10px; align-items: end; }
.combo { position: relative; }
.combo-list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: linear-gradient(150deg, var(--glass-1), var(--glass-2)), var(--surface-solid); border-radius: 16px; box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; z-index: 20; padding: 6px; }
.combo-list button { display: flex; width: 100%; gap: 8px; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 11px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; align-items: center; }
.combo-list button.sel, .combo-list button:hover { background: var(--accent-soft); }
.combo-list mark { background: transparent; color: var(--accent-text); font-weight: 800; }
.big-total { font: 800 44px/1 var(--font-disp); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.qty-input { font: 700 18px var(--mono) !important; text-align: center; }
.flash { animation: flash 1s; }
@keyframes flash { 0% { background: var(--ok-soft); } 100% { background: transparent; } }

/* ---------- Rotas (planejamento e rotas geradas) ---------- */
.route-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.route-card { display: flex; flex-direction: column; overflow: hidden; --rcc: var(--route-color, var(--brand)); transition: transform .35s var(--e-out), box-shadow .3s; }
.route-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--rcc); box-shadow: 0 0 14px var(--rcc); z-index: 1; }
.route-card:hover { box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--rcc) 45%, transparent), 0 16px 34px -20px var(--rcc); }
.route-card.selected { box-shadow: var(--shadow), 0 0 0 2px var(--brand-2), 0 0 30px -10px var(--glow); }
.route-card.rejected { opacity: .55; }
.route-card .rc-head { padding: 14px 16px 8px; display: flex; gap: 10px; align-items: flex-start; }
.route-card .rc-title { font: 700 14.5px/1.3 var(--font-disp); letter-spacing: -.01em; overflow-wrap: break-word; }
.route-card .rc-meta { color: var(--muted); font-size: var(--fs-xs); display: flex; gap: 4px 12px; flex-wrap: wrap; margin-top: 3px; font-weight: 600; }
.route-card .rc-stops { padding: 0 8px; }
.stop { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; min-height: 36px; }
.stop:hover { background: var(--surface-2); }
.stop .seq { width: 22px; height: 22px; border-radius: 7px; background: var(--surface-3); display: grid; place-items: center; font: 700 11px var(--mono); color: var(--text-2); flex: none; }
.stop .vol { font: 700 12.5px var(--mono); font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }
.stop .stop-actions { opacity: 0; display: flex; gap: 2px; transition: opacity .2s; }
.stop:hover .stop-actions, .stop:focus-within .stop-actions { opacity: 1; }
@media (hover: none) { .stop .stop-actions { opacity: 1; } }
.route-card .rc-foot { margin-top: auto; padding: 10px 16px 14px; border-top: 1px solid var(--line); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cap-line { padding: 4px 16px 10px; display: flex; gap: 8px; align-items: center; font: 600 12px var(--mono); color: var(--muted); }
.cap-line .progress { flex: 1; }
.pool { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: 99px; border: 0; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.chip strong { font: 700 12px var(--mono); font-variant-numeric: tabular-nums; }
.chip.retained { color: var(--load); background: var(--load-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--load) 40%, transparent); }

/* ---------- Mapas (Leaflet) ---------- */
.map-layout { position: relative; z-index: 0; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0; height: calc(100dvh - var(--header-h) - 160px); min-height: 480px; border-radius: var(--radius); overflow: hidden; background: var(--map-bg); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); min-width: 0; }
#map { position: relative; z-index: 0; height: 100%; width: 100%; min-width: 0; background: var(--map-bg); }
.map-side { border-left: 1px solid var(--line); overflow: auto; display: flex; flex-direction: column; min-width: 0; background: linear-gradient(150deg, var(--glass-1), var(--glass-2)), var(--surface); }
.map-side section { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.legend { display: grid; gap: 6px; font-size: 12.5px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.pin-label { background: var(--surface-solid); color: var(--text); border: 0; box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow); border-radius: 8px; padding: 1px 6px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.leaflet-container { font: 13px var(--font); background: var(--map-bg) !important; position: relative; z-index: 0 !important; max-width: 100%; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-lg); }
.leaflet-popup-content-wrapper { border-radius: 16px; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface-solid); color: var(--text); border-color: var(--line); }
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow), 0 0 0 1px var(--line) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-container .leaflet-bar a { width: 36px; height: 36px; line-height: 36px; }
:root[data-theme="dark"] .leaflet-tile-pane { filter: brightness(.72) contrast(1.08) saturate(.7) sepia(.15); }
.mini-map { height: 300px; border-radius: 16px; margin-top: 8px; position: relative; z-index: 0; isolation: isolate; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.seq-pin { width: 22px; height: 22px; border-radius: 50%; color: #fff; font: 700 11px var(--font); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .45); }
.seq-pin.done { opacity: .55; }
.dir-arrow { font-size: 14px; line-height: 16px; text-align: center; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.map-route { display: flex; flex-direction: column; gap: 4px; }
.leg-list { list-style: none; margin: 0 0 4px 10px; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.base-pin { width: 28px; height: 28px; border-radius: 9px; background: var(--brand); color: #fff; font: 800 12px var(--font-disp); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 0 14px var(--glow), 0 1px 5px rgba(0, 0, 0, .5); }
.truck-pin { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .5); }

/* ---------- Bipagem ---------- */
.scan-input { font: 700 clamp(18px, 2.4vw, 24px) var(--mono) !important; letter-spacing: .04em; padding: 14px 18px !important; min-height: 64px !important; border-radius: 20px !important; background: rgba(14, 9, 5, .45) !important; box-shadow: inset 0 0 0 1px rgba(255, 180, 130, .25) !important; }
:root[data-theme="light"] .scan-input { background: rgba(255, 255, 255, .85) !important; }
.scan-input:focus { box-shadow: inset 0 0 0 1.5px var(--brand-2), 0 0 0 6px rgba(252, 97, 5, .12), 0 0 40px -10px var(--glow) !important; }
.scan-input::placeholder { font: 600 15px var(--font); letter-spacing: 0; }
.scan-feedback { border-radius: 20px; padding: 16px 18px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 15px; font-weight: 650; min-height: 72px; line-height: 1.4; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .25s, box-shadow .25s; }
.scan-feedback > .icon { width: 30px; height: 30px; flex: none; }
.scan-feedback.ok { background: linear-gradient(150deg, rgba(52, 227, 160, .2), rgba(52, 227, 160, .05)); color: var(--ok); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ok) 55%, transparent), 0 0 40px -16px var(--ok); }
.scan-feedback.warn { background: linear-gradient(150deg, rgba(255, 192, 77, .2), rgba(255, 192, 77, .05)); color: var(--warn); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--warn) 60%, transparent), 0 0 40px -16px var(--warn); }
.scan-feedback.danger { background: linear-gradient(150deg, rgba(255, 107, 129, .2), rgba(255, 107, 129, .05)); color: var(--danger); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--danger) 60%, transparent), 0 0 40px -16px var(--danger); }
.scan-feedback.idle { color: var(--muted); }
.scan-feedback > .grow { flex: 1 1 220px; min-width: 0; color: var(--text); }
.scan-feedback > .row { flex: 0 1 auto; flex-wrap: wrap; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px; }
.stat { border-radius: 18px; padding: 12px 14px; background: linear-gradient(150deg, var(--glass-1), var(--glass-2)), var(--surface); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.stat b { display: block; font: 800 24px/1.15 var(--font-disp); letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat span { font-size: var(--fs-xs); color: var(--muted); font-weight: 700; line-height: 1.35; display: block; }
.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 10px; margin-top: 12px; }
.city-btn { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px 16px; min-height: 88px; border-radius: 18px; border: 0; color: var(--text); cursor: pointer; font: inherit; line-height: 1.35;
  background: linear-gradient(150deg, var(--glass-1), var(--glass-2)), var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow); transition: transform .25s var(--e-out), box-shadow .3s; }
.city-btn strong { font: 700 16px/1.25 var(--font-disp); overflow-wrap: break-word; }
.city-btn:hover, .city-btn:focus-visible { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--brand-2), 0 14px 30px -14px var(--glow); outline: none; }
.scan-page { display: flex; flex-direction: column; gap: 14px; max-width: 1040px; margin: 0 auto; }
.scan-totals { display: grid; grid-template-columns: 2fr repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat.big { padding: 18px 20px; background: radial-gradient(400px 200px at 100% 0%, rgba(255, 150, 70, .22), transparent 70%), linear-gradient(150deg, var(--glass-1), var(--glass-2)), var(--surface); }
.stat.big b { font-size: clamp(44px, 5vw, 64px); line-height: 1.12; margin: 6px 0 4px; color: var(--text); }
.scan-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.scan-actions .btn { min-height: 52px; }
.sync-ind { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sync { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 12px; border-radius: 99px; font-weight: 750; font-size: var(--fs-xs); line-height: 1.25; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.sync.ok { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 35%, transparent); }
.sync.warn { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 35%, transparent); }
.sync.danger { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent); }
.tbl tr.rep td { background: var(--danger-soft); color: var(--danger); font-weight: 650; }
.tbl tr.cancelled td { color: var(--muted); text-decoration: line-through; }
.tbl tr.cancelled td:last-child, .tbl tr.cancelled td .badge { text-decoration: none; }
.tbl tr.pending-row td, .tbl tr.warn-row td { background: var(--warn-soft); }
.sheet-tbl th { position: sticky; top: 0; background: var(--surface-solid); z-index: 1; }
.sheet-tbl td, .sheet-tbl th { white-space: nowrap; }

/* ---------- Financeiro, abas, listas ---------- */
.composition { display: grid; gap: 4px; font-size: var(--fs-sm); }
.composition div { display: flex; justify-content: space-between; gap: 12px; }
.composition .total { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 750; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabs { position: relative; display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; margin-bottom: 18px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); width: fit-content; max-width: 100%; }
.tabs button { min-height: 36px; padding: 6px 14px; border: 0; border-radius: 12px; background: none; color: var(--muted); font: 750 13px/1.2 var(--font); cursor: pointer; text-align: center; transition: color .25s, background-color .25s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: #fff; background: linear-gradient(120deg, #ffa25c, #fc6105 60%, #d94a0a); box-shadow: 0 6px 18px -8px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .35); }
.checklist { display: grid; gap: 6px; }
.checklist a { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 14px; color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); line-height: 1.35; }
.checklist a:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--edge-b); }
.checklist .ok { color: var(--ok); } .checklist .pend { color: var(--warn); }
.chart-box { position: relative; height: 260px; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 8px; }
.quick-actions a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font-weight: 700; font-size: var(--fs-sm); line-height: 1.25; }
.quick-actions a:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--edge-b), 0 8px 22px -14px var(--glow); }
.quick-actions a .icon { color: var(--accent-text); }
.date-nav { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.date-nav input { border: 0; min-height: 36px; width: 150px; padding: 4px 6px; box-shadow: none !important; background: transparent; font-weight: 700; }
.date-nav .btn { --h: 36px; box-shadow: none; }
.quick-dates { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.perm-box { border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 16px; padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 8px 14px; }
.perm-box legend { font-weight: 700; padding: 0 6px; }
.perm-box .hint { grid-column: 1 / -1; }
.perm-box label:has(input:disabled) { opacity: .65; }

/* ---------- Rotas de Entrega, Acompanhamento ---------- */
ul.plain { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.badges, .flag-line { display: flex; flex-wrap: wrap; gap: 4px; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; min-height: 150px; padding: 22px; border-radius: 20px; border: 1.5px dashed var(--edge-b); background: var(--surface-2); cursor: pointer; color: var(--text); transition: background-color .25s, border-color .25s, box-shadow .3s; }
.dropzone:hover, .dropzone.over, .dropzone:focus-within { border-color: var(--brand-2); background: var(--accent-soft); box-shadow: 0 0 34px -14px var(--glow); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone .icon.lg { width: 30px; height: 30px; color: var(--accent-text); }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chips .chip { cursor: pointer; font: 700 12.5px var(--font); min-height: 36px; color: var(--text-2); }
.filter-chips .chip.on { color: #fff; background: linear-gradient(120deg, #ffa25c, #fc6105 60%, #d94a0a); box-shadow: 0 6px 18px -8px var(--glow); }
.orig { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); border-radius: 14px; padding: 10px 12px; }
.orig .mono { white-space: pre-wrap; word-break: break-word; }
.sel-cell input { width: 20px; height: 20px; }
.smart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.smart-map-wrap { position: sticky; top: calc(var(--header-h) + 36px); min-width: 0; }
.smart-map { height: calc(100dvh - var(--header-h) - 150px); min-height: 420px; border-radius: var(--radius); position: relative; z-index: 0; isolation: isolate; overflow: hidden; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); background: var(--map-bg); }
.map-note { margin-top: 8px; }
.smart-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.route-box { box-shadow: var(--shadow), inset 4px 0 0 var(--rc, var(--brand)); }
.route-box .card-body { padding: 12px 16px; }
.rc-metrics { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-sm); margin-bottom: 6px; }
.rc-form { margin-top: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); align-items: end; }
.rc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.stop-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 30px; border-radius: 12px; }
.stop-list.drop { outline: 2px dashed var(--brand-2); outline-offset: 2px; }
.stop-item { border-radius: 14px; padding: 9px 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.stop-item[draggable="true"] { cursor: grab; }
.stop-item.dragging { opacity: .45; }
.stop-item.locked { background: var(--warn-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 50%, transparent); }
.stop-item.base-row { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); border: 0; outline: 1px dashed var(--line-strong); outline-offset: -4px; }
.stop-main { display: flex; gap: 10px; align-items: flex-start; }
.stop-main .seq-pin { flex: none; margin-top: 2px; }
.stop-btns { display: flex; flex-wrap: wrap; gap: 2px; justify-content: flex-end; max-width: 50%; }
.stop-btns select { width: auto; min-width: 92px; }
.stop-dels { list-style: none; margin: 6px 0 0 30px; padding: 0; display: grid; gap: 4px; }
.stop-dels li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.proof-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0 30px; }
.proof-thumb { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text); }
.proof-thumb img { width: 96px; height: 72px; object-fit: cover; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); background: #fff; }
.timeline li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.ed-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ed-map-col { position: sticky; top: 0; min-width: 0; }
.flow-steps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.flow-steps li { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-xs); font-weight: 700; color: var(--muted); line-height: 1.25; }
.flow-steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text); font: 700 11px var(--mono); flex: none; }
.flow-steps li.on { color: var(--text); box-shadow: inset 0 0 0 1px var(--brand-2), 0 0 20px -10px var(--glow); }
.flow-steps li.on span, .flow-steps li.done span { background: var(--grad); color: #fff; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; margin: 0; font-size: var(--fs-sm); }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.provider-notes { display: block; position: relative; padding-left: 42px; }
.provider-notes > .icon, .provider-notes > svg { position: absolute; left: 14px; top: 13px; }
.provider-notes summary { cursor: pointer; list-style: revert; font-weight: 700; }
.provider-notes[open] summary { margin-bottom: 6px; }

/* ---------- Portal do Motorista ---------- */
.driver-shell .main { margin-left: 0 !important; padding-left: max(18px, env(safe-area-inset-left)); }
.driver-shell .topbar .brand-logo { width: 38px; height: 38px; }
.driver-shell .content { max-width: 760px; margin: 0 auto; }
.driver-shell .topbar { max-width: 760px; width: 100%; margin-left: auto; margin-right: auto; }
.drv-head { margin: 6px 0 16px; }
.drv-head h1 { font-size: clamp(22px, 5vw, 28px); }
.drv-cards { display: grid; gap: 12px; }
.drv-card { display: block; padding: 16px 18px; color: var(--text); overflow: hidden; }
.drv-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--rc, var(--brand)); box-shadow: 0 0 14px var(--rc, var(--brand)); }
.drv-card:hover { text-decoration: none; box-shadow: var(--shadow), 0 0 0 1px var(--edge-b); }
.drv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.drv-actions .btn { flex: 1 1 140px; }
.next-stop { box-shadow: var(--shadow), 0 0 0 1.5px var(--brand-2), 0 0 40px -16px var(--glow) !important; background: radial-gradient(500px 220px at 100% 0%, rgba(255, 150, 70, .2), transparent 70%), linear-gradient(150deg, var(--glass-1), var(--glass-2)), var(--surface) !important; }
.stop-addr b { font: 700 18px/1.3 var(--font-disp); }
.drv-dels { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.drv-dels li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.drv-map { height: min(60dvh, 460px); min-height: 280px; border-radius: var(--radius); margin-bottom: 14px; position: relative; z-index: 0; isolation: isolate; overflow: hidden; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); background: var(--map-bg); }
.drv-stops { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.drv-stop-btn { display: flex; width: 100%; gap: 12px; align-items: center; text-align: left; padding: 12px 14px; min-height: 64px; border-radius: 16px; border: 0; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font: inherit; cursor: pointer; line-height: 1.35; transition: box-shadow .25s; }
.drv-stop-btn:hover, .drv-stop-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--brand-2), 0 0 24px -10px var(--glow); }
.drv-stop.done .drv-stop-btn { opacity: .75; }
.drv-stop .seq-pin { width: 30px; height: 30px; font-size: 13px; flex: none; }
.outcomes { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.outcomes legend { font-weight: 700; font-size: var(--fs-xs); margin-bottom: 6px; }
.outcome { display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 10px 12px; border-radius: 16px; border: 0; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); font: 700 14px/1.3 var(--font); cursor: pointer; text-align: left; transition: box-shadow .25s; }
.outcome.on { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 2px var(--brand-2), 0 0 24px -10px var(--glow); }
.photo-prev { max-height: 220px; width: auto; border-radius: 14px; margin-top: 6px; box-shadow: inset 0 0 0 1px var(--line); }
canvas.sig { width: 100%; height: auto; aspect-ratio: 600 / 220; background: #fff; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-strong); touch-action: none; }

/* ---------- Impressão ---------- */
.print-only { display: none; }
@media print {
  html, body { background: #fff !important; color: #000; }
  body::before, body::after { display: none; }
  .sidebar, .rail, .mnav, .atmo, .topbar, .bottom-nav, .fab, .no-print, .toasts, .page-head .actions, .card-head .actions, .qa-pop { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .content { padding: 0; max-width: none; }
  .card, .kpi, .route-card, .glass { background: #fff !important; box-shadow: none !important; border: 1px solid #ccc; break-inside: avoid; color: #000; }
  .card::before, .card::after, .route-card::after, .glass::before, .glass::after { display: none; }
  .print-only { display: block; }
  .route-cards { grid-template-columns: 1fr 1fr; }
  a { color: #000; }
}

/* =================== Responsividade =================== */
@media (max-width: 1439px) {
  .search-box { flex-basis: 260px; }
  .search-box:focus-within { flex-basis: 340px; }
}
@media (max-width: 1365px) {
  .user-chip .who { display: none; }
  .user-chip { padding-right: 8px; }
}
@media (max-width: 1279px) {
  .qa-top kbd { display: none; }
  /* Busca vira botão; ao tocar abre por cima da barra */
  .search-box { flex: 0 0 42px; justify-content: center; cursor: pointer; }
  .search-box > .icon { margin: 0; }
  .search-box input, .search-box kbd { display: none; }
  .search-box.open { position: absolute; left: 10px; right: 10px; top: 10px; height: calc(100% - 20px); z-index: 3; background: var(--surface-solid); justify-content: flex-start; cursor: auto; }
  .search-box.open > .icon { margin: 0 8px 0 13px; }
  .search-box.open input { display: block; }
}
@media (max-width: 1180px) {
  .grid.side, .grid.side-left { grid-template-columns: minmax(0, 1fr); }
  .map-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  #map { height: 60vh; min-height: 380px; }
  .map-side { border-left: 0; border-top: 1px solid var(--line); }
  .smart-layout { grid-template-columns: minmax(0, 1fr); }
  .smart-map-wrap { position: relative; top: 0; }
  .smart-map { height: min(55dvh, 480px); min-height: 300px; }
}
@media (max-width: 1099px) {
  body { --side-w: var(--side-w-collapsed); }
  body:not(.side-open) .sidebar:not(:hover) .brand-text, body:not(.side-open) .sidebar:not(:hover) .nav a > span, body:not(.side-open) .sidebar:not(:hover) .nav-section .txt, body:not(.side-open) .sidebar:not(:hover) .side-foot, body:not(.side-open) .sidebar:not(:hover) .nav a .fav-toggle { opacity: 0; pointer-events: none; }
  .sidebar .nav a > span, .sidebar .nav-section { white-space: nowrap; }
  body:not(.side-open) .sidebar:not(:hover) .nav-section { padding-left: 16px; }
  .sidebar:hover, body.side-open .sidebar { width: 312px; box-shadow: var(--shadow-lg); }
  body.side-open::after { content: ""; position: fixed; inset: 0; background: rgba(10, 5, 2, .4); z-index: 980; -webkit-mask-image: none; mask-image: none; }
  .scan-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scan-totals .stat.big { grid-column: 1 / -1; }
}
@media (max-width: 899px) {
  .topbar .ttl .eyebrow { display: none; }
  .qa-top .t { display: none; } .qa-top { padding: 0 12px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .entry-bar { grid-template-columns: minmax(0, 1fr) 100px; }
  .entry-bar .add-btn { grid-column: 1 / -1; }
  .ed-grid { grid-template-columns: minmax(0, 1fr); } .ed-map-col { position: static; }
  .pool .chip { min-height: 40px; }
  /* Tabelas viram cartões no celular */
  table.tbl.responsive thead { display: none; }
  table.tbl.responsive, .tbl.responsive tbody, .tbl.responsive tr, .tbl.responsive td { display: block; width: 100%; }
  .tbl.responsive tr { border-bottom: 1px solid var(--line); padding: 10px 4px; }
  .tbl.responsive td { border: 0; padding: 5px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; min-width: 0; overflow-wrap: break-word; }
  .tbl.responsive td::before { content: attr(data-label); font-weight: 700; color: var(--muted); font-size: var(--fs-xs); text-align: left; flex: none; max-width: 48%; }
  .tbl.responsive td:has(> div.small) { flex-wrap: wrap; row-gap: 2px; }
  .tbl.responsive td:has(> div.small) > div.small { flex-basis: 100%; }
  .tbl.responsive td.actions { justify-content: flex-end; flex-wrap: wrap; }
  .tbl.responsive td.actions::before { content: none; }
  .tbl.responsive tfoot { display: block; }
  .tbl.responsive tfoot tr { display: flex; flex-wrap: wrap; }
  .tbl.responsive tfoot td:empty { display: none; }
  html { scroll-padding-bottom: 96px; scroll-padding-top: 84px; }
}
/* Alvos de toque: 44 px no celular e no tablet */
@media (max-width: 899px), (pointer: coarse) {
  .btn, .btn.sm { --h: var(--tap); }
  .icon-btn, .user-chip, .qa-top { min-height: var(--tap); height: var(--tap); }
  .icon-btn { width: var(--tap); }
  .user-chip { min-width: var(--tap); justify-content: center; }
  .nav a, .dropdown .dd-item, .checklist a, .search-results a, .combo-list button { min-height: var(--tap); }
  .tabs button, .btn-group .btn, .filter-chips .chip, .chip { min-height: var(--tap); }
  .qa-top { min-width: var(--tap); justify-content: center; }
  .btn { min-width: var(--tap); }
  .check { min-height: var(--tap); }
  input, select { min-height: var(--tap); }
  .date-nav input, .date-nav .btn { min-height: var(--tap); --h: var(--tap); }
  .date-nav .btn.icon-only, .date-nav .btn.sm { min-width: var(--tap); }
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; }
  .stop .stop-actions .btn, .stop-btns .btn.icon-only { --h: var(--tap); }
}
@media (max-width: 599px) {
  .sidebar { top: 0; bottom: 0; left: 0; width: min(320px, 88vw) !important; border-radius: 0 28px 28px 0; transform: translateX(-105%); box-shadow: var(--shadow-lg); visibility: hidden; transition: transform .45s var(--e-out), visibility 0s linear .45s; }
  body.side-open .sidebar { transform: none; visibility: visible; transition: transform .45s var(--e-out), visibility 0s; }
  body.side-open::after { content: ""; position: fixed; inset: 0; background: rgba(10, 5, 2, .5); z-index: 980; -webkit-mask-image: none; mask-image: none; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  .sidebar .brand-text, .sidebar .nav a > span, .sidebar .nav-section .txt, .sidebar .side-foot, .sidebar .nav a .fav-toggle { opacity: 1 !important; pointer-events: auto !important; }
  .sidebar .nav a > span, .sidebar .nav-section { white-space: normal !important; }
  .sidebar .nav-section { padding-left: 10px !important; }
  .main, body.side-collapsed .main { margin-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .topbar { top: calc(8px + env(safe-area-inset-top)); margin-top: 8px; padding: 8px; gap: 8px; border-radius: 20px; min-height: 60px; }
  .topbar .mmark { display: grid; }
  .topbar .title { font-size: 15px; }
  #menu-btn { display: none; }
  .search-box, #theme-btn, .user-chip .icon { display: none; }
  .search-box.open { display: flex; }
  .content { padding: 18px 2px 140px; }
  h1 { font-size: 25px; }
  .page-head { margin-bottom: 14px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .page-head .actions > .btn { flex: 1 1 auto; }
  .card-head, .card-body { padding-left: 14px; padding-right: 14px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 22px; }
  .route-cards { grid-template-columns: minmax(0, 1fr); }
  .toolbar input, .toolbar select, .toolbar .search { min-width: 0; flex: 1 1 140px; max-width: none; }
  .modal-foot .btn { flex: 1 1 auto; }
  .date-nav input { width: 132px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .btn-group { width: 100%; }
  .btn-group .btn { flex: 1 1 auto; }
  .tabs { width: 100%; }
  .tabs button { flex: 1 1 auto; }
  .city-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .city-btn { padding: 12px; min-height: 80px; }
  .scan-actions { grid-template-columns: 1fr 1fr; } .scan-actions .btn.primary { grid-column: 1 / -1; }
  .scan-feedback > .row { flex: 1 1 100%; } .scan-feedback > .row .btn { flex: 1 1 auto; }

  .stop-main { flex-wrap: wrap; }
  .stop-btns { max-width: none; width: 100%; justify-content: flex-start; }
  .stop-dels, .proof-row { margin-left: 0; }
  .rc-actions .btn { flex: 1 1 auto; }
  .outcomes { grid-template-columns: minmax(0, 1fr); }
  .mini-map { height: 240px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; } .kv dd { margin-bottom: 6px; }
  .alert:has(> .row) { flex-wrap: wrap; } .alert > .grow { flex: 1 1 calc(100% - 34px); } .alert > .row { flex: 1 1 100%; justify-content: flex-end; }
  .map-layout { min-height: 0; } #map { height: min(55dvh, 480px); min-height: 300px; }
  .chart-box { height: 220px; }
  .qa-grid { grid-template-columns: minmax(0, 1fr); }
  .toasts { bottom: auto; }
  /* Barra inferior flutuante */
  .bottom-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; z-index: 950; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom));
    padding: 6px; border-radius: 24px; isolation: isolate; background: linear-gradient(150deg, var(--glass-1), var(--glass-2)), var(--surface); box-shadow: var(--shadow-lg); }
  .bottom-nav a, .bottom-nav button { position: relative; z-index: 1; display: grid; justify-items: center; align-content: center; gap: 3px; min-width: 0; min-height: 58px; padding: 8px 2px 6px; border: 0; border-radius: 18px; background: none; color: var(--muted); font: 750 var(--fs-cap)/1.15 var(--font); text-align: center; cursor: pointer; transition: color .3s; }
  .bottom-nav a .icon, .bottom-nav button .icon { width: 21px; height: 21px; }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav a.active { color: var(--text); background: linear-gradient(150deg, rgba(255, 150, 70, .2), rgba(252, 97, 5, .1)); box-shadow: inset 0 0 0 1px rgba(255, 180, 130, .3), 0 0 22px -8px var(--glow); }
  .bottom-nav a.active .icon { color: var(--accent-text); filter: drop-shadow(0 0 6px var(--glow)); }
  .bottom-nav .scan .icon { width: 48px; height: 48px; padding: 12px; margin-top: -22px; border-radius: 16px; color: #fff; background: linear-gradient(145deg, #ffa25c, #fc6105 60%, #d94a0a); box-shadow: 0 10px 24px -8px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .4); box-sizing: border-box; }
  .bottom-nav .scan.active { background: none; box-shadow: none; }
  .bottom-nav .scan.active .icon { color: #fff; filter: none; box-shadow: 0 0 0 3px var(--glow-soft), 0 10px 24px -8px var(--glow); }
  .driver-nav { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scan-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scan-totals .stat { padding: 10px; } .scan-totals .stat b { font-size: 20px; } .scan-totals .stat.big b { font-size: 44px; }
  .sheet .qa-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .scan-totals { grid-template-columns: minmax(0, 1fr); }
  .scan-totals .stat:not(.big) { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
}
@media (max-width: 360px) {
  .kpis, .city-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-row { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 600px) { .driver-shell .bottom-nav { display: none; } }
@media (max-width: 599px) { .driver-shell .main { padding-left: max(12px, env(safe-area-inset-left)); } }
@media (hover: none) { .card::after, .glass::after { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
/* Efeitos leves (celulares simples): sem desfoque nem auroras animadas */
:root[data-fx="lite"] body::before { animation: none; }
:root[data-fx="lite"] .topbar, :root[data-fx="lite"] .sidebar, :root[data-fx="lite"] .bottom-nav, :root[data-fx="lite"] .modal, :root[data-fx="lite"] .dropdown, :root[data-fx="lite"] .sheet, :root[data-fx="lite"] .toast, :root[data-fx="lite"] .qa-pop, :root[data-fx="lite"] .search-results, :root[data-fx="lite"] .combo-list, :root[data-fx="lite"] .login-box {
  -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-fx="lite"] { --surface: color-mix(in srgb, var(--surface-solid) 92%, transparent); }

/* ---------- Complementos da moldura (v1.6.0) ---------- */
.brand-logo.has-img { background: var(--surface-3); }
.brand-logo.has-img img { object-fit: contain; }
.topbar .mmark { width: 36px; height: 36px; border-radius: 10px; }
.qa-pop .qa-grid a[data-qa-search], .sheet .qa-grid a[data-qa-search] { display: none; }
@media (max-width: 1279px) { .qa-pop .qa-grid a[data-qa-search] { display: flex; } }
@media (max-width: 599px) {
  .sheet .qa-grid a[data-qa-search] { display: flex; }
  .bottom-nav.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 600px) { #theme-dd { display: none; } }
.kpis.mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.avatar.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 10.5px; }
/* Minha Conta */
.swatches { flex-wrap: wrap; gap: 8px; }
.btn.swatch { background: var(--sw); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.btn.swatch.on { outline: 3px solid var(--text); outline-offset: 2px; }
.color-in { width: 28px; height: 22px; min-height: 0; border: 0; padding: 0; background: none; }
.check.fav-opt { display: flex; min-height: var(--tap); padding: 10px 12px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; overflow-wrap: anywhere; }
.check.fav-opt .icon { color: var(--accent-text); }
.base-pin { width: 30px; height: 30px; border-radius: 9px; background: #fc6105 var(--logo) center / cover no-repeat; color: transparent; font-size: 0; border: 2px solid #fff; box-shadow: 0 0 0 4px rgba(252, 97, 5, .3), 0 4px 12px rgba(0, 0, 0, .45); }
@media (max-width: 599px) {
  .topbar .ttl { min-width: 0; flex: 1 1 0; }
  .user-chip { padding: 4px; }
}
@media (max-width: 380px) {
  .topbar, .top-actions { gap: 6px; }
  .topbar .mmark { width: 32px; height: 32px; }
  .topbar .title { font-size: 14px; }
}
/* Abaixo de 360 px o título do topo não cabe ao lado das ações; o título da própria página (h1) aparece logo abaixo */
@media (max-width: 359px) {
  .topbar .ttl { visibility: hidden; }
}
.toolbar input[type="checkbox"], .toolbar input[type="radio"] { flex: none; width: 18px; min-width: 0; max-width: none; }
@media (max-width: 899px), (pointer: coarse) { .toolbar input[type="checkbox"], .toolbar input[type="radio"] { width: 22px; } }
/* Seleção das rotas no planejamento: a área de toque é o rótulo inteiro */
.sel-hit { display: grid; place-items: center; flex: none; min-width: 32px; min-height: 32px; margin: -6px 0 -6px -6px; cursor: pointer; border-radius: 10px; }
.sel-hit:hover { background: var(--surface-3); }
@media (max-width: 899px), (pointer: coarse) { .sel-hit { min-width: var(--tap); min-height: var(--tap); margin: -10px 0 -10px -10px; } }
.leaflet-container.leaflet-touch .leaflet-bar a { width: var(--tap); height: var(--tap); line-height: var(--tap); }
