/* ============================================================
   BOLSO PLENO — design system
   Friendly, motivational debt-freedom app. Blue, calm, fun.
   ============================================================ */

:root {
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-ui: "Plus Jakarta Sans", system-ui, sans-serif;

  /* light theme */
  --bg: oklch(0.984 0.007 250);
  --bg-grad: oklch(0.965 0.015 252);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.972 0.008 250);
  --surface-3: oklch(0.955 0.012 250);
  --ink: oklch(0.27 0.035 262);
  --ink-soft: oklch(0.48 0.025 262);
  --ink-faint: oklch(0.62 0.018 262);
  --border: oklch(0.92 0.012 255);
  --border-soft: oklch(0.95 0.008 255);

  --primary: oklch(0.55 0.17 256);
  --primary-strong: oklch(0.47 0.17 256);
  --primary-ink: oklch(0.4 0.14 256);
  --primary-soft: oklch(0.95 0.04 256);
  --primary-glow: oklch(0.55 0.17 256 / 0.28);
  --on-primary: #fff;

  --pago: oklch(0.6 0.13 158);
  --pago-soft: oklch(0.95 0.045 158);
  --pendente: oklch(0.72 0.13 75);
  --pendente-soft: oklch(0.95 0.06 85);
  --atrasado: oklch(0.6 0.19 26);
  --atrasado-soft: oklch(0.95 0.05 30);

  --accent: oklch(0.7 0.16 45);
  --accent-soft: oklch(0.95 0.05 50);

  --shadow-sm:
    0 1px 2px oklch(0.45 0.05 262 / 0.06), 0 1px 3px oklch(0.45 0.05 262 / 0.05);
  --shadow-md:
    0 4px 14px oklch(0.45 0.05 262 / 0.08),
    0 2px 6px oklch(0.45 0.05 262 / 0.05);
  --shadow-lg:
    0 18px 48px oklch(0.4 0.06 262 / 0.16),
    0 6px 16px oklch(0.4 0.06 262 / 0.08);
  --shadow-glow: 0 10px 30px var(--primary-glow);

  --r-xs: 9px;
  --r-sm: 13px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;
  --r-pill: 999px;

  --maxw: 1180px;
  --sidebar-w: 248px;
}

[data-theme="dark"] {
  --bg: oklch(0.205 0.02 262);
  --bg-grad: oklch(0.245 0.03 258);
  --surface: oklch(0.255 0.025 262);
  --surface-2: oklch(0.29 0.028 262);
  --surface-3: oklch(0.32 0.03 262);
  --ink: oklch(0.96 0.01 255);
  --ink-soft: oklch(0.78 0.02 255);
  --ink-faint: oklch(0.62 0.02 255);
  --border: oklch(0.36 0.028 262);
  --border-soft: oklch(0.32 0.025 262);

  --primary: oklch(0.7 0.15 256);
  --primary-strong: oklch(0.76 0.14 256);
  --primary-ink: oklch(0.82 0.1 256);
  --primary-soft: oklch(0.36 0.07 256);
  --primary-glow: oklch(0.62 0.16 256 / 0.4);
  --on-primary: oklch(0.18 0.03 262);

  --pago: oklch(0.75 0.13 158);
  --pago-soft: oklch(0.36 0.06 158);
  --pendente: oklch(0.82 0.12 80);
  --pendente-soft: oklch(0.38 0.06 80);
  --atrasado: oklch(0.72 0.16 26);
  --atrasado-soft: oklch(0.37 0.08 26);

  --accent: oklch(0.8 0.13 50);
  --accent-soft: oklch(0.38 0.07 50);

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 16px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 20px 50px oklch(0 0 0 / 0.55);
  --shadow-glow: 0 10px 30px var(--primary-glow);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.45;
}

#app {
  min-height: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
