@font-face { font-family: 'Inter'; src: url('fonts/InterVariable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
/* =====================================================================
   Gastei Quanto — design system (inspirado nas Human Interface Guidelines)
   ===================================================================== */
:root {
  --bg: #f5f5f7;
  --bg-elev: #ffffff;
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .08);
  --sep: rgba(60, 60, 67, .14);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #a1a1a6;
  --accent: #0a8f7a;
  --accent-soft: rgba(10, 143, 122, .12);
  --pos: #1f8a3b;
  --neg: #d70015;
  --warn: #c76a00;
  --blue: #0071e3;
  --material: rgba(255, 255, 255, .72);
  --shadow: 0 1px 1px rgba(0, 0, 0, .02), 0 4px 18px rgba(0, 0, 0, .045);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .18);
  --r: 18px;
  --r-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000; --bg-elev: #1c1c1e; --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .16);
    --sep: rgba(84, 84, 88, .55); --text: #f5f5f7; --text-2: #98989f; --text-3: #636366;
    --accent: #30d1b4; --accent-soft: rgba(48, 209, 180, .16); --pos: #30d158; --neg: #ff453a; --warn: #ff9f0a; --blue: #0a84ff;
    --material: rgba(28, 28, 30, .72); --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000; --bg-elev: #1c1c1e; --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .16);
  --sep: rgba(84, 84, 88, .55); --text: #f5f5f7; --text-2: #98989f; --text-3: #636366;
  --accent: #30d1b4; --accent-soft: rgba(48, 209, 180, .16); --pos: #30d158; --neg: #ff453a; --warn: #ff9f0a; --blue: #0a84ff;
  --material: rgba(28, 28, 30, .72); --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; font-feature-settings: "cv11", "ss01";
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.38; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h3 { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.num, .money, .value, .tx-amt, .right, td.num { font-variant-numeric: tabular-nums; }
.i { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  width: 248px; flex-shrink: 0; padding: 22px 12px 16px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh; background: var(--material); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px); border-right: .5px solid var(--sep);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 0 10px; letter-spacing: -.02em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--text); font-weight: 500; font-size: 14.5px;
  transition: background .15s;
}
.side-nav a .i { color: var(--accent); }
.side-nav a:hover { background: var(--fill-2); }
.side-nav a.active { background: var(--accent); color: #fff; }
.side-nav a.active .i { color: #fff; }
.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 18px 36px 12px; position: sticky; top: 0; z-index: 10;
  background: var(--material); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.topbar h1 { font-size: 30px; font-weight: 700; letter-spacing: -.03em; flex: 1; }
.month-nav { display: flex; align-items: center; background: var(--fill-2); border-radius: 999px; padding: 2px; position: relative; }
.month-nav .icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.mp-caret { width: 14px; height: 14px; vertical-align: -2px; color: var(--text-2); stroke-width: 2.4; }
.month-pop {
  position: absolute; top: calc(100% + 8px); right: 0; width: 300px; z-index: 30; padding: 12px; border-radius: 18px;
  background: var(--bg-elev); box-shadow: 0 0 0 .5px var(--sep), var(--shadow-lg); animation: pop .22s var(--ease);
}
.mp-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 10px; font-size: 17px; }
.mp-head .icon-btn:disabled { opacity: .25; }
.mp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mp-m { border: 0; background: none; padding: 11px 0; border-radius: 12px; font-weight: 500; font-size: 15px; cursor: pointer; text-transform: capitalize; }
.mp-m:hover:not(:disabled) { background: var(--fill-2); }
.mp-m.now { color: var(--accent); font-weight: 700; }
.mp-m.sel { background: var(--accent); color: #fff; font-weight: 600; }
.mp-m:disabled { color: var(--text-3); opacity: .45; cursor: default; }
.mp-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 4px 0; margin-top: 8px; border-top: .5px solid var(--sep); }
.month-label { border: 0; background: none; font-weight: 600; min-width: 148px; cursor: pointer; padding: 6px 4px; border-radius: 999px; font-size: 14.5px; }
.icon-btn {
  border: 0; background: none; width: 34px; height: 34px; border-radius: 999px; cursor: pointer; color: var(--text);
  display: inline-grid; place-items: center; transition: background .15s;
}
.icon-btn:hover { background: var(--fill); }
#hide-btn { background: var(--fill-2); color: var(--text-2); }
.view { padding: 8px 36px 48px; max-width: 1180px; animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
.bottom-nav, .fab { display: none; }

/* ---------- Superfícies ---------- */
.card { background: var(--bg-elev); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.card-head a, .link { font-size: 14px; font-weight: 500; color: var(--accent); cursor: pointer; background: none; border: 0; padding: 0; }
.section-title { font-size: 20px; font-weight: 700; letter-spacing: -.025em; margin: 30px 0 12px; display: flex; align-items: baseline; justify-content: space-between; }
.section-title a { font-size: 14px; font-weight: 500; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat .label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.03em; }
.stat .sub { color: var(--text-2); font-size: 12.5px; margin-top: 4px; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .warn { color: var(--warn); } .muted { color: var(--text-2); }
.small { font-size: 13px; }

/* ---------- Botões ---------- */
.btn {
  border: 0; background: var(--fill-2); padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 14.5px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; justify-content: center; color: var(--accent); transition: background .15s, transform .1s;
}
.btn:hover { background: var(--fill); }
.btn:active { transform: scale(.97); }
.btn .i { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
:root[data-theme="dark"] .btn.primary { color: #00140f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #00140f; } }
.btn.danger { color: var(--neg); }
.btn.sm { padding: 6px 12px; font-size: 13.5px; }
.btn.block { width: 100%; padding: 12px; }
.btn[disabled] { opacity: .5; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }

/* ---------- Listas agrupadas ---------- */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; height: .5px; background: var(--sep); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row .right { text-align: right; font-weight: 600; white-space: nowrap; }
.clickable { cursor: pointer; border-radius: 12px; }
.clickable:hover { background: var(--fill-2); }
.chev { color: var(--text-3); width: 16px; height: 16px; }

.cat-icon {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 19px;
  background: color-mix(in srgb, var(--c, #8e8e93) 16%, transparent); color: var(--c);
}
.cat-icon .i { width: 20px; height: 20px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: #fff;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .1); display: grid; place-items: center;
}
.avatar.mono { background: var(--c); color: #fff; font-weight: 700; font-size: 16px; box-shadow: none; letter-spacing: -.02em; }
.avatar.generic { background: color-mix(in srgb, var(--c, #8e8e93) 16%, transparent); color: var(--c); box-shadow: none; }
.avatar.xs { width: 16px; height: 16px; font-size: 9px; vertical-align: -3px; margin-right: 4px; display: inline-grid; }
.avatar.xs .i { width: 10px; height: 10px; stroke-width: 2.4; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--c); }

.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--fill-2); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--pos) 14%, transparent); color: var(--pos); }
.pill.bad { background: color-mix(in srgb, var(--neg) 13%, transparent); color: var(--neg); }
.pill.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.pill.info { background: var(--accent-soft); color: var(--accent); }

.progress { height: 6px; background: var(--fill); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s var(--ease); }
.progress.over > div { background: var(--neg); }
.progress.near > div { background: var(--warn); }

/* ---------- Início: hero e insights ---------- */
.hero { padding: 26px 26px 22px; }
.hero-label { color: var(--text-2); font-size: 14px; font-weight: 500; }
.hero-value { font-size: 46px; font-weight: 700; letter-spacing: -.045em; line-height: 1.05; margin: 6px 0 14px; }
.hero-story { font-size: 17px; line-height: 1.45; color: var(--text); max-width: 640px; letter-spacing: -.015em; }
.hero-story b { font-weight: 600; }
.flow { margin-top: 18px; display: grid; gap: 8px; }
.flow-row { display: grid; grid-template-columns: 82px 1fr auto; align-items: center; gap: 12px; font-size: 13.5px; }
.flow-row .lbl { color: var(--text-2); font-weight: 500; }
.flow-bar { height: 10px; border-radius: 999px; background: var(--fill-2); overflow: hidden; }
.flow-bar > div { height: 100%; border-radius: 999px; transition: width .6s var(--ease); }
.flow-row .amt { font-weight: 600; min-width: 110px; text-align: right; }

.insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.insight { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.insight-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.insight-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--fill-2); color: var(--text-2); }
.insight-ic .i { width: 16px; height: 16px; stroke-width: 2; }
.insight.t-good .insight-ic { background: color-mix(in srgb, var(--pos) 14%, transparent); color: var(--pos); }
.insight.t-bad .insight-ic { background: color-mix(in srgb, var(--neg) 12%, transparent); color: var(--neg); }
.insight.t-warn .insight-ic { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.insight.t-info .insight-ic { background: var(--accent-soft); color: var(--accent); }
.insight-big { font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.insight-text { font-size: 14px; color: var(--text-2); line-height: 1.45; }
.insight-text b { color: var(--text); font-weight: 600; }

.catbars { display: flex; flex-direction: column; gap: 4px; }
.catbar { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; padding: 8px 6px; border-radius: 12px; cursor: pointer; }
.catbar:hover { background: var(--fill-2); }
.catbar-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 14.5px; }
.catbar-top .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catbar-top .val { font-weight: 600; white-space: nowrap; }
.catbar-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); margin-top: 5px; }
.trend { font-weight: 600; }
.trend.up { color: var(--neg); } .trend.down { color: var(--pos); }

/* ---------- Transações ---------- */
.tx-group { margin-bottom: 18px; }
.tx-date { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0 4px 7px; display: flex; justify-content: space-between; }
.tx-date span:first-child::first-letter { text-transform: uppercase; }
.tx-card { padding: 4px 8px; }
.tx-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px; cursor: pointer; position: relative; }
.tx-row:hover { background: var(--fill-2); }
.tx-row + .tx-row::before { content: ""; position: absolute; top: 0; left: 60px; right: 8px; height: .5px; background: var(--sep); }
.tx-main { flex: 1; min-width: 0; }
.tx-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.tx-amt { font-weight: 600; white-space: nowrap; }
.tx-amt.neg { color: var(--text); }
.tx-amt.neutral { color: var(--text-2); }
.status {
  width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer; flex-shrink: 0; display: grid; place-items: center; padding: 0;
}
.status .i { width: 14px; height: 14px; stroke-width: 2.6; }
.status.ok { background: transparent; color: var(--text-3); }
.status.pending { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.status.late { background: color-mix(in srgb, var(--neg) 14%, transparent); color: var(--neg); }
.status-spacer { width: 24px; flex-shrink: 0; }
.summary-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.summary-chips .card { padding: 14px 16px; }
.summary-chips .value { font-size: 20px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; align-items: center; }
.filters select { flex: 0 1 220px; }
.search { position: relative; flex: 1 1 240px; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 17px; height: 17px; }
.search input { padding-left: 34px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 0; background: var(--fill-2); padding: 7px 14px; border-radius: 999px; font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip.active { background: var(--text); color: var(--bg-elev); }

/* ---------- Formulários ---------- */
input, select, textarea {
  width: 100%; padding: 10px 13px; border: 0; border-radius: var(--r-sm); background: var(--fill-2); outline: none; font-size: 15px;
  transition: box-shadow .15s, background .15s;
}
select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5M7 9l5-5 5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { background-color: var(--bg-elev); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
input::placeholder { color: var(--text-3); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); padding: 0; }
textarea { resize: vertical; min-height: 60px; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text); font-weight: 400; margin: 0; cursor: pointer; }
.amount-input { font-size: 34px; font-weight: 700; padding: 12px 14px; letter-spacing: -.03em; text-align: center; background: transparent; }
.amount-input:focus { background: transparent; box-shadow: none; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill-2); border-radius: 10px; padding: 2px; gap: 2px; margin-bottom: 16px; }
.seg button { border: 0; background: none; padding: 7px 10px; border-radius: 8px; font-weight: 500; font-size: 14px; cursor: pointer; color: var(--text); }
.seg button.active { background: var(--bg-elev); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); font-weight: 600; }
:root[data-theme="dark"] .seg button.active { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.active { background: #636366; } }
.seg button.active[data-t="expense"] { color: var(--neg); }
.seg button.active[data-t="income"] { color: var(--pos); }
.hidden { display: none !important; }

.inst-search { margin-bottom: 10px; }
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; max-height: 236px; overflow-y: auto; padding: 2px; }
.inst-opt { border: 0; background: none; border-radius: 12px; padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); }
.inst-opt:hover { background: var(--fill-2); }
.inst-opt.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.inst-opt span { max-width: 72px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Modal (sheet) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .32); z-index: 50; display: grid; place-items: center; padding: 16px;
  animation: fade .2s ease;
}
.modal {
  background: var(--bg-elev); border-radius: 22px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto;
  box-shadow: var(--shadow-lg); animation: pop .3s var(--ease);
}
.modal.wide { max-width: 640px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; position: sticky; top: 0; background: var(--bg-elev); z-index: 1; }
.modal-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.modal-head .icon-btn { background: var(--fill-2); width: 30px; height: 30px; color: var(--text-2); }
.modal-head .icon-btn .i { width: 15px; height: 15px; stroke-width: 2.4; }
.modal-body { padding: 6px 18px 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.modal-actions .left { margin-right: auto; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { transform: translateY(16px) scale(.98); opacity: 0 } }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--material); color: var(--text);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none;
  transition: .3s var(--ease); z-index: 60; box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Gráficos ---------- */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 168px; height: 168px; flex-shrink: 0; }
.donut-label { font-size: 11px; fill: var(--text-2); }
.donut-value { font-size: 15px; font-weight: 700; fill: var(--text); }
.legend { flex: 1; min-width: 170px; display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.legend-item .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-item .pct { color: var(--text-2); font-size: 12.5px; width: 38px; text-align: right; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding-top: 12px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; min-width: 0; cursor: default; }
.bar-pair { flex: 1; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }
.bar { width: 38%; max-width: 18px; border-radius: 6px 6px 3px 3px; min-height: 3px; transition: height .6s var(--ease), opacity .2s; }
.bar.inc { background: var(--pos); }
.bar.exp { background: var(--text-3); }
.bar-col.current .bar.exp { background: var(--text); }
.bar-col:hover .bar { opacity: .75; }
.bar-label { font-size: 12px; color: var(--text-2); text-transform: capitalize; }
.bar-col.current .bar-label { color: var(--text); font-weight: 600; }
.chart-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.chart-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--c); }

