/* =========================================================
   Trakker Cliente — app.css — base compartilhada por TODAS as
   telas do app do cliente (login à parte, que tem seu próprio
   <style> em index.html, mas usa as mesmas variáveis daqui):
   variáveis de cor/fonte, reset, topo (app-topbar), menu lateral
   (app-sidebar), cartões, botões, modais/folhas, pílulas de
   status, toast e os poucos componentes usados em mais de uma
   tela (resumo em "hero", plano do veículo, abas de veículo,
   trajetos, faturas). O que é específico de UMA tela só fica no
   CSS dela (css/mapa.css, css/cercas.css).

   Mobile-first: todo o layout parte do celular; os breakpoints no
   fim do arquivo (a partir de 640px) só limitam a largura e dão
   mais respiro em tablets/telas maiores — o app nunca vira um
   "site de desktop", continua com cara de app em qualquer tamanho.
   ========================================================= */

:root {
  --bg: #FFFFFF;
  --surface: #F2F5FC;
  --surface-hi: #E7EDFB;
  --border: #D6E0F5;
  --border-soft: #E4EAF8;
  --text: #10162B;
  --text-dim: #545F80;
  --text-faint: #93A0C2;

  --primary: #2E5CF6;
  --primary-hi: #1A46E0;
  --primary-dim: #7C97F7;
  --primary-soft: #E7ECFE;

  --rust: #FF5A2E;
  --rust-hi: #E7440F;
  --rust-soft: #FFE4DA;

  --ok: #17A34A;
  --ok-soft: #DCF3E4;
  --alert: #E63946;
  --alert-soft: #FBDEE1;

  /* Mesmo tom de azul da barra de título do painel administrativo
     (css/layout.css lá) — deixa a barra superior do app do cliente
     com a mesma identidade visual. */
  --topbar-from: #101B4D;
  --topbar-to: #070C29;

  /* Uma família só pro app inteiro (Inter) — títulos usam peso
     maior em vez de trocar de fonte, pra tudo ficar visualmente
     consistente. --font-display é mantido (mesmo valor de
     --font-body) só pra não precisar reescrever cada regra que já
     usava var(--font-display); IBM Plex Mono continua à parte, só
     pro que é literalmente monoespaçado (placa, código Pix). */
  --font-display: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --topbar-h: 58px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ---------------------------------------------------------
   Modo escuro — segue a preferência do sistema por padrão
   (prefers-color-scheme) e pode ser fixado em claro/escuro via
   data-theme no <html>, escolhido em Configurações e guardado no
   localStorage (ver js/theme.js, carregado bem cedo em cada
   página pra evitar "flash" de tema errado). Como o app inteiro
   já usa essas variáveis (nada de cor "cravada" nos componentes),
   só redefinir os tokens aqui já basta — sem precisar mexer em
   cada regra espalhada pelos outros arquivos CSS.
   --------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0F1F;
    --surface: #10152B;
    --surface-hi: #171D38;
    --border: #262E52;
    --border-soft: #1D2444;
    --text: #EDF0FB;
    --text-dim: #A2ACD1;
    --text-faint: #626E99;

    --primary: #5B7CFA;
    --primary-hi: #7C97F7;
    --primary-dim: #3A4FA0;
    --primary-soft: #1B2450;

    --rust: #FF7A52;
    --rust-hi: #FF5A2E;
    --rust-soft: #3A1F16;

    --ok: #34C471;
    --ok-soft: #123322;
    --alert: #FF6B78;
    --alert-soft: #3A1820;

    --topbar-from: #0B1130;
    --topbar-to: #05081C;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0F1F;
  --surface: #10152B;
  --surface-hi: #171D38;
  --border: #262E52;
  --border-soft: #1D2444;
  --text: #EDF0FB;
  --text-dim: #A2ACD1;
  --text-faint: #626E99;

  --primary: #5B7CFA;
  --primary-hi: #7C97F7;
  --primary-dim: #3A4FA0;
  --primary-soft: #1B2450;

  --rust: #FF7A52;
  --rust-hi: #FF5A2E;
  --rust-soft: #3A1F16;

  --ok: #34C471;
  --ok-soft: #123322;
  --alert: #FF6B78;
  --alert-soft: #3A1820;

  --topbar-from: #0B1130;
  --topbar-to: #05081C;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* html/body TRAVADOS (nunca rolam) — é isso que impede o "puxar pra
   baixo e arrastar a tela toda" (bounce/rubber-band) do Safari/iOS,
   que revelava um vão atrás da barra superior. Quem rola de verdade
   é .app-content, um contêiner por dentro do app-shell; a barra
   superior (sticky dentro dele) fica sempre visível e nunca se
   descola do topo. Precisa de position:fixed no body (não só
   overflow:hidden) porque no Safari/iOS o "bounce" acontece no nível
   da viewport, não só num elemento com overflow. */
html {
  height: 100%;
  overflow: hidden;
  /* v37: "arrastar horizontal na tela volta pra página anterior" —
     é o gesto de "voltar" que o Chrome/Android (e alguns WebViews)
     ativa sozinho ao ver um arraste horizontal que a página não
     "consumiu" como rolagem, mesmo sem nenhum elemento rolando de
     verdade na horizontal. overscroll-behavior:none no body (linha
     abaixo) sozinho não bastava porque o body aqui é position:fixed
     (não é ele que o navegador considera o "scroller" da página pra
     esse gesto) — o <html> (a raiz) precisa declarar isso também. */
  overscroll-behavior-x: none;
}
body {
  /* var(--app-vvh, ...) = altura visível de verdade da tela (ver
     js/theme.js, window.visualViewport) — sem isso, "100%" no
     Safari/iOS corresponde ao viewport de LAYOUT (inclui a área
     atrás da barra do navegador quando ela está visível), deixando
     conteúdo perto do fim da tela escondido atrás dela. */
  height: var(--app-vvh, 100%);
  width: 100%;
  position: fixed;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
/* Trava o zoom por pinça/duplo-toque em TODO o app — sem isso, num
   PWA/site aberto no Safari, dá pra beliscar a tela e a página cresce
   igual um site normal, o que quebra a sensação de "aplicativo".
   O <meta viewport> (maximum-scale=1, user-scalable=no) já ajuda,
   mas o próprio iOS ignora essa parte do viewport em alguns casos
   por acessibilidade — 'touch-action: manipulation' é o reforço que
   funciona de verdade: continua permitindo rolar/arrastar normal,
   só desliga o gesto de zoom. */
html, body { touch-action: manipulation; }
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

/* Trava o scroll do conteúdo (não do body, que já fica sempre
   travado acima) enquanto o menu lateral ou a barra de veículos
   (mapa.html) está aberta — ver initSidebar em js/app.js. */
body.sidebar-locked .app-content { overflow: hidden; }

/* ---------------------------------------------------------
   Casca do app — topo fixo + conteúdo rolável (.app-content, logo
   abaixo, é quem realmente rola dentro dessa casca de altura fixa).
   --------------------------------------------------------- */
.app-shell { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

/* Mesmo azul (e o mesmo gradiente) da barra de título do painel
   administrativo — sem a "logo" T aqui (fica só no topo do menu
   lateral, .sidebar-head), a barra superior mostra só o botão de
   menu e o nome da tela, com ícones/texto em branco por cima do
   fundo escuro. */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding: calc(var(--safe-top)) 14px 0;
  background: linear-gradient(120deg, var(--topbar-from) 0%, var(--topbar-to) 100%);
  box-shadow: 0 4px 18px -8px rgba(7, 12, 41, 0.5);
  flex-shrink: 0;
}

.app-menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.app-menu-btn svg { width: 19px; height: 19px; }
.app-menu-btn:active { background: rgba(255, 255, 255, 0.24); transform: scale(0.93); }

/* Sininho de notificações — mesmo desenho do botão de menu, mas do
   lado direito da barra de título, com uma bolinha de contagem de
   não lidas (ver js/push.js: renderNotifBadge/openNotifPanel). */
.app-notif-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.app-notif-btn svg { width: 18px; height: 18px; }
.app-notif-btn:active { background: rgba(255, 255, 255, 0.24); transform: scale(0.93); }
.app-notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--rust);
  border: 1.5px solid var(--topbar-from);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
}
.app-notif-badge[hidden] { display: none; }

