:root {
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #F1F3F7;
  --surface-3: #E9EDF3;
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #64748B;
  --line: #E4E8EF;
  --line-strong: #D3D9E3;
  --brand: #2155E8;
  --brand-2: #4C7BF5;
  --brand-soft: #EAF0FE;
  --on-brand: #FFFFFF;
  --pos: #0E9F6E;
  --pos-soft: #E3F6EE;
  --warn: #B45309;
  --warn-soft: #FEF3E2;
  --neg: #D92D20;
  --neg-soft: #FDECEA;
  --essencial: #2155E8;
  --estilo: #F97316;
  --futuro: #0E9F6E;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .28);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --sidebar: 248px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0B1120;
  --surface: #111A2E;
  --surface-2: #16213A;
  --surface-3: #1D2A47;
  --ink: #E8EDF7;
  --ink-2: #C3CCDD;
  --muted: #8B98B0;
  --line: #1F2B45;
  --line-strong: #2A3858;
  --brand: #5B8CFF;
  --brand-2: #7FA5FF;
  --brand-soft: #1A2A55;
  --on-brand: #0B1120;
  --pos: #34D399;
  --pos-soft: #0F2E26;
  --warn: #FBBF24;
  --warn-soft: #33270C;
  --neg: #F87171;
  --neg-soft: #3A1518;
  --essencial: #5B8CFF;
  --estilo: #FB923C;
  --futuro: #34D399;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0B1120; --surface: #111A2E; --surface-2: #16213A; --surface-3: #1D2A47;
    --ink: #E8EDF7; --ink-2: #C3CCDD; --muted: #8B98B0; --line: #1F2B45; --line-strong: #2A3858;
    --brand: #5B8CFF; --brand-2: #7FA5FF; --brand-soft: #1A2A55; --on-brand: #0B1120;
    --pos: #34D399; --pos-soft: #0F2E26; --warn: #FBBF24; --warn-soft: #33270C; --neg: #F87171; --neg-soft: #3A1518;
    --essencial: #5B8CFF; --estilo: #FB923C; --futuro: #34D399;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: 'tnum' 1, 'cv11' 1;
  -webkit-font-smoothing: antialiased;
  transition: background .3s var(--ease), color .3s var(--ease);
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-soft); }
.muted { color: var(--muted); }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
body.private .money, body.private .blur-private { filter: blur(7px); transition: filter .2s; }
body.private .money:hover { filter: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* compass */
.compass { width: 32px; height: 32px; overflow: visible; }
.compass-ring { fill: none; stroke: var(--brand); stroke-width: 5; stroke-dasharray: 1; stroke-dashoffset: 0; opacity: .9; }
.compass-ring--inner { stroke-width: 2; opacity: .25; }
.compass-ticks line { stroke: var(--brand); stroke-width: 5; stroke-linecap: round; opacity: .55; }
.compass-north { fill: var(--brand); }
.compass-south { fill: var(--line-strong); }
.compass-hub { fill: var(--surface); stroke: var(--brand); stroke-width: 3; }
.compass-needle { transform-origin: 60px 60px; transition: transform .8s var(--spring); }
.brand:hover .compass-needle { transform: rotate(18deg); }

/* loader */
.loader { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); transition: opacity .45s var(--ease), visibility .45s; }
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__inner { display: grid; justify-items: center; gap: 14px; }
.loader .compass { width: 84px; height: 84px; }
.loader .compass-ring { stroke-dashoffset: 1; animation: draw 1s var(--ease) forwards; }
.loader .compass-ring--inner { animation-delay: .15s; }
.loader .compass-needle { animation: seek 1.6s var(--ease) both; }
.loader strong { font-size: 20px; letter-spacing: -.02em; opacity: 0; animation: rise .5s .45s var(--ease) forwards; }
.loader__line { width: 120px; height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.loader__line i { display: block; height: 100%; width: 40%; border-radius: inherit; background: var(--brand); animation: slide 1.1s var(--ease) infinite; }
@keyframes seek { 0% { transform: rotate(-140deg); } 45% { transform: rotate(40deg); } 70% { transform: rotate(-12deg); } 100% { transform: rotate(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translate3d(0, 0, 0) rotateX(var(--rx, 8deg)) rotateY(var(--ry, -14deg)); } 50% { transform: translate3d(0, -12px, 0) rotateX(var(--rx, 8deg)) rotateY(var(--ry, -14deg)); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 40%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }

/* shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--surface); z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.nav { display: grid; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 16px 12px 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 11px; color: var(--ink-2); font-weight: 600; font-size: 14.5px; transition: background .18s, color .18s; position: relative; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.is-active { background: var(--brand-soft); color: var(--brand); }
.nav-link.is-active svg { animation: pop .4s var(--spring); }
.nav-link .badge { margin-left: auto; }
.sidebar__foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); }
.topbar__menu { display: none; }
.topbar__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.month-switch { display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; box-shadow: var(--shadow-sm); }
.month-switch__label { min-width: 132px; padding: 6px 10px; border-radius: 9px; font-weight: 700; font-size: 14px; text-transform: capitalize; }
.month-switch__label:hover { background: var(--surface-2); }
.month-switch.is-hidden { visibility: hidden; }
.quick-trigger { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--muted); text-align: left; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.quick-trigger:hover { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.quick-trigger svg { color: var(--brand); }
.quick-trigger span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.quick-trigger em { font-style: normal; font-weight: 500; opacity: .7; }
kbd { font: 600 11px var(--font); padding: 3px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; font-size: 14px; margin-left: 4px; transition: transform .2s var(--spring); }
.avatar:hover { transform: scale(1.06); }

.view { padding: 8px 28px 64px; max-width: 1380px; width: 100%; margin: 0 auto; outline: none; }
.view.is-entering > * { animation: rise .45s var(--ease) both; }
.view.is-entering > *:nth-child(2) { animation-delay: .04s; }
.view.is-entering > *:nth-child(3) { animation-delay: .08s; }
.view.is-entering > *:nth-child(4) { animation-delay: .12s; }
.view.is-entering > *:nth-child(5) { animation-delay: .16s; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 10px 0 22px; }
.page-head h1 { font-size: 28px; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* grid */
.grid { display: grid; gap: 18px; }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.stack { display: grid; gap: 18px; align-content: start; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); position: relative; min-width: 0; }
.card--flush { padding: 0; overflow: hidden; }
.card--soft { background: var(--surface-2); box-shadow: none; }
.card--tilt { transform-style: preserve-3d; transition: transform .35s var(--ease), box-shadow .35s; will-change: transform; }
.card--tilt:hover { box-shadow: var(--shadow-lg); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card__title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card__title svg { color: var(--muted); }
.card__sub { font-size: 13px; color: var(--muted); }
.link { color: var(--brand); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }
.link svg { width: 15px; height: 15px; }

/* kpi */
.kpi { display: grid; gap: 6px; }
.kpi__label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi__icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi__icon svg { width: 16px; height: 16px; }
.kpi__value { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.kpi__foot { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi--hero { background: linear-gradient(140deg, var(--brand) 0%, #1A3FB8 100%); color: #fff; border: 0; overflow: hidden; }
:root[data-theme="dark"] .kpi--hero { background: linear-gradient(140deg, #2A57D6 0%, #16307F 100%); }
.kpi--hero .kpi__label, .kpi--hero .kpi__foot { color: rgba(255, 255, 255, .78); }
.kpi--hero .kpi__icon { background: rgba(255, 255, 255, .16); color: #fff; }
.kpi--hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; border: 28px solid rgba(255, 255, 255, .07); }
.kpi--hero .bar { background: rgba(255, 255, 255, .2); }
.kpi--hero .bar i { background: #fff; }

/* badges & chips */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.badge--pos { background: var(--pos-soft); color: var(--pos); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--neg { background: var(--neg-soft); color: var(--neg); }
.badge--brand { background: var(--brand-soft); color: var(--brand); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); transition: all .18s var(--ease); white-space: nowrap; }
.chip svg { width: 14px; height: 14px; }
.chip:hover { border-color: var(--line-strong); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip--dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips--scroll::-webkit-scrollbar { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; font-weight: 700; font-size: 14px; border: 1px solid transparent; transition: transform .15s var(--ease), background .2s, box-shadow .2s, border-color .2s; white-space: nowrap; user-select: none; }
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 6px 18px -8px var(--brand); }
.btn--primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn--soft { background: var(--brand-soft); color: var(--brand); }
.btn--soft:hover { background: color-mix(in srgb, var(--brand-soft) 80%, var(--brand)); }
.btn--danger { background: var(--neg-soft); color: var(--neg); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn--lg { height: 50px; font-size: 15px; border-radius: 14px; }
.btn--block { width: 100%; }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading svg { animation: spin .8s linear infinite; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 11px; color: var(--ink-2); transition: background .18s, color .18s, transform .15s; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { transform: scale(.92); }
.icon-btn--sm { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn--sm svg { width: 16px; height: 16px; }

/* forms */
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field > span { display: flex; justify-content: space-between; gap: 8px; }
.field input, .field select, .field textarea, .input {
  width: 100%; height: 44px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 15px; font-weight: 500; color: var(--ink); transition: border-color .2s, box-shadow .2s; outline: none;
}
.field textarea { height: auto; min-height: 84px; padding: 11px 13px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field.has-error input, .field.has-error select { border-color: var(--neg); }
.field .error { color: var(--neg); font-weight: 600; font-size: 12px; }
.field-affix { position: relative; }
.field-affix .icon-btn { position: absolute; right: 4px; top: 3px; }
.field-prefix { position: relative; }
.field-prefix > b { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.field-prefix input { padding-left: 40px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-error { padding: 10px 12px; border-radius: 10px; background: var(--neg-soft); color: var(--neg); font-weight: 600; font-size: 13.5px; }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.segmented button { flex: 1; height: 34px; padding: 0 12px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .2s, color .2s; white-space: nowrap; }
.segmented button svg { width: 15px; height: 15px; }
.segmented button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .25s var(--spring); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); transition: transform .15s; }
.swatches button.is-active { box-shadow: 0 0 0 2px var(--ink); transform: scale(1.1); }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; max-height: 150px; overflow: auto; padding: 2px; }
.icon-pick button { height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink-2); }
.icon-pick button.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* progress */
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--brand)); width: 0; transition: width 1s var(--ease); }
.bar--thin { height: 5px; }
.bar--over i { background: var(--neg); }
.bar-stack { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.bar-stack i { height: 100%; background: var(--c); width: 0; transition: width 1s var(--ease); }
.ring { position: relative; display: grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: var(--sw, 8); }
.ring .ring__track { stroke: var(--surface-3); }
.ring .ring__value { stroke: var(--c, var(--brand)); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.2s var(--ease); }
.ring__label { position: absolute; text-align: center; line-height: 1.1; }
.ring__label strong { display: block; font-size: var(--fs, 22px); font-weight: 800; letter-spacing: -.03em; }
.ring__label small { font-size: 11px; color: var(--muted); font-weight: 600; }

/* lists */
.list { display: grid; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.item:last-child { border-bottom: 0; }
.item--click { cursor: pointer; border-radius: 12px; padding-left: 8px; padding-right: 8px; transition: background .15s; }
.item--click:hover { background: var(--surface-2); }
.item__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c, var(--muted)) 13%, transparent); color: var(--c, var(--muted)); }
.item__icon svg { width: 19px; height: 19px; }
.item__body { flex: 1; min-width: 0; }
.item__title { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.item__meta .dot::before { content: '·'; margin-right: 6px; }
.item__end { text-align: right; display: grid; gap: 2px; justify-items: end; }
.item__amount { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.item__amount--neg { color: var(--ink); }
.item__amount--pos { color: var(--pos); }
.item.is-paid .item__title, .item.is-done .item__title { text-decoration: line-through; color: var(--muted); }
.item.is-paid .item__amount { color: var(--muted); }
.item.is-removing { animation: remove .35s var(--ease) forwards; }
@keyframes remove { to { opacity: 0; transform: translateX(24px); height: 0; padding-top: 0; padding-bottom: 0; margin: 0; } }
.day-head { display: flex; justify-content: space-between; padding: 16px 4px 4px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

.tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: none; transition: all .25s var(--spring); color: transparent; }
.tick svg { width: 14px; height: 14px; stroke-width: 3; }
.tick:hover { border-color: var(--pos); }
.tick.is-on { background: var(--pos); border-color: var(--pos); color: #fff; transform: scale(1.05); }
.tick.is-on svg path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: dash .4s .05s var(--ease) forwards; }
@keyframes dash { to { stroke-dashoffset: 0; } }

/* insights */
.insight { display: flex; gap: 12px; padding: 13px; border-radius: 14px; background: var(--surface-2); align-items: flex-start; transition: transform .2s var(--ease), background .2s; }
.insight:hover { transform: translateX(3px); }
.insight__icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.insight__icon svg { width: 17px; height: 17px; }
.insight--good .insight__icon { color: var(--pos); }
.insight--warn .insight__icon { color: var(--warn); }
.insight--danger { background: var(--neg-soft); }
.insight--danger .insight__icon { color: var(--neg); }
.insight strong { display: block; font-size: 14px; font-weight: 700; }
.insight p { font-size: 13px; color: var(--muted); margin-top: 1px; }
.insight--danger p { color: var(--ink-2); }

.tip { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.tip__icon { color: var(--brand); margin-top: 1px; }
.tip--good .tip__icon { color: var(--pos); }
.tip--warn .tip__icon { color: var(--warn); }
.tip--danger { border-color: color-mix(in srgb, var(--neg) 35%, transparent); background: var(--neg-soft); }
.tip--danger .tip__icon { color: var(--neg); }
.tip p { font-size: 14px; font-weight: 500; color: var(--ink-2); }

/* allocation */
.alloc { display: grid; gap: 4px; }
.alloc__row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; }
.alloc__name { font-weight: 700; font-size: 14px; }
.alloc__note { font-size: 12.5px; color: var(--muted); }
.alloc__amount { font-weight: 800; font-size: 16px; }
.groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.group { padding: 16px; border-radius: 16px; background: var(--surface-2); display: grid; gap: 8px; border-top: 3px solid var(--c); }
.group__name { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--c); }
.group__value { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.group__meta { font-size: 12.5px; color: var(--muted); }

/* goal cards */
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.goal { display: grid; gap: 16px; cursor: pointer; }
.goal__top { display: flex; gap: 14px; align-items: center; }
.goal__name { font-weight: 800; font-size: 16px; }
.goal__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.goal__stat { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.goal__stat small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.goal__stat b { font-size: 15px; }
.goal.is-done { opacity: .75; }

/* cards (credit) */
.cc { position: relative; aspect-ratio: 1.6; border-radius: 20px; padding: 20px; color: #fff; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #000)); box-shadow: var(--shadow-lg); transform-style: preserve-3d; transition: transform .4s var(--ease); max-width: 400px; }
.cc::before { content: ''; position: absolute; width: 260px; height: 260px; right: -80px; top: -110px; border-radius: 50%; background: rgba(255, 255, 255, .09); }
.cc::after { content: ''; position: absolute; width: 200px; height: 200px; left: -60px; bottom: -120px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.cc__name { font-weight: 800; font-size: 18px; letter-spacing: -.02em; position: relative; z-index: 1; }
.cc__chip { width: 38px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, #F4D58D, #C9A44C); opacity: .9; }
.cc__value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; position: relative; z-index: 1; }
.cc__row { display: flex; justify-content: space-between; align-items: flex-end; position: relative; z-index: 1; font-size: 12.5px; opacity: .9; gap: 10px; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal__dow { font-size: 11px; font-weight: 800; color: var(--muted); text-align: center; padding: 4px 0; text-transform: uppercase; }
.cal__day { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; font-size: 13px; font-weight: 700; position: relative; color: var(--ink-2); }
.cal__day.is-out { opacity: .3; }
.cal__day.is-today { background: var(--brand); color: var(--on-brand); }
.cal__day.has-item::after { content: ''; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--brand)); }
.cal__day.is-today.has-item::after { background: #fff; }

/* empty */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 34px 16px; color: var(--muted); }
.empty svg.art { width: 120px; height: 90px; }
.empty svg.art * { fill: none; stroke: var(--line-strong); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw-long 1.6s var(--ease) forwards; }
.empty svg.art .accent { stroke: var(--brand); }
@keyframes draw-long { to { stroke-dashoffset: 0; } }
.empty strong { color: var(--ink); font-size: 15px; }
.empty p { font-size: 13.5px; max-width: 320px; }

/* skeleton */
.skeleton { border-radius: var(--radius); min-height: 120px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }

/* modal & sheet */
.backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .42); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .2s ease; }
.backdrop.is-closing { animation: fade .18s ease reverse forwards; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); animation: modal-in .35s var(--spring); }
.modal--wide { max-width: 760px; }
.backdrop.is-closing .modal { animation: modal-out .18s ease forwards; }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 6px; }
.modal__head h2 { font-size: 19px; font-weight: 800; }
.modal__body { padding: 14px 22px 8px; display: grid; gap: 14px; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px 22px; flex-wrap: wrap; }
.modal__foot .spacer { margin-right: auto; }

/* quick add */
.quick { max-width: 640px; align-self: start; margin-top: 10vh; }
.quick__input { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.quick__input svg { color: var(--brand); width: 22px; height: 22px; }
.quick__input input { flex: 1; border: 0; outline: 0; background: none; font-size: 18px; font-weight: 600; color: var(--ink); min-width: 0; }
.quick__input input::placeholder { color: var(--muted); font-weight: 500; }
.quick__preview { padding: 16px 20px; display: grid; gap: 14px; min-height: 96px; }
.quick__intent { display: flex; align-items: center; gap: 10px; }
.quick__intent .item__icon { width: 44px; height: 44px; }
.quick__summary strong { display: block; font-size: 16px; font-weight: 800; }
.quick__summary span { font-size: 13px; color: var(--muted); }
.quick__amount { margin-left: auto; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.quick__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.quick__chips .chip { cursor: pointer; }
.quick__chips .chip--learned { border-color: color-mix(in srgb, var(--brand) 40%, transparent); color: var(--brand); background: var(--brand-soft); }
.quick__examples { display: grid; gap: 4px; }
.quick__examples button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 10px; border-radius: 10px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.quick__examples button:hover, .quick__examples button.is-active { background: var(--surface-2); }
.quick__examples small { margin-left: auto; color: var(--muted); font-weight: 600; }
.quick__foot { display: flex; align-items: center; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.quick__foot .btn { margin-left: auto; }
.quick__done { display: grid; justify-items: center; gap: 8px; padding: 30px; text-align: center; }
.quick__done .check-burst { width: 64px; height: 64px; border-radius: 50%; background: var(--pos); color: #fff; display: grid; place-items: center; animation: pop .5s var(--spring); }
.quick__done .check-burst svg { width: 32px; height: 32px; stroke-width: 3; }
.mini-pick { position: absolute; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 2px; max-height: 260px; overflow: auto; min-width: 210px; animation: modal-in .2s var(--ease); }
.mini-pick button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-size: 14px; font-weight: 600; text-align: left; }
.mini-pick button:hover { background: var(--surface-2); }
.mini-pick button svg { width: 16px; height: 16px; color: var(--c, var(--muted)); }

/* toast */
.toasts { position: fixed; z-index: 80; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 11px 12px 11px 16px; border-radius: 14px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; animation: toast-in .4s var(--spring); min-width: 260px; max-width: calc(100vw - 32px); }
.toast svg { width: 18px; height: 18px; }
.toast--error svg { color: #FCA5A5; }
.toast--ok svg { color: #6EE7B7; }
.toast button { margin-left: auto; color: #93B4FF; font-weight: 800; padding: 4px 8px; border-radius: 8px; }
.toast.is-leaving { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

.fab { display: none; }
.tabbar { display: none; }

/* table */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }

.chart-box { position: relative; height: 240px; }
.chart-box--sm { height: 180px; }
.legend { display: grid; gap: 8px; }
.legend__row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.legend__row i { width: 10px; height: 10px; border-radius: 4px; background: var(--c); flex: none; }
.legend__row span { flex: 1; color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend__row b { font-weight: 800; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.score-parts { display: grid; gap: 10px; }
.score-parts .row span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.notice { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--warn-soft); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.notice svg { color: var(--warn); }
.recovery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font: 700 15px ui-monospace, monospace; }
.recovery span { padding: 10px; border-radius: 10px; background: var(--surface-2); text-align: center; }
.qr { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 16px; width: fit-content; margin: 0 auto; }
.qr img { width: 180px; height: 180px; image-rendering: pixelated; }

/* auth */
.auth { min-height: 100vh; }
.auth-shell { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-shell--single { grid-template-columns: 1fr; }
.auth-art { position: relative; overflow: hidden; background: linear-gradient(160deg, #0F1E4D 0%, #1A3FB8 55%, #2155E8 100%); color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; perspective: 1200px; }
.auth-art__glow { position: absolute; width: 600px; height: 600px; border-radius: 50%; right: -200px; bottom: -260px; background: radial-gradient(circle, rgba(124, 167, 255, .45), transparent 65%); }
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; letter-spacing: -.03em; position: relative; }
.auth-brand .compass-ring, .auth-brand .compass-ticks line { stroke: #fff; }
.auth-brand .compass-north { fill: #fff; }
.auth-brand .compass-south { fill: rgba(255, 255, 255, .35); }
.auth-brand .compass-hub { fill: #1A3FB8; stroke: #fff; }
.auth-brand .compass { width: 38px; height: 38px; }
.auth-brand .compass-needle { animation: seek 2.2s var(--ease) both; }
.float-scene { position: relative; height: 340px; transform-style: preserve-3d; }
.float-card { position: absolute; padding: 18px 20px; border-radius: 20px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .5); display: grid; gap: 8px; min-width: 220px; animation: float 7s ease-in-out infinite; }
.float-card small { font-size: 12.5px; opacity: .8; font-weight: 600; }
.float-card strong { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.float-card--a { left: 4%; top: 12%; }
.float-card--b { right: 8%; top: 0; --rx: 4deg; --ry: 16deg; animation-delay: -2s; grid-template-columns: auto 1fr; align-items: center; }
.float-card--b small { grid-column: 1 / -1; }
.float-card--c { left: 22%; bottom: 0; --rx: -6deg; --ry: -8deg; animation-delay: -4s; }
.float-bar { height: 6px; border-radius: 9px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.float-bar i { display: block; height: 100%; background: #7CF0C5; border-radius: inherit; }
.float-ring { width: 48px; height: 48px; transform: rotate(-90deg); }
.float-ring circle { fill: none; stroke: rgba(255, 255, 255, .2); stroke-width: 5; }
.float-ring .float-ring__value { stroke: #fff; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 28; }
.auth-art__quote { font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.4; opacity: .92; position: relative; }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-form { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.auth-form h1 { font-size: 28px; font-weight: 800; }
.auth-form__brand .compass { width: 48px; height: 48px; }
.auth-form__brand .compass-ring { stroke-dashoffset: 1; animation: draw 1s var(--ease) forwards; }
.auth-form__brand .compass-needle { animation: seek 1.8s var(--ease) both; }
.auth-form .step { display: grid; gap: 14px; animation: rise .35s var(--ease); }
.auth-foot { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.auth-foot svg { width: 14px; height: 14px; }
.shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* responsive */
@media (max-width: 1180px) {
  .span-3 { grid-column: span 6; }
  .span-4, .span-5 { grid-column: span 6; }
  .span-7, .span-8 { grid-column: span 12; }
  .span-6 { grid-column: span 12; }
}

@media (max-width: 1023px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 272px; transform: translateX(-102%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .topbar__menu { display: inline-grid; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}

@media (max-width: 767px) {
  body { font-size: 14.5px; }
  .topbar { padding: 10px 16px; gap: 8px; flex-wrap: wrap; }
  .quick-trigger { display: none; }
  .month-switch { order: 3; width: 100%; justify-content: space-between; }
  .month-switch__label { flex: 1; }
  .view { padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); }
  .page-head h1 { font-size: 23px; }
  .grid-12 { gap: 14px; }
  .span-3, .span-4, .span-5, .span-6 { grid-column: span 12; }
  .grid-12 > .kpi-card { grid-column: span 6; }
  .card { padding: 16px; border-radius: 16px; }
  .kpi__value { font-size: 21px; }
  .groups { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .backdrop { padding: 0; place-items: end stretch; }
  .modal { max-width: none; border-radius: 22px 22px 0 0; max-height: 92vh; animation: sheet-in .35s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
  .backdrop.is-closing .modal { animation: sheet-out .2s ease forwards; }
  @keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
  @keyframes sheet-out { to { transform: translateY(100%); } }
  .quick { margin-top: 0; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 11px; font-weight: 700; color: var(--muted); border-radius: 12px; }
  .tabbar .is-active { color: var(--brand); }
  .tabbar svg { width: 21px; height: 21px; }
  .tabbar .tab-gap { pointer-events: none; }
  .fab { display: grid; place-items: center; position: fixed; z-index: 45; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: 56px; height: 56px; border-radius: 18px; background: var(--brand); color: var(--on-brand); box-shadow: 0 12px 28px -10px var(--brand); transition: transform .2s var(--spring); }
  .fab:active { transform: translateX(-50%) scale(.92); }
  .fab svg { width: 26px; height: 26px; stroke-width: 2.4; }
  .toasts { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .cc { max-width: none; }
  .hide-mobile { display: none !important; }
}

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