/* ══════════════════════════════════════════════════════════════
   MCZ Sat — portal web do cliente
   Convertido do documento de design (Canvas.dc.html, quadro 1a).
   Diferente do protótipo em app/, aqui o layout é de desktop:
   menu lateral fixo + área de conteúdo com três abas.
   ══════════════════════════════════════════════════════════════ */

:root {
  --side-w: 308px;
  --side-w-rail: 88px;   /* menu resumido (só ícones) */
  --mbar-h: 57px;        /* barra do topo — só existe abaixo de 1000px */

  --navy: #23264a;
  --navy-2: #2e3263;
  --ink: #181b2a;
  --ink-2: #2a2e45;
  --ink-3: #4a4f66;
  --muted: #8a8fa3;
  --muted-2: #a2a7ba;
  --muted-3: #b3b7c7;
  --blue: #1590c4;
  --blue-2: #35b6e8;
  --blue-dark: #0f76a2;
  --blue-soft: #e9f6fd;
  --blue-soft-2: #f0faff;
  --sky: #7fd4f5;
  --green: #1f9d63;
  --green-soft: #e8f8f0;
  --amber: #b06a1e;
  --amber-soft: #fdeee0;
  --amber-row: #fdf9f3;
  --red: #e05252;
  --bg: #eceef4;
  --surface: #fff;
  --surface-2: #f5f6fa;
  --line: #eceef4;
  --line-2: #e3e6ef;
  --line-3: #f3f4f8;
  --chip: #eef0f6;

  --shadow-card: 0 4px 18px rgba(30, 34, 70, .07);
  --shadow-sm: 0 2px 8px rgba(30, 34, 70, .06);
  --shadow-map: 0 10px 30px rgba(30, 34, 70, .12);

  --sans: 'Instrument Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --display: 'Sora', var(--sans);
}

* { box-sizing: border-box; }

/* Vários elementos são flex; o atributo `hidden` precisa vencer. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

h1, h2 { margin: 0; }
dl, dd, dt { margin: 0; }

.sprite { display: none; }

.ic {
  width: 21px;
  height: 21px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.grow { flex: 1; min-width: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; }

/* ── Estrutura ────────────────────────────────────────────────── */

/* A altura é travada em uma tela: só a coluna de conteúdo rola, e a aba
   Início cabe inteira (o mapa ocupa a altura que sobra). */
.shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  height: 100vh;
  background: linear-gradient(180deg, #f7f8fc 0%, #f1f3f9 100%);
}


/* ── Menu lateral ─────────────────────────────────────────────── */

.side {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 32px 24px 28px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
}

.side__brand { display: flex; align-items: center; gap: 10px; }
.side__logo { height: 38px; border-radius: 9px; }

/* Menu hambúrguer — à direita de “Portal do cliente”. */
.burger {
  width: 36px;
  height: 36px;
  flex: none;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}

.burger:hover { background: #f0f6fb; border-color: var(--blue-2); color: var(--blue-dark); }
.burger .ic { width: 19px; height: 19px; stroke-width: 1.9; }

.side__kicker {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.user {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
}

.user__ring {
  width: 56px;
  height: 56px;
  flex: none;
  display: block;
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-2), var(--blue));
}

/* Espaço da foto do cliente (slot `foto-usuario` do design). */
.user__photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3a3f6b;
  color: #cfd6f5;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .04em;
}

.user__body { flex: 1; min-width: 0; }

.user__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15.5px;
  color: #fff;
}

.user__links { display: flex; gap: 12px; margin-top: 5px; }

