:root {
  --fs: 1;
  --p: #6D4AE8; --p2: #8B6CF6; --pd: #4C2FC4; --pl: #EEE9FF;
  --bg: #F3F0FC; --card: #FFFFFF; --ink: #1E1B2E; --mut: #5F5B73; --line: #E6E1F5;
  --pos: #15803D; --neg: #DC2626; --warn: #B45309;
  --r: 22px; --sh: 0 6px 24px rgba(76, 47, 196, .08), 0 1px 3px rgba(30, 27, 46, .05);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: calc(17px * var(--fs)); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.4; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(circle at 10% -10%, #E3DAFF 0, transparent 45%), radial-gradient(circle at 110% 10%, #EDE6FF 0, transparent 40%);
  background-attachment: fixed;
}
body.lock { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; color: var(--mut); margin-bottom: .3rem; }
p { margin: .3rem 0; }
.muted { color: var(--mut); }
.center { text-align: center; }
.pad { padding: 0 .4rem; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.row { display: flex; align-items: center; gap: .6rem; }
.between { justify-content: space-between; }
.center-row { display: flex; justify-content: center; margin: .2rem 0 .8rem; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; }
.view { padding: max(16px, env(safe-area-inset-top)) 16px calc(110px + env(safe-area-inset-bottom)); }

/* cartões */
.card { background: var(--card); border-radius: var(--r); padding: 1.1rem; box-shadow: var(--sh); margin-bottom: 1rem; border: 1px solid rgba(109, 74, 232, .06); }
.card > h2 { margin-bottom: .5rem; }
.top { display: flex; align-items: center; gap: .6rem; margin: .4rem 0 1rem; min-height: 48px; }
.ib { width: 48px; height: 48px; border-radius: 16px; display: inline-grid; place-items: center; font-size: 1.3rem; background: var(--card); box-shadow: var(--sh); flex: none; }
.ib:disabled { opacity: .35; }
.back { font-size: 1.5rem; font-weight: 700; }

/* saudação */
.hello { display: flex; align-items: center; gap: .8rem; margin: .4rem 0 1.1rem; }
.hello > div:nth-child(2) { flex: 1; min-width: 0; }
.hello p { margin: .1rem 0 0; color: var(--mut); }
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: #fff; background: linear-gradient(135deg, var(--p2), var(--pd)); flex: none; box-shadow: 0 6px 16px rgba(109, 74, 232, .35); }
.bell { position: relative; width: 52px; height: 52px; border-radius: 18px; background: var(--card); box-shadow: var(--sh); font-size: 1.35rem; flex: none; }
.bell i { position: absolute; top: 6px; right: 6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--neg); color: #fff; font-size: .72rem; font-style: normal; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }

/* resumo */
.summary .row.between { margin-bottom: .6rem; flex-wrap: wrap; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; padding: .45rem 0; font-size: 1.02rem; }
.kv b { font-size: 1.2rem; font-weight: 800; white-space: nowrap; }
.kv.big { border-top: 2px solid var(--line); margin-top: .6rem; padding-top: .8rem; }
.kv.big span { font-weight: 700; }
.kv.big b { font-size: 1.6rem; }
.kv.sep { border-top: 1px dashed var(--line); margin-top: .2rem; }
.bar { height: 12px; background: var(--pl); border-radius: 99px; overflow: hidden; margin: .5rem 0 .3rem; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--p2), var(--p)); transition: width .4s; }
.bar i.hot { background: linear-gradient(90deg, #F59E0B, #DC2626); }
.bar i.good { background: linear-gradient(90deg, #34D399, #15803D); }

.mpick { display: inline-flex; align-items: center; gap: .3rem; background: var(--pl); border-radius: 16px; padding: 4px; font-weight: 700; }
.mpick .ib { width: 40px; height: 40px; box-shadow: none; background: #fff; font-size: 1.4rem; border-radius: 12px; }
.mpick span { min-width: 8.5em; text-align: center; font-size: .95rem; }

/* atalhos */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1rem; }
.tile { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 1.1rem .6rem; display: flex; flex-direction: column; align-items: center; gap: .55rem; font-weight: 700; font-size: 1rem; min-height: 120px; justify-content: center; text-align: center; border: 1px solid rgba(109, 74, 232, .06); transition: transform .12s; }
.tile:active { transform: scale(.97); }
.tic { width: 58px; height: 58px; border-radius: 50%; background: var(--pl); display: grid; place-items: center; font-size: 1.6rem; }

/* alertas */
.alert { display: flex; gap: .8rem; align-items: center; padding: .9rem; border-radius: 18px; margin-top: .6rem; background: #F6F4FD; cursor: default; }
.alert[data-go], .alert[data-act] { cursor: pointer; }
.alert b { display: block; font-size: 1.02rem; }
.alert p { margin: .15rem 0 0; font-size: .93rem; color: #3f3b52; }
.alert > div { flex: 1; }
.aico { font-size: 1.7rem; flex: none; width: 48px; height: 48px; display: grid; place-items: center; background: #fff; border-radius: 14px; }
.alert.warn { background: #FFF4E0; }
.alert.danger { background: #FEE7E7; }
.alert.danger b { color: #B91C1C; }
.alert.good { background: #E7F8EE; }
.chev { font-size: 1.6rem; color: #9B95B5; flex: none; }

/* listas */
.list { padding: .6rem .9rem; }
.list > h2, .list > h3 { padding: .4rem .2rem .2rem; }
.list > small { display: block; padding: 0 .2rem .4rem; }
.li { width: 100%; display: flex; align-items: center; gap: .8rem; padding: .75rem .2rem; text-align: left; border-bottom: 1px solid var(--line); min-height: 64px; }
.li:last-child, .li:last-of-type { border-bottom: 0; }
.li.danger b { color: var(--neg); }
.cic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.45rem; background: var(--pl); flex: none; }
.cic.xl { width: 78px; height: 78px; font-size: 2.4rem; border-radius: 24px; margin: 0 auto .4rem; }
.lt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lt b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt small { color: var(--mut); font-size: .88rem; }
.amt { font-weight: 800; white-space: nowrap; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.pct { font-weight: 800; color: var(--mut); }
.mini { height: 7px; background: var(--pl); border-radius: 9px; margin-top: .35rem; overflow: hidden; }
.mini i { display: block; height: 100%; border-radius: 9px; }
.delta { font-size: .78rem; font-weight: 700; color: var(--mut); }
.delta.up { color: var(--neg); }
.delta.down { color: var(--pos); }

/* abas */
.seg { display: flex; background: #fff; border-radius: 18px; padding: 5px; gap: 5px; box-shadow: var(--sh); margin-bottom: 1rem; }
.seg button { flex: 1; padding: .8rem .4rem; border-radius: 14px; font-weight: 700; color: var(--mut); min-height: 52px; }
.seg button.on { background: linear-gradient(135deg, var(--p2), var(--p)); color: #fff; box-shadow: 0 4px 12px rgba(109, 74, 232, .35); }
.card .seg { box-shadow: none; background: var(--pl); margin: 0; }

/* rosca */
.total { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.donut { position: relative; width: min(260px, 72vw); margin: 1rem auto .4rem; }
.donut svg { width: 100%; display: block; }
.donut circle { transition: stroke-dasharray .5s; }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-c b { font-size: 1.3rem; font-weight: 800; }
.donut-c small { color: var(--mut); font-size: .85rem; max-width: 9em; }

/* botões */
.btn { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; border-radius: 18px; padding: .9rem 1rem; font-weight: 700; min-height: 56px; margin-top: .7rem; transition: transform .12s, filter .12s; }
.btn:active { transform: scale(.98); }
.btn.big { min-height: 64px; font-size: 1.08rem; }
.btn.primary { background: linear-gradient(135deg, var(--p2), var(--p) 60%, var(--pd)); color: #fff; box-shadow: 0 8px 20px rgba(109, 74, 232, .35); }
.btn.soft { background: var(--pl); color: var(--pd); }
.btn.danger { background: #FEE7E7; color: #B91C1C; }

/* formulários */
.fl { display: block; margin-top: .9rem; }
.fl > span { display: block; font-weight: 700; margin-bottom: .4rem; }
input, select { width: 100%; min-height: 56px; border: 2px solid var(--line); background: #FBFAFF; border-radius: 16px; padding: .6rem .9rem; outline: none; font-size: 1.05rem; }
input:focus, select:focus { border-color: var(--p); background: #fff; box-shadow: 0 0 0 4px rgba(109, 74, 232, .15); }
.money-in { display: flex; align-items: center; gap: .5rem; border: 2px solid var(--line); background: #FBFAFF; border-radius: 16px; padding: 0 1rem; margin: .4rem 0; }
.money-in:focus-within { border-color: var(--p); box-shadow: 0 0 0 4px rgba(109, 74, 232, .15); }
.money-in input { border: 0; background: none; box-shadow: none !important; padding: 0; font-weight: 800; font-size: 1.4rem; }
.money-in span { font-weight: 800; font-size: 1.3rem; color: var(--mut); }
.money-in.huge input { font-size: 2rem; min-height: 72px; }
.hint { background: var(--pl); border-radius: 14px; padding: .8rem; margin-top: .6rem; font-weight: 600; }

.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.cg { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .7rem .3rem; border-radius: 16px; border: 2px solid var(--line); background: #fff; font-size: .82rem; font-weight: 700; line-height: 1.15; text-align: center; min-height: 84px; }
.cg span { font-size: 1.6rem; }
.cg.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }

/* ticket */
.hero { text-align: center; padding: 1.6rem 1.1rem; background: linear-gradient(180deg, #F1ECFF, #fff); }
.hero h2 { font-size: 1.35rem; margin: .9rem 0 .4rem; }
.scan { width: 150px; height: 150px; margin: 0 auto; position: relative; display: grid; place-items: center; font-size: 4.6rem; }
.scan::before { content: ''; position: absolute; inset: 0; border-radius: 20px; background:
  linear-gradient(var(--p), var(--p)) top left / 34px 5px, linear-gradient(var(--p), var(--p)) top left / 5px 34px,
  linear-gradient(var(--p), var(--p)) top right / 34px 5px, linear-gradient(var(--p), var(--p)) top right / 5px 34px,
  linear-gradient(var(--p), var(--p)) bottom left / 34px 5px, linear-gradient(var(--p), var(--p)) bottom left / 5px 34px,
  linear-gradient(var(--p), var(--p)) bottom right / 34px 5px, linear-gradient(var(--p), var(--p)) bottom right / 5px 34px;
  background-repeat: no-repeat; }
.scan::after { content: ''; position: absolute; left: 12px; right: 12px; height: 3px; background: var(--p); box-shadow: 0 0 12px var(--p); border-radius: 3px; animation: scan 2s ease-in-out infinite; }
@keyframes scan { 0%, 100% { top: 14%; } 50% { top: 84%; } }
.rprev { max-width: 70%; max-height: 260px; border-radius: 14px; box-shadow: var(--sh); }
.note p { font-size: .95rem; }
.ok-head { margin: .4rem 0 1rem; }
.okc { width: 76px; height: 76px; border-radius: 50%; background: linear-gradient(135deg, #34D399, #15803D); color: #fff; font-size: 2.6rem; font-weight: 800; display: grid; place-items: center; margin: 0 auto .6rem; box-shadow: 0 10px 24px rgba(21, 128, 61, .3); animation: pop .4s ease-out; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.ritem { display: flex; gap: .6rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.rmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.rmain input, .rmain select { min-height: 44px; padding: .3rem .6rem; font-size: .98rem; border-radius: 12px; }
.rname { font-weight: 700; }
.rright { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; width: 6.2em; flex: none; }
.rprice { min-height: 44px; padding: .3rem .5rem; text-align: right; font-weight: 800; border-radius: 12px; }
.ib.del { width: 40px; height: 40px; font-size: 1rem; box-shadow: none; background: #FEE7E7; color: #B91C1C; border-radius: 12px; }

/* relatórios */
.legend { display: flex; gap: 1rem; font-size: .9rem; color: var(--mut); margin-bottom: .4rem; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: .35rem; vertical-align: -1px; }
.lg.in, .bpair i.in { background: #34D399; }
.lg.out, .bpair i.out { background: var(--p); }
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; height: 190px; align-items: end; margin: .6rem 0 .4rem; }
.bcol { height: 100%; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .3rem 0; border-radius: 12px; }
.bcol.on { background: var(--pl); }
.bpair { flex: 1; width: 100%; display: flex; justify-content: center; align-items: flex-end; gap: 3px; }
.bpair i { width: 34%; max-width: 16px; border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bcol small { font-weight: 700; color: var(--mut); font-size: .8rem; }

/* metas */
.goal h2 { font-size: 1.1rem; }
.goal .ib { width: 42px; height: 42px; font-size: 1.05rem; box-shadow: none; background: var(--pl); }
.emoji-xl { font-size: 3rem; }
.pill { background: var(--pl); color: var(--pd); font-weight: 700; font-size: .8rem; padding: .3rem .7rem; border-radius: 99px; white-space: nowrap; }

/* barra inferior */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 560px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: .4rem .3rem calc(.5rem + env(safe-area-inset-bottom)); z-index: 20; border-radius: 22px 22px 0 0; box-shadow: 0 -6px 24px rgba(76, 47, 196, .08); }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .78rem; font-weight: 700; color: var(--mut); padding: .35rem 0; min-height: 60px; justify-content: center; }
.tabbar .ti { font-size: 1.45rem; filter: grayscale(1); opacity: .6; }
.tabbar button.on { color: var(--p); }
.tabbar button.on .ti { filter: none; opacity: 1; }
.tabbar .fab { align-self: center; }
.tabbar .fab span { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 2.2rem; font-weight: 500; background: linear-gradient(135deg, var(--p2), var(--pd)); box-shadow: 0 8px 20px rgba(109, 74, 232, .45); margin-top: -26px; border: 4px solid #fff; }

/* folha */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(30, 27, 46, .45); animation: fade .2s; }
.sheet-card { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: #fff; border-radius: 28px 28px 0 0; padding: 1.2rem 1.1rem calc(1.4rem + env(safe-area-inset-bottom)); animation: up .25s ease-out; }
.sh-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.sh-head .ib { box-shadow: none; background: var(--pl); }
.sheet-card .seg { box-shadow: none; background: var(--pl); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: .9rem 1.3rem; border-radius: 16px; font-weight: 700; z-index: 60; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: up .25s; }

/* boas-vindas */
.welcome { text-align: center; padding-top: 1.5rem; }
.welcome .logo { width: 92px; height: 92px; border-radius: 28px; margin: 0 auto .6rem; display: grid; place-items: center; font-size: 3rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--p2), var(--pd)); box-shadow: 0 12px 30px rgba(109, 74, 232, .4); }
.welcome h1 { font-size: 2rem; margin-bottom: 1rem; }
.welcome h2 { margin-top: 1.2rem; font-size: 1.4rem; }
.welcome .card { text-align: left; margin-top: 1rem; }

@media (min-width: 600px) {
  .view { padding-top: 28px; }
}

/* seletor de idioma pequeno */
.lpill { display: inline-flex; gap: 3px; padding: 4px; border-radius: 14px; background: var(--pl); flex: none; }
.lpill button { min-width: 46px; height: 38px; border-radius: 10px; font-weight: 800; font-size: .9rem; color: var(--mut); letter-spacing: .03em; }
.lpill button.on { background: linear-gradient(135deg, var(--p2), var(--p)); color: #fff; box-shadow: 0 3px 10px rgba(109, 74, 232, .35); }
.wtop { display: flex; justify-content: flex-end; margin-bottom: .4rem; }
.wtop .lpill { background: #fff; box-shadow: var(--sh); }
.fixedhome > .row { padding: .4rem .2rem .3rem; }
.fixedhome > .row b { font-size: 1.1rem; font-weight: 800; }
.fixedhome .btn { margin-bottom: .4rem; }
