:root {
  --bg: #0d1015; --bg-2: #11151b; --surface: #161b22; --surface-2: #1c222b; --surface-3: #242b36;
  --ink: #f1f4f8; --muted: #98a2b1; --faint: #6b7483; --line: #262d38; --line-soft: #1d232c;
  --blue: #0ea5f0; --blue-deep: #0b8fd3; --blue-ink: #ffffff; --blue-soft: rgba(14,165,240,.12); --blue-line: rgba(14,165,240,.35);
  --pos: #34d399; --pos-soft: rgba(52,211,153,.13);
  --warn: #f5b84a; --warn-soft: rgba(245,184,74,.14);
  --danger: #f87171; --danger-soft: rgba(248,113,113,.14);
  --shadow: 0 24px 60px -16px rgba(0,0,0,.6);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.04);
  --glow: 0 12px 26px -10px rgba(14,165,240,.55);
  --radius: 16px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f6f9; --bg-2: #eef1f5; --surface: #ffffff; --surface-2: #f3f5f8; --surface-3: #e8ecf1;
  --ink: #111827; --muted: #5b6574; --faint: #8a93a1; --line: #e2e6ec; --line-soft: #edf0f4;
  --blue: #0b8fd3; --blue-deep: #0878b3; --blue-soft: rgba(11,143,211,.10); --blue-line: rgba(11,143,211,.35);
  --pos: #059669; --pos-soft: rgba(5,150,105,.10);
  --warn: #b7791f; --warn-soft: rgba(183,121,31,.12);
  --danger: #dc2626; --danger-soft: rgba(220,38,38,.10);
  --shadow: 0 24px 60px -16px rgba(17,24,39,.18);
  --shadow-sm: 0 1px 2px rgba(17,24,39,.06), inset 0 1px 0 rgba(255,255,255,.7);
  --glow: 0 12px 26px -10px rgba(11,143,211,.4);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
