:root {
  --pri: #0f766e;
  --pri-2: #14b8a6;
  --pri-claro: #e6f6f4;
  --verde: #16a34a;
  --laranja: #ea8a0c;
  --vermelho: #dc2626;
  --azul: #2563eb;
  --tinta: #1f2933;
  --suave: #6b7280;
  --linha: #e5e7eb;
  --fundo: #f4f6f7;
  --cartao: #ffffff;
  --raio: 14px;
  --sombra: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--tinta); background: var(--fundo); }
a { color: var(--pri); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
small, .suave { color: var(--suave); }
img { max-width: 100%; }

/* ---------- topo do escritório ---------- */
.barra-admin { position: sticky; top: 0; z-index: 10; background: var(--pri); color: #fff; display: flex; align-items: center; gap: 16px; padding: 0 16px; flex-wrap: wrap; }
.barra-admin .marca { color: #fff; text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: 8px; padding: 12px 0; white-space: nowrap; }
.logo { background: #fff; color: var(--pri); border-radius: 8px; padding: 2px 6px; font-size: 13px; font-weight: 800; }
.barra-admin nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.barra-admin nav a { color: #d7f3ef; text-decoration: none; padding: 14px 10px; white-space: nowrap; border-bottom: 3px solid transparent; }
.barra-admin nav a.ativo, .barra-admin nav a:hover { color: #fff; border-bottom-color: #fff; }
.barra-admin nav .sair { margin-left: auto; }
.conteudo-admin { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }

/* ---------- app (motorista / montador) ---------- */
.barra-app { position: sticky; top: 0; z-index: 10; background: #fff; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--linha); }
.barra-app h1 { font-size: 1.05rem; margin: 0; flex: 1; text-align: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--pri-claro); color: var(--pri); display: grid; place-items: center; font-weight: 700; }
.btn-voltar, .btn-icone { width: 34px; height: 34px; display: grid; place-items: center; text-decoration: none; color: var(--tinta); font-size: 26px; line-height: 1; }
.btn-icone { font-size: 13px; width: auto; color: var(--suave); }
.conteudo-app { max-width: 640px; margin: 0 auto; padding: 14px 14px 90px; }
.conteudo-publico { max-width: 560px; margin: 0 auto; padding: 24px 16px 60px; }

/* ---------- abas ---------- */
.abas { display: flex; background: #eef1f2; border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.abas a { flex: 1; text-align: center; text-decoration: none; padding: 8px 6px; border-radius: 999px; color: var(--pri); font-size: 14px; white-space: nowrap; }
.abas a.ativo { background: var(--pri); color: #fff; }
.abas .n { font-size: 12px; opacity: .8; }

/* ---------- cartões ---------- */
.cartao { background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); padding: 16px; margin-bottom: 14px; }
.cartao h3:first-child, .cartao h2:first-child { margin-top: 0; }
.parada { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 10px; text-decoration: none; color: inherit; border-left: 4px solid var(--verde); box-shadow: var(--sombra); }
.parada.ocorrencia { border-left-color: var(--laranja); }
.parada.entregue { border-left-color: var(--suave); opacity: .75; }
.parada .icone { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--verde); color: #fff; display: grid; place-items: center; font-size: 20px; }
.parada.ocorrencia .icone { background: var(--laranja); }
.parada.entregue .icone { background: var(--suave); }
.parada .ordem { position: absolute; top: -6px; right: -8px; background: #f4b63f; color: #3b2a00; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 5px; }
.parada .info { min-width: 0; flex: 1; }
.parada .nome, .parada .sub { display: block; }
.parada .nome { font-weight: 700; color: var(--verde); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.parada.ocorrencia .nome { color: var(--laranja); }
.parada.entregue .nome { color: var(--suave); }
.parada .sub { font-size: 13px; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.parada .seta { color: var(--suave); font-size: 22px; }
.tag-movel { display: inline-block; background: #fff4e0; color: #9a5b00; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }

.dados dt { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--suave); margin-top: 10px; }
.dados dd { margin: 2px 0 0; }
.acoes-rapidas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.acoes-rapidas a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; background: var(--pri-claro); color: var(--pri); border-radius: 12px; text-decoration: none; font-size: 13px; font-weight: 600; }
.acoes-rapidas span { font-size: 20px; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 11px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--pri); color: #fff; }
.btn:hover { filter: brightness(1.05); }
.btn-sec { background: #fff; color: var(--pri); border: 1.5px solid var(--pri); }
.btn-perigo { background: #fff; color: var(--vermelho); border: 1.5px solid #f2a7a7; }
.btn-whats { background: #25d366; color: #fff; }
.btn-peq { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.btn-bloco { display: flex; width: 100%; }
.botoes { display: flex; gap: 10px; flex-wrap: wrap; }
.botoes-fixos { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--linha); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; z-index: 20; }
.botoes-fixos .btn { flex: 1; }

/* ---------- formulários ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=tel], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1.5px solid #d4d8dc; border-radius: 10px; background: #fff; color: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pri-2); box-shadow: 0 0 0 3px rgba(20,184,166,.15); }
textarea { min-height: 80px; resize: vertical; }
.grade { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.linha-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.linha-form > * { flex: 1; min-width: 120px; }
.linha-form .btn { flex: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips label { margin: 0; font-weight: 500; }
.chips input { display: none; }
.chips span { display: inline-block; padding: 7px 12px; border: 1.5px solid #cfd5d9; border-radius: 999px; cursor: pointer; font-size: 14px; }
.chips input:checked + span { background: var(--pri); border-color: var(--pri); color: #fff; }

.anexos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.anexo { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #fff; border: 1.5px solid #e1e5e8; border-radius: 12px; padding: 12px 4px; cursor: pointer; font-size: 13px; font-weight: 500; text-align: center; margin: 0; color: var(--tinta); text-decoration: none; }
.anexo.feito { border-color: var(--pri-2); }
.anexo .ic { font-size: 22px; }
.anexo input { display: none; }
.anexo.feito { background: var(--pri-claro); color: var(--pri); }
.miniaturas { display: flex; gap: 6px; flex-wrap: wrap; }
.miniaturas img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--linha); }

/* assinatura */
.assinatura-modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; z-index: 50; padding: 12px; }
.assinatura-modal.aberto { display: flex; }
.assinatura-caixa { background: #fff; border-radius: 16px; padding: 14px; width: 100%; max-width: 560px; }
.assinatura-caixa canvas { width: 100%; height: 220px; border: 1.5px dashed #b8c0c6; border-radius: 10px; touch-action: none; background: #fff; }
.assinatura-preview { max-height: 80px; border: 1px solid var(--linha); border-radius: 8px; background: #fff; }

/* ---------- tabelas ---------- */
.tabela-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--linha); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--suave); font-weight: 600; background: #fafbfb; }
tr:hover td { background: #fbfdfd; }
td.num, th.num { text-align: right; white-space: nowrap; }
.total td { font-weight: 700; background: #f7faf9; }

/* ---------- selos ---------- */
.selo { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef1f2; color: #4b5563; white-space: nowrap; }
.selo-em_rota, .selo-agendada { background: #e0ecff; color: #1d4ed8; }
.selo-entregue, .selo-concluida { background: #dcfce7; color: #15803d; }
.selo-ocorrencia, .selo-problema { background: #ffedd5; color: #b45309; }
.selo-a_agendar { background: #fef9c3; color: #854d0e; }
.selo-cancelada { background: #fee2e2; color: #b91c1c; }

/* ---------- números do painel ---------- */
.indicadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.indicador { background: #fff; border-radius: var(--raio); padding: 14px 16px; box-shadow: var(--sombra); text-decoration: none; color: inherit; border-top: 3px solid var(--pri-2); }
.indicador b { display: block; font-size: 1.8rem; line-height: 1.1; }
.indicador span { font-size: 13px; color: var(--suave); }
.indicador.alerta { border-top-color: var(--laranja); }

.aviso { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; }
.aviso-ok { background: #dcfce7; color: #14532d; }
.aviso-erro { background: #fee2e2; color: #7f1d1d; }
.aviso-info { background: #e0f2fe; color: #0c4a6e; }
.vazio { text-align: center; color: var(--suave); padding: 30px 10px; }
.titulo-linha { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.titulo-linha h2 { margin: 0; }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filtros > * { width: auto; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--pri) 0%, #115e59 100%); }
.login .cartao { width: 100%; max-width: 360px; padding: 26px; }
.login h1 { font-size: 1.3rem; text-align: center; }

/* ---------- rastreio ---------- */
.linha-tempo { list-style: none; padding: 0; margin: 0; }
.linha-tempo li { position: relative; padding: 0 0 18px 30px; }
.linha-tempo li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--linha); }
.linha-tempo li:last-child::before { display: none; }
.linha-tempo li::after { content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #d1d5db; }
.linha-tempo li.feito::after { background: var(--verde); }
.linha-tempo li.atual::after { background: var(--pri-2); box-shadow: 0 0 0 5px rgba(20,184,166,.2); }
.estrelas { display: flex; gap: 6px; justify-content: center; flex-direction: row-reverse; }
.estrelas input { display: none; }
.estrelas label { font-size: 36px; color: #d1d5db; cursor: pointer; margin: 0; }
.estrelas input:checked ~ label, .estrelas label:hover, .estrelas label:hover ~ label { color: #f5b301; }
.destaque { font-size: 1.6rem; font-weight: 800; color: var(--pri); }

@media (max-width: 640px) {
  .conteudo-admin { padding: 14px 12px 60px; }
  .esconder-cel { display: none; }
}
@media print {
  .barra-admin, .botoes, .filtros, .nao-imprimir { display: none !important; }
  body { background: #fff; }
  .cartao { box-shadow: none; border: 1px solid #ddd; }
}

/* =========================================================
   Painéis dos escritórios (entregas / montagens)
   ========================================================= */
.barra-admin .marca span:not(.logo) { display: flex; flex-direction: column; line-height: 1.15; }
.barra-admin .marca small { font-weight: 400; font-size: 11px; opacity: .8; }
.lado-montagens .barra-admin { background: #7a4a1e; }
.lado-montagens .logo { color: #7a4a1e; }
.troca-lado { display: flex; background: rgba(255,255,255,.15); border-radius: 999px; padding: 3px; }
.troca-lado a { color: #fff; text-decoration: none; font-size: 13px; padding: 5px 12px; border-radius: 999px; }
.troca-lado a.ativo { background: #fff; color: var(--tinta); font-weight: 600; }

.filtro-painel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff; border-radius: var(--raio); box-shadow: var(--sombra); padding: 10px 14px; margin-bottom: 14px; }
.filtro-painel label { margin: 0; font-weight: 500; color: var(--suave); }
.filtro-painel input[type=date] { width: auto; padding: 6px 8px; }
.filtro-painel .atalhos { display: flex; gap: 4px; background: #eef1f2; border-radius: 999px; padding: 3px; }
.filtro-painel .atalhos a { text-decoration: none; font-size: 13px; padding: 4px 10px; border-radius: 999px; color: var(--tinta); }
.filtro-painel .atalhos a.ativo { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.1); font-weight: 600; }
.filtro-painel .atualizar { margin-left: auto; }

.painel-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.painel-grade > .cartao { margin: 0; }
.painel-titulo { font-size: 14px; font-weight: 700; text-align: center; margin-bottom: 12px; }
.sub-titulo { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); margin: 14px 0 8px; }

/* rosca */
.rosca-corpo { display: grid; grid-template-columns: minmax(170px, 230px) 1fr; gap: 20px; align-items: center; }
.rosca { width: 100%; height: auto; display: block; }
.rosca .fatia { cursor: pointer; transition: stroke-width .15s; outline: none; }
.rosca .fatia:hover, .rosca .fatia:focus { stroke-width: 32; }
.rosca-rotulo { font-size: 13px; fill: var(--suave); font-weight: 600; }
.rosca-num { font-size: 46px; font-weight: 300; fill: var(--tinta); }
.legenda h4 { font-size: 14px; margin: 10px 0 4px; }
.legenda h4:first-child { margin-top: 0; }
.leg-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; text-decoration: none; color: var(--tinta); }
a.leg-item:hover { background: #f4f6f7; }
.leg-cor { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.leg-ic { width: 18px; text-align: center; font-size: 14px; }
.leg-rot { flex: 1; }
.leg-num { font-size: 1.05rem; min-width: 32px; text-align: right; }
.legenda-nota { font-size: 12px; color: var(--suave); margin: 8px 6px 0; }
.alerta-linha { display: block; margin-top: 12px; padding: 8px 12px; background: #fff7e6; color: #8a5300; border-radius: 10px; text-decoration: none; font-size: 14px; }

/* barras por pessoa/cidade */
.seg { display: flex; background: #eef1f2; border-radius: 999px; padding: 3px; }
.seg a { text-decoration: none; color: var(--tinta); font-size: 13px; padding: 4px 12px; border-radius: 999px; }
.seg a.ativo { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.1); font-weight: 600; }
.barras { display: flex; flex-direction: column; gap: 8px; }
.barra-linha { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 36px; gap: 10px; align-items: center; background: #f7f8f9; border-radius: 10px; padding: 8px 10px; }
.barra-nome { min-width: 0; display: flex; flex-direction: column; }
.barra-nome span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.barra-nome small { color: var(--suave); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-trilho { height: 18px; }
.barra-fill { display: flex; gap: 2px; height: 100%; min-width: 4px; }
.barra-seg { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.35); min-width: 3px; cursor: pointer; outline: none; }
.barra-seg:first-child { border-radius: 4px 0 0 4px; }
.barra-seg:last-child { border-radius: 0 4px 4px 0; }
.barra-seg:only-child { border-radius: 4px; }
.barra-seg:hover, .barra-seg:focus { filter: brightness(1.1); box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.25); }
.barra-total { text-align: right; font-size: 14px; }
.legenda-linha { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--suave); }
.legenda-linha i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* colunas por dia/hora */
.colunas { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; height: 140px; align-items: end; border-bottom: 1px solid var(--linha); }
.col { display: flex; flex-direction: column; height: 100%; cursor: pointer; outline: none; }
.col-barra-area { flex: 1; display: flex; align-items: flex-end; }
.col-barra { width: 100%; border-radius: 4px 4px 0 0; min-height: 0; }
.col:hover .col-barra, .col:focus .col-barra { filter: brightness(1.1); }
.col:hover, .col:focus { background: rgba(0,0,0,.03); border-radius: 4px; }
.col-rot { font-size: 10px; color: var(--suave); text-align: center; height: 16px; line-height: 16px; white-space: nowrap; transform: translateY(18px); }
.eixo-max { font-size: 11px; color: var(--suave); text-align: right; margin-top: 22px; }

/* estrelas */
.nota-media { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 12px; }
.nota-media b { font-size: 2.4rem; font-weight: 700; line-height: 1; }
.estrelas-fixas { color: #f5b301; font-size: 20px; letter-spacing: 1px; }
.estrelas-fixas span { color: #d8dce0; }
.nota-media small { color: var(--suave); width: 100%; text-align: center; }
.dist { display: flex; flex-direction: column; gap: 5px; }
.dist-linha { display: grid; grid-template-columns: 30px 1fr 30px; gap: 8px; align-items: center; font-size: 13px; outline: none; }
.dist-trilho { height: 8px; background: #eef1f2; border-radius: 4px; overflow: hidden; }
.dist-trilho div { height: 100%; background: #f5b301; border-radius: 4px; }
.dist-linha b { text-align: right; font-weight: 600; }
.carinha { font-size: 2rem; font-weight: 700; color: var(--pri-2); margin-bottom: 6px; }

.kpi-linha { display: flex; align-items: center; gap: 14px; }
.kpi-linha b { font-size: 2.2rem; color: var(--tinta); line-height: 1; }
.kpi-linha b small { font-size: 1rem; font-weight: 500; }
.kpi-linha span { font-size: 14px; }
.kpi-linha small { color: var(--suave); }
.kpi-duplo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi-duplo > * { background: #f7f8f9; border-radius: 12px; padding: 12px; text-decoration: none; color: var(--tinta); }
.kpi-duplo span { display: block; font-size: 12px; color: var(--suave); }
.kpi-duplo b { font-size: 1.35rem; }
.alertas { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.alertas a { flex: 1 1 220px; background: #fff7e6; color: #7a4a00; border-radius: 12px; padding: 10px 14px; text-decoration: none; font-size: 14px; box-shadow: var(--sombra); }

/* dica flutuante dos gráficos */
.dica { position: fixed; z-index: 100; pointer-events: none; background: #1f2933; color: #fff; font-size: 13px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: 0 4px 12px rgba(0,0,0,.2); }

@media (max-width: 900px) {
  .painel-grade { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .rosca-corpo { grid-template-columns: 1fr; }
  .rosca { max-width: 220px; margin: 0 auto; }
  .filtro-painel .atualizar { margin-left: 0; }
  .kpi-duplo { grid-template-columns: 1fr; }
  .barra-linha { grid-template-columns: 90px 1fr 30px; }
}

/* ajustes */
.barra-admin .marca small { color: #fff; opacity: .75; }
@media (max-width: 640px) {
  .barra-admin { gap: 8px; padding-top: 4px; }
  .barra-admin .marca { padding: 8px 0 4px; }
  .troca-lado { margin-left: auto; }
  .barra-admin nav { flex-basis: 100%; order: 3; margin: 0 -16px; padding: 0 8px; background: rgba(0,0,0,.12); }
  .barra-admin nav a { padding: 10px 9px; font-size: 14px; }
  .barra-linha { grid-template-columns: 1fr 30px; row-gap: 6px; }
  .barra-nome { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 8px; }
  .barra-nome span { flex: none; max-width: 60%; }
  .filtro-painel input[type=date] { flex: 1; min-width: 130px; }
}

/* local da entrega (GPS) */
.gps-status { font-size: 13px; padding: 8px 12px; border-radius: 10px; background: #eef1f2; color: var(--suave); margin: 10px 0 0; }
.gps-status[data-estado=ok] { background: #dcfce7; color: #14532d; }
.gps-status[data-estado=fraco] { background: #fff7e6; color: #7a4a00; }
.gps-status[data-estado=erro] { background: #fee2e2; color: #7f1d1d; }
.local { border: 1px solid var(--linha); border-radius: 12px; overflow: hidden; background: #fff; }
.local-topo { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.local-topo small { color: var(--suave); }
.local-alerta { margin: 0 12px 8px; font-size: 13px; padding: 6px 10px; border-radius: 8px; background: #fff7e6; color: #7a4a00; }
.local-mapa { display: block; width: 100%; height: 230px; border: 0; background: #e9eef0; }
.local-botoes { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 12px; }
.local-botoes .btn { flex: 1 1 auto; }
.local-sem-gps { font-size: 14px; padding: 10px 12px; border-radius: 10px; background: #f4f6f7; }

/* mapa dos motoristas */
.mapa-grade { display: grid; grid-template-columns: 280px 1fr; gap: 14px; margin-bottom: 12px; }
.mapa-caixa { padding: 0; overflow: hidden; margin: 0; }
#mapa { height: 70vh; min-height: 420px; }
.mapa-lista { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.mot-card { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: #fff; border: 1.5px solid transparent; border-radius: 12px; padding: 10px 12px; box-shadow: var(--sombra); cursor: pointer; font: inherit; color: inherit; }
.mot-card.ativo { border-color: var(--pri-2); }
.mot-cor { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex: none; }
.mot-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mot-info small { color: var(--suave); font-size: 12px; }
.sit.vivo { color: #15803d; font-weight: 600; }
.sit.atraso { color: #9a5b00; font-weight: 600; }
.sit.sem { color: #9aa3ab; }
.pino-caminhao { position: relative; display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 3px solid var(--cor); border-radius: 999px; padding: 2px 8px 2px 4px; box-shadow: 0 2px 6px rgba(0,0,0,.3); white-space: nowrap; transform: translate(-50%, -50%); font-size: 12px; }
.pino-caminhao span { font-size: 16px; }
.pino-caminhao.sem { opacity: .6; filter: grayscale(.6); }
.pino-caminhao.vivo::after { content: ""; position: absolute; inset: -3px; border-radius: 999px; border: 3px solid var(--cor); animation: pulso 1.8s infinite; }
@keyframes pulso { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(1.35); } }
.mapa-cliente { height: 260px; border-radius: 12px; overflow: hidden; margin-top: 10px; }
@media (max-width: 800px) {
  .mapa-grade { grid-template-columns: 1fr; }
  .mapa-lista { max-height: none; flex-direction: row; overflow-x: auto; }
  .mot-card { min-width: 230px; }
  #mapa { height: 60vh; }
}

/* =========================================================
   Motorista (funciona sem internet)
   ========================================================= */
.btn-sync { position: relative; width: 36px; height: 36px; display: grid; place-items: center; text-decoration: none; color: var(--pri); font-size: 22px; font-weight: 700; }
.btn-sync .badge { position: absolute; top: -2px; right: -4px; background: var(--laranja); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.btn-sync.girando { animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.faixa { position: sticky; top: 61px; z-index: 9; background: #fff7e6; color: #7a4a00; font-size: 13px; padding: 8px 14px; border-bottom: 1px solid #f3dfb8; }
.faixa-erro { background: #fee2e2; color: #7f1d1d; border-color: #f6c4c4; }
.faixa a { color: inherit; font-weight: 700; }
.tag-pendente { display: inline-block; background: #e0ecff; color: #1d4ed8; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.obrig { color: var(--vermelho); }
.campo-erro { border-color: var(--vermelho) !important; }
.dica-form { font-size: 13px; color: var(--suave); margin: -4px 0 6px; }
button.anexo { font: inherit; width: 100%; }
.lista-anexos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 6px; }
.anexo-item { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 0; border: 0; background: none; font: inherit; font-size: 12px; color: var(--pri); font-weight: 600; cursor: pointer; }
.anexo-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--linha); background: #fff; }
.anexo-item img.anexo-ass { object-fit: contain; }
.modal-fundo { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-fundo[hidden] { display: none; }
.modal-caixa { background: #fff; border-radius: 18px; padding: 18px; width: 100%; max-width: 440px; max-height: 90vh; overflow: auto; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.modal-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 1.05rem; }
.modal-x { border: 0; background: none; font-size: 20px; color: var(--suave); cursor: pointer; text-decoration: none; padding: 4px 8px; }
.modal-img { display: block; width: 100%; max-height: 55vh; object-fit: contain; border-radius: 10px; background: #f4f6f7; }
.modal-botoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn-remover { background: #d64545; color: #fff; }
.estrelas-toque { display: flex; justify-content: center; gap: 8px; }
.estrelas-toque button { border: 0; background: none; font-size: 40px; color: #d1d5db; cursor: pointer; padding: 0 2px; }
.estrelas-toque button.on { color: #f5b301; }
.avaliar-ic { width: 44px; height: 44px; border-radius: 10px; background: var(--pri); display: grid; place-items: center; font-size: 22px; }
.sync-contagem { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.sync-contagem div { display: flex; align-items: center; background: #f2f4f5; border-radius: 10px; overflow: hidden; }
.sync-contagem b { background: #cdeae6; color: var(--tinta); font-size: 1.3rem; padding: 14px 18px; min-width: 70px; text-align: center; }
.sync-contagem span { padding: 0 16px; font-size: 1.05rem; }
.sync-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--sombra); font-size: 14px; }
.sync-item.erro { border-left: 4px solid var(--vermelho); }
.txt-erro { color: var(--vermelho); }
[hidden] { display: none !important; }
.selo-fixo { background: #e0ecff; color: #1d4ed8; }
.selo-terc { background: #fff4e0; color: #9a5b00; }
.acoes-linha { white-space: nowrap; text-align: right; }
.acoes-linha .btn { margin: 2px 0; }
.filtros input[type=text], .filtros input[type=date], .filtros select, .filtros button { width: auto; }

/* eventos do motorista */
.busca-evento { margin-bottom: 6px; }
.grupo-ev { font-size: 1.15rem; margin: 18px 0 10px; }
.evento-item { display: flex; justify-content: space-between; align-items: center; width: 100%; background: #f2f4f5; border: 0; border-radius: 12px; padding: 18px 16px; margin-bottom: 10px; font: inherit; font-weight: 600; color: #3f4a54; text-decoration: none; text-transform: uppercase; text-align: left; cursor: pointer; }
.evento-item:active { background: #e6eaec; }
.evento-item .seta { font-size: 22px; color: var(--suave); }
.tag-cancelada { display: inline-block; background: #fee2e2; color: #b91c1c; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.tag-reagendada { display: inline-block; background: #e0ecff; color: #1d4ed8; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.visao-barra { display: flex; align-items: center; gap: 10px; max-width: 1180px; margin: 0 auto; padding: 12px 16px 0; }
.visao-barra label { margin: 0; font-weight: 700; }
.visao-barra select { width: auto; min-width: 240px; padding: 6px 10px; }
.tag-filial { display: inline-block; background: #eef1f2; color: #4b5563; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 6px; margin-left: 4px; white-space: nowrap; }
input[type=search] { width: 100%; font: inherit; padding: 10px 12px; border: 1.5px solid #d4d8dc; border-radius: 10px; background: #fff; color: inherit; }