.user__link { font-size: 12.5px; font-weight: 500; color: #9fd9f2; }
.user__link:hover { color: #fff; }
.user__link.is-active { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.user__link--muted { color: #c3c6e5; }

.group { display: flex; flex-direction: column; gap: 10px; }

.group__label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.veh-list { display: flex; flex-direction: column; gap: 10px; }

.veh {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
}

.veh:hover { background: #eef7fd; }

.veh.is-selected {
  border-color: var(--blue-2);
  background: var(--blue-soft-2);
  box-shadow: 0 4px 14px rgba(38, 150, 196, .12);
}

.veh__ic { width: 24px; height: 24px; color: var(--muted-2); }
.veh.is-selected .veh__ic { color: var(--blue); }

.veh__body { flex: 1; min-width: 0; }

.veh__plate {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .05em;
  color: #3a3f52;
}

.veh__model { display: block; font-size: 12.5px; color: var(--muted); }

.veh.is-selected .veh__plate { color: #14324a; }
.veh.is-selected .veh__model { color: #5f83a0; }

.veh__check { display: none; color: var(--blue); }
.veh.is-selected .veh__check { display: block; }

.veh-empty { margin: 2px 0 0; font-size: 13px; color: var(--muted-2); }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav .group__label { margin-bottom: 4px; }

.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: none;
  border-radius: 13px;
  background: none;
  color: var(--ink-3);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.nav__item .ic { color: var(--muted); }
.nav__item:hover { background: #f0f6fb; }

.nav__item.is-active {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(35, 38, 74, .25);
}

.nav__item.is-active .ic { color: var(--sky); }

.nav__soon {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  font-size: 15px;
  color: var(--muted-3);
}

.badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--chip);
  color: var(--muted);
  padding: 4px 9px;
  border-radius: 100px;
}

/* Atalho para o protótipo do app (app/). */
.jump {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 13px 14px;
  border: 1.5px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink-2);
}

.jump:hover {
  border-color: var(--blue-2);
  background: var(--blue-soft-2);
  color: var(--ink-2);
}

.jump .ic { color: var(--blue); }

/* Os dois atalhos ficam colados no rodapé: só o primeiro empurra (margin-top:auto). */
.jump + .jump { margin-top: 8px; }

/* Suporte via WhatsApp — mesmo cartão, sotaque verde. */
.jump--wa .ic { color: var(--green); }
.jump--wa:hover { border-color: var(--green); background: var(--green-soft); }
.jump--wa:hover .jump__arrow { color: var(--green); }
.jump__body { flex: 1; min-width: 0; }

.jump__title {
  display: block;
  font-family: var(--display);
  font-size: 14.5px;
  font-weight: 600;
}

.jump__sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }

.jump__arrow { width: 18px; height: 18px; color: var(--muted-2); }
.jump:hover .jump__arrow { color: var(--blue); }

.side__foot { margin-top: 20px; font-size: 12px; color: var(--muted-3); }

/* ── Menu resumido ────────────────────────────────────────────
   `.is-rail` no .shell reduz a coluna do menu a uma faixa de ícones.
   Nada é removido do DOM — só rótulos e textos auxiliares somem, e o
   atributo `title` de cada item vira a dica na passagem do mouse.
   Só existe no layout de duas colunas; abaixo de 1000px o menu já
   vira uma faixa no topo e o hambúrguer some. */
@media (min-width: 1001px) {

.shell.is-rail { grid-template-columns: var(--side-w-rail) minmax(0, 1fr); }

.is-rail .side {
  align-items: center;
  gap: 18px;
  padding: 24px 12px 22px;
}

.is-rail .side__brand { flex-direction: column; gap: 12px; }
/* Largura manda na faixa estreita — a marca é bem mais larga que alta. */
.is-rail .side__logo { width: 100%; height: auto; }
.is-rail .side__kicker,
.is-rail .group__label,
.is-rail .nav__soon,
.is-rail .side__foot { display: none; }

.is-rail .burger { margin-left: 0; }

.is-rail .user {
  padding: 6px;
  border-radius: 50%;
}

.is-rail .user__body { display: none; }
.is-rail .user__ring { width: 48px; height: 48px; }
.is-rail .user__photo { width: 44px; height: 44px; font-size: 15px; }

.is-rail .group,
.is-rail .veh-list,
.is-rail .nav { width: 100%; align-items: stretch; }

.is-rail .veh,
.is-rail .nav__item,
.is-rail .jump {
  justify-content: center;
  gap: 0;
  padding: 13px 0;
}

.is-rail .veh__body,
.is-rail .veh__check,
.is-rail .nav__text,
.is-rail .jump__body,
.is-rail .jump__arrow { display: none; }

.is-rail .veh-empty { display: none; }

/* Sem o “check”, o veículo escolhido se distingue pela cor do ícone. */
.is-rail .veh.is-selected .veh__ic { color: var(--blue); }

}

/* ── Barra superior · celular ─────────────────────────────────
   Só existe abaixo de 1000px, onde o menu lateral vira um modal
   que desce do topo. No desktop não ocupa espaço nenhum. */

.mbar { display: none; }
.menu-backdrop { display: none; }

/* ── Conteúdo ─────────────────────────────────────────────────── */

.main {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.head { display: flex; align-items: center; gap: 18px; }

/* A placa é o botão de troca de veículo — no desktop ela fica desativada,
   porque a lista completa já está no menu lateral. */
.picker { position: relative; }

.plate {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  padding: 8px 18px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
}

.plate:disabled { cursor: default; }
.plate__text { display: block; }
.plate__caret { display: none; width: 18px; height: 18px; color: var(--muted); }
.plate[aria-expanded="true"] .plate__caret { transform: rotate(180deg); }

/* Atalho para os indicadores do veículo — só existe no celular. */
.details { display: none; }

/* Fora do celular o modal não existe: `display: contents` devolve a grade
   de indicadores ao fluxo da aba Início. */
.sheet, .sheet__panel { display: contents; }
.sheet__backdrop, .sheet__head { display: none; }

.plate__country {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .28em;
  color: var(--muted-2);
  text-align: center;
}

.plate__value {
  display: block;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.1;
  color: var(--ink);
}

.head__model {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-2);
}

.head__sub { font-size: 13.5px; color: var(--muted); margin-top: 3px; }

.round {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.round:hover { background: #f0f6fb; }
.round .ic { width: 20px; height: 20px; }

.round__dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--surface);
}

/* Busca rápida do cabeçalho — filtra a lista de veículos. */
.quick {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 8px 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.quick__input {
  width: 220px;
  border: none;
  outline: none;
  background: none;
  font-size: 14.5px;
  color: var(--ink);
}

.quick__input::placeholder { color: var(--muted-2); }
.quick__input::-webkit-search-cancel-button { display: none; }

.quick__clear {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.quick__clear:hover { background: var(--chip); color: var(--ink-2); }
.quick__clear .ic { width: 16px; height: 16px; stroke-width: 2; }

/* ── Abas ─────────────────────────────────────────────────────── */

.panel { display: none; }
.panel.is-active { display: flex; flex-direction: column; gap: 20px; flex: 1; min-height: 0; }

/* ── Início ───────────────────────────────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.stat {
  background: var(--surface);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat__ic {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 13px;
  background: var(--chip);
  color: #5a5f76;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat__ic .ic { width: 23px; height: 23px; }

.stat--green .stat__ic { background: var(--green-soft); color: var(--green); }
.stat--blue .stat__ic { background: var(--blue-soft); color: var(--blue); }

/* Ignição ligada: destaque, espelhando o estado do veículo. */
.stat.is-on .stat__ic { background: var(--blue-soft); color: var(--blue); }

.stat__body { min-width: 0; }

.stat__label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.stat__value {
  display: block;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2px;
}

.stat__value--green { color: var(--green); }

/* Ocupa a altura que sobra na tela — sem mínimo alto, para não gerar
   barra de rolagem vertical na aba Início. */
.map {
  position: relative;
  flex: 1;
  min-height: 260px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-map);
}

/* O zoom escala a imagem a partir do ponto do marcador, que fica parado. */
.map__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: 50% 46%;
  transition: transform .28s ease;
}

.map__zoom {
  position: absolute;
  right: 18px;
  top: 18px;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}

.map__zoom-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--navy);
  cursor: pointer;
}

.map__zoom-btn + .map__zoom-btn { border-top: 1px solid rgba(35, 38, 74, .12); }
.map__zoom-btn:hover { background: rgba(35, 38, 74, .07); }
.map__zoom-btn .ic { width: 18px; height: 18px; }
.map__zoom-btn:disabled { color: var(--muted); cursor: default; background: none; opacity: .5; }

.marker {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.marker__plate {
  background: var(--navy);
  color: #fff;
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .07em;
  padding: 6px 12px;
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}

.marker__stem { width: 2px; height: 9px; background: var(--navy); }

.marker__dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #1eaee5;
  border: 3.5px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
}

.map__where {
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
  pointer-events: none;
}

.map__where-ic { width: 20px; height: 20px; color: var(--blue); }
.map__addr { font-size: 14px; font-weight: 600; color: var(--ink); }
.map__coords { font-size: 12px; color: var(--muted); margin-top: 1px; }

.map__refresh {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: none;
  border-radius: 100px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 13px 20px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(35, 38, 74, .35);
}

.map__refresh:hover { background: var(--navy-2); }
.map__refresh-ic { width: 18px; height: 18px; color: var(--sky); }

.spinner {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: var(--sky);
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
}

/* ── Financeiro ───────────────────────────────────────────────── */

#panel-financeiro.is-active { gap: 18px; max-width: 1080px; flex: none; }

.sec-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }

.sec-head__title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}

