/* Registro de Viagem — sistema web da operação (CCO).
   Tokens do design system "Heavy Haul & Logistics" + layout dos protótipos do CCO
   (menu lateral, barra superior, painel ao vivo, descargas pendentes, detalhe do manifesto). */

/* Inter variável (pesos 100–900) servida junto do site — não depende do Google Fonts.
   Fontsource @fontsource-variable/inter 5, licença SIL OFL 1.1 (assets/fontes/LICENSE-Inter-OFL.txt). */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fontes/inter-latin-wght-normal.woff2") format("woff2-variations"), url("fontes/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fontes/inter-latin-ext-wght-normal.woff2") format("woff2-variations"), url("fontes/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --primary: #0B2545;
  --primary-deep: #001026;
  --primary-on-muted: #B1C7F0;
  --secondary: #1D63FF;
  --secondary-pressed: #133E87;
  --amber: #D97706;
  --orange: #EA580C;
  --success: #16A34A;
  --danger: #BA1A1A;
  --danger-forte: #DC2626;
  --danger-bg: #FFDAD6;

  --canvas: #F4F6F9;
  --surface: #FFFFFF;
  --surface-low: #F2F3FF;
  --text: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --disabled: #94A3B8;

  --badge-azul-bg: #EFF6FF;
  --badge-ambar-bg: #FEF3C7;
  --badge-verde-bg: #DCFCE7;
  --badge-laranja-bg: #FFEDD5;
  --badge-cinza-bg: #F1F5F9;
  --badge-vermelho-bg: #FEE2E2;

  --r-sm: 0.25rem; --r: 0.5rem; --r-md: 0.75rem; --r-lg: 1rem; --r-xl: 1.5rem; --r-full: 9999px;
  --sp-xs: 0.25rem; --sp-sm: 0.5rem; --sp-md: 1rem; --sp-lg: 1.5rem; --sp-xl: 2rem;

  --sombra-1: 0 2px 4px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --sombra-2: 0 8px 16px -2px rgba(11, 37, 69, 0.12), 0 3px 6px -1px rgba(11, 37, 69, 0.08);
  --sombra-3: 0 20px 25px -5px rgba(15, 23, 42, 0.25), 0 8px 10px -6px rgba(15, 23, 42, 0.2);
  --halo: 0 0 0 4px rgba(29, 99, 255, 0.15);

  --fonte: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --lateral: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--canvas); color: var(--text); font-family: var(--fonte);
  font-size: 15px; font-weight: 500; line-height: 22px; -webkit-font-smoothing: antialiased;
}
a { color: var(--secondary); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.tnum, td, .kpi-valor, .placa-numero { font-variant-numeric: tabular-nums; }
.oculto { display: none !important; }
.muted { color: var(--text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { margin: 0; color: var(--text); }

/* ---------- Tipografia (tokens do escopo: display, headline, body, label, code-plate) ---------- */
.display-lg { font-size: 32px; font-weight: 800; line-height: 40px; letter-spacing: -0.02em; }
.display-md { font-size: 28px; font-weight: 700; line-height: 36px; letter-spacing: -0.01em; }
.headline-lg { font-size: 24px; font-weight: 700; line-height: 32px; letter-spacing: -0.01em; }
.headline-md { font-size: 20px; font-weight: 700; line-height: 28px; }
.headline-sm { font-size: 18px; font-weight: 600; line-height: 24px; }
.body-lg { font-size: 17px; font-weight: 500; line-height: 24px; }
.body-sm { font-size: 13px; font-weight: 500; line-height: 18px; letter-spacing: 0.01em; }
.label-lg { font-size: 16px; font-weight: 700; line-height: 20px; letter-spacing: 0.02em; }
.label-md { font-size: 14px; font-weight: 700; line-height: 18px; letter-spacing: 0.02em; }
.label-sm { font-size: 12px; font-weight: 700; line-height: 16px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.sobretitulo { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--secondary); display: inline-flex; align-items: center; gap: 6px; }
.ao-vivo { width: 8px; height: 8px; border-radius: 50%; background: var(--danger-forte); box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); animation: pulso 1.6s infinite; }
@keyframes pulso { 70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }

/* ---------- Estrutura: menu lateral + barra superior ---------- */
.casca { display: grid; grid-template-columns: var(--lateral) 1fr; min-height: 100vh; }
.lateral {
  background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 16px 12px;
}
.lateral-marca { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; border-bottom: 1px solid var(--border); margin-bottom: 14px; color: var(--text); }
.lateral-marca:hover { text-decoration: none; }
.lateral-marca .logo { width: 40px; height: 40px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; }
.lateral-marca strong { display: block; font-size: 15px; font-weight: 800; line-height: 18px; }
.lateral-marca small { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.versao { margin-left: auto; background: var(--primary); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; }
.grupo-menu { margin-bottom: 18px; }
.grupo-menu .label-sm { padding: 0 10px 6px; }
.item-menu {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); color: var(--text);
  font-weight: 700; font-size: 14px; line-height: 18px; letter-spacing: 0.02em; margin-bottom: 2px; position: relative;
}
.item-menu svg { flex: none; color: var(--text-muted); }
.item-menu:hover { background: var(--canvas); text-decoration: none; }
.item-menu.ativo { background: var(--secondary); color: #fff; box-shadow: 0 4px 10px -2px rgba(29, 99, 255, .45); }
.item-menu.ativo svg { color: #fff; }
.item-menu .contador { margin-left: auto; background: var(--danger-forte); color: #fff; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: var(--r-full); display: grid; place-items: center; padding: 0 6px; }
.item-menu.ativo .contador { background: #fff; color: var(--danger-forte); }
.item-menu.desabilitado { color: var(--disabled); pointer-events: none; }
.status-sistema { margin-top: auto; border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; background: var(--canvas); display: grid; gap: 6px; font-size: 12px; }
.status-sistema div { display: flex; align-items: center; gap: 8px; }
.status-sistema b { margin-left: auto; font-size: 11px; letter-spacing: 0.04em; }
.ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--disabled); flex: none; }
.ponto.on { background: #22C55E; } .ponto.alerta { background: var(--amber); } .ponto.off { background: var(--danger-forte); }

.principal { min-width: 0; display: flex; flex-direction: column; }
.topo {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center;
  gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.busca { position: relative; flex: 1 1 260px; min-width: 190px; max-width: 380px; }
.busca input { width: 100%; height: 40px; border: 1.5px solid var(--border-strong); border-radius: var(--r); padding: 0 12px 0 36px; background: var(--canvas); }
.busca input:focus { outline: none; border-color: var(--secondary); box-shadow: var(--halo); background: #fff; }
.busca svg { position: absolute; left: 11px; top: 11px; color: var(--text-muted); }
.seletor-filial { height: 40px; border: 1.5px solid var(--border-strong); border-radius: var(--r); padding: 0 10px; background: #fff; font-weight: 700; font-size: 14px; }
.chip-topo { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--canvas); font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--text); }
.chip-topo:hover { text-decoration: none; border-color: var(--border-strong); }
.chip-topo.alerta { background: var(--badge-ambar-bg); border-color: var(--amber); color: #92400E; }
.chip-topo.critico { background: var(--badge-vermelho-bg); border-color: var(--danger-forte); color: #991B1B; }
.topo-usuario { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topo-usuario .nome { text-align: right; line-height: 18px; }
.topo-usuario .nome strong { display: block; font-size: 14px; }
.topo-usuario .nome small { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.avatar.p { width: 30px; height: 30px; font-size: 11px; background: #E2E7FF; color: var(--primary); }
.icone-btn { width: 40px; height: 40px; border-radius: var(--r); border: 1px solid var(--border); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--text-muted); }
.icone-btn:hover { color: var(--primary); border-color: var(--border-strong); }
.menu { position: relative; }
.menu-lista { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--sombra-2); padding: 6px; z-index: 30; }
.menu-lista a, .menu-lista button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--r); color: var(--text); background: none; border: 0; cursor: pointer; font-weight: 600; font-size: 14px; }
.menu-lista a:hover, .menu-lista button:hover { background: var(--canvas); text-decoration: none; }
.menu-lista .sep { height: 1px; background: var(--border); margin: 4px 0; }

/* Ocupa a largura disponível; em telas muito largas (ou zoom reduzido) fica centralizado num limite confortável */
.conteudo { padding: 24px; max-width: 1720px; width: 100%; margin: 0 auto; }
.cabecalho { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-md); margin-bottom: 20px; flex-wrap: wrap; }
.cabecalho p { margin: 4px 0 0; color: var(--text-muted); }
.voltar { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 14px; }

/* ---------- Cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sombra-1); padding: 1.25rem; }
.pilha > * + * { margin-top: 16px; }
.card-titulo { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.card-titulo .sub { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.grade { display: grid; gap: 16px; }
.grade-painel { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grade-pendentes { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grade-detalhe { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
@media (max-width: 1180px) { .grade-painel, .grade-pendentes, .grade-detalhe { grid-template-columns: 1fr; } }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 1080px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }
.kpi { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none !important; position: relative; }
.kpi .topo-kpi { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kpi .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--badge-azul-bg); color: var(--secondary); flex: none; }
.kpi .ic.verde { background: var(--badge-verde-bg); color: var(--success); }
.kpi .ic.ambar { background: var(--badge-ambar-bg); color: var(--amber); }
.kpi-valor { font-size: 32px; font-weight: 800; line-height: 40px; letter-spacing: -0.02em; } /* display-lg */
.tendencia { font-size: 12px; font-weight: 700; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.tendencia .sobe { color: var(--success); } .tendencia .desce { color: var(--danger); }
.meta-chip { display: inline-block; background: var(--badge-ambar-bg); color: #92400E; border-radius: 6px; font-size: 11px; font-weight: 800; padding: 2px 8px; }
.kpi.acao { background: var(--danger-forte); border-color: var(--danger-forte); color: #fff; }
.kpi.acao .label-sm, .kpi.acao .tendencia { color: #FEE2E2; }
.kpi.acao.zero { background: var(--surface); border-color: var(--border); color: var(--text); }
.kpi.acao.zero .label-sm, .kpi.acao.zero .tendencia { color: var(--text-muted); }
.kpi.acao .btn { margin-top: 8px; align-self: flex-start; }

/* Gráfico de barras */
.grafico { width: 100%; height: 220px; }
.grafico text { font-size: 11px; fill: var(--text-muted); font-family: var(--fonte); font-weight: 600; }
.legenda { display: flex; gap: 14px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.nota-capacidade { margin-top: 12px; background: var(--surface-low); border: 1px solid #DCE1FF; border-radius: var(--r); padding: 10px 12px; font-size: 13px; font-weight: 700; color: var(--primary); }

/* Painel lateral: filiais e GPS */
.linha-filial { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--r); }
.linha-filial + .linha-filial { margin-top: 8px; }
.linha-filial .num { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-low); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.card-escuro { background: var(--primary); border-color: var(--primary); color: #fff; }
.card-escuro .label-sm { color: var(--primary-on-muted); }
.card-escuro .grande { font-size: 30px; font-weight: 800; line-height: 36px; }
.barra-prog { height: 8px; border-radius: var(--r-full); background: rgba(255, 255, 255, .15); overflow: hidden; margin-top: 10px; }
.barra-prog i { display: block; height: 100%; background: #22C55E; border-radius: inherit; }

/* Pares rótulo/valor */
.pares { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 20px; }
.par .valor { font-size: 16px; font-weight: 700; line-height: 22px; margin-top: 2px; word-break: break-word; }
.par .valor small { display: block; font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ---------- Badges e placas ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r-full); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid; white-space: nowrap; }
.badge.azul { background: var(--badge-azul-bg); color: var(--secondary); border-color: var(--secondary); }
.badge.ambar { background: var(--badge-ambar-bg); color: #92400E; border-color: var(--amber); }
.badge.verde { background: var(--badge-verde-bg); color: #15803D; border-color: var(--success); }
.badge.laranja { background: var(--badge-laranja-bg); color: #9A3412; border: 1.5px solid var(--orange); }
.badge.vermelho { background: var(--danger-forte); color: #fff; border-color: var(--danger-forte); }
.badge.cinza { background: var(--badge-cinza-bg); color: var(--text-muted); border-color: var(--border-strong); }
.badge.navy { background: var(--primary); color: #fff; border-color: var(--primary); }
.badge.solido-azul { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.tag-tipo { display: inline-block; padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 800; color: #fff; background: var(--primary); }
.tag-tipo.c { background: var(--secondary); }

.placas { display: flex; flex-wrap: wrap; gap: 6px; }
/* Placa Mercosul: borda 1.5px navy, faixa "BRASIL" 9px, número no token code-plate (16px / 800 / 0.08em) */
.placa { display: inline-flex; flex-direction: column; border: 1.5px solid var(--primary); border-radius: 6px; overflow: hidden; background: #fff; min-width: 92px; text-align: center; }
.placa-topo { background: #003399; color: #fff; font-size: 9px; font-weight: 800; letter-spacing: 0.18em; line-height: 13px; padding: 0 6px; }
.placa-numero { font-size: 16px; font-weight: 800; letter-spacing: 0.08em; line-height: 20px; padding: 1px 8px; color: var(--text); }
.placa.grande { min-width: 140px; } .placa.grande .placa-topo { font-size: 10px; line-height: 15px; } .placa.grande .placa-numero { font-size: 22px; line-height: 30px; }

/* ---------- Botões ---------- */
/* Botões: texto no token label-lg (16px / 700 / 0.02em); principal com 52px (escopo); compactos para tabelas e avisos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: var(--r-md); border: 1.5px solid transparent; font-weight: 700; font-size: 16px; line-height: 20px; letter-spacing: 0.02em; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:focus-visible { outline: none; box-shadow: var(--halo); }
.btn-primario { background: var(--secondary); color: #fff; }
.btn-primario:hover { background: #1656E6; }
.btn-primario:active { background: var(--secondary-pressed); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .15); }
.btn-escuro { background: var(--primary); color: #fff; } .btn-escuro:hover { background: var(--primary-deep); }
.btn-sucesso { background: var(--success); color: #fff; } .btn-sucesso:hover { background: #15803D; }
.btn-branco { background: #fff; color: var(--danger-forte); }
.btn-secundario { background: #fff; color: var(--primary); border-color: var(--border-strong); }
.btn-secundario:hover { border-color: var(--primary); }
.btn-perigo { background: #fff; color: var(--danger); border-color: #F1B0A9; } .btn-perigo:hover { border-color: var(--danger); }
.btn-grande { min-height: 52px; border-radius: var(--r-lg); font-size: 16px; }
.btn-pequeno { min-height: 36px; padding: 0 14px; font-size: 14px; line-height: 18px; border-radius: var(--r); }
.btn-bloco { width: 100%; }
.btn:disabled { background: var(--disabled); border-color: var(--disabled); color: #fff; cursor: not-allowed; }
.acoes { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Formulários ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.campo input, .campo select, .campo textarea { min-height: 46px; border: 1.5px solid var(--border-strong); border-radius: var(--r); background: #fff; padding: 0 12px; width: 100%; }
.campo textarea { padding: 10px 12px; min-height: 96px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border: 2px solid var(--secondary); box-shadow: var(--halo); padding-left: 11.5px; }
.filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.erro-form { color: var(--danger); background: var(--danger-bg); border: 1px solid #F1B0A9; border-radius: var(--r); padding: 10px 12px; font-weight: 600; font-size: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--secondary); flex: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 14px; border-radius: var(--r-full); border: 1.5px solid var(--border-strong); background: #fff; font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.ativo { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip .ponto { width: 7px; height: 7px; }

/* ---------- Tabelas ---------- */
.tabela-wrap { overflow-x: auto; }
.conteudo .tabela-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sombra-1); }
.conteudo .card .tabela-wrap { background: none; border: 0; border-radius: 0; box-shadow: none; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; height: 64px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clicavel { cursor: pointer; } tbody tr.clicavel:hover { background: #F8FAFF; }
tbody tr.atrasado { background: #FFF7F5; } tbody tr.atrasado td:first-child { box-shadow: inset 4px 0 0 var(--danger-forte); }
.hora { font-weight: 800; color: var(--text-muted); white-space: nowrap; }
tr.atrasado .hora { color: var(--danger-forte); }
.mdfe { font-weight: 800; font-size: 15px; white-space: nowrap; }
.motorista { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.celula-sub { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.anexos { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 6px; background: var(--badge-verde-bg); color: #15803D; white-space: nowrap; }
.anexos.sem-gps { background: var(--badge-ambar-bg); color: #92400E; }
.vazio { text-align: center; color: var(--text-muted); padding: 40px 16px; }
.rodape-tabela { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; flex-wrap: wrap; font-size: 13px; }

/* ---------- Descargas pendentes ---------- */
.diretriz { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; gap: 20px 24px; align-items: center; background: var(--primary); color: #fff; border-radius: var(--r-lg); padding: 16px 20px; margin-bottom: 16px; }
.diretriz .stats { display: flex; gap: 28px; flex-wrap: wrap; }
@media (max-width: 1180px) { .diretriz { grid-template-columns: auto 1fr; } .diretriz .stats { grid-column: 1 / -1; } }
.diretriz .ic { width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; }
.diretriz .label-sm { color: var(--primary-on-muted); }
.diretriz .num { font-size: 22px; font-weight: 800; line-height: 28px; }
.diretriz .meta { font-size: 17px; font-weight: 800; line-height: 22px; }
.barra-filtros { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cartao-desc { position: relative; padding-left: 1.5rem; overflow: hidden; cursor: pointer; transition: box-shadow .15s; }
.cartao-desc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--amber); }
.cartao-desc.estourado::before { background: var(--danger-forte); }
.cartao-desc.tratando::before { background: var(--secondary); }
.cartao-desc.selecionado { box-shadow: var(--sombra-2); border-color: var(--secondary); }
.cartao-desc + .cartao-desc { margin-top: 14px; }
.cartao-desc .linha1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.cartao-desc .mdfe-g { font-size: 18px; font-weight: 800; }
.rota-g { font-size: 20px; font-weight: 800; line-height: 26px; margin: 10px 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rota-g .seta { color: var(--danger-forte); }
.cartao-desc .colunas { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cartao-desc .rodape-cartao { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; flex-wrap: wrap; }
.aviso-prazo { font-size: 13px; font-weight: 700; color: var(--danger-forte); }
.aviso-prazo.ok { color: var(--amber); }
.previa .foto-previa { aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: var(--canvas); border: 1px solid var(--border); margin: 12px 0; display: grid; place-items: center; color: var(--text-muted); font-size: 13px; }
.previa .foto-previa img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Detalhe ---------- */
.cab-detalhe { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.cab-detalhe .linha-status { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.motorista-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.motorista-card .ic { width: 48px; height: 48px; border-radius: 12px; background: var(--primary); display: grid; place-items: center; color: #fff; }
.motorista-card .nome { font-size: 22px; font-weight: 800; line-height: 28px; }
.composicao { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.visor-grande { position: relative; border-radius: var(--r-md); overflow: hidden; background: #0B1220; aspect-ratio: 16 / 9; display: grid; place-items: center; cursor: zoom-in; }
.visor-grande img { width: 100%; height: 100%; object-fit: contain; }
.visor-grande .selo { position: absolute; left: 12px; bottom: 12px; background: rgba(11, 37, 69, .88); color: #fff; border-radius: var(--r); padding: 8px 12px; font-size: 12px; font-weight: 700; display: grid; gap: 2px; }
.miniaturas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.mini { position: relative; border-radius: var(--r); overflow: hidden; border: 2px solid transparent; background: var(--canvas); aspect-ratio: 4 / 3; cursor: pointer; padding: 0; }
.mini.ativa { border-color: var(--secondary); }
.mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(11, 37, 69, .82); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 6px; text-align: left; }
.metadados { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; padding: 12px; background: var(--canvas); border: 1px solid var(--border); border-radius: var(--r); }

.etapas { list-style: none; margin: 0; padding: 0; }
.etapas li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding-bottom: 18px; }
.etapas li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--border-strong); }
.etapas li.feito:not(:last-child)::before { background: var(--secondary); }
.etapas .bola { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--border-strong); color: var(--text-muted); z-index: 1; }
.etapas li.feito .bola { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.etapas li.atual .bola { background: #fff; border-color: var(--secondary); color: var(--secondary); box-shadow: var(--halo); }
.etapas .t { font-weight: 800; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.etapas .t small { font-weight: 700; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.etapas .d { font-size: 12px; color: var(--text-muted); font-weight: 600; line-height: 17px; margin-top: 2px; }
.etapas .acao-pend { display: inline-block; margin-top: 6px; background: var(--secondary); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; }
.baixa { border: 2px solid var(--secondary); }
.baixa .operador { display: flex; justify-content: space-between; align-items: center; background: var(--canvas); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; font-size: 13px; }
.baixa .rodape-seg { font-size: 11px; color: var(--text-muted); font-weight: 600; text-align: center; margin-top: 10px; }

/* ---------- Login ---------- */
.login-pagina { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--primary); }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: var(--r-lg); border: 2px solid var(--primary-deep); box-shadow: var(--sombra-3); padding: 2rem; }
.login-marca { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-icone { width: 48px; height: 48px; border-radius: 12px; background: var(--primary); display: grid; place-items: center; }
.login-card form { display: grid; gap: 16px; }

/* ---------- Modal e visor ---------- */
.fundo-modal { position: fixed; inset: 0; background: rgba(11, 37, 69, .55); display: grid; place-items: center; z-index: 50; padding: 24px; }
.modal { background: #fff; border: 2px solid var(--primary); border-radius: var(--r-lg); box-shadow: var(--sombra-3); width: 100%; max-width: 520px; padding: 1.5rem; max-height: 90vh; overflow: auto; }
.modal h2 { margin-bottom: 16px; }
.modal .acoes { justify-content: flex-end; margin-top: 20px; }
.visor { background: rgba(0, 16, 38, .92); }
.visor-conteudo { position: relative; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.visor-conteudo img { max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: var(--r); background: #000; }
.visor-legenda { color: #fff; font-size: 14px; font-weight: 600; display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.visor-legenda a { color: var(--primary-on-muted); }
.visor-nav { position: absolute; top: 45%; background: rgba(255, 255, 255, .14); color: #fff; border: 0; width: 48px; height: 64px; border-radius: var(--r); font-size: 28px; cursor: pointer; }
.visor-nav.esq { left: -60px; } .visor-nav.dir { right: -60px; }
@media (max-width: 900px) { .visor-nav.esq { left: 4px; } .visor-nav.dir { right: 4px; } }
.visor-fechar { position: fixed; top: 16px; right: 16px; }

/* ---------- Aviso de nova descarga (canto superior direito) ---------- */
.avisos { position: fixed; top: 76px; right: 20px; display: grid; gap: 12px; z-index: 60; width: min(440px, calc(100vw - 40px)); }
.aviso-descarga { background: #fff; border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--sombra-3); padding: 16px; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; animation: entra .2s ease-out; }
.aviso-descarga .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--secondary); color: #fff; display: grid; place-items: center; }
.aviso-descarga .tag { display: inline-flex; align-items: center; gap: 6px; background: var(--badge-vermelho-bg); color: #991B1B; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.aviso-descarga h3 { font-size: 16px; font-weight: 800; margin: 6px 0 4px; }
.aviso-descarga p { margin: 0; font-size: 13px; color: var(--text-muted); font-weight: 600; }
.aviso-descarga .acoes { margin-top: 12px; grid-column: 2 / 4; }
.aviso-descarga .fechar { background: none; border: 0; color: var(--text-muted); font-size: 18px; cursor: pointer; line-height: 1; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 61; width: min(420px, calc(100vw - 40px)); }
.toast { background: #fff; border: 1px solid var(--border-strong); border-left: 5px solid var(--secondary); border-radius: var(--r-md); box-shadow: var(--sombra-2); padding: 12px 14px; display: grid; gap: 4px; animation: entra .18s ease-out; }
.toast.sucesso { border-left-color: var(--success); } .toast.erro { border-left-color: var(--danger); }
@keyframes entra { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }

.carregando { display: grid; place-items: center; padding: 60px 0; color: var(--text-muted); font-weight: 600; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border-strong); border-top-color: var(--secondary); border-radius: 50%; animation: gira .8s linear infinite; margin-bottom: 10px; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- Telas menores / zoom aumentado ---------- */
@media (max-width: 1280px) {
  .topo-usuario .nome { display: none; }            /* fica só o avatar (nome e e-mail no menu dele) */
}
@media (max-width: 1200px) {
  /* Menu lateral vira uma coluna de ícones (nome do item aparece ao passar o mouse) */
  :root { --lateral: 76px; }
  .lateral { padding: 14px 10px; align-items: center; }
  .lateral-marca { padding: 0 0 14px; justify-content: center; width: 100%; }
  .lateral-marca > span:not(.logo) { display: none; }
  .grupo-menu { width: 100%; }
  .grupo-menu .label-sm { display: none; }
  .item-menu { justify-content: center; padding: 12px 0; }
  .item-menu > span:not(.contador) { display: none; }
  .item-menu .contador { position: absolute; top: 3px; right: 6px; min-width: 18px; height: 18px; font-size: 10px; padding: 0 4px; }
  .status-sistema { padding: 10px 0; background: none; border: 0; justify-items: center; }
  .status-sistema div { font-size: 0; gap: 0; }
  .status-sistema b { display: none; }
  .topo { padding: 0 16px; gap: 10px; }
  .conteudo { padding: 20px; }
}
@media (max-width: 860px) {
  .seletor-filial { max-width: 150px; }
  .chip-topo span { display: none; }                /* só o ícone + cor de alerta */
}
@media (max-width: 640px) {
  .casca { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 8px; }
  .lateral-marca, .status-sistema { display: none; }
  .grupo-menu { display: flex; width: auto; gap: 4px; margin: 0; }
  .item-menu { padding: 10px 12px; }
  .topo { flex-wrap: wrap; height: auto; padding: 10px 12px; }
  .busca { max-width: none; }
  .conteudo { padding: 12px; }
}

@media print {
  .lateral, .topo, .avisos, .toasts, .nao-imprimir { display: none !important; }
  .casca { display: block; } .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
