/* Mr. Jones: folha de estilo única. Ordem: tokens, base, layout, componentes, painel, cliente, páginas, utilitários.
   Regras do projeto (CSP default-src 'self'): nenhum style="" inline, nenhum recurso externo, sem build.
   Para mudar a identidade, edite só os tokens em :root. */

/* ===== 1. Tokens ===== */
:root {
  /* cores */
  --bg: #0a0a0a;
  --surface: #151515;
  --surface-2: #1f1f1f;
  --line: #2e2e2e;
  --field-line: #8a8a85; /* borda de campo: contraste 3:1 (WCAG 1.4.11) */
  --text: #f6f5f1;
  --muted: #9b9a94;
  --accent: #f2a71b;
  --accent-ink: #120c00;
  --good: #6fbf73;
  --bad: #ef6a61;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --good-soft: color-mix(in srgb, var(--good) 12%, var(--surface));
  --bad-soft: color-mix(in srgb, var(--bad) 12%, var(--surface));
  /* espaçamento (base 4) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  /* raios: controle < item < cartão < pílula; o saldo mantém o canto quase reto da marca */
  --r-control: 10px; --r-item: 12px; --r-card: 14px; --r-pill: 999px; --r-brand: 4px;
  --radius: var(--r-card);
  /* tipografia */
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 0.8125rem; --fs-sm: 0.875rem; --fs-md: 1rem; --fs-lg: 1.125rem;
  --fs-h2: 1.05rem; --fs-h1: 1.5rem; --fs-num: 1.4rem; --fs-hero: 4rem;
  /* medidas */
  --tap: 44px;
  --topbar-h: 56px;
  --bottom-nav-h: 60px;
  --nav-offset: 0px; /* vira a altura da barra inferior no celular do painel */
  color-scheme: dark;
}

