/* Visual "Comando" (v4.0): barra de ícones + painel da área + busca Ctrl K + linha do tempo "Agora".
   Camada por cima do app.css. Os temas anteriores (tema.css, temas.css) estão em css/legado/ e não são mais carregados. */
:root {
  --bg: #fbfbfc; --surface: #fff; --surface-2: #f6f6f9; --ink: #14151a; --muted: #6b6d7a; --line: #e6e7ec;
  --accent: #5b5bd6; --accent-2: #eeeefb; --accent-ink: #3b3bb0;
  --ok: #1a7f4b; --ok-2: #e4f6ec; --warn: #b4540a; --warn-2: #fff3df; --danger: #c42b2b; --danger-2: #fdecec; --info: #1d5fa8; --info-2: #e6f0fa;
  --side: #14151a; --side-ink: #a9abb8; --radius: 12px; --radius-s: 8px;
  --shadow: none; --shadow-m: 0 8px 30px rgba(20,21,26,.14);
  --ring: 0 0 0 3px rgba(91,91,214,.22);
  --font: "Inter", -apple-system, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body { font-size: 13px; line-height: 1.5; background: var(--bg); color: var(--ink); }
h1 { font-size: 20px; letter-spacing: -.015em; font-weight: 700; }
h2 { font-size: 16px; } h3 { font-size: 11.5px; letter-spacing: .06em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(91,91,214,.2); }

/* ----- estrutura: barra de ícones | painel | conteúdo ----- */
.app { grid-template-columns: 64px 208px minmax(0, 1fr); }
.rail { background: var(--side); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 0; }
.rail-logo { width: 38px; height: 38px; border-radius: 11px; background: var(--accent); display: grid; place-items: center; margin-bottom: 12px; color: #fff; text-decoration: none; overflow: hidden; }
.rail-logo .logo { font-size: 19px; background: none; } .rail-logo img { width: 100%; height: 100%; object-fit: cover; }
.rail-a { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; color: var(--side-ink); background: none; border: 0; cursor: pointer; transition: background .12s, color .12s; text-decoration: none; }
.rail-a:hover { background: #23242e; color: #fff; }
.rail-a.on { background: #2b2c3a; color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.rail-esp { flex: 1; }
.painel { background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.painel-tit { font-weight: 700; font-size: 14px; padding: 0 8px 12px; letter-spacing: -.01em; }
.painel a { padding: 7px 9px; border-radius: 7px; color: #52545f; text-decoration: none; font-weight: 500; }
.painel a:hover { background: var(--surface-2); color: var(--ink); }
.painel a.on { background: var(--accent-2); color: var(--accent-ink); font-weight: 600; }
.painel-sec { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #8a8c99; padding: 16px 9px 6px; }
.painel-fim { margin-top: auto; padding-top: 16px; }
.side { display: none; }

/* ----- topo ----- */
.top { padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); gap: 12px; }
.top .titulo { font-weight: 600; font-size: 14px; min-width: 0; white-space: nowrap; }
.paleta-btn { display: flex; align-items: center; gap: 9px; height: 36px; width: min(420px, 38vw); border: 1px solid #dcdde4; border-radius: 9px; background: var(--bg); padding: 0 10px; color: var(--muted); font: inherit; cursor: pointer; margin-left: 10px; }
.paleta-btn:hover { border-color: #c4c6d2; background: #fff; }
.paleta-btn span { flex: 1; text-align: left; }
.paleta-btn kbd, .paleta-rod kbd { font: 600 11px var(--font); border: 1px solid #dcdde4; border-radius: 5px; padding: 1px 6px; background: #fff; color: var(--muted); }
#fav-btn { color: var(--muted); } #fav-btn.on { color: #d99a00; } #fav-btn.on svg { fill: currentColor; }
.view { padding: 22px 24px; max-width: none; }

/* ----- paleta de comandos ----- */
.paleta-bg { position: fixed; inset: 0; z-index: 70; background: rgba(20,21,26,.45); display: flex; justify-content: center; align-items: flex-start; padding: 14vh 16px 0; }
.paleta { width: 100%; max-width: 560px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-m); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.paleta input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; font-size: 16px; box-shadow: none !important; }
.paleta-lista { overflow-y: auto; padding: 6px; }
.paleta-i { display: flex; align-items: center; padding: 10px 12px; border-radius: 8px; cursor: pointer; gap: 12px; }
.paleta-i span { flex: 1; font-weight: 500; } .paleta-i small { color: var(--muted); }
.paleta-i.on, .paleta-i:hover { background: var(--accent-2); color: var(--accent-ink); }
.paleta-vazio { padding: 24px; text-align: center; color: var(--muted); }
.paleta-rod { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--surface-2); }

/* ----- cartões, KPIs, botões, campos (mais compactos e planos) ----- */
.card, .kpi { border-radius: var(--radius); border-color: var(--line); box-shadow: none; }
.card { padding: 16px 18px; } .card.p0 { padding: 0; }
.card.p0 > div[style*="padding:18px 18px 0"] { padding: 14px 18px 8px !important; }
.kpi { padding: 14px 16px; } .kpi .val { font-size: 22px; letter-spacing: -.02em; margin-top: 3px; } .kpi .rot { font-size: 11.5px; }
.btn { border-radius: var(--radius-s); padding: 7px 12px; font-weight: 600; font-size: 13px; box-shadow: none; }
.btn.pri { background: var(--accent); border-color: var(--accent); } .btn.pri:hover { filter: brightness(1.08); }
.btn.sm { padding: 4px 9px; font-size: 12px; } .btn.lg { padding: 11px 18px; font-size: 14px; border-radius: 10px; }
input, select, textarea { border-radius: var(--radius-s); padding: 7px 10px; border-color: #dcdde4; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
table.t th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--surface-2); padding: 8px 14px; }
table.t td { padding: 9px 14px; }
table.t tbody tr:hover { background: #f8f8fc; }
.tabs { gap: 2px; margin-bottom: 16px; }
.tabs button.on { color: var(--accent-ink); border-bottom-color: var(--accent); }
.tag { font-size: 11.5px; padding: 2px 9px; }
.tag.acc { background: var(--accent-2); color: var(--accent-ink); }
.modal { border-radius: 14px; box-shadow: var(--shadow-m); } .modal footer { background: var(--surface-2); border-radius: 0 0 14px 14px; }
.chart .bar { fill: var(--accent); } .chart .bar:hover { fill: #4545b8; }
.tw .chart { width: 100%; height: auto; min-width: 0 !important; display: block; }
@media (max-width: 700px) { .tw .chart { min-width: 420px !important; } }
.side a.on, .btn.pri { color: #fff; }
.login { background: radial-gradient(900px 500px at 10% 0, #e6e6fb 0, transparent 60%), var(--bg); min-height: 100vh; min-height: 100dvh; }
.login form { border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow-m); }
.brand .logo { background: var(--accent); }

/* ----- painel: coluna "Agora" ----- */
.dash { display: flex; gap: 22px; align-items: flex-start; }
.dash-main { flex: 1; min-width: 0; }
.agora { width: 280px; flex: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; position: sticky; top: 70px; max-height: calc(100vh - 92px); overflow-y: auto; }
.agora-cab { display: flex; align-items: center; margin-bottom: 8px; } .agora-cab b { flex: 1; font-size: 14px; }
.agora-vivo { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ok); }
.agora-vivo i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulsa 2s infinite; }
@keyframes pulsa { 50% { opacity: .3; } }
.ag-sec { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #8a8c99; padding: 12px 0 4px; }
.ag-i { display: flex; gap: 10px; padding: 8px 6px; margin: 0 -6px; border-radius: 8px; color: inherit; text-decoration: none; }
.ag-i:hover { background: var(--surface-2); }
.ag-h { width: 38px; flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.ag-urg .ag-h { color: var(--danger); font-weight: 700; }
.ag-t small { display: block; color: var(--muted); font-size: 11.5px; }
@media (max-width: 1280px) { .dash { flex-direction: column; } .agora { width: 100%; position: static; max-height: none; } }

/* ----- celular: sem barra de ícones; abas embaixo; menu completo em "Mais" ----- */
.abas { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
  .rail, .painel { display: none; }
  .side { display: flex; background: var(--side); border-radius: 0 16px 16px 0; width: 264px; }
  .top { padding: 9px 14px; } .paleta-btn { display: none; }
  .view { padding: 14px; } .view.full { padding: 0; }
  .abas { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--side); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .abas a, .abas button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: #9a9cab; font: 500 11px var(--font); text-decoration: none; background: none; border: 0; cursor: pointer; min-height: 44px; }
  .abas a.on { color: #fff; font-weight: 600; }
  .abas a.on svg { color: #fff; }
  .btn { min-height: 38px; } .btn.sm { min-height: 32px; }
  input, select, textarea { font-size: 16px; }
  .tabs { overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
  .modal-bg { align-items: end; padding: 0; } .modal { max-width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; } .modal footer { border-radius: 0; }
  .toasts { left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); } .toast { max-width: none; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .grid > *, .view > * { min-width: 0; }
  .top #sel-loja { min-width: 0 !important; max-width: 130px; }
}
.grid > * { min-width: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
#painel-lista, #painel-fav, #painel-rec { display: flex; flex-direction: column; gap: 2px; }
.dash-main .g3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.side .side-sec { margin: 14px 12px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #7d7f8d; }
.side { padding: 14px 10px; gap: 2px; overflow-y: auto; }
.side a { padding: 8px 10px; border-radius: 9px; }
.side a:hover { background: #23242e; } .side a.on { background: var(--accent); }
@media (max-width: 860px) { .app.sem-abas { padding-bottom: 0; } .app.sem-abas .abas { display: none; } .app.sem-abas .toasts { bottom: 12px; } }

/* v4.0.1: ícones com nome embaixo, sem "Recentes", dica nos favoritos */
.app { grid-template-columns: 76px 208px minmax(0, 1fr); }
.rail { gap: 2px; padding: 12px 0; }
.rail-a { width: 64px; height: 54px; flex-direction: column; gap: 3px; align-content: center; justify-items: center; display: flex; align-items: center; justify-content: center; }
.rail-a span { font-size: 10.5px; font-weight: 600; line-height: 1; letter-spacing: .01em; }
.rail-a.on { box-shadow: none; background: #2b2c3a; color: #fff; }
.rail-a.on::before { content: ""; position: absolute; left: 0; width: 3px; height: 26px; border-radius: 0 3px 3px 0; background: var(--accent); }
.rail-a { position: relative; }
.painel-tit { font-size: 15px; padding-bottom: 14px; }
.painel-dica { padding: 4px 9px; color: var(--muted); font-size: 12px; line-height: 1.45; }

/* v4.1: uma coluna só (as áreas viram sanfona) */
.app { grid-template-columns: 236px minmax(0, 1fr); }
.rail { display: none; }
.painel { background: var(--side); border-right: 0; color: var(--side-ink); padding: 14px 10px; gap: 0; }
.painel-marca { display: block; text-decoration: none; padding: 2px 6px 14px; }
.painel .brand { color: #fff; padding: 0; font-size: 15px; }
.painel #painel-fav, .painel #painel-areas { display: flex; flex-direction: column; gap: 1px; }
.painel .painel-sec { color: #7d7f8d; padding: 10px 10px 5px; }
.painel a { color: #c3c5d1; padding: 7px 10px 7px 38px; border-radius: 8px; font-weight: 500; }
.painel #painel-fav a { padding-left: 10px; }
.painel a:hover { background: #23242e; color: #fff; }
.painel a.on { background: var(--accent); color: #fff; font-weight: 600; }
.pa-cab { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: none; color: #c3c5d1; padding: 9px 10px; border-radius: 9px; cursor: pointer; font: 600 13px var(--font); text-align: left; }
.pa-cab:hover { background: #23242e; color: #fff; }
.pa-cab span { flex: 1; }
.pa-seta { transition: transform .15s; color: #7d7f8d; }
.pa-cab.open .pa-seta { transform: rotate(90deg); }
.pa.atual > .pa-cab { color: #fff; }
.pa-itens { display: flex; flex-direction: column; gap: 1px; margin: 1px 0 6px; }
.painel-fim { margin-top: auto; padding-top: 14px; border-top: 1px solid #272835; display: flex; flex-direction: column; gap: 1px; }
.painel-bt { display: flex; align-items: center; gap: 11px; border: 0; background: none; color: #a9abb8; padding: 8px 10px; border-radius: 9px; cursor: pointer; font: 500 13px var(--font); text-align: left; }
.painel-bt:hover { background: #23242e; color: #fff; }
.painel-fim .powered { padding: 10px 6px 0; filter: brightness(1.6) saturate(.6); }
@media (max-width: 860px) { .painel { display: none; } .app { grid-template-columns: minmax(0, 1fr); } }
.painel-fim { flex-direction: row; flex-wrap: wrap; gap: 4px; }
.painel-bt { flex: 1 1 0; justify-content: center; padding: 8px 6px; gap: 7px; }
.painel-fim .powered { width: 100%; }

/* Notas fiscais (v4.6): segundo nível de navegação e descrição do grupo */
.nf-sub { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 10px; }
.nf-sub:empty { display: none; }
.nf-sub button { border: 1px solid var(--line); background: var(--card, #fff); color: var(--muted); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 13px; cursor: pointer; }
.nf-sub button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.nf-desc { color: var(--muted); font-size: 13px; margin: 0 0 14px; max-width: 70ch; }
.nf-desc:empty { display: none; }

/* Configuração fiscal (v4.7): um painel por assunto */
.cfg-pane[hidden] { display: none; }
.cfg-ponto { color: var(--warn, #b45309); font-size: 11px; margin-left: 2px; }
#cfg-sub { margin: 0 0 14px; }

/* ===== PDV (v4.8): lateral limpa, abas sem rolagem, lançamento compacto, barras de rolagem discretas ===== */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
.tabs, .chips, .lanca-barra { scrollbar-width: none; }
.tabs::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.pdv-lado .lista, .prods, .comanda .itens { scrollbar-gutter: stable; }

.pdv-topo { padding: 12px 12px 0; }
.novo-tit { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.pdv-topo .acoes-novo, .pdv-lado .pdv-topo .acoes-novo { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 0; }
.pdv-topo .acoes-novo .btn { padding: 9px 0; font-size: 12px; letter-spacing: -.01em; font-weight: 600; justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acoes-sec { display: flex; gap: 6px; margin: 6px 0 10px; }
.acoes-sec .btn { flex: 1; font-size: 12px; color: var(--muted); background: transparent; justify-content: center; white-space: nowrap; }
.pdv-faixa { padding: 0 0 10px; gap: 4px; }
.pdv-faixa .tag { font-size: 11.5px; padding: 3px 8px; }
.pdv-topo { border-bottom: 0; }

#pdv-abas { display: flex; padding: 0 12px; border-bottom: 1px solid var(--line); overflow: visible; margin: 0; }
#pdv-abas button { flex: 1 1 0; padding: 10px 2px; font-size: 13px; white-space: nowrap; text-align: center; }
#pdv-abas button span:empty { display: none; }

.mapa-resumo { gap: 2px 10px; font-size: 11.5px; }
.pdv-lado .lista { padding: 10px 12px; }
.mesas { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }

/* centro: busca, lançamento e produtos */
.catalogo { gap: 10px; padding: 12px; }
.lanca-barra { gap: 6px 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2, transparent); }
.lanca-barra .grp { flex-wrap: wrap; }
.lanca-barra button { height: 30px; min-width: 30px; }
#cats { margin: 0 -12px; padding: 0 12px 2px; }
#cats button { padding: 5px 12px; font-size: 13px; }
.prods { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.prod { padding: 10px 11px; min-height: 66px; gap: 4px; }
.prod b { font-size: 13.5px; }
.prod span { font-size: 14px; }

/* PDV em telas médias (notebook, tablet deitado): lista de mesas e pedido alternam, como no celular, para o cardápio caber */
@media (min-width: 861px) and (max-width: 1240px) {
  .pdv { grid-template-columns: minmax(0, 1fr); }
  .pdv.com-pedido .pdv-lado { display: none; }
  .pdv:not(.com-pedido) .pdv-main { display: none; }
  .pdv-main { grid-template-columns: minmax(0, 1fr) 340px; }
  .voltar { display: inline-flex; }
  .pdv:not(.com-pedido) .mesas { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .pdv:not(.com-pedido) .pdv-lado { max-width: 760px; border-right: 0; }
}

.painel-ver { text-align: center; padding: 2px 0 8px; font-size: 11px; opacity: .7; }

/* ===== PDV (v4.9.2 · telas em sequência, sem colunas): só visual — mesmos botões e funções ===== */
/* 1) escolhe a mesa/pedido numa tela larga; 2) lança num cardápio de largura total; o pedido é uma barra com o total embaixo que abre como folha */
.mesas { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mesa { aspect-ratio: auto; min-height: 64px; border-radius: 12px; background: var(--surface); }
.mesa b { font-size: 17px; }
.mesa.sel { border: 2px solid var(--accent); outline: 0; }
@media (min-width: 861px) {
  .pdv { grid-template-columns: minmax(0, 1fr); position: relative; overflow: hidden; }
  .pdv.com-pedido .pdv-lado { display: none; }
  .pdv:not(.com-pedido) .pdv-main { display: none; }
  .voltar { display: inline-flex; }

  /* tela 1: mesas grandes, em largura total */
  .pdv:not(.com-pedido) .pdv-lado { max-width: none; border: 0; background: transparent; overflow-y: auto; }
  .pdv-lado .pdv-topo, .pdv-lado #pdv-abas, .pdv-lado .lista { width: 100%; max-width: 1120px; margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }
  .pdv-topo { padding-top: 18px; }
  .pdv-topo .acoes-novo { max-width: 560px; }
  .pdv-lado .lista { overflow: visible; flex: none; padding-top: 16px; padding-bottom: 28px; }
  .pdv .mesas { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
  .pdv .mesa { min-height: 110px; border-radius: 16px; }
  .pdv .mesa b { font-size: 24px; }
  .pdv .mesa small { font-size: 12px; }

  /* tela 2: cardápio em largura total */
  .pdv.com-pedido .pdv-main { display: block; height: 100%; }
  .catalogo { height: 100%; max-height: none; padding: 16px 28px 96px; gap: 12px; max-width: 1180px; margin: 0 auto; overflow: hidden; }
  .catalogo #busca { height: 46px; font-size: 15px; border-radius: 12px; }
  #cats button { padding: 9px 18px; font-size: 14px; border-radius: 999px; }
  .prods { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
  .prod { min-height: 100px; padding: 14px; border-radius: 14px; }
  .prod b { font-size: 16px; }
  .prod span { font-size: 16px; }

  /* pedido: barra embaixo (total + Enviar) que abre como folha centralizada */
  .comanda { position: absolute; left: 50%; bottom: 0; width: min(760px, 100%); z-index: 30; max-height: 92%; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 28px rgba(0, 0, 0, .18); transform: translate(-50%, calc(100% - 72px)); transition: transform .22s ease; }
  .pdv.comanda-aberta .comanda { transform: translate(-50%, 0); }
  .pdv.comanda-aberta .pdv-main::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .38); z-index: 29; }
  .comanda .alca { display: flex; align-items: center; gap: 12px; height: 72px; padding: 0 16px 0 20px; flex: 0 0 auto; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; background: var(--surface); }
  .comanda .alca::before { content: ""; position: absolute; top: 7px; left: 50%; width: 42px; height: 4px; margin-left: -21px; border-radius: 4px; background: var(--line); }
  .comanda .al-abre { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 8px 0 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
  .comanda .al-n { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .comanda .al-nome { font-size: 16px; }
  .comanda .al-sub { font-size: 13px; }
  .comanda .al-t { font-size: 22px; font-weight: 800; }
  .comanda .al-seta { color: var(--muted); font-size: 12px; transition: transform .2s; }
  .pdv.comanda-aberta .al-seta { transform: rotate(180deg); }
  .comanda .al-env { height: 46px; padding: 0 22px; margin-top: 8px; font-weight: 700; border-radius: 12px; flex: 0 0 auto; }
  .comanda .itens { flex: none; overflow: visible; min-height: 90px; }
  .comanda .novos-t { color: var(--accent); }
  .totais .tot { font-size: 24px; }
  .comanda .bts .btn { min-height: 44px; }
  .comanda .bts #b-receber { min-height: 56px; font-size: 17px; border-radius: 12px; }
}
@media (max-width: 860px) {
  .comanda .al-t { font-size: 20px; }
  .comanda .al-env { border-radius: 12px; }
  .comanda .bts .btn { min-height: 44px; }
  .prod { border-radius: 14px; }
}

/* versão do sistema sempre visível no topo */
.ver-topo { font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.ver-topo[hidden] { display: none; }
@media (max-width: 520px) { .ver-topo { font-size: 11px; padding: 2px 6px; } }

/* v4.9.11 alvos de toque: em telas de toque nada clicável fica abaixo de ~44px de altura */
@media (pointer: coarse) {
  .btn, .btn.sm, .btn.ghost.sm, .menu-btn { min-height: 44px; }
  .menu-btn { min-width: 44px; }
  .chip-f, .tag.on, .tabs > *, [role=tab] { min-height: 40px; display: inline-flex; align-items: center; }
  .menu a, .menu button, nav a, .lado a { min-height: 44px; }
  .tag[onclick], .tag[data-f], .tag[role=button], button.tag { min-height: 40px; display: inline-flex; align-items: center; }
  .chips button, .chips-f button { min-height: 44px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
}

/* v4.9.12 telas abertas: abas internas com voltar, minimizar e fechar */
.janelas { position: sticky; top: var(--top-h, 57px); z-index: 4; display: flex; align-items: stretch; gap: 8px; background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 6px 12px 0; }
.jan-lista { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; align-items: flex-end; }
.jan { flex: none; max-width: 200px; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 6px 0 10px; border: 1px solid var(--line); border-bottom: 0; border-radius: 9px 9px 0 0; background: var(--bg); color: var(--muted); cursor: pointer; font-weight: 500; user-select: none; }
.jan:hover { color: var(--ink); background: var(--surface); }
.jan.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 2px 0 var(--accent); }
.jan:focus-visible, .jan-ctl button:focus-visible, .jx:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.jan .jic { font-size: 14px; line-height: 1; }
.jan .jt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jx { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.jx svg { width: 14px; height: 14px; }
.jx:hover { background: var(--danger-2); color: var(--danger); }
.jan-ctl { flex: none; display: flex; align-items: center; gap: 2px; padding-bottom: 4px; }
.jan-ctl button { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.jan-ctl button:hover { background: var(--surface); color: var(--ink); }
.jan-ctl #j-fechar:hover { background: var(--danger-2); color: var(--danger); }
.jan-ctl svg { width: 18px; height: 18px; }
.app.min .view { display: none; }
@media (pointer: coarse) {
  .jan { min-height: 44px; } .jx { width: 36px; height: 36px; } .jan-ctl button { width: 44px; height: 44px; }
}
@media (max-width: 860px) {
  .janelas { padding: 4px 8px 0; gap: 4px; }
  .jan { max-width: 140px; }
}
.jan:not(:has(.jx)) { padding-right: 12px; }
.janelas[hidden] { display: none; }

/* v4.9.16 barra do topo no celular: o título cede espaço, a loja e a versão não empurram nem se sobrepõem */
@media (max-width: 860px) {
  .top { gap: 8px; }
  .top .menu-btn, .top #fav-btn { flex: none; }
  .top .titulo { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top .esp { display: none; }
  .top > .tag:not(.ver-topo) { flex: 0 1 auto; min-width: 0; max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top #sel-loja { flex: 0 1 auto; max-width: 38vw; }
  .top .ver-topo { flex: none; }
}
@media (max-width: 520px) {
  .top .ver-topo { display: none; } /* a versão continua no rodapé do menu */
}

/* v4.13.0 — venda rápida (funciona sem internet) */
.vr{display:grid;grid-template-columns:1.3fr 1fr;gap:14px;min-width:0}
.vr-prods,.vr-conta{min-width:0}
.vr-grade{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:8px;margin-top:8px;max-height:52vh;overflow:auto}
.vr-grade .prod{min-height:64px;display:flex;flex-direction:column;justify-content:space-between;text-align:left;gap:4px}
.vr-itens{display:flex;flex-direction:column;gap:6px;max-height:30vh;overflow:auto;margin-bottom:8px}
.vr-it{display:flex;align-items:center;gap:8px;justify-content:space-between;border-bottom:1px solid var(--line,#8883);padding:4px 0}
.vr-it span{flex:1;min-width:0}
.vr-it button{min-width:30px;min-height:30px}
.vr-total{display:flex;justify-content:space-between;font-size:22px;margin:6px 0 10px}
@media (max-width:760px){.vr{grid-template-columns:1fr}}

/* v4.14.0 — totem de autoatendimento (tela cheia, alvos grandes) */
body.modo-totem{user-select:none;-webkit-user-select:none;touch-action:manipulation;overflow:hidden}
.totem{display:grid;grid-template-columns:210px 1fr 320px;height:100vh;background:var(--bg);color:var(--fg);font-size:18px}
.totem-inicio,.totem:has(.totem-msg){grid-template-columns:1fr}
.totem-msg{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;text-align:center;padding:24px;max-width:760px;margin:auto}
.totem-msg h1{font-size:44px;margin:0}.totem-msg p{font-size:22px;margin:0}
.totem-loja{font-weight:700;opacity:.75;padding:6px 4px 12px}
.totem-cats{display:flex;flex-direction:column;gap:8px;padding:12px;background:var(--bg2,#0001);overflow:auto}
.totem-cats button{min-height:64px;font-size:20px;border-radius:14px;border:2px solid transparent;background:var(--card,#fff1);color:inherit;text-align:left;padding:10px 14px}
.totem-cats button.on{border-color:var(--accent,#d4571f);font-weight:700}
.totem-cats .totem-sair{margin-top:auto;font-size:16px;opacity:.8}
.totem-prods{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:14px;padding:14px;overflow:auto;align-content:start}
.totem-prod{display:flex;flex-direction:column;gap:6px;text-align:left;border-radius:16px;border:1px solid var(--line,#8884);background:var(--card,#fff1);color:inherit;padding:0 0 12px;overflow:hidden;font-size:18px;min-height:150px}
.totem-prod img,.totem-semfoto{width:100%;height:130px;object-fit:cover;display:flex;align-items:center;justify-content:center;font-size:44px;background:var(--bg2,#0002)}
.totem-prod b,.totem-prod span{padding:0 12px}.totem-prod .preco{font-weight:700;font-size:20px;margin-top:auto}
.totem-conta{display:flex;flex-direction:column;gap:10px;padding:14px;border-left:1px solid var(--line,#8884);min-width:0}
.totem-conta h2{margin:0}.totem-itens{flex:1;overflow:auto;display:flex;flex-direction:column;gap:8px}
.totem-it{display:flex;gap:8px;align-items:center}.totem-it span{flex:1;min-width:0}.totem-it small{display:block;opacity:.7}.totem-it button{min-width:44px;min-height:44px;border-radius:10px;border:0;background:transparent;color:inherit;font-size:18px}
.totem-total{display:flex;justify-content:space-between;font-size:28px}
.totem-btn{min-height:68px;font-size:22px;border-radius:16px;border:2px solid var(--line,#8886);background:var(--card,#fff1);color:inherit;padding:0 24px}
.totem-btn.pri{background:var(--accent,#d4571f);border-color:var(--accent,#d4571f);color:#fff;font-weight:700}.totem-btn:disabled{opacity:.45}
.totem-btn.grande{min-height:96px;font-size:30px;padding:0 48px}
.totem-botoes{display:flex;gap:14px}
.totem-resumo{width:min(560px,92vw);font-size:22px;display:flex;flex-direction:column;gap:8px;text-align:left}.totem-resumo>div{display:flex;justify-content:space-between;gap:12px}.totem-resumo .tt{border-top:2px solid var(--line,#8886);padding-top:8px;font-size:28px}
.totem-nome{display:flex;flex-direction:column;gap:6px;font-size:20px}.totem-nome input{font-size:24px;min-height:60px;border-radius:12px;padding:0 14px;text-align:center}
.totem-senha-rot{font-size:26px;opacity:.8}.totem-senha{font-size:150px;line-height:1;font-weight:800;color:var(--accent,#d4571f)}
.totem-modal{position:fixed;inset:0;background:#000a;display:flex;align-items:center;justify-content:center;z-index:100}.totem-card{background:var(--bg);color:var(--fg);padding:32px;border-radius:20px;text-align:center;display:flex;flex-direction:column;gap:16px}
@media (max-width:900px){.totem{grid-template-columns:150px 1fr;grid-template-rows:1fr auto}.totem-conta{grid-column:1/3;border-left:0;border-top:1px solid var(--line,#8884);max-height:42vh}}

/* v4.17.0 — módulo de notas fiscais reorganizado: faixa compacta, bolinhas de pendência nas abas */
.nf-faixa{font-size:13px;padding:7px 12px;border-radius:10px;margin:0 0 10px;background:var(--bg2,#0001);color:var(--muted)}
.nf-faixa.warn{background:color-mix(in srgb,var(--warn,#d97706) 14%,transparent);color:var(--fg)}
.nf-faixa a{color:var(--accent);font-weight:600}
.nf-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;margin-left:6px;border-radius:999px;font-size:11px;font-weight:700;color:#fff;vertical-align:middle}
.nf-badge.erro{background:var(--danger,#dc2626)}.nf-badge.aviso{background:var(--warn,#d97706)}
.nf-badge[hidden]{display:none}

/* v4.17.1 — abas do módulo Notas fiscais ficam fixas ao rolar */
.nf-fixo { position: sticky; top: calc(var(--top-h, 57px) + var(--jan-h, 46px)); z-index: 4; background: var(--bg); padding-top: 6px; margin-bottom: 10px; }
.nf-fixo .tabs { margin-bottom: 10px; }
.nf-fixo .nf-sub { margin: 0 0 8px; }

/* v4.18.1 — campo de documento com botão "Buscar CNPJ" na mesma linha; aviso abaixo da linha */
.inp-btn { display: flex; gap: 6px; align-items: center; }
.inp-btn > input { flex: 1; min-width: 0; }
.inp-btn > .btn { flex: none; white-space: nowrap; }
.cnpj-aviso:empty { display: none; }
.cnpj-aviso { margin: -4px 0 2px; }
.form .row { align-items: flex-start; }

/* v4.20.0 — lista de itens (adicionar em cima, lista embaixo) e escolha de fornecedores */
.ed-add { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 8px 0 12px; }
.ed-add .ed-ins { flex: 3 1 260px; min-width: 0; }
.ed-add .ed-qtd { flex: 1 1 150px; min-width: 0; }
.ed-add .ed-btn { flex: none; height: 38px; }
.ed-un { min-width: 28px; color: var(--muted); font-weight: 600; }
.ed-t input { padding: 6px 8px; }
.forn-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 8px; }
.forn-op { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; background: var(--surface); }
.forn-op:has(input:checked) { border-color: var(--accent); background: var(--accent-soft, rgba(91, 91, 214, .08)); }
.forn-op span { display: grid; gap: 2px; min-width: 0; }
.forn-op small { color: var(--muted); font-weight: 400; }

/* v4.21.0 — busca de insumo com lista de resultados */
.pk { position: relative; }
.pk-lista { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 2px); background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-m, 0 8px 24px rgba(0,0,0,.14)); max-height: 280px; overflow-y: auto; padding: 4px; }
.ed-ins.pk { position: relative; }
.pk-op { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; font-weight: 400; color: var(--ink, inherit); }
.pk-op.on, .pk-op:hover { background: var(--accent-soft, rgba(91, 91, 214, .1)); }
.pk-dica { margin-left: auto; font-size: 12px; color: var(--muted); }
.pk-mais { padding: 8px 10px; font-size: 12px; color: var(--muted); font-weight: 400; }

/* v4.22.0 — Preços inteligentes: tabela larga com rolagem lateral e coluna do prato legível */
#pi-tab { overflow-x: auto; }
#pi-tab table { min-width: 1240px; }
#pi-tab td:nth-child(2), #pi-tab th:nth-child(2) { min-width: 250px; }
#pi-tab td:nth-child(n+3) { white-space: nowrap; }

/* v4.23.0 — CRM */
.crm-segs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.crm-seg { text-align: left; background: var(--surface, #fff); border: 1px solid var(--border, #e3e3e3); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; font: inherit; color: inherit; }
.crm-seg .n { font-size: 22px; font-weight: 800; }
.crm-seg.on { border-color: var(--accent, #4f46e5); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #4f46e5) 25%, transparent); }
.crm-aviso { margin-bottom: 12px; padding: 10px 14px; background: var(--surface-2, #f6f6f8); }
.crm-aviso.ok { background: var(--ok-2, #e8f6ee); }
.crm-kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; align-items: start; }
.crm-col { background: var(--surface-2, #f6f6f8); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.crm-col-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.crm-card { background: var(--surface, #fff); border: 1px solid var(--border, #e3e3e3); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.crm-card.atrasado { border-color: var(--danger, #c0392b); }
.crm-card .v { font-weight: 700; }
.crm-card .atr, .crm-atr { color: var(--danger, #c0392b); font-weight: 600; }
.crm-card .mv { display: flex; justify-content: flex-end; gap: 4px; }
.crm-tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.crm-tl li { display: flex; gap: 10px; align-items: flex-start; }
.crm-tl .ic { width: 28px; flex: none; text-align: center; font-size: 18px; }
.sw { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw span { position: absolute; inset: 0; background: var(--border, #cfcfd6); border-radius: 24px; transition: .15s; cursor: pointer; }
.sw span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.sw input:checked + span { background: var(--accent, #4f46e5); }
.sw input:checked + span::before { transform: translateX(18px); }
.sw input:focus-visible + span { outline: 2px solid var(--accent, #4f46e5); outline-offset: 2px; }
