/* =========================================================
   Finanças da Kau — dark glow rosa
   ========================================================= */
:root {
  --bg: #07050a;
  --bg-2: #0e0b13;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-solid: #131019;
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --hairline: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
  --text: #f7eff5;
  --text-2: #cfc3cc;
  --muted: #877b86;
  --pink: #ff4fa8;
  --pink-2: #ff8cc6;
  --lilac: #f3c6ff;
  --violet: #9b5cff;
  --green: #5ff0b5;
  --red: #ff6b8b;
  --amber: #ffcc66;
  --grad: linear-gradient(135deg, #ff4fa8 0%, #c04dff 60%, #8a4dff 100%);
  --glow: 0 10px 40px -8px rgba(255, 79, 168, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  --shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.9);
  --hero-glow:
    radial-gradient(60% 55% at 50% 0%, rgba(255, 140, 210, 0.55) 0%, transparent 70%),
    radial-gradient(90% 75% at 50% 0%, rgba(214, 70, 190, 0.75) 0%, rgba(120, 40, 200, 0.45) 45%, transparent 80%);
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --nav-h: 68px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #fbf4f8;
  --bg-2: #f4e9f0;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-solid: #ffffff;
  --surface-2: rgba(120, 20, 80, 0.05);
  --surface-3: rgba(120, 20, 80, 0.1);
  --border: rgba(120, 20, 80, 0.08);
  --border-strong: rgba(120, 20, 80, 0.16);
  --hairline: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.4));
  --text: #22101c;
  --text-2: #57414f;
  --muted: #98828f;
  --pink: #e8268a;
  --pink-2: #d6247f;
  --lilac: #a8329a;
  --green: #0d9c69;
  --red: #dc3360;
  --amber: #b97900;
  --shadow: 0 20px 40px -28px rgba(120, 20, 80, 0.35);
  --hero-glow:
    radial-gradient(60% 55% at 50% 0%, rgba(255, 170, 220, 0.8) 0%, transparent 70%),
    radial-gradient(90% 75% at 50% 0%, rgba(255, 120, 200, 0.55) 0%, rgba(180, 120, 255, 0.3) 45%, transparent 80%);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--pink-2); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; font-weight: 600; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--pink-2); outline-offset: 2px; border-radius: 8px; }

/* ---------- fundo: granulado sutil ---------- */
.bg-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--bg); }
.bg-fx::after {
  content: ''; position: absolute; inset: 0; opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- boot ---------- */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-logo span { display: block; width: 56px; height: 56px; border-radius: 50%; background: var(--grad); box-shadow: var(--glow); animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 50% { transform: scale(0.86); opacity: 0.7; } }

/* ---------- layout ---------- */
.shell { min-height: 100dvh; }
.main {
  position: relative; isolation: isolate; max-width: 1120px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 40px);
}
.main::before {
  content: ''; position: absolute; z-index: -1; left: 50%; top: 0; transform: translateX(-50%);
  width: min(1100px, 160vw); height: 560px; background: var(--hero-glow); pointer-events: none;
  mask-image: linear-gradient(#000 40%, transparent);
}
.main.calm::before { height: 300px; opacity: 0.55; }

/* ---------- topo ---------- */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center; text-decoration: none;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 18px; position: relative;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 8px 24px -8px rgba(255, 79, 168, 0.8);
}
.hello { flex: 1; min-width: 0; line-height: 1.25; }
.hello small { display: block; color: color-mix(in srgb, var(--text) 65%, transparent); font-size: 13px; }
.hello h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-actions {
  display: flex; gap: 2px; padding: 4px; border-radius: 999px; flex: none;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.pill-actions a, .pill-actions button {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--text); border: 0; background: none;
}
.pill-actions a:hover, .pill-actions button:hover { background: rgba(255, 255, 255, 0.1); }
.pill-actions svg { width: 19px; height: 19px; }