/* ---------- Cartões ---------- */
.credit-card {
  border-radius: 16px; padding: 18px; color: #fff; min-height: 132px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c, #3a3a3c) 85%, #fff), var(--c, #3a3a3c) 45%, color-mix(in srgb, var(--c, #3a3a3c) 60%, #000));
  box-shadow: 0 10px 30px color-mix(in srgb, var(--c, #000) 30%, transparent);
}
.credit-card .cc-name { font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.credit-card .cc-limit { font-size: 13px; opacity: .85; }
.credit-card .progress { background: rgba(255, 255, 255, .25); margin-top: 8px; }
.credit-card .progress > div { background: #fff; }
.invoice-box { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 0 6px; }
.invoice-box .big { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }

.empty { text-align: center; padding: 30px 12px; color: var(--text-2); }
.empty .em { font-size: 34px; margin-bottom: 8px; }
.welcome { background: linear-gradient(135deg, var(--accent-soft), var(--bg-elev) 70%); }
.welcome ol { margin: 12px 0 16px; padding-left: 20px; color: var(--text-2); }
.welcome li { margin: 5px 0; }
.more-list { padding: 6px 16px; }
.more-list a { display: flex; align-items: center; gap: 14px; padding: 12px 0; color: var(--text); font-weight: 500; position: relative; }
.more-list a + a::before { content: ""; position: absolute; top: 0; left: 44px; right: 0; height: .5px; background: var(--sep); }
.more-list .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: var(--c); }
.more-list .ico .i { width: 17px; height: 17px; stroke-width: 2; }
.emoji-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-grid button { width: 38px; height: 38px; border: 0; background: var(--fill-2); border-radius: 10px; cursor: pointer; font-size: 19px; }
.emoji-grid button.active { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.color-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.color-grid button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; }
.color-grid button.active { box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--c); }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th, table.simple td { padding: 9px 6px; border-bottom: .5px solid var(--sep); text-align: left; }
table.simple tr:last-child td { border-bottom: 0; }
table.simple th { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
table.simple td.num, table.simple th.num { text-align: right; white-space: nowrap; }

/* ---------- Login ---------- */
.auth { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .brand { flex-direction: column; gap: 14px; font-size: 26px; margin-bottom: 6px; }
.auth-card .brand img { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 10px 30px rgba(10, 143, 122, .25); }
.auth-sub { text-align: center; color: var(--text-2); margin: 0 0 28px; font-size: 15px; }
.auth-msg { background: var(--fill-2); padding: 11px 13px; border-radius: 12px; font-size: 14px; }
.sync-pill { font-size: 12px; }
.google-btn { gap: 10px; padding: 12px 14px; background: var(--bg-elev); color: var(--text); box-shadow: 0 0 0 .5px var(--sep), var(--shadow); }
.google-btn:hover { background: var(--bg-elev); filter: brightness(.98); }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13px; margin: 18px 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: .5px; background: var(--sep); }

/* ---------- Responsivo ---------- */
@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two, .three { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .sidebar { display: none; }
  .topbar { padding: 10px 16px 8px; padding-top: max(10px, env(safe-area-inset-top)); flex-wrap: wrap; row-gap: 8px; }
  .topbar h1 { font-size: 30px; }
  .month-nav { order: 3; width: 100%; justify-content: space-between; }
  .month-label { flex: 1; }
  .month-pop { left: 0; right: 0; width: auto; }
  .view { padding: 6px 16px calc(100px + env(safe-area-inset-bottom) + var(--vv-lift, 0px)); }
  .card { padding: 16px; }
  .hero { padding: 22px 18px 18px; }
  .hero-value { font-size: 38px; }
  .hero-story { font-size: 16px; }
  .flow-row { grid-template-columns: 50px 1fr auto; gap: 10px; }
  .flow-row .amt { min-width: 0; font-size: 14px; }
  .insights { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .insights::-webkit-scrollbar { display: none; }
  .insight { flex: 0 0 80%; scroll-snap-align: start; }
  .stat .value { font-size: 20px; }
  .summary-chips { gap: 8px; }
  .summary-chips .card { padding: 11px 12px; }
  .summary-chips .value { font-size: 15.5px; }
  .filters select { flex: 1 1 45%; }
  .section-title { font-size: 21px; margin-top: 26px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: start; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--material); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: .5px solid var(--sep); padding: 6px 4px calc(4px + env(safe-area-inset-bottom));
    transform: translateY(calc(-1 * var(--vv-lift, 0px)));
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-3); font-size: 10.5px; font-weight: 500; padding: 2px 0; }
  .bottom-nav a .i { width: 25px; height: 25px; stroke-width: 1.7; }
  .bottom-nav a.active { color: var(--accent); }
  .bottom-nav .tab-add { display: grid; place-items: center; }
  .bottom-nav .tab-add button {
    width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 40%, transparent); margin-top: -2px;
  }
  .bottom-nav .tab-add .i { width: 24px; height: 24px; stroke-width: 2.4; }
  .modal-backdrop { place-items: end center; padding: 0 0 var(--vv-lift, 0px); }
  .modal { border-radius: 22px 22px 0 0; max-height: 94vh; padding-bottom: env(safe-area-inset-bottom); animation: sheet .35s var(--ease); }
  @keyframes sheet { from { transform: translateY(100%); } }
  .donut { width: 140px; height: 140px; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom) + var(--vv-lift, 0px)); }
}