.sec-head__sub { font-size: 14px; color: var(--muted); }

.table {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table__head,
.row {
  display: grid;
  grid-template-columns: 1.2fr 1fr .8fr 1fr 1.6fr;
  gap: 12px;
}

.table__head {
  padding: 14px 24px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
  border-bottom: 1px solid var(--chip);
}

.row {
  padding: 16px 24px;
  align-items: center;
  border-bottom: 1px solid var(--line-3);
}

.row--open { background: var(--amber-row); }
.row--last { border-bottom: none; }

.row__ref { font-size: 15px; font-weight: 600; }
.row__cell { font-size: 14.5px; color: var(--ink-3); }
.row__cell--strong { font-weight: 600; color: var(--ink); }

.tag {
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 100px;
  white-space: nowrap;
}

.tag--open { background: var(--amber-soft); color: var(--amber); }
.tag--paid { background: var(--green-soft); color: var(--green); }

.row__actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.btn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 100px;
  cursor: pointer;
  border: none;
}

.btn .ic { width: 15px; height: 15px; }

.btn--ghost { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); }
.btn--ghost:hover { background: #f0f6fb; }

.btn--solid { background: var(--blue); color: #fff; }
.btn--solid:hover { background: var(--blue-dark); }

.btn--link { background: none; color: var(--blue); }
.btn--link:hover { background: var(--blue-soft); }

.btn.is-done { color: var(--green); border-color: var(--green-soft); background: var(--green-soft); }

.note { font-size: 13px; color: var(--muted-2); }

/* ── Rastreador ───────────────────────────────────────────────── */

#panel-rastreador.is-active { flex: none; }

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1150px;
  align-content: start;
}

.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
}