/* ===== 1b. Tema claro ===== */
/* Duas regras: (1) segue o sistema quando não há escolha manual e (2) respeita a escolha explícita.
   Mantenha as duas em sincronia: mesmos valores. Os tokens -soft usam color-mix com --surface, então se adaptam. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f4ef;
    --surface: #ffffff;
    --surface-2: #edeae3;
    --line: #d4d1ca;
    --field-line: #6b6960;
    --text: #1a1816;
    --muted: #5c5a52;
    --accent: #c98a0a;
    --accent-ink: #ffffff;
    --good: #2d8a31;
    --bad: #c7342b;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #edeae3;
  --line: #d4d1ca;
  --field-line: #6b6960;
  --text: #1a1816;
  --muted: #5c5a52;
  --accent: #c98a0a;
  --accent-ink: #ffffff;
  --good: #2d8a31;
  --bad: #c7342b;
  color-scheme: light;
}

/* Overrides do tema claro para elementos com valores codificados */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) body { background-image: none; }
  :root:not([data-theme="dark"]) .brand .logo,
  :root:not([data-theme="dark"]) .logo-sm { filter: contrast(1.2); mix-blend-mode: multiply; }
  :root:not([data-theme="dark"]) .toast-error { color: #4a0000; }
  :root:not([data-theme="dark"]) dialog::backdrop { background: rgba(0, 0, 0, 0.3); }
}
:root[data-theme="light"] body { background-image: none; }
:root[data-theme="light"] .brand .logo,
:root[data-theme="light"] .logo-sm { filter: contrast(1.2); mix-blend-mode: multiply; }
:root[data-theme="light"] .toast-error { color: #4a0000; }
:root[data-theme="light"] dialog::backdrop { background: rgba(0, 0, 0, 0.3); }

/* ===== 2. Base ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 130px; scroll-padding-bottom: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  min-height: 100dvh;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3 { font-weight: 800; line-height: 1.2; margin: 0; text-wrap: balance; }
/* Caixa alta só nos títulos: é a assinatura da marca. Nomes de pessoas, tags e botões ficam em frase normal. */
h1, h2 { text-transform: uppercase; letter-spacing: 0.05em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); color: var(--accent); }
h3 { font-size: var(--fs-md); }
h1:focus { outline: none; }
p { margin: 0; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== 3. Layout e utilitários ===== */
.wrap { max-width: 560px; margin: 0 auto; padding: var(--sp-5) var(--sp-4) 48px; }
.wrap.wide { max-width: 860px; }
.stack { display: grid; gap: var(--sp-4); }
.stack-sm { display: grid; gap: var(--sp-2); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 0; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -80px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--r-control); font-weight: 700; }
.skip:focus { top: 8px; }
.table-scroll { overflow-x: auto; }
/* grade de formulário: 1 coluna no celular, colunas automáticas a partir de 641 px (filtros, datas) */
.form-grid { display: grid; gap: var(--sp-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 641px) { .form-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
.form-grid > label, .form-grid input, .form-grid select { min-width: 0; }

/* Marca */
.brand { text-align: center; padding: var(--sp-2) 0 0; }
/* A logo tem fundo preto texturizado: o contraste apaga a textura e o "screen" deixa só o branco. */
.brand .logo { width: min(340px, 86%); height: auto; display: block; margin: 0 auto 6px; filter: contrast(2.6); mix-blend-mode: screen; }
.logo-sm { width: 36px; height: 40px; flex: none; object-fit: contain; filter: contrast(2.6); mix-blend-mode: screen; }
/* Título com filetes laterais, como na faixa "Barber Shop" da logo (área do cliente e páginas públicas). */
h2.ruled { display: flex; align-items: center; gap: 12px; justify-content: center; text-align: center; margin-top: var(--sp-2); }
h2.ruled::before, h2.ruled::after { content: ''; flex: 1; height: 5px; border-block: 1px solid var(--line); }

/* ===== 4. Componentes ===== */

/* 4.1 Botões: neutro, .primary (uma por região), .ghost, .danger, .sm, .block */
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  border-radius: var(--r-control); padding: 10px 16px; min-height: var(--tap);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
}
button:hover:not(:disabled), .btn:hover { border-color: var(--accent); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover:not(:disabled), .btn.primary:hover { filter: brightness(1.08); }
button.danger, .btn.danger { color: var(--bad); }
button.ghost, .btn.ghost { background: transparent; }
button.block, .btn.block { width: 100%; }
button.sm, .btn.sm { min-height: 36px; padding: 6px 12px; font-size: var(--fs-sm); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

/* Alternador de tema */
#theme-toggle {
  background: none; border: none; padding: 6px; min-height: auto;
  color: var(--muted); cursor: pointer; font-size: 1.25rem; line-height: 1;
}
#theme-toggle:hover { color: var(--text); }

/* 4.2 Campos */
label { display: grid; gap: 6px; font-size: var(--fs-sm); color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--field-line); border-radius: var(--r-control);
  padding: 12px 14px; width: 100%; min-height: 48px;
}
textarea { min-height: 80px; resize: vertical; }
input[type='checkbox'] { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--accent); flex: none; }
input[type='file'] { padding: 10px; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: var(--fs-md); }
.hint { font-size: var(--fs-xs); color: var(--muted); }
.error { color: var(--bad); font-size: 0.9rem; }
.error:empty { display: none; }
.error-box { display: grid; gap: var(--sp-2); justify-items: start; background: var(--bad-soft); border: 1px solid var(--bad); border-radius: var(--r-item); padding: var(--sp-3) var(--sp-4); }
.error-box p { color: var(--text); }