input,
select,
textarea {
  font-family: inherit;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

/* ===== App shell ===== */
.app {
  min-height: 100vh;
  display: flex;
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--bg-grad), transparent 60%),
    var(--bg);
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 22px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.brand-name span {
  color: var(--primary);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 15px;
  transition:
    background 0.15s,
    color 0.15s;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.nav-item .ico {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-item .lock {
  margin-left: auto;
  opacity: 0.8;
}

.side-spacer {
  flex: 1;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.topbar .mobile-brand {
  display: none;
  align-items: center;
  gap: 9px;
}

.topbar h1 {
  font-size: 21px;
  font-weight: 700;
}

.topbar .sub {
  color: var(--ink-faint);
  font-size: 13.5px;
  font-weight: 500;
}

.topbar-spacer {
  flex: 1;
}

.content {
  padding: 26px 28px 120px;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  overflow-x: hidden;
}

.content.narrow {
  max-width: 760px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  padding: 13px 20px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 9px;
  animation: toastin 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

@keyframes toastin {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
}

.bottomnav {
  display: none;
}

@media (max-width: 880px) {
  .app {
    display: block;
  }

  .main {
    min-height: 100vh;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    padding: 14px 18px;
  }

  .topbar .mobile-brand {
    display: flex;
  }

  .topbar h1.page-title {
    font-size: 19px;
  }

  .topbar .desktop-title {
    display: none;
  }

  .content {
    padding: 18px 16px 110px;
    overflow-x: hidden;
  }

  .bottomnav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: color-mix(in oklch, var(--surface) 92%, transparent);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: center;
  }

  .bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--ink-faint);
    font-size: 10.5px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 12px;
    flex: 1;
  }

  .bn-item .ico {
    width: 23px;
    height: 23px;
  }

  .bn-item.active {
    color: var(--primary);
  }

  .bn-fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-glow);
    margin-top: -22px;
    flex: none;
  }

  .bn-fab .ico {
    width: 26px;
    height: 26px;
  }
}

@media (min-width: 881px) {
  .topbar .desktop-title {
    display: block;
  }
}

/* ===== Shared brand mark (Sidebar + MainLayout mobile) ===== */
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(150deg, var(--primary), var(--primary-strong));
  display: grid;
  place-items: center;
  color: var(--on-primary);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  box-shadow: var(--shadow-glow);
}

/* ===== Plan card (Sidebar + ContaPage) ===== */
.plan-card {
  margin-top: 12px;
  padding: 16px;
  border-radius: var(--r-md);
  background: linear-gradient(155deg, var(--primary), var(--primary-strong));
  color: var(--on-primary);
  box-shadow: var(--shadow-glow);
}
.plan-card.is-pro {
  background: linear-gradient(155deg, var(--accent), oklch(0.62 0.17 35));
  box-shadow: 0 10px 30px oklch(0.7 0.16 45 / 0.3);
}
.plan-card h4 {
  color: inherit;
  font-size: 16px;
  margin-bottom: 4px;
}
.plan-card p {
  font-size: 13px;
  opacity: 0.92;
  margin-bottom: 12px;
  line-height: 1.35;
}
.plan-card .btn-mini {
  background: var(--on-primary);
  color: var(--primary-strong);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  width: 100%;
}
.plan-card.is-pro .btn-mini {
  color: oklch(0.55 0.17 38);
}
[data-theme="dark"] .plan-card {
  background: linear-gradient(
    155deg,
    oklch(0.55 0.17 256),
    oklch(0.47 0.17 256)
  );
  color: #fff;
}
[data-theme="dark"] .plan-card .btn-mini {
  background: #fff;
  color: oklch(0.47 0.17 256);
}
[data-theme="dark"] .plan-card.is-pro {
  background: linear-gradient(155deg, oklch(0.7 0.16 45), oklch(0.62 0.17 35));
  color: #fff;
}
[data-theme="dark"] .plan-card.is-pro .btn-mini {
  color: oklch(0.55 0.17 38);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  transition:
    transform 0.12s,
    box-shadow 0.15s,
    background 0.15s,
    filter 0.15s;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  filter: brightness(1.06);
}
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover {
  background: var(--surface-2);
}
.btn-soft {
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.btn-soft:hover {
  filter: brightness(0.98);
}
.btn-danger {
  background: var(--atrasado);
  color: #fff;
  box-shadow: 0 8px 22px oklch(0.6 0.19 26 / 0.3);
}
.btn-danger:hover {
  filter: brightness(1.06);
}
.btn-lg {
  padding: 15px 26px;
  font-size: 16px;
}
.btn-block {
  width: 100%;
}
.ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Icon action buttons ===== */
.iconbtn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s;
}
.iconbtn:hover {
  background: var(--surface-3);
  color: var(--ink);
}
.iconbtn.danger:hover {
  background: var(--atrasado-soft);
  color: var(--atrasado);
  border-color: color-mix(in oklch, var(--atrasado) 35%, var(--border));
}
.iconbtn svg {
  width: 18px;
  height: 18px;
}

