/* =====================================================================
   Gaiolas NFC — Tremps · estilos comuns
   ===================================================================== */
:root {
  --producao: #1d4ed8;   --producao-claro: #dbeafe;
  --jateamento: #6b7280; --jateamento-claro: #e5e7eb;
  --esmaltacao: #d97706; --esmaltacao-claro: #fef3c7;
  --expedicao: #15803d;  --expedicao-claro: #dcfce7;
  --vermelho: #dc2626;   --vermelho-claro: #fee2e2;
  --admin: #334155;      --admin-claro: #e2e8f0;

  /* Marca Tremps: verde #00e87a sobre quase-preto (o mesmo do site da Tremps) */
  --marca: #00e87a;          /* verde Tremps (fundo de botão, destaque) */
  --marca-forte: #00b862;    /* bordas e anéis de foco visíveis no branco */
  --marca-escura: #047a42;   /* texto verde sobre fundo claro */
  --marca-tinta: #03140b;    /* texto em cima do verde */
  --marca-claro: #dcfce9;
  --marca-fundo: #0a0d12;    /* fundo escuro da Tremps */

  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #f3f6f4;
  --card: #ffffff;
  --foco: var(--marca-forte);

  --raio: 12px;
  --raio-sm: 8px;
  --sombra: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --sombra-alta: 0 10px 30px rgba(15, 23, 42, .18);
  --fonte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* sem setor (PC, PCP, gerência, admin): verde da Tremps */
  --setor: var(--marca);
  --setor-claro: var(--marca-claro);
  --setor-texto: var(--marca-tinta);
  --logo-fundo: var(--marca-fundo);
  --logo-cor: var(--marca);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--fonte);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--marca-escura); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.pequeno { font-size: .85rem; }