/* 4.3 Cartão, aviso, saldo */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; }
.card.notice, .notice { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r-card); padding: var(--sp-3) var(--sp-4); }
.balance { text-align: center; padding: 30px 18px; border-color: var(--text); border-radius: var(--r-brand); outline: 1px solid var(--text); outline-offset: -7px; }
.balance .value { font-weight: 800; font-size: var(--fs-hero); line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.balance .value.value-gap { margin-top: 14px; }
.balance .unit { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.75rem; color: var(--muted); margin-top: 6px; }
/* versão compacta para a equipe: moldura simples, nome em frase normal */
.balance.compact { padding: var(--sp-4); outline: 0; border-color: var(--line); border-radius: var(--r-card); display: grid; gap: var(--sp-1); }
.balance.compact h1, .balance.compact .cust-name { font-size: var(--fs-lg); text-transform: none; letter-spacing: 0; color: var(--text); }
.balance.compact .value { font-size: 2.4rem; margin-top: var(--sp-1); }
.balance.compact .value.value-gap { margin-top: var(--sp-1); }
.cust-name { overflow-wrap: anywhere; }

/* 4.4 Cabeçalho de seção ou de aba: título à esquerda, ação principal à direita */
.head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.head h2, .head h1 { flex: 1 1 auto; min-width: 0; }
.lead { font-size: var(--fs-sm); color: var(--muted); }

/* 4.5 Listas e item canônico */
.list { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-item); padding: 14px; display: grid; gap: var(--sp-2); }
.item.off { border-style: dashed; }
.item.off .title { opacity: 0.8; }
button.item { text-align: left; width: 100%; font-weight: 400; justify-content: stretch; }
.item .title { font-weight: 600; overflow-wrap: break-word; }
.meta { display: block; font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
/* Item canônico: texto + pontos na linha 1; ações na linha 2, à direita (no máximo 2 botões visíveis + menu). */
.item:has(> .item-main) { grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: var(--sp-3); }
.item-main { grid-column: 1; min-width: 0; display: grid; gap: 2px; }
.item-main:has(> .thumb) { grid-template-columns: auto minmax(0, 1fr); column-gap: var(--sp-3); align-items: center; }
.item-main:has(> .thumb) > .meta { grid-column: 2; }
.item-main:not(:has(+ .pts)) { grid-column: 1 / -1; }
.item > .pts { grid-column: 2; }
.item-actions { grid-column: 1 / -1; display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; align-items: center; }
/* compatível com a marcação antiga (.row > .grow + .pts + botões) até todas as telas migrarem */
.item .row > .grow { flex-basis: 150px; }
.item .row > .pts { margin-left: auto; }
.pts { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pts.neg { color: var(--bad); }
.pts.pos { color: var(--good); }
/* Lançamento estornado: título esmaecido e riscado; os pontos só riscados (opacidade reduziria o contraste de .pts.neg/.pos abaixo de 4,5:1). */
.void .title { opacity: 0.6; }
.void .title, .void .pts { text-decoration: line-through; }
.lines { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex: none; background: var(--surface-2); }
.reward .photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; background: var(--surface-2); }

.item-main[role=button] { cursor: pointer; }
.item-main[role=button]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--r-control); }
.jump { padding-inline-end: 28px; }
@media (max-width: 640px) { .jump { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); } }

/* 4.6 Tags: frase normal; no máximo 2 por item */
.tag { font-size: var(--fs-xs); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px 10px; color: var(--muted); white-space: nowrap; display: inline-block; line-height: 1.4; }
.tag.ok { color: var(--good); border-color: var(--good); }
.tag.gold { color: var(--accent); border-color: var(--accent); }
.tag.bad { color: var(--bad); border-color: var(--bad); }