/* row-level inline action (table / mobile cards) */
.row-actions {
  display: inline-flex;
  gap: 4px;
  justify-content: flex-end;
}
.row-action {
  opacity: 0;
  transition: opacity 0.12s;
  color: var(--ink-faint);
  padding: 4px;
  border-radius: 8px;
}
tr:hover .row-action {
  opacity: 1;
}
.row-action:hover {
  background: var(--surface-3);
  color: var(--atrasado);
}
.row-action.edit:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 2px 16px;
}
.section-head h2 {
  font-size: 20px;
}
.section-head .sub {
  color: var(--ink-faint);
  font-size: 13.5px;
  font-weight: 500;
}
.section-head .grow {
  flex: 1;
}

/* ===== Vault (cofre) cards ===== */
.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}
.vault {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.16s,
    box-shadow 0.16s,
    border-color 0.16s;
}
.vault:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(
    in oklch,
    var(--vhue, var(--primary)) 40%,
    var(--border)
  );
}
.vault::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--vhue, var(--primary));
}
.vault-top {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 18px;
}
.vault-emoji {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: color-mix(
    in oklch,
    var(--vhue, var(--primary)) 14%,
    var(--surface)
  );
}
.vault-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}
.vault-meta {
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 500;
}
.vault-amounts {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* progress bar */
.pbar {
  height: 9px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.pbar > i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--vhue, var(--primary));
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pbar.success > i {
  background: var(--pago);
}
.pcap {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-faint);
}
.pcap b {
  color: var(--ink);
}

.vault.add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 196px;
  border-style: dashed;
  color: var(--ink-faint);
  background: transparent;
  text-align: center;
}
.vault.add:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: none;
}
.vault.add .plus {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
}
.vault.add.locked {
  cursor: pointer;
}
.vault.add .lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ===== Tags ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.tag .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.tag-choose .tag {
  cursor: pointer;
  border: 1.5px solid transparent;
  opacity: 0.65;
  transition:
    opacity 0.12s,
    transform 0.12s;
}
.tag-choose .tag.sel {
  opacity: 1;
  transform: scale(1.04);
  box-shadow: 0 0 0 2px currentColor;
}

/* ===== Debt table ===== */
.month-group {
  margin-bottom: 26px;
}
.month-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 4px 11px;
}
.month-head h3 {
  font-size: 16px;
  text-transform: capitalize;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table.debts {
  width: 100%;
  border-collapse: collapse;
}
table.debts thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
table.debts tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
  vertical-align: middle;
}
table.debts tbody tr:last-child td {
  border-bottom: none;
}
table.debts tbody tr {
  transition: background 0.12s;
}
table.debts tbody tr:hover {
  background: var(--surface-2);
}
.debt-desc {
  font-weight: 600;
}
.debt-sub {
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 500;
}
.debt-val {
  font-weight: 700;
}
.parc-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
}

/* card-style debt rows for mobile */
.debt-cards {
  display: none;
  flex-direction: column;
  gap: 10px;
}
.debt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.debt-card .dc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.debt-card .dc-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== Modal form fields ===== */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field > label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}
.input,
.select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--surface);
}
.input::placeholder {
  color: var(--ink-faint);
}
.field-row {
  display: flex;
  gap: 12px;
}
.field-row > .field {
  flex: 1;
}

