/* Multiplicar — tema açaí. Roxo profundo + magenta-berry + dourado (oferta).
   Mobile-first: coluna única, barra de abas no rodapé (alcance do polegar). */
:root {
  --acai: #5A2E93; --acai-deep: #3C1C6B; --berry: #C42B8E; --gold: #E9A93C;
  --green: #17915C; --red: #D93B4A;
  --bg: #F6F1FB; --surface: #FFFFFF; --surface-2: #F1E9FA;
  --ink: #241435; --muted: #756685; --line: #E6DCF2;
  --on-acai: #FFFFFF;
  --shadow: 0 1px 2px rgba(60,28,107,.06), 0 8px 24px rgba(60,28,107,.08);
  --radius: 16px; --radius-sm: 11px;
  --maxw: 620px;
  font-synthesis-weight: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --acai: #9A6CE0; --acai-deep: #7B4DC4; --berry: #F06BC0; --gold: #F3C061;
    --green: #35C489; --red: #FF6B76;
    --bg: #150C24; --surface: #211436; --surface-2: #2B1B45;
    --ink: #F1E9FB; --muted: #A896BE; --line: #38264F;
    --on-acai: #FFFFFF;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --acai: #9A6CE0; --acai-deep: #7B4DC4; --berry: #F06BC0; --gold: #F3C061;
  --green: #35C489; --red: #FF6B76;
  --bg: #150C24; --surface: #211436; --surface-2: #2B1B45;
  --ink: #F1E9FB; --muted: #A896BE; --line: #38264F;
  --on-acai: #FFFFFF;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { height: 100%; touch-action: manipulation; } /* touch-action mata o zoom no toque duplo */
html, body { margin: 0; }
/* app-shell: a página não rola (sem rubber-band), só o #app rola por dentro; menu fixo no rodapé fora do scroll. */
body {
  background: var(--bg); color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-size: 16px; line-height: 1.45;
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased;
  height: 100dvh; overflow: hidden; display: flex; flex-direction: column;
  overscroll-behavior: none; -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
}
/* texto/números seguem selecionáveis (copiar chave, valores, etc.) */
input, textarea, select, .amt, .big, .pin, .pixbar b, .n, .seller-top .pin { -webkit-user-select: text; user-select: text; }
h1, h2, h3 { font-family: "Baloo 2", system-ui, sans-serif; margin: 0; line-height: 1.12; text-wrap: balance; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }
.tnum { font-variant-numeric: tabular-nums; }

#app { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 14px calc(90px + env(safe-area-inset-bottom)); }

/* ---------- topo ---------- */
.top { display: flex; align-items: center; gap: 12px; padding: 18px 2px 12px; }
.top .mark {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  background: linear-gradient(150deg, var(--acai), var(--berry));
  display: grid; place-items: center; color: #fff; font-family: "Baloo 2"; font-weight: 800; font-size: 22px;
  box-shadow: var(--shadow);
}
.top .ttl { flex: 1; min-width: 0; }
.top .ttl b { font-family: "Baloo 2"; font-weight: 800; font-size: 20px; display: block; letter-spacing: -.2px; }
.top .ttl small { color: var(--muted); font-size: 12.5px; }
.iconbtn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 18px; display: grid; place-items: center;
}

/* ---------- tiles / painel ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tile { padding: 15px 15px 16px; display: flex; flex-direction: column; gap: 3px; min-height: 104px; }
.tile .lbl { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tile .big { font-family: "Baloo 2"; font-weight: 800; font-size: 30px; letter-spacing: -.5px; line-height: 1; }
.tile .sub { font-size: 12.5px; color: var(--muted); }
.tile.hero { grid-column: 1 / -1; background: linear-gradient(155deg, var(--acai-deep), var(--acai) 62%, var(--berry)); border: none; color: var(--on-acai); }
.tile.hero .lbl { color: rgba(255,255,255,.72); }
.tile.hero .big { font-size: 38px; }
.tile.hero .sub { color: rgba(255,255,255,.82); }
.tile .accent-gold { color: var(--gold); }

.bar { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.tile.hero .bar { background: rgba(255,255,255,.22); }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--acai); transition: width .5s cubic-bezier(.2,.7,.2,1); }
.tile.hero .bar > i { background: var(--gold); }
.bar.g > i { background: var(--green); }
.bar.gold > i { background: var(--gold); }

.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 4px 10px; }
.section-h h2 { font-size: 17px; font-weight: 700; }
.section-h span { font-size: 12.5px; color: var(--muted); }

/* ranking */
.rank { padding: 6px 4px; }
.rank-row { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; padding: 9px 11px; }
.rank-row + .rank-row { border-top: 1px solid var(--line); }
.rank-pos { font-family: "Baloo 2"; font-weight: 800; color: var(--muted); text-align: center; }
.rank-row:nth-child(1) .rank-pos { color: var(--gold); }
.rank-name { min-width: 0; }
.rank-name b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-name .rbar { height: 6px; border-radius: 999px; background: var(--surface-2); margin-top: 5px; overflow: hidden; }
.rank-name .rbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--acai), var(--berry)); }
.rank-val { text-align: right; font-weight: 700; font-size: 14px; }
.rank-val small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }

/* ---------- vendas: filtros + lista ---------- */
.toolbar { display: flex; gap: 8px; margin: 4px 0 12px; }
.search { flex: 1; position: relative; }
.search input { width: 100%; padding: 12px 14px 12px 38px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.search::before { content: "⌕"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; }
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--acai); color: #fff; border-color: var(--acai); }