/* seletor de mês em pílula */
.month-pill {
  display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 79, 168, 0.55), rgba(138, 77, 255, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 10px 30px -12px rgba(200, 60, 255, 0.8);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff;
}
.month-pill button { border: 0; background: none; color: #fff; height: 34px; border-radius: 999px; display: grid; place-items: center; }
.month-pill button[data-month='-1'], .month-pill button[data-month='1'] { width: 34px; }
.month-pill button:hover { background: rgba(255, 255, 255, 0.14); }
.month-pill svg { width: 17px; height: 17px; }
.month-pill .label { padding: 0 10px; font-weight: 600; font-size: 14px; text-transform: capitalize; white-space: nowrap; min-width: 120px; }
.month-bar { display: flex; justify-content: center; margin: -4px 0 18px; }
.month-bar[hidden] { display: none; }

.page-head { text-align: center; margin: 4px 0 22px; }
.page-head h2 { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }

/* ---------- saldo ---------- */
.balance { text-align: center; padding: 10px 0 6px; }
.balance .label { font-size: 13px; color: color-mix(in srgb, var(--text) 70%, transparent); }
.balance .amount { font-size: clamp(42px, 12vw, 60px); font-weight: 500; letter-spacing: -0.045em; line-height: 1.05; margin: 6px 0 16px; font-variant-numeric: tabular-nums; }
.balance .amount .cents { color: color-mix(in srgb, var(--text) 45%, transparent); }
.io { display: flex; justify-content: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.io span {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 13px; color: var(--text-2);
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border);
}
.io b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.io i { width: 8px; height: 8px; border-radius: 50%; }
.io i.in { background: var(--green); box-shadow: 0 0 10px var(--green); }
.io i.out { background: var(--pink); box-shadow: 0 0 10px var(--pink); }

/* ---------- atalhos redondos ---------- */
.qa { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 26px auto 26px; max-width: 460px; }
.qa > * {
  display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; background: none; text-decoration: none;
  color: var(--text); font-size: 13px; font-weight: 500;
}
.qa .ring {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02) 70%), var(--bg-2);
  border: 1px solid var(--border-strong); transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.qa .ring svg { width: 22px; height: 22px; }
.qa > *:hover .ring { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(255, 79, 168, 0.7); border-color: rgba(255, 140, 198, 0.4); }
.qa > *:active .ring { transform: scale(0.95); }

/* ---------- seções ---------- */
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 8px 2px 12px; }
.section-title h3 { font-size: 20px; font-weight: 600; }
.see-all { color: var(--pink-2); font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.see-all svg { width: 14px; height: 14px; }

/* ---------- nav flutuante ---------- */
.nav {
  position: fixed; z-index: 30; left: 14px; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom));
  height: var(--nav-h); padding: 0 8px; border-radius: 999px;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: rgba(22, 17, 28, 0.78); border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  max-width: 520px; margin: 0 auto;
}
:root[data-theme='light'] .nav { background: rgba(255, 255, 255, 0.85); border-color: var(--border-strong); box-shadow: 0 20px 40px -20px rgba(120, 20, 80, 0.4); }
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none;
  color: var(--muted); font-size: 11px; font-weight: 500; padding: 6px 0; position: relative; transition: color 0.18s var(--ease);
}
.nav a svg { width: 22px; height: 22px; }
.nav a.active { color: var(--text); }
.nav a.active svg { color: var(--pink); filter: drop-shadow(0 0 8px rgba(255, 79, 168, 0.7)); }
.nav .fab-slot { display: grid; place-items: center; }
.fab {
  width: 52px; height: 52px; border: 0; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center;
  box-shadow: var(--glow); transition: transform 0.18s var(--ease);
}
.fab:active { transform: scale(0.92); }
.fab svg { width: 24px; height: 24px; }
.fab .fab-text { display: none; }
.nav .brand { display: none; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 252px 1fr; }
  .nav {
    position: sticky; top: 0; left: auto; right: auto; bottom: auto; height: 100dvh; max-width: none; margin: 0;
    border-radius: 0; border: 0; border-right: 1px solid var(--border); background: var(--bg-2); box-shadow: none;
    grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: start; gap: 4px; padding: 26px 16px;
  }
  .nav .brand { order: -2; display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; font-weight: 700; font-size: 17px; }
  .brand i { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); box-shadow: var(--glow); display: grid; place-items: center; color: #fff; }
  .brand i svg { width: 18px; height: 18px; }
  .nav a { flex-direction: row; gap: 12px; font-size: 14px; padding: 12px 16px; border-radius: 999px; }
  .nav a:hover { background: var(--surface-2); color: var(--text); }
  .nav a.active { background: var(--surface-2); }
  .nav a svg { width: 20px; height: 20px; }
  .nav .fab-slot { order: -1; margin-bottom: 16px; }
  .fab { width: 100%; height: 48px; border-radius: 999px; display: flex; gap: 8px; justify-content: center; font-weight: 600; }
  .fab svg { width: 20px; height: 20px; }
  .fab .fab-text { display: inline; }
  .main { padding: 26px 36px 56px; }
}

