:root {
  --marinho: #0b1730;
  --marinho-2: #14254a;
  --azul: #1e88e5;
  --vermelho: #e2001a;
  --laranja: #f26a1b;
  --areia: #f7b267;
  --verde: #0b8a3a;
  --fundo: #f4f5f8;
  --cartao: #ffffff;
  --texto: #18202f;
  --suave: #5c6677;
  --borda: #dfe3ea;
  --raio: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fundo); color: var(--texto);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
[hidden] { display: none !important; }

.topo { background: var(--marinho); color: #fff; border-bottom: 4px solid var(--laranja); position: sticky; top: 0; z-index: 20; }
.topo-in { max-width: 920px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.marca { display: flex; flex-direction: column; line-height: 1.1; flex: 1; min-width: 0; }
.marca strong { font-size: 1.25rem; font-weight: 800; letter-spacing: .2px; }
.marca span { color: #6ab4ff; font-size: .68rem; letter-spacing: .32em; font-weight: 700; margin-top: 3px; }
.link-topo { background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .9rem; cursor: pointer; }

main { max-width: 920px; margin: 0 auto; padding: 16px 16px 120px; }
.cartao { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: 18px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(11,23,48,.04); }
.cartao.estreito { max-width: 420px; margin: 32px auto; }
h1 { font-size: 1.2rem; margin: 0 0 6px; color: var(--marinho); }
h2 { font-size: 1.05rem; margin: 0; color: var(--marinho); }
h2 small { color: var(--suave); font-weight: 500; font-size: .85rem; margin-left: 4px; }
.sub { color: var(--suave); font-size: .92rem; margin: 0 0 12px; }

label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 5px; }
input[type=text], input[type=tel], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 12px; border: 1px solid #c5ccd8; border-radius: 10px; font: inherit; background: #fff; color: var(--texto);
  min-height: 46px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid rgba(30,136,229,.35); outline-offset: 1px; border-color: var(--azul); }

.btn { border: 0; border-radius: 10px; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer; min-height: 46px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primario { background: var(--laranja); color: #fff; }
.btn.primario:hover:not(:disabled) { background: #dd5a0e; }
.btn.secundario { background: #e8f2fd; color: #0f5fb0; }
.btn.fantasma { background: #fff; color: var(--marinho); border: 1px solid #c5ccd8; }
.btn.confirmar { background: var(--verde); color: #fff; font-size: 1.05rem; }
.btn.confirmar:hover:not(:disabled) { background: #076e2d; }
.btn.pequeno { padding: 8px 14px; min-height: 38px; font-size: .9rem; }
.btn.largo { width: 100%; margin-top: 16px; }

.erro { background: #fdecee; color: #a40014; border: 1px solid #f5b5bd; border-radius: 10px; padding: 10px 12px; font-size: .93rem; margin: 12px 0 0; }
.aviso { border-radius: 10px; padding: 10px 12px; font-size: .93rem; margin: 10px 0 0; }
.aviso.alerta { background: #fff4e3; border: 1px solid var(--areia); color: #7a4300; }
#faixa-teste { margin-bottom: 14px; }

.passos { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 14px; }
.passos li { flex: 1; display: flex; align-items: center; gap: 8px; background: #e9ecf2; color: var(--suave); border-radius: 999px; padding: 6px 10px 6px 6px; font-size: .82rem; font-weight: 600; min-width: 0; }
.passos li b { background: #fff; color: var(--suave); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.passos li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.passos li.ativo { background: var(--marinho); color: #fff; }
.passos li.ativo b { background: var(--laranja); color: #fff; }
.passos li.feito { background: #dff3e6; color: var(--verde); }
.passos li.feito b { background: var(--verde); color: #fff; }

.arquivo { display: block; border: 2px dashed #b9c2d2; border-radius: 12px; padding: 22px 14px; text-align: center; cursor: pointer; background: #fafbfd; margin: 0 0 12px; font-weight: 600; color: var(--marinho); word-break: break-word; }
.arquivo.tem { border-style: solid; border-color: var(--laranja); background: #fff8f2; }
.arquivo input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.arquivo:focus-within { outline: 3px solid rgba(30,136,229,.35); }

.linha-titulo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.linha-titulo h2 { min-width: 0; word-break: break-word; }
.numeros { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.numeros div { background: #f4f6fa; border-radius: 10px; padding: 10px 12px; }
.numeros span { display: block; font-size: .78rem; color: var(--suave); }
.numeros b { font-size: 1.25rem; color: var(--marinho); }
.numeros .ok b { color: var(--verde); }
.numeros .ruim b { color: var(--vermelho); }
.numeros .neutro b { color: #0f5fb0; }

.lista { border-left: 5px solid var(--verde); }
.lista.falta { border-left-color: var(--vermelho); }
.lista.especial { border-left-color: var(--azul); }
.texto { margin: 0; background: #f6f7fa; border: 1px solid var(--borda); border-radius: 10px; padding: 12px; font: 14px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; white-space: pre-wrap; word-break: break-word; max-height: 340px; overflow: auto; }
.texto.alto { max-height: 460px; }
.texto.vazio { color: var(--suave); font-family: inherit; }

.busca { position: relative; }
.sugestoes { list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; left: 0; right: 0; background: #fff; border: 1px solid #c5ccd8; border-radius: 10px; box-shadow: 0 8px 24px rgba(11,23,48,.15); z-index: 10; max-height: 260px; overflow: auto; }
.sugestoes li { padding: 11px 10px; border-radius: 8px; cursor: pointer; font-size: .95rem; }
.sugestoes li:hover, .sugestoes li.foco { background: #eef4fc; }
.sugestoes li.nada { color: var(--suave); cursor: default; }
.escolhido { background: #dff3e6; color: #075c27; border-radius: 10px; padding: 10px 12px; margin: 8px 0 0; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.escolhido button { background: none; border: 0; color: #075c27; text-decoration: underline; cursor: pointer; font: inherit; font-weight: 500; }
.duas { display: grid; gap: 0 12px; }

.barra { height: 14px; background: #e9ecf2; border-radius: 999px; overflow: hidden; margin: 14px 0; }
.barra i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--laranja), var(--vermelho)); transition: width .4s; }

.dados { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0; font-size: .95rem; }
.dados dt { color: var(--suave); }
.dados dd { margin: 0; font-weight: 600; word-break: break-word; }
.totais { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; }
.totais div { background: #f4f6fa; border-radius: 10px; padding: 10px 12px; }
.totais span { display: block; font-size: .78rem; color: var(--suave); }
.totais b { font-size: 1.1rem; }
.totais .destaque { background: var(--marinho); color: #fff; }
.totais .destaque span { color: #b8c6e0; }
.totais .destaque b { font-size: 1.35rem; }

.tabela-rolagem { overflow-x: auto; margin-top: 10px; }
.tabela { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabela th { text-align: left; color: var(--suave); font-size: .78rem; font-weight: 600; padding: 6px 8px; border-bottom: 2px solid var(--borda); white-space: nowrap; }
.tabela td { padding: 9px 8px; border-bottom: 1px solid #edf0f4; vertical-align: top; }
.tabela .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabela td.num:first-child { font-weight: 800; color: var(--marinho); }
.tabela .sku { font-weight: 700; word-break: break-all; }
.tabela .desc { color: var(--suave); font-size: .82rem; }
.tabela tr.familia td { background: #f4f6fa; font-weight: 700; color: var(--marinho); font-size: .82rem; }

.acoes-fixas { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--borda); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: center; z-index: 15; box-shadow: 0 -6px 18px rgba(11,23,48,.08); }
.acoes-fixas .btn { flex: 1; max-width: 440px; }
.acoes-fixas .fantasma { flex: 0 1 auto; }

.sucesso { border-top: 5px solid var(--verde); text-align: center; }
.sucesso .grande { font-size: 1.7rem; font-weight: 800; color: var(--verde); margin: 4px 0; }

.flutuante { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--marinho); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 40; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 90vw; text-align: center; }
.carregando { position: fixed; inset: 0; background: rgba(11,23,48,.55); display: grid; place-items: center; z-index: 50; }
.carregando div { background: #fff; border-radius: 14px; padding: 22px 26px; text-align: center; max-width: 300px; }
.carregando i { display: block; width: 36px; height: 36px; margin: 0 auto 10px; border: 4px solid #e9ecf2; border-top-color: var(--laranja); border-radius: 50%; animation: gira .8s linear infinite; }
.carregando p { margin: 0; font-weight: 600; }
@keyframes gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .carregando i { animation-duration: 2.5s; } .barra i { transition: none; } }

@media (min-width: 640px) {
  .numeros { grid-template-columns: repeat(4, 1fr); }
  .duas { grid-template-columns: 1fr 1fr; }
  form#form-arquivo { display: flex; gap: 12px; align-items: stretch; }
  form#form-arquivo .arquivo { flex: 1; margin: 0; padding: 14px; }
  .passos li { font-size: .9rem; padding-right: 14px; }
}
@media (max-width: 420px) {
  .tabela th:nth-child(3), .tabela td:nth-child(3) { display: none; }
  .marca strong { font-size: 1.1rem; }
}