svg { flex-shrink: 0; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.app { max-width: 1080px; margin: 0 auto; padding-bottom: 60px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.tab { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 500; font-size: 15px; }
.tab.active { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 10px 20px; border-bottom: 1px solid var(--line); }
.topbar .title { font-weight: 500; font-size: 15px; }
.topbar .title b { color: var(--blue); font-weight: 700; letter-spacing: .14em; margin-right: 8px; }
.icon-btns { display: flex; gap: 4px; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--ink); }
.icon-btn:hover { background: var(--surface-2); }
main { padding: 28px 16px 0; }
.eyebrow { color: var(--blue); font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
h1 { font-size: clamp(28px, 7vw, 36px); line-height: 1.1; margin: 8px 0 22px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 18px; margin: 0; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
@media (max-width: 480px) {
  .tab { font-size: 13.5px; gap: 7px; height: 48px; white-space: nowrap; }
  .tab svg { width: 19px; height: 19px; }
  .tabs { gap: 8px; padding: 12px; }
  .actions .btn { flex: 1 1 0; padding: 0 12px; font-size: 14px; gap: 7px; }
  .actions .btn svg { width: 18px; height: 18px; }
  .tile { padding: 14px; min-height: 108px; }
  .tile-head { font-size: 13px; }
  .tile-ico { width: 34px; height: 34px; }
  .tile-ico svg { width: 18px; height: 18px; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 50px; padding: 0 20px; border-radius: 13px; border: 1px solid var(--line); background: transparent; font-weight: 600; font-size: 15px; transition: transform .08s, background .15s, filter .15s, box-shadow .2s, border-color .15s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
a.btn { text-decoration: none; color: var(--ink); }
.btn-primary { background: linear-gradient(180deg, var(--blue), var(--blue-deep)); border-color: transparent; color: var(--blue-ink); box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.22); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--blue-line); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); border-color: var(--danger-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--blue); font-weight: 600; padding: 0; }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 820px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-height: 118px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow-sm); }
.tile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 14px; }
.tile-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(180deg, var(--blue-soft), transparent); border: 1px solid var(--blue-line); color: var(--blue); }
.tile .v { font-size: clamp(24px, 6.4vw, 32px); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tile .v.money { font-size: clamp(20px, 5.4vw, 26px); }
.eye { background: none; border: 0; color: var(--faint); padding: 2px; display: grid; }
.blur { filter: blur(7px); user-select: none; }

/* ---------- Sections / lists ---------- */
.section { margin-top: 30px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.list { overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.pos { color: var(--pos); } .amt.neg { color: var(--danger); }
.dest-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--blue); }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.pill.wait { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--pos-soft); color: var(--pos); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------- Financeiro ---------- */
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav span { min-width: 120px; text-align: center; font-weight: 600; white-space: nowrap; }
.fin-hero { padding: 20px; display: grid; gap: 16px; }
.fin-hero .big { font-size: clamp(30px, 8vw, 40px); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fin-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fin-split > div { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.fin-split .l { color: var(--muted); font-size: 12.5px; }
.fin-split .n { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; background: var(--pos); }
.bar i + i { background: var(--danger); }

/* ---------- Modal / sheet ---------- */
.overlay { position: fixed; inset: 0; background: rgba(5,8,12,.62); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; z-index: 50; animation: fade .15s; }
@media (min-width: 720px) { .overlay { align-items: center; padding: 24px; } }
.sheet { background: var(--bg-2); border: 1px solid var(--line); width: 100%; max-width: 560px; max-height: 92vh; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; animation: up .2s ease-out; }
.sheet.wide { max-width: 860px; }
@media (min-width: 720px) { .sheet { border-radius: 20px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 17px; }
.sheet-body { padding: 18px 20px; overflow-y: auto; }
.sheet-foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); outline: none; width: 100%; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12.5px; color: var(--faint); margin-top: -6px; margin-bottom: 12px; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-bottom: 16px; }
.choice { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.choice.on { border-color: var(--blue); color: var(--ink); background: var(--blue-soft); }
.choice svg { color: var(--blue); }

/* ---------- Catálogo ---------- */
.prod-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .prod-grid { grid-template-columns: 1fr 1fr; } }
.prod { padding: 16px; display: grid; gap: 14px; }
.prod-top { display: flex; gap: 14px; }
.prod-img { width: 92px; height: 92px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; }
.prod-banner { margin: -16px -16px 0; height: 220px; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: #ece7e0; }
.prod-banner img { width: 100%; height: 100%; object-fit: contain; display: block; }
.prod h3 { margin: 0 0 4px; font-size: 16px; }
.prod p { margin: 0; color: var(--muted); font-size: 13px; }
.price { font-size: 20px; font-weight: 700; margin-top: 6px; }
.price small { font-size: 12px; color: var(--muted); font-weight: 500; }
.opt-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); padding: 0; position: relative; }
.sw.on { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.chip.on { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--surface); }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 20px; color: var(--blue); }
.stepper input { width: 64px; text-align: center; border: 0; background: transparent; font-weight: 700; font-size: 16px; height: 44px; outline: none; }
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tiers { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.tiers span { background: var(--surface-2); padding: 3px 8px; border-radius: 6px; }
.tiers span.on { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.cart-bar { flex: 1; min-width: 0; }
.cart-bar .l { font-size: 12.5px; color: var(--muted); }
.cart-bar .n { font-size: 19px; font-weight: 700; }
.cart-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.cart-item:last-child { border-bottom: 0; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); flex-shrink: 0; }

/* ---------- Ativar / NFC ---------- */
.nfc-wave { width: 120px; height: 120px; margin: 10px auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); position: relative; }
.nfc-wave.on::before, .nfc-wave.on::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--blue); animation: ping 1.6s infinite; }
.nfc-wave.on::after { animation-delay: .8s; }
@keyframes ping { from { transform: scale(1); opacity: .7; } to { transform: scale(1.6); opacity: 0; } }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; font-size: 14px; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 700; font-size: 13px; display: grid; place-items: center; flex-shrink: 0; }
.url-box { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px dashed var(--blue-line); border-radius: 11px; padding: 10px 10px 10px 14px; margin-bottom: 16px; }
.url-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--blue-soft); color: var(--ink); font-size: 13.5px; margin-bottom: 16px; }
.notice.warn { background: var(--warn-soft); }
.notice svg { color: var(--blue); margin-top: 2px; }
.notice.warn svg { color: var(--warn); }
.center { text-align: center; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(900px 500px at 50% -10%, var(--blue-soft), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-logo .mark { width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 16px; background: var(--blue); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 30px var(--blue-soft); }
.auth-logo .wm { font-weight: 800; letter-spacing: .3em; font-size: 22px; padding-left: .3em; }
.auth-logo .wm .hub { color: var(--blue); letter-spacing: .04em; margin-left: .42em; }
.auth-logo .sub { color: var(--muted); font-size: 13.5px; }
.auth-box { padding: 24px; }
.auth-box h2 { font-size: 21px; margin-bottom: 4px; }
.auth-box .lead { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.auth-alt { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.code-inputs { display: flex; gap: 8px; justify-content: center; margin: 6px 0 10px; }
.code-inputs input { width: 46px; height: 56px; text-align: center; font-size: 22px; font-weight: 700; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); outline: none; }
.code-inputs input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-wrap button { position: absolute; right: 4px; top: 4px; }

/* ---------- Toast / dev inbox ---------- */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 80; box-shadow: var(--shadow); max-width: calc(100% - 32px); animation: up .2s; }
.dev-mail { position: fixed; right: 16px; top: 16px; z-index: 90; width: min(340px, calc(100% - 32px)); background: var(--surface); border: 1px solid var(--blue-line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); animation: up .2s; }
.dev-mail .h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--blue); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.dev-mail .code { font-size: 28px; font-weight: 800; letter-spacing: .25em; margin: 6px 0 2px; }
.dev-mail p { margin: 0; font-size: 12.5px; color: var(--muted); }
.custo-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line); background: transparent; font-size: 14px; color: var(--muted); text-align: left; }
.admin-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.admin-metrics > div { text-align: center; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; }
.admin-metrics b { display: block; font-size: 18px; font-weight: 800; line-height: 1.15; }
.admin-metrics span { font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .01em; }
.lanc-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.lanc-row:last-of-type { border-bottom: 0; }
.lanc-row .grow .t { font-size: 15px; font-weight: 600; }
.lanc-row .stepper { flex-shrink: 0; }
.lanc-row .stepper input { width: 52px; }
.fin-dia-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px; color: var(--muted); font-weight: 600; }
.fin-dia-row input { height: 42px; width: auto; max-width: 180px; }
.fin-dia-row .link-btn { display: inline-flex; align-items: center; gap: 4px; }
.sw-pick { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; }
.sw-pick svg { color: #fff; mix-blend-mode: difference; pointer-events: none; }
.sw-pick input[type="color"] { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); opacity: 0; border: 0; padding: 0; cursor: pointer; }
.custo-line b { color: var(--ink); }
.custo-line .link-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; }
.search-row { display: flex; gap: 8px; }
.search-row .btn { width: 50px; padding: 0; flex-shrink: 0; }
.results:empty { display: none; }
.results { margin: -4px 0 14px; max-height: 300px; overflow-y: auto; }
.result { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-soft); text-align: left; color: inherit; }
.result:hover { background: var(--surface-2); }
.picked { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--pos-soft); margin-bottom: 14px; }
.picked > svg { color: var(--pos); }
.picked .s { color: var(--muted); font-size: 12.5px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; margin: 4px 0 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.qr-wrap { display: flex; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin-bottom: 18px; }
.qr { width: 132px; height: 132px; flex-shrink: 0; background: #fff; border-radius: 10px; padding: 8px; display: grid; place-items: center; }
.qr canvas, .qr img { width: 116px !important; height: 116px !important; }
.qr-side { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.qr-side b { color: var(--ink); font-size: 15px; }
.qr-side .btn { justify-self: start; }
.howto { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 0 14px; }
.howto summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 0; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); }
.howto summary::-webkit-details-marker { display: none; }
.howto summary svg { color: var(--blue); }
.howto[open] { padding-bottom: 14px; }
.choice .cnt { font-size: 11px; font-weight: 700; color: var(--pos); margin-top: -2px; }
.choice .cnt.zero { color: var(--danger); }
.pix-line { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.pix-line > svg { color: #32bcad; }
.pix-line b { display: block; font-size: 14.5px; }
.pix-line span { color: var(--muted); font-size: 13px; }
.check.warnbox { align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); font-weight: 500; font-size: 13.5px; line-height: 1.45; }
.check.warnbox input { margin-top: 2px; flex-shrink: 0; }
.pix-line .btn { flex-shrink: 0; }
a.icon-btn { color: var(--ink); text-decoration: none; }