/* ---------- grid ---------- */
.grid { display: grid; gap: 14px; }
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1.3fr 1fr; align-items: start; }
  .grid-2-eq { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* ---------- cards de vidro ---------- */
.card {
  position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); min-width: 0; isolation: isolate;
}
:root[data-theme='light'] .card { background: var(--surface-solid); }
.card::before, .stat::before, .panel::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: -1;
  background: var(--hairline);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: 17px; font-weight: 600; }
.card-head .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.eyebrow { font-size: 12px; color: var(--muted); font-weight: 500; }
.link-btn { border: 0; background: none; color: var(--pink-2); font-size: 13px; font-weight: 600; padding: 6px 8px; border-radius: 999px; text-decoration: none; }
.link-btn:hover { background: var(--surface-2); }
.round-link {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff;
  background: radial-gradient(circle at 30% 20%, #c06bff, #5b2bbd); box-shadow: 0 8px 24px -6px rgba(155, 92, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.round-link svg { width: 18px; height: 18px; }

/* painel tipo "folha" */
.panel {
  position: relative; isolation: isolate; border-radius: 30px; padding: 10px 18px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
}
:root[data-theme='light'] .panel { background: var(--surface-solid); }
.panel .grip { width: 38px; height: 4px; border-radius: 4px; background: var(--surface-3); margin: 0 auto 12px; }

/* estatísticas */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { position: relative; isolation: isolate; background: var(--surface); border-radius: var(--r); padding: 14px 16px; }
:root[data-theme='light'] .stat { background: var(--surface-solid); }
.stat .v { font-weight: 600; font-size: 18px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .hint { font-size: 12px; color: var(--muted); }

/* ---------- listas ---------- */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 11px 8px; margin: 0 -8px; border-radius: 18px;
  border: 0; background: none; text-align: left; width: calc(100% + 16px); transition: background 0.15s var(--ease);
}
.item:hover { background: var(--surface-2); }
.item .ic {
  width: 46px; height: 46px; flex: none; border-radius: 15px; display: grid; place-items: center; font-size: 20px;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--c, var(--pink)) 38%, transparent), color-mix(in srgb, var(--c, var(--pink)) 10%, transparent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.item .body { flex: 1; min-width: 0; }
.item .t { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.item .amt { font-weight: 600; font-size: 15px; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.item .amt small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.tag.pink { background: rgba(255, 79, 168, 0.16); color: var(--pink-2); }
.tag.amber { background: rgba(255, 204, 102, 0.14); color: var(--amber); }
.tag.green { background: rgba(95, 240, 181, 0.14); color: var(--green); }

.day-group + .day-group { margin-top: 12px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 2px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: capitalize; }

/* ---------- progresso ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width 0.6s var(--ease); }
.bar.thin { height: 6px; }

.cat-row { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 9px 0; }
.cat-row .ic { width: 38px; height: 38px; border-radius: 13px; font-size: 17px; grid-row: span 2; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); }
.cat-row .name { font-size: 14px; font-weight: 500; display: flex; justify-content: space-between; gap: 8px; }
.cat-row .val { font-weight: 600; font-size: 14px; text-align: right; grid-row: span 2; font-variant-numeric: tabular-nums; }
.cat-row .val small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }

/* ---------- gráficos ---------- */
.flow { width: 100%; height: auto; max-height: 240px; display: block; overflow: visible; }
.flow text { font-family: var(--font); }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }

.donut-wrap { display: grid; grid-template-columns: 156px 1fr; gap: 20px; align-items: center; }
@media (max-width: 420px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } }
.donut { position: relative; width: 156px; height: 156px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.donut .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut .center b { font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.donut .center small { font-size: 11px; color: var(--muted); }
.legend { display: flex; flex-direction: column; gap: 9px; width: 100%; min-width: 0; }
.legend div { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c); box-shadow: 0 0 8px var(--c); }
.legend span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 64px; display: block; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 22px;
  border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); font-weight: 600; font-size: 15px;
  transition: transform 0.12s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease); white-space: nowrap; text-decoration: none; color: var(--text);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.98); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--grad); border-color: rgba(255, 255, 255, 0.2); color: #fff; box-shadow: var(--glow); }