.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.card__ic { width: 22px; height: 22px; color: var(--blue); }

.card__title {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  font-size: 14.5px;
}

.fields dt { font-size: 12px; color: var(--muted-2); }
.fields dd { font-weight: 600; margin-top: 2px; }
.fields dd.is-green { color: var(--green); }
.fields dd.is-break { word-break: break-all; }
.fields .soft { font-weight: 400; color: var(--muted); }
.field--wide { grid-column: 1 / -1; }

/* ── Dados cadastrais ─────────────────────────────────────────── */

#panel-dados-cadastrais.is-active { gap: 18px; flex: none; }

.card--wide { grid-column: 1 / -1; }

/* CPF oculto por padrão. */
.reveal { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.reveal__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
}

.reveal__btn:hover { color: var(--blue-dark); }
.reveal__btn .ic { width: 15px; height: 15px; }

.vrows { display: flex; flex-direction: column; gap: 10px; }

.vrow {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line-3);
  border-radius: 16px;
  background: var(--surface-2);
}

.vrow.is-selected { border-color: var(--blue-2); background: var(--blue-soft-2); }

.vrow__plate {
  flex: none;
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  border-radius: 9px;
  padding: 6px 14px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--ink);
}

.vrow__body { flex: 1; min-width: 0; }

.vrow__model {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}

.vrow__meta { font-size: 13px; color: var(--muted); margin-top: 3px; }

.vrow__tag {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue-dark);
  background: var(--blue-soft);
  padding: 4px 9px;
  border-radius: 100px;
}

/* ── Modal lateral · notificações ─────────────────────────────── */

.drawer { position: fixed; inset: 0; z-index: 40; }

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 27, 42, .38);
  opacity: 0;
  transition: opacity .22s ease;
}

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(30, 34, 70, .22);
  transform: translateX(100%);
  transition: transform .22s ease;
}

.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  .drawer__backdrop, .drawer__panel { transition: none; }
}

.drawer__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 16px 26px;
  border-bottom: 1px solid var(--line-3);
}

