/* Vendaí — estilos do painel e da loja pública */
:root {
  --grafite: #0e1014;
  --grafite-2: #1a1d24;
  --grafite-3: #262a33;
  --laranja: #ff6b1a;
  --laranja-2: #ff8a3d;
  --laranja-claro: #fff1e8;
  --fundo: #f5f6f8;
  --cartao: #ffffff;
  --texto: #15171c;
  --suave: #6b7280;
  --borda: #e3e5ea;
  --verde: #16a34a;
  --verde-claro: #e8f7ee;
  --vermelho: #dc2626;
  --vermelho-claro: #fdecec;
  --amarelo: #b45309;
  --amarelo-claro: #fff6e0;
  --azul: #2f6bff;
  --raio: 12px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .06);
  --fonte: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--fonte); background: var(--fundo); color: var(--texto); font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--laranja); }
.oculto { display: none !important; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.suave { color: var(--suave); }
.pequeno { font-size: .85rem; }
.direita { text-align: right; }
.num { font-variant-numeric: tabular-nums; }

/* marca */
.marca { font-weight: 800; letter-spacing: -.02em; font-size: 1.35rem; color: #fff; white-space: nowrap; }
.marca b { color: var(--laranja); font-weight: 800; }
.marca.escura { color: var(--grafite); }

/* botões */
.bt { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--borda);
  background: #fff; padding: .6rem 1rem; border-radius: 10px; cursor: pointer; font-weight: 600; min-height: 42px;
  transition: background .15s, border-color .15s, transform .05s; text-decoration: none; color: var(--texto); }
.bt:hover { background: #f2f3f5; }
.bt:active { transform: translateY(1px); }
.bt:disabled { opacity: .5; cursor: not-allowed; }
.bt.primario { background: var(--laranja); border-color: var(--laranja); color: #fff; }
.bt.primario:hover { background: var(--laranja-2); }
.bt.escuro { background: var(--grafite); border-color: var(--grafite); color: #fff; }
.bt.perigo { color: var(--vermelho); border-color: #f3c4c4; }
.bt.perigo.cheio { background: var(--vermelho); color: #fff; border-color: var(--vermelho); }
.bt.verde { background: var(--verde); border-color: var(--verde); color: #fff; }
.bt.grande { min-height: 54px; font-size: 1.05rem; padding: .8rem 1.4rem; }
.bt.bloco { width: 100%; }
.bt.mini { min-height: 32px; padding: .3rem .65rem; font-size: .85rem; border-radius: 8px; }
.bt.fantasma { border-color: transparent; background: transparent; }
.bt.fantasma:hover { background: rgba(0,0,0,.05); }

/* formulários */
label.campo { display: block; margin-bottom: .8rem; }
label.campo > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; color: #374151; }
.entrada, select.entrada, textarea.entrada { width: 100%; border: 1px solid var(--borda); border-radius: 10px; padding: .65rem .8rem;
  background: #fff; min-height: 44px; outline: none; transition: border-color .15s, box-shadow .15s; }
.entrada:focus { border-color: var(--laranja); box-shadow: 0 0 0 3px rgba(255,107,26,.15); }
textarea.entrada { min-height: 80px; resize: vertical; }
.linha { display: flex; gap: .75rem; flex-wrap: wrap; }
.linha > * { flex: 1 1 160px; }
.check { display: flex; align-items: center; gap: .55rem; margin: .4rem 0 .8rem; cursor: pointer; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--laranja); }
.dica { font-size: .8rem; color: var(--suave); margin-top: .25rem; }

/* cartões */
.cartao { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1rem; box-shadow: var(--sombra); }
.cartao + .cartao { margin-top: 1rem; }
.grade > .cartao + .cartao { margin-top: 0; }
.grade { display: grid; gap: 1rem; }
.grade.k4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi .rotulo { font-size: .8rem; color: var(--suave); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kpi .valor { font-size: 1.6rem; font-weight: 800; margin-top: .25rem; }
.etiqueta { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #eef0f3; color: #374151; }
.etiqueta.verde { background: var(--verde-claro); color: var(--verde); }
.etiqueta.vermelho { background: var(--vermelho-claro); color: var(--vermelho); }
.etiqueta.amarelo { background: var(--amarelo-claro); color: var(--amarelo); }
.etiqueta.laranja { background: var(--laranja-claro); color: #c2410c; }
.aviso { border-radius: 10px; padding: .75rem 1rem; background: var(--amarelo-claro); color: #7c4a03; border: 1px solid #f6dfa4; margin-bottom: 1rem; }
.aviso.erro { background: var(--vermelho-claro); color: #991b1b; border-color: #f5c2c2; }
.aviso.ok { background: var(--verde-claro); color: #14532d; border-color: #bfe8cd; }

table.tabela { width: 100%; border-collapse: collapse; }
.tabela th, .tabela td { padding: .55rem .5rem; border-bottom: 1px solid var(--borda); text-align: left; vertical-align: middle; }
.tabela th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--suave); }
.tabela tr:last-child td { border-bottom: none; }
.rolagem-x { overflow-x: auto; }
.tabela .direita { text-align: right; }

/* ====================== estrutura do painel ====================== */
.topo { position: sticky; top: 0; z-index: 20; background: var(--grafite); color: #fff; display: flex; align-items: center;
  gap: 1rem; padding: .6rem 1rem; min-height: 56px; }
.topo .loja-nome { font-weight: 600; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topo .espaco { flex: 1; }
.topo .status-rede { font-size: .78rem; padding: .2rem .55rem; border-radius: 999px; background: var(--grafite-3); }
.topo .status-rede.off { background: #7f1d1d; }
.topo .bt { min-height: 36px; padding: .35rem .7rem; background: var(--grafite-2); color: #fff; border-color: var(--grafite-3); }
.topo .bt:hover { background: var(--grafite-3); }

.casca { display: flex; min-height: calc(100vh - 56px); }
nav.menu { width: 220px; background: var(--grafite-2); padding: .75rem .5rem; flex-shrink: 0; }
nav.menu a { display: flex; align-items: center; gap: .7rem; color: #c9ccd3; text-decoration: none; padding: .7rem .8rem; border-radius: 10px;
  font-weight: 600; margin-bottom: 2px; position: relative; }
nav.menu a .ic { font-size: 1.15rem; width: 1.4rem; text-align: center; }
nav.menu a:hover { background: var(--grafite-3); color: #fff; }
nav.menu a.ativo { background: var(--laranja); color: #fff; }
nav.menu a .bolinha { position: absolute; right: .6rem; background: var(--laranja); color: #fff; border-radius: 999px; font-size: .72rem;
  padding: .05rem .45rem; font-weight: 800; }
nav.menu a.ativo .bolinha { background: #fff; color: var(--laranja); }
main.conteudo { flex: 1; padding: 1.25rem; min-width: 0; }
.cabecalho-tela { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cabecalho-tela h2 { margin: 0; flex: 1; }

@media (max-width: 860px) {
  nav.menu { position: fixed; bottom: 0; left: 0; right: 0; width: auto; display: flex; justify-content: space-around; padding: .25rem;
    z-index: 30; border-top: 1px solid var(--grafite-3); }
  nav.menu a { flex-direction: column; gap: .1rem; font-size: .66rem; padding: .4rem .25rem; flex: 1; text-align: center; margin: 0; }
  nav.menu a .bolinha { right: 18%; top: 2px; }
  main.conteudo { padding: 1rem .75rem 5.5rem; }
  .topo .loja-nome, .topo .so-desktop { display: none; }
  .topo { gap: .5rem; }
}

/* ====================== PDV ====================== */
.pdv > * { min-width: 0; }
.pdv { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1rem; align-items: start; }
.pdv-busca { display: flex; gap: .5rem; margin-bottom: .75rem; }
.pdv-busca .entrada { font-size: 1.05rem; }
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: .5rem; scrollbar-width: thin; }
.chip { flex-shrink: 0; border: 1px solid var(--borda); background: #fff; border-radius: 999px; padding: .4rem .85rem; cursor: pointer;
  font-weight: 600; font-size: .88rem; white-space: nowrap; }
.chip.ativo { background: var(--grafite); color: #fff; border-color: var(--grafite); }
.produtos-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.produto-bloco { background: #fff; border: 1px solid var(--borda); border-radius: 12px; padding: 0; cursor: pointer; text-align: left;
  overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; min-height: 150px; }
.produto-bloco:hover { border-color: var(--laranja); box-shadow: 0 0 0 3px rgba(255,107,26,.12); }
.produto-bloco .img { height: 84px; background: #f1f2f4 center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.produto-bloco .info { padding: .5rem .6rem .6rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.produto-bloco .nome { font-weight: 600; font-size: .86rem; line-height: 1.2; }
.produto-bloco .preco { font-weight: 800; color: var(--grafite); margin-top: auto; }
.produto-bloco .estq { font-size: .72rem; color: var(--suave); }
.produto-bloco .estq.baixo { color: var(--vermelho); font-weight: 700; }

.carrinho { position: sticky; top: 72px; display: flex; flex-direction: column; max-height: calc(100vh - 90px); }
.carrinho .itens { overflow-y: auto; flex: 1; min-height: 120px; margin: 0 -1rem; padding: 0 1rem; }
.item-carrinho { display: grid; grid-template-columns: 1fr auto; gap: .2rem .5rem; padding: .6rem 0; border-bottom: 1px dashed var(--borda); }
.item-carrinho .n { font-weight: 600; font-size: .92rem; }
.item-carrinho .ad { font-size: .78rem; color: var(--suave); grid-column: 1 / -1; }
.item-carrinho .t { font-weight: 700; text-align: right; }
.qtd { display: flex; align-items: center; gap: .3rem; }
.qtd button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--borda); background: #fff; cursor: pointer; font-weight: 800; }
.qtd .v { min-width: 3.2rem; text-align: center; font-weight: 700; cursor: pointer; border-bottom: 1px dotted var(--suave); }
.totais { border-top: 2px solid var(--grafite); padding-top: .7rem; margin-top: .5rem; }
.totais .lin { display: flex; justify-content: space-between; margin-bottom: .3rem; }
.totais .total { font-size: 1.6rem; font-weight: 800; }
.vazio { text-align: center; color: var(--suave); padding: 2rem 1rem; }
.vazio .ic { font-size: 2.2rem; display: block; margin-bottom: .4rem; }
.barra-caixa { display: flex; align-items: center; gap: .75rem; justify-content: space-between; flex-wrap: wrap; }

@media (max-width: 1060px) {
  .pdv { grid-template-columns: minmax(0, 1fr); }
  .carrinho { position: static; max-height: none; }
  .carrinho-flutuante { position: fixed; left: .75rem; right: .75rem; bottom: 4.6rem; z-index: 25; }
}
@media (min-width: 1061px) { .carrinho-flutuante { display: none !important; } }

/* formas de pagamento */
.formas { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.forma { border: 2px solid var(--borda); border-radius: 12px; background: #fff; padding: .8rem .5rem; cursor: pointer; font-weight: 700; text-align: center; }
.forma .ic { display: block; font-size: 1.5rem; margin-bottom: .2rem; }
.forma.ativo { border-color: var(--laranja); background: var(--laranja-claro); }
.troco { font-size: 1.3rem; font-weight: 800; color: var(--verde); }

/* ====================== modal ====================== */
.fundo-modal { position: fixed; inset: 0; background: rgba(14,16,20,.55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: calc(100vh - 2rem); display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal.largo { max-width: 760px; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem .5rem; }
.modal header h3 { margin: 0; }
.modal .corpo { padding: .5rem 1.1rem 1rem; overflow-y: auto; }
.modal footer { padding: .8rem 1.1rem 1rem; display: flex; gap: .5rem; justify-content: flex-end; border-top: 1px solid var(--borda); flex-wrap: wrap; }
@media (max-width: 600px) {
  .fundo-modal { align-items: flex-end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
}

/* toast */
#toasts { position: fixed; top: 70px; right: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .5rem; max-width: calc(100vw - 2rem); }
.toast { background: var(--grafite); color: #fff; padding: .75rem 1rem; border-radius: 10px; box-shadow: var(--sombra); font-weight: 600;
  animation: entra .2s ease-out; max-width: 380px; }
.toast.erro { background: var(--vermelho); }
.toast.ok { background: var(--verde); }
@keyframes entra { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ====================== login / cadastro ====================== */
.tela-entrada { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.entrada-lado { background: var(--grafite); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.entrada-lado .marca { font-size: 2.6rem; }
.entrada-lado h1 { font-size: 2rem; margin: 1.5rem 0 1rem; max-width: 30rem; }
.entrada-lado p { color: #c9ccd3; max-width: 30rem; line-height: 1.55; }
.entrada-lado ul { padding: 0; list-style: none; margin: 1.5rem 0 0; }
.entrada-lado li { margin: .55rem 0; color: #e5e7eb; }
.entrada-lado li::before { content: '✓'; color: var(--laranja); font-weight: 800; margin-right: .6rem; }
.entrada-lado .rodape { position: absolute; bottom: 1.2rem; left: 3rem; font-size: .8rem; color: #8b909a; }
.entrada-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.entrada-form .caixa-form { width: 100%; max-width: 440px; }
.abas { display: flex; background: #eceef2; border-radius: 12px; padding: 4px; margin-bottom: 1.25rem; }
.abas button { flex: 1; border: 0; background: transparent; padding: .6rem; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--suave); }
.abas button.ativo { background: #fff; color: var(--texto); box-shadow: var(--sombra); }
.segmentos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .5rem; }
.segmento { border: 2px solid var(--borda); background: #fff; border-radius: 12px; padding: .7rem .5rem; cursor: pointer; text-align: center; }
.segmento .ic { font-size: 1.7rem; display: block; }
.segmento .n { font-weight: 700; font-size: .82rem; display: block; margin-top: .3rem; line-height: 1.2; }
.segmento .q { font-size: .72rem; color: var(--suave); }
.segmento.ativo { border-color: var(--laranja); background: var(--laranja-claro); }
.passos { display: flex; gap: .4rem; margin-bottom: 1rem; }
.passos span { flex: 1; height: 4px; border-radius: 4px; background: var(--borda); }
.passos span.feito { background: var(--laranja); }
.prefixo { display: flex; align-items: stretch; }
.prefixo .pre { background: #eef0f3; border: 1px solid var(--borda); border-right: 0; border-radius: 10px 0 0 10px; padding: 0 .6rem;
  display: flex; align-items: center; font-size: .85rem; color: var(--suave); white-space: nowrap; }
.prefixo .entrada { border-radius: 0 10px 10px 0; }
@media (max-width: 860px) {
  .tela-entrada { grid-template-columns: 1fr; }
  .entrada-lado { padding: 1.5rem 1.25rem; }
  .entrada-lado h1 { font-size: 1.3rem; margin: .8rem 0 .4rem; }
  .entrada-lado ul, .entrada-lado .rodape, .entrada-lado p { display: none; }
}

/* bloqueio por PIN */
.tela-bloqueio { position: fixed; inset: 0; background: var(--grafite); z-index: 300; display: flex; align-items: center; justify-content: center; color: #fff; padding: 1rem; }
.tela-bloqueio .caixa-pin { text-align: center; width: 100%; max-width: 320px; }
.pin-pontos { display: flex; justify-content: center; gap: .7rem; margin: 1.2rem 0; }
.pin-pontos span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #6b7280; }
.pin-pontos span.cheio { background: var(--laranja); border-color: var(--laranja); }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.teclado button { height: 62px; border-radius: 14px; border: 0; background: var(--grafite-3); color: #fff; font-size: 1.4rem; font-weight: 700; cursor: pointer; }
.teclado button:active { background: var(--laranja); }

/* gráfico simples de barras */
.barras { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 1rem; }
.barras .b { flex: 1; background: var(--laranja); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.barras .b:hover { background: var(--grafite); }
.barras .b span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: .65rem; white-space: nowrap; color: var(--suave); display: none; }
.barras .b:hover span { display: block; }
.eixo { display: flex; gap: 4px; font-size: .65rem; color: var(--suave); margin-top: .3rem; }
.eixo span { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; }
.barra-h { display: flex; align-items: center; gap: .6rem; margin: .45rem 0; }
.barra-h .r { width: 110px; font-size: .85rem; font-weight: 600; flex-shrink: 0; }
.barra-h .trilho { flex: 1; background: #eef0f3; border-radius: 6px; height: 12px; overflow: hidden; }
.barra-h .trilho i { display: block; height: 100%; background: var(--laranja); border-radius: 6px; }
.barra-h .v { width: 110px; text-align: right; font-weight: 700; font-size: .85rem; }

/* assistente IA */
.chat { display: flex; flex-direction: column; gap: .8rem; min-height: 260px; }
.msg { max-width: 85%; padding: .75rem 1rem; border-radius: 14px; line-height: 1.5; }
.msg.usuario { align-self: flex-end; background: var(--grafite); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistente { align-self: flex-start; background: #fff; border: 1px solid var(--borda); border-bottom-left-radius: 4px; }
.msg.assistente ul { margin: .3rem 0; padding-left: 1.2rem; }
.msg p { margin: .3rem 0; }
.sugestoes { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.ia-selo { display: inline-flex; align-items: center; gap: 0; background: var(--grafite); color: #fff; border-radius: 999px; padding: .2rem .65rem; font-size: .78rem; font-weight: 700; }
.ia-selo b { color: var(--laranja); }
.digitando::after { content: '...'; animation: pontos 1s infinite steps(4); display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes pontos { from { width: 0; } to { width: 1.2em; } }

/* pedidos */
.pedidos-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; align-items: start; }
.pedido { border-left: 5px solid var(--borda); }
.pedido.novo { border-left-color: var(--laranja); }
.pedido.aceito { border-left-color: var(--azul); }
.pedido.pronto { border-left-color: var(--verde); }
.pedido .cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.pedido .acoes { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .7rem; }
.pedido ul { margin: .4rem 0; padding-left: 1.1rem; font-size: .9rem; }

/* lista de produtos (cadastro) */
.lista-prod { display: flex; flex-direction: column; }
.lp { display: grid; grid-template-columns: 48px 1fr auto auto; gap: .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--borda); }
.lp .mini-img { width: 48px; height: 48px; border-radius: 10px; background: #f1f2f4 center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.lp .n { font-weight: 600; }
@media (max-width: 600px) { .lp { grid-template-columns: 42px 1fr auto; } .lp .acoes-lp { grid-column: 1 / -1; display: flex; gap: .4rem; } }

/* cupom (impressão) */
#cupom { display: none; }
@media print {
  body > *:not(#cupom) { display: none !important; }
  #cupom { display: block; font-family: 'Courier New', monospace; font-size: 12px; width: 72mm; color: #000; }
  #cupom .c { text-align: center; }
  #cupom hr { border: 0; border-top: 1px dashed #000; }
  #cupom table { width: 100%; font-size: 12px; }
}