.app-topbar-id { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
/* Fica só no cabeçalho do menu lateral agora — a barra de título
   superior não tem mais logo, só o nome da tela. */
.sidebar-head .app-topbar-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--topbar-from), var(--topbar-to));
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* Barra de título superior mostra o NOME DA TELA (fixo em cada
   página) — o nome do cliente não aparece mais aqui, só no topo
   do menu lateral (.sidebar-client). Texto branco por cima do
   fundo azul escuro. */
.app-topbar-title {
  font-weight: 700;
  font-size: 15.5px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ---------------------------------------------------------
   Conteúdo — rolável, com respiro; app-content-flush tira o
   respiro (usada pela tela de Mapa, que ocupa a tela toda).
   --------------------------------------------------------- */
.app-content {
  flex: 1;
  min-height: 0; /* essencial: sem isso o flex item não encolhe e o scroll interno não aparece */
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 14px calc(24px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain; /* o bounce, quando acontece, fica preso aqui dentro — não puxa a página toda */
  overscroll-behavior-x: none; /* v37: mesmo motivo do <html> acima — este é o container que a pessoa toca de verdade pra rolar a tela */
}
.app-content-flush { max-width: none; padding: 0; margin: 0; overflow: hidden; }

.screen-head { margin-bottom: 16px; }
.screen-head h1 { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--text); }
.screen-head p { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.4; }

.screen-fab-row { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.screen-fab-row .btn-primary { padding: 10px 16px; font-size: 12.5px; }

/* ---------------------------------------------------------
   Menu lateral (sidebar) — desliza da esquerda; a barra de
   veículos do mapa (id="vehicleDrawer") reaproveita a mesma base
   com a classe .from-right pra deslizar da direita.
   --------------------------------------------------------- */
.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(10, 16, 40, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.sidebar-scrim.open { opacity: 1; pointer-events: auto; }

/* Em celular o menu preenche a tela toda (100%) — só a partir do
   breakpoint de tablet/desktop (ver media query no fim do arquivo)
   é que volta a ser uma faixa lateral estreita, no estilo "drawer"
   de app maior. */
.app-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 31;
  width: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  box-shadow: 0 0 40px -12px rgba(10, 16, 40, 0.4);
  padding-top: var(--safe-top);
}
.app-sidebar.open { transform: translateX(0); }
.app-sidebar.from-right { left: auto; right: 0; transform: translateX(100%); }
.app-sidebar.from-right.open { transform: translateX(0); }

.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid var(--border-soft); }
.sidebar-head-text { min-width: 0; flex: 1; }
.sidebar-brand { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text); }
.sidebar-client { font-size: 11.5px; color: var(--text-faint); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-close {
  width: 32px; height: 32px; border-radius: 9px; border: none; background: transparent;
  color: var(--text-faint); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  transition: background 0.15s ease, transform 0.12s ease;
}
.sidebar-close svg { width: 17px; height: 17px; }
.sidebar-close:active { background: var(--surface); transform: scale(0.9); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 10px; flex: 1; overflow-y: auto; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dim);
  transition: background 0.15s ease, transform 0.12s ease;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-nav a:active { background: var(--surface); transform: scale(0.98); }
.sidebar-nav a.active { background: var(--primary-soft); color: var(--primary-hi); font-weight: 600; }

/* Botão de sair — vive no menu lateral (não mais na barra
   superior). Fica logo abaixo da navegação, com sua própria borda
   pra se separar visualmente dos links de tela. */
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-top: 1px solid var(--border-soft);
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--alert);
  cursor: pointer;
  text-align: left;
  flex-shrink: 0;
}
.sidebar-logout svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-logout { transition: background 0.15s ease, transform 0.12s ease; }
.sidebar-logout:active { background: var(--alert-soft); transform: scale(0.98); }

.sidebar-foot { padding: 14px 16px calc(14px + var(--safe-bottom)); font-size: 11px; color: var(--text-faint); border-top: 1px solid var(--border-soft); }
.sidebar-foot .sidebar-version { font-family: var(--font-mono); font-size: 10.5px; opacity: 0.8; }

/* ---------------------------------------------------------
   Cartões, estado vazio, texto monoespaçado
   --------------------------------------------------------- */
.card {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: 0 10px 24px -18px rgba(16, 22, 43, 0.35);
}

.empty-state {
  text-align: center;
  padding: 34px 18px;
  font-size: 12.5px;
  color: var(--text-faint);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.mono { font-family: var(--font-mono); }

/* ---------------------------------------------------------
   Botões — cara de app nativo: cantos bem arredondados (mesmo
   "continuous corner" do iOS/Android), sem toque azulado de link,
   e feedback de toque de verdade (encolhe + escurece um pouco no
   :active, em vez de só um "translateY" sutil) — a pessoa sente
   que apertou, como num botão nativo em vez de um botão de site.
   --------------------------------------------------------- */
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: 13px;
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: -0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: transform 0.12s cubic-bezier(.34,1.4,.64,1), filter 0.15s ease, background 0.15s ease, box-shadow 0.12s ease;
  white-space: nowrap;
}
.btn-primary svg, .btn-secondary svg, .btn-danger svg { flex-shrink: 0; }
.btn-primary:active, .btn-secondary:active, .btn-danger:active { transform: scale(0.96); }
.btn-primary:disabled, .btn-secondary:disabled, .btn-danger:disabled { opacity: 0.55; cursor: default; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hi) 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 10px 20px -10px rgba(46, 92, 246, 0.55);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { filter: brightness(0.95); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 4px 10px -6px rgba(46, 92, 246, 0.5); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-hi); }
.btn-secondary:active { background: var(--surface-hi); border-color: var(--primary-dim); }

