:root {
  --purple: #6314D6;
  --purple-2: #7625EB;
  --purple-dark: #4B0CA8;
  --purple-soft: #F3ECFF;
  --purple-tint: #EAE0FF;
  --green: #0FA968;
  --green-soft: #E9FBF2;
  --red: #E53935;
  --red-soft: #FDEEEE;
  --amber: #D97706;
  --amber-soft: #FEF3C7;
  --blue: #2563EB;
  --bg: #F4F5F9;
  --card: #FFFFFF;
  --text: #1B1F2A;
  --text-2: #4B5563;
  --muted: #6B7280;
  --light: #9CA3AF;
  --border: #E9ECF2;
  --shadow-sm: 0 1px 3px rgba(18, 12, 48, 0.04), 0 4px 14px rgba(18, 12, 48, 0.045);
  --shadow-md: 0 8px 24px rgba(18, 12, 48, 0.10);
  --radius: 16px;
  --nav-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #E4E7F0;
  color: var(--text);
  height: 100%;
  -webkit-font-smoothing: antialiased;
}
.num { font-variant-numeric: tabular-nums; }

.app-shell {
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 42px rgba(20, 14, 54, 0.14);
}

/* Topbars */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
}
.topbar.purple {
  background: linear-gradient(135deg, var(--purple-2), var(--purple));
  color: #FFFFFF;
  border-bottom: none;
}
.brand {
  display: flex;
  align-items: center;
  font-size: 22px;
  letter-spacing: -0.7px;
  user-select: none;
}
.brand-b { font-weight: 800; color: #2D3340; position: relative; }
.brand-bar {
  position: absolute; top: 0px; left: 13px;
  width: 14px; height: 3.5px; border-radius: 2px;
  background: var(--green);
}
.brand-c { font-weight: 600; color: var(--purple); }
.proto-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--purple);
  background: var(--purple-soft);
  padding: 4px 9px;
  border-radius: 999px;
}

.icon-btn {
  width: 38px; height: 38px;
  border: none; background: transparent;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2);
  transition: background 0.15s, transform 0.1s;
}
.icon-btn:hover { background: rgba(15, 23, 42, 0.06); }
.icon-btn:active { transform: scale(0.94); }
.topbar.purple .icon-btn { color: #FFF; }
.topbar.purple .icon-btn:hover { background: rgba(255,255,255,0.16); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.topbar-action-btn {
  border: none;
  background: rgba(255,255,255,0.18);
  color: #FFF;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 10px;
  cursor: pointer;
}
.topbar-action-btn:hover { background: rgba(255,255,255,0.28); }

/* Screens */
.screen {
  display: none;
  flex: 1;
  padding: 14px 14px calc(var(--nav-h) + 92px);
  overflow-y: auto;
}
.screen.active { display: block; }

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid rgba(15, 23, 42, 0.04);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 14px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}
.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.month-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.month-nav-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  background: #FFF;
  color: var(--purple);
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.month-nav-btn:hover { background: var(--purple-soft); border-color: var(--purple-tint); }
.month-nav-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.month-heading {
  display: flex; align-items: center; gap: 7px;
  font-size: 17px; font-weight: 700; color: var(--text);
  cursor: pointer;
}
.proj-tag {
  font-size: 10.5px; font-weight: 700;
  background: var(--purple-soft); color: var(--purple);
  padding: 2px 7px; border-radius: 999px;
}

/* Summary Rows */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14.5px;
}
.summary-row.total {
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--purple);
  color: #FFF;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
}
.summary-row.total.classic {
  background: transparent;
  color: var(--text);
  padding: 9px 0 2px;
  border-radius: 0;
  border-top: 1px solid var(--border);
}
.sum-lbl { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; }
.sum-ico {
  width: 24px; height: 24px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
}
.sum-ico svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.val-neutral { color: var(--text); font-weight: 700; }
.val-expense { color: var(--red); font-weight: 700; }
.val-income { color: var(--green); font-weight: 700; }
.val-purple { color: var(--purple); font-weight: 800; }