/* hue picker (ProjectModal + TagModal) */
.hue-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.hue-pick button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  transition: transform 0.12s;
}
.hue-pick button.sel {
  transform: scale(1.15);
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px currentColor;
}

/* segmented control (DashboardInner + DebtModal) */
.seg {
  display: flex;
  gap: 6px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.seg button {
  flex: 1;
  padding: 9px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink-faint);
  transition: all 0.12s;
}
.seg button.sel {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ===== Tag manager (TagsPage) ===== */
.tag-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tag-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.tag-row .swatch {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex-shrink: 0;
}
.tag-row .tname {
  font-weight: 700;
  font-size: 15px;
}
.tag-row .tmeta {
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 500;
}
.tag-row .tamt {
  margin-left: auto;
  text-align: right;
}
.tag-row .tamt b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}
.tag-row .tamt small {
  display: block;
  color: var(--ink-faint);
  font-size: 11.5px;
  font-weight: 600;
}

/* ===== Paywall shared (PaywallModal + DashboardPage) ===== */
.lock-badge {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  margin: 0 auto 16px;
  background: linear-gradient(150deg, var(--primary), var(--primary-strong));
  display: grid;
  place-items: center;
  color: var(--on-primary);
  box-shadow: var(--shadow-glow);
}
.price-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 18px;
}
.price-line .amt {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 40px;
  letter-spacing: -0.04em;
}
.price-line .per {
  color: var(--ink-faint);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
}
.empty-state .em {
  font-size: 54px;
  margin-bottom: 14px;
}
.empty-state h2 {
  font-size: 24px;
  margin-bottom: 8px;
}
.empty-state p {
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 420px;
  margin: 0 auto 22px;
  line-height: 1.5;
}

/* ===== Blazor loading ===== */
#blazor-error-ui {
  color-scheme: light only;
  background: lightyellow;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}
#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

.loading-progress {
  position: absolute;
  display: block;
  width: 8rem;
  height: 8rem;
  inset: 20vh 0 auto 0;
  margin: 0 auto;
}
.loading-progress circle {
  fill: none;
  stroke: #e0e0e0;
  stroke-width: 0.6rem;
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
}
.loading-progress circle:last-child {
  stroke: var(--primary, #1b6ec2);
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
  transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
  position: absolute;
  text-align: center;
  font-weight: bold;
  inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}
.loading-progress-text:after {
  content: var(--blazor-load-percentage-text, "Carregando");
}

/* ===== Modal Shell ===== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: oklch(0.2 0.03 262 / 0.5);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: modal-fade 0.18s ease;
}

@keyframes modal-fade {
  from {
    opacity: 0;
  }
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
  animation: modal-pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 24px 4px;
}

.modal-head h2 {
  font-size: 21px;
  flex: 1;
}

.modal-head .x {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--ink-faint);
}

.modal-head .x:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.modal-body {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== Responsive ===== */
@media (max-width: 880px) {
  table.debts {
    display: none;
  }
  .debt-cards {
    display: flex;
  }
  .vault-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   AUTH
   ============================================================ */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background:
    radial-gradient(900px 600px at 75% 110%, var(--bg-grad), transparent 60%),
    var(--bg);
}
.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(
    160deg,
    var(--primary) 0%,
    var(--primary-strong) 100%
  );
  color: var(--on-primary);
}
.auth-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, oklch(1 0 0 / 0.14), transparent 70%);
}
.auth-hero .brand-name {
  color: var(--on-primary);
  font-size: 26px;
}
.auth-hero .brand-name span {
  color: oklch(1 0 0 / 0.7);
}
.auth-hero .brand-mark {
  background: oklch(1 0 0 / 0.16);
  box-shadow: none;
}
.auth-pitch {
  max-width: 460px;
}
.auth-pitch h1 {
  font-size: 44px;
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--on-primary);
}
.auth-pitch p {
  font-size: 17px;
  line-height: 1.5;
  opacity: 0.92;
  color: var(--on-primary);
}
.auth-feats {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.auth-feat {
  display: flex;
  align-items: center;
  gap: 13px;
  font-weight: 600;
  font-size: 15px;
  color: var(--on-primary);
}
.auth-feat .fi {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: oklch(1 0 0 / 0.16);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
}
.auth-card .mobile-brand-row {
  display: none;
}
.auth-card h2 {
  font-size: 28px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.auth-card .lede {
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: 26px;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 15.5px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition:
    background 0.14s,
    box-shadow 0.14s,
    transform 0.12s;
}
.btn-google:hover {
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
}
.btn-google:active {
  transform: translateY(1px);
}
.btn-google .gicon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 600;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-foot {
  margin-top: 26px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 12.5px;
  line-height: 1.6;
}
.auth-foot a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.auth-foot a:hover {
  text-decoration: underline;
}
.auth-secure {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.auth-toggle {
  text-align: center;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}
.auth-toggle b {
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
}
.auth-toggle b:hover {
  text-decoration: underline;
}

.form-error {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--atrasado);
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.verify-badge {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 26px;
  margin: 4px 0 22px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
}
.verify-badge::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 32px;
  border: 2px solid var(--primary);
  opacity: 0.25;
  animation: vpulse 2.2s ease-out infinite;
}
@keyframes vpulse {
  0% {
    transform: scale(0.92);
    opacity: 0.35;
  }
  70% {
    transform: scale(1.12);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.verify-badge .vb-dot {
  position: absolute;
  right: -4px;
  top: -4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--pago);
  color: #fff;
  display: grid;
  place-items: center;
  border: 3px solid var(--surface);
}
.verify-mail {
  padding: 13px 15px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 4px 0 6px;
}
.verify-mail .vm-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.verify-mail .vm-em {
  font-weight: 700;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.verify-mail .vm-lb {
  font-size: 11.5px;
  color: var(--ink-faint);
  font-weight: 600;
}
.verify-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 18px 0 22px;
}
.verify-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--ink-soft);
  font-weight: 500;
  line-height: 1.45;
}
.verify-step .vs-n {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--ink-soft);
  font-weight: 800;
  font-size: 12.5px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.verify-sent {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--r-sm);
  background: var(--pago-soft);
  color: var(--pago);
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 12px;
}
.verify-resend {
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 600;
}