.btn.primary:hover { box-shadow: 0 14px 44px -8px rgba(255, 79, 168, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn.white { background: #fff; color: #1a0b16; border-color: transparent; }
.btn.white:hover { background: #ffeef7; }
.btn.white .arrow { width: 28px; height: 28px; margin-right: -12px; border-radius: 50%; display: grid; place-items: center; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: rgba(255, 107, 139, 0.4); background: transparent; }
.btn.block { width: 100%; }
.btn.sm { height: 38px; padding: 0 14px; font-size: 13px; }
.btn[disabled] { opacity: 0.6; pointer-events: none; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-2);
  display: grid; place-items: center; color: var(--text-2); flex: none;
}
.icon-btn:hover { color: var(--text); background: var(--surface-3); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- formulários ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input, select.input, textarea.input {
  width: 100%; height: 52px; padding: 0 18px; border-radius: 16px; border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04); outline: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; font-size: 16px;
}
:root[data-theme='light'] .input { background: #fff; }
select.input option { background: var(--surface-solid); color: var(--text); }
textarea.input { height: auto; min-height: 80px; padding: 14px 18px; resize: vertical; }
.input:focus { border-color: var(--pink); background: rgba(255, 79, 168, 0.05); box-shadow: 0 0 0 4px rgba(255, 79, 168, 0.15); }
.input.invalid { border-color: var(--red); }
.field .err { font-size: 12px; color: var(--red); }
.field .hint { font-size: 12px; color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.money-input { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 12px 0 4px; }
.money-input span { font-weight: 500; font-size: 22px; color: var(--muted); }
.money-input input {
  width: 4.5ch; min-width: 3ch; max-width: 100%; border: 0; background: none; outline: none; text-align: left;
  font-weight: 500; font-size: 50px; letter-spacing: -0.045em; padding: 0; caret-color: var(--pink); font-variant-numeric: tabular-nums;
}
.money-input input::placeholder { color: color-mix(in srgb, var(--text) 25%, transparent); }
.money-input input:focus-visible { outline: none; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; gap: 4px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-radius: 999px; }
.seg button { height: 42px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; color: var(--muted); font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.2s var(--ease); }
.seg button svg { width: 16px; height: 16px; }
.seg button.on { background: var(--surface-3); color: var(--text); }
.seg.type button.on[data-v='out'] { background: var(--grad); color: #fff; box-shadow: 0 6px 20px -8px rgba(255, 79, 168, 0.9); }
.seg.type button.on[data-v='in'] { background: linear-gradient(135deg, #3fdca0, #2bb3c9); color: #04130d; box-shadow: 0 6px 20px -8px rgba(63, 220, 160, 0.8); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 15px; border-radius: 999px; flex: none;
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.03); font-size: 13px; font-weight: 500; color: var(--text-2); transition: all 0.15s var(--ease);
}
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .e { font-size: 15px; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.cat-pick {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 20px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03); font-size: 11.5px; color: var(--text-2); text-align: center; line-height: 1.2; transition: all 0.15s var(--ease);
}
.cat-pick .e { font-size: 20px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--c) 40%, transparent), color-mix(in srgb, var(--c) 8%, transparent)); }
.cat-pick.on { border-color: color-mix(in srgb, var(--c) 70%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); color: var(--text); box-shadow: 0 8px 24px -12px var(--c); }

.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-2); font-size: 20px; }
.stepper output { min-width: 58px; text-align: center; font-weight: 600; font-size: 24px; letter-spacing: -0.03em; }

.callout { border-radius: 18px; padding: 13px 16px; font-size: 13px; color: var(--text-2); background: linear-gradient(135deg, rgba(255, 79, 168, 0.1), rgba(138, 77, 255, 0.08)); border: 1px solid rgba(255, 140, 198, 0.18); }
.callout b { color: var(--text); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; cursor: pointer; }
.switch input { appearance: none; width: 48px; height: 28px; border-radius: 99px; background: var(--surface-3); position: relative; transition: background 0.2s; flex: none; border: 1px solid var(--border-strong); }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.switch input:checked { background: var(--grad); }
.switch input:checked::after { transform: translateX(20px); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.search { position: relative; flex: 1; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search input { padding-left: 44px; height: 48px; border-radius: 999px; }
.toolbar select.input { border-radius: 999px; height: 48px; }

/* ---------- cartões de crédito furta-cor ---------- */
.cc-scroll { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: min(320px, 84%); gap: 14px; overflow-x: auto; margin: 0 -16px; padding: 6px 16px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.cc-scroll::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .cc-scroll { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin: 0; padding: 6px 0 10px; overflow: visible; } }
.cc {
  scroll-snap-align: center; position: relative; overflow: hidden; isolation: isolate; border-radius: 26px; padding: 20px; min-height: 196px; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; border: 0; text-align: left;
  background:
    linear-gradient(160deg, rgba(20, 8, 26, 0.05) 30%, rgba(14, 6, 20, 0.7) 100%),
    conic-gradient(from 210deg at 75% 35%, var(--c), #ffb3dc, #8fd3ff, #c99bff, var(--c));
  box-shadow: 0 24px 50px -24px var(--c), inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.cc::before {
  content: ''; position: absolute; z-index: -1; width: 140%; height: 70%; left: -20%; top: 10%; border-radius: 50%;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.55) 45%, rgba(255, 180, 230, 0.3) 55%, transparent 75%);
  filter: blur(18px); transform: rotate(-18deg);
}
.cc::after { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 80% at 0% 100%, rgba(10, 4, 16, 0.55), transparent 60%); }
.cc .cc-top { display: flex; justify-content: space-between; align-items: center; }
.cc .name { font-weight: 600; font-size: 16px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3); }
.cc .chip-ic { width: 40px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.35)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5); position: relative; }
.cc .chip-ic::after { content: ''; position: absolute; inset: 8px 6px; border: 1.5px solid rgba(80, 40, 80, 0.35); border-radius: 4px; }
.cc .lbl { font-size: 12px; opacity: 0.85; }
.cc .inv { font-weight: 600; font-size: 28px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25); }
.cc .meta { display: flex; justify-content: space-between; font-size: 12px; opacity: 0.9; gap: 8px; }
.cc .bar { background: rgba(255, 255, 255, 0.22); margin: 8px 0 6px; }
.cc .bar > span { background: #fff; }
.cc .cc-btn { border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.16); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cc-add { background: transparent; border: 1.5px dashed var(--border-strong); color: var(--muted); align-items: center; justify-content: center; gap: 8px; box-shadow: none; font-weight: 600; flex-direction: row; }
.cc-add::before, .cc-add::after { display: none; }
.dots-pager { display: flex; justify-content: center; gap: 6px; margin: 4px 0 4px; }
.dots-pager i { width: 6px; height: 6px; border-radius: 99px; background: var(--surface-3); transition: all 0.25s var(--ease); }
.dots-pager i.on { width: 18px; background: var(--pink); }
@media (min-width: 900px) { .dots-pager { display: none; } }

.inst { padding: 14px 4px; border-bottom: 1px solid var(--border); }
.inst:last-child { border-bottom: 0; }
.inst-top { display: flex; gap: 12px; align-items: center; }
.inst-top .body { flex: 1; min-width: 0; }
.inst-top .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inst-top .s { font-size: 12px; color: var(--muted); }
.inst .dots { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.inst .dots i { flex: 1; min-width: 6px; max-width: 28px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.inst .dots i.on { background: var(--grad); box-shadow: 0 0 8px -1px var(--pink); }
.inst-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- ajustes ---------- */
.set-group { margin-bottom: 20px; }
.set-group > .eyebrow { margin: 0 6px 8px; display: block; }
.set-list { position: relative; isolation: isolate; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
:root[data-theme='light'] .set-list { background: var(--surface-solid); }
.set-item { display: flex; align-items: center; gap: 14px; padding: 15px 18px; width: 100%; border: 0; background: none; text-align: left; border-bottom: 1px solid var(--border); }
.set-item:last-child { border-bottom: 0; }
.set-item:hover { background: var(--surface-2); }
.set-item .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--c, var(--pink)) 35%, transparent), color-mix(in srgb, var(--c, var(--pink)) 8%, transparent)); color: var(--c, var(--pink-2)); flex: none; font-size: 17px; }
.set-item .ic svg { width: 18px; height: 18px; }
.set-item .body { flex: 1; min-width: 0; }
.set-item .t { font-weight: 500; }
.set-item .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-item .chev { color: var(--muted); width: 18px; height: 18px; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; background: var(--c); }
.swatches button.on { border-color: var(--text); box-shadow: 0 0 0 3px var(--bg) inset, 0 0 14px var(--c); }
.emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.emojis button { height: 44px; border-radius: 50%; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03); font-size: 20px; }
.emojis button.on { border-color: var(--pink); background: rgba(255, 79, 168, 0.14); }