.scheduled-banner {
  margin-top: 10px;
  padding: 8px 11px;
  border-radius: 10px;
  background: #F6F3FF;
  border: 1px solid #E9DFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #4C1D95;
  gap: 8px;
  cursor: pointer;
}

/* Pill Toggle */
.chip-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: inherit;
  font-size: 11.5px; font-weight: 700;
  color: var(--purple); background: var(--purple-soft);
  border: none; padding: 5px 10px; border-radius: 999px;
  cursor: pointer;
}
.chip-toggle.off { background: #EEF0F5; color: var(--muted); }

/* Accounts list */
.acc-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 6px; border-radius: 10px;
  cursor: pointer; transition: background 0.12s;
}
.acc-row:hover { background: #F7F8FC; }
.acc-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.acc-ico {
  width: 28px; height: 28px; border-radius: 8px;
  background: #F1F3F8; color: #525B6B;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.acc-ico svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.acc-name { font-size: 14.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-bal { font-size: 14.5px; font-weight: 700; flex-shrink: 0; }

/* Card footer button */
.card-footer-btn {
  display: block; width: 100%;
  margin-top: 10px; padding: 10px 0 2px;
  border: none; border-top: 1px solid var(--border);
  background: transparent;
  font-family: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--purple); cursor: pointer;
}
.card-footer-btn:hover { opacity: 0.78; }

/* Transaction Row */
.tx-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 6px;
  border-bottom: 1px solid #F2F4F8;
  cursor: pointer; gap: 11px; border-radius: 10px;
  transition: background 0.12s;
}
.tx-item:last-of-type { border-bottom: none; }
.tx-item:hover { background: #F8F9FD; }
.tx-badge-ico {
  width: 38px; height: 38px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tx-badge-ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.tx-badge-ico.exp { background: var(--red-soft); color: var(--red); }
.tx-badge-ico.inc { background: var(--green-soft); color: var(--green); }
.tx-badge-ico.trf { background: var(--purple-soft); color: var(--purple); }
.tx-mid { flex: 1; min-width: 0; }
.tx-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tx-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tx-desc {
  font-size: 12px; color: var(--light); font-style: italic;
  margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tx-right { text-align: right; flex-shrink: 0; }
.tx-date { font-size: 11px; font-weight: 700; color: var(--purple); }
.tx-amt { font-size: 14.5px; font-weight: 800; margin-top: 2px; }
.tx-status {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 700;
  margin-top: 3px; padding: 2px 7px; border-radius: 999px;
}
.tx-status.paid { background: var(--green-soft); color: var(--green); }
.tx-status.unpaid { background: var(--red-soft); color: var(--red); }
.tx-status.sched { background: var(--amber-soft); color: #B45309; }
.tx-status.trf { background: var(--purple-soft); color: var(--purple); }

/* Segmented controls & Chart toggle */
.seg-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
}
.seg-group {
  display: inline-flex; background: #F1F2F7; padding: 3px; border-radius: 999px;
}
.seg-btn {
  border: none; background: transparent;
  font-family: inherit; font-size: 13px; font-weight: 700;
  color: var(--muted); padding: 7px 16px; border-radius: 999px;
  cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 5px;
}
.seg-btn.active {
  background: var(--purple); color: #FFF;
  box-shadow: 0 2px 8px rgba(99, 20, 214, 0.28);
}
.seg-btn.icon-only { padding: 7px 11px; }
.seg-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; }

/* Donut & Bars */
.donut-wrap { position: relative; width: 224px; height: 224px; margin: 4px auto 14px; }
.donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none; text-align: center; padding: 26px;
}
.donut-pct { font-size: 12px; font-weight: 700; color: var(--purple); }
.donut-lbl { font-size: 13px; font-weight: 600; color: var(--muted); margin: 2px 0; max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-val { font-size: 16px; font-weight: 800; color: var(--purple); }

.cat-list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 6px; border-radius: 10px; cursor: pointer; gap: 10px;
}
.cat-list-row:hover, .cat-list-row.selected { background: var(--purple-soft); }
.cat-dot { width: 11px; height: 11px; border-radius: 4px; flex-shrink: 0; }
.bar-row { margin-bottom: 13px; }
.bar-top { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; margin-bottom: 5px; }
.bar-track-wrap { display: flex; align-items: center; gap: 10px; }
.bar-track { flex: 1; height: 9px; background: #EFEFF5; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width 0.35s ease; }
.bar-pct { font-size: 12px; font-weight: 700; color: var(--muted); width: 42px; text-align: right; }

/* FABs */
.fab-stack {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  right: max(16px, calc(50% - 214px));
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  z-index: 35;
}
.fab-mini {
  width: 44px; height: 44px; border-radius: 14px;
  border: none; background: #FFF; color: var(--purple);
  box-shadow: 0 4px 14px rgba(18, 12, 48, 0.16);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--purple-tint);
}
.fab-main {
  width: 56px; height: 56px; border-radius: 18px;
  border: none; background: linear-gradient(135deg, var(--purple-2), var(--purple));
  color: #FFF;
  box-shadow: 0 8px 20px rgba(99, 20, 214, 0.36);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.fab-mini svg, .fab-main svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.fab-main svg { width: 26px; height: 26px; }
.fab-mini:active, .fab-main:active { transform: scale(0.94); }

/* Bottom Nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 460px; height: var(--nav-h);
  background: #FFFFFF; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(3, 1fr);
  z-index: 40;
}
.nav-btn {
  border: none; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--light); font-family: inherit; font-size: 11px; font-weight: 700;
  cursor: pointer;
}
.nav-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn.active { color: var(--purple); }
.nav-btn.active .nav-pill {
  background: var(--purple-soft); padding: 4px 16px; border-radius: 999px;
  display: inline-flex;
}
.nav-pill { padding: 4px 16px; border-radius: 999px; display: inline-flex; transition: background 0.15s; }

/* Annual Screen */
.annual-bar {
  background: #FFF; border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 10px 14px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.year-picker { display: flex; align-items: center; gap: 14px; font-size: 19px; font-weight: 800; }
.chart-open-btn {
  border: none; background: linear-gradient(135deg, var(--purple-2), var(--purple));
  color: #FFF; border-radius: 11px; padding: 9px 13px;
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chart-open-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.3; }
.month-card { cursor: pointer; transition: transform 0.1s; }
.month-card:active { transform: scale(0.99); }

/* Settings */
.settings-group-title {
  font-size: 11.5px; font-weight: 800; color: var(--purple);
  text-transform: uppercase; letter-spacing: 0.6px; margin: 16px 6px 8px;
}
.settings-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 2px; border-bottom: 1px solid #F2F4F8; cursor: pointer; gap: 10px;
}
.settings-item:last-child { border-bottom: none; }
.settings-item-title { font-size: 14.5px; font-weight: 700; color: var(--text); }
.settings-item-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Overlays */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  display: none; justify-content: center;
  background: rgba(15, 18, 32, 0.48);
}
.overlay.open { display: flex; }
.overlay-sheet {
  width: 100%; max-width: 460px; height: 100%;
  background: var(--bg);
  display: flex; flex-direction: column; overflow: hidden;
}
.form-body { flex: 1; overflow-y: auto; padding: 14px; }

/* Entry Form (Refined Modern-Classic) */
.amount-card {
  background: #FFF; border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 16px 18px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.amount-prefix { font-size: 24px; font-weight: 800; color: var(--red); }
.amount-input {
  width: 190px; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 34px; font-weight: 800; color: var(--red);
  text-align: left;
}
.amount-card.inc .amount-prefix, .amount-card.inc .amount-input { color: var(--green); }
.amount-card.trf .amount-prefix, .amount-card.trf .amount-input { color: var(--purple); }

.type-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px;
}
.type-btn {
  border: 1.5px solid var(--border); background: #FFF;
  border-radius: 13px; padding: 11px;
  font-family: inherit; font-size: 14.5px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--muted); transition: all 0.15s;
}
.type-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2.3; }
.type-btn.exp.active { background: var(--red); border-color: var(--red); color: #FFF; box-shadow: 0 4px 12px rgba(229,57,53,0.28); }
.type-btn.inc.active { background: var(--green); border-color: var(--green); color: #FFF; box-shadow: 0 4px 12px rgba(15,169,104,0.28); }

.field-card {
  background: #FFF; border-radius: 14px; box-shadow: var(--shadow-sm);
  padding: 12px 14px; margin-bottom: 11px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid rgba(15,23,42,0.03);
}
.field-card.clickable { cursor: pointer; }
.field-card.clickable:hover { background: #FAF9FF; }
.field-ico-box {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--purple-soft); color: var(--purple);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.field-ico-box svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.field-content { flex: 1; min-width: 0; }
.field-lbl { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.field-val { font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-input {
  width: 100%; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 15px; font-weight: 600; color: var(--text);
  padding: 2px 0;
}

/* Switch */
.switch-row {
  background: #FFF; border-radius: 14px; box-shadow: var(--shadow-sm);
  padding: 13px 16px; margin-bottom: 11px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.switch-item { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--text-2); cursor: pointer; }
.switch {
  position: relative; width: 44px; height: 25px; display: inline-block;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: #D7DCE5; border-radius: 999px; transition: 0.2s; cursor: pointer;
}
.slider::before {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 19px; height: 19px; border-radius: 50%; background: #FFF;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2); transition: 0.2s;
}
.switch input:checked + .slider { background: var(--purple); }
.switch input:checked + .slider::before { transform: translateX(19px); }

.repeat-card {
  display: none; background: #FFF; border-radius: 14px; box-shadow: var(--shadow-sm);
  padding: 12px 14px; margin-bottom: 14px;
  align-items: center; justify-content: space-between; gap: 12px;
}
.repeat-card.show { display: flex; }
.repeat-num {
  flex: 1; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 9px 12px; font-family: inherit; font-size: 16px; font-weight: 700;
  text-align: center; outline: none;
}
.repeat-num:focus { border-color: var(--purple); }
.btn-ver-parc {
  border: none; background: var(--purple); color: #FFF;
  font-family: inherit; font-size: 13.5px; font-weight: 700;
  padding: 10px 16px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}

.form-footer {
  padding: 12px 14px 16px; background: #FFF; border-top: 1px solid var(--border);
}
.btn-primary {
  width: 100%; border: none;
  background: linear-gradient(135deg, var(--purple-2), var(--purple));
  color: #FFF; font-family: inherit; font-size: 15px; font-weight: 700;
  padding: 14px; border-radius: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(99, 20, 214, 0.26);
}
.btn-primary.exp { background: linear-gradient(135deg, #F04844, var(--red)); box-shadow: 0 4px 14px rgba(229,57,53,0.28); }
.btn-primary.inc { background: linear-gradient(135deg, #12B872, var(--green)); box-shadow: 0 4px 14px rgba(15,169,104,0.28); }
.btn-secondary {
  width: 100%; border: 1.5px solid var(--border); background: #FFF;
  color: var(--text); font-family: inherit; font-size: 14px; font-weight: 700;
  padding: 12px; border-radius: 13px; cursor: pointer;
}
.btn-outline-purple {
  border: 1.5px solid var(--purple); background: #FFF; color: var(--purple);
  font-family: inherit; font-size: 13.5px; font-weight: 700;
  padding: 11px 14px; border-radius: 12px; cursor: pointer;
}

/* Consulta Topbar Icons (Chart, Sort, Filter) */
.consulta-actions { display: flex; align-items: center; gap: 7px; }
.c-act-btn {
  width: 36px; height: 36px; border: none; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; color: #FFF;
}
.c-act-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.c-act-btn.blue { background: #2563EB; }
.c-act-btn.purple { background: var(--purple); }
.c-act-btn.green { background: #0D9668; }
.c-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #FFF;
  font-size: 10px; font-weight: 800;
  min-width: 17px; height: 17px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #FFF;
}
.consulta-subbar {
  background: #FFF; padding: 8px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12.5px; color: var(--muted);
}
.consulta-list { flex: 1; overflow-y: auto; padding: 12px 14px; }
.consulta-footer {
  background: #FFF; border-top: 1px solid var(--border);
  padding: 12px 14px 14px; box-shadow: 0 -4px 18px rgba(18,12,48,0.06);
}
.kpi-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px;
}
.kpi-box {
  border-radius: 12px; padding: 9px 8px; text-align: center;
}
.kpi-box.exp { background: var(--red-soft); color: var(--red); border: 1px solid #FAD5D5; }
.kpi-box.inc { background: var(--green-soft); color: var(--green); border: 1px solid #C6F3DF; }
.kpi-box.net { background: var(--purple); color: #FFF; }
.kpi-lbl { font-size: 11px; font-weight: 700; opacity: 0.9; }
.kpi-val { font-size: 13.5px; font-weight: 800; margin-top: 3px; }
.where-panel { display: none; max-height: 220px; overflow-y: auto; margin-bottom: 10px; }
.where-panel.open { display: block; }
.where-acc-pill {
  font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.where-acc-pill.pos { background: var(--green-soft); color: var(--green); }
.where-acc-pill.neg { background: var(--red-soft); color: var(--red); }

/* Bottom Sheet Dialog */
.dialog-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 18, 32, 0.52);
  display: none; align-items: flex-end; justify-content: center;
}
.dialog-backdrop.open { display: flex; }
.dialog-backdrop.center { align-items: center; padding: 18px; }
.dialog-box {
  width: 100%; max-width: 460px; max-height: 86vh;
  background: #FFF; border-radius: 22px 22px 0 0;
  padding: 12px 16px 18px;
  display: flex; flex-direction: column; overflow: hidden;
  animation: slideUp 0.18s ease-out;
}
.dialog-backdrop.center .dialog-box {
  border-radius: 22px; max-width: 360px; padding: 20px;
}
@keyframes slideUp { from { transform: translateY(24px); opacity: 0.7; } to { transform: translateY(0); opacity: 1; } }
.sheet-handle {
  width: 40px; height: 4px; border-radius: 999px; background: #DDE1EA;
  margin: 0 auto 12px;
}
.dialog-scroll { flex: 1; overflow-y: auto; margin: 10px 0; }

/* Search box inside picker sheets */
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: #F3F4F8; border-radius: 12px; padding: 9px 12px; margin-bottom: 10px;
}
.search-box input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 14px; font-weight: 500;
}
.picker-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 10px; border-bottom: 1px solid #F2F4F8;
  cursor: pointer; border-radius: 10px; font-size: 14.5px; font-weight: 600;
}
.picker-item:hover { background: var(--purple-soft); color: var(--purple); }
.picker-item.selected { background: var(--purple-soft); color: var(--purple); font-weight: 700; }

/* Installments Modal Table */
.parc-mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.parc-mode-btn {
  border: 1.5px solid var(--border); background: #FFF; border-radius: 11px;
  padding: 10px; font-family: inherit; font-size: 13.5px; font-weight: 700;
  color: var(--text-2); cursor: pointer;
}
.parc-mode-btn.active { background: var(--purple-soft); border-color: var(--purple); color: var(--purple); }
.parc-sum-pill {
  text-align: center; padding: 9px 12px; border-radius: 11px;
  background: var(--green-soft); color: var(--green); border: 1px solid #BFEFD9;
  font-size: 13.5px; font-weight: 700; margin-bottom: 12px;
}
.parc-grid-head {
  display: grid; grid-template-columns: 1.15fr 1fr 44px; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--muted);
  padding: 0 2px 6px; border-bottom: 1px solid var(--border);
}
.parc-grid-row {
  display: grid; grid-template-columns: 1.15fr 1fr 44px; gap: 8px;
  align-items: center; padding: 8px 0; border-bottom: 1px solid #F3F4F8;
}
.parc-inp {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 8px 9px; font-family: inherit; font-size: 13.5px; font-weight: 600;
  outline: none; background: #FFF;
}
.parc-inp:focus { border-color: var(--purple); }
.parc-chk { width: 20px; height: 20px; accent-color: var(--purple); justify-self: center; cursor: pointer; }

/* Filter Form */
.flt-card {
  background: #F7F8FC; border: 1px solid var(--border); border-radius: 14px;
  padding: 12px; margin-bottom: 12px;
}
.flt-label { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 5px; display: block; }
.flt-select, .flt-date {
  width: 100%; border: 1px solid var(--border); background: #FFF;
  border-radius: 10px; padding: 9px 11px; font-family: inherit; font-size: 14px; font-weight: 600;
}
.quick-dates { display: flex; justify-content: space-around; margin: 10px 0; }
.quick-date-link {
  border: none; background: transparent; font-family: inherit;
  font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: underline;
}
.flt-picker-btn {
  width: 100%; border: 1px solid var(--border); background: #FFF;
  border-radius: 10px; padding: 10px 12px; text-align: left;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text);
  display: flex; justify-content: space-between; align-items: center; cursor: pointer;
}

/* Annual Evolution Card */
.evo-summary {
  background: #FFF; border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 14px; margin-bottom: 12px;
}
.evo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.evo-mini { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.evo-sobrou {
  background: linear-gradient(135deg, var(--purple-2), var(--purple));
  color: #FFF; border-radius: 12px; padding: 11px 14px;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 15px;
}
.month-pills { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 12px; }
.month-pill {
  border: 1px solid var(--border); background: #FFF; color: var(--muted);
  border-radius: 999px; padding: 6px 11px; font-family: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; flex-shrink: 0;
}
.month-pill.active { background: var(--purple); color: #FFF; border-color: var(--purple); }

/* Manage rows */
.manage-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 4px; border-bottom: 1px solid #F1F3F8; gap: 8px;
}
.sm-btn {
  border: 1px solid var(--border); background: #FFF; color: var(--text-2);
  border-radius: 9px; padding: 6px 10px; font-family: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer;
}
.sm-btn.purple { border-color: var(--purple-tint); background: var(--purple-soft); color: var(--purple); }
.sm-btn.red { border-color: #FAD5D5; background: var(--red-soft); color: var(--red); }
.tag-arch { font-size: 10.5px; background: #ECEFF5; color: var(--muted); padding: 2px 7px; border-radius: 999px; margin-left: 6px; }

.empty-msg { text-align: center; color: var(--light); padding: 22px 12px; font-size: 13.5px; }

.toast {
  position: fixed; bottom: 84px; left: 50%;
  transform: translateX(-50%) translateY(18px);
  background: #1B1F2A; color: #FFF;
  padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all 0.22s;
  z-index: 120; box-shadow: 0 8px 20px rgba(0,0,0,0.22);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Radio list (Exclusão / Ordenação) */
.radio-card-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 12px; border: 1.5px solid var(--border);
  margin-bottom: 8px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.radio-card-opt.selected { border-color: var(--purple); background: var(--purple-soft); color: var(--purple); }
.radio-card-opt input { width: 18px; height: 18px; accent-color: var(--purple); }

[hidden] { display: none !important; }

.login-shell {
  min-height: 100dvh;
  justify-content: center;
  padding: 24px;
}

.login-card {
  margin: 0;
  padding: 28px;
  border-top: 4px solid var(--purple);
}

.login-brand {
  font-size: 28px;
}

.login-card h1 {
  margin: 22px 0 18px;
  font-size: 22px;
}

.login-form {
  display: grid;
  gap: 8px;
}

.login-form label {
  font-size: 14px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 46px;
  margin-bottom: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}

.login-form input:focus-visible, .login-card button:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.login-form button:disabled { opacity: 0.6; cursor: wait; }

.login-notice {
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}

.login-notice:empty { display: none; }

.offline-retry { display: block; text-align: center; text-decoration: none; margin-top: 16px; }
.offline-retry:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

.settings-action { width: 100%; background: none; border: 0; text-align: left; font: inherit; color: inherit; }
.settings-action .settings-item-title, .settings-action .settings-item-sub { display: block; }
.settings-action:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.import-summary { margin: 0 0 12px; }
.import-summary div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; }
.import-summary dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.import-status { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.import-status:empty { display: none; }
.import-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
