/* Painel do ChefBot Web Cardápio */
:root {
  --cor: #d9472b;
  --cor-escura: #b5381f;
  --texto: #1f2328;
  --muted: #6b7280;
  --borda: #e5e7eb;
  --fundo: #f6f6f4;
  --cartao: #fff;
  --ok: #15803d;
  --ok-fundo: #e8f6ed;
  --erro: #b42318;
  --erro-fundo: #fdecea;
  --info-fundo: #eef4ff;
  --info: #1d4ed8;
  --raio: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texto); background: var(--fundo); }
a { color: var(--cor-escura); }
h1 { font-size: 1.5rem; margin: 0 0 .4rem; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.muted { color: var(--muted); }
.inline { display: inline; }
[hidden] { display: none !important; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 0; border-radius: 8px; padding: .6rem 1rem; font: inherit; font-weight: 600;
  background: var(--cor); color: #fff; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--cor-escura); }
.btn-sec { background: #fff; color: var(--texto); border: 1px solid var(--borda); }
.btn-sec:hover { background: #f3f4f6; }
.btn-perigo { background: #fff; color: var(--erro); border: 1px solid #f3c1bb; }
.btn-perigo:hover { background: var(--erro-fundo); }
.btn-peq { padding: .35rem .65rem; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--cor-escura); cursor: pointer; text-decoration: underline; }
.link.perigo { color: var(--erro); }

/* formulários */
.form { display: grid; gap: .8rem; margin: .8rem 0; }
.form label { display: grid; gap: .25rem; font-weight: 600; font-size: .9rem; }
.form label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
input, select, textarea { font: inherit; padding: .55rem .65rem; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: var(--texto); width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--cor) 35%, transparent); border-color: var(--cor); }
input.codigo { font-size: 1.6rem; letter-spacing: .3em; text-align: center; }
.grade-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.grade-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.grade-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.form-linha { margin: .4rem 0; }
@media (max-width: 760px) { .grade-2, .grade-3, .grade-4 { grid-template-columns: 1fr; } }

/* avisos */
.aviso { border-radius: 8px; padding: .7rem .9rem; margin: 0 0 1rem; white-space: normal; }
.aviso-ok { background: var(--ok-fundo); color: #14532d; }
.aviso-erro { background: var(--erro-fundo); color: var(--erro); }
.aviso-info { background: var(--info-fundo); color: #1e3a8a; }
.selo { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 99px; background: #eef0f3; color: #374151; }
.selo-ok { background: var(--ok-fundo); color: var(--ok); }
.selo-off { background: var(--erro-fundo); color: var(--erro); }

/* página simples (login) */
body.simples { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.cartao-central { background: #fff; width: 100%; max-width: 420px; padding: 1.6rem; border-radius: 14px; box-shadow: 0 6px 30px rgba(0,0,0,.07); }
.cartao-central pre { white-space: pre-wrap; font-size: .8rem; background: #f3f4f6; padding: .6rem; border-radius: 6px; }
.marca { display: inline-flex; gap: .35rem; align-items: baseline; color: var(--texto); text-decoration: none; margin-bottom: 1rem; }
.marca b { color: var(--cor); }
.marca span:last-child { color: var(--muted); }

/* painel */
.faixa-admin { background: #1f2937; color: #fff; padding: .45rem 1rem; font-size: .88rem; }
.faixa-admin .link { color: #fde68a; }
.topo { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; background: #fff; border-bottom: 1px solid var(--borda); position: sticky; top: 0; z-index: 20; }
.topo .marca { margin: 0; }
.topo-loja { font-weight: 700; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-botao { display: none; background: none; border: 1px solid var(--borda); border-radius: 8px; font-size: 1.2rem; padding: .2rem .6rem; cursor: pointer; }
.corpo { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.menu-lateral { background: #fff; border-right: 1px solid var(--borda); padding: 1rem .6rem; display: flex; flex-direction: column; gap: .15rem; }
.menu-lateral a, .menu-lateral .sair { display: block; padding: .55rem .75rem; border-radius: 8px; color: var(--texto); text-decoration: none; text-align: left; }
.menu-lateral a:hover { background: #f3f4f6; }
.menu-lateral a.ativo { background: color-mix(in srgb, var(--cor) 12%, #fff); color: var(--cor-escura); font-weight: 700; }
.menu-lateral form { margin-top: auto; }
.menu-lateral .sair { color: var(--muted); text-decoration: none; width: 100%; }
.conteudo { padding: 1.4rem; min-width: 0; }
@media (max-width: 860px) {
  .menu-botao { display: block; }
  .topo-loja { display: none; }
  .topo .btn { margin-left: auto; }
  .corpo { grid-template-columns: 1fr; }
  .menu-lateral { display: none; border-right: 0; border-bottom: 1px solid var(--borda); }
  .menu-lateral.aberto { display: flex; }
  .conteudo { padding: 1rem; }
}

.cartao { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1.1rem; margin: 0 0 1rem; }
details.cartao > summary { cursor: pointer; }
.tabela-rolagem { overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); overflow: hidden; }
.tabela th, .tabela td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--borda); vertical-align: top; }
.tabela th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafafa; }
.tabela tr.apagado td { opacity: .55; }
.tabela .acoes { white-space: nowrap; text-align: right; }
.usuario-linha { margin-bottom: .2rem; }
.pequeno { font-size: .82rem; }
.botoes { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.categoria-topo { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.categoria-topo h2 { margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.categoria.pausada { background: #fafafa; }
.editar-categoria { margin: .2rem 0 .8rem; }
.editar-categoria > summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.tabela.produtos td { vertical-align: middle; }
.tabela.produtos td:nth-child(2) { width: 100%; min-width: 180px; }
.tabela.produtos .precos { white-space: normal; min-width: 150px; }
.precos span { white-space: nowrap; display: inline-block; margin-right: .5rem; }
@media (max-width: 1100px) {
  .tabela.produtos, .tabela.produtos tbody { display: block; }
  .tabela.produtos tr { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: .1rem .6rem; padding: .6rem 0; border-bottom: 1px solid var(--borda); }
  .tabela.produtos td { border: 0; padding: .15rem 0; width: auto !important; min-width: 0 !important; }
  .tabela.produtos td.miniatura { grid-row: span 3; }
  .tabela.produtos td.acoes { text-align: left; white-space: normal; }
  .tabela.produtos { border: 0; }
}
.miniatura { width: 60px; }
.miniatura img, .sem-foto { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: #f3f4f6; font-size: 1.4rem; }
.precos { white-space: nowrap; font-size: .9rem; }
.lista-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .35rem .9rem; }
.lista-checks .check { display: flex; gap: .45rem; align-items: flex-start; font-weight: 400; }
.lista-checks input { margin-top: .25rem; }
.foto-linha { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.foto-produto { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; }
select.multi { min-height: 12rem; }
.perigo-zona { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--borda); }
.vazio p { max-width: 60ch; }
.tabela.tamanhos, .tabela.opcoes { max-width: 640px; }
.tabela.tamanhos td, .tabela.opcoes td { padding: .35rem .5rem; }
.cabecalho-pagina { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cabecalho-pagina h1 { margin: 0; }

/* quadro de pedidos */
.quadro-topo p { margin: .2rem 0 0; }
.som-botao.som-off { background: var(--erro-fundo); color: var(--erro); border-color: #f3c1bb; }
.som-botao.pisca { animation: pisca 1s steps(2, start) infinite; }
@keyframes pisca { to { visibility: hidden; } }
.faixa-push { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.quadro { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: .8rem; align-items: start; }
.coluna { background: #eeeeea; border-radius: var(--raio); padding: .6rem; min-width: 0; }
.coluna h2 { font-size: .95rem; margin: .1rem .2rem .6rem; display: flex; align-items: center; gap: .4rem; }
.contador { background: #fff; border-radius: 99px; padding: 0 .5rem; font-size: .8rem; color: var(--muted); }
.col-novo .contador { background: var(--cor); color: #fff; }
.coluna-corpo { display: grid; gap: .6rem; max-height: calc(100vh - 210px); overflow-y: auto; padding: 2px; }
.coluna-vazia { color: var(--muted); font-size: .88rem; margin: .4rem .2rem 1rem; }
.pedido { background: #fff; border: 1px solid var(--borda); border-left: 4px solid #9ca3af; border-radius: 8px; padding: .65rem .7rem; font-size: .92rem; }
.pedido p { margin: .2rem 0; }
.pedido header { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.pedido .num { font-size: 1.1rem; }
.pedido .hora { margin-left: auto; color: var(--muted); font-size: .82rem; }
.pedido.st-novo { border-left-color: var(--cor); }
.pedido.st-preparo { border-left-color: #d97706; }
.pedido.st-saiu { border-left-color: var(--info); }
.pedido.st-entregue { border-left-color: var(--ok); opacity: .85; }
.pedido.st-cancelado { border-left-color: #6b7280; opacity: .7; }
.pedido.chegou { animation: chegou 1.2s ease-in-out 3; }
@keyframes chegou { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--cor) 35%, transparent); } }
.pedido.atrasado .hora { color: var(--erro); font-weight: 700; }
.selo-entrega { background: #e0ecff; color: #1e3a8a; }
.selo-retirada { background: #fef3c7; color: #92400e; }
.cancelado-aviso { color: var(--erro); font-weight: 700; }
.feito-aviso { color: var(--ok); font-weight: 600; }
.pedido .cliente a { color: inherit; }
.pedido details > summary { cursor: pointer; color: var(--cor-escura); font-size: .88rem; margin: .3rem 0; }
.pedido .itens { list-style: none; padding: 0; margin: .3rem 0; display: grid; gap: .35rem; }
.pedido .itens small { display: block; color: var(--muted); padding-left: 1.6rem; }
.pedido .obs { background: #fffbeb; border-radius: 6px; padding: .3rem .45rem; }
.acoes-pedido { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .5rem; }
.btn-whats { color: #128c4a; border-color: #b7e4c7; }
.acoes-pedido details.mais { margin-left: auto; position: relative; }
.acoes-pedido details.mais > summary { list-style: none; color: var(--muted); margin: 0; }
.acoes-pedido details.mais > summary::-webkit-details-marker { display: none; }
.acoes-pedido details.mais > div { position: absolute; right: 0; top: 1.6rem; z-index: 5; background: #fff; border: 1px solid var(--borda); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: .5rem .7rem; display: grid; gap: .45rem; min-width: 210px; text-align: left; }
@media (max-width: 1100px) {
  .quadro { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(270px, 86vw); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
  .coluna { scroll-snap-align: start; }
  .coluna-corpo { max-height: none; }
}

/* loja e horários */
.situacao-loja { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; border-left: 4px solid var(--ok); }
.situacao-loja.fechada { border-left-color: var(--erro); background: #fffafa; }
.situacao-loja p { margin: .2rem 0 0; }
.tabela.horarios { max-width: 720px; }
.tabela.horarios td { vertical-align: middle; padding: .4rem .6rem; }
.horarios .faixa { white-space: nowrap; }
.horarios .faixa input { width: 7.2rem; display: inline-block; }
.horarios .faixa span { color: var(--muted); margin: 0 .25rem; }
.barra-salvar { position: sticky; bottom: 0; background: color-mix(in srgb, var(--fundo) 92%, transparent); padding: .7rem 0; border-top: 1px solid var(--borda); z-index: 4; }

/* entrega */
.campo-curto { max-width: 260px; }
.tabela.bairros { max-width: 760px; }
.tabela.bairros td { vertical-align: middle; padding: .35rem .5rem; }
.tabela.bairros input.taxa { width: 7rem; }
.alinhar-topo { align-items: start; }

.maiusculas { text-transform: uppercase; }
.codigo-cupom { font-family: ui-monospace, Consolas, monospace; letter-spacing: .03em; }

/* relatórios */
.filtros { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.periodo-livre input { width: auto; padding: .35rem .5rem; }
.numeros { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; margin: .8rem 0 1rem; }
.numero { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: .9rem 1rem; display: grid; gap: .15rem; }
.numero > span:first-child { color: var(--muted); font-size: .85rem; }
.numero b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.var { font-size: .8rem; color: var(--muted); }
.var.sobe { color: var(--ok); }
.var.desce { color: var(--erro); }
.grafico { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem; height: 240px; padding-bottom: 1.4rem; }
.grafico-eixo { display: flex; flex-direction: column; justify-content: space-between; font-size: .72rem; color: var(--muted); text-align: right; padding-bottom: .1rem; }
.grafico-barras { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; align-items: end; height: 100%;
  border-bottom: 1px solid #d1d5db; background: linear-gradient(to bottom, #eef0f2 1px, transparent 1px) 0 0 / 100% 50%; }
.barra { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.barra i { display: block; width: min(100%, 28px); min-height: 0; background: #2a78d6; border-radius: 4px 4px 0 0; }
.barra:hover i, .barra:focus i { background: #1d5fae; }
.barra small { position: absolute; top: 100%; margin-top: .25rem; font-size: .68rem; color: var(--muted); white-space: nowrap; }
.grafico-barras:has(> .barra:nth-child(15)) .barra:not(:nth-child(4n+1)) small { display: none; }
[data-dica]:hover::after, [data-dica]:focus::after { content: attr(data-dica); position: absolute; z-index: 10; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #1f2328; color: #fff; font-size: .78rem; padding: .35rem .55rem; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.tabela-dados { margin-top: .6rem; }
.tabela-dados > summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.grade-relatorio { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 1rem; align-items: start; }
.tabela.compacta th, .tabela.compacta td { padding: .4rem .55rem; }
.tabela .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.espaco-topo { margin-top: 1.2rem; }
.horas { display: grid; gap: 3px; }
.hora-linha { position: relative; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) 2rem; align-items: center; gap: .4rem; font-size: .8rem; outline: none; }
.hora-linha span { color: var(--muted); }
.hora-linha i { display: block; height: 12px; background: #2a78d6; border-radius: 0 4px 4px 0; min-width: 0; }
.hora-linha b { font-weight: 600; font-variant-numeric: tabular-nums; }
.hora-linha[data-dica]:hover::after, .hora-linha[data-dica]:focus::after { left: 60%; }

/* visual e QR code */
.qr-bloco { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.qr-bloco > div { flex: 1 1 220px; }
.qr-bloco p { margin: 0 0 .6rem; }
.qr-bloco a { word-break: break-all; }
.qr-previa { width: 170px; height: 170px; border: 1px solid var(--borda); border-radius: 8px; image-rendering: pixelated; }
.campo-prefixo { display: flex; align-items: stretch; border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; background: #fff; }
.campo-prefixo span { padding: .55rem .5rem; background: #f3f4f6; color: var(--muted); font-weight: 400; white-space: nowrap; }
.campo-prefixo input { border: 0; border-radius: 0; min-width: 0; }
.amostra-cor { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--borda); cursor: pointer; }
.amostra-cor.atual { box-shadow: 0 0 0 3px var(--texto); }
.seletor-cor { width: 52px; height: 38px; padding: 2px; }
.previa-logo { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 1px solid var(--borda); }
.previa-capa { width: 100%; max-height: 160px; object-fit: cover; border-radius: 8px; }
.arquivo { width: auto; max-width: 100%; }