/* 4.7 Indicadores: 2 por linha no celular, 3 a partir de 641 px */
.stats, .dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dash-grid { margin: var(--sp-3) 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-item); padding: var(--sp-3); text-align: center; }
.stat b { display: block; font-size: var(--fs-num); color: var(--accent); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat span { font-size: var(--fs-xs); color: var(--muted); display: block; }
.stat .hint, .dash-hint { display: block; margin-top: var(--sp-1); }
@media (max-width: 640px) { .stats, .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dash-table th, .dash-table td { text-align: left; padding: var(--sp-2) 6px; border-bottom: 1px solid var(--line); }
.dash-table th { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.audit-json { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; font-size: var(--fs-xs); }

/* 4.8 Barra de progresso */
.bar { height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

/* 4.9 Estados: vazio, carregando, esqueleto */
.empty { text-align: center; color: var(--muted); font-size: var(--fs-sm); padding: var(--sp-5) var(--sp-4); display: grid; gap: var(--sp-3); justify-items: center; }
li.empty { background: transparent; }
.loading { color: var(--muted); font-size: 0.9rem; text-align: center; padding: var(--sp-3) 0; }
.skeleton { display: block; height: 1em; border-radius: var(--r-control); background: var(--surface-2); }
.skeleton.block { height: 72px; border-radius: var(--r-item); }

/* 4.10 Chips: filtros e abas internas */
.chips, .tabs, .jump { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar, .tabs::-webkit-scrollbar, .jump::-webkit-scrollbar { display: none; }
.chips button, .jump a { white-space: nowrap; border-radius: var(--r-pill); min-height: 38px; padding: 6px 14px; font-weight: 500; font-size: var(--fs-sm); }
.chips button[aria-pressed='true'], .chips button[aria-current='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.jump a { text-decoration: none; border: 1px solid var(--line); color: var(--text); display: inline-flex; align-items: center; min-height: 36px; }
.chips.wrap-chips { flex-wrap: wrap; overflow: visible; }

/* 4.11 Menu "Mais" (details, sem JS próprio; o painel fecha ao tocar fora) */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary.btn, .menu > summary.sm { display: inline-flex; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; max-width: calc(100vw - 32px); display: grid; gap: 2px; padding: var(--sp-2); background: var(--surface); border: 1px solid var(--field-line); border-radius: var(--r-item); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6); }
.menu-pop > button, .menu-pop > a { width: 100%; justify-content: flex-start; border: 0; background: transparent; text-align: left; }
.menu-pop > button:hover:not(:disabled) { background: var(--surface-2); }
.menu-pop .menu-info { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-1); }
details.more { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-item); padding: 10px 14px; }
details.more summary { cursor: pointer; font-weight: 600; min-height: 32px; }
details.more .row { margin-top: 10px; }
.more { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-item); padding: 10px 14px; }
.more summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.more .row { margin-top: 10px; }

/* 4.12 Diálogo (openForm): folha ancorada embaixo no celular */
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
dialog.wide { width: min(560px, calc(100vw - 32px)); }
@media (max-width: 640px) {
  dialog { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 92dvh; border-radius: var(--r-card) var(--r-card) 0 0; border-bottom: 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* 4.13 Toast: sucesso some sozinho; erro fica até tocar; pode ter uma ação */
.toast-region { display: contents; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-offset) + 24px); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: var(--r-pill); font-weight: 600; max-width: calc(100vw - 32px); z-index: 50; text-align: center; display: flex; gap: var(--sp-3); align-items: center; justify-content: center; flex-wrap: wrap; }
/* Com a barra de ação do atendimento na tela (altura medida: 103 px), o aviso sobe para não cobrir o botão principal. */
body:has(.action-bar) .toast { bottom: calc(var(--nav-offset) + 24px + 112px + env(safe-area-inset-bottom)); }
.toast.has-action { border-radius: var(--r-card); }
.toast .toast-action { min-height: 32px; padding: 4px 12px; background: var(--bg); color: var(--text); border-color: var(--bg); }
.toast-error { background: var(--bad); color: #120000; cursor: pointer; }

/* 4.14 Barra de ação fixa: botão principal da tela, sempre ao alcance do polegar */
.action-bar { position: sticky; bottom: var(--nav-offset); z-index: 8; display: grid; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom)); margin-inline: calc(-1 * var(--sp-4)); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.action-bar .total { display: flex; justify-content: space-between; font-weight: 700; }

/* 4.15 Instalação do PWA: aviso em fluxo, nunca cobre botões */
.pwa-install { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r-card); padding: 10px 14px; }
.pwa-install span { flex: 1 1 160px; }

/* ===== 5. Painel da equipe ===== */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 860px; margin: 0 auto; padding: 8px var(--sp-4); }
.topbar-row { display: flex; align-items: center; gap: var(--sp-3); min-height: 40px; }
.topbar-title { flex: 1 1 0; min-width: 0; display: grid; line-height: 1.25; }
.topbar-title .small { font-size: var(--fs-xs); }
.tabs { padding: 8px 0 2px; padding-inline-end: 28px; }
.tabs button { min-height: 38px; padding: 6px 14px; border-radius: var(--r-pill); white-space: nowrap; font-weight: 500; }
.tabs button[aria-current='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.tabs.groups { padding-bottom: 0; }
.tabs.groups button { background: transparent; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; font-weight: 700; }
.tabs.groups button[aria-current='true'] { background: var(--text); border-color: var(--text); color: var(--bg); }
.view-tabs { flex-wrap: wrap; overflow: visible; padding-inline-end: 0; }
.bottom-nav { display: none; }
@media (max-width: 640px) {
  .tabs { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .view-tabs { -webkit-mask-image: none; mask-image: none; }
  .tabs.groups.desk-only { display: none; }
  body.has-bottom-nav { --nav-offset: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
  body.has-bottom-nav main { padding-bottom: calc(var(--nav-offset) + 32px); }
  .bottom-nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset: auto 0 0 0; z-index: 25; height: var(--nav-offset); padding-bottom: env(safe-area-inset-bottom); background: var(--bg); border-top: 1px solid var(--line); }
  .bottom-nav button { border: 0; border-radius: 0; background: transparent; min-height: var(--bottom-nav-h); min-width: 0; padding: 0 2px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
  .bottom-nav button[aria-current='true'] { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
}
@media (min-width: 641px) { .tabs { flex-wrap: wrap; overflow: visible; padding-inline-end: 0; } }

/* ===== 6. Área do cliente e cartões de fidelização ===== */
.sec-code { display: block; font-size: 2rem; font-weight: 800; color: var(--accent); letter-spacing: 0.2em; text-align: center; font-variant-numeric: tabular-nums; }
.card-qr { background: #fff; border-radius: var(--r-item); padding: 8px; width: min(260px, 100%); margin: 0 auto; }
.card-qr.big { width: min(340px, 100%); }
.card-qr svg { display: block; width: 100%; height: auto; }
.card-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.15rem; letter-spacing: 0.08em; text-align: center; overflow-wrap: anywhere; }
.card-code.big { font-size: 1.6rem; letter-spacing: 0.2em; }
.notif.unread { border-color: var(--accent); }
.notif .small { white-space: pre-line; }

/* ===== 7. Páginas legais e privacidade ===== */
.legal-text { white-space: pre-wrap; font-size: 1.05rem; line-height: 1.6; overflow-wrap: anywhere; max-width: 65ch; }
.legal-model { border: 1px solid var(--accent); color: var(--accent); background: var(--accent-soft); border-radius: var(--r-item); padding: 10px 14px; font-weight: 600; }
.privacy-note { font-size: 0.8rem; color: var(--muted); }
.stack textarea.long { min-height: 14rem; }

/* ===== 8. Preferências do usuário e dispositivo ===== */
@media (pointer: coarse) {
  button.sm, .btn.sm, .tabs button { min-height: var(--tap); }
  .chips button { min-height: var(--tap); }
  input[type='checkbox'] { width: 26px; height: 26px; }
  label.check { min-height: var(--tap); }
}
@media (max-width: 420px) { .balance .value { font-size: 3.2rem; } .balance.compact .value { font-size: 2.2rem; } }
@media (prefers-reduced-motion: no-preference) {
  .bar > span { transition: width 0.6s ease; }
  .skeleton { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.5; } }
}
@media (forced-colors: active) { .bar { border: 1px solid CanvasText; } .bar > span { background: Highlight; forced-color-adjust: none; } }
