/* Controle de Jornada — cores do logo da Jaloto Transportes (degradê azul) e farol em semáforo.
   Vermelho, amarelo e verde ficam reservados ao farol e sempre andam com texto (nunca só a cor). */
:root {
  /* azuis do logo: #084887 (claro) → #03396a → #00213a (escuro) */
  --jal-claro: #084887; --jal-medio: #03396a; --jal-escuro: #00213a; --jal-cabecalho: #0b3a66; --jal-destaque: #7cc0ff;
  --canvas: #edf1f6; --surface: #fff; --surface-2: #f7f9fc; --hover: #eef5fd; --selecao: #e3eefb;
  --line: #e3e9f0; --line-forte: #cdd6e1; --card-border: #d9e1ea;
  --ink: #102030; --ink-2: #3d5064; --muted: #6b7c8f; --placeholder: #a3b0be;
  --primario: #0a4f93; --primario-hover: #03396a; --link: #0b62ad;
  /* farol (paleta de status): crítico, atenção, bom */
  --farol-vermelho: #d03b3b; --farol-amarelo: #fab219; --farol-verde: #0ca30c;
  --texto-neg: #b42318; --fundo-excedido: #fdf3f3;
  --amber-txt: #7a4f00; --amber-soft: #fff1cf; --red-soft: #fde8e8;
  --r: 10px; --r-lg: 12px;
  --shadow: 0 1px 2px rgba(16,30,50,.05), 0 2px 8px rgba(16,30,50,.05);
  --fonte: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --gx: clamp(12px, 1.6vw, 24px); --barra-h: 56px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--canvas); color: var(--ink); font: 13.5px/1.4 var(--fonte); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
a { color: var(--link); }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.neg, .saldo-neg { color: var(--texto-neg); font-weight: 650; }

/* ---------- barra superior */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px; height: var(--barra-h); padding: 0 var(--gx);
  background: linear-gradient(100deg, var(--jal-claro) 0%, var(--jal-medio) 38%, var(--jal-escuro) 100%); color: #e8eef6;
  box-shadow: 0 2px 10px rgba(0,22,42,.3); }