/* Vermelho sólido de verdade (era um rosa claro/--alert-soft com
   texto vermelho — lia mais como "aviso" do que como ação de risco;
   "Bloquear remotamente"/"Revogar link" são ações que desligam o
   motor ou derrubam um link — merecem o mesmo peso visual forte que
   .btn-primary tem pra ação positiva, só que na cor de perigo). */
.btn-danger {
  background: linear-gradient(135deg, var(--alert) 0%, var(--rust-hi) 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 10px 20px -10px rgba(230, 57, 70, 0.55);
}
.btn-danger:hover { filter: brightness(1.05); }
.btn-danger:active { filter: brightness(0.93); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 4px 10px -6px rgba(230, 57, 70, 0.5); }

.btn-block { width: 100%; }

.icon-chip { display: inline-flex; align-items: center; justify-content: center; }
.icon-chip svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------
   Pílulas de status
   --------------------------------------------------------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: lowercase;
  white-space: nowrap;
}
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.moving { background: var(--rust-soft); color: var(--rust-hi); }
.status-pill.idle { background: var(--ok-soft); color: var(--ok); }
.status-pill.offline { background: var(--surface-hi); color: var(--text-faint); }
.status-pill.blocked-pill { background: var(--alert-soft); color: var(--alert); }
.status-pill.active-pill { background: var(--ok-soft); color: var(--ok); }

/* botão de alerta de velocidade ligado/pausado reaproveita
   .status-pill, mas como <button> (cursor + sem sombra herdada) */
button.status-pill { border: none; cursor: pointer; }

/* ---------------------------------------------------------
   Modais / folhas (bottom sheets)
   --------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 16, 40, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  padding: 10px 20px calc(20px + var(--safe-bottom));
  transform: translateY(16px);
  transition: transform 0.22s ease;
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }

.modal-sheet-grip { width: 36px; height: 4px; border-radius: 100px; background: var(--border); margin: 4px auto 14px; }

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--text); }
.modal-head p { font-size: 12px; color: var(--text-dim); margin-top: 3px; line-height: 1.4; }

.modal-close {
  width: 30px; height: 30px; border-radius: 9px; border: none; background: var(--surface);
  color: var(--text-dim); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  transition: background 0.15s ease, transform 0.12s ease;
}
.modal-close svg { width: 15px; height: 15px; }
.modal-close:active { background: var(--surface-hi); transform: scale(0.9); }

.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

#formFence, #formAlert { display: flex; flex-direction: column; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 12px; font-weight: 500; color: var(--text-dim); }
.form-field input, .form-field select {
  width: 100%;
  min-height: 46px; /* alvo de toque confortável (Apple HIG recomenda 44pt) */
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  /* 16px é o mínimo pro Safari/iOS NÃO dar zoom automático na tela
     inteira ao focar o campo — abaixo disso (era 14.5px) o app
     parecia "quebrar o zoom" toda vez que alguém tocava um campo. */
  font-size: 16px;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.form-field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393A0C2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}
.form-field input:focus, .form-field select:focus {
  outline: none; border-color: var(--primary); background-color: var(--bg); box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-field .hint { font-size: 11px; color: var(--text-faint); line-height: 1.4; }

/* ---------------------------------------------------------
   Confirmação modal genérica (ver ensureConfirmModal em js/app.js)
   --------------------------------------------------------- */
.modal-confirm {
  width: 100%;
  max-width: 380px;
  background: var(--bg);
  border-radius: 18px;
  padding: 22px 22px calc(20px + var(--safe-bottom));
  text-align: center;
}
.confirm-overlay .modal-confirm { margin: auto; }
.confirm-icon {
  width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--primary-soft); color: var(--primary-hi);
  display: flex; align-items: center; justify-content: center;
}
.confirm-icon svg { width: 22px; height: 22px; }
.confirm-overlay.is-danger .confirm-icon { background: var(--alert-soft); color: var(--alert); }
.confirm-overlay.is-success .confirm-icon { background: rgba(23,163,74,.12); color: #16A34A; }
.modal-confirm h2 { font-family: var(--font-display); font-weight: 600; font-size: 16.5px; margin-bottom: 8px; }
.modal-confirm p { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin-bottom: 20px; }
.confirm-actions { display: flex; flex-direction: column-reverse; gap: 8px; }

/* ---------------------------------------------------------
   PIN de segurança (ver js/pin-security.js) — folha de confirmação
   reaproveita .modal-confirm/.confirm-actions acima, só acrescenta
   o campo do PIN; e o formulário de definir/trocar PIN em
   Configurações reaproveita .form-field (já usado por
   #formFence/#formAlert). */
.modal-pin p { margin-bottom: 14px; }
.pin-input {
  width: 100%;
  text-align: center;
  letter-spacing: 0.5em;
  font-family: var(--font-mono);
  font-size: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 12px 12px 16px;
  color: var(--text);
  margin-bottom: 10px;
}
.pin-input:focus { outline: none; border-color: var(--primary); background: var(--bg); box-shadow: 0 0 0 3px var(--primary-soft); }
.pin-error { font-size: 12px; color: var(--alert); margin: -2px 0 14px; text-align: center; }
.pin-card-note { font-size: 11.5px; color: var(--text-faint); line-height: 1.5; margin: 10px 0 0; }
#formPinSetup { display: flex; flex-direction: column; gap: 14px; }
#formPinSetup .pin-error { margin: -6px 0 0; text-align: left; }

/* Folha de PIN pra comandos (bloquear/desbloquear) — mesmo visual
   do desbloqueio na abertura do app (index.html): cadeado, bolinhas
   e teclado numérico próprio. Ver js/pin-security.js. */
.pinlock-overlay { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.pinlock-sheet {
  position: relative; width: 100%; max-width: 440px; max-height: 94vh; overflow-y: auto;
  background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 10px 22px calc(18px + var(--safe-bottom));
  display: flex; flex-direction: column; align-items: center; text-align: center;
  box-shadow: 0 -16px 40px -16px rgba(7,12,41,.5);
  transform: translateY(24px); transition: transform .25s cubic-bezier(.2,.9,.3,1);
}
.modal-overlay.open .pinlock-sheet { transform: translateY(0); }
.pinlock-sheet .modal-sheet-grip { margin-bottom: 18px; }
.pinlock-close { position: absolute; top: 14px; right: 14px; }
.pinlock-icon { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 12px; color: #fff;
  background: linear-gradient(155deg, var(--primary), var(--primary-hi)); box-shadow: 0 10px 22px -10px rgba(46,92,246,.6); }
.pinlock-icon svg { width: 26px; height: 26px; }
.pinlock-sheet h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin-bottom: 4px; }
.pinlock-sub { font-size: 13.5px; color: var(--text-dim); line-height: 1.5; max-width: 300px; }
.pinlock-dots { display: flex; justify-content: center; gap: 12px; height: 16px; margin: 20px 0 6px; }
.pinlock-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); transition: background .15s, border-color .15s, transform .15s; }
.pinlock-dots i.on { background: var(--primary); border-color: var(--primary); transform: scale(1.08); }
.pinlock-dots.error { animation: pinlock-shake .35s ease; }
.pinlock-dots.error i { border-color: var(--alert); }
@keyframes pinlock-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.pinlock-msg { min-height: 20px; font-size: 13px; color: var(--alert); margin-bottom: 8px; }
.pinlock-keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px 22px; justify-content: center; margin-bottom: 10px; }
.pinlock-keypad button { width: 72px; height: 58px; border-radius: 16px; border: 1px solid var(--border-soft); background: var(--surface); color: var(--text); font: inherit; font-size: 24px; font-weight: 600; cursor: pointer; display: grid; place-items: center; transition: background .12s, transform .08s; -webkit-tap-highlight-color: transparent; }
.pinlock-keypad button:active { background: var(--surface-hi); transform: scale(.96); }
.pinlock-keypad button svg { width: 24px; height: 24px; }
.pinlock-keypad .key-fn { background: transparent; border-color: transparent; color: var(--text-dim); }
.pinlock-keypad .key-ok { background: var(--primary); border-color: var(--primary); color: #fff; }
.pinlock-cancel { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-dim); padding: 10px 16px; cursor: pointer; }
@media (max-height: 640px) { .pinlock-keypad button { height: 50px; } .pinlock-icon { width: 48px; height: 48px; } }

