/* ============================================================
   NavSupply Coletor — design system v2 "nível Apple"
   Mescla: Embarque AI (Geist, verde-limão #c6ff3d, dark #0a0a0f, glass,
   cubic-bezier) + NavSupply (navy #2f3b60, dourado #cf964d, marca naval).
   Princípios: hierarquia clara, superfícies em vidro, micro-interações
   suaves, tipografia com peso, toque generoso, movimento com propósito.
   ============================================================ */

@font-face { font-family: "Geist"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/geist-400.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/geist-500.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/geist-600.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/geist-700.woff2") format("woff2"); }

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  /* base escura profunda (Embarque AI) */
  --bg: #0a0a0f;
  --bg-2: #0e0e15;
  --surface: rgba(255,255,255,.04);
  --surface-solid: #14141c;
  --surface-hi: rgba(255,255,255,.07);
  --hair: rgba(255,255,255,.08);
  --hair-hi: rgba(255,255,255,.16);
  --glass: rgba(20,20,28,.72);

  /* texto */
  --fg: #ffffff;
  --fg-2: #a6a6b4;
  --fg-3: #6b6b7a;

  /* acentos: verde-limão Embarque + naval/dourado NavSupply */
  --accent: #c6ff3d;         /* verde-limão — ação primária, foco */
  --accent-ink: #0a0a0f;
  --naval: #72a8e5;          /* azul naval NavSupply — informação */
  --gold: #cf964d;           /* dourado NavSupply — marca, destaque */
  --ok: #5ee28f;
  --warn: #ffb545;
  --danger: #ff5d6a;
  --magenta: #c84dff;

  /* raios e movimento */
  --r: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --r-pill: 999px;
  --ease: cubic-bezier(.16,1,.3,1);
  --ease-in: cubic-bezier(.4,0,1,1);
  --dur: .42s;
  --shadow: 0 10px 40px -12px rgba(0,0,0,.6);
  --shadow-accent: 0 8px 30px -10px rgba(198,255,61,.4);

  --font: "Geist", -apple-system, "SF Pro Display", system-ui, sans-serif;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* brilho ambiente sutil no topo (aurora) */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(680px 340px at 78% -8%, rgba(198,255,61,.10), transparent 62%),
    radial-gradient(600px 360px at 12% 4%, rgba(114,168,229,.10), transparent 60%);
}

#app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }

/* animação de entrada de tela */
#tela, .login-wrap { animation: surge var(--dur) var(--ease); }
@keyframes surge { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- flash de feedback ---------- */
#flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 90; transition: opacity .12s var(--ease); }
#flash.mostra { opacity: 1; }
#flash.ok { background: radial-gradient(circle at 50% 42%, rgba(94,226,143,.34), transparent 62%); }
#flash.erro { background: radial-gradient(circle at 50% 42%, rgba(255,93,106,.36), transparent 62%); }

/* ---------- topo / marca ---------- */
.marca-bar {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 20px 13px;
  border-bottom: 1px solid var(--hair);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  position: sticky; top: 0; z-index: 20;
}
.marca-bar .logo-mark { height: 26px; width: auto; }
.marca-bar .wordmark { font-weight: 700; font-size: 15px; letter-spacing: .06em; }
.marca-bar .wordmark small { display: block; font-weight: 500; font-size: 9px; letter-spacing: .34em; color: var(--gold); margin-top: 1px; }
.marca-bar .direita { margin-left: auto; }
.chip-operador {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500; font-size: 12.5px; color: var(--fg);
  background: var(--surface); border: 1px solid var(--hair-hi);
  padding: 6px 13px 6px 11px; border-radius: var(--r-pill);
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip-operador::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); flex: none; }

/* ---------- área da tela ---------- */
main { flex: 1; display: flex; flex-direction: column; padding: 18px 20px 28px; }