/* ---------- Início minimalista ---------- */
.hero-plain { padding: 18px 4px 26px; }
.hero-plain .hero-value { font-size: 52px; margin: 4px 0 12px; }
.hero-pill { margin-left: 4px; font-size: 13px; padding: 4px 10px; vertical-align: 1px; }
.strip { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 16px; color: var(--text); transition: transform .15s; }
.strip:hover { transform: translateY(-1px); }
.strip .title { font-weight: 600; }
.strip .sub { color: var(--text-2); font-size: 13px; margin-top: 1px; }
.strip .grow { flex: 1; min-width: 0; }
.insights { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.insight { box-shadow: none; background: var(--bg-elev); border: .5px solid var(--sep); }
.i.tiny { width: 13px; height: 13px; vertical-align: -2px; stroke-width: 2.2; }

/* ---------- Comprovantes ---------- */
.att-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.att { position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--fill-2); cursor: pointer; display: grid; place-items: center; }
.att img { width: 100%; height: 100%; object-fit: cover; }
.att-pdf { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--text-2); }
.att-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.att-x .i { width: 12px; height: 12px; stroke-width: 2.6; }
.att-add { flex-direction: column; gap: 4px; color: var(--accent); font-size: 11.5px; font-weight: 600; border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, transparent); background: transparent; display: flex; justify-content: center; align-items: center; }
.att-add.loading { opacity: .6; pointer-events: none; }
.viewer { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.88); display: grid; place-items: center; padding: 24px; animation: fade .2s ease; cursor: zoom-out; }
.viewer img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.viewer .icon-btn { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; color: #fff; background: rgba(255,255,255,.15); }
.cat-hint { color: var(--accent); font-weight: 600; font-size: 12px; margin-left: 4px; }
.cat-hint .i { width: 12px; height: 12px; vertical-align: -1px; }

/* ---------- Contas a pagar ---------- */
.preset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 520px; margin: 0 auto; }
.preset { border: 0; background: var(--fill-2); border-radius: 14px; padding: 14px 6px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.preset:hover { background: var(--fill); }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick button { width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--fill-2); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.icon-pick button.active { background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.paid-check { width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--pos) 15%, transparent); color: var(--pos); display: grid; place-items: center; flex-shrink: 0; }
.paid-check .i { width: 14px; height: 14px; stroke-width: 2.8; }
.section-title .link { display: inline-flex; align-items: center; gap: 4px; }
.section-title .link .i { width: 15px; height: 15px; }

/* ---------- Importar fatura ---------- */
.cs-list { max-height: 50vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.cs-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: .5px solid var(--sep); }
.cs-row.off { opacity: .45; }
.cs-row .grow { flex: 1; min-width: 0; }
.cs-row .title { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-row .sub { font-size: 12.5px; color: var(--text-2); }
.cs-row select { width: 170px; flex-shrink: 0; padding: 7px 28px 7px 10px; font-size: 13.5px; }
.cs-row .right { min-width: 92px; text-align: right; font-weight: 600; font-size: 14px; }

@media (max-width: 760px) {
  .hero-plain { padding: 10px 2px 20px; }
  .hero-plain .hero-value { font-size: 42px; }
  .insights .insight { flex: 0 0 82%; }
  .preset-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cs-row { flex-wrap: wrap; }
  .cs-row select { order: 4; width: calc(100% - 30px); margin-left: 30px; }
}

/* ---------- Autosugestão ---------- */
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; background: var(--bg-elev); border-radius: 14px; padding: 6px;
  box-shadow: 0 0 0 .5px var(--sep), 0 12px 32px rgba(0,0,0,.18); max-height: 320px; overflow-y: auto; animation: pop .15s var(--ease); }