/* ---------------------------------------------------------
   Toast
   --------------------------------------------------------- */
.toast {
  /* v50 — aviso em cartão (antes uma pílula estreita que quebrava o
     texto em várias linhas centralizadas): largura boa, texto à
     esquerda, ícone num círculo, e aparece no TOPO (logo abaixo da
     barra) pra não cobrir os botões das folhas de baixo. */
  position: fixed;
  left: 50%;
  top: calc(var(--safe-top) + 66px);
  z-index: 90;
  transform: translate(-50%, -14px);
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(440px, calc(100vw - 24px));
  /* Fundo sempre escuro (mesmo tom do topbar, --topbar-from — o único
     token que NÃO inverte no modo escuro) porque o texto/ícone abaixo
     é branco fixo: usar var(--text) aqui (como era antes) ficava
     branco sobre quase-branco no modo escuro, já que --text também
     clareia nesse modo — o toast sumia de tão ilegível. */
  background: var(--topbar-from);
  color: #fff;
  border-radius: 16px;
  padding: 11px 14px 11px 11px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 18px 40px -16px rgba(10, 16, 40, 0.6), 0 0 0 1px rgba(255,255,255,.06) inset;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.25s cubic-bezier(.2,.9,.3,1.2);
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: rgba(23,163,74,.22); color: #4ADE80; flex-shrink: 0; }
.toast span { flex: 1; min-width: 0; }
.toast.is-warn svg { background: rgba(245,158,11,.22); color: #FBBF24; }

/* ---------------------------------------------------------
   Resumo em "hero" — reaproveitado por Veículos (fleetHero) e
   Faturas (faturaSummary): faixa com números lado a lado.
   --------------------------------------------------------- */
.fleet-hero, .fatura-hero {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px 10px;
  margin-bottom: 14px;
  box-shadow: 0 10px 24px -18px rgba(16, 22, 43, 0.35);
}
.fleet-hero-item, .fatura-hero-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  min-width: 0;
}
.fleet-hero-item .label, .fatura-hero-item .label { font-size: 10.5px; color: var(--text-faint); font-weight: 600; }
.fleet-hero-item .value, .fatura-hero-item .value {
  font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--text); white-space: nowrap;
}
.fatura-hero-item .value.alert { color: var(--alert); }
.fleet-hero-divider, .fatura-hero-divider { width: 1px; align-self: stretch; background: var(--border-soft); margin: 2px 4px; }

/* ---------------------------------------------------------
   Plano do veículo — linha usada no cartão de veículo
   --------------------------------------------------------- */
.vehicle-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-soft);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}
.vehicle-plan-row .plan-name { color: var(--primary-hi); font-weight: 600; }
.vehicle-plan-row .plan-price { color: var(--primary-hi); font-weight: 600; }

.vehicle-card-actions.two-col { display: flex; gap: 8px; }
.vehicle-card-actions.two-col > * { flex: 1; }
.vehicle-card-block { margin-top: 2px; }
.vehicle-card-block button { width: 100%; }

/* ---------------------------------------------------------
   Faturas — lista de cobranças
   --------------------------------------------------------- */
.invoice-list, .fence-list, .alert-list, .vehicle-list, .trip-list { display: flex; flex-direction: column; gap: 12px; }

.invoice-card {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.invoice-card-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-hi); color: var(--text-faint);
}
.invoice-card-icon svg { width: 18px; height: 18px; }
.invoice-card.is-paid .invoice-card-icon { background: var(--ok-soft); color: var(--ok); }
.invoice-card.is-pending .invoice-card-icon { background: var(--primary-soft); color: var(--primary-hi); }
.invoice-card.is-overdue .invoice-card-icon { background: var(--alert-soft); color: var(--alert); }

.invoice-card-main { flex: 1; min-width: 0; }
.invoice-card-title { font-weight: 600; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invoice-card-due { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

.invoice-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.invoice-card-value { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; color: var(--text); }
.invoice-pay-btn { padding: 7px 12px; font-size: 11.5px; }

/* ---------------------------------------------------------
   Folha de pagamento Pix (faturas.html)
   --------------------------------------------------------- */
.pix-summary { text-align: center; margin-bottom: 18px; }
.pix-summary .pix-ref { font-size: 12.5px; color: var(--text-dim); margin-bottom: 4px; }
.pix-summary .pix-val { font-family: var(--font-display); font-weight: 600; font-size: 26px; color: var(--text); }

.pix-code-row { display: flex; gap: 8px; margin-bottom: 16px; }
.pix-code-row input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
}
.pix-code-row .btn-secondary { flex-shrink: 0; padding: 0 16px; }
.pix-code-row .btn-secondary.copied { color: var(--ok); border-color: var(--ok-soft); background: var(--ok-soft); }

.pix-hint {
  display: flex;
  gap: 9px;
  background: var(--surface);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.45;
  margin-bottom: 18px;
}
.pix-hint svg { width: 15px; height: 15px; color: var(--text-faint); flex-shrink: 0; margin-top: 1px; }

/* ---------------------------------------------------------
   Relatórios — abas de veículo, resumo do dia, lista de trajetos
   --------------------------------------------------------- */
.vehicle-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; -ms-overflow-style: none; scrollbar-width: none; }
.vehicle-tabs::-webkit-scrollbar { display: none; }
.vehicle-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 100px;
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
}
.vehicle-tab svg { width: 15px; height: 15px; flex-shrink: 0; }
.vehicle-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.report-date-row { margin-bottom: 14px; }
.report-date-row input {
  width: 100%;
  min-height: 44px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 16px; /* trava o zoom automático do Safari/iOS ao focar */
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}

.report-summary {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px 8px;
  margin-bottom: 16px;
  box-shadow: 0 10px 24px -18px rgba(16, 22, 43, 0.35);
}
.report-summary-item { flex: 1; text-align: center; display: flex; flex-direction: column; gap: 3px; }
.report-summary-item .label { font-size: 10.5px; color: var(--text-faint); font-weight: 600; }
.report-summary-item .value { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--text); }
.report-summary-divider { width: 1px; align-self: stretch; background: var(--border-soft); margin: 2px 4px; }

