/* BarFácil — feito para celular, letras grandes e botões fáceis de tocar */
:root {
  --azul: #0e7490;
  --azul-escuro: #155e75;
  --azul-claro: #e0f2f7;
  --sol: #f59e0b;
  --sol-claro: #fef3c7;
  --verde: #15803d;
  --verde-claro: #dcfce7;
  --vermelho: #b91c1c;
  --vermelho-claro: #fee2e2;
  --texto: #1c1917;
  --texto-2: #57534e;
  --borda: #d6d3d1;
  --fundo: #f6f4ef;
  --branco: #ffffff;
  --raio: 14px;
  --sombra: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
  font-size: 18px;
}
html.letra-grande { font-size: 21px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--texto);
  background: var(--fundo);
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
body.area-painel { padding-bottom: 84px; }
a { color: var(--azul-escuro); }
h1 { font-size: 1.5rem; margin: .2em 0 .6em; }
h2 { font-size: 1.25rem; margin: .2em 0 .6em; }
h3 { font-size: 1.08rem; margin: .2em 0 .5em; }
p { margin: .4em 0 .8em; }
.mudo { color: var(--texto-2); font-size: .9rem; }
.centro { text-align: center; }
.direita { text-align: right; }
.grande { font-size: 1.6rem; font-weight: 800; }
.oculto { display: none !important; }
hr { border: 0; border-top: 1px solid var(--borda); margin: 1rem 0; }

