:root {
  --brand: #B91C1C;
  --brand-ink: #fff;
  --bg: #F6F4F2;
  --surface: #fff;
  --ink: #1F1A17;
  --muted: #6B625C;
  --line: #E7E2DE;
  --ok: #15803D;
  --warn: #B45309;
  --danger: #B91C1C;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--brand); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.strike { text-decoration: line-through; color: var(--muted); font-weight: 400; font-size: .85em; }

/* ---------- botões e formulários ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #cfc6bf; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: .85rem; border-radius: 8px; }
.btn.block { width: 100%; justify-content: center; }

label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=time],
input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
textarea { min-height: 70px; resize: vertical; }
.field { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: .95rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.hint { font-size: .8rem; color: var(--muted); margin-top: 3px; }

/* chips (cortes / tags) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 11px;
  font-size: .82rem; cursor: pointer; user-select: none;
}
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.chip.static { cursor: default; background: #F3EFEC; border-color: transparent; }
.chip-input { display: flex; gap: 6px; margin-top: 6px; }
.chip-input input { flex: 1; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #F3EFEC; color: var(--muted); }
.badge.ok { background: #DCFCE7; color: var(--ok); }
.badge.warn { background: #FEF3C7; color: var(--warn); }
.badge.danger { background: #FEE2E2; color: var(--danger); }
.badge.brand { background: var(--brand); color: var(--brand-ink); }

/* ---------- cards / tabelas ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #EFE9E5; flex: none; }
.thumb.ph { display: grid; place-items: center; font-size: 22px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat .v { font-size: 1.6rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .l { font-size: .82rem; color: var(--muted); font-weight: 600; }

/* ---------- layout do painel/admin ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: #1F1A17; color: #EDE7E3; padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side .logo { font-weight: 800; font-size: 1.1rem; padding: 0 8px 18px; display: flex; gap: 8px; align-items: center; }
.side nav a {
  display: flex; gap: 10px; align-items: center; color: #CFC6BF; text-decoration: none;
  padding: 9px 10px; border-radius: 8px; font-weight: 600; margin-bottom: 2px;
}
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.active { background: var(--brand); color: #fff; }
.side .foot { margin-top: auto; font-size: .82rem; color: #A69C95; padding: 8px; }
.side .foot button { color: #EDE7E3; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; font: inherit; }
.main { padding: 26px 30px 60px; min-width: 0; }
.main header.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.main header.top h1 { margin: 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; }
  .side .logo { padding: 0 8px; }
  .side nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .side .foot { margin: 0 0 0 auto; }
  .main { padding: 18px 16px 60px; }
}

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,14,10,.5); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 640px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 900px; }
.modal > header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal > header h2 { margin: 0; }
.modal .body { padding: 18px 20px; }
.modal > footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.x { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
@media (max-width: 640px) { .modal-bg { padding: 0; align-items: flex-end; } .modal { border-radius: 16px 16px 0 0; } }

/* toast */
#toast { position: fixed; left: 50%; top: 16px; pointer-events: none; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
#toast div { background: #1F1A17; color: #fff; padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 600; }
#toast div.err { background: var(--danger); }

/* upload */
.upload { display: flex; gap: 12px; align-items: center; }
.upload img, .upload .ph { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: #EFE9E5; display: grid; place-items: center; font-size: 30px; }

/* ---------- login / landing ---------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; }
.hero { background: linear-gradient(135deg, #1F1A17, #4A1D16); color: #fff; padding: 64px 20px 80px; text-align: center; }
.hero h1 { font-size: 2.2rem; }
.hero p { color: #E5D8D1; max-width: 620px; margin: 0 auto 22px; font-size: 1.05rem; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: -40px; }
.store-card { text-decoration: none; color: inherit; display: flex; gap: 14px; align-items: center; transition: transform .15s; }
.store-card:hover { transform: translateY(-2px); }
.store-card .logo { width: 60px; height: 60px; border-radius: 14px; object-fit: cover; flex: none; display: grid; place-items: center; font-size: 28px; color: #fff; font-weight: 800; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 40px 0; }

/* ---------- widget de suporte ---------- */
.sup { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 10px; }
.sup-fab { border: 0; border-radius: 999px; padding: 12px 18px; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.sup-panel { width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 100px)); background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; }
.sup-panel > header { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sup-body { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 10px 12px; overflow-y: auto; }
.sup-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.sup-msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; font-size: .92rem; line-height: 1.4; }
.sup-msg.user { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 4px; }
.sup-msg.assistant { align-self: flex-start; background: #F3EFEC; border-bottom-left-radius: 4px; }
.sup-msg.typing { color: var(--muted); font-style: italic; }
.sup-form { display: flex; gap: 6px; align-items: flex-end; }
.sup-form textarea { min-height: 42px; resize: none; }
.sup-foot { margin-top: 6px; text-align: center; }
.sup-ticket { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
details.inc { border-bottom: 1px solid var(--line); padding: 8px 0; }
details.inc summary { cursor: pointer; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* A rolagem dentro do modal não "vaza" para a página de trás */
.modal-bg { overscroll-behavior: contain; }

/* Modal com altura limitada à tela: cabeçalho (×) e rodapé fixos, só o conteúdo rola.
   Evita o corte no topo da "folha" em telas baixas (ex.: iPhone SE). */
.modal { display: flex; flex-direction: column; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); }
.modal > header, .modal > footer { flex: none; }
.modal .body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  .modal-bg { padding: 12px 0 0; }
  .modal { max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); }
  .modal > header { padding: 12px 16px; }
  .modal .body { padding: 14px 16px; }
  .modal > footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
}
.modal:focus { outline: none; }
.x:focus:not(:focus-visible) { outline: none; }
.x:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }

/* ---------- checklist de boas-vindas ---------- */
.onb-bar { height: 8px; border-radius: 999px; background: rgba(118,118,128,.14); margin: 12px 0 6px; overflow: hidden; }
.onb-bar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .4s; }
.onb-steps { list-style: none; padding: 0; margin: 8px 0 0; }
.onb-steps li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.onb-steps li:last-child { border-bottom: 0; }
.onb-steps .ck { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; font-size: .85rem;
  border: 2px solid rgba(118,118,128,.35); color: #fff; }
.onb-steps li.done .ck { background: var(--ok); border-color: var(--ok); }
.onb-steps li.done b { color: var(--muted); text-decoration: line-through; font-weight: 600; }

/* Toque no celular sem o destaque azul do navegador */
.chip, .group, .btn, .opt, .pcard, .hl { -webkit-tap-highlight-color: transparent; }
.chip, .group { -webkit-user-select: none; user-select: none; }

@media (max-width: 640px) {
  /* Checklist: botão vai para baixo do texto em vez de estourar o card */
  .onb-steps li { flex-wrap: wrap; }
  .onb-steps li > .btn { margin-left: 38px; }
  .onb-steps li > .grow { flex: 1 1 calc(100% - 50px); }
  #link { flex: 1 1 100%; min-width: 0; }
}

/* ---------- importação de planilha ---------- */
.imp-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; border: 2px dashed rgba(118,118,128,.35);
  border-radius: 20px; cursor: pointer; text-align: center; background: rgba(255,255,255,.35); transition: border-color .2s, background .2s; font-weight: 400; }