.titulo-tela { display: flex; align-items: flex-start; gap: 14px; margin: 4px 0 20px; }
.titulo-tela .voltar {
  background: var(--surface); border: 1px solid var(--hair); color: var(--fg);
  font-size: 20px; border-radius: 14px; width: 46px; height: 46px; flex: none; cursor: pointer;
  transition: transform .2s var(--ease), background .2s var(--ease); display: flex; align-items: center; justify-content: center;
}
.titulo-tela .voltar:active { transform: scale(.9); background: var(--surface-hi); }
.titulo-tela .kicker { font-weight: 600; font-size: 11px; letter-spacing: .16em; color: var(--accent); text-transform: uppercase; }
.titulo-tela h1 { font-weight: 700; font-size: 26px; line-height: 1.12; letter-spacing: -0.03em; margin-top: 3px; }
.titulo-tela .passo { margin-left: auto; font-weight: 600; font-size: 13px; color: var(--fg-3); padding-top: 4px; }
.titulo-tela .passo b { color: var(--accent); }

/* ---------- botões ---------- */
.btn {
  position: relative; display: block; width: 100%; border: 1px solid var(--hair);
  border-radius: var(--r-md); background: var(--surface); color: var(--fg);
  font-family: var(--font); font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
  padding: 17px; margin: 10px 0; min-height: 56px; cursor: pointer;
  transition: transform .18s var(--ease), background .2s var(--ease), border-color .2s var(--ease), box-shadow .3s var(--ease);
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .4; }
.btn small { display: block; font-weight: 400; font-size: 13px; color: var(--fg-3); letter-spacing: 0; margin-top: 4px; }

.btn.principal { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-accent); }
.btn.principal small { color: rgba(10,10,15,.62); }
.btn.principal:active { box-shadow: 0 4px 16px -8px rgba(198,255,61,.5); }
.btn.confirmar { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-size: 18px; min-height: 66px; box-shadow: var(--shadow-accent); }
.btn.cancelar { background: transparent; border-color: rgba(255,93,106,.4); color: #ff8f98; }
.btn.atencao { background: rgba(255,181,69,.12); border-color: rgba(255,181,69,.42); color: var(--warn); }
.btn.pequeno { font-size: 14px; padding: 12px; min-height: 46px; margin: 0; }

/* ---------- cartões de ação (menu) ---------- */
.acao-card {
  position: relative; display: flex; align-items: center; gap: 15px; width: 100%;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-md);
  padding: 18px 17px; margin: 11px 0; cursor: pointer; color: var(--fg); text-align: left;
  transition: transform .2s var(--ease), background .22s var(--ease), border-color .22s var(--ease);
  overflow: hidden;
}
.acao-card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); opacity: 0; transition: opacity .22s var(--ease);
}
.acao-card:active { transform: scale(.985); background: var(--surface-hi); border-color: var(--hair-hi); }
.acao-card:active::after { opacity: 1; }
.acao-card .icone {
  width: 48px; height: 48px; flex: none; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: rgba(198,255,61,.10); border: 1px solid rgba(198,255,61,.24);
}
.acao-card.naval .icone { background: rgba(114,168,229,.10); border-color: rgba(114,168,229,.26); }
.acao-card.dourado .icone { background: rgba(207,150,77,.12); border-color: rgba(207,150,77,.3); }
.acao-card .rotulo { font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.acao-card .descr-acao { font-size: 13px; color: var(--fg-3); margin-top: 2px; }
.acao-card .seta { margin-left: auto; color: var(--fg-3); font-size: 22px; transition: transform .22s var(--ease); }
.acao-card:active .seta { transform: translateX(3px); color: var(--accent); }
.acao-card.desabilitada { opacity: .42; }
.acao-card .badge-breve { margin-left: auto; font-size: 10px; font-weight: 600; letter-spacing: .12em; color: var(--gold); border: 1px solid rgba(207,150,77,.44); padding: 4px 9px; border-radius: var(--r-pill); }

/* ---------- campos ---------- */
input[type=text], input[type=search], input[type=tel], input[type=number], select {
  width: 100%; background: var(--surface-solid); color: var(--fg);
  border: 1.5px solid var(--hair); border-radius: var(--r-sm);
  font-family: var(--font); font-size: 19px; padding: 15px; margin: 7px 0;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(198,255,61,.12); }
input::placeholder { color: var(--fg-3); }

.linha-manual { display: flex; gap: 9px; align-items: center; }
.linha-manual input { flex: 1; }
.linha-manual .btn { width: 88px; flex: none; }

/* ---------- zona de scan ---------- */
.zona-scan {
  position: relative; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(198,255,61,.06), rgba(198,255,61,.015)),
    var(--surface-solid);
  border: 1.5px solid rgba(198,255,61,.28); border-radius: var(--r);
  text-align: center; padding: 30px 14px 26px; margin: 6px 0 14px;
}
.zona-scan .titulo-scan { font-weight: 700; font-size: 19px; letter-spacing: .02em; color: var(--accent); }
.zona-scan .sub-scan { font-size: 13.5px; color: var(--fg-3); margin-top: 5px; }
.zona-scan .cod-icone { font-size: 30px; margin-bottom: 8px; display: block; letter-spacing: 3px; color: var(--accent); opacity: .85; }
.zona-scan::after {
  content: ""; position: absolute; left: 10%; right: 10%; height: 2px; top: 20%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 12px var(--accent);
  animation: varredura 2.4s var(--ease) infinite;
}
@keyframes varredura { 0%,100% { top: 22%; opacity: .5; } 50% { top: 78%; opacity: 1; } }

