/* LogClin — estilos do app (celular primeiro) */
:root {
  --verde: #0B6E69;
  --verde-escuro: #084B49;
  --destaque: #3FC9BE;
  --texto: #0E2428;
  --fundo: #F5F7F6;
  --cartao: #FFFFFF;
  --borda: #E3EAEA;
  --borda-forte: #CFDADB;
  --suave: #576B6F;
  --verde-claro: #E3F2F0;
  --cinza-claro: #EDF2F2;
  --segmento: #E9EFEF;
  --trilho: #E6ECEC;
  --erro: #B42318;
  --erro-fundo: #FDECEA;
  --aviso: #8A5200;
  --aviso-fundo: #FFF1D6;
  --aviso-borda: #F3D9A4;
  --ok: #17663A;
  --ok-fundo: #E4F5EA;
  --scan: #071A1C;
  --sombra: 0 1px 2px rgba(14, 36, 40, .04), 0 8px 24px rgba(14, 36, 40, .06);
  --raio: 20px;
  --fonte: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --topo-seguro: env(safe-area-inset-top, 0px);
  --base-segura: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #E9EEED; color: var(--texto); font-family: var(--fonte); }
body { min-height: 100dvh; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--verde); }
/* sem zoom com dois toques (o toque fica imediato); o zoom de pinça continua para quem precisa */
html, body, button, a, input, select, textarea, label { touch-action: manipulation; }
/* iPhone dá zoom sozinho em campos com letra menor que 16px: todos ficam com pelo menos 16px */
input, select, textarea { font-size: max(16px, 1em); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg { display: block; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--destaque); outline-offset: 2px; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: var(--fundo); position: relative; box-shadow: 0 0 0 1px rgba(14, 36, 40, .04); }