.oculto { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

/* celular pareado: a cor do setor marca a tela da operação */
body[data-setor] { --setor-texto: #fff; --logo-fundo: var(--setor); --logo-cor: #fff; }
body[data-setor="producao"]   { --setor: var(--producao);   --setor-claro: var(--producao-claro); }
body[data-setor="esmaltacao"] { --setor: var(--esmaltacao); --setor-claro: var(--esmaltacao-claro); }
body[data-setor="expedicao"]  { --setor: var(--expedicao);  --setor-claro: var(--expedicao-claro); }

/* ------------------------------ Cabeçalho ------------------------------ */
.topo {
  position: sticky; top: 0; z-index: 20;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.topo-faixa { height: 6px; background: var(--setor); }
.topo-linha {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; min-height: 56px;
  max-width: 1200px; margin: 0 auto;
}
.topo-marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topo-marca .logo {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--logo-fundo); color: var(--logo-cor);
  display: grid; place-items: center; font-weight: 800; font-size: .95rem;
}
.topo-marca .logo svg { width: 20px; height: 20px; }
.topo-marca .titulos { min-width: 0; }
.topo-marca .t1 { font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo-marca .t2 { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo-menu { display: flex; gap: 4px; margin-left: 12px; overflow-x: auto; scrollbar-width: none; }
.topo-menu::-webkit-scrollbar { display: none; }
.topo-menu a {
  padding: 8px 12px; border-radius: var(--raio-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap;
}
.topo-menu a:hover { background: var(--bg); }
.topo-menu a.ativo { background: var(--setor-claro); color: color-mix(in srgb, var(--setor) 45%, #000); }
.topo-usuario { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.topo-usuario .nome { font-weight: 600; font-size: .9rem; text-align: right; line-height: 1.2; }
.topo-usuario .nome small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.topo-marca { flex: 1 1 auto; }
@media (max-width: 480px) {
  .topo-linha { gap: 8px; padding: 8px 12px; }
  .topo-marca .logo, .topo-marca .t2, .topo-usuario .nome small { display: none; }
  .topo-usuario { gap: 8px; }
  .topo-usuario .nome { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topo-usuario .btn { min-height: 36px; padding: 6px 10px; font-size: .82rem; }
  /* com menu: o menu ganha o espaço do título e do nome */
  .topo-linha:has(.topo-menu) .topo-marca, .topo-linha:has(.topo-menu) .topo-usuario .nome { display: none; }
  .topo-menu { margin-left: 0; }
}

/* ------------------------------ Layout ------------------------------ */
.pagina { max-width: 1200px; margin: 0 auto; padding: 16px; }
.pagina-estreita { max-width: 560px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--raio); box-shadow: var(--sombra);
  padding: 16px;
}
.card + .card { margin-top: 12px; }
.pilha > * + * { margin-top: 12px; }
.linha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.linha-entre { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grade-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grade-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .grade-2, .grade-3 { grid-template-columns: 1fr; } }

/* ------------------------------ Botões ------------------------------ */
.btn {
  appearance: none; border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: 10px 16px; min-height: 44px; border-radius: var(--raio-sm);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; user-select: none; touch-action: manipulation;
  transition: background-color .12s, border-color .12s, transform .08s;
}
.btn:hover { background: var(--bg); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--foco) 40%, transparent); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primario { background: var(--setor); border-color: var(--setor); color: var(--setor-texto, #fff); }
.btn-primario:hover { background: color-mix(in srgb, var(--setor) 88%, #000); }
.btn-perigo { background: var(--vermelho); border-color: var(--vermelho); color: #fff; }
.btn-perigo:hover { background: #b91c1c; }
.btn-fantasma { border-color: transparent; background: transparent; }
.btn-pequeno { min-height: 34px; padding: 6px 10px; font-size: .85rem; }
.btn-grande { min-height: 64px; font-size: 1.15rem; padding: 14px 20px; border-radius: var(--raio); width: 100%; }
.btn-bloco { width: 100%; }

/* ------------------------------ Formulários ------------------------------ */
.campo { display: block; }
.campo + .campo { margin-top: 12px; }
.campo > span { display: block; font-weight: 600; font-size: .85rem; color: var(--ink-2); margin-bottom: 4px; }
.campo small { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--line-2); border-radius: var(--raio-sm); background: #fff;
}
textarea.input { min-height: 120px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.input:focus { outline: none; border-color: var(--foco); box-shadow: 0 0 0 3px color-mix(in srgb, var(--foco) 20%, transparent); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  cursor: pointer; font-weight: 600; font-size: .9rem; user-select: none; background: #fff;
}
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--setor); }
.check:has(input:checked) { border-color: var(--setor); background: var(--setor-claro); }

/* ------------------------------ Selos ------------------------------ */
.selo {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: var(--admin-claro); color: var(--admin); white-space: nowrap;
}
.selo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.selo.sem-ponto::before { display: none; }
.selo.producao   { background: var(--producao-claro);   color: var(--producao); }
.selo.jateamento { background: var(--jateamento-claro); color: #374151; }
.selo.esmaltacao { background: var(--esmaltacao-claro); color: #92400e; }
.selo.expedicao  { background: var(--expedicao-claro);  color: var(--expedicao); }
.selo.vermelho   { background: var(--vermelho-claro);   color: #b91c1c; }
.selo.cinza      { background: #f1f5f9; color: var(--muted); }
.selo.ok         { background: var(--expedicao-claro);  color: var(--expedicao); }

/* ------------------------------ Tabelas ------------------------------ */
.tabela-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--raio); background: var(--card); }
table.tabela { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabela th, .tabela td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabela th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #f8fafc; font-weight: 700; white-space: nowrap; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela td.acoes { text-align: right; white-space: nowrap; }
.tabela tr.inativo td { color: var(--muted); }
.tabela .num { text-align: right; }
.vazio { padding: 28px 16px; text-align: center; color: var(--muted); }

/* ------------------------------ Abas ------------------------------ */
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.abas::-webkit-scrollbar { display: none; }
.aba {
  appearance: none; border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted);
  padding: 12px 14px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap;
}
.aba.ativa { color: var(--ink); border-bottom-color: var(--setor); }
.sub-abas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.sub-aba { appearance: none; font: inherit; font-weight: 600; font-size: .9rem; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; color: var(--ink-2); }
.sub-aba.ativa { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ------------------------------ Modal ------------------------------ */
.modal-fundo {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, .5);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: aparece .15s ease-out;
  overscroll-behavior: contain;
}
.modal {
  background: var(--card); border-radius: 16px; box-shadow: var(--sombra-alta);
  width: 100%; max-width: 520px; max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column;
  animation: sobe .18s ease-out;
}
.modal.largo { max-width: 760px; }
.modal-cab { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-cab h2 { flex: 1; }
.modal-corpo { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.modal-rodape { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 640px) {
  .modal-fundo { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 16px 16px 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
  .modal-rodape .btn { flex: 1; }
}
@keyframes aparece { from { opacity: 0; } }
@keyframes sobe { from { transform: translateY(12px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .modal-fundo, .modal { animation: none; } }

/* ------------------------------ Avisos ------------------------------ */
.aviso { padding: 12px 14px; border-radius: var(--raio-sm); background: #f1f5f9; color: var(--ink-2); font-size: .95rem; }
.aviso.erro { background: var(--vermelho-claro); color: #991b1b; }
.aviso.ok { background: var(--expedicao-claro); color: #166534; }
.aviso.atencao { background: var(--esmaltacao-claro); color: #92400e; }
.aviso.info { background: var(--producao-claro); color: #1e3a8a; }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 480px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--sombra-alta); font-weight: 600; font-size: .95rem; animation: sobe .18s ease-out; text-align: center; }
.toast.erro { background: var(--vermelho); }
.toast.ok { background: var(--expedicao); }

.carregando { display: inline-block; width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: gira .7s linear infinite; vertical-align: -3px; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ------------------------------ Login ------------------------------ */
/* Sempre na marca Tremps (verde #00e87a sobre quase-preto), em qualquer aparelho */
.login-tela {
  --setor: var(--marca); --setor-claro: var(--marca-claro); --setor-texto: var(--marca-tinta);
  display: grid; grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .login-tela { grid-template-columns: minmax(380px, 1.05fr) minmax(0, 1fr); min-height: 100dvh; }
}
/* o login ocupa a tela toda, mesmo dentro do container da página */
.pagina:has(> .login-tela), .painel:has(> .login-tela) { max-width: none; padding: 0; }

/* Painel da marca */
.login-lado {
  position: relative; overflow: hidden; color: #d1fae5;
  background:
    radial-gradient(110% 75% at 0% 0%, rgba(0, 232, 122, .22) 0%, transparent 55%),
    radial-gradient(70% 60% at 100% 100%, rgba(0, 232, 122, .10) 0%, transparent 60%),
    linear-gradient(160deg, #0a0d12 0%, #0b1712 55%, #0a0d12 100%);
  display: flex; flex-direction: column; padding: 18px 20px;
}
/* grade fina, como no site da Tremps */
.login-lado::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(0, 232, 122, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 232, 122, .05) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%); mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
/* ondas de NFC */
.login-lado::after {
  content: ""; position: absolute; right: -180px; bottom: -180px; width: 520px; height: 520px; border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(circle, rgba(0, 232, 122, .16) 0 1.5px, transparent 1.5px 44px);
  -webkit-mask-image: radial-gradient(circle, #000 35%, transparent 70%); mask-image: radial-gradient(circle, #000 35%, transparent 70%);
}
.login-logo { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.login-logo .simbolo {
  width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center;
  color: var(--marca-tinta); background: var(--marca);
  box-shadow: 0 0 0 1px rgba(0, 232, 122, .35), 0 8px 28px rgba(0, 232, 122, .35);
}
.login-logo .simbolo svg { width: 26px; height: 26px; }
.login-logo .nome { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; color: #fff; line-height: 1.15; }
.login-logo .nome small { display: block; font-weight: 700; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--marca); }
.login-chamada, .login-fluxo, .login-rodape { display: none; position: relative; z-index: 1; }
@media (min-width: 900px) {
  .login-lado { padding: 40px 48px; justify-content: space-between; }
  .login-logo .simbolo { width: 52px; height: 52px; border-radius: 14px; }
  .login-logo .simbolo svg { width: 30px; height: 30px; }
  .login-logo .nome { font-size: 1.2rem; }
  .login-chamada { display: block; max-width: 30rem; }
  .login-chamada h2 { font-size: clamp(2rem, 3.2vw, 2.9rem); line-height: 1.08; letter-spacing: -.025em; color: #fff; font-weight: 800; text-wrap: balance; }
  .login-chamada h2 span { color: var(--marca); text-shadow: 0 0 28px rgba(0, 232, 122, .35); }
  .login-chamada p { margin-top: 14px; font-size: 1.05rem; color: #a7c4b5; max-width: 26rem; text-wrap: pretty; }
  .login-fluxo { display: flex; align-items: center; margin-top: 30px; }
  .login-fluxo .etapa-f { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; color: #e2f5eb;
    background: rgba(255, 255, 255, .05); border: 1px solid rgba(0, 232, 122, .22); border-radius: 999px; padding: 7px 12px; }
  .login-fluxo .etapa-f i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
  .login-fluxo .liga { width: 22px; height: 2px; background: linear-gradient(90deg, rgba(0, 232, 122, .1), rgba(0, 232, 122, .5), rgba(0, 232, 122, .1)); }
  .login-rodape { display: block; font-size: .8rem; color: #4b6b5b; }
}

/* Formulário */
.login-form {
  display: flex; align-items: flex-start; justify-content: center; padding: 26px 18px 40px;
  background: radial-gradient(90% 60% at 100% 0%, rgba(0, 232, 122, .10), transparent 60%), #f3f6f4;
}
@media (min-width: 900px) { .login-form { align-items: center; padding: 40px; } }
.login-caixa { width: 100%; max-width: 380px; }
.login-caixa .sobre {
  display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--marca-escura); background: var(--marca-claro); border: 1px solid #b7f5d3; border-radius: 999px; padding: 4px 10px; margin-bottom: 10px;
}
.login-caixa .sobre::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--marca-forte); }
.login-caixa h1 { font-size: 1.9rem; letter-spacing: -.025em; color: #0a0d12; }
.login-caixa .sub { color: var(--muted); margin-top: 4px; margin-bottom: 22px; }

/* Campos: rótulo pequeno + caixa com ícone */
.campo-l { display: block; }
.campo-l + .campo-l { margin-top: 16px; }
.campo-l .rotulo { display: flex; justify-content: space-between; align-items: baseline; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #3f4b45; margin-bottom: 7px; }
.campo-l .rotulo small { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); }
.caixa-in {
  display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 6px 0 14px;
  background: #fff; border: 1.5px solid #d5e0da; border-radius: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.caixa-in:focus-within { border-color: var(--marca-forte); box-shadow: 0 0 0 4px rgba(0, 232, 122, .18); }
.caixa-in > svg { width: 20px; height: 20px; flex: none; color: #7a8c83; }
.caixa-in:focus-within > svg { color: var(--marca-escura); }
.caixa-in input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 1.05rem; color: #0a0d12;
}
.caixa-in input::placeholder { color: #9aa8a1; }
.caixa-in input.pin { font-size: 1.35rem; letter-spacing: .5em; font-variant-numeric: tabular-nums; }
.caixa-in input.pin::placeholder { letter-spacing: .35em; font-size: 1rem; }
.olho {
  appearance: none; border: 0; background: transparent; width: 44px; height: 44px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #7a8c83; cursor: pointer;
}
.olho:hover { background: #eef5f1; color: var(--marca-escura); }
.olho svg { width: 20px; height: 20px; }
/* barrinha dos 6 números */
.pin-barra { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 8px; }
.pin-barra i { height: 4px; border-radius: 2px; background: #dbe5df; transition: background-color .15s; }
.pin-barra i.cheio { background: var(--marca-forte); }
.campo-l.erro .caixa-in { border-color: var(--vermelho); box-shadow: 0 0 0 4px rgba(220, 38, 38, .12); animation: treme .35s; }
.campo-l.erro .pin-barra i { background: #fecaca; }
@keyframes treme { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* Teclado numérico grande: só em tela de toque (no PC digita no teclado) */
.teclado { display: none; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
@media (pointer: coarse) { .teclado { display: grid; } }
.tecla {
  appearance: none; border: 0; background: #fff; border-radius: 14px;
  font: inherit; font-size: 1.55rem; font-weight: 700; color: #0a0d12; font-variant-numeric: tabular-nums;
  min-height: 60px; cursor: pointer; touch-action: manipulation; user-select: none;
  box-shadow: 0 1px 0 #d5e0da, 0 1px 2px rgba(10, 13, 18, .06); transition: transform .08s, background-color .12s;
}
.tecla:active { transform: scale(.96); background: var(--marca-claro); }
.tecla.fraca { font-size: .95rem; font-weight: 600; color: var(--muted); background: transparent; box-shadow: none; }

.login-caixa #lg-entrar {
  width: 100%; margin-top: 20px; min-height: 56px; border-radius: 14px; font-size: 1.08rem; font-weight: 800; letter-spacing: .01em;
  background: var(--marca); border-color: var(--marca); color: var(--marca-tinta);
  box-shadow: 0 10px 24px rgba(0, 232, 122, .32), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.login-caixa #lg-entrar:hover { background: #00d46f; }
.login-caixa #lg-entrar svg { width: 18px; height: 18px; }
.login-dica { margin-top: 14px; font-size: .82rem; color: var(--muted); text-align: center; }
@media (prefers-reduced-motion: reduce) { .campo-l.erro .caixa-in, .tecla, .pin-barra i { animation: none; transition: none; } }

/* ------------------------------ Celular (index) ------------------------------ */
.faixa-setor { background: var(--setor); color: #fff; padding: 14px 16px; }
.faixa-setor .t1 { font-size: 1.2rem; font-weight: 800; }
.faixa-setor .t2 { opacity: .9; font-size: .9rem; }
.tela-centro { min-height: 60dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 24px 16px; }
.icone-grande { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 2.6rem; font-weight: 800; }
.icone-grande.ok { background: var(--expedicao-claro); color: var(--expedicao); }
.icone-grande.erro { background: var(--vermelho-claro); color: var(--vermelho); }
.icone-grande.info { background: var(--setor-claro); color: var(--setor); }

.progresso { display: flex; gap: 4px; margin: 4px 0 2px; }
.progresso .passo { flex: 1; text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); }
.progresso .passo i { display: block; height: 8px; border-radius: 4px; background: var(--line); margin-bottom: 6px; }
.progresso .passo.feito i { background: var(--cor, var(--expedicao)); }
.progresso .passo.atual i { background: var(--cor, var(--setor)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cor, var(--setor)) 25%, transparent); }
.progresso .passo.atual { color: var(--ink); }

.dados { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .95rem; }
.dados dt { color: var(--muted); }
.dados dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.linha-tempo { list-style: none; margin: 0; padding: 0; }
.linha-tempo li { position: relative; padding: 0 0 14px 22px; }
.linha-tempo li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--cor, var(--admin)); }
.linha-tempo li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.linha-tempo li:last-child::after { display: none; }
.linha-tempo .quando { font-size: .8rem; color: var(--muted); }
.alteracao { font-size: .85rem; color: var(--ink-2); }
.alteracao s { color: var(--muted); }

.leitor-nfc { display: grid; place-items: center; gap: 10px; padding: 18px 8px; text-align: center; }
.onda { width: 96px; height: 96px; border-radius: 50%; background: var(--setor-claro); color: var(--setor); display: grid; place-items: center; font-weight: 800; position: relative; }
.onda::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--setor); opacity: 0; animation: pulso 1.6s ease-out infinite; }
@keyframes pulso { 0% { transform: scale(.85); opacity: .7; } 100% { transform: scale(1.25); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .onda::after { animation: none; } }
.camera { position: relative; width: 100%; aspect-ratio: 1; background: #000; border-radius: var(--raio); overflow: hidden; }
.camera video { width: 100%; height: 100%; object-fit: cover; }
.camera::after { content: ""; position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 16px; }

/* ------------------------------ Seletor de período ------------------------------ */
.periodo { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.periodo .input { width: auto; min-height: 34px; padding: 4px 8px; font-size: .9rem; }
.periodo-datas { display: inline-flex; gap: 6px; align-items: center; margin-left: 6px; }
.barra-inline { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; min-width: 60px; }
.barra-inline i { display: block; height: 100%; border-radius: 4px; background: var(--c, #2a78d6); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.kpi-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--raio); padding: 12px 14px; }
.kpi-tile > span { display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.kpi-tile b { display: block; font-size: 1.7rem; line-height: 1.15; margin-top: 4px; }
.kpi-tile small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.delta-bom { color: #006300; font-weight: 700; }
.delta-ruim { color: #b91c1c; font-weight: 700; }

/* ------------------------------ Tema escuro (painel da gerência e telão) ------------------------------ */
body.escuro {
  --bg: #000; --card: #0d0d0f; --line: #26262b; --line-2: #3a3a42; --ink: #fff; --ink-2: #d4d4d8; --muted: #9ca3af;
  --setor: var(--marca); --setor-claro: #0b2a1b; --setor-texto: var(--marca-tinta);
  background: #000; color: #fff;
}
body.escuro .topo { background: #000; border-bottom-color: #1f1f23; }
body.escuro .topo-menu a { color: #d4d4d8; }
body.escuro .topo-menu a:hover { background: #18181b; }
body.escuro .topo-menu a.ativo { background: #0b2a1b; color: #6ee7a8; }
body.escuro .btn { background: #18181b; border-color: #3f3f46; color: #fff; }
body.escuro .btn:hover { background: #27272a; }
body.escuro .modal { background: #0d0d0f; color: #fff; border: 1px solid #27272a; }
body.escuro .modal-cab, body.escuro .modal-rodape { border-color: #27272a; }
body.escuro .tabela-wrap { background: #0d0d0f; border-color: #26262b; }
body.escuro .tabela th { background: #111114; color: #a1a1aa; }
body.escuro .tabela td, body.escuro .tabela th { border-color: #26262b; }
body.escuro .selo.cinza { background: #27272a; color: #d4d4d8; }
body.escuro .selo.producao { background: #172554; color: #93c5fd; }
body.escuro .selo.jateamento { background: #27272a; color: #d4d4d8; }
body.escuro .selo.esmaltacao { background: #451a03; color: #fcd34d; }
body.escuro .selo.expedicao, body.escuro .selo.ok { background: #052e16; color: #86efac; }
body.escuro .selo.vermelho { background: #450a0a; color: #fca5a5; }
body.escuro .aviso.erro { background: #450a0a; color: #fecaca; }
body.escuro .input { background: #111114; color: #fff; border-color: #3f3f46; }
body.escuro .card { background: #0d0d0f; border-color: #26262b; box-shadow: none; }
body.escuro .tecla { background: #111114; color: #fff; border-color: #3f3f46; }

/* ------------------------------ QR / etiquetas ------------------------------ */
.qr-box { display: grid; place-items: center; gap: 10px; text-align: center; }
.qr-box svg { width: min(78vw, 340px); height: auto; background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--line); }
.contagem { font-size: 2rem; font-weight: 800; }
#area-impressao { display: none; }
@media print {
  body.imprimindo > *:not(#area-impressao) { display: none !important; }
  body.imprimindo #area-impressao { display: block !important; }
  body.imprimindo { background: #fff; }
  @page { margin: 10mm; }
}
.etiquetas { display: grid; grid-template-columns: repeat(3, 60mm); gap: 6mm; }
.etiqueta { width: 60mm; height: 40mm; border: 1px dashed #999; border-radius: 3mm; padding: 3mm; display: flex; align-items: center; gap: 3mm; break-inside: avoid; }
.etiqueta svg { width: 30mm; height: 30mm; flex: none; }
.etiqueta .cod { font-size: 12.5pt; font-weight: 800; font-family: var(--fonte); white-space: nowrap; letter-spacing: -.01em; }
.etiqueta .sub { font-size: 7.5pt; color: #333; }
