/* Meu Bob · estilos */
@font-face { font-family: "Bricolage"; src: url("fonts/bricolage.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  --gabriel: #2F5BEA; --gabriel-soft: #EBF0FE; --gabriel-ink: #1F43C4;
  --jaine: #E2458F; --jaine-soft: #FDEBF3; --jaine-ink: #B8286A;
  --casa: #8850BC; --casa-soft: #F3ECFA; --casa-ink: #6B3799;
  --in: #0E9A5F; --in-soft: #E3F5EC; --out: #D93A2F; --out-soft: #FDECEA;
  --warn: #B86E00; --warn-soft: #FFF3DC;
  --ink: #1B2140; --ink-2: #474D6B; --muted: #767C96; --faint: #A3A8BD;
  --line: #E7E9F1; --line-2: #F1F2F7; --bg: #FFFFFF; --tint: #F6F7FB;
  --me: var(--gabriel); --me-soft: var(--gabriel-soft); --me-ink: var(--gabriel-ink);
  --r-l: 20px; --r-m: 14px; --r-s: 10px;
  --display: "Bricolage", "Figtree", system-ui, sans-serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --float: 0 10px 30px rgba(27, 33, 64, .14), 0 2px 6px rgba(27, 33, 64, .08);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabbar-h: 66px;
}
body.me-jaine { --me: var(--jaine); --me-soft: var(--jaine-soft); --me-ink: var(--jaine-ink); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--text); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
.tab, .btn, .nav-link, .brand, .stat, .row-btn, .me-chip { text-decoration: none; }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.money-in { color: var(--in); }
.money-out { color: var(--out); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--me) 45%, transparent); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Marca ---------- */
.mark { display: block; object-fit: contain; }
.wordmark { font-family: var(--display); font-weight: 750; letter-spacing: -.02em; }

/* ---------- Login ---------- */
.login {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(32px + var(--safe-t)) 24px calc(32px + var(--safe-b)); text-align: center;
}
.login .mark { width: 150px; height: 159px; margin-bottom: 12px; animation: pop-in .7s cubic-bezier(.2, .9, .3, 1.25) both; }
@keyframes pop-in { from { transform: translateY(12px) scale(.9); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
.login h1 { font-size: 34px; margin: 0; line-height: 1.1; }
.login .lead { color: var(--muted); margin: 6px 0 30px; }
.login form { width: 100%; max-width: 360px; }
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.who-btn {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 12px 16px;
  border: 1.5px solid var(--line); border-radius: var(--r-l); font-weight: 700; font-size: 16px;
  transition: border-color .15s, background .15s;
}
.who-btn .avatar { width: 52px; height: 52px; font-size: 22px; }
.who-btn.gabriel[aria-pressed="true"] { border-color: var(--gabriel); background: var(--gabriel-soft); color: var(--gabriel-ink); }
.who-btn.jaine[aria-pressed="true"] { border-color: var(--jaine); background: var(--jaine-soft); color: var(--jaine-ink); }
.login-err { color: var(--out); min-height: 22px; margin: 10px 0 0; font-size: 14px; }
.login .field { text-align: left; }
.login .btn { width: 100%; margin-top: 14px; }
.login-note { margin-top: 28px; font-size: 13px; color: var(--faint); max-width: 360px; }
.setup-box { max-width: 420px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; margin-top: 18px; }
.setup-box li { margin: 4px 0; }

/* ---------- Avatar ---------- */
.avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  font-family: var(--display); font-weight: 750; color: #fff; background: var(--gabriel); flex: none;
}
.avatar.jaine { background: var(--jaine); }
.avatar.casa { background: var(--casa); }

/* ---------- Estrutura ---------- */
.shell { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: calc(10px + var(--safe-t)) 16px 10px; background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-2);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .mark { width: 32px; height: 34px; }
.brand .wordmark { font-size: 19px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 4px 8px; border-radius: 999px; }
.sync.offline { color: var(--warn); background: var(--warn-soft); }
.sync .ic { width: 15px; height: 15px; }
.me-chip { border-radius: 50%; padding: 2px; border: 2px solid var(--me); }
.me-chip .avatar { width: 30px; height: 30px; font-size: 14px; }

.main { padding: 14px 16px calc(var(--tabbar-h) + 28px + var(--safe-b)); max-width: 720px; margin: 0 auto; overflow-x: clip; }
.dash > *, .stack > *, .grid-2 > *, .stats > * { min-width: 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: end; height: calc(var(--tabbar-h) + var(--safe-b)); padding: 0 6px var(--safe-b);
  background: #fff; border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 10px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tab .ic { width: 23px; height: 23px; }
.tab[aria-current="page"] { color: var(--me-ink); }
.tab[aria-current="page"] .ic { stroke-width: 2.4; }
.fab-slot { display: flex; justify-content: center; }
.fab {
  width: 60px; height: 60px; border-radius: 50%; background: var(--me); color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--me) 45%, transparent); transform: translateY(-18px);
  border: 4px solid #fff;
}
.fab .ic { width: 28px; height: 28px; stroke-width: 2.6; }