.trip-card { padding: 14px; }
.trip-card-top { display: flex; align-items: center; gap: 12px; }
.trip-card-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary-hi);
  display: flex; align-items: center; justify-content: center;
}
.trip-card-icon svg { width: 16px; height: 16px; }
.trip-card.has-alert .trip-card-icon { background: var(--alert-soft); color: var(--alert); }
.trip-card-info { flex: 1; min-width: 0; }
.trip-card-time { font-weight: 600; font-size: 13.5px; color: var(--text); }
.trip-card-duration { font-size: 11.5px; color: var(--text-faint); margin-top: 1px; }
.trip-card-distance { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text); flex-shrink: 0; }

.speed-bar { height: 5px; border-radius: 100px; background: var(--surface-hi); margin: 12px 0 10px; overflow: hidden; }
.speed-bar-fill { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--ok), var(--rust)); }

.trip-card-stats { display: flex; gap: 18px; }
.trip-stat { display: flex; flex-direction: column; gap: 2px; }
.trip-stat .label { font-size: 10px; color: var(--text-faint); font-weight: 600; }
.trip-stat .value { font-size: 13px; font-weight: 600; color: var(--text); }
.trip-stat.is-max .value { color: var(--rust-hi); }

.trip-alert-note {
  display: flex; align-items: flex-start; gap: 7px;
  background: var(--alert-soft); color: var(--alert);
  border-radius: 8px; padding: 8px 10px; margin-top: 10px;
  font-size: 11.5px; line-height: 1.4;
}
.trip-alert-note svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }

.trip-card-route-link {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--primary-hi);
}

/* ---------------------------------------------------------
   Alternador (switch) — usado nas configurações de notificação
   (relatorios.html): mesmo cartão de "Alertas por notificação".
   --------------------------------------------------------- */
.settings-card { padding: 14px; margin-bottom: 16px; }
.settings-row { display: flex; align-items: center; gap: 12px; }
.settings-row-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary-hi);
  display: flex; align-items: center; justify-content: center;
}
.settings-row-icon svg { width: 17px; height: 17px; }
.settings-row-text { flex: 1; min-width: 0; }
.settings-row-text .title { font-weight: 600; font-size: 13.5px; color: var(--text); }
.settings-row-text .desc { font-size: 11.5px; color: var(--text-faint); margin-top: 1px; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: var(--border); border-radius: 100px;
  cursor: pointer; transition: background 0.15s ease;
}
.switch .track::before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.15s ease;
  box-shadow: 0 2px 6px -1px rgba(16,22,43,0.35);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { transform: translateX(18px); }

.settings-card-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.settings-card-foot .btn-secondary { width: 100%; font-size: 12px; padding: 9px; }

/* Seletor de tema (Aparência, em Configurações) — 3 opções lado a
   lado, mesma ideia visual de um segmented control nativo. */
.theme-segmented {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}
.theme-segmented button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.theme-segmented button.is-active { background: var(--bg); color: var(--primary); box-shadow: 0 1px 3px rgba(16,22,43,0.12); }

/* ---------------------------------------------------------
   Responsivo — telas maiores que celular (tablet/desktop): o
   conteúdo continua com cara de app, só ganha mais respiro e um
   teto de largura confortável pra leitura.
   --------------------------------------------------------- */
@media (min-width: 640px) {
  body { background: var(--surface-hi); }
  /* :not(.app-content-flush) — sem isso, essas regras (mesma
     especificidade de .app-content-flush, porém depois dela no
     arquivo) venciam a cascata em telas ≥640px e devolviam
     padding/max-width pro <main> da tela de Mapa, cortando o
     Google Maps num retângulo estreito em telas grandes mesmo
     com "flush" aplicado. */
  .app-content:not(.app-content-flush) { padding: 24px 20px calc(32px + var(--safe-bottom)); }
  .app-topbar { padding-left: 20px; padding-right: 20px; }
  /* Só a partir daqui o menu volta a ser uma faixa lateral estreita
     — em celular (regra base, acima) ele preenche a tela toda. */
  .app-sidebar { width: min(82vw, 320px); }
}

@media (min-width: 860px) {
  .app-content:not(.app-content-flush) { max-width: 720px; }
}

/* ---------------------------------------------------------
   Modal de "nova versão disponível" (ver js/update-modal.js) —
   visual próprio (fundo desfocado + entrada com leve "salto"),
   fica por cima até de outros modais/folhas (z-index maior),
   já que não deve ser possível continuar usando uma tela
   desatualizada por engano.
   --------------------------------------------------------- */
.update-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 12, 41, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.update-modal-overlay.open { opacity: 1; pointer-events: auto; }

.update-modal {
  width: 100%;
  max-width: 360px;
  background: var(--bg);
  border-radius: 22px;
  padding: 28px 24px calc(22px + var(--safe-bottom));
  text-align: center;
  box-shadow: 0 30px 70px -20px rgba(7, 12, 41, 0.55);
  transform: translateY(10px) scale(0.96);
  opacity: 0;
  transition: transform 0.26s cubic-bezier(.2,.9,.3,1.3), opacity 0.22s ease;
}
.update-modal-overlay.open .update-modal { transform: translateY(0) scale(1); opacity: 1; }

.update-modal-icon {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--topbar-from), var(--topbar-to));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 26px -10px rgba(16, 27, 77, 0.6);
}
.update-modal-icon svg:first-child { width: 26px; height: 26px; }

/* Anel de contagem regressiva por cima do ícone — "track" fraco
   sempre visível, "progress" desenha por cima conforme os segundos
   passam (stroke-dashoffset animado via JS em update-modal.js). */
.update-modal-ring {
  position: absolute;
  inset: -5px;
  width: 66px;
  height: 66px;
  transform: rotate(-90deg);
}
.update-modal-ring-track, .update-modal-ring-progress {
  fill: none;
  stroke-width: 2.5;
}
.update-modal-ring-track { stroke: rgba(255,255,255,0.28); }
.update-modal-ring-progress {
  stroke: #fff;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.update-modal h2 { font-family: var(--font-display); font-weight: 700; font-size: 17.5px; color: var(--text); margin-bottom: 8px; }
.update-modal p { font-size: 13px; color: var(--text-dim); line-height: 1.55; margin-bottom: 22px; }

.update-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.update-modal-countdown {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.update-modal-countdown span { color: var(--text-dim); }

/* ---------------------------------------------------------
   Loading overlay — spinner central usado em qualquer tela
   enquanto uma operação assíncrona está em andamento (ver
   showLoading/hideLoading em js/app.js). Mesmo desenho do painel
   administrativo (css/layout.css), adaptado às cores do app do
   cliente. z-index abaixo do modal de atualização forçada (80) —
   uma atualização crítica não deve poder ficar escondida atrás
   de um spinner.
   --------------------------------------------------------- */
.loading-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 70;
  align-items: center;
  justify-content: center;
  background: rgba(16,22,43,0.36);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}
.loading-overlay.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.18s ease, visibility 0s linear;
}
.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 28px 34px;
  min-width: 132px;
  box-shadow: 0 40px 80px -32px rgba(16,22,43,0.5), 0 0 0 1px rgba(16,22,43,0.03);
  transform: scale(0.92) translateY(4px);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.loading-overlay.open .loading-card { transform: scale(1) translateY(0); }
