:root {
  --bg: #0b0f14; --s1: #121821; --s2: #18202b; --s3: #1f2935; --line: #232d3a; --line2: #2c3949;
  --text: #e6edf3; --muted: #8b98a9; --dim: #5d6a7b;
  --green: #34d399; --green-d: #0aac23; --red: #f87171; --gold: #fbbf24; --blue: #338ced; --violet: #9887ef;
  --r: 16px; --r-s: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 26px; } h2 { font-size: 22px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 6px 0; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
code { background: var(--s3); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .upper { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 600; }
.pos { color: var(--green); } .neg { color: var(--red); }
.grow { flex: 1; } .nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; }
.row { display: flex; align-items: center; } .row.gap { gap: 8px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; gap: 8px; } .row.end { justify-content: flex-end; margin: 10px 0; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.big { font-size: 22px; font-weight: 650; display: block; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; } .dot.lg { width: 14px; height: 14px; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.main, .grid-main > *, .grid-wealth > *, .grid2 > *, .grid3 > *, .col > *, .card { min-width: 0; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; background: #0d1218; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.brand div { display: flex; flex-direction: column; }
.logo { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #04120c; background: linear-gradient(135deg, #34d399, #fbbf24); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a { padding: 10px 12px; border-radius: 10px; color: var(--muted); display: flex; gap: 10px; align-items: center; font-weight: 500; }
.sidebar nav a:hover { background: var(--s1); color: var(--text); }
.sidebar nav a.on { background: var(--s2); color: var(--text); }
.nav-i { width: 18px; text-align: center; opacity: .8; }
kbd { font-size: 11px; background: rgba(0,0,0,.25); padding: 1px 5px; border-radius: 4px; margin-left: 6px; }
.sync-mini { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; padding: 0 6px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.sync-dot.saving { background: var(--gold); } .sync-dot.error { background: var(--red); }
.main { padding: 24px 32px 60px; max-width: 1280px; width: 100%; }
.page { display: flex; flex-direction: column; gap: 18px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.section-t { margin: 8px 0 4px; color: var(--muted); font-size: 14px; font-weight: 600; }
.tabbar, .sheet-bg { display: none; }

.member-filter { display: inline-flex; gap: 4px; background: var(--s1); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-bottom: 14px; }
.member-filter button { background: none; border: 0; color: var(--muted); padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; }
.member-filter button.on { background: var(--s3); color: var(--text); }

/* ---------- Cards ---------- */
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card.list, .list { padding: 4px; gap: 0; }
.card .list { margin: 0 -8px; }
.grid-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2.wide { gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* Hero */
.hero { background: radial-gradient(120% 140% at 0% 0%, #12301f 0%, var(--s1) 55%); }
.hero-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero-v { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0; font-variant-numeric: tabular-nums; }
.hero-split { display: flex; gap: 24px; align-items: flex-end; }
.hero-split div { display: flex; flex-direction: column; gap: 2px; }
.hero-note { background: rgba(255,255,255,.03); padding: 10px 12px; border-radius: 10px; }
.delta { font-size: 13px; font-weight: 600; } .delta.pos { color: var(--green); } .delta.neg { color: var(--red); }
.link { background: none; border: 0; color: var(--green); font: inherit; font-size: 13px; cursor: pointer; padding: 0; align-self: flex-start; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi .money, .kpi strong { font-size: 20px; font-weight: 650; }
.summary3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.summary3 > div { background: var(--s1); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; }
.summary3 .money { font-weight: 650; font-size: 17px; }

/* Insights */
.insights { display: flex; flex-direction: column; gap: 8px; }
.insight { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--s2); border-left: 3px solid var(--line2); }
.insight p { margin: 0; font-size: 14px; }
.insight.good { border-left-color: var(--green); } .insight.warn { border-left-color: var(--gold); } .insight.bad { border-left-color: var(--red); } .insight.info { border-left-color: var(--blue); }

/* Progress */
.progress { height: 8px; background: var(--s3); border-radius: 99px; overflow: hidden; }
.progress.thin { height: 5px; }
.progress > div { height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.cat-bars { display: flex; flex-direction: column; gap: 12px; }
.cat-bar { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

/* Streak & score */
.streak-n { font-size: 30px; font-weight: 750; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.streak-n small { font-size: 14px; color: var(--muted); font-weight: 500; }
.flame { filter: grayscale(1) opacity(.5); } .flame.lit { filter: none; animation: flick 1.6s ease-in-out infinite; }
@keyframes flick { 50% { transform: scale(1.08) rotate(-3deg); } }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wday { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--dim); }
.wday i { width: 100%; height: 8px; border-radius: 4px; background: var(--s3); }
.wday.on i { background: linear-gradient(90deg, #fb923c, #fbbf24); }
.wday.today span { color: var(--text); font-weight: 700; }
.score { flex-direction: row; align-items: center; gap: 16px; cursor: pointer; }
.score:hover { border-color: var(--line2); }
.ring { --p: 0; width: 72px; height: 72px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--s3) 0); position: relative; }
.ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--s1); }
.ring span { position: relative; font-weight: 750; font-size: 20px; }
.ring.lg { width: 110px; height: 110px; } .ring.lg span { font-size: 30px; } .ring.lg::before { inset: 10px; }
.score-big { display: flex; gap: 18px; align-items: center; }
.score-part { display: flex; flex-direction: column; gap: 4px; }
.streak-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.streak-stats > div { display: flex; flex-direction: column; }
.streak-stats .streak-n { font-size: 22px; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; overflow-x: auto; }
.heatmap i { width: 12px; height: 12px; border-radius: 3px; background: var(--s3); }
.heatmap i.on { background: var(--green-d); }

/* Upcoming */
.due { display: flex; gap: 12px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.due:last-child { border-bottom: 0; }
.due > .grow { display: flex; flex-direction: column; }
.due-d { width: 42px; text-align: center; background: var(--s2); border-radius: 10px; padding: 4px 0; display: flex; flex-direction: column; line-height: 1.1; }
.due-d span { font-size: 11px; color: var(--muted); }
.due.late .due-d { background: rgba(248,113,113,.15); color: var(--red); }
.due-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.goal-mini { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

/* Transactions */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar select, .toolbar .search { width: auto; min-width: 150px; }
.month-nav { display: flex; align-items: center; gap: 8px; background: var(--s1); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.month-nav strong { min-width: 130px; text-align: center; font-size: 14px; }
.month-nav.small strong { min-width: 60px; }
.tx-group { display: flex; flex-direction: column; gap: 6px; }
.tx-date { display: flex; justify-content: space-between; padding: 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.tx { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.tx:hover { background: var(--s2); } .tx.static { cursor: default; }
.tx-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 18px; background: var(--s3); }
.tx-icon.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tx-main strong { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-v { font-weight: 600; }
.tx-side { display: flex; gap: 6px; align-items: center; }
.mini-money { width: 90px !important; } .mini-day { width: 56px !important; }

/* Forms */
input, select, textarea { width: 100%; background: var(--s2); border: 1px solid var(--line2); color: var(--text); border-radius: var(--r-s); padding: 10px 12px; font: inherit; font-size: 15px; outline: none; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(52,211,153,.15); }
input[type=checkbox] { width: auto; accent-color: var(--green); }
input[type=date] { color-scheme: dark; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-l { font-size: 13px; color: var(--muted); font-weight: 500; }
.field-h { font-size: 12px; color: var(--dim); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.money-input { display: flex; align-items: center; background: var(--s2); border: 1px solid var(--line2); border-radius: var(--r-s); padding-left: 12px; }
.money-input:focus-within { border-color: var(--green); }
.money-input span { color: var(--muted); font-size: 14px; }
.money-input input { border: 0; background: none; box-shadow: none !important; font-variant-numeric: tabular-nums; }
.money-input.big { background: none; border: 0; justify-content: center; padding: 0; }
.money-input.big span { font-size: 22px; }
.money-input.big input { font-size: 40px; font-weight: 700; text-align: center; width: 260px; }
.amount-wrap { padding: 10px 0 4px; border-radius: 14px; }
.amount-wrap.despesa input { color: var(--text); } .amount-wrap.receita input { color: var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chips.center { justify-content: center; }
.chip { background: var(--s2); border: 1px solid var(--line2); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--muted); } .chip.on { border-color: var(--green); background: rgba(52,211,153,.12); }
.quick-dates { display: flex; gap: 6px; margin-top: -4px; }
.seg { display: inline-flex; background: var(--s2); border: 1px solid var(--line2); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: none; border: 0; color: var(--muted); padding: 8px 14px; border-radius: 9px; font: inherit; font-size: 14px; cursor: pointer; flex: 1; white-space: nowrap; }
.seg.small button { padding: 6px 10px; font-size: 13px; }
.seg button.on { background: var(--s3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.icon-pick { display: flex; flex-wrap: wrap; gap: 4px; } .icon-pick button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: var(--s2); font-size: 18px; cursor: pointer; }
.icon-pick button.on { border-color: var(--green); }
.color-pick { display: flex; gap: 8px; } .color-pick button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.color-pick button.on { border-color: #fff; }
.share-box { background: var(--s2); border: 1px dashed var(--line2); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.share-v { font-size: 20px; padding-top: 8px; color: var(--green); }
.co-row { display: grid; grid-template-columns: 1fr 90px 16px 32px; gap: 6px; align-items: center; }
.preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; background: var(--s2); border-radius: 12px; padding: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; } .stat-l { font-size: 12px; color: var(--muted); } .stat strong { font-size: 15px; font-variant-numeric: tabular-nums; } .stat.pos strong { color: var(--green); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid-icon { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: end; }
.emoji-in { font-size: 24px; text-align: center; padding: 6px; }
.file-btn { position: relative; overflow: hidden; } .file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop { position: relative; border: 2px dashed var(--line2); border-radius: 14px; padding: 30px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.drop:hover { border-color: var(--green); } .drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Buttons */
.btn { border: 1px solid transparent; border-radius: 11px; padding: 10px 16px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: transform .1s, background .15s; }
.btn:active { transform: scale(.97); } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--green); color: #04120c; } .btn.primary:hover { background: #4ade9e; }
.btn.ghost { background: var(--s2); border-color: var(--line2); color: var(--text); } .btn.ghost:hover { border-color: var(--muted); }
.btn.danger { color: var(--red); }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.icon-btn { background: none; border: 0; color: var(--muted); width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 16px; display: grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--s3); color: var(--text); } .icon-btn.lg { width: 42px; height: 42px; font-size: 20px; background: var(--s1); border: 1px solid var(--line); }
.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--s3); color: var(--muted); }
.pill.good { background: rgba(52,211,153,.14); color: var(--green); } .pill.warn { background: rgba(251,191,36,.14); color: var(--gold); } .pill.bad { background: rgba(248,113,113,.14); color: var(--red); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(3,6,10,.7); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .15s; }
.modal { background: var(--s1); border: 1px solid var(--line2); border-radius: 20px; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.modal.wide { width: min(780px, 100%); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-b { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }

/* Toasts */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--s3); border: 1px solid var(--line2); padding: 12px 16px; border-radius: 12px; display: flex; gap: 10px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: pop .3s cubic-bezier(.2,1.4,.4,1); font-size: 14px; max-width: 340px; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.96); } }

/* Empty */
.empty { text-align: center; padding: 36px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--s1); border: 1px dashed var(--line2); border-radius: var(--r); }
.empty-icon { font-size: 40px; }

/* Charts */
.chart { position: relative; width: 100%; }
.donut-wrap { display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: center; }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.lg { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 8px; align-items: center; }
.lg i { width: 10px; height: 10px; border-radius: 3px; }
.lg > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid2.wide .donut-wrap { grid-template-columns: 1fr; }
.row-legend { flex-direction: row; gap: 20px; flex-wrap: wrap; } .row-legend .lg { grid-template-columns: 10px auto auto auto; }
.split-bar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; gap: 2px; }

/* Wealth */
.grid-wealth { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.eq { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.eq > div { display: flex; flex-direction: column; } .eq .op { color: var(--dim); font-size: 18px; padding-bottom: 2px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.asset { cursor: default; } .asset[onclick], .budget-item { cursor: pointer; }
.asset-v { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.asset-v > div { display: flex; flex-direction: column; gap: 2px; }
.owners { display: flex; flex-direction: column; gap: 6px; }
.owner-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 2px; }
.owner-list { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.owner-list b { color: var(--text); font-weight: 600; }
.equity { background: var(--s2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.hist-row { padding: 8px 6px; border-bottom: 1px solid var(--line); }

/* Budget */
.budget-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.budget-hero .full { grid-column: 1 / -1; }
.budget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.budget-item { gap: 8px; } .budget-item:hover { border-color: var(--line2); }
.b-name { display: flex; gap: 8px; align-items: center; font-weight: 550; }
.b-vals .money { font-weight: 650; font-size: 17px; }

/* Goals */
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.goal-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; }
.goal-ring { --p: 0; --c: var(--green); width: 120px; height: 120px; border-radius: 50%; margin: 4px auto; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--s3) 0); position: relative; }
.goal-ring::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: var(--s1); }
.goal-ring span { position: relative; font-size: 24px; font-weight: 750; }
.goal.done { border-color: rgba(251,191,36,.4); background: linear-gradient(180deg, rgba(251,191,36,.07), var(--s1)); }

/* Achievements */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.ach { background: var(--s1); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; opacity: .55; }
.ach.on { opacity: 1; border-color: rgba(251,191,36,.35); background: linear-gradient(180deg, rgba(251,191,36,.08), var(--s1)); }
.ach-i { font-size: 30px; } .ach-d { font-size: 11px; color: var(--gold); }

/* Import & tables */
.import-list { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.import-row { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.import-row.off { opacity: .45; } .import-row select { width: 170px; padding: 6px 8px; font-size: 13px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; }
.table.num td:not(:first-child), .table.num th:not(:first-child) { text-align: right; }

/* Settings */
.member-row { display: flex; gap: 10px; align-items: center; } .member-row input { max-width: 280px; }
.sync-ok { display: flex; gap: 12px; align-items: center; } .sync-ok .sync-dot { width: 12px; height: 12px; }
.code { font-family: ui-monospace, Menlo, monospace; background: var(--s3); padding: 2px 8px; border-radius: 6px; letter-spacing: .1em; color: var(--gold); }

/* Onboarding */
.onb { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(80% 60% at 50% 0%, #10291c, var(--bg)); }
.onb-card { width: min(760px, 100%); background: var(--s1); border: 1px solid var(--line2); border-radius: 24px; padding: 28px; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.onb-steps { display: flex; gap: 6px; justify-content: center; }
.onb-steps span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--s3); color: var(--muted); font-weight: 600; }
.onb-steps span.on { background: var(--green); color: #04120c; } .onb-steps span.done { background: rgba(52,211,153,.2); color: var(--green); }
.onb-body { display: flex; flex-direction: column; gap: 14px; animation: fade .3s; }
.onb-body.center { align-items: center; text-align: center; }
.onb-emoji { font-size: 40px; } .onb-emoji.big { font-size: 64px; }
.onb-list { display: flex; flex-direction: column; gap: 8px; }
.onb-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr 32px; gap: 6px; align-items: center; }
.onb-house { background: var(--s2); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.onb-f { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 16px; }

/* ---------- Mobile ---------- */
@media (max-width: 1100px) { .grid-wealth { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { padding: calc(env(safe-area-inset-top) + 16px) 16px calc(96px + env(safe-area-inset-bottom)); }
  .grid-main, .grid-wealth, .grid2.wide { grid-template-columns: 1fr; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: rgba(13,18,24,.92); backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); align-items: center; }
  .tabbar a, .tabbar > button:not(.fab) { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); background: none; border: 0; font-family: inherit; padding: 4px 0; }
  .tabbar a span, .tabbar > button span { font-size: 18px; }
  .tabbar .on { color: var(--green) !important; }
  .fab { width: 54px; height: 54px; border-radius: 18px; border: 0; justify-self: center; margin-top: -22px; background: linear-gradient(135deg, #34d399, #10b981); color: #04120c; font-size: 30px; font-weight: 500; box-shadow: 0 10px 30px rgba(16,185,129,.4); cursor: pointer; }
  .sheet-bg { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.5); }
  .sheet { position: absolute; left: 10px; right: 10px; bottom: calc(80px + env(safe-area-inset-bottom)); background: var(--s1); border: 1px solid var(--line2); border-radius: 18px; padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; animation: pop .2s; }
  .sheet a { padding: 14px; border-radius: 12px; display: flex; gap: 10px; background: var(--s2); }
  h1 { font-size: 22px; }
  .hero-v { font-size: 32px; }
  .hero-split { gap: 14px; flex-wrap: wrap; }
  .kpis { grid-template-columns: 1fr 1fr; } .kpis .kpi:last-child { grid-column: 1 / -1; }
  .donut-wrap { grid-template-columns: 1fr; }
  .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
  .page-h .row.gap { flex-wrap: wrap; }
  .toolbar .search, .toolbar select { flex: 1 1 140px; min-width: 0; }
  .modal-bg { padding: 0; align-items: end; }
  .modal { border-radius: 20px 20px 0 0; max-height: 94vh; width: 100% !important; padding-bottom: env(safe-area-inset-bottom); }
  .toasts { left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 10px); } .toast { max-width: none; }
  .onb-card { padding: 20px; }
  .onb-row { grid-template-columns: 1fr 1fr; } .onb-row .money-input { grid-column: 1 / 2; }
  .budget-hero { grid-template-columns: 1fr; }
  .import-row { flex-wrap: wrap; } .import-row select { width: 100%; }
}
@media (max-width: 480px) {
  .grid2 { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
  .summary3 .money { font-size: 15px; }
}

.import-cta { border-color: rgba(52,211,153,.35); background: linear-gradient(90deg, rgba(52,211,153,.08), var(--s1)); flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.acc-total { padding: 10px 12px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.bill { display: flex; gap: 12px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.bill:last-child { border-bottom: 0; }
.bill > .grow { display: flex; flex-direction: column; min-width: 0; }
.bill.pago { opacity: .6; } .bill.atrasado .due-d { background: rgba(248,113,113,.15); color: var(--red); }
.day-bal { font-size: 12px; color: var(--muted); font-weight: 500; }
.balance-bar { flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.balance-bar > div { display: flex; flex-direction: column; gap: 2px; }

/* ---------- Início focado ---------- */
.home { gap: 16px; }
.bank { flex-direction: row; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: radial-gradient(120% 160% at 0% 0%, #12301f 0%, var(--s1) 55%); }
.bank-main { display: flex; flex-direction: column; gap: 4px; min-width: 240px; }
.bank-side { display: flex; flex-direction: column; gap: 14px; min-width: 280px; flex: 1; max-width: 460px; }
.forecast { display: flex; flex-direction: column; gap: 2px; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.forecast .money.big { font-size: 20px; }
.mini3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini3 > div { display: flex; flex-direction: column; }
.mini3 .money { font-weight: 600; }
.saving-chip { align-self: flex-start; margin-top: 6px; display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--dim);
  background: var(--s2); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; opacity: .8; }
.saving-chip .money { color: var(--muted); }

.agenda-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; position: relative; align-items: start; }
.agenda { gap: 8px; }
.agenda.in { border-top: 3px solid var(--green); }
.agenda.out { border-top: 3px solid #e76624; }
.ag-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ag-kicker { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.agenda.in .ag-kicker { color: var(--green); } .agenda.out .ag-kicker { color: #f0915a; }
.ag-tot { display: flex; flex-direction: column; align-items: flex-end; }
.ag-tot .money { font-size: 20px; font-weight: 700; }
.ag-bar { height: 5px; background: var(--s3); border-radius: 99px; overflow: hidden; }
.ag-bar i { display: block; height: 100%; border-radius: 99px; }
.agenda.in .ag-bar i { background: var(--green); } .agenda.out .ag-bar i { background: #e76624; }
.ag-list { display: flex; flex-direction: column; margin: 4px -6px 0; }
.ag-row { display: flex; gap: 12px; align-items: center; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.ag-row:last-child { border-bottom: 0; }
.ag-row.done { opacity: .5; }
.ag-date { width: 40px; flex: none; text-align: center; background: var(--s2); border-radius: 10px; padding: 4px 0; display: flex; flex-direction: column; line-height: 1.1; }
.ag-date span { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.ag-row.atrasado .ag-date { background: rgba(248,113,113,.15); color: var(--red); }
.ag-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ag-main strong { font-size: 14px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-st { font-size: 12px; color: var(--muted); } .ag-st.ok { color: var(--green); } .ag-st.atrasado { color: var(--red); }
.ag-val { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ag-val .money { font-weight: 600; font-size: 14px; }
.ag-edit { position: absolute; right: 4px; bottom: -22px; }
.home-foot { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.foot-chip { background: var(--s1); border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.foot-chip:hover { color: var(--text); border-color: var(--line2); }
.tx.tx-save { padding-top: 6px; padding-bottom: 6px; opacity: .55; }
.tx.tx-save:hover { opacity: .9; }
@media (max-width: 900px) {
  .agenda-grid { grid-template-columns: 1fr; }
  .ag-edit { position: static; justify-self: start; }
  .bank-side { max-width: none; min-width: 0; }
}

/* ---------- Painel estilo assessor ---------- */
.quick { display: flex; flex-direction: column; gap: 8px; }
.quick-in { display: flex; align-items: center; gap: 10px; background: var(--s1); border: 1px solid var(--line2); border-radius: 16px; padding: 6px 6px 6px 14px; }
.quick-in:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(52,211,153,.12); }
.quick-in input { border: 0; background: none; box-shadow: none !important; padding: 10px 0; font-size: 15px; }
.quick-prev { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 6px; font-size: 13px; }
.tabs-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; }
.tabs button { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--green); }
.tabs-row .month-nav { margin-bottom: 6px; }
.period { background: radial-gradient(120% 160% at 0% 0%, #12301f 0%, var(--s1) 55%); }
.period-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.period-stats > div { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.period-stats span { font-size: 12px; color: var(--muted); }
.period-stats .money { font-size: 17px; font-weight: 650; }
.summary { border-left: 3px solid var(--violet); }
.summary ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.summary li { line-height: 1.45; }
.sum-ico { width: 36px; height: 36px; border-radius: 10px; background: rgba(152,135,239,.15); display: grid; place-items: center; font-size: 18px; }
.still .ring.lg span { font-size: 22px; }
.flow { gap: 4px; }
.flow-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.flow-row small { grid-column: 1 / -1; font-size: 12px; }
.flow-row .money { font-weight: 650; font-size: 16px; }
.flow-row.total { border-bottom: 0; }
.cards-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.cc { background: linear-gradient(135deg, var(--s2), var(--s3)); border: 1px solid var(--line2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.cc.done { opacity: .5; }
.cc-name { font-size: 13px; color: var(--muted); font-weight: 600; }
@media (max-width: 900px) { .period-stats { grid-template-columns: 1fr 1fr; } }
.future-note { background: rgba(251,191,36,.1); color: var(--gold); padding: 8px 10px; border-radius: 10px; margin: -4px 0 0; }
.save-st { font-size: 12px; padding: 6px 10px; border-radius: 10px; text-align: center; }
.save-st.ok { color: var(--muted); }
.save-st.bad { color: #1a0f00; background: var(--gold); font-weight: 700; }
.mobile-save { display: none; }
@media (max-width: 900px) { .mobile-save { display: block; margin-bottom: 8px; } .mobile-save .save-st.ok { text-align: right; padding: 0; } }
.auth-wrap { max-width: 420px; }
.auth-card { display: flex; flex-direction: column; gap: 12px; }
.auth-logo { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-weight: 800; font-size: 22px; color: #04120c; background: linear-gradient(135deg, #34d399, #fbbf24); }
.auth-msg { background: var(--s2); border-radius: 10px; padding: 8px 10px; }

/* Site publicado: espaço para o selo "Powered by Netlify" (canto inferior direito) */
@media (max-width: 900px) {
  .hosted .tabbar { bottom: 0; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .hosted .main { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
  .hosted .sheet { bottom: calc(140px + env(safe-area-inset-bottom)); }
  .hosted .modal { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .hosted .onb { padding-bottom: 80px; }
}
.hosted .sidebar { padding-bottom: 72px; }

/* ---------- Ajustes finos para iPhone ---------- */
html, body { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
.page, .page > *, .agenda-grid > *, .kpis > *, .summary3 > *, .period-stats > *, .grid2 > *, .mini3 > * { min-width: 0; }
.summary3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.period-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.summary3 .money, .kpi .money, .period-stats .money, .mini3 .money, .ag-tot .money { overflow: hidden; text-overflow: ellipsis; display: block; }
@media (max-width: 900px) {
  input, select, textarea { font-size: 16px; } /* evita o zoom automático do iPhone ao tocar */
  .period-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .main { padding-left: 12px; padding-right: 12px; }
  .card { padding: 14px; }
  .hero-v { font-size: 30px; }
  .summary3 { gap: 6px; }
  .summary3 > div { padding: 8px 10px; }
  .summary3 .money { font-size: 14px; }
  .period-stats .money, .kpi .money, .kpi strong { font-size: 15px; }
  .ag-tot .money { font-size: 17px; }
  .ag-row { gap: 8px; }
  .ag-main strong { font-size: 13px; }
  .ag-val .money { font-size: 13px; }
  .tabs button { padding: 10px 8px; font-size: 14px; }
  .page-h h1 { font-size: 21px; }
  .page-h .row.gap .btn.small { padding: 6px 9px; font-size: 12px; }
  .toolbar > * { flex: 1 1 100%; }
  .toolbar .seg { width: 100%; }
  .balance-bar .money.big { font-size: 22px; }
  .tx-main strong { font-size: 14px; }
  .tx-v { font-size: 14px; }
}
@media (max-width: 480px) {
  .summary3 { grid-template-columns: 1fr; gap: 0; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; }
  .summary3 > div { flex-direction: row; justify-content: space-between; align-items: center; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
  .summary3 > div:last-child { border-bottom: 0; }
  .summary3 .money { font-size: 15px; overflow: visible; }
}