/* ---------- cartões de conteúdo ---------- */
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-md); padding: 18px; margin: 12px 0; }
.card.ok { border-color: rgba(94,226,143,.34); background: linear-gradient(180deg, rgba(94,226,143,.05), transparent), var(--surface); }
.card.falha { border-color: rgba(255,93,106,.34); background: linear-gradient(180deg, rgba(255,93,106,.05), transparent), var(--surface); }
.card .descr { font-weight: 700; font-size: 22px; line-height: 1.24; letter-spacing: -0.02em; }
.card .meta { color: var(--fg-2); margin-top: 9px; font-size: 15px; }
.card .meta b { color: var(--fg); font-weight: 600; }

.estoque { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 15px; }
.estoque th { font-weight: 600; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--naval); padding: 9px 6px; text-align: right; border-bottom: 1px solid var(--hair); }
.estoque td { padding: 10px 6px; text-align: right; border-top: 1px solid var(--hair); color: var(--fg-2); }
.estoque th:first-child, .estoque td:first-child { text-align: left; }
.estoque td b { color: var(--fg); }
.estoque .disp { color: var(--ok); font-weight: 700; font-size: 17px; }

.badge { display: inline-flex; align-items: center; border-radius: var(--r-pill); padding: 4px 11px; font-size: 11px; font-weight: 600; letter-spacing: .04em; margin-left: 7px; vertical-align: 2px; }
.badge.ativo { background: rgba(94,226,143,.13); color: var(--ok); border: 1px solid rgba(94,226,143,.34); }
.badge.inativo { background: rgba(255,93,106,.12); color: #ff8f98; border: 1px solid rgba(255,93,106,.34); }
.badge.tembarra { background: rgba(207,150,77,.13); color: var(--gold); border: 1px solid rgba(207,150,77,.38); }

/* ---------- login ---------- */
.login-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 4px 30px; }
.login-logo { display: block; width: 220px; max-width: 66%; margin: 0 auto 10px; filter: drop-shadow(0 6px 24px rgba(0,0,0,.5)); }
.login-sub { text-align: center; font-weight: 600; font-size: 11px; letter-spacing: .34em; color: var(--gold); text-transform: uppercase; margin-bottom: 30px; }
.pin-visor { display: flex; justify-content: center; gap: 14px; min-height: 30px; margin-bottom: 6px; }
.pin-dot { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--hair-hi); transition: all .2s var(--ease); }
.pin-dot.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px rgba(198,255,61,.6); transform: scale(1.1); }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.teclado button {
  background: var(--surface); border: 1px solid var(--hair); color: var(--fg);
  font-family: var(--font); font-size: 25px; font-weight: 500; border-radius: var(--r-md);
  min-height: 66px; cursor: pointer; transition: transform .14s var(--ease), background .18s var(--ease);
}
.teclado button:active { transform: scale(.92); background: var(--surface-hi); }
.teclado .entrar { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tagline { text-align: center; margin-top: 26px; font-size: 12.5px; color: var(--fg-3); }
.tagline b { color: var(--gold); }

/* ---------- listas ---------- */
.lista-prod { margin-top: 8px; }
.item-prod {
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-sm);
  padding: 15px; margin: 9px 0; cursor: pointer;
  transition: transform .16s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.item-prod:active { transform: scale(.985); background: var(--surface-hi); border-color: var(--hair-hi); }
.item-prod .d { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.item-prod .m { color: var(--fg-3); font-size: 13.5px; margin-top: 4px; }

/* ---------- rodapé / status ---------- */
.rodape { margin-top: auto; padding-top: 22px; color: var(--fg-3); font-size: 13px; text-align: center; line-height: 1.7; }
.status-card {
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-sm);
  padding: 13px 15px; margin-top: 16px; font-size: 12.5px; color: var(--fg-2);
  display: flex; align-items: center; gap: 11px; text-align: left;
}
.status-card b { color: var(--fg); font-weight: 600; }
.status-card .ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 10px var(--ok); }
.status-card .ponto.off { background: var(--danger); box-shadow: none; }

