/* FrotaVez — estilos */
:root {
  --verde: #14532d;
  --verde-2: #166534;
  --verde-claro: #dcfce7;
  --ambar: #b45309;
  --ambar-claro: #fef3c7;
  --vermelho: #b91c1c;
  --vermelho-claro: #fee2e2;
  --azul: #1d4ed8;
  --azul-claro: #dbeafe;
  --texto: #1c1917;
  --texto-2: #57534e;
  --linha: #e7e5e4;
  --fundo: #f5f5f4;
  --cartao: #ffffff;
  --raio: 12px;
  --sombra: 0 1px 2px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.04);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background: var(--fundo);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; line-height: 1.45; }
a { color: var(--verde-2); }
small, .suave { color: var(--texto-2); font-size: .875rem; }

/* Layout */
.tela { max-width: 640px; margin: 0 auto; padding: 1rem 1rem 6rem; }
.tela-acesso { max-width: 420px; margin: 0 auto; padding: 2rem 1.25rem; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.marca { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.5rem; }
.marca img { width: 44px; height: 44px; }
.marca strong { font-size: 1.6rem; color: var(--verde); letter-spacing: -.02em; }
.topo { position: sticky; top: 0; z-index: 5; background: var(--verde); color: #fff; padding: calc(.75rem + env(safe-area-inset-top)) 1rem .75rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.topo h1 { font-size: 1.1rem; margin: 0; }
.topo select { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: .35rem .5rem; max-width: 55%; }
.topo select option { color: var(--texto); }

/* Navegação inferior */
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; background: #fff; border-top: 1px solid var(--linha); display: flex; justify-content: space-around; padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom)); }
.nav a { flex: 1; text-align: center; text-decoration: none; color: var(--texto-2); font-size: .75rem; padding: .3rem 0; display: flex; flex-direction: column; align-items: center; gap: .15rem; position: relative; }
.nav a svg { width: 22px; height: 22px; }
.nav a.ativo { color: var(--verde); font-weight: 600; }
.nav .bolha { position: absolute; top: 0; right: calc(50% - 20px); background: var(--vermelho); color: #fff; border-radius: 999px; font-size: .65rem; padding: 0 .35rem; min-width: 1.1rem; }

/* Cartões e listas */
.cartao { background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); padding: 1rem; margin-bottom: .75rem; }
.lista { list-style: none; margin: 0; padding: 0; }
.item { background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); padding: .85rem 1rem; margin-bottom: .6rem; }
.item-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.item-titulo { font-weight: 600; }
.item-acoes { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.vazio { text-align: center; color: var(--texto-2); padding: 2rem 1rem; }
.secao { display: flex; justify-content: space-between; align-items: center; margin: 1.25rem 0 .6rem; }
.secao h2 { margin: 0; }

/* Etiquetas */
.etq { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; white-space: nowrap; }
.etq-pendente { background: var(--ambar-claro); color: var(--ambar); }
.etq-aprovada { background: var(--verde-claro); color: var(--verde); }
.etq-recusada, .etq-cancelada { background: var(--vermelho-claro); color: var(--vermelho); }
.etq-concluida { background: var(--azul-claro); color: var(--azul); }
.etq-neutra { background: var(--linha); color: var(--texto-2); }

/* Formulários */
form { display: grid; gap: .85rem; }
label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 500; }
input, select, textarea { font: inherit; padding: .7rem .8rem; border: 1px solid #d6d3d1; border-radius: 10px; background: #fff; color: var(--texto); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--verde-2); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 4.5rem; resize: vertical; }
.linha-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.check { display: flex; align-items: flex-start; gap: .55rem; font-weight: 400; }
.check input { width: auto; margin-top: .2rem; }
.dica { font-size: .8rem; color: var(--texto-2); font-weight: 400; }

/* Botões */
button, .btn { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: .75rem 1rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; text-decoration: none; }
.btn-primario { background: var(--verde); color: #fff; }
.btn-primario:hover { background: var(--verde-2); }
.btn-secundario { background: #fff; color: var(--verde); border: 1px solid var(--verde); }
.btn-perigo { background: var(--vermelho); color: #fff; }
.btn-texto { background: none; color: var(--verde-2); padding: .4rem; }
.btn-peq { padding: .45rem .75rem; font-size: .85rem; }
.btn-bloco { width: 100%; }
button:disabled { opacity: .55; cursor: not-allowed; }
button svg { width: 20px; height: 20px; }
.divisor { display: flex; align-items: center; gap: .75rem; color: var(--texto-2); font-size: .85rem; margin: .5rem 0; }
.divisor::before, .divisor::after { content: ""; flex: 1; height: 1px; background: var(--linha); }
.links { display: flex; justify-content: space-between; margin-top: 1rem; font-size: .9rem; }

/* Mensagens */
.alerta { border-radius: 10px; padding: .75rem .9rem; font-size: .9rem; }
.alerta-erro { background: var(--vermelho-claro); color: var(--vermelho); }
.alerta-ok { background: var(--verde-claro); color: var(--verde); }
.alerta-info { background: var(--azul-claro); color: var(--azul); }
#aviso { position: fixed; left: 50%; bottom: 5.5rem; transform: translateX(-50%); z-index: 50; background: var(--texto); color: #fff; padding: .7rem 1rem; border-radius: 10px; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#aviso.visivel { opacity: 1; }
#aviso.erro { background: var(--vermelho); }

/* Diálogo */
dialog { border: 0; border-radius: 16px; padding: 1.25rem; width: min(520px, 94vw); max-height: 90vh; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(0,0,0,.4); }
.dialogo-acoes { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }

/* Dia da agenda */
.dia { display: flex; align-items: center; justify-content: space-between; gap: .5rem; background: #fff; border-radius: var(--raio); box-shadow: var(--sombra); padding: .5rem; margin-bottom: .75rem; }
.dia input { border: 0; text-align: center; font-weight: 600; padding: .4rem; }
.dia button { background: var(--fundo); color: var(--verde); padding: .5rem .8rem; }
.filtros { display: flex; gap: .4rem; margin-bottom: .75rem; overflow-x: auto; }
.filtro { background: #fff; border: 1px solid var(--linha); color: var(--texto-2); border-radius: 999px; padding: .4rem .85rem; font-size: .85rem; font-weight: 500; white-space: nowrap; }
.filtro.ativo { background: var(--verde); color: #fff; border-color: var(--verde); }

/* Carregando */
.carregando { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--texto-2); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--linha); border-top-color: var(--verde); border-radius: 50%; animation: gira .8s linear infinite; margin-bottom: .75rem; }
@keyframes gira { to { transform: rotate(360deg); } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (min-width: 700px) { .tela { padding-top: 1.5rem; } }

/* Placa Mercosul */
.placa { display: inline-grid; grid-template-rows: 5px auto; background: #fff; color: #111; border: 1.5px solid #20242b; border-radius: 4px; overflow: hidden; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .06em; line-height: 1; min-width: 86px; text-align: center; vertical-align: middle; }
.placa::before { content: ""; background: #1f4fb4; }
.placa span { padding: 4px 7px 5px; font-size: 14px; }
.item-placa { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .35rem; }
.topo-empresa { font-size: .85rem; opacity: .9; text-align: right; }

/* Barra do dia */
.dia-centro { display: grid; justify-items: center; gap: .1rem; flex: 1; }
.dia-nome { font-size: 1.05rem; }
.dia-nome::first-letter { text-transform: uppercase; }
.dia input { font-size: .85rem; color: var(--texto-2); font-weight: 500; }

/* Linha do tempo por veículo */
.tl { overflow-x: auto; margin: 0 -1rem; padding: 0 1rem; }
.tl-grade { min-width: 720px; display: grid; grid-template-columns: 130px 1fr; row-gap: 6px; }
.tl-horas { position: relative; height: 18px; font-size: 11px; color: var(--texto-2); }
.tl-horas span { position: absolute; transform: translateX(-50%); }
.tl-horas span:last-child { transform: translateX(-100%); }
.tl-veiculo { display: grid; gap: 2px; align-content: center; padding-right: 8px; }
.tl-veiculo small { font-size: 11px; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-linha { position: relative; height: 56px; background: var(--fundo); border-radius: 6px; background-image: repeating-linear-gradient(to right, var(--linha) 0 1px, transparent 1px 100%); background-size: calc(100% / var(--hrs)) 100%; }
.slot { position: absolute; top: 0; bottom: 0; background: transparent; border: 0; padding: 0; border-radius: 0; }
.slot:hover, .slot:focus-visible { background: rgba(22, 101, 52, .12); }
.blk { position: absolute; top: 4px; bottom: 4px; border-radius: 5px; padding: 2px 6px; font-size: 11.5px; line-height: 1.25; overflow: hidden; border: 1px solid; text-align: left; font-weight: 500; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; color: var(--texto); }
.blk b, .blk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.blk span { opacity: .8; font-weight: 400; }
.blk-minha { background: var(--verde-claro); border-color: var(--verde-2); }
.blk-outra { background: var(--azul-claro); border-color: var(--azul); }
.blk-pend { background: var(--ambar-claro); border-color: var(--ambar); border-style: dashed; }
.blk-feita { background: #fff; border-color: var(--linha); color: var(--texto-2); }
.agora { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--vermelho); pointer-events: none; }
.legenda { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .75rem; color: var(--texto-2); margin-bottom: .6rem; }
.leg { display: inline-block; width: 11px; height: 11px; border-radius: 3px; border: 1px solid; vertical-align: -1px; margin-right: 4px; }
.leg.blk-pend { border-style: dashed; }

/* Fatos (detalhe) */
.fatos { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; font-size: .92rem; margin: .5rem 0; }
.fatos dt { color: var(--texto-2); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding-top: .15rem; }
.fatos dd { margin: 0; overflow-wrap: anywhere; }

.btn-whats { background: #1f8f4e; color: #fff; margin: .5rem 0; }
.cartao.destaque { border-left: 4px solid var(--verde-2); }
details summary { cursor: pointer; font-weight: 600; }
.pedido label { margin-top: .5rem; }

/* Páginas de Termos e Privacidade */
.documento { padding-bottom: 3rem; }
.documento h1 { margin-top: 1rem; }
.documento h2 { margin-top: 1.75rem; }
.documento table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: .5rem 0 1rem; display: block; overflow-x: auto; }
.documento th, .documento td { border-bottom: 1px solid var(--linha); padding: .5rem; text-align: left; vertical-align: top; }
.documento li { margin-bottom: .35rem; line-height: 1.45; }