.suggest-head { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 4px 8px 6px; }
.suggest-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 7px 8px; border-radius: 10px; cursor: pointer; text-align: left; }
.suggest-item:hover, .suggest-item.on { background: var(--fill-2); }
.suggest-item .cat-icon { width: 32px; height: 32px; font-size: 16px; }
.suggest-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.suggest-item .title { font-weight: 500; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-item .sub { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-item .amt { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- Patrimônio ---------- */
.compbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; margin-bottom: 10px; }
.fipe-box { background: var(--fill-2); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.fipe-box .field { margin-bottom: 10px; }
.fipe-box select, .fipe-box input:not([type=checkbox]) { background: var(--bg-elev); }
.fipe-box .inst-search { margin-bottom: 6px; }
.fipe-title { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 10px; }
.fipe-title .i { color: var(--blue); }
.seg.kinds { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); }
.seg.kinds button { font-size: 13px; padding: 7px 4px; }
@media (max-width: 760px) { .seg.kinds { grid-template-columns: repeat(3, 1fr); } .preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }

/* =====================================================================
   Direção de arte 2 — "livro-caixa silencioso" (brief de pesquisa: Copilot, Mercury, Robinhood, Monarch)
   ===================================================================== */
:root {
  --bg: #F6F6F4; --bg-elev: #FFFFFF; --fill-2: #EFEFEC; --fill: #E6E6E2; --sep: rgba(0, 0, 0, .07);
  --text: #17171A; --text-2: #5F5F66; --text-3: #9A9AA0;
  --accent: #0B8A75; --accent-soft: rgba(11, 138, 117, .12); --pos: #0B8A75; --neg: #C2453D; --warn: #B7791F;
  --chart-prev: #C9C9CD; --material: rgba(246, 246, 244, .8);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04); --r: 20px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0B0C; --bg-elev: #151517; --fill-2: #202023; --fill: #2A2A2E; --sep: rgba(255, 255, 255, .08);
    --text: #F2F2F3; --text-2: #A0A0A8; --text-3: #66666D;
    --accent: #34CFB2; --accent-soft: rgba(52, 207, 178, .16); --pos: #34CFB2; --neg: #F07A72; --warn: #E5B25A;
    --chart-prev: #3A3A3F; --material: rgba(11, 11, 12, .8); --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0B0C; --bg-elev: #151517; --fill-2: #202023; --fill: #2A2A2E; --sep: rgba(255, 255, 255, .08);
  --text: #F2F2F3; --text-2: #A0A0A8; --text-3: #66666D;
  --accent: #34CFB2; --accent-soft: rgba(52, 207, 178, .16); --pos: #34CFB2; --neg: #F07A72; --warn: #E5B25A;
  --chart-prev: #3A3A3F; --material: rgba(11, 11, 12, .8); --shadow: none;
}
.card { box-shadow: var(--shadow); border: 1px solid var(--sep); }
.i { stroke-width: 1.75; }
/* ícones de categoria neutros (sem arco-íris); cor só quando há significado */
.cat-icon, .sq { width: 36px; height: 36px; border-radius: 10px; background: var(--fill-2); color: var(--text-2); display: grid; place-items: center; flex-shrink: 0; }
.cat-icon .i, .sq .i { width: 19px; height: 19px; }
.avatar.generic { background: var(--fill-2); color: var(--text-2); border-radius: 10px; }
.catbar .progress > div { background: var(--text) !important; opacity: .8; }
.bar.inc { background: var(--accent); }
.chart-legend span[style*="--pos"]::before { background: var(--accent); }
.ti { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--fill-2); color: var(--text-2); margin-right: 8px; vertical-align: -6px; }
.ti .i { width: 13px; height: 13px; }
.empty .em { display: flex; justify-content: center; color: var(--text-3); }
.empty .em .i { width: 30px; height: 30px; stroke-width: 1.5; }
.empty-ic { display: flex; justify-content: center; color: var(--text-3); margin-bottom: 10px; }
.empty-ic .i { width: 36px; height: 36px; stroke-width: 1.5; }
.side-nav a.active { background: var(--fill-2); color: var(--text); }
.side-nav a.active .i { color: var(--accent); }
.side-nav a .i { color: var(--text-2); }
.topbar h1 { font-size: 26px; font-weight: 650; letter-spacing: -.025em; }
.sync-pill .i { width: 12px; height: 12px; vertical-align: -1px; }

/* ---------- Início ---------- */
.home { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; row-gap: 48px; max-width: 1120px; align-items: start; padding-top: 8px; }
.home .mob { display: none; }
.home-hero { grid-column: 1 / span 8; grid-row: 1; }
.home-rail { grid-column: 9 / span 4; grid-row: 1 / span 2; }
.home-cats { grid-column: 1 / span 8; grid-row: 2; }
.home-note { grid-column: 9 / span 4; grid-row: 3; margin-top: -24px; }
.home-cap { font-size: 14px; font-weight: 500; color: var(--text-2); }
.home-amt { font-size: 56px; font-weight: 600; letter-spacing: -.035em; line-height: 1; margin: 10px 0 14px; font-variant-numeric: tabular-nums; }
.home-amt .cur { font-size: .45em; font-weight: 500; color: var(--text-2); margin-right: 6px; letter-spacing: -.01em; vertical-align: .55em; }
.home-amt .dec { font-size: .5em; color: var(--text-2); letter-spacing: -.01em; }
.home-cmp { font-size: 15px; font-weight: 500; }
.home-cmp .sep { color: var(--text-3); margin: 0 6px; }
.acc { color: var(--accent); }
.hchart { position: relative; height: 200px; margin-top: 28px; touch-action: pan-y; cursor: crosshair; }
.hchart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hchart path, .hchart line { vector-effect: non-scaling-stroke; fill: none; }
.hchart .base { stroke: var(--sep); stroke-width: 1; }
.hchart .prev { stroke: var(--chart-prev); stroke-width: 1.5; stroke-dasharray: 3 4; stroke-linecap: round; }
.hchart .cur { stroke: var(--accent); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.hchart .area { fill: url(#hgrad); }
.hchart .drop { stroke: var(--sep); stroke-width: 1; }
.hchart.anim .cur, .hchart.anim .area { clip-path: inset(0 100% 0 0); animation: reveal .7s cubic-bezier(.2, .7, .2, 1) .1s forwards; }
.hchart.anim .hdot { opacity: 0; animation: dotIn .3s ease .7s forwards; }
@keyframes reveal { to { clip-path: inset(0 0 0 0); } }
@keyframes dotIn { to { opacity: 1; } }
.hdot { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; }
.hdot.now { width: 9px; height: 9px; background: var(--accent); box-shadow: 0 0 0 2.5px var(--bg); }
.hdot.ghost { width: 6px; height: 6px; background: var(--text-3); }
.hlabel { position: absolute; right: 0; transform: translateY(-140%); font-size: 11px; font-weight: 500; color: var(--text-3); white-space: nowrap; pointer-events: none; }
.hticks { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; font-size: 11px; font-weight: 500; color: var(--text-3); pointer-events: none; }
.hticks span { position: absolute; transform: translateX(-50%); }
.hticks span:first-child { transform: none; }
.hticks .today { color: var(--text); font-weight: 600; }
.hscrub { position: absolute; inset: 0 0 22px 0; pointer-events: none; }
.hscrub i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--text-3); opacity: .5; }
.hscrub b { position: absolute; top: -10px; transform: translate(-50%, -100%); background: var(--bg-elev); border: 1px solid var(--sep); box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hscrub b span:first-child { color: var(--text-2); font-weight: 500; margin-right: 4px; }
.home-title { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; font-weight: 600; letter-spacing: -.005em; margin-bottom: 8px; }
.home-title a, .rail-head a { font-size: 13px; font-weight: 500; }
.rail-card { background: var(--bg-elev); border: 1px solid var(--sep); border-radius: 20px; padding: 22px 22px 18px; box-shadow: var(--shadow); }
.rail-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 500; color: var(--text-2); }
.rail-total { font-size: 28px; font-weight: 600; letter-spacing: -.03em; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }
.rail-list { display: flex; flex-direction: column; }
.rrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--text); background: none; border: 0; width: 100%; text-align: left; cursor: pointer; border-radius: 8px; }
.rrow:hover .nm { color: var(--text); }
.rrow .nm { flex: 1; min-width: 0; font-size: 14.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .nm small { display: block; font-size: 12.5px; margin-top: 1px; }
.rrow .amt { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rrow .sq { width: 28px; height: 28px; border-radius: 8px; }
.rrow .sq .i { width: 16px; height: 16px; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.sm .i { width: 14px; height: 14px; }
.rail-sep { height: 1px; background: var(--sep); margin: 14px 0 16px; }
.rail-link { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; font-weight: 500; color: var(--text-2); margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--sep); }
.hcats { display: flex; flex-direction: column; }
.hcat { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: center; padding: 12px 0; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; color: inherit; border-radius: 12px; }
.hcat:hover .nm { color: var(--accent); }
.hcat-main { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.hcat-top { display: flex; justify-content: space-between; gap: 10px; }
.hcat .nm { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .18s; }
.hcat .amt { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.track { height: 4px; border-radius: 999px; background: var(--fill-2); overflow: hidden; display: block; }
.track span { display: block; height: 100%; border-radius: 999px; background: var(--text); opacity: .85; transition: width .6s cubic-bezier(.2, .7, .2, 1); }
.track span.b { background: var(--accent); opacity: 1; }
.hcat .cap { font-size: 12.5px; color: var(--text-2); }
.hcat.alarm .sq { background: color-mix(in srgb, var(--neg) 12%, transparent); color: var(--neg); }
.hcat.alarm .track span { background: var(--neg); opacity: 1; }
.hnote { display: flex; gap: 12px; align-items: flex-start; padding: 16px 16px 16px 14px; background: var(--bg-elev); border: 1px solid var(--sep); border-radius: 20px; cursor: pointer; }
.hnote p { flex: 1; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.hnote p b { color: var(--text); font-weight: 600; }
.hnote-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--fill-2); color: var(--text-2); }
.hnote-ic .i { width: 16px; height: 16px; }
.hnote.t-bad .hnote-ic, .hnote.t-warn .hnote-ic { background: color-mix(in srgb, var(--neg) 12%, transparent); color: var(--neg); }
.hnote.t-good .hnote-ic { background: var(--accent-soft); color: var(--accent); }
.hnote .chev { margin-top: 6px; }
.home-empty { max-width: 720px; padding-top: 8px; }
.home-dash { height: 120px; border-bottom: 1.5px dashed var(--sep); margin: 18px 0 20px; }
.achips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px 4px; }
.achips::-webkit-scrollbar { display: none; }
.achip { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; background: var(--fill-2); border-radius: 14px; color: var(--text); flex-shrink: 0; }
.achip > span { display: flex; flex-direction: column; }
.achip .nm { font-size: 12px; color: var(--text-2); max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.achip .amt { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Seletor de categoria ---------- */
.cat-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 12px 6px 6px; border: 0; border-radius: 12px; background: var(--fill-2); cursor: pointer; text-align: left; min-height: 44px; }
.cat-btn:hover { background: var(--fill); }
.cat-btn .sq { width: 32px; height: 32px; border-radius: 9px; background: var(--bg-elev); }
.cat-btn .nm { flex: 1; font-size: 15px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 4px 0 8px; }
.cp-sec { margin-bottom: 14px; }
.cp-top { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 0; border-radius: 999px; background: var(--fill-2); cursor: pointer; font-size: 14px; font-weight: 500; }
.cp-chip .sq { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-elev); }
.cp-chip .sq .i { width: 15px; height: 15px; }
.cp-chip.on { background: var(--accent-soft); color: var(--accent); }
.cp-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; }
.cp-opt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; background: none; border-radius: 12px; cursor: pointer; text-align: left; font-size: 14.5px; min-width: 0; }
.cp-opt:hover { background: var(--fill-2); }
.cp-opt.on { background: var(--accent-soft); }
.cp-opt .sq { width: 32px; height: 32px; }
.cp-opt .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-opt .ok { color: var(--accent); width: 17px; height: 17px; }
.icon-pick button .i { width: 19px; height: 19px; }

@media (max-width: 760px) {
  .home { display: flex; flex-direction: column; gap: 32px; }
  .home .desk { display: none; }
  .home .mob { display: flex; }
  .home .hcats.mob { flex-direction: column; }
  .home-hero { order: 1; } .home-due { order: 2; flex-direction: column; } .home-cats { order: 3; } .home-rail { order: 4; } .home-note { order: 5; margin-top: 0; }
  .home-amt { font-size: 44px; }
  .hchart { height: 160px; margin-top: 22px; }
  .rail-card { padding: 18px; }
  .cp-list { grid-template-columns: minmax(0, 1fr); }
}
/* Início: coluna lateral com largura fixa; empilha em telas médias */
.home { grid-template-columns: minmax(0, 1fr) 320px; column-gap: 40px; }
.home-hero, .home-cats { grid-column: 1; }
.home-rail { grid-column: 2; grid-row: 1 / span 2; }
.home-note { grid-column: 2; grid-row: 3; }
@media (min-width: 761px) and (max-width: 1100px) {
  .home { grid-template-columns: minmax(0, 1fr); row-gap: 36px; }
  .home-hero { grid-row: 1; } .home-rail { grid-column: 1; grid-row: 2; } .home-cats { grid-row: 3; } .home-note { grid-column: 1; grid-row: 4; margin-top: 0; }
}
@media (max-width: 760px) { .home { align-items: stretch; } .home > * { width: 100%; } }