.imp-drop:hover, .imp-drop.over, .imp-drop:focus-visible { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, rgba(255,255,255,.6)); outline: none; }
.imp-ico { font-size: 40px; }
.imp-alert { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(255,159,10,.14); border: 1px solid rgba(255,159,10,.35); }
.imp-tpl code, .imp-map code { background: rgba(118,118,128,.14); padding: 1px 6px; border-radius: 6px; }
.imp-map { display: grid; gap: 6px; }
.imp-row { display: grid; grid-template-columns: 1.1fr 1fr 1.2fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; font-weight: 400; margin: 0; }
.imp-row:nth-child(odd) { background: rgba(118,118,128,.06); }
.imp-row.miss { background: rgba(255,59,48,.08); box-shadow: inset 3px 0 0 #FF3B30; }
.imp-sample { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-errors { margin: 8px 0 12px; } .imp-errors ul { margin: 6px 0 0; padding-left: 18px; max-height: 160px; overflow: auto; }
@media (max-width: 640px) { .imp-row { grid-template-columns: 1fr; gap: 4px; } }

/* =====================================================================
   Sistema de ícones (ver icon() em js/common.js e scripts/build-icons.js)
   Escala: xs 12 · sm 16 · md 20 · lg 24 · xl 32. Cor = currentColor (herda do texto).
   ===================================================================== */
.icon { display: inline-block; flex: none; vertical-align: -0.2em; width: 20px; height: 20px; overflow: visible; }
.icon-xs { width: 12px; height: 12px; vertical-align: -0.1em; }
.icon-sm { width: 16px; height: 16px; vertical-align: -0.18em; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; vertical-align: -0.25em; }
.icon-xl { width: 32px; height: 32px; }
.icon.spin { animation: icon-spin .9s linear infinite; }
@keyframes icon-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .icon.spin { animation: none; } }

/* Ícone + texto na mesma linha */
.ic-line, .ic-title, .feat-title { display: inline-flex; align-items: center; gap: .45em; }
.ic-title, .feat-title { display: flex; }
.badge .icon { margin-right: 2px; }
.brand-mark { color: var(--brand); }
.ok-ic { color: var(--ok); display: inline-flex; }
.empty-ic { color: var(--muted); display: flex; justify-content: center; margin-bottom: 8px; }
.facts span, .facts a { display: inline-flex; align-items: center; gap: 6px; }
.facts .icon { color: var(--muted); }
.side nav a .icon { color: currentColor; opacity: .9; }
.ph .icon, .pm-ph .icon, .thumb.ph .icon { color: rgba(110,110,115,.75); }
.opt .icon { color: var(--muted); }

/* Botões só com ícone: área de toque mínima de 44×44 px (o ícone continua pequeno) */
.btn-icon { min-width: 44px; min-height: 44px; padding: 0; justify-content: center; }
.x { width: 44px; height: 44px; display: grid; place-items: center; position: relative; background: transparent !important; color: var(--muted); }
.x::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: rgba(118,118,128,.14); transition: background .2s; }
.x:hover::before { background: rgba(118,118,128,.24); }
.x .icon { position: relative; }
.stepper button { width: 44px; height: 44px; display: grid; place-items: center; }
.hl-ic { color: #E8590C; display: inline-flex; }   /* chama dos destaques: laranja com contraste ≥ 3:1 sobre fundo claro */

/* =====================================================================
   Impressão de pedido em impressora térmica (js/impressao.js)
   Só preto puro: térmica não imprime cinza/fundos de forma legível.
   ===================================================================== */
#print-area { display: none; }
@media print {
  @page { margin: 0; }
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  body { position: static !important; top: auto !important; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; color: #000; font-family: Arial, Helvetica, sans-serif; line-height: 1.3; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print-area.paper-80 { width: 72mm; padding: 2mm 4mm; font-size: 12.5px; }   /* área imprimível da bobina de 80 mm */
  #print-area.paper-58 { width: 48mm; padding: 2mm 3mm; font-size: 10.5px; }   /* bobina de 58 mm */
  #print-area * { color: #000 !important; background: none !important; box-shadow: none !important; }
  #print-area b { font-weight: 800; }
  .r-center { text-align: center; }
  .r-store { font-size: 1.35em; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; }
  .r-small { font-size: .85em; }
  .r-sep { border-top: 1.5px dashed #000; margin: 2mm 0; }
  .r-row { display: flex; justify-content: space-between; gap: 2mm; }
  .r-big { font-size: 1.25em; font-weight: 900; }
  .r-total { font-size: 1.3em; font-weight: 900; margin-top: 1mm; }
  .r-item { margin-bottom: 1.6mm; break-inside: avoid; }
  .r-item .r-row { justify-content: flex-start; font-weight: 700; }
  .r-qty { flex: none; min-width: 12mm; }
  .r-name { flex: 1; }
  .r-val { flex: none; }
  .r-sub { padding-left: 12mm; font-size: .92em; }
  .paper-58 .r-qty { min-width: 9mm; } .paper-58 .r-sub { padding-left: 9mm; }
  .paper-58 .r-pr { display: block; }                      /* 58 mm: "Peso real" em linha própria */
  .paper-58 .r-total { font-size: 1.12em; }
  .r-total span, .r-big span { white-space: nowrap; }
  .r-notes { font-weight: 700; white-space: pre-wrap; }
  .r-feed { height: 12mm; }   /* espaço antes do corte do papel */
}

/* Pedido que chegou na última atualização automática */
.order-new { box-shadow: 0 0 0 2px var(--brand), 0 12px 30px color-mix(in srgb, var(--brand) 25%, transparent) !important; animation: order-pop .6s ease-out; }
@keyframes order-pop { 0% { transform: scale(.98); } 60% { transform: scale(1.01); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .order-new { animation: none; } }

/* Validação de telefone (cadastro e configurações da loja) */
.tel-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: .82rem; margin-top: 6px; min-height: 0; }
.tel-status:empty { display: none; }
.tel-status .icon { flex: none; }
.tel-status.ok { color: var(--ok); }
.tel-status.warn { color: var(--warn); }
.tel-status.err { color: var(--danger); }
.tel-status a { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; min-height: 32px; color: var(--ok); font-weight: 600; text-decoration: none; }
input[aria-invalid="true"] { border-color: var(--danger); }

/* Contas de demonstração na tela de login (só dev/homologação) */
.demo-box { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.demo-box p { margin: 0 0 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.demo-acc { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 44px; padding: 8px 12px; margin-top: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: transparent; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.demo-acc span { font-size: .82rem; color: var(--muted); }

/* Honeypot anti-robô: campo fora da tela que pessoas não preenchem */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- relatórios (painel) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.month-pick select { min-height: 44px; font-weight: 700; }
.delta { display: inline-block; margin-top: 4px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.empty-report { text-align: center; padding: 40px 18px; margin-top: 18px; color: var(--muted); }
.empty-report h2 { color: var(--ink); margin: 10px 0 4px; }
.rp-highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 18px 0; }
.rp-card { display: flex; gap: 12px; align-items: flex-start; }
.rp-card .l { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.rp-card .rp-t { display: block; font-size: 1.05rem; margin: 2px 0; }
.rp-card .small:last-child { margin-top: 4px; }
.rp-ic { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.rp-ic.gold { background: #FEF3C7; color: #B45309; }
.rp-ic.brand { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.rp-ic.ok { background: #DCFCE7; color: var(--ok); }
.rp-ic.danger { background: #FEE2E2; color: var(--danger); }
.report-card { margin-bottom: 18px; }
.report-card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.report-card .row.spread h2 { margin: 0; }
.report-card .row.spread { margin-bottom: 12px; gap: 8px; flex-wrap: wrap; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.report-grid .report-card { margin-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl td:first-child { color: var(--muted); width: 1%; }

/* gráfico de barras em HTML/CSS */
.chart { height: 180px; padding-bottom: 20px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 100%; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; cursor: default; }
.bar { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--brand) 45%, transparent); transition: background .15s; }
.bar-col:hover .bar { background: color-mix(in srgb, var(--brand) 70%, transparent); }
.bar-col.best .bar { background: var(--ok); }
.bar-col.worst .bar { background: var(--danger); }
.bar-col.closed .bar { background: repeating-linear-gradient(45deg, var(--line), var(--line) 3px, transparent 3px, transparent 6px); height: 100% !important; opacity: .5; }
.bl { position: absolute; bottom: -19px; font-size: .68rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.legend { display: inline-flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; color: var(--muted); }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: -4px; vertical-align: -1px; }
.lg.best { background: var(--ok); } .lg.worst { background: var(--danger); }
.lg.closed { background: repeating-linear-gradient(45deg, var(--line), var(--line) 2px, transparent 2px, transparent 4px); border: 1px solid var(--line); }
@media (max-width: 640px) { .bars { gap: 2px; } .chart { height: 150px; } .report-grid { grid-template-columns: 1fr; } }
.tbl a { white-space: nowrap; }
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stats .stat { padding: 14px; }
  .stats .stat .v { font-size: 1.15rem; overflow-wrap: normal; white-space: nowrap; letter-spacing: -.01em; }
}

/* Logo da loja no menu do painel */
#storeMark { display: inline-flex; flex: none; }
.side-logo { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; background: #fff; box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 640px) { .side-logo { width: 30px; height: 30px; border-radius: 8px; } }

/* ---------- menu lateral recolhível (telas largas) ---------- */
.side-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; margin: -8px 0 10px;
  border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.side-toggle:hover { background: var(--fill, rgba(0,0,0,.05)); color: var(--ink); }
.side .foot button { display: inline-flex; align-items: center; gap: 6px; }
@media (min-width: 861px) {
  .app { transition: grid-template-columns .2s ease; }
  .side-collapsed .app { grid-template-columns: 76px 1fr; }
  .side-collapsed .side { padding-left: 10px; padding-right: 10px; }
  .side-collapsed .side .lbl, .side-collapsed .side #who { display: none; }
  .side-collapsed .side .logo { justify-content: center; padding: 0 0 14px; }
  .side-collapsed .side-toggle { justify-content: center; padding: 8px 0; }
  .side-collapsed .side nav a { justify-content: center; padding: 11px 0; }
  .side-collapsed .side .foot { display: flex; justify-content: center; padding: 8px 0; }
  .side-collapsed .side .foot button { min-width: 44px; min-height: 44px; justify-content: center; text-decoration: none; }
}
@media (max-width: 860px) { .side-toggle { display: none; } }

/* ---------- modo tablet (#balcao): quadro de pedidos ---------- */
body.board-mode .side, body.board-mode .sup { display: none !important; }
body.board-mode .app { grid-template-columns: 1fr !important; }
body.board-mode .main { padding: 10px 12px 12px !important; height: 100dvh; display: flex; flex-direction: column; }
.board-bar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.bb-left { display: flex; align-items: baseline; gap: 12px; font-size: 1.1rem; }
.bb-clock { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.bb-info { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; flex: 1; }
.bb-off { color: var(--danger); font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.bb-actions { display: flex; gap: 8px; margin-left: auto; }
.bb-actions .btn { min-height: 48px; }
.btn.bicon { min-width: 48px; min-height: 48px; justify-content: center; padding: 0 12px; }
.btn.bicon.warn { color: var(--warn); }
.bb-hint { font-size: .8rem; font-weight: 700; margin-left: 6px; }
.board { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(270px, 1fr)); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; }
.bcol { display: flex; flex-direction: column; min-height: 0; background: rgba(0,0,0,.035); border-radius: 18px; padding: 10px; scroll-snap-align: start; }
.bcol h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin: 2px 4px 10px; }
.bcount { margin-left: auto; min-width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; background: var(--surface, #fff); font-size: .9rem; box-shadow: var(--shadow); }
.bcol[data-col="NOVO"] .bcount { background: var(--brand); color: #fff; }
.bcol-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px; -webkit-overflow-scrolling: touch; }
.bempty { text-align: center; color: var(--muted); margin: 24px 0; }
.bcard { background: var(--surface, #fff); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); border: 2px solid transparent; }
.bcard.fresh { border-color: var(--brand); animation: bpulse 1.6s ease-in-out 4; }
.bcard.late1 .bage { background: #FEF3C7; color: var(--warn); }
.bcard.late2 .bage { background: #FEE2E2; color: var(--danger); }
.bcard.late2 { border-color: var(--danger); }
@keyframes bpulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 25%, transparent); } }
.bcard header { display: flex; align-items: center; gap: 8px; }
.bnum { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.bname { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bage { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.05); white-space: nowrap; }
.btags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.btotal { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.bitems { list-style: none; margin: 0; padding: 0; font-size: 1.05rem; }
.bitems li { padding: 5px 0; border-top: 1px dashed var(--line); }
.bitems li:first-child { border-top: 0; }
.bcut { display: inline-block; font-size: .8rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #FEF3C7; color: #92400E; }
.bnote-i { font-size: .88rem; font-style: italic; color: var(--warn); }
.breward { color: var(--ok); }
.bnote, .baddr { display: flex; gap: 6px; align-items: flex-start; font-size: .9rem; margin: 8px 0 0; }
.bnote { background: #FEF3C7; color: #78350F; padding: 6px 8px; border-radius: 10px; font-weight: 600; }
/* Botão principal em linha inteira (alvo grande para o dedo); voltar/imprimir/cancelar embaixo */
.bactions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bactions .bnext { order: -1; flex: 1 1 100%; min-height: 54px; font-size: 1.05rem; justify-content: center; }
@media (max-width: 900px) {
  .board { grid-template-columns: repeat(4, calc(50% - 6px)); }   /* tablet em pé: 2 colunas por vez, desliza para as outras */
  .bb-actions .btn:not(.bicon) { padding: 0 12px; }
}
@media (max-width: 640px) { .board { grid-template-columns: repeat(4, 86%); } }

/* Prévia da capa nas Configurações: mesmas proporções da vitrine (1100 × 230 no computador, 390 × 230 no celular) */
.cover-preview { margin-top: 10px; }
.cp-frames { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.cp-frames figure { margin: 0; }
.cp-frames figcaption { font-size: .75rem; color: var(--muted); margin-top: 4px; text-align: center; }
.cp-desk, .cp-cel { background-size: cover; background-position: center; border-radius: 0 0 12px 12px; background-color: #EFE9E5; box-shadow: 0 0 0 1px var(--line); }
.cp-desk { width: 220px; aspect-ratio: 1100 / 230; }
.cp-cel { width: 78px; aspect-ratio: 390 / 230; }
.cp-status { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; }
.cp-status .icon { flex: none; margin-top: 1px; }
.cp-status.warn { color: var(--warn); }
.cp-status.ok { color: var(--ok); }
.req-flag { background: #FEF3C7; color: #78350F; border-radius: 8px; padding: 6px 8px; margin-top: 4px; align-items: flex-start; }