.marca { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.marca img { display: block; height: 40px; width: auto; flex: none; }
.marca span { display: grid; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.28); font-size: 13px; font-weight: 600; line-height: 1.25; color: #d6e6f7; white-space: nowrap; }
.marca small { font-size: 11.5px; font-weight: 500; color: #9dbbdb; }
.marca small:empty { display: none; }
.top-acoes { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.top-acoes:empty { display: none; }
.top-acoes .btn { height: 32px; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.28); color: #fff; }
.top-acoes .btn:hover:not(:disabled) { background: rgba(255,255,255,.2); }
.top-acoes .btn.icone { width: 32px; }
.top-acoes .btn.primario { background: #fff; border-color: #fff; color: var(--jal-medio); }
.top-acoes .btn.primario:hover:not(:disabled) { background: #dcebfb; }
.top-acoes input[type=date] { height: 32px; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.28); color: #fff; color-scheme: dark; }
.top-acoes input[type=date]:focus { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.2); }
.top-acoes .sel-filial { height: 32px; max-width: 260px; padding: 0 28px 0 10px; background-color: rgba(255,255,255,.1); border-color: rgba(255,255,255,.28);
  color: #fff; font-weight: 650; color-scheme: dark; cursor: pointer; text-overflow: ellipsis; }
.top-acoes .sel-filial:focus { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.2); }
.top-acoes .sel-filial option { background: #fff; color: var(--ink); font-weight: 500; }
.usuario { margin-left: 10px; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  color: #e8eef6; border-radius: 999px; padding: 3px 12px 3px 3px; font: inherit; font-size: 12.5px; cursor: pointer; }
.usuario:hover { background: rgba(255,255,255,.14); }
.usuario i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #d7ebff; color: var(--jal-escuro);
  font-style: normal; font-weight: 800; font-size: 11px; }

main { padding: 14px var(--gx) 32px; max-width: 1900px; margin: 0 auto; display: grid; gap: 12px; }
main > * { min-width: 0; }
main:focus { outline: none; }

/* ---------- cartões, botões, campos */
.card { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line-forte);
  border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--hover); }
.btn.primario { background: var(--primario); border-color: var(--primario); color: #fff; }
.btn.primario:hover:not(:disabled) { background: var(--primario-hover); }
.btn.icone { width: 34px; padding: 0; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
input, select { border: 1px solid var(--line-forte); border-radius: 8px; background: #fff; color: var(--ink); padding: 6px 10px; font: inherit; font-size: 13px; }
input:focus, select:focus { outline: 0; border-color: var(--link); box-shadow: 0 0 0 3px rgba(11,98,173,.15); }
input[type=date] { height: 34px; padding: 0 8px; }
::placeholder { color: var(--placeholder); }

.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 9px 14px; border-radius: var(--r); border: 1px solid; font-size: 13px; }
.aviso.err { background: #fff5f5; border-color: rgba(208,59,59,.35); color: var(--texto-neg); }
.aviso.warn { background: #fffaef; border-color: rgba(250,178,25,.5); color: var(--amber-txt); }
.aviso.info { background: #f2f7fd; border-color: rgba(10,79,147,.25); color: var(--jal-medio); }
.aviso b { font-weight: 700; }

/* ---------- indicador do farol, sóbrio: cor só onde pede ação.
   Excedido e Atenção = selo com símbolo (✕ e !); Dentro do limite = ponto verde pequeno; sem dados = anel cinza vazio.
   Forma e tamanho também diferenciam, então não depende só da cor. */
.farol { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.ind { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; flex: none; vertical-align: middle; }
.ind svg { width: 10px; height: 10px; fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.i-vermelho { background: var(--farol-vermelho); }
.i-amarelo { background: var(--farol-amarelo); }
.i-amarelo svg { stroke: #3d2a00; }
.i-verde, .i-cinza { width: 9px; height: 9px; margin: 3.5px; }
.i-verde { background: var(--farol-verde); }
.i-cinza { background: transparent; border: 1.5px solid #9aa7b4; }
.i-verde svg, .i-cinza svg { display: none; }
.farol-txt { font-size: 12px; font-weight: 600; color: var(--ink-2); }

/* ---------- faixa de indicadores: azul-escura, blocos translúcidos, ações empilhadas à direita.
   Cada bloco com atalho filtra a tabela (o bloco ligado ganha borda azul-clara). */
.faixa-kpi { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)) auto; gap: 8px; padding: 10px;
  border-radius: 14px; background: linear-gradient(100deg, #081f38 0%, #0f2f55 42%, #1d4f86 100%); box-shadow: 0 6px 18px rgba(0,22,42,.22); }
.kpi { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 8px 16px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px;
  background: rgba(255,255,255,.05); color: #fff; font: inherit; text-align: left; }
button.kpi { cursor: pointer; }
button.kpi:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.24); }
button.kpi:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.kpi.on { background: rgba(124,192,255,.16); border-color: var(--jal-destaque); box-shadow: inset 0 -3px 0 var(--jal-destaque); }
.kpi-txt { display: grid; min-width: 0; line-height: 1.2; }
.kpi-n { font-size: 24px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.kpi-l { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { margin-top: 1px; font-size: 11.5px; color: #a4b9cf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-marca { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.m-vermelho { background: #f2696b; }
.m-amarelo { background: var(--farol-amarelo); }
.m-cinza { border: 1.5px solid #9fb3c8; }
.kpi-anel { position: relative; display: grid; place-items: center; width: 48px; height: 48px; flex: none; }
.kpi-anel svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.anel-fundo, .anel-valor { fill: none; stroke-width: 5; }
.anel-fundo { stroke: rgba(255,255,255,.14); }
.anel-valor { stroke: #5aaef2; stroke-linecap: round; }
.kpi-anel b { font-size: 11.5px; font-weight: 700; }
.kpi-acoes { display: grid; gap: 6px; align-content: center; }
.kpi-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 35px; min-width: 176px; padding: 0 16px; border: 1px solid rgba(255,255,255,.26);
  border-radius: 8px; background: rgba(90,150,215,.28); color: #fff; font: inherit; font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; cursor: pointer; }
.kpi-btn:hover:not(:disabled) { background: rgba(110,170,235,.42); }
.kpi-btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.kpi-btn:disabled { opacity: .55; cursor: default; }
.kpi-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- lista de motoristas */
.lista { overflow: clip; }
.top-acoes .info-leitura { margin-right: 8px; color: #b7cce2; font-size: 12px; white-space: nowrap; }
.top-acoes .info-leitura b { color: #fff; font-weight: 650; }
/* filtro ligado: pílula azul-clara na barra com "12 de 30" e o botão de limpar */
.top-acoes .btn.limpar-filtros { gap: 8px; padding: 0 4px 0 10px; background: var(--jal-destaque); border-color: var(--jal-destaque); color: var(--jal-escuro); font-size: 12.5px; }
.top-acoes .btn.limpar-filtros:hover:not(:disabled) { background: #a5d4ff; }
.limpar-filtros svg { width: 14px; height: 14px; }
.limpar-filtros .lf-x { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 6px; background: rgba(0,33,58,.12); }
.limpar-filtros .lf-x svg { width: 12px; height: 12px; stroke-width: 2.6; }
.filtros-celular { display: none; }
.top-acoes .btn.filtros-celular.ligado { background: var(--jal-destaque); border-color: var(--jal-destaque); color: var(--jal-escuro); }
.filtros-celular svg { width: 14px; height: 14px; }

table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.t > thead > tr > th { position: sticky; top: var(--barra-h); z-index: 2; background: var(--jal-cabecalho); color: #fff; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; text-align: left; padding: 6px 8px; line-height: 1.2; vertical-align: bottom; }
.t > tbody > tr > td { padding: 4px 8px; border-bottom: 1px solid #d3dce6; vertical-align: middle; height: 34px; color: #0b1826; }
.t > thead > tr > th.n, .t > tbody > tr > td.n { text-align: right; }
.t tbody tr.par > td { background: #eaf0f6; }
.t tbody tr.linha:hover > td { background: #d9e7f6; }
.painel .muted { color: #4b5d70; }
.t > tbody > tr > td.neg { color: var(--texto-neg); }
.painel .placa { color: #1f3247; font-weight: 600; }
.painel > tbody > tr > td.num { font-weight: 600; }
.painel .pct .trilho { background: #cfd9e4; }
.t tr.linha.aberta > td { background: var(--selecao); border-bottom-color: transparent; }

/* título da coluna = botão do filtro (funil); coluna filtrada fica marcada em azul-claro */
.painel > thead > tr > th { padding: 6px 2px; }
.th-filtro { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; margin: -3px 0; padding: 3px 4px; border: 0; border-radius: 5px; background: none;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: inherit; line-height: inherit; cursor: pointer; }
.th-filtro > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.th-filtro .funil { width: 11px; height: 11px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; opacity: .5; }
.th-filtro:hover { background: rgba(255,255,255,.14); }
.th-filtro:hover .funil, .th-filtro[aria-expanded="true"] .funil { opacity: 1; }
.th-filtro[aria-expanded="true"] { background: rgba(255,255,255,.2); }
.th-filtro:focus-visible { outline: 2px solid #fff; outline-offset: 0; }
.painel > thead > tr > th.filtrado { background: #17558f; box-shadow: inset 0 -3px 0 var(--jal-destaque); }
.painel > thead > tr > th.filtrado .funil { opacity: 1; fill: var(--jal-destaque); stroke: var(--jal-destaque); }
.sem-resultado > td { height: auto !important; white-space: normal !important; }
.sem-resultado .vazio .btn { margin-top: 10px; }

/* janelinha do filtro (como no Excel): valores com caixa de marcar e quantos motoristas há em cada um */
.filtro-pop { position: fixed; z-index: 40; width: 272px; max-height: min(460px, calc(100vh - 16px)); display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line-forte); border-radius: 10px; box-shadow: 0 14px 34px rgba(0,22,42,.24); color: var(--ink); font-size: 13px; }
.fp-cab { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--line); }
.fp-cab b { flex: 1; font-size: 13.5px; font-weight: 700; }
.fp-cab select { flex: 1; height: 32px; font-weight: 600; }
.fp-fechar { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; }
.fp-fechar:hover { background: var(--hover); }
.fp-fechar svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.fp-busca { margin: 8px 10px 2px; height: 32px; }
.filtro-pop input[type=checkbox] { width: 15px; height: 15px; margin: 0; padding: 0; flex: none; accent-color: var(--primario); }
.fp-todos, .fp-op label { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
.fp-todos { padding: 8px 12px 6px; font-weight: 650; border-bottom: 1px solid var(--line); }
.fp-lista { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0; }
.fp-op { display: flex; align-items: center; }
.fp-op label { flex: 1; padding: 5px 4px 5px 12px; }
.fp-op:hover { background: var(--hover); }
.fp-r { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-n { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.fp-op.zero .fp-r, .fp-op.zero .fp-n { color: var(--placeholder); }
.fp-so { visibility: hidden; flex: none; margin-right: 6px; padding: 2px 6px; border: 0; border-radius: 4px; background: none; color: var(--link);
  font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.fp-so:hover { background: var(--selecao); }
.fp-op:hover .fp-so, .fp-so:focus-visible { visibility: visible; }
@media (hover: none) { .fp-so { visibility: visible; } }
.fp-vazio { padding: 10px 12px; color: var(--muted); }
.fp-rodape { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); }
.fp-rodape .btn { height: 30px; font-size: 12.5px; }

/* tabela do painel: colunas em % da largura (somam 100%), então se espalham por igual em qualquer tela e nunca rolam para o lado */
table.painel { table-layout: fixed; }
.painel .w-farol { width: 4.5%; } .painel .w-nome { width: 16.75%; } .painel .w-placa { width: 5.5%; } .painel .w-hora { width: 5.5%; }
.painel .w-pct { width: 9%; } .painel .w-dirigir { width: 8.5%; } .painel .w-agora { width: 11.5%; } .painel .w-alertas { width: 9.25%; } .painel .w-obs { width: 13%; }
.painel.com-filial .w-nome { width: 14.5%; } .painel.com-filial .w-filial { width: 9%; } .painel.com-filial .w-placa { width: 5%; } .painel.com-filial .w-pct { width: 8%; }
.painel.com-filial .w-dirigir { width: 7.5%; } .painel.com-filial .w-agora { width: 10.5%; } .painel.com-filial .w-alertas { width: 8.5%; } .painel.com-filial .w-obs { width: 10.5%; }
.painel .filial-txt { font-size: 12px; font-weight: 600; color: #1f3247; }
.painel .nome span, .painel .agora { font-size: 12.5px; }
.painel > thead > tr > th, .painel > tbody > tr > td, .painel > thead > tr > th.n, .painel > tbody > tr > td.n { text-align: center; }
.painel > thead > tr > th.c-nome, .painel > thead > tr > th.c-filial, .painel > thead > tr > th.c-obs,
.painel > tbody > tr > td.c-nome, .painel > tbody > tr > td.c-filial, .painel > tbody > tr > td.c-obs { text-align: left; }
.painel .pct { max-width: 132px; margin: 0 auto; }
.farol-cartao { display: none; }
.painel > tbody > tr > td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.painel > tbody > tr.linha > td { height: var(--linha-h, 34px); padding-top: 0; padding-bottom: 0; }
.painel .obs { height: min(26px, calc(var(--linha-h, 34px) - 4px)); }

/* página do tamanho da tela (sem barra de rolagem); só a área da tabela rola se faltar espaço */
@media (min-width: 1100px) {
  body.modo-painel { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
  body.modo-painel .topbar { flex: none; }
  body.modo-painel main { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  body.modo-painel main > * { flex: none; }
  body.modo-painel main > .lista { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  body.modo-painel .area-tabela { flex: 1; min-height: 0; overflow-y: auto; }
  body.modo-painel .t > thead > tr > th { top: 0; }
}
.painel tr.f-excedido > td { background: var(--fundo-excedido); }
.painel tr.f-excedido > td:first-child { box-shadow: inset 3px 0 0 var(--farol-vermelho); }
.painel tr.f-atencao > td:first-child { box-shadow: inset 3px 0 0 var(--farol-amarelo); }
.painel tr.f-sem_dados > td, .painel tr.f-atestado > td { color: var(--muted); }

.t .nome { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; background: none; border: 0; padding: 0; font: inherit; font-weight: 650; color: var(--ink);
  cursor: pointer; text-align: left; }
.t .nome span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t .nome:hover span { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.t .nome .seta { width: 13px; height: 13px; flex: none; transition: transform .15s; stroke: var(--muted); fill: none; stroke-width: 2.4; }
.t tr.aberta .nome .seta { transform: rotate(90deg); }
.placa { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; color: var(--ink-2); }
.jornada { font-weight: 750; }

.pct { display: grid; grid-template-columns: 1fr 44px; gap: 6px; align-items: center; }
.pct .trilho { position: relative; height: 6px; border-radius: 999px; background: #e1e8f0; overflow: hidden; }
.pct .trilho i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: #4f7396; }
.pct.f-atencao .trilho i { background: var(--farol-amarelo); }
.pct.f-excedido .trilho i { background: var(--farol-vermelho); }
.pct .trilho::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--marca, 90%); width: 1px; background: rgba(16,32,48,.35); }
.pct b { font-size: 12px; font-weight: 650; text-align: right; }

.agora { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.ponto { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c, #94a3b8); }
.alertas { display: inline-flex; gap: 4px; max-width: 100%; overflow: hidden; }
.chip { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11px; font-weight: 650; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.err { background: var(--red-soft); color: var(--texto-neg); }
.chip.warn { background: var(--amber-soft); color: var(--amber-txt); }
.chip.mais { background: #e7edf3; color: var(--ink-2); flex: none; }

/* observação: parece texto até passar o mouse ou clicar */
.obs::placeholder { color: transparent; }
.obs:hover::placeholder, .obs:focus::placeholder { color: var(--placeholder); }
.obs { width: 100%; height: 26px; padding: 2px 7px; font-size: 12.5px; background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--ink); }
.obs:hover { border-color: var(--line-forte); background: #fff; }
.obs:focus { background: #fff; }
.obs.salvando { border-color: var(--farol-amarelo); }
.obs.salvo { border-color: var(--farol-verde); }
.obs.erro { border-color: var(--farol-vermelho); }

/* ---------- detalhe do motorista (linha expandida) */
.t tr.detalhe > td { background: var(--selecao); padding: 2px 14px 14px; white-space: normal; height: auto; }
.det { display: grid; gap: 10px; }
.det-topo { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--ink-2); font-size: 12.5px; }
.det-topo b { color: var(--ink); }
.linha-tempo { position: relative; }
.lt-barra { position: relative; height: 24px; border-radius: 6px; background: repeating-linear-gradient(90deg, #fff 0 calc(100%/24 - 1px), #e6ecf2 calc(100%/24 - 1px) calc(100%/24));
  border: 1px solid var(--line-forte); overflow: hidden; }
.lt-barra i { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; background: var(--c); min-width: 2px; }
.lt-horas { position: relative; height: 14px; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.lt-horas span { position: absolute; transform: translateX(-50%); }
.lt-horas span:first-child { transform: none; }
.lt-horas span:last-child { transform: translateX(-100%); }
.lt-agora { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--farol-vermelho); border-radius: 2px; }
.legenda { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--ink-2); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.det .mini { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.det .mini h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); padding: 7px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.det .mini table { width: 100%; border-collapse: collapse; font-size: 12px; }
.det .mini td, .det .mini th { padding: 4px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.det .mini th { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.det .mini tr:last-child td { border-bottom: 0; }
.det .local { color: var(--muted); font-size: 11.5px; }

.vazio { padding: 30px 20px; text-align: center; color: var(--muted); }
.vazio b { display: block; color: var(--ink); font-size: 14.5px; margin-bottom: 4px; }

/* ---------- diálogo e avisos rápidos */
.dlg { border: 0; border-radius: var(--r-lg); padding: 20px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(16,30,50,.25); }
.dlg::backdrop { background: rgba(0,33,58,.45); }
.dlg h2 { font-size: 17px; }
.dlg p { margin: 6px 0 14px; font-size: 13px; }
.dlg input { width: 100%; height: 36px; }
.dlg-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--jal-escuro); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(5,15,30,.3); max-width: 360px; }
.toast.err { background: var(--texto-neg); }
.carregando { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- telas menores: em notebook estreito some a coluna Placa; abaixo de 1100px a lista vira cartões */
@media (max-width: 1500px) {
  .kpi { gap: 10px; padding: 8px 12px; }
  .kpi small { font-size: 11px; }
  .kpi-btn { min-width: 150px; padding: 0 12px; }
  .painel > thead > tr > th { font-size: 10px; letter-spacing: 0; }
  .th-filtro .funil { width: 10px; height: 10px; }
}
@media (max-width: 1320px) {
  /* colunas estreitas: o funil só aparece na coluna filtrada (o título inteiro continua abrindo o filtro) */
  .th-filtro .funil { display: none; }
  .painel > thead > tr > th.filtrado .funil, .th-filtro[aria-expanded="true"] .funil { display: block; }
  .usuario span { display: none; }
  .usuario { padding: 3px; }
  .top-acoes .info-leitura { font-size: 11.5px; margin-right: 4px; }
}
@media (max-width: 1280px) {
  .painel .w-placa, .painel.com-filial .w-placa { width: 0; } .painel th.c-placa, .painel td.c-placa { padding: 0; font-size: 0; border-left: 0; }
  .painel th.c-placa .th-filtro { display: none; }
  .painel.com-filial .w-nome { width: 16%; } .painel.com-filial .w-filial { width: 11.5%; } .painel.com-filial .w-hora { width: 5.75%; }
  .top-acoes .sel-filial { max-width: 200px; }
}
@media (max-width: 1099px) {
  .topbar { height: auto; flex-wrap: wrap; row-gap: 0; padding-top: 6px; padding-bottom: 6px; }
  .top-acoes { order: 3; width: 100%; margin: 4px 0 2px; flex-wrap: wrap; justify-content: flex-end; }
  .usuario { margin-left: auto; }
  .faixa-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-principal { grid-column: 1 / -1; }
  .kpi-acoes { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .kpi-btn { min-width: 0; }
  /* lista em cartões: farol e nome em cima, números em 3 colunas, rótulo pequeno sobre o valor */
  table.painel, .painel > tbody { display: block; width: 100%; }
  .painel colgroup, .painel thead { display: none; }
  .painel tr.linha { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: dense; gap: 4px 12px; padding: 10px 12px;
    border-bottom: 1px solid var(--line); background: var(--surface); }
  .painel tr.linha.par { background: var(--surface-2); }
  .painel tr.linha.f-excedido { background: var(--fundo-excedido); box-shadow: inset 3px 0 0 var(--farol-vermelho); }
  .painel tr.linha.f-atencao { box-shadow: inset 3px 0 0 var(--farol-amarelo); }
  .painel > tbody > tr.linha > td { display: block; height: auto; padding: 0; border: 0; white-space: normal; text-align: left !important;
    box-shadow: none !important; background: transparent !important; min-width: 0; }
  .painel tr.linha > td::before { content: attr(data-l); display: block; color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
  .painel td.c-farol, .painel td.c-nome, .painel td.c-pct, .painel td.c-agora, .painel td.c-alertas, .painel td.c-obs { grid-column: 1 / -1; }
  .painel td.c-farol, .painel td.sem-rotulo { display: flex !important; align-items: center; }
  .painel tr.linha > td.c-farol::before, .painel tr.linha > td.sem-rotulo::before { display: none; }
  .painel td.c-alertas:empty { display: none; }
  .painel .nome span { white-space: normal; font-size: 14px; }
  .painel td.c-placa { font-size: inherit; }
  .top-acoes .sel-filial { max-width: none; flex: 1 1 180px; }
  .painel .pct { max-width: none; margin: 0; }
  .painel .obs { height: 30px; }
  .farol-cartao { display: inline; margin-left: 8px; font-size: 12px; font-weight: 650; color: var(--ink-2); }
  .painel .jornada { font-size: 15px; }
  .top-acoes .btn.filtros-celular { display: inline-flex; }
  .top-acoes .btn.limpar-filtros { display: none; }
  .top-acoes .info-leitura { margin-right: auto; }
  .painel tr.sem-resultado, .painel tr.sem-resultado > td { display: block; }
  .painel tr.detalhe { display: block; }
  .painel tr.detalhe > td { display: block; padding: 8px 12px 14px; }
  .obs { border-color: var(--line-forte); background: #fff; }
  .obs::placeholder { color: var(--placeholder); }
}
@media (max-width: 760px) {
  .topbar { gap: 12px; }
  .marca img { height: 32px; }
  .marca span, .usuario span { display: none; }
  .usuario { padding: 3px; }
  main { padding: 10px 10px 32px; }
  .faixa-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  .kpi[data-atalho="NAO"] { grid-column: 1 / -1; }
  .kpi { padding: 8px 12px; }
  .kpi-n { font-size: 21px; }
  .top-acoes .info-leitura { flex: 1 1 100%; white-space: normal; }
}

/* ---------- site da nuvem: menu da conta, campos, login e admin */
.menu-conta { position: fixed; z-index: 45; min-width: 230px; display: grid; padding: 6px; background: #fff; border: 1px solid var(--line-forte);
  border-radius: 10px; box-shadow: 0 14px 34px rgba(0,22,42,.24); }
.menu-conta .mc-quem { display: grid; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-conta .mc-quem small { color: var(--muted); font-size: 12px; }
.menu-conta button, .menu-conta a { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink);
  font: inherit; font-size: 13px; text-align: left; text-decoration: none; cursor: pointer; }
.menu-conta button:hover, .menu-conta a:hover { background: var(--hover); }
.campo { display: grid; gap: 5px; margin-top: 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.campo input, .campo select { width: 100%; height: 36px; font-weight: 400; color: var(--ink); }
.campo-linha { display: flex; gap: 6px; }
.campo-linha input { flex: 1; min-width: 0; }
.form-msg { min-height: 18px; margin: 10px 0 0; color: var(--texto-neg); font-size: 12.5px; font-weight: 600; }
.form-msg:empty { min-height: 0; margin: 0; }
.btn.largo { width: 100%; height: 40px; margin-top: 14px; font-size: 14px; }
.btn.perigo { color: var(--texto-neg); border-color: rgba(180,35,24,.35); }
.btn.perigo:hover:not(:disabled) { background: #fff5f5; }
.chip.ok { background: #e6f4e6; color: #145c14; }

.pagina-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: linear-gradient(135deg, var(--jal-claro) 0%, var(--jal-medio) 45%, var(--jal-escuro) 100%); }
.login-caixa { width: min(400px, 100%); display: grid; gap: 18px; padding: 0; margin: 0; max-width: none; }
.login-marca { display: flex; align-items: center; justify-content: center; gap: 14px; color: #fff; }
.login-marca img { height: 52px; width: auto; }
.login-marca span { padding-left: 14px; border-left: 1px solid rgba(255,255,255,.3); font-size: 15px; font-weight: 600; color: #d6e6f7; }
.login-form { padding: 24px; background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,22,42,.35); }
.login-form h1 { font-size: 20px; }
.login-form .muted { margin: 6px 0 0; font-size: 13px; }
.lembrar { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.lembrar input { width: 16px; height: 16px; margin: 0; accent-color: var(--primario); }
.login-ajuda { margin: 14px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }

.pagina-admin main { max-width: 1200px; }
.adm { padding: 0; }
.adm-cab { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.adm-cab h1 { font-size: 18px; } .adm-cab h2 { font-size: 15px; }
.adm-cab p { margin: 4px 0 0; font-size: 12.5px; }
.adm-tabela { overflow-x: auto; }
.adm-tabela .t > thead > tr > th { position: static; }
.adm-tabela tr.inativo > td { color: var(--muted); }
.adm-acoes { white-space: nowrap; text-align: right; }
.adm-acoes .btn { height: 30px; font-size: 12.5px; }
.adm-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; padding: 4px 16px 16px; }
.adm-form .form-msg, .adm-form-acoes { grid-column: 1 / -1; }
.adm-form-acoes { display: flex; justify-content: flex-end; margin-top: 14px; }
.dlg .campo:first-of-type { margin-top: 6px; }
@media (max-width: 760px) { .adm-form { grid-template-columns: 1fr; } }