/* Alternância Gastos / Receitas no Início */
.hmode { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--fill-2); margin-bottom: 20px; }
.hmode button { border: 0; background: none; padding: 6px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background .18s, color .18s; }
.hmode button.on { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 0 0 1px var(--sep); }
.strong { font-weight: 600; }
.rrow .btn.sm { padding: 5px 10px; font-size: 12.5px; margin-left: 4px; }

/* ---------- Páginas no padrão do Início ---------- */
.page { max-width: 1120px; padding-top: 8px; }
.page-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.page-top .hmode { margin-bottom: 0; }
.page-hero { margin: 16px 0 32px; }
.home-title .small { font-weight: 500; }

/* Recorrentes */
.rec-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; }
.rec-grid .card { border-radius: 20px; }
.rc-head, .rc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.rc-head span { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-3); padding-bottom: 6px; }
.rc-day { min-height: 46px; border-radius: 10px; padding: 5px 4px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-variant-numeric: tabular-nums; }
.rc-day b { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.rc-day i { font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--text); line-height: 1.2; }
.rc-day.has { background: var(--fill-2); }
.rc-day.past { opacity: .5; }
.rc-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); opacity: 1; }
.rc-day.today b { color: var(--accent); font-weight: 700; }
.rec-list { display: flex; flex-direction: column; background: var(--bg-elev); border: 1px solid var(--sep); border-radius: 20px; padding: 4px 16px; }
.rec-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; color: inherit; position: relative; }
.rec-row + .rec-row::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; height: 1px; background: var(--sep); }
.rec-row:hover .nm { color: var(--accent); }
.rec-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rec-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rec-row .nm { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .18s; }
.rec-row .cap { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-row .amt { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec-row .amt small { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 2px; }
.rec-row .pill { font-size: 11px; padding: 2px 7px; }
.rd-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.sq.lg { width: 48px; height: 48px; border-radius: 14px; }
.sq.lg .i { width: 24px; height: 24px; }
.rd-amt { font-size: 26px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.rd-amt small { font-size: 14px; font-weight: 500; color: var(--text-2); margin-left: 4px; letter-spacing: 0; }
.mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding-top: 6px; }
.mini-bars span { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.mini-bars i { width: 100%; max-width: 22px; background: var(--fill); border-radius: 5px 5px 2px 2px; min-height: 2px; }
.mini-bars span:last-child i, .mini-bars span.cur i { background: var(--accent); }
.mini-bars b { font-size: 10.5px; font-weight: 500; color: var(--text-3); }
.rd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.rd-stats div { background: var(--fill-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.rd-stats span { font-size: 12px; color: var(--text-2); }
.rd-stats b { font-size: 15px; font-variant-numeric: tabular-nums; }

/* Fluxo de caixa */
.cf-card { padding: 20px 20px 14px; border-radius: 20px; }
.cf-legend { display: flex; gap: 16px; align-items: center; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.cf-legend .li::before, .cf-legend .lo::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 6px; }
.cf-legend .li::before { background: var(--accent); } .cf-legend .lo::before { background: var(--text); opacity: .8; }
.cf-legend .small { margin-left: auto; font-weight: 400; }
.cf { display: flex; align-items: stretch; gap: 6px; height: 260px; padding-top: 70px; }
.cf-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; position: relative; border-radius: 10px; outline: none; }
.cf-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 0 2px; }
.cf-bars span { width: 42%; max-width: 20px; border-radius: 5px 5px 2px 2px; min-height: 2px; transition: height .6s cubic-bezier(.2, .7, .2, 1), opacity .15s; }
.cf-bars .in { background: var(--accent); }
.cf-bars .out { background: var(--text); opacity: .8; }
.cf-col:not(.cur) .cf-bars span { opacity: .45; }
.cf:hover .cf-col .cf-bars span { opacity: .35; }
.cf .cf-col:hover .cf-bars span, .cf .cf-col:focus .cf-bars span { opacity: 1; }
.cf-col:hover .cf-bars .out { opacity: .85; }
.cf-net { font-size: 11px; font-weight: 600; margin-top: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cf-lbl { font-size: 11.5px; color: var(--text-3); text-transform: capitalize; margin-top: 2px; }
.cf-col.cur .cf-lbl { color: var(--text); font-weight: 600; }
.cf-tip { position: absolute; bottom: calc(100% - 64px); left: 50%; transform: translate(-50%, -6px); background: var(--bg-elev); border: 1px solid var(--sep); border-radius: 12px; padding: 9px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14); font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 2; min-width: 150px; }
.cf-tip b { font-size: 13px; margin-bottom: 2px; }
.cf-tip span { display: flex; justify-content: space-between; gap: 14px; color: var(--text-2); }
.cf-tip i { font-style: normal; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.cf-col:hover .cf-tip, .cf-col:focus .cf-tip { opacity: 1; }
.cf-col:first-child .cf-tip { left: 0; transform: translate(0, -6px); }
.cf-col:last-child .cf-tip { left: auto; right: 0; transform: translate(0, -6px); }
.sline { position: relative; height: 90px; }
.sline svg { width: 100%; height: 100%; overflow: visible; }
.sline path { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.sline .zero { stroke: var(--sep); vector-effect: non-scaling-stroke; }
.sline-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translate(-50%, -50%); box-shadow: 0 0 0 2.5px var(--bg-elev); }
.cf-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cf-cat { display: grid; grid-template-columns: 36px minmax(0, 1fr) 84px auto; gap: 12px; align-items: center; padding: 11px 4px; width: 100%; background: none; border: 0; text-align: left; cursor: pointer; color: inherit; position: relative; }
.cf-cat + .cf-cat::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; height: 1px; background: var(--sep); }
.cf-cat:hover .nm { color: var(--accent); }
.cf-cat-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.cf-cat .nm { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .18s; }
.cf-cat .cap { font-size: 12px; color: var(--text-2); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.spark i { flex: 1; background: var(--fill); border-radius: 2px; }
.spark i.last { background: var(--accent); }
.cf-cat-r { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 96px; }
.cf-cat-r b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.cf-cat-r small { font-size: 11.5px; font-weight: 600; text-transform: capitalize; }
@media (max-width: 1100px) { .rec-grid, .cf-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .cf { height: 220px; gap: 3px; } .cf-net { font-size: 9.5px; } .cf-lbl { font-size: 10.5px; }
  .cf-legend .small { display: none; }
  .cf-cat { grid-template-columns: 36px minmax(0, 1fr) auto; } .spark { display: none; }
  .rec-list { padding: 4px 14px; }
}

/* ---------- Análises ---------- */
.an-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 36px; }
.an-card { padding: 18px 20px; border-radius: 20px; }
.lchart { position: relative; margin-bottom: 18px; }
.lchart svg { width: 100%; height: 100%; overflow: visible; }
.lchart .ln { fill: none; stroke: var(--accent); stroke-width: 2.25; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.lchart-v { position: absolute; right: 0; transform: translateY(-160%); font-size: 12px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.lchart-x { position: absolute; left: 0; right: 0; bottom: -20px; height: 14px; font-size: 10.5px; color: var(--text-3); }
.lchart-x span { position: absolute; transform: translateX(-50%); text-transform: capitalize; }
.lchart-x span:first-child { transform: none; } .lchart-x span:last-child { transform: translateX(-100%); }
.lchart-x span.on { color: var(--text); font-weight: 600; }
.lchart-hit { position: absolute; inset: 0; display: flex; }
.lchart-hit i { flex: 1; }
.lchart-hit i:hover { background: linear-gradient(to right, transparent calc(50% - .5px), var(--sep) calc(50% - .5px), var(--sep) calc(50% + .5px), transparent calc(50% + .5px)); }
.tmap { position: relative; width: 100%; border-radius: 14px; overflow: hidden; }
.tm { position: absolute; border: 2px solid var(--bg-elev); border-radius: 10px; background: color-mix(in srgb, var(--accent) calc(var(--o) * 100%), var(--fill-2)); color: #fff; cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 2px; padding: 10px 12px; text-align: left; overflow: hidden; transition: filter .15s; }
.tm:hover { filter: brightness(1.08); }
.tm .tm-ic { position: absolute; top: 10px; left: 12px; opacity: .9; } .tm .tm-ic .i { width: 18px; height: 18px; }
.tm-nm { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tm-v { font-size: 12px; opacity: .85; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm:not(.top) { color: var(--text); }
.tm:nth-child(-n+3) { color: #fff; }
:root[data-theme="dark"] .tm { color: #04140f; } :root[data-theme="dark"] .tm:not(:nth-child(-n+3)) { color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tm { color: #04140f; } :root:not([data-theme="light"]) .tm:not(:nth-child(-n+3)) { color: var(--text); } }
.cf-legend .sl::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 6px; background: var(--c); }
.stack { display: flex; align-items: flex-end; gap: 8px; height: 230px; margin-top: 12px; }
.stack-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.stack-bar { width: 70%; max-width: 34px; display: flex; flex-direction: column-reverse; border-radius: 6px; overflow: hidden; gap: 1px; min-height: 2px; }
.stack-bar i { display: block; min-height: 1px; }
.stack-col:not(.cur) .stack-bar { opacity: .75; }
.stack-col.cur .cf-lbl { color: var(--text); font-weight: 600; }
.sankey-card { padding: 22px 24px; }
.sankey { width: 100%; height: auto; overflow: visible; }
.sankey .rb { opacity: .22; transition: opacity .15s; }
.sankey .rb:hover { opacity: .5; }
.sankey .rb.in { fill: var(--accent); } .sankey .rb.out { fill: var(--text-3); } .sankey .rb.save { fill: var(--accent); opacity: .4; } .sankey .rb.bal { fill: var(--neg); }
.sankey .nd { fill: var(--text-2); } .sankey .nd.l, .sankey .nd.c, .sankey .nd.save { fill: var(--accent); } .sankey .nd.bal { fill: var(--neg); }
.sankey text { font-family: inherit; }
.sankey .t1 { font-size: 18px; font-weight: 600; fill: var(--text); }
.sankey .t2 { font-size: 15px; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.hm-wrap { overflow-x: auto; padding-bottom: 4px; }
.hm-months { display: flex; gap: 3px; font-size: 10.5px; color: var(--text-3); height: 16px; min-width: max-content; }
.hm-months span { width: 13px; white-space: nowrap; overflow: visible; }
.hm { display: flex; gap: 3px; min-width: max-content; }
.hm-w { display: flex; flex-direction: column; gap: 3px; }
.hm i { width: 13px; height: 13px; border-radius: 3px; display: block; }
.hm .l0, .hm-leg .l0 { background: var(--fill-2); }
.hm .l1, .hm-leg .l1 { background: color-mix(in srgb, var(--accent) 28%, var(--fill-2)); }
.hm .l2, .hm-leg .l2 { background: color-mix(in srgb, var(--accent) 52%, var(--fill-2)); }
.hm .l3, .hm-leg .l3 { background: color-mix(in srgb, var(--accent) 76%, var(--fill-2)); }
.hm .l4, .hm-leg .l4 { background: var(--accent); }
.hm-leg { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: 11px; color: var(--text-3); margin-top: 10px; }
.hm-leg i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.hm-leg span { margin: 0 4px; }
.wd { display: flex; gap: 10px; height: 190px; align-items: stretch; }
.wd-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wd-v { font-size: 11px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.wd-bar { flex: 1; width: 100%; max-width: 36px; display: flex; align-items: flex-end; }
.wd-bar i { width: 100%; background: var(--fill); border-radius: 6px 6px 3px 3px; min-height: 3px; }
.wd-col.top .wd-bar i { background: var(--accent); }
.wd-col.top .wd-v, .wd-col.top .cf-lbl { color: var(--text); }
.mrow { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.mrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.mrow-top { display: flex; justify-content: space-between; gap: 8px; }
.mrow .nm { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .amt { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mrow .cap { font-size: 12px; color: var(--text-2); }
.an-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.an-stats div { background: var(--bg-elev); border: 1px solid var(--sep); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.an-stats span { font-size: 12.5px; color: var(--text-2); }
.an-stats b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.an-stats small { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Revisar transações ---------- */
.nav-badge { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #fff; }
:root[data-theme="dark"] .nav-badge { color: #04140f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav-badge { color: #04140f; } }
.bottom-nav a { position: relative; }
.tab-dot { position: absolute; top: 2px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.acc-sq { background: var(--accent-soft) !important; color: var(--accent) !important; }
.review { max-width: 640px; margin: 0 auto; }
.review-top { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.review-prog { flex: 1; height: 4px; border-radius: 999px; background: var(--fill-2); overflow: hidden; }
.review-prog i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.review-card { background: var(--bg-elev); border: 1px solid var(--sep); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); animation: pop .25s var(--ease); }
.rv-meta { font-size: 13px; color: var(--text-2); font-weight: 500; }
.rv-meta::first-letter { text-transform: uppercase; }
.rv-amt { font-size: 44px; font-weight: 600; letter-spacing: -.035em; margin: 10px 0 8px; line-height: 1; font-variant-numeric: tabular-nums; }
.rv-amt .cur { font-size: .45em; font-weight: 500; color: var(--text-2); margin-right: 6px; vertical-align: .55em; }
.rv-amt .dec { font-size: .5em; color: var(--text-2); }
.rv-desc { font-size: 17px; font-weight: 500; background: transparent; padding: 6px 0; border-radius: 0; border-bottom: 1px solid var(--sep); margin-bottom: 22px; }
.rv-desc:focus { background: transparent; box-shadow: none; border-bottom-color: var(--accent); }
.rv-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.rv-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-cat { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: 1px solid var(--sep); background: var(--bg-elev); border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer; }
.rv-cat .sq { width: 28px; height: 28px; border-radius: 50%; } .rv-cat .sq .i { width: 15px; height: 15px; }
.rv-cat:hover { background: var(--fill-2); }
.rv-cat.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.rv-cat.on .sq { background: var(--accent); color: #fff; }
.rv-cat.other { padding: 8px 14px; color: var(--text-2); }
.rv-cat .i { width: 15px; height: 15px; }
kbd { font-family: inherit; font-size: 10.5px; font-weight: 600; color: var(--text-3); border: 1px solid var(--sep); border-radius: 5px; padding: 0 5px; margin-left: 2px; }
.btn.primary kbd { color: inherit; border-color: rgba(255, 255, 255, .4); opacity: .8; }
.rv-rule { margin: 20px 0 0; font-size: 14px; color: var(--text-2); }
.rv-rule b { color: var(--text); font-weight: 600; }
.rv-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.review-done { text-align: center; padding: 60px 20px; max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.review-done h2 { font-size: 24px; letter-spacing: -.03em; }
@media (max-width: 1100px) { .an-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .page-top { flex-direction: column; align-items: stretch; }
  .page-top .hmode { overflow-x: auto; }
  .an-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-stats div:last-child { grid-column: 1 / -1; }
  .sankey .t1 { font-size: 26px; } .sankey .t2 { font-size: 22px; }
  .review-card { padding: 22px 18px; } .rv-amt { font-size: 38px; }
  kbd { display: none; }
}

/* heatmap responsivo: as semanas dividem a largura do cartão */
.hm-months, .hm { display: grid; grid-template-columns: repeat(var(--wk), minmax(6px, 1fr)); gap: 2px; min-width: 0; }
.hm-w { grid-template-rows: repeat(7, auto); gap: 2px !important; }
.hm i.pad { visibility: hidden; }
.hm-months span { width: auto; overflow: visible; white-space: nowrap; }
.hm-w { display: grid; gap: 3px; }
.hm i { width: 100%; height: auto; aspect-ratio: 1; border-radius: 3px; }

.hmode button { white-space: nowrap; }
@media (max-width: 760px) { .page-top .hmode button { padding: 6px 12px; } }

/* ---------- Metas ---------- */
.goals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.goal { display: flex; gap: 18px; align-items: center; padding: 20px; background: var(--bg-elev); border: 1px solid var(--sep); border-radius: 20px; cursor: pointer; text-align: left; color: inherit; transition: transform .18s, box-shadow .18s; }
.goal:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0, 0, 0, .06); }
.goal-ring { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.goal-ring.lg { width: 76px; height: 76px; }
.goal-ring .sq { position: absolute; inset: 0; margin: auto; width: 36px; height: 36px; border-radius: 50%; }
.ring { display: block; }
.ring-bg { fill: none; stroke: var(--fill-2); }
.ring-fg { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .8s cubic-bezier(.2, .7, .2, 1); }
.goal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.goal-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.goal .nm { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal .pct { font-size: 14px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.goal-amt { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.goal-amt .muted { font-weight: 500; }
.goal-line { font-size: 13px; color: var(--text-2); }
.goal-line b { color: var(--text); }
.goal-more { margin-top: 28px; }
.goal-more summary { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.goal-accs { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; background: var(--fill-2); border-radius: 12px; padding: 6px; }
.goal-acc { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; margin: 0; color: var(--text); font-weight: 500; font-size: 14.5px; }
.goal-acc:hover { background: var(--bg-elev); }
.goal-acc .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-acc .amt { font-size: 13.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.goal-acc input { flex-shrink: 0; }
.rd-amt small { margin-left: 6px; }
@media (max-width: 900px) { .goals { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .goal { padding: 16px; gap: 14px; } }

/* ---------- Planejamento ---------- */
.plan-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--fill-2); }
.plan-bar i { display: block; height: 100%; min-width: 3px; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.plan-grid .card { border-radius: 20px; }
.nm-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 8px; margin-bottom: 8px; align-items: center; }
@media (max-width: 1100px) { .plan-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .nm-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; } .nm-row input:first-child { grid-column: 1 / -1; } }

/* =====================================================================
   Reorganização: cores de entrada (verde) e saída (vermelho), abas internas, Ajustes
   ===================================================================== */
:root { --pos: #18884A; --neg: #D23B3B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pos: #3CCB7F; --neg: #F26B6B; } }
:root[data-theme="dark"] { --pos: #3CCB7F; --neg: #F26B6B; }
.acc { color: var(--pos); }
.tx-amt.neg { color: var(--neg); }
.tx-amt.pos { color: var(--pos); }
.cf-bars .in { background: var(--pos); }
.cf-bars .out { background: var(--neg); opacity: .85; }
.cf-legend .li::before { background: var(--pos); } .cf-legend .lo::before { background: var(--neg); opacity: .85; }
.bar.inc { background: var(--pos); } .bar.exp { background: var(--neg); }
.home-amt.is-exp { color: var(--neg); } .home-amt.is-inc { color: var(--pos); }
.home-amt.is-exp .cur, .home-amt.is-inc .cur { color: var(--text-2); }
.home-amt.is-exp .dec, .home-amt.is-inc .dec { color: inherit; opacity: .7; }
.hchart[data-type="expense"] { --line: var(--neg); } .hchart[data-type="income"] { --line: var(--pos); }
.hchart .cur { stroke: var(--line, var(--accent)); }
.hdot.now { background: var(--line, var(--accent)); }
.rec-row .amt.neg { color: var(--neg); } .rec-row .amt.pos, .rrow .amt.pos { color: var(--pos); } .rrow .amt.neg { color: var(--neg); }
.rec-row[role="button"] { cursor: pointer; }
.rec-row .btn.sm { margin-left: 6px; flex-shrink: 0; }

/* Abas internas dos hubs (Planejamento, Patrimônio) */
.hub-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--fill-2); margin: 4px 0 8px; }
.hub-tabs a { padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.hub-tabs a.on { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 0 0 1px var(--sep); }
.hub-tabs + .page, .hub-tabs + .home { padding-top: 0; }
.side-nav .side-foot { margin-top: auto; color: var(--text-2); }

/* Ajustes */
.settings { max-width: 680px; }
.set-group { margin-bottom: 26px; }
.set-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 8px 6px; }
.set-card { background: var(--bg-elev); border: 1px solid var(--sep); border-radius: 18px; padding: 2px 14px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; width: 100%; background: none; border: 0; text-align: left; color: var(--text); position: relative; cursor: default; }
button.set-row, a.set-row { cursor: pointer; }
.set-row + .set-row::before { content: ""; position: absolute; top: 0; left: 48px; right: 0; height: 1px; background: var(--sep); }
.set-row .sq { width: 34px; height: 34px; border-radius: 9px; }
.set-row .sq .i { width: 18px; height: 18px; }
.set-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.set-t { font-size: 15px; font-weight: 500; }
.set-s { font-size: 12.5px; color: var(--text-2); }
button.set-row:hover .set-t, a.set-row:hover .set-t { color: var(--accent); }
.set-row.danger .set-t { color: var(--neg); }
.set-row.danger .sq { background: color-mix(in srgb, var(--neg) 12%, transparent); color: var(--neg); }
.switch { width: 46px; height: 28px; border-radius: 999px; border: 0; background: var(--fill); position: relative; cursor: pointer; flex-shrink: 0; transition: background .2s; padding: 0; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch.on { background: var(--pos); } .switch.on i { transform: translateX(18px); }
@media (max-width: 760px) {
  .hub-tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
  .hub-tabs a { flex: 1; text-align: center; padding: 7px 10px; }
  .set-row .hmode button { padding: 6px 10px; font-size: 12.5px; }
  .set-row:has(.hmode) { flex-wrap: wrap; }
}

/* ---------- Início v3: saldo no topo, mês como bloco secundário, destaque em linha ---------- */
.home-hero { grid-column: 1; grid-row: 1; }
.home-month { grid-column: 1; grid-row: 2; background: var(--bg-elev); border: 1px solid var(--sep); border-radius: 22px; padding: 20px 22px 16px; }
.home-cats { grid-column: 1; grid-row: 3; }
.home-rail { grid-column: 2; grid-row: 1 / span 3; }
.home { row-gap: 36px; }
.hm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hm-head .hmode { margin: 0; }
.hm-amt { font-size: 30px; font-weight: 600; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.small-cmp { font-size: 14px; margin-top: 6px; }
.home-month .hchart { height: 170px; margin-top: 18px; }
.irow-wrap { background: var(--bg-elev); border: 1px solid var(--sep); border-radius: 16px; padding: 2px 14px; }
.irow { display: flex; align-items: center; gap: 12px; padding: 12px 0; width: 100%; background: none; border: 0; text-align: left; color: var(--text); }
button.irow { cursor: pointer; }
button.irow:hover .irow-t { color: var(--accent); }
.irow-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--fill-2); color: var(--text-2); }
.irow-ic .i { width: 17px; height: 17px; }
.irow.t-bad .irow-ic, .irow.t-warn .irow-ic { color: var(--warn); }
.irow.t-good .irow-ic { color: var(--pos); }
.irow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.irow-t { font-size: 15px; font-weight: 500; transition: color .18s; }
.irow-s { font-size: 13px; color: var(--text-2); line-height: 1.4; }
.irow-s b { font-weight: 500; color: var(--text-2); }
@media (min-width: 761px) and (max-width: 1100px) {
  .home-hero { grid-row: 1; } .home-month { grid-column: 1; grid-row: 2; } .home-rail { grid-column: 1; grid-row: 3; } .home-cats { grid-row: 4; }
}
@media (max-width: 760px) {
  .home-hero { order: 1; } .home-due { order: 2; } .home-month { order: 3; padding: 16px; } .home-cats { order: 4; } .home-rail { order: 5; }
  .hm-head { flex-direction: column; } .hm-amt { font-size: 26px; }
}

/* ---------- Início: crescimento do patrimônio ---------- */
.nw-title { margin-top: 28px; }
.nw-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 14px; }
.seg-mini { display: inline-flex; background: var(--fill-2); border-radius: 9px; padding: 2px; }
.seg-mini button { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--text-2); padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.seg-mini button.on { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chip-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--sep); background: none; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--text-2); padding: 5px 10px; border-radius: 9px; cursor: pointer; }
.chip-toggle .i { width: 14px; height: 14px; }
.chip-toggle.on { border-color: var(--accent); color: var(--accent); }
.nwc { position: relative; height: 210px; touch-action: pan-y; }
.nwc svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.nw-line { fill: none; stroke: var(--accent); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.nw-area { fill: url(#nwgrad); }
.nw-bar { fill: var(--accent); opacity: .55; } .nw-bar.last { opacity: 1; }
.nw-base { stroke: var(--sep); stroke-width: 1; vector-effect: non-scaling-stroke; }
.nw-trend { stroke: var(--text-3); stroke-width: 1.5; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.nw-trend.proj { stroke: var(--accent); opacity: .7; }
.nw-tl { position: absolute; transform: translate(-100%, -120%); font-size: 11px; line-height: 1.3; color: var(--text-3); text-align: right; white-space: nowrap; pointer-events: none; }
.nw-tl b { color: var(--text-2); font-weight: 600; }
.nw-y { position: absolute; left: 0; font-size: 11px; color: var(--text-3); pointer-events: none; }
.nw-y.hi { top: 0; } .nw-y.lo { bottom: 26px; }
.nwc .hscrub b { position: absolute; top: 2px; transform: translateX(-50%); z-index: 2; background: var(--bg-elev); border: 1px solid var(--sep); border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.nwc .hscrub b span:first-child { color: var(--text-3); font-weight: 500; margin-right: 4px; }
.nw-sum { font-size: 13.5px; margin-top: 10px; line-height: 1.5; }
@media (max-width: 760px) { .nwc { height: 180px; } .nw-tl { display: none; } }

/* ---------- Importação de fatura: grupos, nomes editáveis ---------- */
.cs-bar { display: flex; align-items: flex-end; gap: 12px; margin: 12px 0 6px; flex-wrap: wrap; }
.cs-bar .field { flex: 1; min-width: 220px; margin: 0; }
.cs-view { margin-bottom: 4px; }
.cs-list { max-height: 56vh; }
.cs-name { width: 100%; border: 0; background: none; padding: 2px 0; font: inherit; font-weight: 500; font-size: 14.5px; color: var(--text); border-bottom: 1px dashed transparent; border-radius: 0; }
.cs-name:hover { border-bottom-color: var(--sep); } .cs-name:focus { outline: none; border-bottom-color: var(--accent); }
.cs-group { border-bottom: .5px solid var(--sep); } .cs-group .cs-ghead { border-bottom: 0; }
.cs-group.off .cs-ghead { opacity: .45; }
.cs-toggle { border: 0; background: none; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font: inherit; font-size: 12.5px; }
.cs-toggle .chev { width: 14px; height: 14px; transition: transform .15s; } .cs-toggle .chev.open { transform: rotate(90deg); }
.cs-row.nested { padding-left: 26px; border-bottom: 0; } .cs-row.nested .title { font-weight: 400; font-size: 13px; color: var(--text-2); }
.cs-credit { min-width: 170px; text-align: right; }
.raw-desc { display: block; margin-top: 4px; font-size: 12px; }
.toast.has-action { display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.toast button { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
@media (max-width: 760px) { .cs-credit { display: none; } .cs-row.nested { padding-left: 30px; } }

/* ---------- Dica flutuante dos gráficos ---------- */
.gtip { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; max-width: 260px; padding: 8px 11px; border-radius: 10px; background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--sep); box-shadow: 0 8px 28px rgba(0,0,0,.18); font-size: 12.5px; line-height: 1.45; display: flex; flex-direction: column; opacity: 0; transition: opacity .12s; }
.gtip.on { opacity: 1; }
.gtip b { font-weight: 600; font-size: 13px; margin-bottom: 1px; }
.gtip span { color: var(--text-2); font-variant-numeric: tabular-nums; }
[data-tip] { cursor: default; }
.stack-bar i, .spark i, .hm i, .lchart-hit i, .inv-bar { transition: opacity .12s, filter .12s; }
.stack-bar i:hover, .spark i:hover, .hm i:hover { filter: brightness(1.15); outline: 1.5px solid var(--text); outline-offset: -1px; }
.mrow.clickable { cursor: pointer; border-radius: 10px; } .mrow.clickable:hover .nm { color: var(--accent); }
.sline { position: relative; } .sline .lchart-hit { position: absolute; inset: 0; display: flex; } .sline .lchart-hit i { flex: 1; }
.cf.dense .cf-net { display: none; } .cf.dense .cf-col { min-width: 0; }
.an-period button { padding-left: 10px; padding-right: 10px; }
@media (max-width: 760px) { .an-period { overflow-x: auto; max-width: 100%; } .page-top { flex-wrap: wrap; gap: 10px; } }

/* ---------- Página do cartão ---------- */
.credit-card.clickable { cursor: pointer; transition: transform .15s; } .credit-card.clickable:hover { transform: translateY(-2px); }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 500; margin-bottom: 14px; } .back-link .i { width: 16px; height: 16px; }
.cd-top { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 20px; align-items: stretch; margin-bottom: 20px; }
.cd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-content: start; }
.cd-stats > div:not(.cd-actions) { background: var(--bg-elev); border: 1px solid var(--sep); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.cd-stats span { font-size: 12.5px; color: var(--text-2); } .cd-stats b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cd-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.inv-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; margin-top: 12px; }
.inv-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; }
.inv-bar i { width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: var(--text-3); opacity: .55; }
.inv-bar span { font-size: 11px; color: var(--text-3); }
.inv-bar.s-ok i { background: var(--pos); } .inv-bar.s-info i { background: var(--accent); } .inv-bar.s-warn i { background: var(--warn); } .inv-bar.s-bad i { background: var(--neg); }
.inv-bar:hover i, .inv-bar.cur i { opacity: 1; } .inv-bar.cur span { color: var(--text); font-weight: 600; }
.inv-leg { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.inv-leg span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: var(--text-3); }
.inv-leg .s-ok::before { background: var(--pos); } .inv-leg .s-info::before { background: var(--accent); } .inv-leg .s-warn::before { background: var(--warn); } .inv-leg .s-bad::before { background: var(--neg); }
.inv-list { background: var(--bg-elev); border: 1px solid var(--sep); border-radius: 16px; overflow: hidden; }
.inv + .inv { border-top: .5px solid var(--sep); }
.inv summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.inv summary::-webkit-details-marker { display: none; }
.inv summary:hover { background: var(--fill-2); }
.inv-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .inv-m b { font-weight: 600; } .inv-m span { font-size: 12.5px; color: var(--text-2); }
.inv-t { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 96px; text-align: right; }
.inv summary .chev { width: 16px; height: 16px; color: var(--text-3); transition: transform .15s; } .inv[open] summary .chev { transform: rotate(90deg); }
.inv.cur summary .inv-m b::after { content: 'atual'; margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--accent); }
.inv-body { padding: 0 16px 14px; }
.inv-meta { font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.inv-pay { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px; border-radius: 12px; background: color-mix(in srgb, var(--pos) 10%, transparent); }
.inv-pay .sq { color: var(--pos); } .inv-pay .grow { flex: 1; min-width: 0; } .inv-pay .title { font-weight: 500; } .inv-pay .sub { font-size: 12.5px; color: var(--text-2); }
.inv-att { display: flex; gap: 6px; }
.att-mini { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--sep); background: var(--bg-elev); display: grid; place-items: center; cursor: pointer; color: var(--text-2); }
.att-mini .i { width: 16px; height: 16px; }
@media (max-width: 760px) {
  .cd-top { grid-template-columns: 1fr; } .cd-stats b { font-size: 15px; } .cd-stats > div:not(.cd-actions) { padding: 10px; }
  .inv summary { padding: 12px; gap: 8px; } .inv-t { min-width: 0; } .inv-body { padding: 0 12px 12px; }
}

/* ---------- Importar extrato ---------- */
.bs-sel { display: flex; gap: 6px; flex-shrink: 0; }
.bs-sel select { width: 150px; padding: 7px 26px 7px 10px; font-size: 13px; }
.bs-sel .bs-type { width: 130px; }
@media (max-width: 760px) { .bs-row { flex-wrap: wrap; } .bs-sel { order: 4; width: calc(100% - 30px); margin-left: 30px; } .bs-sel select { flex: 1; width: auto; } }

/* opções avançadas recolhidas em formulários */
.more-opts { margin: 4px 0 12px; }
.more-opts summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 500; padding: 6px 0; list-style: none; }
.more-opts summary::-webkit-details-marker { display: none; }
.more-opts summary::before { content: '+'; display: inline-block; width: 16px; }
.more-opts[open] summary::before { content: '–'; }

/* ---------- Planos ---------- */
.pro-lock { display: inline-flex; margin-left: 4px; opacity: .55; vertical-align: -1px; } .pro-lock .i { width: 12px; height: 12px; }
.side-pro { color: var(--accent) !important; font-weight: 600; margin-top: auto; }
.side-pro + .side-foot { margin-top: 0 !important; }
.trial-bar { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 18px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); font-size: 14px; font-weight: 500; }
.trial-bar > .i:first-child { color: var(--accent); } .trial-bar span { flex: 1; } .trial-bar .chev { width: 16px; height: 16px; color: var(--text-3); }
.paywall { display: flex; flex-direction: column; gap: 12px; }
.pw-hero { display: flex; align-items: center; gap: 14px; } .pw-hero img { border-radius: 14px; }
.pw-hero h3 { margin: 2px 0 0; font-size: 21px; letter-spacing: -.02em; }
.pw-kicker { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--accent); } .pw-kicker .i { width: 14px; height: 14px; }
.pw-perks { list-style: none; padding: 0; margin: 2px 0; display: grid; gap: 8px; }
.pw-perks li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; } .pw-perks .i { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.plan-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 6px; }
.plan-opt { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--sep); cursor: pointer; background: var(--bg-elev); }
.plan-opt input { position: absolute; opacity: 0; pointer-events: none; }
.plan-opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.po-top { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.po-badge { font-size: 11.5px; font-weight: 700; color: #fff; background: var(--accent); padding: 2px 7px; border-radius: 99px; }
.po-price { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; } .po-price small { font-size: 13px; font-weight: 500; color: var(--text-2); margin-left: 2px; }
.po-sub { font-size: 12.5px; color: var(--text-2); }
.plans-page { max-width: 720px; }
.plans-hero { margin-bottom: 18px; } .plans-now { font-size: 26px; font-weight: 600; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.plans-now .i { width: 24px; height: 24px; color: var(--accent); }
.plans-buy { margin-bottom: 18px; }
.plans-table { padding: 6px 16px; overflow-x: auto; } .plans-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.plans-table th { text-align: left; font-size: 13px; color: var(--text-2); font-weight: 600; padding: 10px 8px; } .plans-table th .i { width: 14px; height: 14px; color: var(--accent); vertical-align: -2px; }
.plans-table td { padding: 10px 8px; border-top: .5px solid var(--sep); } .plans-table td:last-child { font-weight: 600; }
@media (max-width: 760px) { .plan-opts { grid-template-columns: 1fr 1fr; } .po-price { font-size: 19px; } .plans-now { font-size: 22px; } }
.plan-opts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.plan-opt { min-width: 0; }
.plans-page, .plans-buy, .plans-table { min-width: 0; max-width: 100%; box-sizing: border-box; }
.plans-table table { table-layout: fixed; } .plans-table th:first-child, .plans-table td:first-child { width: 42%; }
.plans-table td, .plans-table th { overflow-wrap: anywhere; }
@media (max-width: 760px) { .plans-table { padding: 4px 10px; } .plans-table td, .plans-table th { padding: 9px 5px; font-size: 13px; } .plan-opt { padding: 12px; } }
.po-top { flex-wrap: wrap; gap: 4px 6px; } .po-price small { white-space: nowrap; }

/* ---------- Bloqueio pós-downgrade e indicação ---------- */
.lock-note { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-align: left; }
.lock-note .i { width: 14px; height: 14px; color: var(--warn); }
.credit-card.is-locked { filter: grayscale(.85); opacity: .7; }
.lock-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--warn); margin-left: 6px; } .lock-tag .i { width: 12px; height: 12px; }
.refer { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.refer-h { display: flex; gap: 12px; align-items: flex-start; } .refer-h > .i { width: 26px; height: 26px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.refer-h div { display: flex; flex-direction: column; gap: 2px; } .refer-h span { font-size: 14px; color: var(--text-2); line-height: 1.45; }
.refer-link { display: flex; gap: 8px; } .refer-link input { flex: 1; min-width: 0; font-size: 13px; }