/* ---------- Topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .5rem;
  background: var(--azul); color: #fff;
  padding: .55rem 16px; padding-top: max(.55rem, env(safe-area-inset-top));
}
.topo-admin { background: #292524; }
.topo-nome { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.05rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pilula { border-radius: 99px; padding: .25rem .75rem; font-weight: 700; font-size: .85rem; text-decoration: none; white-space: nowrap; }
.pilula-aberto { background: #bbf7d0; color: #14532d; }
.pilula-fechado { background: #fecaca; color: #7f1d1d; }
.btn-letra { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 10px; font-weight: 800; font-size: .95rem; padding: .35rem .6rem; cursor: pointer; }

.abas-admin { display: flex; gap: .25rem; overflow-x: auto; background: #44403c; padding: .35rem 16px; }
.abas-admin a { color: #e7e5e4; text-decoration: none; padding: .45rem .7rem; border-radius: 10px; white-space: nowrap; font-size: .9rem; }
.abas-admin a.ativo { background: #fff; color: var(--texto); font-weight: 700; }

.conteudo { max-width: 760px; margin: 0 auto; padding: 16px; }
.conteudo.largo { max-width: 1100px; }

/* ---------- Menu de baixo (painel) ---------- */
.menu-baixo {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; background: #fff; border-top: 1px solid var(--borda);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.menu-baixo a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: .45rem 0 .5rem; text-decoration: none; color: var(--texto-2); font-size: .78rem; font-weight: 600;
  position: relative; min-height: 64px;
}
.menu-baixo a .ic { font-size: 1.55rem; line-height: 1.1; }
.menu-baixo a.ativo { color: var(--azul); }
.menu-baixo a.ativo::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; background: var(--azul); border-radius: 0 0 3px 3px; }
.contador { position: absolute; top: 4px; left: 54%; background: var(--vermelho); color: #fff; border-radius: 99px; font-size: .72rem; min-width: 1.3rem; height: 1.3rem; display: flex; align-items: center; justify-content: center; padding: 0 .3rem; }

/* ---------- Cartões e listas ---------- */
.cartao { background: var(--branco); border-radius: var(--raio); padding: 1rem; box-shadow: var(--sombra); margin-bottom: 1rem; }
.cartao > :last-child { margin-bottom: 0; }
.cartao-titulo { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.cartao-titulo h2, .cartao-titulo h3 { margin: 0; }

.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid #ece9e4; }
.lista > li:last-child { border-bottom: 0; }
.lista .cresce { flex: 1; min-width: 0; }
.lista .nome { font-weight: 650; }

.grade { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grade-2 { display: grid; gap: .75rem; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
@media (max-width: 420px) { .grade-2.empilha { grid-template-columns: 1fr; } }

.numeros { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 1rem; }
.numero { background: #fff; border-radius: var(--raio); padding: .8rem 1rem; box-shadow: var(--sombra); }
.numero small { display: block; color: var(--texto-2); font-size: .82rem; font-weight: 600; }
.numero b { font-size: 1.35rem; }

.etiqueta { display: inline-block; border-radius: 99px; padding: .1rem .55rem; font-size: .78rem; font-weight: 700; background: #eee; color: #333; white-space: nowrap; }
.etiqueta.verde { background: var(--verde-claro); color: #14532d; }
.etiqueta.vermelha { background: var(--vermelho-claro); color: #7f1d1d; }
.etiqueta.amarela { background: var(--sol-claro); color: #78350f; }
.etiqueta.azul { background: var(--azul-claro); color: var(--azul-escuro); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 52px; padding: .6rem 1.2rem; border-radius: 12px; border: 0;
  background: var(--azul); color: #fff; font: inherit; font-weight: 750; text-decoration: none;
  cursor: pointer; text-align: center; touch-action: manipulation;
}
.btn:active { transform: translateY(1px); filter: brightness(.95); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-sec { background: #fff; color: var(--azul-escuro); box-shadow: inset 0 0 0 2px var(--azul); }
.btn-verde { background: var(--verde); }
.btn-vermelho { background: var(--vermelho); }
.btn-sol { background: var(--sol); color: #3b2300; }
.btn-claro { background: #f0eeea; color: var(--texto); }
.btn-pq { min-height: 42px; padding: .4rem .8rem; font-size: .9rem; border-radius: 10px; }
.btn-bloco { display: flex; width: 100%; }
.btn-enorme { min-height: 68px; font-size: 1.2rem; width: 100%; }
.botoes { display: flex; flex-wrap: wrap; gap: .5rem; }
.botoes > .btn { flex: 1 1 auto; }
.link-btn { background: none; border: 0; color: var(--azul-escuro); text-decoration: underline; font: inherit; cursor: pointer; padding: 0; }

/* ---------- Formulários ---------- */
label { display: block; font-weight: 650; margin: .8rem 0 .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=search], input[type=url], select, textarea {
  width: 100%; font: inherit; padding: .7rem .8rem; min-height: 52px;
  border: 2px solid var(--borda); border-radius: 12px; background: #fff; color: var(--texto);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-claro); }
textarea { min-height: 90px; }
.obrig { color: var(--vermelho); }
.ajuda { font-size: .85rem; color: var(--texto-2); margin-top: .25rem; }
.check { display: flex; align-items: center; gap: .65rem; font-weight: 600; margin: .8rem 0; cursor: pointer; }
.check input { width: 26px; height: 26px; accent-color: var(--azul); flex: none; }
.opcoes-radio { display: grid; gap: .5rem; }
.opcoes-radio label { display: flex; gap: .7rem; align-items: flex-start; border: 2px solid var(--borda); border-radius: 12px; padding: .75rem; margin: 0; cursor: pointer; font-weight: 500; }
.opcoes-radio label:has(input:checked) { border-color: var(--azul); background: var(--azul-claro); }
.opcoes-radio input { width: 24px; height: 24px; margin-top: .1rem; accent-color: var(--azul); flex: none; }
.opcoes-radio b { display: block; }

.campo-busca { position: relative; }
.sugestoes { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 2px solid var(--azul); border-top: 0; border-radius: 0 0 12px 12px; max-height: 320px; overflow-y: auto; box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.sugestoes button { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #eee; padding: .7rem .8rem; font: inherit; cursor: pointer; }
.sugestoes button:hover, .sugestoes button:focus { background: var(--azul-claro); }
.sugestoes .preco { margin-left: auto; color: var(--texto-2); font-size: .9rem; white-space: nowrap; }

/* ---------- Alertas ---------- */
.alerta { border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.alerta-ok { background: var(--verde-claro); color: #14532d; }
.alerta-erro { background: var(--vermelho-claro); color: #7f1d1d; }
.alerta-aviso { background: var(--sol-claro); color: #78350f; }
.alerta-info { background: var(--azul-claro); color: var(--azul-escuro); }

.aviso-novo { position: sticky; top: 52px; z-index: 29; background: var(--sol); color: #3b2300; font-weight: 800; padding: .8rem 16px; text-align: center; cursor: pointer; animation: pisca 1s ease-in-out 3; }
@keyframes pisca { 50% { filter: brightness(1.15); } }

/* ---------- Abrir / fechar bar ---------- */
.chave-bar { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: var(--raio); margin-bottom: 1rem; color: #fff; }
.chave-bar.aberto { background: var(--verde); }
.chave-bar.fechado { background: #57534e; }
.chave-bar .texto { flex: 1; }
.chave-bar .texto b { display: block; font-size: 1.25rem; }
.chave-bar .btn { background: #fff; color: var(--texto); min-width: 120px; }

/* ---------- Pedidos (painel) ---------- */
.pedido { background: #fff; border-radius: var(--raio); box-shadow: var(--sombra); margin-bottom: .9rem; overflow: hidden; border-left: 8px solid var(--borda); }
.pedido.st-novo { border-left-color: var(--sol); }
.pedido.st-preparando { border-left-color: var(--azul); }
.pedido.st-aguardando_pagamento { border-left-color: #a8a29e; opacity: .85; }
.pedido-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; padding: .8rem 1rem .3rem; }
.pedido-local { font-size: 1.25rem; font-weight: 800; }
.pedido-itens { list-style: none; margin: 0; padding: .2rem 1rem .6rem; font-size: 1.05rem; }
.pedido-itens li { padding: .15rem 0; }
.pedido-itens b { display: inline-block; min-width: 2.1rem; }
.pedido-rodape { display: flex; gap: .5rem; padding: .6rem 1rem .9rem; flex-wrap: wrap; align-items: center; }
.pedido-rodape .btn { flex: 1 1 140px; }
.obs { background: var(--sol-claro); border-radius: 8px; padding: .4rem .6rem; margin: 0 1rem .5rem; font-weight: 600; }

.filtro-abas { display: flex; gap: .4rem; overflow-x: auto; margin-bottom: 1rem; padding-bottom: .2rem; }
.filtro-abas a, .filtro-abas button { white-space: nowrap; text-decoration: none; padding: .5rem .9rem; border-radius: 99px; background: #fff; color: var(--texto); font-weight: 650; box-shadow: var(--sombra); border: 0; font: inherit; cursor: pointer; }
.filtro-abas .ativo { background: var(--azul); color: #fff; }

/* ---------- Produtos / venda rápida ---------- */
.prod-ic { font-size: 1.9rem; width: 2.6rem; height: 2.6rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.prod-ic.foto { object-fit: cover; border-radius: 10px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: #fff; border: 2px solid transparent; border-radius: var(--raio); box-shadow: var(--sombra);
  padding: .7rem .5rem; min-height: 120px; font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; user-select: none;
}
.tile:active { transform: scale(.98); }
.tile .prod-ic { font-size: 2.3rem; width: 3rem; height: 3rem; }
.tile .t-nome { font-weight: 650; font-size: .92rem; line-height: 1.2; margin: .3rem 0 .15rem; }
.tile .t-preco { font-weight: 800; color: var(--azul-escuro); }
.tile .t-estoque { font-size: .75rem; color: var(--texto-2); }
.tile.sel { border-color: var(--verde); background: #f0fdf4; }
.tile .qtd-sel { position: absolute; top: 6px; right: 6px; background: var(--verde); color: #fff; border-radius: 99px; min-width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.tile.esgotado { opacity: .45; }
.tile .menos { position: absolute; top: 6px; left: 6px; width: 2rem; height: 2rem; border-radius: 99px; background: var(--vermelho); color: #fff; border: 0; font-weight: 800; font-size: 1.2rem; line-height: 1; cursor: pointer; }

.barra-total {
  position: fixed; left: 0; right: 0; bottom: 64px; z-index: 35; background: var(--texto); color: #fff;
  display: flex; align-items: center; gap: .75rem; padding: .7rem 16px; padding-bottom: calc(.7rem + env(safe-area-inset-bottom));
}
.area-cliente .barra-total { bottom: 0; }
.barra-total .total { flex: 1; }
.barra-total .total small { display: block; opacity: .8; font-size: .8rem; }
.barra-total .total b { font-size: 1.35rem; white-space: nowrap; }
.barra-total .btn { min-width: 150px; }

.qtd { display: inline-flex; align-items: center; gap: .3rem; }
.qtd button { width: 46px; height: 46px; border-radius: 12px; border: 0; font-size: 1.5rem; font-weight: 800; cursor: pointer; background: var(--azul-claro); color: var(--azul-escuro); touch-action: manipulation; }
.qtd button.mais { background: var(--azul); color: #fff; }
.qtd span { min-width: 2rem; text-align: center; font-weight: 800; font-size: 1.15rem; }

.estoque-num { font-weight: 800; font-size: 1.15rem; min-width: 3rem; text-align: center; }
.estoque-num.baixo { color: var(--vermelho); }

/* ---------- Cliente ---------- */
.area-cliente { padding-bottom: 96px; background: #fbfaf7; }
.capa { background: linear-gradient(160deg, var(--azul) 0%, #0891b2 60%, #22a6b3 100%); color: #fff; padding: 1.2rem 16px 1.5rem; position: relative; overflow: hidden; }
.capa::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, #fcd34d 0 45%, transparent 46%); opacity: .9; }
.capa h1 { margin: 0; font-size: 1.6rem; position: relative; z-index: 1; max-width: 80%; }
.capa .local { display: inline-block; margin-top: .4rem; background: rgba(255,255,255,.2); border-radius: 99px; padding: .2rem .8rem; font-weight: 700; position: relative; z-index: 1; }
.cat-titulo { font-size: 1.1rem; margin: 1.3rem 0 .5rem; display: flex; align-items: center; gap: .4rem; }
.item-cardapio { display: flex; align-items: center; gap: .7rem; background: #fff; border-radius: var(--raio); padding: .7rem .8rem; box-shadow: var(--sombra); margin-bottom: .55rem; }
.item-cardapio .cresce { flex: 1; min-width: 0; }
.item-cardapio .nome { font-weight: 650; }
.item-cardapio .preco { color: var(--azul-escuro); font-weight: 800; }
.item-cardapio.esgotado { opacity: .5; }
.item-cardapio .btn-add { width: 52px; height: 52px; border-radius: 14px; border: 0; background: var(--azul); color: #fff; font-size: 1.7rem; font-weight: 800; cursor: pointer; }
.cats-rolagem { display: flex; gap: .4rem; overflow-x: auto; position: sticky; top: 0; z-index: 20; background: #fbfaf7; padding: .6rem 16px; margin: 0 -16px; }
.cats-rolagem a { white-space: nowrap; text-decoration: none; background: #fff; color: var(--texto); border-radius: 99px; padding: .45rem .85rem; font-weight: 650; box-shadow: var(--sombra); font-size: .9rem; }

.gaveta-fundo { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; }
.gaveta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: #fff; border-radius: 20px 20px 0 0; max-height: 92vh; overflow-y: auto; padding: 1rem 16px calc(1rem + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(0,0,0,.2); max-width: 760px; margin: 0 auto; }
.gaveta .fechar { float: right; background: #f0eeea; border: 0; border-radius: 99px; width: 44px; height: 44px; font-size: 1.3rem; cursor: pointer; }

.pix-qr { display: block; margin: .5rem auto; width: 240px; max-width: 80%; image-rendering: pixelated; border: 8px solid #fff; box-shadow: var(--sombra); border-radius: 8px; }
.copia-cola { word-break: break-all; font-family: ui-monospace, monospace; font-size: .75rem; background: #f5f5f4; padding: .6rem; border-radius: 8px; max-height: 90px; overflow: auto; }

.status-linha { display: flex; gap: .3rem; margin: .6rem 0; }
.status-linha span { flex: 1; height: 8px; border-radius: 99px; background: #e7e5e4; }
.status-linha span.ok { background: var(--verde); }

.fechado-grande { text-align: center; padding: 2.5rem 1rem; }
.fechado-grande .ic { font-size: 4rem; }

/* ---------- Telas de entrada ---------- */
.tela-entrada { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 16px; background: linear-gradient(180deg, var(--azul) 0 38%, var(--fundo) 38%); }
.tela-entrada .cartao { max-width: 440px; width: 100%; margin: 0 auto; padding: 1.4rem; }
.logo { text-align: center; color: #fff; margin-bottom: 1rem; }
.logo .ic { font-size: 3rem; }
.logo b { display: block; font-size: 1.7rem; }

/* ---------- Tabelas (relatórios/admin) ---------- */
.tabela-wrap { overflow-x: auto; }
table.tabela { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabela th, .tabela td { padding: .55rem .5rem; border-bottom: 1px solid #ece9e4; text-align: left; vertical-align: middle; }
.tabela th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--texto-2); }
.tabela td.num, .tabela th.num { text-align: right; white-space: nowrap; }

.barra-h { height: 12px; background: var(--azul-claro); border-radius: 99px; overflow: hidden; }
.barra-h span { display: block; height: 100%; background: var(--azul); border-radius: 99px; }

.atalhos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.atalhos a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; background: #fff; border-radius: var(--raio); box-shadow: var(--sombra); padding: 1rem .5rem; text-decoration: none; color: var(--texto); font-weight: 700; min-height: 110px; text-align: center; }
.atalhos a .ic { font-size: 2.2rem; }

/* ---------- Impressão dos QR-codes ---------- */
.folhas-qr { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.folha-qr { background: #fff; border: 2px dashed var(--borda); border-radius: 16px; padding: 1.2rem; text-align: center; page-break-inside: avoid; break-inside: avoid; }
.folha-qr .fq-bar { font-size: 1.3rem; font-weight: 800; }
.folha-qr .fq-chamada { font-size: 1.6rem; font-weight: 900; color: var(--azul-escuro); margin: .3rem 0; line-height: 1.1; }
.folha-qr .fq-qr svg { width: 220px; height: 220px; }
.folha-qr .fq-local { display: inline-block; background: var(--sol); color: #3b2300; font-weight: 900; font-size: 1.3rem; border-radius: 12px; padding: .3rem 1rem; margin-top: .4rem; }
.folha-qr .fq-passos { font-size: .9rem; color: var(--texto-2); margin-top: .6rem; }
@media print {
  .topo, .menu-baixo, .nao-imprimir, .aviso-novo, .alerta { display: none !important; }
  body { background: #fff; padding: 0 !important; }
  .conteudo { max-width: none; padding: 0; }
  .folhas-qr { display: block; }
  .folha-qr { border: 0; width: 100%; height: 100vh; display: flex; flex-direction: column; justify-content: center; page-break-after: always; break-after: page; }
  .folhas-qr.tamanho-meia .folha-qr { height: 50vh; border-bottom: 2px dashed #ccc; }
  .folha-qr .fq-chamada { font-size: 2.6rem; }
  .folha-qr .fq-bar { font-size: 2rem; }
  .folha-qr .fq-qr svg { width: 9cm; height: 9cm; }
  .folhas-qr.tamanho-meia .folha-qr .fq-qr svg { width: 6.5cm; height: 6.5cm; }
  .folhas-qr.tamanho-meia .folha-qr .fq-chamada { font-size: 1.9rem; }
  .folha-qr .fq-local { font-size: 2rem; }
  .folha-qr .fq-passos { font-size: 1.1rem; }
}