/* ---------- sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(4, 0, 8, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.2s var(--ease); }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: radial-gradient(120% 40% at 50% 0%, rgba(255, 79, 168, 0.14), transparent 70%), var(--surface-solid);
  border: 1px solid var(--border-strong); border-bottom: 0;
  border-radius: 32px 32px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  animation: up 0.3s var(--ease); box-shadow: 0 -30px 80px -30px rgba(255, 79, 168, 0.35);
}
.sheet .grip { width: 40px; height: 4px; border-radius: 4px; background: var(--surface-3); margin: 2px auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.sheet-head h2 { font-size: 22px; letter-spacing: -0.03em; }
.sheet-foot { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); margin: 10px -20px calc(-20px - env(safe-area-inset-bottom)); padding: 14px 20px calc(20px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--surface-solid) 30%); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }
.overlay.closing { animation: fade 0.18s var(--ease) reverse forwards; }
.overlay.closing .sheet { animation: down 0.2s var(--ease) forwards; }
@media (min-width: 700px) {
  .overlay { align-items: center; padding: 20px; }
  .sheet { border-radius: 32px; border-bottom: 1px solid var(--border-strong); animation: pop 0.24s var(--ease); }
  .sheet .grip { display: none; }
  .sheet-foot { bottom: -20px; margin-bottom: -20px; padding-bottom: 20px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
@keyframes pop { from { transform: translateY(12px) scale(0.98); opacity: 0; } }

/* ---------- toast ---------- */
#toast-root { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 900px) { #toast-root { bottom: 24px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-radius: 999px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7); font-size: 14px; animation: pop 0.22s var(--ease); }
.toast.err { border-color: rgba(255, 107, 139, 0.5); }
.toast svg { width: 18px; height: 18px; flex: none; color: var(--pink-2); }
.toast.err svg { color: var(--red); }