/* Google account chooser */
.gchooser {
  max-width: 400px;
}
.gchooser-head {
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.gchooser-head .gicon {
  width: 22px;
  height: 22px;
}
.gchooser-head .ttl {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-soft);
}
.gchooser-body {
  padding: 10px 0;
}
.gchooser-sub {
  padding: 8px 24px 14px;
  color: var(--ink-soft);
  font-size: 14px;
}
.gacc {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  cursor: pointer;
  transition: background 0.12s;
  width: 100%;
  text-align: left;
}
.gacc:hover {
  background: var(--surface-2);
}
.gacc .av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.gacc .nm {
  font-weight: 600;
  font-size: 14.5px;
}
.gacc .em {
  color: var(--ink-faint);
  font-size: 13px;
}
.gacc.add .av {
  background: var(--surface-3);
  color: var(--ink-soft);
}

@media (max-width: 880px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-hero {
    display: none;
  }
  .auth-card .mobile-brand-row {
    display: flex;
    align-items: center;
    gap: 11px;
    justify-content: center;
    margin-bottom: 28px;
  }
  .auth-panel {
    padding: 32px 22px calc(32px + env(safe-area-inset-bottom));
  }
  .auth-pitch h1 {
    font-size: 34px;
  }
}

/* ============================================================
   ONBOARDING
   ============================================================ */
