:root { --cor: #12355b; --cor2: #1d5fa8; --fundo: #f3f5f8; --texto: #14202e; --suave: #44556a; --borda: #c5cfdb; --ok: #15803d; --nao: #b91c1c; --ouro: #c79a3a; --ambar-bg: #fef3c7; --ambar: #8a4b08; --verm-bg: #fee2e2; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--fundo); color: var(--texto); padding-bottom: calc(72px + env(safe-area-inset-bottom)); overflow-x: hidden; }
[hidden] { display: none !important; }
header { background: var(--cor); color: #fff; padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 1000; min-height: 52px; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 20px; margin: 22px 0 8px; }
h3 { font-size: 18px; margin: 18px 0 6px; }
#status-lista { font-size: 16px; }
main { padding: 12px; max-width: 760px; margin: 0 auto; }
.aba { display: none; }
.aba.ativa { display: block; }
.oculto { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

button, .botao, select { font: inherit; min-height: 48px; padding: 10px 14px; border-radius: 10px; border: 2px solid var(--borda); background: #fff; color: var(--texto); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
button:focus-visible, .botao:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--cor2); outline-offset: 2px; }
.primario { background: var(--cor); color: #fff; border-color: var(--cor); font-weight: 700; }
.dourado { background: var(--ouro); color: #17284b; border-color: var(--ouro); font-weight: 700; }
.grande { min-height: 60px; font-weight: 700; }
.largo { width: 100%; margin-top: 10px; }
button:disabled { opacity: .5; }
.grade2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.msg { color: var(--suave); margin: 8px 0; }
.msg.erro { color: var(--nao); font-weight: 600; }

.campo { display: block; margin: 10px 0; font-weight: 600; }
input[type=text], input[type=number], input[type=date], input[type=month], input[type=tel], input:not([type]), select { width: 100%; min-height: 48px; padding: 8px 10px; font: inherit; font-weight: 400; margin-top: 4px; border: 2px solid var(--borda); border-radius: 10px; background: #fff; color: var(--texto); }

/* progresso da leitura */
.progresso { margin: 6px 0 10px; }
.barra-prog { height: 10px; background: #d9e2ee; border-radius: 6px; overflow: hidden; position: relative; }
.barra-prog::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--cor2); border-radius: 6px; animation: corre 1.2s ease-in-out infinite; }
@keyframes corre { 0% { left: -40%; } 100% { left: 100%; } }

/* conferência */
.resumo-geo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.resumo-geo div { border-radius: 10px; padding: 8px 4px; text-align: center; font-weight: 700; }
.resumo-geo small { display: block; font-weight: 400; font-size: 16px; }
.r-porta { background: #dcfce7; color: #14532d; }
.r-aprox { background: var(--ambar-bg); color: var(--ambar); }
.r-sem { background: var(--verm-bg); color: #7f1d1d; }
.pac { background: #fff; border: 2px solid var(--borda); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.pac-topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pac-topo b { font-size: 18px; }
.pac label { display: block; font-weight: 600; margin-top: 8px; }
.pac input { margin-top: 2px; }
.pac input.vazio { border-color: #dc2626; background: #fef2f2; }
.pac input.suspeito { border-color: #d97706; background: #fffbeb; }
.dica { display: none; font-size: 16px; font-weight: 400; color: var(--ambar); }
.dica.on { display: block; }
.selo { display: block; border-radius: 10px; padding: 8px 10px; margin-top: 8px; font-weight: 700; }
.selo.aprox { background: var(--ambar-bg); color: var(--ambar); border: 2px solid #f59e0b; }
.selo.sem { background: var(--verm-bg); color: #7f1d1d; border: 2px solid #dc2626; }
.selo.porta { background: #dcfce7; color: #14532d; }
.pac .largo { margin-top: 8px; }

/* rota */
.cab-rota { background: var(--cor); color: #fff; border-radius: 12px; padding: 12px; font-weight: 700; font-size: 18px; margin-bottom: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { min-height: 48px; border-radius: 24px; padding: 8px 16px; }
.chip[aria-checked=true] { background: var(--cor2); color: #fff; border-color: var(--cor2); font-weight: 700; }
#mapa, #mini-mapa { height: 280px; border-radius: 12px; border: 2px solid var(--borda); margin: 10px 0; z-index: 0; }
#mini-mapa { height: 55vh; }
#paradas { list-style: none; padding: 0; margin: 0; }
#paradas li { background: #fff; border: 2px solid var(--borda); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
#paradas li.atual { border-color: var(--cor2); box-shadow: 0 0 0 3px #bfdbfe; }
#paradas li.entregue { opacity: .55; border-left: 8px solid var(--ok); }
#paradas li.nao_entregue { border-left: 8px solid var(--nao); }
.topo { display: flex; gap: 10px; align-items: center; }
.num { background: var(--cor); color: #fff; border-radius: 50%; min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.nome { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.sub { color: var(--suave); margin-top: 4px; overflow-wrap: anywhere; }
.obs { margin-top: 4px; font-weight: 600; overflow-wrap: anywhere; }
.acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.acoes .b-ok { background: var(--ok); color: #fff; border-color: var(--ok); font-weight: 700; }
.acoes .b-nao { background: var(--nao); color: #fff; border-color: var(--nao); font-weight: 700; }
.acoes .cheio { grid-column: 1 / -1; }
.pino { background: var(--cor); color: #fff; border-radius: 50%; width: 32px; height: 32px; line-height: 28px; text-align: center; font-weight: 700; font-size: 16px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.pino.aprox { background: #b45309; }
.pino.ok { background: var(--ok); opacity: .7; }
.pino.nao { background: var(--nao); }
.pino.base { background: var(--ouro); color: #17284b; }
.pino.alvo { background: var(--nao); width: 36px; height: 36px; line-height: 32px; }

/* contabilidade */
.linha-mes { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.linha-mes .campo { margin: 0; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.cartao { background: #fff; border: 2px solid var(--borda); border-radius: 12px; padding: 10px; }
.cartao span { display: block; color: var(--suave); }
.cartao b { font-size: 22px; overflow-wrap: anywhere; }
.largo-c b { font-size: 18px; }
.pos { color: var(--ok); }
.neg { color: var(--nao); }
.frase { background: #eaf2fb; border-radius: 12px; padding: 12px; font-weight: 600; margin: 10px 0; }
.frase:empty { display: none; }
.dias, .lista-simples { list-style: none; padding: 0; margin: 0; }
.dias li { background: #fff; border: 2px solid var(--borda); border-radius: 12px; padding: 10px; margin-bottom: 8px; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.dias .lucro { font-weight: 700; font-size: 18px; text-align: right; }
.dias .det { grid-column: 1 / -1; color: var(--suave); }
.lista-simples li { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--borda); border-radius: 10px; padding: 6px 6px 6px 12px; margin-bottom: 6px; overflow-wrap: anywhere; }
.lista-simples button { flex: none; }
.grade-custo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form { background: #fff; border: 2px solid var(--borda); border-radius: 12px; padding: 4px 12px 12px; }

/* navegação */
nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 2px solid var(--borda); padding-bottom: env(safe-area-inset-bottom); z-index: 1000; }
nav button { flex: 1; border: 0; border-radius: 0; min-height: 60px; background: transparent; font-weight: 600; }
nav button.ativa { color: var(--cor2); font-weight: 800; box-shadow: inset 0 4px 0 var(--cor2); }

/* telas sobrepostas */
.ov { position: fixed; inset: 0; z-index: 2000; background: var(--fundo); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ov-corpo { max-width: 760px; margin: 0 auto; padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }
.ov-baixo { background: rgba(10, 20, 35, .55); display: flex; align-items: flex-end; }
.ov-baixo .ov-corpo { background: var(--fundo); width: 100%; border-radius: 18px 18px 0 0; }
.motivos { display: grid; gap: 8px; margin: 10px 0; }