.list { display: flex; flex-direction: column; gap: 9px; }
.sale { padding: 13px 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; }
.sale .who { min-width: 0; }
.sale .who b { font-weight: 600; font-size: 15.5px; }
.sale .who .meta { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.sale .amt { text-align: right; font-weight: 700; white-space: nowrap; }
.sale .amt .q { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.sale .foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 3px; }

.badge { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; }
.badge.pago { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.badge.deve { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.badge.retirado { background: color-mix(in srgb, var(--acai) 15%, transparent); color: var(--acai); }

/* botão toggle pill (pago / retirar) */
.toggle { border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 6px 11px; border-radius: 999px; }
.toggle.on-green { background: var(--green); border-color: var(--green); color: #fff; }
.toggle.on-acai { background: var(--acai); border-color: var(--acai); color: #fff; }
.linkbtn { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 13px; padding: 6px; }
.linkbtn.danger { color: var(--red); }

.empty { text-align: center; color: var(--muted); padding: 44px 20px; }
.empty .big { font-size: 40px; }

/* ---------- retirada ---------- */
.retira-head { padding: 16px; margin-bottom: 12px; }
.retira-head .n { font-family: "Baloo 2"; font-weight: 800; font-size: 28px; }
.retira .sale.done { opacity: .55; }
.btn-retirar { width: 100%; margin-top: 6px; padding: 12px; border-radius: var(--radius-sm); border: none; background: var(--acai); color: #fff; font-weight: 700; font-size: 15px; }
.btn-retirar.undo { background: var(--surface-2); color: var(--muted); }
.warn-deve { color: var(--red); font-weight: 700; font-size: 13px; }

/* ---------- form / ajustes ---------- */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--acai); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acai) 20%, transparent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.check { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--green); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.btn { display: block; width: 100%; padding: 14px; border-radius: var(--radius-sm); border: none; font-weight: 700; font-size: 15.5px; }
.btn.primary { background: linear-gradient(135deg, var(--acai), var(--berry)); color: #fff; }
.btn.ghost { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }

/* ---------- FAB + bottom nav ---------- */
.fab {
  position: fixed; right: max(16px, calc((100vw - var(--maxw))/2 + 16px)); bottom: calc(78px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 18px; border: none; z-index: 30;
  background: linear-gradient(135deg, var(--acai), var(--berry)); color: #fff; font-size: 30px; font-weight: 400;
  box-shadow: 0 8px 22px rgba(90,46,147,.45); display: grid; place-items: center; line-height: 0;
}
.nav {
  flex: none; z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--line); display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-inner { display: flex; width: 100%; max-width: var(--maxw); }
.nav button { flex: 1; background: none; border: none; padding: 9px 4px 8px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; }
.nav button .ic { font-size: 20px; line-height: 1; }
.nav button.on { color: var(--acai); }

/* ---------- sheet / modal ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(30,14,54,.5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: var(--maxw); border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; }
.sheet .grab { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 8px auto 12px; }
.sheet h2 { font-size: 19px; margin-bottom: 14px; }

/* ---------- gate (PIN) ---------- */
.gate { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 20px; }
.gate .mark { width: 66px; height: 66px; border-radius: 20px; background: linear-gradient(150deg, var(--acai), var(--berry)); display: grid; place-items: center; color: #fff; font-family: "Baloo 2"; font-weight: 800; font-size: 32px; box-shadow: var(--shadow); }
.gate h1 { font-size: 26px; }
.gate p { color: var(--muted); margin: 0; max-width: 280px; }
.gate input { width: 200px; text-align: center; font-size: 26px; letter-spacing: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.gate .err { color: var(--red); font-size: 13px; font-weight: 600; min-height: 18px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); }

/* ---------- pix bar ---------- */
.pixbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-top: 12px; }
.pixbar .lbl { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pixbar b { font-size: 19px; font-family: "Baloo 2"; letter-spacing: .3px; }

/* ---------- badges de sabor ---------- */
.badge.sabor { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.badge.sabor.morango { background: color-mix(in srgb, var(--berry) 14%, transparent); color: var(--berry); border-color: transparent; }
.badge.sabor.banana { background: color-mix(in srgb, var(--gold) 20%, transparent); color: color-mix(in srgb, var(--gold) 78%, var(--ink)); border-color: transparent; }
.saborline { display: flex; gap: 14px; font-family: "Baloo 2"; font-weight: 800; font-size: 26px; letter-spacing: -.5px; }

/* ---------- segmentado (sabor no form) ---------- */
/* caixas de quantidade por sabor (morango + banana na mesma venda) */
.qtybox { display: flex; flex-direction: column; gap: 4px; padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.qtybox span { font-size: 13px; font-weight: 700; color: var(--muted); }
.qtybox input { border: none; background: none; color: var(--ink); font-size: 26px; font-family: "Baloo 2"; font-weight: 800; padding: 0; width: 100%; outline: none; }

/* ---------- vendedores (ajustes) ---------- */
.addrow { display: flex; gap: 9px; margin-bottom: 8px; }
.addrow input { flex: 1; padding: 12px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.addrow input:focus { outline: none; border-color: var(--acai); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acai) 20%, transparent); }
.sellers { margin-top: 6px; }
.seller { padding: 12px 0; }
.seller + .seller { border-top: 1px solid var(--line); }
.seller-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.seller-top b { font-weight: 600; font-size: 15.5px; }
.seller-top .pin { font-family: "Baloo 2"; font-weight: 800; color: var(--acai); background: color-mix(in srgb, var(--acai) 12%, transparent); padding: 3px 11px; border-radius: 999px; font-size: 14px; letter-spacing: .5px; }
.seller-acts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; align-items: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