.drawer__titles { flex: 1; min-width: 0; }

.drawer__title {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}

.drawer__sub { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }

.drawer__head .btn--link { padding: 7px 10px; font-size: 12.5px; }

.round--sm {
  width: 34px;
  height: 34px;
  box-shadow: none;
  border-color: transparent;
  background: none;
  color: var(--muted);
}

.round--sm:hover { background: var(--chip); color: var(--ink-2); }
.round--sm .ic { width: 17px; height: 17px; stroke-width: 2; }

.drawer__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 20px 20px;
}

.drawer__group {
  padding: 16px 6px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.notif {
  display: flex;
  gap: 13px;
  padding: 13px 14px;
  border-radius: 15px;
  background: var(--surface);
  border: 1px solid var(--line-3);
}

.notif + .notif { margin-top: 8px; }

.notif.is-unread { background: var(--blue-soft-2); border-color: #d8eefa; }

.notif__ic {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  background: var(--chip);
  color: #5a5f76;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif__ic .ic { width: 20px; height: 20px; }

.notif__ic--blue { background: var(--blue-soft); color: var(--blue); }
.notif__ic--green { background: var(--green-soft); color: var(--green); }
.notif__ic--amber { background: var(--amber-soft); color: var(--amber); }
.notif__ic--red { background: #fdecec; color: #c23b3b; }

.notif__body { flex: 1; min-width: 0; }

.notif__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.notif__new {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--blue);
}

.notif__text { font-size: 13.5px; color: var(--ink-3); margin-top: 3px; }
.notif__time { font-size: 12px; color: var(--muted-2); margin-top: 5px; }

.notif__action {
  margin-top: 9px;
  border: none;
  background: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
}

.notif__action:hover { color: var(--blue-dark); text-decoration: underline; }

.drawer__foot {
  padding: 14px 26px 18px;
  border-top: 1px solid var(--line-3);
  font-size: 12px;
  color: var(--muted-3);
}

/* ── Telas menores ────────────────────────────────────────────── */

@media (max-width: 1240px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1000px) {
  /* Empilhado: a página volta a rolar por inteiro. */
  .shell {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    /* Desconta a barra do topo, que fica fora do .shell. */
    min-height: calc(100vh - var(--mbar-h));
  }

  /* Barra fixa no topo: marca + botão do menu. */
  .mbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 11px 16px;
    background: rgba(255, 255, 255, .93);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }

  .mbar__logo { height: 34px; border-radius: 8px; flex: none; }

  .mbar__kicker {
    flex: 1;
    min-width: 0;
    font-family: var(--display);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .mbar__btn {
    width: 42px;
    height: 42px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-2);
    border-radius: 13px;
    background: var(--surface);
    color: var(--ink-2);
    cursor: pointer;
  }

  .mbar__btn:hover { background: #f0f6fb; border-color: var(--blue-2); color: var(--blue-dark); }

  /* O menu sai do fluxo e passa a descer sobre o conteúdo. Fechado ele
     fica fora da tela e `visibility` o tira da navegação por teclado —
     o atributo `hidden` não serve aqui, pois no desktop o mesmo
     elemento é o menu lateral permanente. */
  .side {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    max-height: min(90vh, 760px);
    gap: 20px;
    /* Em telas com entalhe o modal encosta no topo. */
    padding: max(16px, env(safe-area-inset-top)) 18px 22px;
    border-right: none;
    border-radius: 0 0 22px 22px;
    box-shadow: 0 22px 50px rgba(30, 34, 70, .28);
    transform: translateY(-101%);
    visibility: hidden;
    transition: transform .26s ease, visibility 0s linear .26s;
  }

  body.is-menu .side {
    transform: none;
    visibility: visible;
    transition: transform .26s ease;
  }

  .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(24, 27, 42, .38);
    opacity: 0;
    visibility: hidden;
    transition: opacity .26s ease, visibility 0s linear .26s;
  }

  body.is-menu .menu-backdrop {
    opacity: 1;
    visibility: visible;
    transition: opacity .26s ease;
  }

  /* Enquanto o modal está aberto, só ele rola. */
  body.is-menu { overflow: hidden; }

  /* O hambúrguer da marca vira o botão de fechar do modal. */
  .burger { display: flex; }

  /* Sem altura sobrando, os atalhos não precisam ser empurrados. */
  .jump { margin-top: 4px; }
  .side__foot { margin-top: 12px; }

  .main { overflow-y: visible; padding: 20px 20px 32px; }
  .head { flex-wrap: wrap; gap: 14px; }
  .head__id { flex: 1; min-width: 200px; }

  /* Sem os quatro cartões, o mapa fica com a tela quase inteira. */
  .map { min-height: min(62vh, 520px); }

  /* ── Linha superior: placa + “Ver detalhes” ─────────────────── */

  .picker { flex: none; }
  /* “BRASIL” sai: no celular a placa é só o número mais a seta. */
  .plate { padding: 9px 12px 9px 16px; gap: 8px; }
  .plate__country { display: none; }
  .plate__caret { display: block; }

  .details {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: none;
    margin-left: auto;
    padding: 10px 16px;
    border: 1px solid var(--line-2);
    border-radius: 100px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
  }

  .details .ic { width: 17px; height: 17px; color: var(--blue); }
  .details[aria-expanded="true"] { border-color: var(--blue-2); background: var(--blue-soft-2); }

  /* Lista de veículos que desce da placa. */
  .picker__menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 35;
    min-width: 244px;
    max-width: min(320px, 84vw);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line-2);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 16px 34px rgba(30, 34, 70, .18);
    animation: picker-in .18s ease;
  }

  @keyframes picker-in {
    from { opacity: 0; transform: translateY(-6px); }
  }

  /* ── Modal dos indicadores (“Ver detalhes”) ─────────────────── */

  .sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    visibility: hidden;
    transition: visibility 0s linear .26s;
  }

  .sheet.is-open { visibility: visible; transition: none; }

  .sheet__backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(24, 27, 42, .38);
    opacity: 0;
    transition: opacity .26s ease;
  }

  .sheet.is-open .sheet__backdrop { opacity: 1; }

  .sheet__panel {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    max-height: min(90vh, 700px);
    overflow-y: auto;
    padding: max(16px, env(safe-area-inset-top)) 16px 20px;
    background: var(--surface);
    border-radius: 0 0 22px 22px;
    box-shadow: 0 22px 50px rgba(30, 34, 70, .28);
    transform: translateY(-101%);
    transition: transform .26s ease;
  }

  .sheet.is-open .sheet__panel { transform: none; }

  body.is-stats { overflow: hidden; }

  .sheet__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

  .sheet__title {
    flex: 1;
    min-width: 0;
    font-family: var(--display);
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
  }

  .sheet__plate {
    font-family: var(--display);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--blue-dark);
    background: var(--blue-soft);
    padding: 5px 11px;
    border-radius: 100px;
  }

  /* Dentro do modal os cartões viram linhas discretas. */
  .sheet .stats { grid-template-columns: minmax(0, 1fr); gap: 10px; }

  .sheet .stat {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line-3);
    background: var(--surface-2);
    box-shadow: none;
  }

  .sheet .stat__ic { width: 40px; height: 40px; border-radius: 11px; }
  .sheet .stat__value { font-size: 16px; }

  .table__head { display: none; }

  .row {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 6px;
    align-items: baseline;
  }

  .row__ref { grid-column: 1 / -1; }
  .row__actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 1000px) and (prefers-reduced-motion: reduce) {
  .side, .menu-backdrop, .sheet__panel, .sheet__backdrop { transition: none; }
  .picker__menu { animation: none; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  :root { --mbar-h: 51px; }
  .mbar { padding: 10px 14px; }
  .mbar__logo { height: 30px; }
  .side { padding: 14px 14px 20px; gap: 18px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .plate__value { font-size: 22px; }
  .quick__input { width: 150px; }

  .map__refresh { left: 18px; right: 18px; justify-content: center; }
  .map__where { right: 18px; bottom: 74px; }

  .vrow { flex-wrap: wrap; gap: 10px 14px; }
  .vrow__body { flex-basis: 100%; }

  .drawer__head { flex-wrap: wrap; padding: 18px 16px 14px 20px; }
  .drawer__head .round--sm { order: 2; }
  .drawer__head .btn--link { order: 3; margin-left: auto; }
  .drawer__body { padding: 4px 14px 16px; }
  .drawer__foot { padding: 12px 20px 16px; }
}