.side { display: none; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 252px 1fr; }
  .topbar, .tabbar { display: none; }
  .side {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100dvh; padding: 22px 14px;
    border-right: 1px solid var(--line); background: #fff;
  }
  .side .brand { padding: 4px 10px 18px; }
  .side .brand .mark { width: 40px; height: 42px; }
  .side .brand .wordmark { font-size: 21px; }
  .side .btn.new { margin: 0 4px 14px; }
  .nav-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-weight: 600;
    color: var(--ink-2); text-decoration: none;
  }
  .nav-link:hover { background: var(--tint); }
  .nav-link[aria-current="page"] { background: var(--me-soft); color: var(--me-ink); }
  .side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 10px 4px; border-top: 1px solid var(--line-2); }
  .side-foot .who-name { font-weight: 700; line-height: 1.2; }
  .side-foot small { color: var(--muted); display: block; }
  .main { max-width: 1120px; padding: 28px 36px 60px; width: 100%; }
}

/* ---------- Cabeçalho de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.page-head h1 { font-family: var(--display); font-weight: 720; font-size: 27px; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
@media (min-width: 960px) { .page-head h1 { font-size: 32px; } }

.monthbar { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: #fff; }
.monthbar button { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.monthbar button:hover { background: var(--tint); }
.monthbar .label { width: auto; padding: 0 10px; border-radius: 999px; font-weight: 700; font-size: 14px; min-width: 132px; }
.page-head .monthbar { margin-left: auto; }

/* ---------- Blocos ---------- */
.card { border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; background: #fff; }
.card + .card, .stack > * + * { margin-top: 14px; }
.card h2, .section-title {
  font-family: var(--display); font-size: 17px; font-weight: 680; letter-spacing: -.01em; margin: 0 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card h2 a, .card h2 button.link { font-family: var(--text); font-size: 13.5px; font-weight: 650; color: var(--me-ink); text-decoration: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dash { display: grid; gap: 14px; }
.dash > * + * { margin-top: 0 !important; }
@media (min-width: 960px) {
  .dash { grid-template-columns: 1.25fr 1fr; align-items: start; }
  .dash .span-2 { grid-column: 1 / -1; }
}

.hero { padding: 18px 18px 16px; }
.hero .label { color: var(--muted); font-weight: 600; font-size: 14px; }
.big { font-family: var(--display); font-weight: 720; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.hero .big { font-size: 40px; margin: 4px 0 2px; }
.hero .hint { color: var(--muted); font-size: 14px; }
.flow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.flow > div { border-radius: var(--r-m); padding: 11px 12px; }
.flow .in { background: var(--in-soft); }
.flow .out { background: var(--out-soft); }
.flow span { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 650; }
.flow .in span { color: var(--in); } .flow .out span { color: var(--out); }
.flow span .ic { width: 16px; height: 16px; }
.flow strong { display: block; font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -.015em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.flow small { color: var(--ink-2); font-size: 12.5px; }
.meter { height: 10px; border-radius: 999px; background: var(--in-soft); overflow: hidden; margin-top: 14px; display: flex; }
.meter i { display: block; height: 100%; background: var(--out); border-radius: 999px; }
.meter-note { font-size: 13px; color: var(--muted); margin-top: 6px; }

.tri { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--line-2); gap: 2px; }
.tri i { display: block; height: 100%; }
.tri .casa { background: var(--casa); } .tri .gabriel { background: var(--gabriel); } .tri .jaine { background: var(--jaine); }
.tri-legend { display: grid; gap: 8px; margin-top: 12px; }
.tri-legend div { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tri-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.tri-legend small { color: var(--muted); width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.casa { background: var(--casa); } .dot.gabriel { background: var(--gabriel); } .dot.jaine { background: var(--jaine); }

.stat { border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px; background: #fff; text-align: left; width: 100%; display: block; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat strong { display: block; font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -.015em; font-variant-numeric: tabular-nums; margin-top: 3px; }
.stat small { font-size: 12.5px; color: var(--muted); }
.stat.alert { border-color: color-mix(in srgb, var(--out) 35%, white); background: var(--out-soft); }
.stat.alert strong { color: var(--out); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } }

.banner {
  display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r-m); padding: 13px 14px; margin-bottom: 14px;
  background: var(--me-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--me) 25%, white);
}
.banner .ic { color: var(--me-ink); margin-top: 1px; }
.banner p { margin: 0; font-size: 14px; }
.banner strong { display: block; }
.banner .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.banner.warn { background: var(--out-soft); border-color: color-mix(in srgb, var(--out) 25%, white); }
.banner.warn .ic { color: var(--out); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 14px; font-weight: 700; font-size: 15px; background: var(--tint); color: var(--ink); border: 1px solid var(--line);
}
.btn.primary { background: var(--me); color: #fff; border-color: transparent; }
.btn.primary:disabled { opacity: .55; }
.btn.danger { color: var(--out); background: #fff; border-color: color-mix(in srgb, var(--out) 30%, white); }
.btn.small { min-height: 36px; padding: 0 13px; font-size: 14px; border-radius: 11px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--me-ink); }
.btn.block { width: 100%; }
.btn .ic { width: 18px; height: 18px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: var(--tint); }

/* ---------- Segmentado e chips ---------- */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--tint); border-radius: 14px; margin-bottom: 14px; overflow-x: auto; }
.seg button { flex: 1; min-height: 38px; padding: 0 12px; border-radius: 11px; font-weight: 650; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(27, 33, 64, .1); }
.seg.kind button[aria-pressed="true"].out { color: var(--out); }
.seg.kind button[aria-pressed="true"].in { color: var(--in); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; color: var(--ink-2);
}
.chip .ic { width: 17px; height: 17px; }
.chip[aria-pressed="true"] { border-color: var(--c, var(--me)); background: color-mix(in srgb, var(--c, var(--me)) 12%, white); color: var(--ink); }
.chip.owner-casa { --c: var(--casa); } .chip.owner-gabriel { --c: var(--gabriel); } .chip.owner-jaine { --c: var(--jaine); }
.chip.add { border-style: dashed; color: var(--muted); }

/* ---------- Lançamentos ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; min-height: 42px; background: #fff; }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; background: transparent; }
.search .ic { color: var(--faint); width: 18px; height: 18px; }
.select { border: 1px solid var(--line); border-radius: 12px; min-height: 42px; padding: 0 8px; background: #fff; flex: 0 0 40%; width: 40%; min-width: 0; text-overflow: ellipsis; }
.legend-line { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin: 10px 0 6px; flex-wrap: wrap; }
.legend-line span { display: inline-flex; align-items: center; gap: 6px; }
.legend-line i { width: 4px; height: 14px; border-radius: 4px; display: inline-block; }

.day { margin-top: 14px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); font-weight: 650; padding: 0 2px 6px; }
.day-head b { font-variant-numeric: tabular-nums; }
.list { border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; background: #fff; }
.entry {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line-2); background: #fff;
}
.entry:last-child { border-bottom: 0; }
.entry::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 4px; border-radius: 4px; background: var(--line); }
.entry.by-gabriel::before { background: var(--gabriel); }
.entry.by-jaine::before { background: var(--jaine); }
.entry.pending-sync { opacity: .7; }
.entry:hover { background: #FCFCFE; }
.bubble { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, var(--muted)) 14%, white); }
.bubble .ic { width: 19px; height: 19px; }
.entry-main { flex: 1; min-width: 0; }
.entry-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; background: var(--tint); color: var(--ink-2); font-weight: 600; font-size: 12px; }
.tag .ic { width: 13px; height: 13px; }
.tag.owner-casa { background: var(--casa-soft); color: var(--casa-ink); }
.tag.owner-gabriel { background: var(--gabriel-soft); color: var(--gabriel-ink); }
.tag.owner-jaine { background: var(--jaine-soft); color: var(--jaine-ink); }
.entry-side { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.entry-amount { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 0; }
.pill.pago { background: var(--in-soft); color: var(--in); }
.pill.pendente { background: var(--warn-soft); color: var(--warn); }
.pill.vencido { background: var(--out-soft); color: var(--out); }
.pill.sync { background: var(--tint); color: var(--muted); }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-l); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.loading { text-align: center; padding: 40px 0; color: var(--muted); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--me); animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Fluxo de caixa ---------- */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m); margin-bottom: 14px; font-weight: 600; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked + span { background: var(--me); }
.switch input:checked + span::after { transform: translateX(20px); }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--text); font-size: 11px; fill: var(--muted); }
.chart .zero { stroke: var(--faint); stroke-dasharray: 3 4; }
.chart .grid { stroke: var(--line-2); }
.chart .line { fill: none; stroke: var(--casa); stroke-width: 2.4; stroke-linejoin: round; }
.chart .area { fill: color-mix(in srgb, var(--casa) 10%, transparent); }
.chart .today { stroke: var(--me); stroke-width: 1.5; stroke-dasharray: 2 3; }
.chart .bar-in { fill: var(--in); } .chart .bar-out { fill: var(--out); }
.day-balance { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- Pizza ---------- */
.pie-wrap { display: grid; gap: 16px; align-items: center; }
.pie-wrap > * { min-width: 0; }
@media (min-width: 560px) { .pie-wrap { grid-template-columns: minmax(140px, 200px) minmax(0, 1fr); } }
.pie { width: 100%; max-width: 240px; margin: 0 auto; display: block; }
.pie text { font-family: var(--display); font-weight: 700; font-size: 13px; fill: #fff; paint-order: stroke; stroke: rgba(20, 20, 40, .28); stroke-width: 3px; }
.legend { display: grid; gap: 2px; }
.legend-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.legend-row:last-child { border-bottom: 0; }
.legend-row .sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legend-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-row b { font-variant-numeric: tabular-nums; }
.legend-row small { width: 42px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Caixinhas ---------- */
.total-card { background: var(--tint); border: 0; }
.total-card .big { font-size: 38px; margin-top: 4px; }
.stack-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: #fff; gap: 2px; margin-top: 14px; }
.stack-bar i { display: block; height: 100%; }
.stack-bar .rest { background: repeating-linear-gradient(-45deg, #fff, #fff 4px, var(--line-2) 4px, var(--line-2) 8px); flex: 1; }
.dist-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line-2); width: 100%; text-align: left; }
.dist-row:last-of-type { border-bottom: 0; }
.dist-row .entry-main small { color: var(--muted); font-size: 12.5px; }
.dist-row .right { text-align: right; }
.dist-row .right b { display: block; color: var(--out); font-variant-numeric: tabular-nums; }
.dist-row .right small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.free-box { margin-top: 12px; padding: 14px; border-radius: var(--r-m); background: var(--in-soft); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.free-box span { font-weight: 650; color: var(--in); }
.free-box strong { font-family: var(--display); font-size: 22px; color: var(--in); font-variant-numeric: tabular-nums; }
.free-box.over { background: var(--out-soft); }
.free-box.over span, .free-box.over strong { color: var(--out); }

.boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.box { position: relative; border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line); background: #fff; text-align: left; width: 100%; display: block; }
.box-top { position: relative; background: var(--c); color: #fff; padding: 12px 12px 14px; min-height: 64px; overflow: hidden; }
.box-top .ic { width: 22px; height: 22px; }
.box-top .name { display: block; font-weight: 700; margin-top: 6px; line-height: 1.2; }
.box-top::before, .box-top::after { content: ""; position: absolute; width: 58px; height: 58px; border-radius: 50%; background: rgba(255, 255, 255, .16); top: -14px; }
.box-top::before { right: 8px; } .box-top::after { right: -22px; }
.box-body { padding: 12px; }
.box-body small { color: var(--muted); font-size: 12px; display: block; }
.box-body .big { font-size: 22px; margin: 2px 0 8px; }
.box-body .big.neg { color: var(--out); }
.bar { height: 7px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--c, var(--me)); }
.bar.over i { background: var(--out); }
.box-foot { font-size: 12px; color: var(--muted); margin-top: 7px; font-variant-numeric: tabular-nums; }
.mini-box { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); width: 100%; text-align: left; }
.mini-box:last-child { border-bottom: 0; }
.mini-box .entry-main small { color: var(--muted); font-size: 12.5px; }
.mini-box .bar { margin-top: 6px; }

/* ---------- Cartões ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ccard {
  position: relative; aspect-ratio: 1.586; border-radius: 18px; padding: 16px 18px; color: #fff; background: var(--c);
  overflow: hidden; display: flex; flex-direction: column; text-align: left; width: 100%;
}
.ccard::before, .ccard::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .13); bottom: -40px; }
.ccard::before { right: 26px; } .ccard::after { right: -34px; }
.ccard .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; position: relative; z-index: 1; }
.ccard .cname { font-family: var(--display); font-size: 21px; font-weight: 720; letter-spacing: -.01em; }
.ccard .owner { font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .22); padding: 3px 9px; border-radius: 999px; }
.ccard .chipimg { width: 36px; height: 27px; border-radius: 6px; background: rgba(255, 255, 255, .35); margin-top: 12px; position: relative; z-index: 1; }
.ccard .bottom { margin-top: auto; position: relative; z-index: 1; }
.ccard .bottom small { opacity: .85; font-size: 12.5px; display: block; }
.ccard .bottom strong { font-family: var(--display); font-size: 26px; font-weight: 720; font-variant-numeric: tabular-nums; }
.ccard.light { color: var(--ink); }
.ccard.light .owner { background: rgba(0, 0, 0, .08); }
.card-limit { margin-top: 10px; }
.card-limit .bar { height: 8px; }
.card-limit small { color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; margin-top: 6px; }
.next-bills { display: grid; gap: 0; }
.next-bills div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.next-bills div:last-child { border-bottom: 0; }

/* ---------- Relatórios ---------- */
.compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.compare .stat strong { font-size: 17px; }
.delta { font-size: 12px; font-weight: 700; }
.delta.up { color: var(--in); } .delta.down { color: var(--out); }
.delta.bad-up { color: var(--out); } .delta.good-down { color: var(--in); }
.people-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.people-row:last-child { border-bottom: 0; }
.people-row .entry-main small { color: var(--muted); }
.people-row b { font-variant-numeric: tabular-nums; }

/* ---------- Categorias e ajustes ---------- */
.row-btn { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); width: 100%; text-align: left; background: #fff; }
.row-btn:last-child { border-bottom: 0; }
.row-btn .entry-main small { color: var(--muted); font-size: 12.5px; }
.row-btn > .ic { color: var(--faint); }
.settings-block p { color: var(--ink-2); margin: 0 0 12px; font-size: 14px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv:last-child { border-bottom: 0; }

/* ---------- Painel deslizante ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(27, 33, 64, .38); display: flex; align-items: flex-end; justify-content: center; animation: fade-in .18s both; }
.sheet {
  position: relative; width: 100%; max-width: 620px; max-height: 94dvh; background: #fff; border-radius: 26px 26px 0 0;
  display: flex; flex-direction: column; animation: sheet-up .26s cubic-bezier(.2, .8, .2, 1) both; box-shadow: var(--float);
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 6px 20px; }
.sheet-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; border-radius: 4px; background: var(--line); transform: translateX(-50%); }
.sheet-head h3 { font-family: var(--display); font-size: 20px; font-weight: 720; margin: 12px 0 4px; letter-spacing: -.015em; }
.sheet-body { overflow-y: auto; padding: 6px 20px 18px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line-2); display: flex; gap: 10px; background: #fff; border-radius: 0 0 26px 26px; }
.sheet-foot .btn { flex: 1; }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { border-radius: 24px; max-height: 88dvh; }
  .sheet-head::before { display: none; }
  .sheet-foot { padding-bottom: 16px; }
}

.field { margin-bottom: 16px; }
.field > label, .field > .flabel { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.input, .field input[type="text"], .field input[type="email"], .field input[type="date"], .field input[type="number"], .field input[type="password"], .field textarea, .field select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; min-height: 46px; padding: 10px 12px; background: #fff; outline: 0;
}
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--me); }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.amount-field { text-align: center; padding: 6px 0 12px; }
.amount-field input {
  width: 100%; border: 0; outline: 0; text-align: center; font-family: var(--display); font-weight: 720; font-size: 42px;
  letter-spacing: -.025em; font-variant-numeric: tabular-nums; background: transparent; padding: 4px 0;
}
.amount-field.out input { color: var(--out); }
.amount-field.in input { color: var(--in); }
.amount-field small { color: var(--muted); font-size: 13px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cat-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 9px; border-radius: 14px;
  border: 1.5px solid var(--line); font-size: 12.5px; font-weight: 650; line-height: 1.15; text-align: center; color: var(--ink-2); min-height: 76px;
}
.cat-opt .bubble { width: 32px; height: 32px; border-radius: 10px; }
.cat-opt[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, white); color: var(--ink); }
.cat-opt.add { border-style: dashed; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.stepper button { width: 46px; height: 44px; font-size: 22px; font-weight: 600; color: var(--ink-2); }
.stepper button:active { background: var(--tint); }
.stepper output { min-width: 64px; text-align: center; font-weight: 750; font-size: 17px; font-variant-numeric: tabular-nums; }
.info-line { font-size: 13.5px; color: var(--ink-2); background: var(--tint); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.info-line b { color: var(--ink); }
.info-line button { color: var(--me-ink); font-weight: 700; margin-left: 4px; }
.meta-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icon-opt { height: 44px; border-radius: 12px; display: grid; place-items: center; border: 1.5px solid var(--line); color: var(--ink-2); }
.icon-opt[aria-pressed="true"] { border-color: var(--c, var(--me)); color: var(--c, var(--me)); background: color-mix(in srgb, var(--c, var(--me)) 10%, white); }
.preview-line { font-size: 13.5px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--in-soft); color: #0B6B43; }
.menu-list { display: grid; }
.menu-list .row-btn { font-weight: 650; border-radius: 12px; border-bottom: 0; }
.menu-list .row-btn .ic { color: var(--ink-2); }
.choice-list { display: grid; gap: 8px; }
.choice-list .btn { justify-content: flex-start; }

/* ---------- Aviso rápido ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + 18px + var(--safe-b)); z-index: 80; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
@media (min-width: 960px) { .toast-wrap { bottom: 24px; } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; border-radius: 14px;
  padding: 11px 14px; font-weight: 600; font-size: 14px; box-shadow: var(--float); animation: sheet-up .2s both; max-width: 460px;
}
.toast button { color: #9DB5FF; font-weight: 750; }
.toast.error { background: #7A1D16; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Perfis (versão por assinatura) ---------- */
.avatar { background: var(--c, #2F5BEA); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-wrap { position: relative; display: inline-block; flex: none; }
.av-wrap .avatar { width: 100% !important; height: 100% !important; }
.crown { position: absolute; top: -.55em; left: 50%; transform: translateX(-50%) rotate(-8deg); width: 1.35em; height: 1.35em; display: grid; place-items: center; background: #FFD84D; color: #8A5A00; border-radius: 50%; border: 2px solid #fff; }
.crown .ic { width: .82em; height: .82em; stroke-width: 2.4; }
.me-chip { border-color: var(--me); }
.entry::before { background: var(--line-c, var(--line)); }
.tag.owner { background: color-mix(in srgb, var(--oc) 13%, white); color: color-mix(in srgb, var(--oc) 72%, black); }
.picker .wordmark, .onboarding .wordmark { font-size: 28px; }
.profiles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 18px 12px; width: 100%; max-width: 440px; margin: 28px 0 14px; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 4px 10px; border-radius: 18px; }
.pick:hover { background: var(--tint); }
.pick-name { font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.ic.mini { width: 14px; height: 14px; color: var(--muted); }
.pinpad { max-width: 380px; padding: 24px 20px calc(22px + var(--safe-b)); align-items: center; }
.pin-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pin-head h3 { margin: 10px 0 0; font-family: var(--display); font-size: 20px; }
.pin-head p { margin: 2px 0 0; }
.pin-dots { display: flex; gap: 16px; justify-content: center; margin: 20px 0 4px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--me); }
.pin-dots i.on { background: var(--me); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.pin-keys { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; justify-content: center; margin-top: 8px; }
.pin-keys button { height: 64px; border-radius: 50%; font-size: 24px; font-weight: 650; background: var(--tint); display: grid; place-items: center; }
.pin-keys .pin-alt { font-size: 13px; background: none; color: var(--muted); }
.pf-top { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 6px 0 16px; }
.pf-photo { position: relative; border-radius: 50%; }
.pf-cam { position: absolute; right: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-2); box-shadow: var(--float); }
.pf-cam .ic { width: 17px; height: 17px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 10px; }
.onboarding .onb-card { width: 100%; max-width: 420px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px 18px 4px; margin: 10px 0 12px; }
.login .lead { max-width: 400px; }
.login .btn.ghost { margin-top: 8px; }
.login-ok { color: var(--in); min-height: 22px; margin: 10px 0 0; font-size: 14px; }
.nav-link.subtle { color: var(--muted); font-weight: 600; font-size: 14px; }
.row-btn.subtle { color: var(--muted); }
.side-foot .icon-btn { margin-left: auto; }
.lesson { border-bottom: 1px solid var(--line-2); background: #fff; }
.lesson:last-child { border-bottom: 0; }
.lesson summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.lesson summary::-webkit-details-marker { display: none; }
.lesson .chev { margin-left: auto; color: var(--faint); transition: transform .2s; }
.lesson[open] .chev { transform: rotate(180deg); }
.lesson-body { padding: 0 16px 12px 64px; color: var(--ink-2); font-size: 14.5px; }
.lesson-body p { margin: 0 0 8px; }