/* ---------- Celular deitado: pede para virar ---------- */
#girar { display: none; }
html.deitado #girar { display: flex; position: fixed; inset: 0; z-index: 100; background: var(--verde-escuro); color: #fff; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; }
html.deitado #girar svg { animation: girar-cel 2.4s ease-in-out infinite; }
html.deitado #girar strong { font-size: 20px; font-weight: 700; }
html.deitado #girar span { font-size: 14px; color: #CFE7E4; }
html.deitado #app, html.deitado .toasts, html.deitado .folha-fundo, html.deitado #faixa-offline { visibility: hidden; }
@keyframes girar-cel { 0%, 30% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0deg); } }
@media (prefers-reduced-motion: reduce) { html.deitado #girar svg { animation: none; } }

/* ---------- Estrutura de tela ---------- */
.tela { min-height: 100dvh; display: flex; flex-direction: column; }
.tela.escura { background: var(--scan); color: #fff; }
.conteudo { flex: 1; padding: 0 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.conteudo.com-nav { padding-bottom: calc(110px + var(--base-segura)); }
.conteudo.com-rodape { padding-bottom: calc(110px + var(--base-segura)); }
.topo { padding: calc(20px + var(--topo-seguro)) 20px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topo-titulo { padding: calc(16px + var(--topo-seguro)) 20px 8px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 5; background: var(--fundo); }
.topo-titulo h1 { flex: 1; margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topo-titulo .sub { display: block; font-size: 12px; font-weight: 500; color: var(--suave); }
.titulo-grande { padding: 28px 20px 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.titulo-grande h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; }
.titulo-grande .sub { font-size: 13px; color: var(--suave); margin-top: 4px; }

/* ---------- Marca ---------- */
.marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.marca-icone { width: 30px; height: 30px; flex: none; }
.logo { font-size: 20px; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.logo b { font-weight: 700; }
.logo span { font-weight: 300; }
.clinica-nome { font-size: 14px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Botões ---------- */
.btn { min-height: 56px; border-radius: 16px; border: 0; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px; font-weight: 700; background: var(--verde); color: #fff; width: 100%; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.escuro { background: var(--texto); }
.btn.claro { background: var(--cartao); color: var(--texto); border: 1.5px solid var(--borda); }
.btn.perigo { background: var(--cartao); color: var(--erro); border: 1.5px solid #F0B8B2; }
.btn.fantasma { background: transparent; color: var(--suave); min-height: 48px; font-weight: 600; font-size: 15px; }
.btn.pequeno { min-height: 44px; font-size: 14px; border-radius: 14px; padding: 0 16px; width: auto; }
.btn svg { flex: none; }
.btn-icone { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--borda); background: var(--cartao); color: var(--texto); display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; text-decoration: none; position: relative; }
.btn-icone.verde { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn-icone.vidro { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #fff; }
.btn-icone .ponto { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 99px; background: var(--erro); border: 2px solid #fff; }
.avatar { width: 44px; height: 44px; border-radius: 14px; background: var(--texto); color: #fff; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 0; padding: 0; }
.link { border: 0; background: none; color: var(--verde); font-weight: 700; font-size: 14px; min-height: 44px; padding: 0; }
.rodape-acoes { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; padding: 12px 20px calc(16px + var(--base-segura)); display: flex; gap: 12px; background: linear-gradient(180deg, rgba(245, 247, 246, 0), var(--fundo) 24%); z-index: 10; flex-wrap: wrap; }
.rodape-acoes .btn { flex: 1; }
.rodape-acoes .linha-unica { flex-basis: 100%; }

/* ---------- Cartões ---------- */
.cartao { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px; box-shadow: var(--sombra); }
.cartao.grande { border-radius: 24px; padding: 18px; }
.cartao-toque { display: flex; flex-direction: column; gap: 12px; text-align: left; width: 100%; font: inherit; color: inherit; cursor: pointer; text-decoration: none; }
.cartao-toque:active { transform: scale(.995); }
.linha { display: flex; align-items: center; gap: 12px; }
.cresce { flex: 1; min-width: 0; }
.nome { font-size: 15px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; }
.detalhe { font-size: 13px; color: var(--suave); margin-top: 2px; }
.numero { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; text-align: right; }
.numero-rotulo { font-size: 12px; color: var(--suave); margin-top: 3px; text-align: right; }
.vermelho { color: var(--erro) !important; }

.cracha { width: 52px; height: 52px; border-radius: 16px; background: var(--verde-claro); color: var(--verde); font-size: 18px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.cracha.vazio { background: var(--cinza-claro); color: var(--suave); }
.cracha.g { width: 64px; height: 64px; border-radius: 19px; font-size: 22px; }
.cracha.p { width: 40px; height: 40px; border-radius: 12px; font-size: 14px; }
.cracha.longo { font-size: 13px; }

.gaveta-vazia { background: transparent; border: 1.5px dashed #AFC3C4; box-shadow: none; flex-direction: row; align-items: center; }
.mais-quadrado { width: 40px; height: 40px; border-radius: 12px; background: var(--cartao); border: 1px solid var(--borda); display: flex; align-items: center; justify-content: center; color: var(--verde); flex: none; }

/* botão ⋯ do administrador nos cards */
.card-admin { position: relative; }
.card-admin > .cartao { width: 100%; }
.cartao.com-mais { padding-bottom: 52px; }
.card-mais { position: absolute; right: 8px; bottom: 6px; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--borda); background: var(--cartao); color: var(--suave); display: flex; align-items: center; justify-content: center; padding: 0; z-index: 1; }
.card-mais.meio { top: 50%; bottom: auto; transform: translateY(-50%); right: 14px; }
.card-mais:active { background: var(--cinza-claro); }

/* ---------- Etiquetas (chips) ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--suave); background: var(--cinza-claro); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.chip.erro { color: var(--erro); background: var(--erro-fundo); }
.chip.aviso { color: var(--aviso); background: var(--aviso-fundo); }
.chip.ok { color: var(--ok); background: var(--ok-fundo); }
.chip.verde { color: var(--verde); background: var(--verde-claro); }
.chip.escuro { color: #fff; background: var(--texto); }

/* ---------- Abas e filtros ---------- */
.segmento { display: flex; gap: 4px; background: var(--segmento); border-radius: 16px; padding: 4px; margin: 16px 20px 0; }
.segmento button, .segmento a { flex: 1; min-height: 44px; border-radius: 12px; border: 0; background: none; color: var(--suave); font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.segmento .ativo { background: var(--cartao); color: var(--texto); font-weight: 700; box-shadow: var(--sombra); }
.filtros { display: flex; gap: 8px; padding: 14px 20px 0; overflow-x: auto; scrollbar-width: none; }
.filtros::-webkit-scrollbar { display: none; }
.filtro { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--borda); background: var(--cartao); color: var(--texto); font-size: 14px; font-weight: 600; white-space: nowrap; flex: none; }
.filtro .n { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--cinza-claro); }
.filtro.ativo { background: var(--texto); border-color: var(--texto); color: #fff; }
.filtro.ativo .n { background: rgba(255, 255, 255, .18); }
.busca { display: flex; align-items: center; gap: 10px; background: var(--cartao); border: 1px solid var(--borda); border-radius: 14px; min-height: 48px; padding: 0 14px; color: var(--suave); margin: 12px 20px 0; }
.busca input { flex: 1; border: 0; outline: 0; background: none; font-size: 16px; color: var(--texto); padding: 0; min-width: 0; }
.busca input::placeholder { color: #7A8C8F; }
.lista { padding: 14px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.lista-vazia { text-align: center; color: var(--suave); font-size: 14px; padding: 32px 12px; }
.lista-vazia strong { display: block; color: var(--texto); font-size: 16px; margin-bottom: 4px; }

/* ---------- Barra inferior ---------- */
.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; align-items: flex-end; background: var(--cartao); border-top: 1px solid var(--borda); padding: 6px 12px calc(10px + var(--base-segura)); z-index: 20; }
.nav a, .nav button { flex: 1; border: 0; background: none; color: var(--suave); font-size: 12px; font-weight: 600; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; text-decoration: none; }
.nav .ativo { color: var(--verde); font-weight: 700; }
.nav .central { gap: 4px; justify-content: flex-end; color: var(--texto); font-weight: 700; }
.nav .central .fab { margin-top: -30px; width: 64px; height: 64px; border-radius: 22px; background: var(--verde); border: 4px solid var(--fundo); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(11, 110, 105, .35); }

/* ---------- Barra de nível ---------- */
.nivel { position: relative; height: 6px; border-radius: 99px; background: var(--trilho); }
.nivel.g { height: 8px; }
.nivel i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--verde); }
.nivel i.baixo { background: var(--erro); }
.nivel i.aviso { background: #B7791F; }
.nivel b { position: absolute; left: 33.3%; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--texto); opacity: .55; }

/* ---------- Formulários ---------- */
.campo { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: var(--suave); }
.entrada { display: flex; align-items: center; gap: 10px; background: var(--cartao); border: 1.5px solid var(--borda-forte); border-radius: 14px; min-height: 52px; padding: 0 16px; }
.entrada:focus-within { border-color: var(--verde); }
.entrada input, .entrada select, .entrada textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; font-weight: 500; color: var(--texto); padding: 0; min-height: 48px; }
.entrada input::placeholder { color: #8A9A9D; font-weight: 400; }
.entrada.erro { border-color: var(--erro); }
.ajuda { font-size: 12px; color: var(--suave); line-height: 1.45; font-weight: 400; margin: 0; }
.contador { display: flex; align-items: center; gap: 8px; }
.contador input { text-align: left; }
.contador .btn-icone { width: 36px; height: 36px; border-radius: 10px; }
.contador-grande { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 8px 0 4px; }
.contador-grande .btn-icone { width: 56px; height: 56px; border-radius: 99px; }
.contador-grande output, .contador-grande input { font-size: 64px; font-weight: 800; letter-spacing: -.04em; line-height: 1; min-width: 90px; text-align: center; font-variant-numeric: tabular-nums; border: 0; background: none; padding: 0; width: 120px; }
.opcoes { display: flex; flex-wrap: wrap; gap: 8px; }
.opcao { min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--borda-forte); background: var(--cartao); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.opcao[aria-pressed="true"] { border-color: var(--verde); background: var(--verde-claro); color: var(--verde); }

/* ---------- Avisos ---------- */
.faixa { display: flex; align-items: flex-start; gap: 10px; border-radius: 16px; padding: 12px 14px; font-size: 13px; line-height: 1.4; }
.faixa svg { flex: none; margin-top: 1px; }
.faixa.aviso { background: var(--aviso-fundo); color: var(--aviso); border: 1px solid var(--aviso-borda); }
.faixa.erro { background: var(--erro-fundo); color: var(--erro); border: 1px solid #F5C6C0; }
.faixa.info { background: var(--verde-claro); color: var(--verde-escuro); }
.faixa.escura { background: var(--texto); color: #fff; align-items: center; }
.faixa b { font-weight: 700; }

/* ---------- Linhas de histórico ---------- */
.mov { display: flex; align-items: center; gap: 12px; padding: 12px 0; text-decoration: none; color: inherit; width: 100%; border: 0; background: none; text-align: left; }
.mov + .mov { border-top: 1px solid var(--borda); }
.mov-icone { width: 40px; height: 40px; border-radius: 99px; background: var(--segmento); display: flex; align-items: center; justify-content: center; flex: none; color: var(--texto); }
.mov-icone.pos { background: var(--ok-fundo); color: var(--ok); }
.mov-icone.estorno { background: var(--aviso-fundo); color: var(--aviso); }
.mov-icone.sai { background: var(--erro-fundo); color: var(--erro); }
.mov-icone.novo { background: #EAF2FF; color: #2563EB; }
.mov-icone.corr { background: var(--aviso-fundo); color: var(--aviso); }
.mov-qtd { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mov-qtd.pos { color: var(--ok); }
.riscado { text-decoration: line-through; opacity: .6; }
.secao-titulo { display: flex; justify-content: space-between; align-items: center; padding: 6px 0 2px; }
.secao-titulo h2 { margin: 0; font-size: 15px; font-weight: 800; }
.dia { font-size: 12px; font-weight: 700; color: var(--suave); letter-spacing: .04em; padding: 10px 0 0; }
.tabela-linhas > div { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; font-size: 14px; color: var(--suave); }
.tabela-linhas > div + div { border-top: 1px solid var(--borda); }
.tabela-linhas strong { color: var(--texto); font-weight: 700; text-align: right; }

/* ---------- Ícones de categoria ---------- */
.cat { width: 48px; height: 48px; border-radius: 14px; flex: none; display: flex; align-items: center; justify-content: center; }
.cat.g { width: 56px; height: 56px; border-radius: 16px; }
.cat-injetavel { background: #EEEAFB; color: #5B45A8; }
.cat-curativo { background: #E6EEF9; color: #2F5DA8; }
.cat-cirurgico { background: var(--verde-claro); color: var(--verde); }
.cat-medicamento { background: #FBEAF0; color: #A3305F; }
.cat-outros { background: var(--cinza-claro); color: var(--suave); }

/* ---------- Login ---------- */
.login-topo { position: relative; min-height: 360px; background: var(--verde-escuro); overflow: hidden; color: #fff; padding: calc(56px + var(--topo-seguro)) 28px 64px; }
.login-topo .grade { position: absolute; inset: 0; opacity: 1; }
.login-topo .conteudo-topo { position: relative; display: flex; flex-direction: column; gap: 18px; }
.login-topo h1 { margin: 26px 0 0; font-size: 32px; line-height: 1.12; font-weight: 800; letter-spacing: -.03em; }
.login-topo p { margin: 0; font-size: 15px; line-height: 1.5; color: #CFE7E4; max-width: 300px; }
.login-corpo { flex: 1; background: var(--cartao); margin-top: -28px; border-radius: 28px 28px 0 0; position: relative; padding: 28px 24px calc(24px + var(--base-segura)); display: flex; flex-direction: column; gap: 16px; }
.login-corpo h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }

/* ---------- Câmera ---------- */
.camera { position: fixed; inset: 0; max-width: 480px; margin: 0 auto; background: var(--scan); overflow: hidden; }
.camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera .veu { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(7, 26, 28, .05) 30%, rgba(7, 26, 28, .72) 75%); pointer-events: none; }
.camera-topo { position: absolute; left: 0; right: 0; top: 0; padding: calc(16px + var(--topo-seguro)) 20px 0; display: flex; align-items: center; gap: 12px; z-index: 2; }
.camera-topo .titulo { flex: 1; text-align: center; font-size: 17px; font-weight: 700; color: #fff; }
.camera-topo .titulo small { display: block; font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, .7); }
.moldura { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); width: 248px; height: 248px; z-index: 1; pointer-events: none; }
.moldura.barras { width: 300px; height: 160px; }
.moldura span { position: absolute; width: 44px; height: 44px; border: 4px solid #fff; }
.moldura span:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 22px 0 0 0; }
.moldura span:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 22px 0 0; }
.moldura span:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 22px; }
.moldura span:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 22px 0; }
.moldura .laser { position: absolute; left: 12px; right: 12px; top: 50%; height: 2px; background: var(--destaque); box-shadow: 0 0 12px var(--destaque); animation: laser 2s ease-in-out infinite; border: 0; width: auto; }
.moldura.barras .laser { background: #FF5A4A; box-shadow: 0 0 12px #FF8A7A; animation: none; }
@keyframes laser { 0%, 100% { transform: translateY(-80px); } 50% { transform: translateY(80px); } }
@media (prefers-reduced-motion: reduce) { .moldura .laser { animation: none; } }
.camera-texto { position: absolute; left: 0; right: 0; top: calc(34% + 150px); text-align: center; padding: 0 28px; z-index: 1; }
.moldura.barras ~ .camera-texto { top: calc(34% + 110px); }
.camera-texto h2 { margin: 0; font-size: 20px; font-weight: 700; color: #fff; }
.camera-texto p { margin: 8px 0 0; font-size: 13px; color: rgba(255, 255, 255, .78); line-height: 1.5; }
.camera-base { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 16px calc(20px + var(--base-segura)); display: flex; flex-direction: column; gap: 10px; z-index: 2; }
.vidro { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); border-radius: 18px; color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.vidro-cartao { display: flex; align-items: center; gap: 12px; padding: 14px; text-align: left; width: 100%; }
.vidro-cartao .ic { width: 40px; height: 40px; border-radius: 12px; background: rgba(63, 201, 190, .18); color: var(--destaque); display: flex; align-items: center; justify-content: center; flex: none; }
.vidro-cartao strong { display: block; font-size: 14px; }
.vidro-cartao small { display: block; font-size: 12px; color: rgba(255, 255, 255, .72); margin-top: 2px; line-height: 1.4; }
.btn.vidro { min-height: 52px; font-weight: 600; font-size: 15px; }
.camera-aviso { position: absolute; left: 20px; right: 20px; top: calc(34% - 40px); z-index: 3; text-align: center; color: #fff; font-size: 14px; line-height: 1.5; }

/* ---------- Folha inferior (bottom sheet) e menus ---------- */
.folha-fundo { position: fixed; inset: 0; background: rgba(7, 26, 28, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: aparecer .15s ease; }
.folha { width: 100%; max-width: 480px; background: var(--cartao); border-radius: 26px 26px 0 0; padding: 10px 20px calc(20px + var(--base-segura)); max-height: 90dvh; overflow: auto; animation: subir .2s ease; }
.folha .alca { width: 40px; height: 5px; border-radius: 99px; background: var(--borda-forte); margin: 0 auto 14px; }
.folha h2 { margin: 0 0 6px; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.folha .itens { display: flex; flex-direction: column; margin-top: 8px; }
.folha .item { display: flex; align-items: center; gap: 14px; min-height: 56px; border: 0; background: none; text-align: left; font-size: 15px; font-weight: 600; padding: 0 4px; border-radius: 12px; color: var(--texto); text-decoration: none; }
.folha .item + .item { border-top: 1px solid var(--borda); }
.folha .item.perigo { color: var(--erro); }
@keyframes subir { from { transform: translateY(40px); opacity: .4; } }
@keyframes aparecer { from { opacity: 0; } }

/* ---------- Avisos rápidos (toast) ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--base-segura)); width: calc(100% - 32px); max-width: 448px; z-index: 60; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--texto); color: #fff; border-radius: 14px; padding: 14px 16px; font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(14, 36, 40, .25); animation: subir .2s ease; display: flex; gap: 10px; align-items: flex-start; pointer-events: auto; }
.toast.erro { background: #7A1A12; }
.toast.ok svg { color: var(--destaque); }

/* ---------- Carregando ---------- */
.carregando { flex: 1; display: flex; align-items: center; justify-content: center; padding: 60px 0; }
.giro { width: 34px; height: 34px; border-radius: 99px; border: 3px solid var(--trilho); border-top-color: var(--verde); animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.esqueleto { background: linear-gradient(90deg, #EEF2F1 25%, #F7F9F9 50%, #EEF2F1 75%); background-size: 200% 100%; animation: brilho 1.2s infinite; border-radius: 20px; height: 96px; }
@keyframes brilho { to { background-position: -200% 0; } }

/* ---------- Gaveta / confirmação ---------- */
.estado-vazio { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 12px; gap: 6px; }
.estado-vazio .circulo { width: 112px; height: 112px; border-radius: 99px; background: var(--segmento); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.estado-vazio .circulo > div { width: 64px; height: 64px; border-radius: 18px; background: var(--cartao); border: 1.5px dashed #AFC3C4; display: flex; align-items: center; justify-content: center; color: var(--verde); }
.estado-vazio h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.estado-vazio p { margin: 6px 0 0; font-size: 14px; color: var(--suave); line-height: 1.5; max-width: 290px; }
.sucesso { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 0 8px; }
.sucesso .check { width: 96px; height: 96px; border-radius: 99px; background: var(--verde); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 14px rgba(11, 110, 105, .12); margin-bottom: 26px; }
.sucesso h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.025em; }
.sucesso p { margin: 6px 0 0; color: var(--suave); font-size: 14px; }
.grande-num { font-size: 52px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.seta-num { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--texto); }
.rotulo { font-size: 13px; color: var(--suave); font-weight: 600; }

/* ---------- Etiqueta ---------- */
.etiqueta { background: #fff; border: 1px solid var(--borda); border-radius: 24px; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: var(--sombra); }
.etiqueta .qr { width: 200px; height: 200px; border: 1px solid var(--borda); border-radius: 16px; padding: 8px; background: #fff; }
.etiqueta .qr svg { width: 100%; height: 100%; }
.etiqueta .cod { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-top: 8px; }
.etiqueta .cli { font-size: 13px; color: var(--suave); }
.etiqueta .prod { font-size: 16px; font-weight: 700; text-align: center; line-height: 1.25; }
.etiqueta .marca-et { font-size: 12px; color: var(--suave); margin-top: 4px; }
#area-impressao { display: none; }

/* ---------- Banner do administrador ---------- */
.banner-admin { margin: calc(16px + var(--topo-seguro)) 20px 0; background: var(--texto); color: #fff; border-radius: 18px; padding: 12px 12px 12px 14px; display: flex; align-items: center; gap: 12px; }
.banner-admin .ic { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .1); display: flex; align-items: center; justify-content: center; flex: none; }
.banner-admin small { display: block; font-size: 11px; color: rgba(255, 255, 255, .7); }
.banner-admin strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner-admin button { min-height: 36px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .3); background: none; color: #fff; font-size: 13px; font-weight: 700; padding: 0 14px; flex: none; }
.estatisticas { display: flex; gap: 10px; padding: 18px 20px 0; }
.estatisticas .cartao { flex: 1; border-radius: 18px; padding: 14px; }
.estatisticas .rotulo { font-size: 12px; }
.estatisticas .valor { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.offline { background: var(--aviso-fundo); color: var(--aviso); font-size: 13px; font-weight: 600; text-align: center; padding: 8px 12px calc(8px); position: sticky; top: 0; z-index: 30; }

/* ---------- Telas largas ---------- */
@media (min-width: 520px) {
  body { padding: 0; }
}

/* ---------- Impressão de etiquetas ---------- */
@media print {
  @page { margin: 10mm; }
  html, body { background: #fff !important; }
  #app, .toasts, .folha-fundo { display: none !important; }
  #area-impressao { display: flex !important; flex-wrap: wrap; gap: 6mm; justify-content: flex-start; }
  .et-imp { width: 60mm; border: 0.3mm dashed #999; border-radius: 3mm; padding: 4mm; display: flex; flex-direction: column; align-items: center; break-inside: avoid; page-break-inside: avoid; font-family: var(--fonte); color: #000; }
  .et-imp svg { width: 46mm; height: 46mm; }
  .et-imp .c { font-size: 22pt; font-weight: 800; line-height: 1.1; margin-top: 1mm; }
  .et-imp .n { font-size: 8pt; text-align: center; }
  .et-imp .p { font-size: 10pt; font-weight: 700; text-align: center; line-height: 1.2; margin-top: .5mm; }
  .et-imp .m { font-size: 7pt; margin-top: 1mm; }
  .et-imp .m b { font-weight: 700; }
  .et-imp .m span { font-weight: 300; }
}

/* nomes de produto, marca, seção e kit: sempre em maiúsculas */
.maiusc { text-transform: uppercase; }
.maiusc::placeholder { text-transform: none; }

/* chave liga/desliga (ex.: "Tem validade") */
.chave-linha { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--borda); border-radius: 16px; background: var(--cartao); cursor: pointer; }
.chave-linha b { display: block; font-size: 15px; color: var(--texto); }
.chave-linha small { display: block; font-size: 13px; color: var(--suave); font-weight: 500; line-height: 1.35; margin-top: 2px; }
.chave { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 32px; border-radius: 16px; background: var(--borda-forte); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.chave::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.chave:checked { background: var(--verde); }
.chave:checked::after { transform: translateX(20px); }
.chave:focus-visible { outline: 3px solid var(--destaque); outline-offset: 2px; }
[data-campo-validade] { gap: 10px; }