/* ---------- histórico / mensagens ---------- */
.historico { margin-top: 18px; }
.historico h3 { font-weight: 600; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 8px; }
.historico .h-item { font-size: 14px; padding: 9px 2px; border-top: 1px solid var(--hair); color: var(--fg-2); }
.historico .h-item b { color: var(--fg); font-weight: 600; }

.ean-gigante {
  text-align: center; font-size: 30px; font-weight: 700; letter-spacing: 2px;
  background: var(--fg); color: var(--bg); border-radius: var(--r-sm); padding: 24px 8px; margin: 14px 0;
  font-family: "Geist", monospace; box-shadow: var(--shadow);
}
.msg-erro { background: rgba(255,93,106,.09); border: 1px solid rgba(255,93,106,.3); color: #ff9ba3; border-radius: var(--r-sm); padding: 14px; margin: 11px 0; font-size: 15px; }
.msg-info { background: rgba(114,168,229,.07); border: 1px solid rgba(114,168,229,.28); color: #b9d3f2; border-radius: var(--r-sm); padding: 14px; margin: 11px 0; font-size: 15px; }
.msg-ok { background: rgba(94,226,143,.08); border: 1px solid rgba(94,226,143,.32); color: #a9efc7; border-radius: var(--r-sm); padding: 14px; margin: 11px 0; font-size: 15px; }
.centro { text-align: center; }
.espaco { height: 12px; }

/* selo de sucesso animado */
.selo-ok {
  width: 78px; height: 78px; margin: 8px auto 16px; border-radius: 50%;
  background: rgba(94,226,143,.12); border: 2px solid var(--ok);
  display: flex; align-items: center; justify-content: center; font-size: 38px; color: var(--ok);
  animation: pop .5s var(--ease);
}
@keyframes pop { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }

/* ---------- modal de quantidade ---------- */
.modal-bk { position: fixed; inset: 0; background: rgba(0,0,0,.62); z-index: 60; display: flex; align-items: flex-end; justify-content: center; padding: 16px; animation: fade .25s var(--ease); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card { background: var(--surface-solid); border: 1px solid var(--hair-hi); border-radius: var(--r); padding: 20px; width: 100%; max-width: 480px; box-shadow: var(--shadow); animation: slideup .4s var(--ease); }
@keyframes slideup { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-card .titulo-modal { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; margin-bottom: 12px; }
.modal-card input { font-size: 28px; text-align: center; font-weight: 600; }
.modal-acoes { display: flex; gap: 9px; margin-top: 10px; }
.modal-acoes .btn { margin: 0; }

/* chips de progresso (rodadas do inventário) */
.rodada-chips { display: flex; gap: 8px; margin: 4px 0 14px; }
.rodada-chip { flex: 1; text-align: center; padding: 10px 6px; border-radius: var(--r-sm); border: 1px solid var(--hair); background: var(--surface); font-size: 12px; color: var(--fg-3); font-weight: 600; }
.rodada-chip.ativa { border-color: var(--accent); background: rgba(198,255,61,.08); color: var(--accent); }
.rodada-chip.feita { border-color: rgba(94,226,143,.3); color: var(--ok); }
.rodada-chip small { display: block; font-weight: 400; font-size: 10px; margin-top: 2px; opacity: .8; }

select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b7a' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
label { display: block; font-size: 12.5px; color: var(--fg-3); font-weight: 500; margin-top: 10px; }