.loading-spinner { position: relative; width: 40px; height: 40px; }
.loading-spinner::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46,92,246,0.16), rgba(23,163,74,0.08) 60%, transparent 75%);
}
.loading-spinner span { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; }
.loading-spinner span:first-child {
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  animation: loading-spin 0.85s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}
.loading-spinner span:last-child {
  inset: 7px;
  border-bottom-color: var(--ok);
  border-left-color: var(--ok);
  opacity: 0.7;
  animation: loading-spin-reverse 1.1s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }
@keyframes loading-spin-reverse { to { transform: rotate(-360deg); } }
.loading-text { font-size: 12.5px; font-weight: 600; color: var(--text-dim); text-align: center; letter-spacing: 0.01em; }
@media (prefers-reduced-motion: reduce) {
  .loading-spinner span { animation-duration: 2.4s; }
}


/* v48 — loading com o logo (mesmo do painel administrativo, ver
   css/layout.css da raiz): anéis girando em volta do logo, halo
   pulsando, reticências animadas e barra de progresso. */
.loading-card {
  gap: 14px; padding: 28px 36px 22px; min-width: 210px; border-radius: 22px;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(16,22,43,0.06), 0 24px 48px -16px rgba(7,12,41,0.45), 0 60px 100px -40px rgba(16,27,77,0.5);
}
.loading-logo { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.loading-logo img { position: relative; z-index: 2; width: 56px; height: 56px; border-radius: 50%;
  box-shadow: 0 10px 22px -8px rgba(16,27,77,0.6), 0 0 0 3px var(--bg); animation: ll-breathe 1.8s ease-in-out infinite; }
.ll-halo { position: absolute; inset: 6px; border-radius: 50%;
  background: radial-gradient(circle, rgba(46,92,246,0.28), rgba(6,199,224,0.12) 55%, transparent 72%); animation: ll-pulse 1.8s ease-out infinite; }
.ll-ring { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(6,199,224,0.9) 75%, #2E5CF6 92%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  animation: ll-spin 1.1s linear infinite; }
.ll-ring-2 { inset: 7px; background: conic-gradient(from 180deg, transparent 0 60%, rgba(255,90,46,0.85) 85%, transparent 100%); animation: ll-spin 1.6s linear infinite reverse; }
.loading-text { display: block; font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; text-align: center; max-width: 240px; }
.loading-text::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: ll-dots 1.2s steps(4, end) infinite; }
.loading-bar { position: relative; overflow: hidden; width: 140px; height: 4px; border-radius: 4px; background: var(--surface-hi); }
.loading-bar span { position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; border-radius: 4px; background: linear-gradient(90deg, #06C7E0, var(--primary)); animation: ll-bar 1.2s cubic-bezier(.4,0,.2,1) infinite; }
@keyframes ll-spin { to { transform: rotate(360deg); } }
@keyframes ll-pulse { 0% { transform: scale(0.85); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes ll-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes ll-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@keyframes ll-bar { 0% { left: -40%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .ll-ring, .ll-ring-2, .ll-halo, .loading-logo img, .loading-bar span, .loading-text::after { animation: none !important; }
}

/* =========================================================
   v48 — menu lateral com cara de app nativo
   Gaveta de ~86% da largura (o mapa aparece escurecido atrás),
   cabeçalho azul com o logo e o nome do cliente, e itens em lista
   agrupada (estilo Ajustes do iPhone): ícone num quadradinho
   colorido, texto e seta ">" à direita. "Sair da conta" num grupo
   separado, em vermelho.
   ========================================================= */
.app-sidebar:not(.from-right) {
  width: min(86vw, 340px);
  background: var(--surface);
  border-radius: 0 22px 22px 0;
  overflow: hidden;
  padding-top: 0;
  box-shadow: 18px 0 50px -20px rgba(7,12,41,.55);
  transition: transform 0.28s cubic-bezier(.2,.9,.3,1);
}
.app-sidebar:not(.from-right) .sidebar-head {
  position: relative; isolation: isolate; overflow: hidden;
  padding: calc(22px + var(--safe-top)) 18px 20px; gap: 12px; border-bottom: 0; color: #fff;
  background:
    radial-gradient(260px 160px at 90% 0%, rgba(6,199,224,.25), transparent 70%),
    linear-gradient(160deg, #101B4D 0%, #0C1540 60%, #070C29 100%);
}
.app-sidebar:not(.from-right) .sidebar-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}
.app-sidebar:not(.from-right) .sidebar-head .app-topbar-mark {
  width: 46px; height: 46px; border-radius: 50%; font-size: 0; color: transparent;
  background: #0C1540 url(../icons/icon-192.png) center/cover no-repeat;
  box-shadow: 0 0 0 2px rgba(255,255,255,.18), 0 8px 18px -6px rgba(0,0,0,.5);
}
.app-sidebar:not(.from-right) .sidebar-brand { color: #fff; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.app-sidebar:not(.from-right) .sidebar-client { color: rgba(255,255,255,.7); font-size: 12.5px; margin-top: 2px; }
.app-sidebar:not(.from-right) .sidebar-close { align-self: flex-start; background: rgba(255,255,255,.12); color: #fff; border-radius: 10px; }
.app-sidebar:not(.from-right) .sidebar-close:active { background: rgba(255,255,255,.22); }

.app-sidebar:not(.from-right) .sidebar-nav { padding: 18px 14px 8px; gap: 0; }
.app-sidebar:not(.from-right) .sidebar-nav::before {
  content: "Menu"; display: block; padding: 0 6px 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint);
}
.app-sidebar:not(.from-right) .sidebar-nav a {
  --tile: var(--primary);
  position: relative; gap: 13px; padding: 11px 36px 11px 12px; border-radius: 0;
  background: var(--bg); color: var(--text); font-size: 15px; font-weight: 500;
  border-bottom: 1px solid var(--border-soft);
}
.app-sidebar:not(.from-right) .sidebar-nav a:first-of-type { border-radius: 14px 14px 0 0; }
.app-sidebar:not(.from-right) .sidebar-nav a:last-of-type { border-radius: 0 0 14px 14px; border-bottom: 0; }
.app-sidebar:not(.from-right) .sidebar-nav a svg {
  width: 34px; height: 34px; padding: 8px; border-radius: 10px; flex-shrink: 0;
  background: var(--tile); color: #fff; stroke-width: 2;
  box-shadow: 0 6px 12px -6px var(--tile);
}
.app-sidebar:not(.from-right) .sidebar-nav a::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-right: 2px solid var(--text-faint); border-top: 2px solid var(--text-faint); transform: rotate(45deg); opacity: .7;
}
.app-sidebar:not(.from-right) .sidebar-nav a:active { background: var(--surface-hi); transform: none; }
.app-sidebar:not(.from-right) .sidebar-nav a.active { background: var(--primary-soft); color: var(--primary-hi); font-weight: 700; }
.app-sidebar:not(.from-right) .sidebar-nav a.active::after { border-color: var(--primary); opacity: 1; }
.app-sidebar:not(.from-right) .sidebar-nav a[data-nav-page="mapa"] { --tile: #2E5CF6; }
.app-sidebar:not(.from-right) .sidebar-nav a[data-nav-page="veiculos"] { --tile: #FF7A45; }
.app-sidebar:not(.from-right) .sidebar-nav a[data-nav-page="cercas"] { --tile: #17A34A; }
.app-sidebar:not(.from-right) .sidebar-nav a[data-nav-page="relatorios"] { --tile: #8B5CF6; }
.app-sidebar:not(.from-right) .sidebar-nav a[data-nav-page="faturas"] { --tile: #0BA5C4; }
.app-sidebar:not(.from-right) .sidebar-nav a[data-nav-page="configuracoes"] { --tile: #64748B; }
.app-sidebar:not(.from-right) .sidebar-nav a[data-nav-page="indique"] { --tile: #E0A100; }
.app-sidebar:not(.from-right) .sidebar-nav a[data-nav-page="suporte"] { --tile: #10B981; }
.app-sidebar:not(.from-right) .sidebar-nav a[data-nav-page="gastos"] { --tile: #F97316; }
.app-sidebar:not(.from-right) .sidebar-nav a[data-nav-page="lembretes"] { --tile: #8B5CF6; }

.app-sidebar:not(.from-right) .sidebar-logout {
  width: auto; margin: 6px 14px 12px; padding: 12px; gap: 13px; border: 0; border-radius: 14px;
  background: var(--bg); font-size: 15px; font-weight: 600;
}
.app-sidebar:not(.from-right) .sidebar-logout svg {
  width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--alert-soft); color: var(--alert);
}
.app-sidebar:not(.from-right) .sidebar-foot { border-top: 0; text-align: center; padding-top: 4px; }


/* ---------------------------------------------------------
   Saúde do rastreador (js/saude.js) — ficha do veículo e selo nos
   cartões da tela Veículos.
   --------------------------------------------------------- */
.sh-block { margin: 16px 0 14px; }
.sh-head { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); margin: 0 2px 8px; }
.sh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sh-item { --c: var(--text-faint); --cs: var(--surface-hi); display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-soft); min-width: 0; }
.sh-item.is-ok { --c: var(--ok); --cs: var(--ok-soft); }
.sh-item.is-warn { --c: #D97706; --cs: #FEF3C7; }
.sh-item.is-bad { --c: var(--alert); --cs: var(--alert-soft); border-color: rgba(230,57,70,.3); }
.sh-ico { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: var(--cs); color: var(--c); }
.sh-ico svg { width: 17px; height: 17px; }
.sh-text { display: flex; flex-direction: column; min-width: 0; }
.sh-text small { font-size: 10.5px; color: var(--text-faint); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-text b { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-item.is-none .sh-text b { color: var(--text-faint); font-weight: 500; }
.sh-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.sh-bars i { width: 3px; border-radius: 1px; background: var(--border); }
.sh-bars i.on { background: var(--c); }
.sh-alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; margin-bottom: 8px; border-radius: 12px; background: var(--alert-soft); color: var(--alert); border: 1px solid rgba(230,57,70,.3); }
.sh-alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.sh-alert strong { display: block; font-size: 13px; }
.sh-alert span { display: block; font-size: 11.5px; color: var(--text-dim); line-height: 1.4; margin-top: 2px; }
.sh-chip { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0; padding: 5px 10px; border-radius: 100px; font-size: 11.5px; font-weight: 600; }
.sh-chip svg { width: 13px; height: 13px; }
.sh-chip.is-bad { background: var(--alert-soft); color: var(--alert); }


/* ---------------------------------------------------------
   Manutenção preventiva (js/manutencao.js)
   --------------------------------------------------------- */
.mt-row { display: flex; align-items: center; gap: 11px; width: 100%; margin-top: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--surface); text-align: left; font: inherit; cursor: pointer; color: var(--text); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.mt-row:active { background: var(--surface-hi); }
.mt-row-ico { --c: var(--primary); width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--c); }
.mt-row-ico.is-ok { --c: var(--ok); background: var(--ok-soft); }
.mt-row-ico.is-warn { --c: #D97706; background: #FEF3C7; }
.mt-row-ico.is-bad { --c: var(--alert); background: var(--alert-soft); }
.mt-row-ico svg { width: 17px; height: 17px; }
.mt-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mt-row-text b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-row-text small { font-size: 11.5px; color: var(--text-faint); }
.mt-row-go { font-size: 22px; color: var(--text-faint); line-height: 1; }

.mt-odo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; margin-bottom: 10px;
  color: #fff; background: radial-gradient(200px 120px at 95% 0%, rgba(6,199,224,.25), transparent 70%), linear-gradient(160deg, #101B4D, #0C1540 60%, #070C29); }
.mt-odo small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.65); }
.mt-odo b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.mt-odo .mt-link { color: #9DB4FF; }
.mt-link { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--primary-hi); cursor: pointer; padding: 6px 4px; }
.mt-link.is-danger { color: var(--alert); }
.mt-odo-form[hidden] { display: none !important; }
.mt-odo-form { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.mt-odo-form .form-field { flex: 1; }
.mt-list { display: flex; flex-direction: column; gap: 8px; }
.mt-item { --c: var(--ok); padding: 12px; border-radius: 14px; border: 1px solid var(--border-soft); background: var(--bg); }
.mt-item.is-warn { --c: #D97706; border-color: rgba(217,119,6,.35); }
.mt-item.is-bad { --c: var(--alert); border-color: rgba(230,57,70,.35); background: color-mix(in srgb, var(--alert-soft) 45%, var(--bg)); }
.mt-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mt-item-top b { font-size: 14px; color: var(--text); }
.mt-badge { flex-shrink: 0; padding: 3px 9px; border-radius: 100px; font-size: 11px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.mt-bar { height: 6px; border-radius: 6px; background: var(--surface-hi); overflow: hidden; margin: 9px 0 6px; }
.mt-bar i { display: block; height: 100%; border-radius: 6px; background: var(--c); }
.mt-item small { display: block; font-size: 11.5px; color: var(--text-faint); }
.mt-item-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.mt-done { border: 0; border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 12.5px; font-weight: 700; color: #fff; background: var(--ok); cursor: pointer; }
.mt-add-head { margin: 16px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.mt-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.mt-preset { border: 0; border-radius: 100px; padding: 7px 12px; font: inherit; font-size: 12.5px; font-weight: 600; background: var(--primary-soft); color: var(--primary-hi); cursor: pointer; }
.mt-preset.is-other { background: var(--surface-hi); color: var(--text-dim); }
.mt-form { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface); margin-bottom: 10px; }
.mt-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mt-agendar { margin-top: 12px; }

/* ---------------------------------------------------------
   Painel de notificações — aberto pelo sininho na barra de título
   (ver ensureNotifPanel/openNotifPanel em js/push.js). Mesma folha
   (modal-sheet) usada pela folha do veículo em mapa.js, com uma
   lista de itens no lugar do formulário.
   --------------------------------------------------------- */
.notif-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; margin: 0 -4px; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border-soft);
}
.notif-item:last-child { border-bottom: none; }
.notif-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--text-dim);
}
.notif-item-icon svg { width: 15px; height: 15px; }
.notif-item.is-alerta .notif-item-icon { background: var(--alert-soft); color: var(--alert); }
.notif-item.is-aviso .notif-item-icon { background: var(--rust-soft); color: var(--rust); }
.notif-item.is-ok .notif-item-icon { background: var(--ok-soft); color: var(--ok); }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: 12.5px; color: var(--text); line-height: 1.4; }
.notif-item-time { font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }
.notif-item-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--primary);
  flex-shrink: 0; margin-top: 5px;
}
.notif-panel-foot {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center; gap: 18px;
}
.notif-panel-foot button {
  background: none; border: none; color: var(--primary); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 6px;
}
.notif-panel-foot button:disabled { color: var(--text-faint); cursor: default; }
/* "Limpar notificações" apaga pra sempre — cor de perigo, separado
   visualmente de "marcar como lido" (que é reversível). */
.notif-panel-foot .notif-clear-btn { color: var(--alert); }

/* ---------------------------------------------------------
   Banner de instalação do PWA — sobe do rodapé (ver js/install.js).
   Mesmo texto/ícone conforme a plataforma: passo a passo pro iPhone
   (Safari não tem instalação automática), botão nativo no
   Android/Chrome.
   --------------------------------------------------------- */
.install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 55;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 30px 60px -24px rgba(16,22,43,0.4), 0 0 0 1px rgba(16,22,43,0.03);
  transform: translateY(calc(100% + 24px));
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.2,0.8,0.2,1), opacity 0.22s ease;
  max-width: 420px;
  margin: 0 auto;
}
.install-banner.open { transform: translateY(0); opacity: 1; }
.install-banner-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary-hi);
}
.install-banner-icon svg { width: 18px; height: 18px; }
.install-banner-body { flex: 1; min-width: 0; }
.install-banner-title { font-weight: 700; font-size: 13.5px; color: var(--text); margin-bottom: 3px; }
.install-banner-text { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.install-banner-text b { color: var(--text); }
.install-banner-text svg { width: 13px; height: 13px; display: inline; vertical-align: -2px; margin: 0 1px; stroke: var(--primary); }
.install-banner-text .btn-primary,
.install-banner-body .btn-primary { margin-top: 10px; padding: 8px 14px; font-size: 12.5px; width: auto; }
.install-banner-close {
  flex-shrink: 0; width: 26px; height: 26px; border: none; background: none; color: var(--text-faint);
  cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 7px;
}
.install-banner-close:hover { background: var(--surface); color: var(--text-dim); }

/* ---------------------------------------------------------
   Barra de rolagem — mais fina, com cantos arredondados e cor
   discreta que acompanha o tema (em vez da barra cinza padrão
   do navegador). Firefox usa 'scrollbar-width'/'scrollbar-color'
   (não dá pra estilizar mais que isso); Chrome/Safari/iOS usam
   os pseudo-elementos '::-webkit-scrollbar*' abaixo, que têm bem
   mais controle (largura, raio, hover). Aplica em qualquer
   elemento que role — a página toda, listas internas como o
   menu lateral (.sidebar-nav), a folha de detalhes do veículo
   etc. — não só num contêiner específico. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: var(--text-faint); }
*::-webkit-scrollbar-corner { background: transparent; }
.install-banner-close svg { width: 14px; height: 14px; }

/* Configurações → "Ajuda e suporte" (link em forma de cartão) */
.settings-link { display: block; text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }
.settings-link:active { background: var(--surface); }
.settings-row-icon.is-help { background: rgba(16,185,129,.14); color: #059669; }
.settings-go { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-faint); }

/* modo offline: menu só com as telas que funcionam sem internet */
.sidebar-nav a[hidden] { display: none !important; }
.sidebar-offline { display: flex; gap: 10px; align-items: flex-start; margin: 4px 14px 10px; padding: 10px 12px; border-radius: 12px; font-size: 12px; line-height: 1.45; color: var(--text-dim); background: var(--surface-hi); }
.sidebar-offline[hidden] { display: none; }
.sidebar-offline svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; color: #D97706; }
.sidebar-offline b { display: block; font-size: 12.5px; color: var(--text); }

/* Configurações → Gastos pelo WhatsApp */
.settings-row-icon.is-wa { background: rgba(31,170,85,.14); color: #16A34A; }
.wa-beta { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 100px; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; color: #fff; background: linear-gradient(135deg, #7C3AED, #2E5CF6); vertical-align: 1px; }
.wa-exemplos { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.wa-exemplos span { padding: 6px 10px; border-radius: 12px 12px 12px 4px; font-size: 12px; color: var(--text-dim); background: #DCFCE7; }
.wa-lista { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.wa-vazio { padding: 10px 12px; border-radius: 12px; font-size: 12.5px; color: var(--text-faint); background: var(--surface); }
.wa-num { padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border-soft); background: var(--bg); }
.wa-num-top { display: flex; align-items: center; gap: 10px; }
.wa-num-ico { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: rgba(31,170,85,.12); color: #16A34A; }
.wa-num-ico svg { width: 17px; height: 17px; }
.wa-num-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wa-num-txt b { font-size: 13.5px; color: var(--text); }
.wa-num-txt small { font-size: 11.5px; color: var(--text-faint); }
.wa-chip { flex-shrink: 0; padding: 3px 9px; border-radius: 100px; font-size: 11px; font-weight: 700; }
.wa-chip.is-ok { color: #15803D; background: #DCFCE7; }
.wa-chip.is-wait { color: #B45309; background: #FEF3C7; }
.wa-confirm { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding: 10px; border-radius: 12px; font-size: 12.5px; line-height: 1.45; color: var(--text-dim); background: #FFFBEB; }
.wa-confirm small { color: var(--text-faint); }
.wa-btn { border: 0; border-radius: 11px; padding: 10px 12px; font: inherit; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(180deg, #2FD46B, #1FAA55); cursor: pointer; }
.wa-remove { margin-top: 6px; border: 0; background: none; padding: 4px 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--alert); cursor: pointer; }
.wa-form { display: flex; flex-direction: column; gap: 12px; }
.settings-card-foot [hidden], #waAdd[hidden] { display: none !important; }

/* folha aberta: fundo parado (js/app.js travarFundo) */
html.modal-aberto, html.modal-aberto body { overflow: hidden; overscroll-behavior: none; }
html.modal-aberto .app-content { overflow: hidden; }