.onboard {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(800px 500px at 50% -10%, var(--bg-grad), transparent 60%),
    var(--bg);
}
.onboard-card {
  width: 100%;
  max-width: 470px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 34px 34px 30px;
  animation: obrise 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.05) both;
}
@keyframes obrise {
  from {
    transform: translateY(14px);
  }
}
.onboard-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 22px;
}
.onboard-step {
  text-align: center;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.onboard-hero {
  text-align: center;
  margin-bottom: 26px;
}
.onboard-av {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  box-shadow: var(--shadow-md);
  transition: background 0.3s;
}
.onboard-hero h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.onboard-hero p {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
  max-width: 360px;
  margin: 0 auto;
}
.onboard-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 14px;
}
.input-prefix {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  overflow: hidden;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.input-prefix:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--surface);
}
.input-prefix .pfx {
  padding: 12px 12px 12px 14px;
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 15px;
  border-right: 1.5px solid var(--border);
  background: var(--surface-3);
  white-space: nowrap;
}
.input-prefix input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  outline: none;
  min-width: 0;
  font-family: var(--font-ui);
}
.field-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
}

/* ============================================================
   SETTINGS / ACCOUNT
   ============================================================ */
.sub-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.sub-head > div {
  min-width: 0;
  flex: 1;
}
.sub-head .back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  flex-shrink: 0;
}
.sub-head .back:hover {
  background: var(--surface-2);
}
.sub-head h1 {
  font-size: 24px;
}
.sub-head .sub {
  color: var(--ink-faint);
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.settings-group {
  margin-bottom: 22px;
}
.settings-group > .gl {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin: 0 4px 10px;
}
.settings-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.srow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-soft);
  width: 100%;
  text-align: left;
  transition: background 0.12s;
}
.srow:last-child {
  border-bottom: none;
}
.srow.tap {
  cursor: pointer;
}
.srow.tap:hover {
  background: var(--surface-2);
}
.srow .si {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.srow .si.warn {
  background: var(--atrasado-soft);
  color: var(--atrasado);
}
.srow .si.muted {
  background: var(--surface-3);
  color: var(--ink-soft);
}
.srow .stxt {
  flex: 1;
  min-width: 0;
}
.srow .stitle {
  font-weight: 700;
  font-size: 15px;
}
.srow .sdesc {
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 500;
  margin-top: 1px;
}
.srow .sval {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
}
.srow .chev {
  color: var(--ink-faint);
  flex-shrink: 0;
}

.switch {
  position: relative;
  width: 46px;
  height: 27px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.switch .track {
  position: absolute;
  inset: 0;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  transition: background 0.2s;
  cursor: pointer;
}
.switch .track::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}
.switch input:checked + .track {
  background: var(--primary);
}
.switch input:checked + .track::before {
  transform: translateX(19px);
}

.paycard {
  position: relative;
  border-radius: var(--r-lg);
  padding: 20px;
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 1.7;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.paycard.visa {
  background: linear-gradient(
    135deg,
    oklch(0.5 0.13 256),
    oklch(0.38 0.12 262)
  );
}
.paycard.master {
  background: linear-gradient(135deg, oklch(0.55 0.13 28), oklch(0.4 0.13 35));
}
.paycard .pc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.paycard .chip {
  width: 40px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, oklch(0.85 0.08 90), oklch(0.7 0.1 80));
}
.paycard .brand-lbl {
  font-weight: 800;
  font-style: italic;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.paycard .pc-num {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 2px;
  font-weight: 600;
}
.paycard .pc-bot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 12.5px;
}
.paycard .pc-bot .lbl {
  opacity: 0.7;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.pay-default {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: oklch(1 0 0 / 0.2);
  font-size: 11px;
  font-weight: 700;
}

.danger-zone {
  border: 1.5px solid color-mix(in oklch, var(--atrasado) 30%, var(--border));
  border-radius: var(--r-lg);
  padding: 18px 20px;
  background: var(--surface);
}
.danger-zone h4 {
  color: var(--atrasado);
  font-size: 15px;
  margin-bottom: 4px;
}
.danger-zone p {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 14px;
}

.policy {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}
.policy .updated {
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}
.policy h3 {
  font-size: 17px;
  margin: 22px 0 8px;
}
.policy h3:first-of-type {
  margin-top: 0;
}
.policy p {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 10px;
}
.policy ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 10px 0;
}
.policy li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.5;
}
.policy li .li-ck {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.policy b {
  color: var(--ink);
}
.bp-trap { position: absolute; opacity: 0; height: 0; overflow: hidden; pointer-events: none; }