/* ---------- estados ---------- */
.empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.empty .em-ic { width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 0%, rgba(255, 79, 168, 0.3), rgba(255, 79, 168, 0.05)); border: 1px solid var(--border-strong); color: var(--pink-2); }
.empty .em-ic svg { width: 24px; height: 24px; }
.empty h4 { color: var(--text); font-size: 15px; margin-bottom: 4px; letter-spacing: 0; }
.empty p { margin: 0 0 14px; font-size: 13px; }
.skel { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--r-lg); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- login ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; position: relative; overflow: hidden; isolation: isolate; }
.auth-art { position: absolute; z-index: -1; inset: 0 0 auto 0; height: 72dvh; }
.auth-art svg { width: 100%; height: 100%; }
.auth-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, var(--bg) 96%); }
.auth-inner { margin-top: auto; width: 100%; max-width: 440px; padding: 24px 22px calc(32px + env(safe-area-inset-bottom)); align-self: center; }
.auth-brand { position: absolute; top: calc(env(safe-area-inset-top) + 22px); left: 22px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.auth-brand b { color: var(--pink-2); }
.auth h1 { font-size: clamp(38px, 10vw, 48px); line-height: 1.02; letter-spacing: -0.045em; margin-bottom: 12px; font-weight: 700; }
.auth p { color: var(--text-2); margin: 0 0 26px; font-size: 15px; }
.auth form { text-align: left; }
.auth .btn.white { height: 56px; font-size: 16px; justify-content: space-between; padding: 0 8px 0 26px; }
.auth .btn.white .arrow { width: 42px; height: 42px; margin: 0; background: #1a0b16; color: #fff; }

/* ---------- motion ---------- */
.fade-in > * { animation: rise 0.45s var(--ease) both; }
.fade-in > *:nth-child(2) { animation-delay: 0.05s; }
.fade-in > *:nth-child(3) { animation-delay: 0.1s; }
.fade-in > *:nth-child(4) { animation-delay: 0.15s; }
.fade-in > *:nth-child(n + 5) { animation-delay: 0.2s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- visibilidade por tamanho ---------- */
.desk-only { display: none; }
@media (min-width: 900px) {
  .desk-only { display: contents; }
  .mob-only { display: none !important; }
}
