@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ── Design tokens ────────────────────────────────────── */
:root {
  --crema:       #F7F3EE;
  --arena:       #DDD2C3;
  --salvia:      #A8BBA0;
  --salvia-light:#EDF2EB;
  --terra:       #C98F7A;
  --terra-light: #FAF0EC;
  --grafito:     #5F5B57;
  --muted:       #9E9A96;
  --white:       #FFFFFF;
  --danger:      #D32F2F;
  --danger-light:#FDECEC;
  --success:     #5F7F59;
  --success-light:#EAF2E8;

  --radius-sm:   10px;
  --radius-md:   14px;
  --radius-lg:   18px;
  --radius-xl:   24px;

  --shadow-card: 0 4px 20px rgba(95,91,87,0.10);
  --shadow-btn:  0 4px 16px rgba(168,187,160,0.40);

  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --nido-visual-viewport-height: 100dvh;
  --nido-visual-viewport-top: 0px;
  --nido-keyboard-overlay-inset: 0px;
  --nido-keyboard-height: 0px;
  --nido-keyboard-fallback-inset: 0px;
}

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

html, body {
  height: 100%;
  font-family: 'Poppins', sans-serif;
  background: var(--crema);
  color: var(--grafito);
  -webkit-font-smoothing: antialiased;
}

/* El host de Blazor incluye este panel fuera de AppRoot. Nido presenta los
   errores mediante AppErrorBoundary y su pantalla genérica, por lo que el
   panel predeterminado no debe aparecer al final de ninguna página. */
#blazor-error-ui {
  display: none !important;
}

/* ── Safe area / MAUI shell ───────────────────────────── */
.page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

input, textarea, select, [contenteditable="true"] {
  scroll-margin-block: 22px;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 20px; border-radius: var(--radius-md); border: none;
  font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
.btn:active { opacity: 0.85; }
.btn-primary { background: var(--salvia); color: var(--white); box-shadow: var(--shadow-btn); }
.btn-secondary { background: var(--white); color: var(--grafito); border: 1px solid var(--arena); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--arena); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-full { width: 100%; }

/* ── Card ─────────────────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); overflow: hidden;
}

/* ── Input ────────────────────────────────────────────── */
.input {
  width: 100%; padding: 12px 16px;
  background: var(--crema); border: 1.5px solid var(--arena);
  border-radius: var(--radius-md); outline: none;
  font-family: 'Poppins', sans-serif; font-size: 14px; color: var(--grafito);
  transition: border-color 0.2s;
}
.input:focus { border-color: var(--salvia); }
.input::placeholder { color: var(--muted); }
.input.input-invalid { border-color: var(--danger); }
.input.input-invalid:focus { box-shadow: 0 0 0 2px var(--danger-light); }

/* ── Bottom nav ───────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--crema);
}

.app-shell.with-bottom-nav {
  padding-bottom: calc(84px + var(--safe-area-bottom));
}

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white); border-top: 1px solid var(--arena);
  display: flex; align-items: center; justify-content: space-around;
  min-height: 72px;
  padding: 10px 8px max(14px, calc(10px + var(--safe-area-bottom)));
  z-index: 100;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 64px; min-height: 50px;
  justify-content: center;
  background: none; border: none; cursor: pointer; padding: 4px 10px;
  font-family: 'Poppins', sans-serif;
}
.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.nav-item.active .nav-icon {
  color: var(--salvia);
}
.nav-item .nav-label { font-size: 9.5px; font-weight: 400; color: var(--muted); }
.nav-item.active .nav-label { font-weight: 600; color: var(--salvia); }
.nav-dot { width: 18px; height: 2.5px; border-radius: 2px; background: var(--salvia); margin-top: 1px; }
.app-fab {
  position: fixed;
  right: 22px;
  bottom: calc(88px + var(--safe-area-bottom));
  z-index: 101;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 18px;
  background: var(--terra);
  color: var(--white);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(201,143,122,0.38);
  cursor: pointer;
}

/* ── Page headers ─────────────────────────────────────── */
.page-header {
  background: var(--white); padding: 52px 22px 14px;
  border-bottom: 1px solid var(--arena);
}
.page-header-salvia { background: var(--salvia); padding: 52px 22px 24px; }

/* ── Auth / Login ─────────────────────────────────────── */
.login-page {
  height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  background: var(--crema);
}
.login-header {
  background: var(--salvia); flex: 0 0 220px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; padding: 48px 24px 30px;
}
.login-logo { font-size: 48px; font-weight: 700; color: var(--white); letter-spacing: -2px; }
.login-tagline { font-size: 13px; color: rgba(255,255,255,0.80); margin-top: 6px; }
.login-brand-logo {
  width: min(280px, 76vw);
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.login-body {
  flex: 1; padding: 32px 24px 40px;
  display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
  scroll-padding-block: 24px;
}

body.nido-keyboard-open .login-header {
  flex-basis: 96px;
  justify-content: center;
  padding: 16px 24px 12px;
}

body.nido-mobile-form-focus .login-header {
  flex-basis: 96px;
  justify-content: center;
  padding: 16px 24px 12px;
}

body.nido-keyboard-open .login-brand-logo,
body.nido-mobile-form-focus .login-brand-logo {
  width: min(176px, 55vw);
}

body.nido-keyboard-open .login-body {
  padding-bottom: calc(32px + var(--nido-keyboard-overlay-inset));
  scroll-padding-bottom: calc(28px + var(--nido-keyboard-overlay-inset));
}

body.nido-mobile-form-focus .login-body {
  padding-bottom: calc(40px + min(42vh, 360px));
  scroll-padding-bottom: calc(32px + min(42vh, 360px));
}

body.nido-mobile-form-focus::after {
  content: '';
  display: block;
  width: 1px;
  height: min(42vh, 360px);
  pointer-events: none;
}
.social-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius-md); border: 1.5px solid var(--arena);
  background: var(--white); font-family: 'Poppins', sans-serif; font-size: 14px;
  font-weight: 500; color: var(--grafito); cursor: pointer; transition: background 0.15s;
  width: 100%;
}
.social-btn:active { background: var(--crema); }
.social-btn .social-icon { width: 22px; height: 22px; flex-shrink: 0; }
.divider {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; color: var(--muted); margin: 4px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--arena);
}
.app-error {
  background: var(--danger-light); border: 1px solid var(--danger);
  border-radius: var(--radius-md); padding: 12px 16px;
  font-size: 13px; color: var(--danger); line-height: 1.45;
  white-space: pre-line;
}
.app-error-page {
  margin: 0 22px 12px;
}

/* ── Full-screen unexpected error ────────────────────── */
.fatal-error-screen {
  position: absolute;
  inset: 0;
  z-index: 1000;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 16%, rgba(168,187,160,0.18), transparent 34%),
    var(--crema);
  padding: max(28px, env(safe-area-inset-top, 0px)) 24px
           max(22px, env(safe-area-inset-bottom, 0px));
}
.fatal-error-main {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 0 24px;
}
.fatal-error-content {
  width: min(100%, 410px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.fatal-error-icon {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 28px;
  color: var(--terra);
  background: var(--terra-light);
  box-shadow: 0 10px 30px rgba(201,143,122,0.20);
}
.fatal-error-icon svg {
  width: 52px;
  height: 52px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.fatal-error-icon-dot {
  fill: currentColor;
  stroke: none;
}
.fatal-error-content h1 {
  max-width: 360px;
  color: var(--grafito);
  font-size: clamp(21px, 5.4vw, 25px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
.fatal-error-description {
  max-width: 380px;
  margin-top: 14px;
  color: var(--grafito);
  font-size: 13px;
  line-height: 1.7;
}
.fatal-error-report {
  width: 100%;
  margin-top: 30px;
  padding: 16px;
  text-align: left;
  background: rgba(255,255,255,0.82);
  border: 1px solid var(--arena);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.fatal-error-report-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fatal-error-report-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fatal-error-report code {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  color: var(--grafito);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  user-select: all;
}
.fatal-error-copy {
  flex: 0 0 auto;
  min-width: 88px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--salvia-light);
  color: var(--success);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.fatal-error-copy:active { opacity: 0.78; }
.fatal-error-copy svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fatal-error-copy-failed {
  display: block;
  margin-top: 8px;
  color: var(--danger);
  font-size: 10px;
}
.fatal-error-actions {
  width: min(100%, 410px);
  flex: 0 0 auto;
  margin: 0 auto;
  padding-top: 16px;
}
.fatal-error-acknowledge {
  width: 100%;
  min-height: 50px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--salvia);
  color: var(--white);
  box-shadow: var(--shadow-btn);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.fatal-error-acknowledge:active {
  opacity: 0.85;
  transform: scale(0.99);
}
.fatal-error-version {
  flex: 0 0 auto;
  padding-top: 12px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

@media (max-height: 620px) {
  .fatal-error-main { align-items: flex-start; padding-top: 12px; }
  .fatal-error-icon { width: 68px; height: 68px; margin-bottom: 18px; border-radius: 22px; }
  .fatal-error-icon svg { width: 42px; height: 42px; }
  .fatal-error-report { margin-top: 20px; }
}
.login-body > .login-error {
  position: sticky;
  top: 0;
  z-index: 2;
}
.email-form {
  display: flex; flex-direction: column; gap: 10px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.05em; }
.form-field > .field-error {
  color: var(--danger);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.invite-toggle {
  display: flex; align-items: center; gap: 6px; background: none; border: none;
  font-family: 'Poppins', sans-serif; font-size: 12px; color: var(--salvia);
  cursor: pointer; padding: 2px 0; align-self: flex-start;
}
.email-back-btn {
  border: none;
  background: transparent;
  color: var(--salvia);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-start;
  padding: 2px 0;
}
.email-step-header {
  background: var(--salvia-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.email-step-header strong {
  display: block;
  color: var(--grafito);
  font-size: 14px;
  margin-bottom: 3px;
}
.email-step-header span {
  color: var(--muted);
  font-size: 11px;
}
.form-hint {
  font-size: 10px; color: var(--muted); text-align: center; line-height: 1.5; margin-top: 2px;
}
.login-version {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

/* ── Chat IA ──────────────────────────────────────────── */
.chat-page {
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; background: var(--crema);
}
.chat-header {
  background: var(--white); padding: 52px 22px 16px;
  border-bottom: 1px solid var(--arena);
  display: flex; align-items: center; gap: 12px;
}
.chat-avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--salvia); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.bubble {
  max-width: 75%; padding: 10px 14px;
  font-size: 13px; line-height: 1.5;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.bubble-ai {
  background: var(--white); color: var(--grafito);
  border-radius: 16px 16px 16px 4px;
  align-self: flex-start;
}
.bubble-user {
  background: var(--salvia); color: var(--white);
  border-radius: 16px 16px 4px 16px;
  align-self: flex-end;
}
.bubble-row { display: flex; align-items: flex-end; gap: 8px; }
.bubble-row.user { justify-content: flex-end; }
.bubble-row.ai { justify-content: flex-start; }
.bubble-ai-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--salvia); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.suggestions { margin-top: 4px; }
.suggestions-label { font-size: 10px; color: var(--muted); margin-bottom: 8px; }
.suggestion-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.suggestion-chip {
  padding: 6px 12px; border-radius: 50px; border: 1px solid var(--arena);
  background: var(--white); font-family: 'Poppins', sans-serif;
  font-size: 11px; color: var(--grafito); cursor: pointer;
}
.chat-input-bar {
  padding: 12px 22px 104px; border-top: 1px solid var(--arena);
  background: var(--white); display: flex; gap: 10px; align-items: flex-end;
}
.chat-input {
  flex: 1; padding: 11px 14px;
  border-radius: 12px; border: 1px solid var(--arena);
  background: var(--crema); font-family: 'Poppins', sans-serif;
  font-size: 13px; color: var(--grafito); outline: none; resize: none;
}
.chat-send-btn {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--salvia); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(168,187,160,0.40); flex-shrink: 0;
}
.loading-dots { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.loading-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--salvia);
  animation: bounce 1.2s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
.nido-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(247,243,238,0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.nido-loading-contained {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 20px;
}

.nido-loading-panel {
  width: min(230px, 100%);
  padding: 20px 18px 18px;
  border: 1px solid rgba(221,210,195,0.82);
  border-radius: 8px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 12px 32px rgba(95,91,87,0.18);
  color: var(--grafito);
  text-align: center;
}

.nido-loading-contained .nido-loading-panel {
  width: min(200px, 100%);
  padding: 8px 12px 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.nido-loading-panel > strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.nido-loading-scene {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 10px;
}

.nido-loading-contained .nido-loading-scene {
  width: 92px;
  height: 92px;
  margin-bottom: 6px;
}

.nido-loading-scene img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  transform: translate(-50%, -50%);
  animation: nido-loader-breathe 1.8s ease-in-out infinite;
}

.nido-loading-contained .nido-loading-scene img {
  width: 56px;
  height: 56px;
  border-radius: 15px;
}

.nido-loader-orbit {
  position: absolute;
  border: 1px dashed rgba(168,187,160,0.42);
  border-radius: 50%;
  animation: nido-loader-orbit 3.4s linear infinite;
}

.nido-loader-orbit.orbit-one {
  inset: 2px;
}

.nido-loader-orbit.orbit-two {
  inset: 15px;
  border-color: rgba(201,143,122,0.32);
  animation-duration: 2.7s;
  animation-direction: reverse;
}

.nido-loader-bird {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 18px;
  height: 9px;
  transform: translateX(-50%);
}

.nido-loader-bird::before,
.nido-loader-bird::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 9px;
  height: 6px;
  border-top: 2px solid var(--terra);
  border-radius: 50%;
}

.nido-loader-bird::before {
  left: 0;
  transform: rotate(18deg);
}

.nido-loader-bird::after {
  right: 0;
  transform: rotate(-18deg);
}

.orbit-two .nido-loader-bird::before,
.orbit-two .nido-loader-bird::after {
  border-top-color: var(--success);
}

@keyframes nido-loader-orbit {
  to { transform: rotate(360deg); }
}

@keyframes nido-loader-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(0.96); }
  50% { transform: translate(-50%, -50%) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .nido-loader-orbit,
  .nido-loading-scene img {
    animation: none;
  }
}
.chat-thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
}
.chat-thinking-text {
  color: var(--text-muted);
  font-size: 0.84rem;
}
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

/* ── Utilities ────────────────────────────────────────── */
.text-muted   { color: var(--muted); }
.text-salvia  { color: var(--salvia); }
.text-terra   { color: var(--terra); }
.text-grafito { color: var(--grafito); }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.fs-10        { font-size: 10px; }
.fs-11        { font-size: 11px; }
.fs-12        { font-size: 12px; }
.fs-13        { font-size: 13px; }
.fs-14        { font-size: 14px; }
.mt-4         { margin-top: 4px; }
.mt-8         { margin-top: 8px; }
.mt-12        { margin-top: 12px; }
.mt-16        { margin-top: 16px; }

/* Transactions */
.transactions-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}

.transactions-header {
  background: var(--white);
  border-bottom: 1px solid var(--arena);
  padding: 52px 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.eyebrow {
  font-size: 12px;
  color: rgba(255,255,255,0.78);
}

.pill-btn,
.secondary-action,
.primary-action,
.close-btn {
  border: none;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
}

.pill-btn {
  background: rgba(255,255,255,0.2);
  color: var(--white);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-btn.subtle {
  background: rgba(255,255,255,0.12);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.transactions-summary {
  margin: 14px 22px 18px;
  background: var(--white);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
  box-shadow: var(--shadow-card);
}

.transactions-summary span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 4px;
}

.transactions-summary strong {
  color: var(--grafito);
  font-size: 14px;
  font-weight: 700;
}

.amount-income {
  color: var(--salvia) !important;
}

.amount-expense {
  color: var(--terra) !important;
}

.segmented {
  background: var(--white);
  border-radius: 14px;
  padding: 4px;
  display: flex;
  gap: 4px;
}

.segmented button {
  flex: 1;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 9px 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.segmented button.active {
  background: var(--salvia);
  color: var(--white);
}

.segmented button.active.expense {
  background: var(--terra);
}

.transactions-list {
  padding: 0 22px;
}

.transaction-group {
  margin-bottom: 18px;
}

.transaction-group h2 {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 9px;
}

.transaction-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
}

.transaction-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--crema);
  cursor: pointer;
}

.transaction-row:last-child {
  border-bottom: none;
}

.transaction-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 800;
}

.transaction-icon svg {
  display: block;
}

.transaction-main {
  min-width: 0;
  flex: 1;
}

.transaction-main strong {
  display: block;
  color: var(--grafito);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-main span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-amount {
  color: var(--grafito);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Movimientos: toolbar + filtros ───────────────────── */
.tx-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tx-groupby {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--muted);
}
.tx-switch {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--arena);
  position: relative;
  transition: background 0.2s;
}
.tx-groupby.on .tx-switch { background: var(--salvia); }
.tx-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--white);
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.tx-groupby.on .tx-knob { left: 18px; }
.tx-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  background: var(--crema);
  color: var(--grafito);
  padding: 7px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.tx-filter-btn.active {
  background: var(--salvia);
  color: var(--white);
}
.tx-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
}
.tx-chip {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: var(--crema);
  color: var(--muted);
  padding: 6px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.tx-chip.active {
  background: var(--grafito);
  color: var(--white);
}
.tx-filter-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 22px 0;
}
.tx-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--salvia-light);
  color: var(--salvia);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
}
.tx-tag button {
  border: none;
  background: none;
  color: var(--salvia);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.tx-clear-all {
  border: none;
  background: none;
  color: var(--terra);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

/* ── Movimientos: modal de filtros ────────────────────── */
.tx-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--crema);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--muted);
}
.tx-search-field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--grafito);
}
.list-search-field {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--arena);
  border-radius: 8px;
  background: var(--white);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}
.list-search-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--grafito);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
}
.list-search-field input::placeholder {
  color: var(--muted);
}
.list-search-field button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--crema);
  color: var(--grafito);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.list-search-block {
  padding: 12px 18px 0;
}
.tx-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.tx-filter-chip {
  border: 1px solid var(--arena);
  background: transparent;
  color: var(--grafito);
  border-radius: 999px;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  cursor: pointer;
}
.tx-filter-chip.selected {
  border-color: var(--chip-color, var(--salvia));
  background: var(--chip-color, var(--salvia-light));
  color: var(--filter-selected-color, var(--salvia));
  font-weight: 600;
}

/* ── Movimientos: detalle ─────────────────────────────── */
.tx-detail {
  position: fixed;
  inset: 0;
  z-index: 115;
  background: var(--crema);
  display: flex;
  flex-direction: column;
}
.tx-detail-header {
  background: var(--white);
  border-bottom: 1px solid var(--arena);
  padding: 52px 22px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tx-back {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--grafito);
}
.tx-detail-header > strong {
  color: var(--grafito);
  font-size: 15px;
  font-weight: 600;
}
.tx-detail-edit {
  border: none;
  background: var(--crema);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--grafito);
  cursor: pointer;
}
.tx-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 30px;
}
.tx-detail-hero {
  background: var(--white);
  border-radius: 20px;
  padding: 24px 20px;
  margin-bottom: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.tx-detail-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
}
.tx-detail-icon.income { background: var(--salvia-light); color: var(--salvia); }
.tx-detail-icon.expense { background: var(--terra-light); color: var(--terra); }
.tx-detail-hero > strong {
  font-size: 32px;
  font-weight: 700;
  color: var(--grafito);
}
.tx-detail-badge {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 500;
}
.tx-detail-badge.income { background: var(--salvia-light); color: var(--salvia); }
.tx-detail-badge.expense { background: var(--terra-light); color: var(--terra); }
.tx-detail-info {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
}
.tx-detail-info > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--crema);
}
.tx-detail-info > div:last-child { border-bottom: none; }
.tx-detail-info span { color: var(--muted); font-size: 12px; }
.tx-detail-info b { color: var(--grafito); font-size: 13px; font-weight: 500; text-align: right; }
.tx-detail-attachment {
  background: var(--white);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 22px;
}
.tx-detail-attachment > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.tx-attachment-empty {
  border: 1.5px dashed var(--arena);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.tx-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tx-detail-primary {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px;
  background: var(--salvia);
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
}
.tx-detail-delete {
  width: 100%;
  border: 1px solid #E53935;
  border-radius: 14px;
  padding: 14px;
  background: transparent;
  color: #E53935;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* ── Movimientos: confirmar eliminar ──────────────────── */
.tx-confirm {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.tx-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(95,91,87,0.45);
}
.tx-confirm-sheet {
  position: relative;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 24px 22px 36px;
}
.tx-confirm-sheet > strong { display: block; color: var(--grafito); font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.tx-confirm-sheet > p { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.tx-confirm-actions { display: flex; gap: 10px; }
.tx-confirm-cancel {
  flex: 1;
  border: 1px solid var(--arena);
  border-radius: 14px;
  padding: 13px;
  background: transparent;
  color: var(--grafito);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.tx-confirm-delete {
  flex: 1;
  border: none;
  border-radius: 14px;
  padding: 13px;
  background: #E53935;
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}


/* ── Transacción → registrar como fijo ────────────────── */
.tx-fixed-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--salvia-light);
  color: var(--salvia);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
}
.tx-fixed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.tx-fixed-chip {
  border-radius: 999px;
  background: var(--crema);
  color: var(--grafito);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
}
.tx-fixed-chip.income { background: var(--salvia-light); color: var(--salvia); }
.tx-fixed-chip.expense { background: var(--terra-light); color: var(--terra); }

/* ── Acceso a seguimiento (desde Categorías / Fijos) ──── */
.track-access-btn {
  margin: 0 22px 14px;
  width: calc(100% - 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 1px solid var(--arena);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--salvia);
}
.track-access-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--grafito);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
}

/* ── Dashboard: card de presupuesto ───────────────────── */
.dashboard-budget-card { cursor: pointer; }
.dashboard-link { color: var(--salvia); font-size: 12px; font-weight: 500; }
.dashboard-soon { color: var(--muted); font-size: 10px; font-weight: 600; }
.dashboard-soon-desc { color: var(--muted); font-size: 12px; line-height: 1.5; }
.budget-base-mini {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-radius: 12px;
  background: var(--crema);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.budget-base-mini span {
  color: var(--muted);
  font-size: 10px;
}
.budget-base-mini strong {
  color: var(--grafito);
  font-size: 14px;
  font-weight: 800;
}

/* ── Páginas de seguimiento ───────────────────────────── */
.track-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}
.track-hero {
  background: var(--salvia);
  color: var(--white);
  padding: 52px 22px 22px;
}
.track-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}
.track-hero h1 {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
  margin-top: 4px;
}
.track-total-card {
  margin: -12px 22px 18px;
  background: var(--white);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
}
.track-total-card > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.track-total-card > strong {
  display: block;
  color: var(--grafito);
  font-size: 26px;
  font-weight: 800;
  margin: 5px 0 8px;
}
.track-total-card > strong small {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.track-summary {
  margin: -12px 22px 18px;
  background: var(--white);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.track-summary span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
}
.track-summary strong {
  display: block;
  color: var(--grafito);
  font-size: 16px;
  font-weight: 800;
  margin-top: 3px;
}
.track-summary-divider {
  border-left: 1px solid var(--crema);
  padding-left: 14px;
}
.track-bar {
  background: var(--crema);
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}
.track-bar > div {
  height: 100%;
  border-radius: 10px;
}
.track-content {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.track-card {
  background: var(--white);
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
}
.track-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.track-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
}
.track-card-top strong {
  flex: 1;
  min-width: 0;
  color: var(--grafito);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-amount {
  font-size: 12px;
  font-weight: 700;
  color: var(--grafito);
  white-space: nowrap;
}
.track-amount.over { color: var(--terra); }
.track-status {
  display: block;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--muted);
}
.track-status.over { color: var(--terra); }
.track-chip {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.track-chip.paid { background: var(--salvia-light); color: var(--salvia); }
.track-chip.pending { background: var(--terra-light); color: var(--terra); }
.track-executed {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

/* 50/30/20 budget */
.budget-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 90px;
  position: relative;
}
.budget-hero {
  background: var(--salvia);
  color: var(--white);
  padding: 52px 22px 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.budget-hero h1 {
  color: var(--white);
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
  margin-top: 4px;
}
.budget-adjust-btn {
  border: none;
  border-radius: 999px;
  background: var(--white);
  color: var(--salvia);
  padding: 10px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.budget-base-card {
  margin: -12px 22px 18px;
  background: var(--white);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
}
.budget-base-card span,
.budget-base-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.budget-base-card strong {
  display: block;
  color: var(--grafito);
  font-size: 28px;
  font-weight: 800;
  margin: 5px 0 2px;
}
.budget-content {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.budget-bucket-card {
  background: var(--white);
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
}
.budget-bucket-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.budget-bucket-top > div {
  min-width: 0;
}
.budget-bucket-top strong {
  display: block;
  color: var(--grafito);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.budget-bucket-top strong small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.budget-bucket-top span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}
.budget-bucket-top b {
  color: var(--grafito);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  text-align: right;
}
.budget-bucket-top b.over { color: var(--terra); }
.budget-bucket-top b small {
  color: var(--muted);
  font-weight: 600;
}
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  background: rgba(95,91,87,0.34);
}
.bottom-sheet {
  width: 100%;
  max-height: 88vh;
  max-height: min(88dvh, calc(var(--nido-visual-viewport-height) - 12px));
  overflow-y: auto;
  background: var(--white);
  border-radius: 22px 22px 0 0;
  padding: 10px 22px 24px;
  box-shadow: 0 -12px 40px rgba(0,0,0,0.18);
  overscroll-behavior: contain;
  scroll-padding-block: 24px;
}
.sheet-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.sheet-title-row h2 {
  color: var(--grafito);
  font-size: 17px;
  font-weight: 700;
}
.sheet-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 12px;
  background: var(--crema);
  color: var(--grafito);
  display: grid;
  place-items: center;
}
.budget-percent-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.budget-percent-row,
.budget-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.budget-percent-row > span:first-child,
.budget-total-row > span {
  color: var(--grafito);
  font-size: 13px;
  font-weight: 600;
}
.budget-percent-row > span:last-child {
  display: flex;
  align-items: center;
  gap: 6px;
}
.budget-percent-row input {
  width: 64px;
  text-align: right;
  margin: 0;
}
.budget-percent-row small {
  color: var(--muted);
  font-size: 13px;
}
.budget-total-row {
  padding: 8px 2px;
}
.budget-total-row strong {
  color: var(--salvia);
  font-size: 13px;
  font-weight: 800;
}
.budget-total-row strong.over {
  color: var(--terra);
}
.budget-total-row small {
  display: block;
  font-size: 10px;
  font-weight: 600;
}

.empty-state {
  background: var(--white);
  border-radius: 16px;
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.empty-state strong {
  color: var(--grafito);
  font-size: 15px;
}

.transaction-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--arena);
  padding: 12px 22px 28px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  z-index: 20;
}

.secondary-action,
.primary-action {
  border-radius: 14px;
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
}

.secondary-action {
  background: var(--salvia-light);
  color: var(--salvia);
}

.primary-action {
  background: var(--terra);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(201,143,122,0.35);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(95,91,87,0.42);
  z-index: 110;
  display: flex;
  align-items: flex-end;
}

.transaction-sheet {
  width: 100%;
  max-height: 90vh;
  max-height: min(90dvh, calc(var(--nido-visual-viewport-height) - 12px));
  overflow-y: auto;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 12px 22px 30px;
  overscroll-behavior: contain;
  scroll-padding-block: 24px;
}

.modal-form-sheet {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  padding: 12px 0 0;
}

.modal-form-sheet > .sheet-handle {
  flex-shrink: 0;
}

.modal-form-sheet > .sheet-header,
.modal-form-sheet > .sheet-title-row {
  flex-shrink: 0;
  padding-inline: 22px;
}

.sheet-scroll-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 22px 24px;
  scroll-padding-block: 24px;
}

.sheet-actions {
  flex: 0 0 auto;
  padding: 12px 22px max(16px, calc(12px + var(--safe-area-bottom)));
  background: var(--white);
  border-top: 1px solid var(--arena);
  box-shadow: 0 -8px 24px rgba(95,91,87,0.08);
  z-index: 5;
}

.sheet-actions .save-transaction {
  margin-top: 0;
}

.sheet-actions .save-preferences-btn {
  width: 100%;
  margin-top: 0;
}

body.nido-keyboard-open .bottom-sheet,
body.nido-keyboard-open .transaction-sheet {
  max-height: calc(var(--nido-visual-viewport-height) - 8px);
  scroll-padding-bottom: calc(28px + var(--nido-keyboard-overlay-inset));
}

body.nido-mobile-form-focus .bottom-sheet,
body.nido-mobile-form-focus .transaction-sheet {
  padding-bottom: calc(30px + min(42vh, 360px));
  scroll-padding-bottom: calc(28px + min(42vh, 360px));
}

body.nido-mobile-form-focus .transaction-sheet.modal-form-sheet {
  padding-bottom: 0;
  scroll-padding-bottom: 0;
}

body.nido-mobile-form-focus .bottom-sheet.modal-form-sheet {
  padding-bottom: 0;
  scroll-padding-bottom: 0;
}

body.nido-mobile-form-focus .modal-form-sheet .sheet-scroll-content {
  padding-bottom: 24px;
  scroll-padding-bottom: 24px;
}

/* El WebView puede mantener el layout viewport completo mientras el teclado
   cubre la zona inferior. En foco movil, ambos tipos de backdrop se limitan
   al viewport visual o a la reserva calculada por el manejador compartido. */
body.nido-mobile-form-focus .modal-backdrop,
body.nido-mobile-form-focus .sheet-backdrop {
  inset: auto 0 auto;
  top: var(--nido-visual-viewport-top);
  bottom: auto;
  height: max(240px, calc(
    var(--nido-visual-viewport-height) - var(--nido-keyboard-fallback-inset)
  ));
}

body.nido-mobile-form-focus .modal-form-sheet {
  max-height: max(232px, calc(
    var(--nido-visual-viewport-height) - var(--nido-keyboard-fallback-inset) - 8px
  ));
}

.sheet-handle {
  width: 38px;
  height: 4px;
  background: var(--arena);
  border-radius: 999px;
  margin: 0 auto 18px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.sheet-header h2 {
  color: var(--grafito);
  font-size: 18px;
  font-weight: 700;
}

.close-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--crema);
  color: var(--grafito);
  font-size: 22px;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 13px;
}

.form-field > span,
.inline-toggle span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.amount-input {
  font-size: 22px;
  font-weight: 700;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.option-chip {
  border: 1px solid var(--arena);
  background: var(--crema);
  color: var(--grafito);
  border-radius: 12px;
  padding: 10px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.option-chip svg {
  flex-shrink: 0;
}

.option-chip.selected {
  border-color: var(--chip-color);
  background: var(--chip-color);
  color: var(--white);
}

.category-picker-option {
  justify-content: flex-start;
  text-align: left;
  background: var(--white);
  border-color: var(--arena);
  padding: 9px 10px;
  min-height: 54px;
}

.category-picker-option.selected {
  background: color-mix(in srgb, var(--chip-color) 18%, white);
  color: var(--grafito);
  box-shadow: inset 4px 0 0 var(--chip-color);
}

.category-picker-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.category-picker-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-toggle {
  background: var(--crema);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-toggle input {
  width: 22px;
  height: 22px;
  accent-color: var(--salvia);
}

.notes-input {
  min-height: 74px;
  resize: vertical;
}

.save-transaction {
  width: 100%;
  margin-top: 18px;
  border: none;
  border-radius: 14px;
  padding: 15px;
  background: var(--salvia);
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
}

.save-transaction:disabled {
  opacity: 0.65;
}

/* Dashboard */
.dashboard-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}

.dashboard-hero {
  background: var(--salvia);
  padding: 52px 22px 22px;
  color: var(--white);
}

.dashboard-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.dashboard-topline p {
  color: rgba(255,255,255,0.76);
  font-size: 13px;
  margin-bottom: 3px;
}

.dashboard-topline h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.dashboard-identity {
  flex: 1;
  min-width: 0;
}

.dashboard-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.dashboard-topline .projection-alert {
  display: flex;
  align-items: center;
  flex: 1 1 190px;
  gap: 7px;
  min-width: 140px;
  max-width: 250px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--white);
  color: var(--grafito);
  box-shadow: 0 3px 12px rgba(95,91,87,0.10);
}

.projection-alert > div {
  min-width: 0;
}

.projection-alert strong,
.projection-alert small {
  display: block;
  line-height: 1.25;
}

.projection-alert strong {
  margin-bottom: 1px;
  color: var(--grafito);
  font-size: 10px;
  font-weight: 700;
}

.projection-alert small {
  color: var(--muted);
  font-size: 9px;
}

.projection-alert small.is-positive {
  color: var(--success);
  font-weight: 600;
}

.projection-alert small.is-negative {
  color: var(--danger);
  font-weight: 600;
}

.projection-status-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
}

.projection-alert.is-stable .projection-status-dot {
  background: var(--success);
}

.projection-alert.is-stable strong {
  color: var(--success);
}

.projection-alert.is-caution .projection-status-dot,
.projection-alert.is-uncertain .projection-status-dot {
  background: var(--terra);
}

.projection-alert.is-caution strong,
.projection-alert.is-uncertain strong {
  color: var(--terra);
}

.projection-alert.is-at-risk .projection-status-dot {
  background: var(--danger);
}

.projection-alert.is-at-risk strong {
  color: var(--danger);
}

.hero-icon-btn {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: var(--white);
  color: var(--grafito);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.hero-icon-btn .hero-badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #E53935;
  border: 1.5px solid var(--salvia);
}

.balance-card {
  margin-top: 20px;
  background: var(--white);
  border-radius: 18px;
  padding: 18px 20px;
  color: var(--grafito);
  box-shadow: var(--shadow-card);
}

.balance-card > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.balance-card > strong {
  display: block;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

.balance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.balance-grid div {
  border-left: 2px solid var(--arena);
  padding-left: 8px;
}

.balance-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 3px;
}

.balance-grid b {
  color: var(--grafito);
  font-size: 13px;
}

.balance-budget-summary {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--arena);
}

.balance-budget-heading,
.balance-budget-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.balance-budget-heading {
  margin-bottom: 6px;
}

.balance-budget-heading > span:first-child {
  color: var(--grafito);
  font-size: 10px;
  font-weight: 600;
}

.budget-state {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.budget-state.is-within,
.budget-total-percent.is-within {
  background: var(--success-light);
  color: var(--success);
}

.budget-state.is-over,
.budget-total-percent.is-over {
  background: var(--danger-light);
  color: var(--danger);
}

.balance-budget-values {
  margin-bottom: 7px;
}

.balance-budget-values > div {
  min-width: 0;
}

.balance-budget-values strong {
  display: block;
  color: var(--grafito);
  font-size: 15px;
  line-height: 1.25;
}

.balance-budget-values small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.budget-total-percent {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-error {
  margin-top: 14px;
}

.dashboard-content {
  padding: 18px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.quick-actions button {
  border: none;
  background: var(--white);
  border-radius: 16px;
  padding: 13px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(95,91,87,0.06);
}

.quick-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--terra-light);
  color: var(--terra);
  font-weight: 800;
}

.quick-icon.muted {
  background: var(--crema);
  color: var(--grafito);
}

.quick-icon.ai {
  background: var(--salvia-light);
  color: var(--salvia);
}

.quick-actions strong {
  color: var(--grafito);
  font-size: 12px;
}

.quick-actions small {
  color: var(--muted);
  font-size: 9.5px;
  text-align: center;
}

.dashboard-card {
  background: var(--white);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 13px;
}

.card-title-row h2 {
  color: var(--grafito);
  font-size: 14px;
  font-weight: 700;
}

.card-title-row span,
.card-title-row button {
  border: none;
  background: transparent;
  color: var(--salvia);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.budget-row {
  margin-bottom: 12px;
}

.budget-row:last-child {
  margin-bottom: 0;
}

.budget-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

.budget-row span {
  color: var(--muted);
  font-size: 11px;
}

.budget-row b {
  color: var(--grafito);
  font-size: 11px;
  text-align: right;
}

.budget-row-values {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.budget-row .budget-percent {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--success-light);
  color: var(--success);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.budget-row .budget-percent.is-over {
  background: var(--danger-light);
  color: var(--danger);
}

.budget-track {
  height: 7px;
  border-radius: 999px;
  background: var(--crema);
  overflow: hidden;
}

.budget-track div {
  height: 100%;
  border-radius: inherit;
}

.dashboard-transaction {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--crema);
}

.dashboard-transaction:last-child {
  border-bottom: none;
}

.transaction-main .dashboard-tx-details {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-tx-details time {
  flex-shrink: 0;
}

.dashboard-tx-details i {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.mini-empty {
  background: var(--crema);
  color: var(--muted);
  border-radius: 12px;
  padding: 16px;
  font-size: 12px;
  text-align: center;
}

.muted-card {
  box-shadow: none;
}

.map-preview {
  height: 130px;
  border-radius: 14px;
  background:
    linear-gradient(90deg, transparent 33%, #fff 33%, #fff 36%, transparent 36%, transparent 66%, #fff 66%, #fff 68%, transparent 68%),
    linear-gradient(0deg, transparent 44%, #fff 44%, #fff 49%, transparent 49%, transparent 72%, #fff 72%, #fff 75%, transparent 75%),
    #EEF2E8;
  position: relative;
  overflow: hidden;
}

.map-preview i {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--terra);
  border: 2px solid var(--white);
}

.map-preview i:nth-child(1) { left: 20%; top: 25%; }
.map-preview i:nth-child(2) { left: 50%; top: 20%; background: var(--salvia); }
.map-preview i:nth-child(3) { left: 75%; top: 35%; }
.map-preview i:nth-child(4) { left: 35%; top: 62%; background: var(--salvia); }
.map-preview i:nth-child(5) { left: 66%; top: 58%; }

.map-stats {
  position: absolute;
  left: 12px;
  bottom: 10px;
  display: flex;
  gap: 6px;
}

.map-stats span {
  background: rgba(255,255,255,0.92);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--grafito);
  font-size: 10px;
  font-weight: 700;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.placeholder-grid div {
  background: var(--crema);
  border-radius: 13px;
  padding: 13px;
}

.placeholder-grid strong {
  display: block;
  color: var(--grafito);
  font-size: 13px;
  margin-bottom: 5px;
}

.placeholder-grid span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

/* Profile */
.profile-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}

.profile-hero {
  background: var(--salvia);
  color: var(--white);
  padding: 52px 22px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--white);
  color: var(--salvia);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}

.profile-hero h1 {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
}

.profile-hero p {
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  margin-top: 4px;
}

.profile-content {
  padding: 18px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-stats {
  margin-top: -32px;
  background: var(--white);
  border-radius: 16px;
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  box-shadow: var(--shadow-card);
}

.profile-stats div {
  border-left: 2px solid var(--arena);
  padding-left: 9px;
}

.profile-stats strong,
.profile-section span,
.profile-row span {
  display: block;
  color: var(--grafito);
  font-size: 13px;
  font-weight: 700;
}

.profile-stats span,
.profile-section small,
.profile-row small {
  color: var(--muted);
  font-size: 10px;
}

.profile-section,
.profile-debug {
  background: var(--white);
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-direction: column;
}

.profile-section button:not(.save-preferences-btn),
.profile-row {
  border: none;
  background: transparent;
  border-radius: 12px;
  padding: 13px 12px;
  text-align: left;
  font-family: 'Poppins', sans-serif;
}

.profile-section button:not(.save-preferences-btn) {
  cursor: pointer;
}

.profile-section button:not(.save-preferences-btn):active {
  background: var(--crema);
}

.profile-row.muted {
  opacity: 0.72;
}

.profile-debug {
  gap: 6px;
  padding: 14px 16px;
}

.profile-debug span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-debug code {
  color: var(--grafito);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.logout-btn {
  border: 1px solid var(--terra);
  border-radius: 14px;
  background: var(--terra-light);
  color: var(--terra);
  padding: 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.profile-family-card {
  background: var(--white);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
}

.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--crema);
}

.member-row:last-child {
  border-bottom: none;
}

.member-avatar {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--salvia-light);
  color: var(--salvia);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.member-row strong {
  display: block;
  color: var(--grafito);
  font-size: 13px;
  font-weight: 700;
}

.member-row span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.preferences-section {
  padding: 12px 14px 14px;
}

.save-preferences-btn {
  border: none;
  border-radius: 14px;
  background: var(--salvia);
  color: var(--white);
  padding: 13px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
}

.save-preferences-btn:disabled {
  opacity: 0.65;
}

.mock-profile {
  background: var(--crema);
}

.profile-mock-hero {
  background: var(--salvia);
  color: var(--white);
  padding: 70px 22px 36px;
}

.profile-id-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-mock-avatar {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: var(--white);
  color: var(--salvia);
  display: grid;
  place-items: center;
  font-size: 27px;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(95,91,87,0.15);
  flex-shrink: 0;
}

.profile-id-row h1 {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 25px;
  line-height: 1.08;
  font-weight: 800;
}

.profile-family-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: rgba(255,255,255,0.88);
  font-size: 13px;
  font-weight: 500;
}

.profile-family-name i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--terra);
  flex-shrink: 0;
}

.profile-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.profile-metric-grid div {
  background: rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 14px 6px;
  text-align: center;
}

.profile-metric-grid strong {
  display: block;
  color: var(--white);
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.profile-metric-grid span {
  display: block;
  color: rgba(255,255,255,0.78);
  font-size: 11px;
  margin-top: 6px;
}

.profile-menu-content {
  padding: 24px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-menu-card,
.profile-preferences-card {
  background: var(--white);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(95,91,87,0.04);
}

.profile-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px 20px;
  text-align: left;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
}

.profile-menu-item:active {
  background: var(--crema);
}

.profile-menu-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.profile-menu-icon.green {
  background: var(--salvia-light);
  color: var(--salvia);
}

.profile-menu-icon.peach {
  background: var(--terra-light);
  color: var(--terra);
}

.profile-menu-icon.gray {
  background: #f5f4f2;
  color: var(--muted);
}

.profile-menu-text {
  flex: 1;
  min-width: 0;
}

.profile-menu-text strong {
  display: block;
  color: var(--grafito);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.profile-menu-text small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 3px;
}

.profile-arrow {
  color: var(--arena);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.profile-menu-divider {
  height: 1px;
  background: var(--crema);
  margin-left: 86px;
}

.profile-badge {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--terra);
  color: var(--white);
  display: grid;
  place-items: center;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
}

.profile-preferences-card {
  padding: 4px 18px 18px;
}

.profile-nidoia-card {
  background: var(--white);
  border-radius: 24px;
  padding: 17px 20px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.04);
}

.profile-nidoia-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-nidoia-heading > div {
  flex: 1;
  min-width: 0;
}

.profile-nidoia-heading strong,
.profile-nidoia-heading small {
  display: block;
}

.profile-nidoia-heading strong {
  color: var(--grafito);
  font-size: 15px;
}

.profile-nidoia-heading small,
.profile-nidoia-card p {
  color: var(--muted);
  font-size: 12px;
}

.profile-nidoia-heading > span:last-child {
  color: var(--salvia);
  font-size: 13px;
  font-weight: 700;
}

.profile-nidoia-track {
  height: 7px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--salvia-light);
}

.profile-nidoia-track i {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: var(--salvia);
}

.profile-nidoia-card p {
  margin: 8px 0 0;
}

.profile-logout {
  margin-bottom: 10px;
}

/* Funds */
.funds-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}

.funds-hero {
  background: var(--salvia);
  color: var(--white);
  padding: 52px 22px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.fund-add-btn {
  border: none;
  border-radius: 999px;
  background: var(--white);
  color: var(--salvia);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.fund-add-btn span {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: var(--salvia-light);
  display: grid;
  place-items: center;
  line-height: 1;
}

.funds-hero h1 {
  font-size: 23px;
  line-height: 1.15;
  font-weight: 700;
  margin-top: 4px;
}

.funds-total-card {
  margin: -12px 22px 18px;
  background: var(--white);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

.funds-total-card span,
.funds-total-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.funds-total-card strong {
  display: block;
  color: var(--grafito);
  font-size: 31px;
  line-height: 1.1;
  font-weight: 800;
  margin: 5px 0 6px;
}

.funds-content {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Categorias ───────────────────────────────────────── */
.categories-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}
.categories-hero {
  background: var(--salvia);
  color: var(--white);
  padding: 52px 22px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.categories-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}
.categories-hero h1 {
  font-size: 23px;
  line-height: 1.15;
  font-weight: 700;
  margin-top: 4px;
}
.categories-add {
  border: none;
  border-radius: 999px;
  background: var(--white);
  color: var(--salvia);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.categories-total-card {
  margin: -12px 22px 18px;
  background: var(--white);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.categories-total-card span,
.categories-total-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.categories-total-card strong {
  display: block;
  color: var(--grafito);
  font-size: 31px;
  line-height: 1.1;
  font-weight: 800;
  margin: 5px 0 6px;
}
.categories-content {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.category-card {
  background: var(--white);
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
}
.category-main {
  display: flex;
  gap: 13px;
  align-items: center;
}
.category-dot-box {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.category-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
}
.category-dot-box svg {
  display: block;
}
.category-text {
  flex: 1;
  min-width: 0;
}
.category-text strong {
  display: block;
  color: var(--grafito);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.category-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}
.category-type-chip {
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--crema);
  color: var(--muted);
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 700;
}
.category-budget {
  color: var(--muted);
  font-size: 10.5px;
}
.category-availability {
  color: var(--salvia-dark);
  font-size: 10px;
  font-weight: 600;
}
.form-field > small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.category-actions {
  margin-top: 12px;
}

/* ── Ingresos y gastos fijos ──────────────────────────── */
.fixed-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}
.fixed-hero {
  background: var(--salvia);
  color: var(--white);
  padding: 52px 22px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.fixed-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}
.fixed-hero h1 {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
  margin-top: 4px;
}
.fixed-add {
  border: none;
  border-radius: 999px;
  background: var(--white);
  color: var(--salvia);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.fixed-summary {
  margin: -12px 22px 18px;
  background: var(--white);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.fixed-summary span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
}
.fixed-summary strong {
  display: block;
  color: var(--grafito);
  font-size: 19px;
  font-weight: 800;
  margin-top: 3px;
}
.fixed-summary-income {
  border-left: 1px solid var(--crema);
  padding-left: 14px;
}
.fixed-chips {
  display: flex;
  gap: 7px;
  padding: 0 22px 14px;
}
.fixed-content {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fixed-card {
  background: var(--white);
  border-radius: 16px;
  padding: 15px;
  display: flex;
  gap: 13px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
}
.fixed-card.paused { opacity: 0.6; }
.fixed-bar {
  width: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.fixed-bar.income { background: var(--salvia); }
.fixed-bar.expense { background: var(--terra); }
.fixed-main { flex: 1; min-width: 0; }
.fixed-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.fixed-title { min-width: 0; }
.fixed-title strong {
  display: block;
  color: var(--grafito);
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fixed-title span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}
.fixed-amount {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}
.fixed-amount.income { color: var(--salvia); }
.fixed-amount.expense { color: var(--terra); }
.fixed-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.fixed-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--muted);
}
.fixed-switch {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--arena);
  position: relative;
  transition: background 0.2s;
}
.fixed-switch.on { background: var(--salvia); }
.fixed-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--white);
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.fixed-switch.on .fixed-knob { left: 16px; }
.fixed-edit { margin-left: auto; }

/* ── Login: overlay de preparación ────────────────────── */
.login-preparing {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(247,243,238,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--grafito);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
}
.login-spinner {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 3px solid var(--arena);
  border-top-color: var(--salvia);
  animation: nido-spin 0.8s linear infinite;
}
@keyframes nido-spin {
  to { transform: rotate(360deg); }
}

.fund-card {
  background: var(--white);
  border-radius: 16px;
  padding: 15px;
  display: flex;
  gap: 13px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
}

.fund-color {
  width: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.fund-main {
  flex: 1;
  min-width: 0;
}

.fund-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 13px;
}

.fund-title-row strong {
  display: block;
  color: var(--grafito);
  font-size: 15px;
  font-weight: 700;
}

.fund-title-row span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.default-badge {
  border-radius: 999px;
  background: var(--salvia-light);
  color: var(--salvia) !important;
  padding: 5px 9px;
  font-size: 9px !important;
  font-weight: 800;
  white-space: nowrap;
}

.fund-balance-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
}

.fund-balance-row span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 3px;
}

.fund-balance-row b {
  color: var(--grafito);
  font-size: 15px;
  font-weight: 800;
}

.fund-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.set-default-btn {
  border: none;
  border-radius: 12px;
  background: var(--crema);
  color: var(--grafito);
  padding: 10px 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.primary-action.inline {
  margin-top: 10px;
  width: 100%;
}

.color-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-dot {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 1px var(--arena);
  cursor: pointer;
}

.color-dot.selected {
  box-shadow: 0 0 0 3px var(--grafito);
}

.category-icon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.category-icon-option {
  min-width: 0;
  border: 1px solid var(--arena);
  border-radius: 12px;
  background: var(--crema);
  color: var(--grafito);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.category-icon-option svg {
  flex-shrink: 0;
}

.category-icon-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-icon-option.selected {
  border-color: var(--icon-color);
  background: color-mix(in srgb, var(--icon-color) 16%, white);
  color: var(--icon-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--icon-color) 24%, transparent);
}

/* Family */
.family-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}

.family-hero {
  background: var(--salvia);
  color: var(--white);
  padding: 52px 22px 24px;
}

.family-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.86);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 14px;
  padding: 0;
}

.family-hero h1 {
  color: var(--white);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
  margin-top: 4px;
}

.family-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.family-metric-grid div {
  background: rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: 10px 0;
  text-align: center;
}

.family-metric-grid strong,
.family-metric-grid span {
  display: block;
  color: var(--white);
}

.family-metric-grid strong {
  font-size: 18px;
  font-weight: 800;
}

.family-metric-grid span {
  font-size: 9.5px;
  color: rgba(255,255,255,0.76);
}

.family-content {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.family-invite-card {
  margin-top: -12px;
  background: var(--white);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.family-invite-card strong,
.family-invite-card span {
  display: block;
}

.family-invite-card strong {
  color: var(--grafito);
  font-size: 15px;
  font-weight: 800;
}

.family-invite-card span {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
  margin-top: 4px;
}

.family-invite-btn {
  border: none;
  border-radius: 14px;
  background: var(--salvia);
  color: var(--white);
  padding: 10px 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(168,187,160,0.35);
  white-space: nowrap;
}

.family-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.family-member-card {
  background: var(--white);
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.family-avatar {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--salvia-light);
  color: var(--salvia);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 800;
}

.family-avatar.pending {
  background: var(--terra-light);
  color: var(--terra);
}

.family-member-main {
  flex: 1;
  min-width: 0;
}

.family-member-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.family-member-title strong {
  color: var(--grafito);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.family-member-main small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 2px;
}

.family-status {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 8.5px;
  font-weight: 800;
  white-space: nowrap;
}

.family-status.active {
  background: var(--salvia-light);
  color: var(--salvia);
}

.family-status.pending {
  background: var(--terra-light);
  color: var(--terra);
}

.family-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.family-chip-row span {
  border-radius: 999px;
  background: var(--crema);
  color: var(--grafito);
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 360px) {
  .quick-actions,
  .transactions-summary,
  .balance-grid,
  .fund-balance-row,
  .family-metric-grid {
    grid-template-columns: 1fr;
  }

  .placeholder-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Chat: markdown en respuestas de la IA ─────────────────── */
.bubble-md p { margin: 0 0 8px; }
.bubble-md p:last-child { margin-bottom: 0; }
.bubble-md ul,
.bubble-md ol { margin: 4px 0 8px; padding-left: 18px; }
.bubble-md li { margin-bottom: 3px; }
.bubble-md strong { font-weight: 700; }
.bubble-md h1, .bubble-md h2, .bubble-md h3, .bubble-md h4 {
  font-size: 13px;
  font-weight: 700;
  margin: 8px 0 4px;
  color: inherit;
}
.bubble-md code {
  background: var(--crema);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11.5px;
}
.bubble-md pre {
  background: var(--crema);
  border-radius: 8px;
  padding: 8px 10px;
  overflow-x: auto;
  margin: 6px 0;
}
.bubble-md pre code { background: none; padding: 0; }
.bubble-md table {
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 12px;
  width: 100%;
}
.bubble-md th,
.bubble-md td {
  border: 1px solid var(--arena);
  padding: 4px 8px;
  text-align: left;
}
.bubble-md th { background: var(--crema); font-weight: 600; }
.bubble-md blockquote {
  border-left: 3px solid var(--arena);
  margin: 6px 0;
  padding-left: 10px;
  color: var(--muted);
}
.bubble-md a { color: var(--salvia); }
.bubble-md hr { border: none; border-top: 1px solid var(--arena); margin: 8px 0; }

/* ── Chat: historial de sesiones ───────────────────────────── */
.chat-header-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.chat-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--crema);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grafito);
}
.chat-history-sheet {
  max-height: 75vh;
  display: flex;
  flex-direction: column;
}
.chat-newchat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--salvia);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.chat-session-list {
  overflow-y: auto;
  flex: 1;
}
.chat-sessions-empty {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px 0;
}
.chat-session-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid var(--crema);
}
.chat-session-row:last-child { border-bottom: none; }
.chat-session-main {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 9px 4px;
  font-family: 'Poppins', sans-serif;
}
.chat-session-main strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--grafito);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-session-main.active strong { font-weight: 700; }
.chat-session-main span {
  font-size: 10.5px;
  color: var(--muted);
}
.chat-session-trash {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}
.chat-session-confirm {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.chat-session-no {
  border: 1px solid var(--arena);
  background: var(--white);
  border-radius: 10px;
  padding: 5px 10px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--grafito);
}
.chat-session-yes {
  border: none;
  background: var(--terra);
  border-radius: 10px;
  padding: 5px 10px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--white);
}

/* Statement import inside Nido IA */
.chat-heading-copy {
  min-width: 0;
  flex: 1;
}
.chat-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--grafito);
}
.chat-subtitle {
  font-size: 11px;
  color: var(--salvia);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-icon-btn.active {
  color: var(--salvia);
  background: var(--salvia-light);
  box-shadow: inset 0 0 0 1px var(--salvia);
}
.chat-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.chat-error {
  align-self: center;
  font-size: 12px;
}
.statement-import-row {
  align-items: flex-end;
}
.statement-import-card {
  width: min(100%, 390px);
  min-width: 0;
  padding: 15px;
  border-radius: 16px 16px 16px 4px;
  background: var(--white);
  color: var(--grafito);
  box-shadow: 0 2px 10px rgba(66, 62, 58, 0.08);
}
.statement-import-setup {
  width: min(100%, 390px);
  min-width: 0;
  padding: 15px;
  border-radius: 16px 16px 16px 4px;
  background: var(--white);
  color: var(--grafito);
  box-shadow: 0 2px 10px rgba(66, 62, 58, 0.08);
}
.statement-import-setup-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--crema);
}
.statement-import-setup-heading h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}
.statement-import-setup-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}
.statement-import-fund-field {
  display: grid;
  gap: 6px;
  margin: 13px 0 11px;
}
.statement-import-fund-field > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}
.statement-import-fund-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 35px 0 12px;
  border: 1px solid var(--arena);
  border-radius: 9px;
  background: var(--crema);
  color: var(--grafito);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  outline: none;
}
.statement-import-fund-field select:focus {
  border-color: var(--salvia);
  box-shadow: 0 0 0 2px var(--salvia-light);
}
.statement-import-funds-loading,
.statement-import-no-funds {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
}
.statement-import-no-funds {
  flex-direction: column;
}
.statement-import-no-funds button {
  border: 0;
  background: transparent;
  color: var(--salvia);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.statement-import-upload {
  min-height: 48px;
  padding: 0 14px;
  border: 1px dashed var(--salvia);
  border-radius: 9px;
  background: var(--salvia-light);
  color: var(--salvia);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.statement-import-upload.uploading {
  border-style: solid;
  cursor: progress;
}
/* Ruedita puramente CSS: se muestra en cuanto el navegador recibe el archivo,
   sin esperar al circuito (que puede estar reconectando). */
.statement-import-upload.uploading::after {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid var(--arena);
  border-top-color: var(--salvia);
  border-radius: 50%;
  animation: ptr-spin 0.7s linear infinite;
}
.statement-import-upload.disabled {
  border-color: var(--arena);
  background: var(--crema);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.7;
}
.statement-import-file-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  text-align: center;
}
.statement-import-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--crema);
}
.statement-import-card-header > div {
  min-width: 0;
}
.statement-import-card-header h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
}
.statement-import-card-header p {
  margin: 3px 0 0;
  font-size: 10.5px;
  color: var(--muted);
}
.statement-import-status {
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--salvia-light);
  color: var(--salvia);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.statement-import-status.completed {
  background: var(--salvia);
  color: var(--white);
}
.statement-import-file {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin: 11px 0;
  color: var(--muted);
  font-size: 10.5px;
}

.statement-import-processing {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 22px 12px;
    text-align: center;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.5;
}

.statement-import-failed {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--terra) 35%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--terra) 10%, white);
    color: var(--terra);
    font-size: 0.78rem;
    font-weight: 600;
}
.statement-import-file span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.statement-import-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--crema);
  border-bottom: 1px solid var(--crema);
}
.statement-import-totals span,
.statement-import-fund span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}
.statement-import-totals strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.statement-import-totals .expense { color: var(--terra); }
.statement-import-totals .income { color: var(--salvia); }
.statement-import-totals .projected {
  padding-left: 9px;
  border-left: 2px solid var(--salvia);
}
.statement-import-totals .projected.positive strong { color: var(--salvia); }
.statement-import-totals .projected.negative {
  border-left-color: var(--terra);
}
.statement-import-totals .projected.negative strong { color: var(--terra); }
.statement-import-categories {
  display: grid;
  gap: 6px;
  padding: 12px 0 9px;
}
.statement-import-categories > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10.5px;
}
.statement-import-categories > div span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.statement-import-categories > div strong {
  flex-shrink: 0;
  font-weight: 600;
}
.statement-import-categories > div strong.income { color: var(--salvia); }
.statement-import-categories > div strong.expense { color: var(--terra); }
.statement-import-categories p {
  margin: 0;
  color: var(--salvia);
  font-size: 10px;
}
.statement-import-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.statement-import-chips span,
.statement-import-chips button {
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  font-family: 'Poppins', sans-serif;
  font-size: 9.5px;
}
.statement-import-chips .duplicate {
  color: var(--salvia);
  background: var(--salvia-light);
}
.statement-import-chips .review {
  color: var(--terra);
  background: var(--terra-light);
}
.statement-import-chips button.review,
.statement-import-chips button.duplicate {
  cursor: pointer;
}
.statement-import-chips .success {
  color: var(--salvia);
  background: var(--salvia-light);
  cursor: pointer;
}
.statement-import-chips .excluded {
  color: var(--grafito);
  background: var(--arena);
  cursor: pointer;
}
.statement-import-validation {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  margin: 0 0 11px;
  border-radius: 8px;
  background: var(--crema);
}
.statement-import-validation-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  border-radius: 6px;
  background: var(--white);
}
.statement-import-validation > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.statement-import-validation strong {
  font-size: 10px;
  line-height: 1.3;
}
.statement-import-validation small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}
.statement-import-validation.matched {
  color: var(--salvia);
  background: var(--salvia-light);
}
.statement-import-validation.mismatch {
  color: var(--terra);
  background: var(--terra-light);
}
.statement-import-draft-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin: 0 0 9px;
}
.statement-import-draft-actions button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid var(--arena);
  border-radius: 7px;
  background: var(--white);
  color: var(--grafito);
  font-family: inherit;
  font-size: 9.5px;
  cursor: pointer;
}
.statement-import-draft-actions button.danger {
  color: var(--terra);
}
.statement-import-review-notice {
  margin: 0 0 8px;
  color: var(--terra);
  font-size: 10px;
  line-height: 1.4;
}
.statement-import-fund {
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 9px;
  background: var(--crema);
}
.statement-import-fund strong {
  display: block;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.statement-import-fund strong.pending { color: var(--terra); }
.statement-import-confirm {
  width: 100%;
  min-height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--salvia);
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.statement-import-confirm:disabled {
  background: var(--arena);
  cursor: not-allowed;
}
.statement-import-complete {
  min-height: 42px;
  border-radius: 10px;
  background: var(--salvia-light);
  color: var(--salvia);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
}

.statement-review-sheet {
  width: min(100%, 560px);
  max-height: min(88dvh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.statement-review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 12px;
  flex-shrink: 0;
}
.statement-review-header.compact {
  justify-content: flex-start;
  align-items: center;
}
.statement-review-header > div {
  min-width: 0;
}
.statement-review-header h2 {
  margin: 0;
  color: var(--grafito);
  font-size: 16px;
  line-height: 1.3;
}
.statement-review-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.statement-review-loading {
  min-height: 180px;
  display: grid;
  place-items: center;
}
.statement-review-list {
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid var(--arena);
}
.statement-review-row {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 9px;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid var(--arena);
  background: transparent;
  color: var(--grafito);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.statement-review-item.pending {
  background: color-mix(in srgb, var(--terra-light) 36%, transparent);
}
.statement-review-item.excluded {
  background: color-mix(in srgb, var(--arena) 45%, transparent);
}
.statement-review-item.excluded .statement-review-row {
  opacity: .62;
}
.statement-review-checkbox {
  margin: 0;
  accent-color: var(--salvia);
  cursor: pointer;
}
.statement-review-checkbox:disabled {
  cursor: default;
  opacity: .8;
}
.statement-review-side small.excluded {
  color: var(--muted);
  background: var(--arena);
}
.statement-draft-confirm {
  padding: 20px;
}
.statement-draft-confirm h2 {
  margin: 4px 0 7px;
  font-size: 16px;
}
.statement-draft-confirm p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.statement-draft-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 18px;
}
.statement-draft-confirm-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
.statement-draft-confirm-actions .secondary {
  background: var(--crema);
  color: var(--grafito);
}
.statement-draft-confirm-actions .primary {
  background: var(--salvia);
  color: var(--white);
}
.statement-draft-confirm-actions .primary.danger {
  background: var(--terra);
}
.statement-review-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.statement-review-main,
.statement-review-side {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.statement-review-main strong {
  overflow: hidden;
  color: var(--grafito);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.statement-review-main span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.statement-review-side {
  justify-items: end;
}
.statement-review-side strong {
  font-size: 10.5px;
  white-space: nowrap;
}
.statement-review-side strong.income,
.statement-review-transaction strong.income {
  color: var(--salvia);
}
.statement-review-side strong.expense,
.statement-review-transaction strong.expense {
  color: var(--terra);
}
.statement-review-side small {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--terra-light);
  color: var(--terra);
  font-size: 8px;
  font-weight: 700;
}
.statement-review-transaction {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 11px 0;
  margin-bottom: 10px;
  border-top: 1px solid var(--arena);
  border-bottom: 1px solid var(--arena);
}
.statement-review-transaction span,
.statement-review-transaction small {
  color: var(--muted);
  font-size: 10px;
}
.statement-review-transaction strong {
  font-size: 12px;
}
.statement-review-transaction small {
  grid-column: 1 / -1;
}
.statement-review-category-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 2px 0 14px;
  overflow-y: auto;
}
.statement-review-category-grid .category-picker-option {
  min-width: 0;
}
.statement-review-category-grid + .statement-import-confirm {
  flex-shrink: 0;
}
.chat-session-type {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--salvia-light);
  color: var(--salvia);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 420px) {
  .chat-header {
    gap: 9px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .chat-header-actions { gap: 5px; }
  .chat-icon-btn {
    width: 32px;
    height: 32px;
  }
  .chat-messages { padding-left: 16px; padding-right: 16px; }
  .chat-input-bar { padding-left: 16px; padding-right: 16px; gap: 7px; }
  .chat-send-btn {
    width: 38px;
    height: 38px;
  }
  .chat-input {
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 11.5px;
  }
  .statement-import-card { padding: 13px; }
}

/* ── Categoría en filas de transacción ─────────────────────── */
.tx-row-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}
.tx-row-meta > i {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
}
.tx-row-meta .tx-meta-date { flex-shrink: 0; }
.tx-row-meta .tx-meta-who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tx-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 500;
  color: var(--grafito);
  white-space: nowrap;
  flex-shrink: 0;
}

.tx-cat-chip svg {
  flex-shrink: 0;
}
.tx-detail-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tx-detail-cat svg {
  flex-shrink: 0;
}

/* ── Metas de ahorro ───────────────────────────────────────── */
.savings-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 90px;
  position: relative;
}
.savings-card {
  background: var(--white);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.savings-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.savings-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.savings-name strong {
  color: var(--grafito);
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.savings-top > b {
  color: var(--grafito);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.savings-pace {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.savings-pace.achieved { background: var(--salvia-light); color: var(--salvia); }
.savings-pace.ontrack  { background: var(--salvia-light); color: var(--salvia); }
.savings-pace.atrisk   { background: #F6ECD8; color: var(--arena); }
.savings-pace.offtrack { background: var(--terra-light); color: var(--terra); }
.savings-pace.nodate   { background: #EEE; color: var(--muted); }
.savings-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}
.savings-projection {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.savings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.savings-contribute-btn {
  border: none;
  border-radius: 999px;
  background: var(--salvia);
  color: var(--white);
  padding: 9px 18px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.savings-link-btn {
  border: none;
  background: none;
  color: var(--muted);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.savings-link-btn.danger { color: var(--terra); }
.savings-color-input {
  height: 44px;
  padding: 4px;
  cursor: pointer;
}
.savings-shared-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--grafito);
  font-size: 13px;
  margin-top: 4px;
}
.savings-hint {
  color: var(--terra);
  font-size: 12px;
  background: var(--terra-light);
  border-radius: 12px;
  padding: 10px 12px;
}
.confirm-sheet h2 {
  color: var(--grafito);
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 6px;
}
.confirm-text {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
}
.confirm-actions { display: flex; gap: 10px; }
.confirm-cancel {
  flex: 1;
  border: 1px solid var(--line, #E5E1D8);
  background: var(--white);
  color: var(--grafito);
  border-radius: 14px;
  padding: 13px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.confirm-delete {
  flex: 1;
  border: none;
  background: var(--terra);
  color: var(--white);
  border-radius: 14px;
  padding: 13px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}


/* ── Notificaciones ────────────────────────────────────────── */
.notif-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 90px;
  position: relative;
}
.notif-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.notif-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--crema);
  cursor: pointer;
  text-align: left;
  font-family: 'Poppins', sans-serif;
}
.notif-row:last-child { border-bottom: none; }
.notif-row.unread { background: rgba(168, 187, 160, 0.08); }
.notif-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-icon.achieved { background: var(--salvia-light); color: var(--salvia); }
.notif-icon.progress { background: var(--salvia-light); color: var(--salvia); }
.notif-icon.warning  { background: #F6ECD8; color: var(--arena); }
.notif-icon.danger   { background: var(--terra-light); color: var(--terra); }
.notif-icon.info     { background: var(--crema); color: var(--muted); }
.notif-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-main strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--grafito);
}
.notif-row.unread .notif-main strong { font-weight: 700; }
.notif-main > span {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}
.notif-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.notif-meta i {
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
}
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--terra);
}


/* ── Configuración de notificaciones ───────────────────────── */
.notif-header-actions { display: flex; gap: 8px; align-items: center; }
.notif-gear-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.22);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-settings-sub {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  margin-top: 4px;
}
.notif-rule-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--crema);
}
.notif-rule-row:last-child { border-bottom: none; }
.notif-rule-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.notif-rule-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.notif-rule-text strong { font-size: 13px; font-weight: 600; color: var(--grafito); }
.notif-rule-text span { font-size: 10.5px; color: var(--muted); }
.notif-switch {
  width: 38px;
  height: 21px;
  border-radius: 11px;
  border: none;
  cursor: pointer;
  background: var(--arena);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
  padding: 0;
}
.notif-switch.on { background: var(--salvia); }
.notif-switch:disabled { opacity: 0.6; }
.notif-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--white);
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.notif-switch.on .notif-knob { left: 19px; }
.notif-days-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  background: var(--crema);
  border-radius: 12px;
  padding: 9px 12px;
}
.notif-days-row > span { flex: 1; font-size: 11.5px; color: var(--grafito); }
.notif-days-row > b { font-size: 12.5px; font-weight: 700; color: var(--grafito); min-width: 52px; text-align: center; }
.notif-step {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: none;
  background: var(--white);
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--grafito);
}
.notif-step:disabled { opacity: 0.6; }
.notif-settings-note {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}


/* ── Reuniones y compromisos ───────────────────────────────── */
.meeting-card {
  background: var(--white);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.meeting-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.meeting-top strong { font-size: 13.5px; font-weight: 700; color: var(--grafito); }
.meeting-top span { font-size: 10.5px; color: var(--muted); }
.meeting-card p { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.meeting-chip {
  display: inline-flex;
  align-items: center;
  background: #F6ECD8;
  border-radius: 10px;
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--arena);
}
.meeting-chip.done { background: var(--salvia-light); color: var(--salvia); }
.meeting-section {
  background: var(--white);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
}
.meeting-section-title { display: block; font-size: 13px; font-weight: 700; color: var(--grafito); }
.meeting-section-sub { font-size: 10.5px; color: var(--muted); margin: 2px 0 12px; }
.meeting-kpis { display: flex; gap: 8px; margin-top: 10px; }
.meeting-kpis > div {
  flex: 1;
  background: var(--crema);
  border-radius: 12px;
  padding: 9px 10px;
  min-width: 0;
}
.meeting-kpis span {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.meeting-kpis b { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.meeting-expense { color: var(--terra); }
.meeting-finding { font-size: 11px; color: var(--muted); margin-top: 8px; }
.meeting-recon-row { border-top: 1px solid var(--crema); padding: 11px 0; }
.meeting-recon-row:first-of-type { margin-top: 4px; }
.meeting-recon-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.meeting-recon-top strong { font-size: 12.5px; font-weight: 600; color: var(--grafito); }
.meeting-recon-top span { font-size: 11px; color: var(--muted); }
.meeting-recon-input { display: flex; gap: 8px; align-items: center; }
.meeting-recon-input .input { flex: 1; min-width: 0; }
.meeting-recon-input b { font-size: 11px; font-weight: 700; white-space: nowrap; }
.meeting-recon-input b.ok { color: var(--salvia); }
.meeting-recon-input b.off { color: var(--terra); }
.meeting-recon-btn {
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  background: var(--salvia);
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.meeting-recon-btn:disabled { background: var(--arena); cursor: default; }
.meeting-recon-done {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--salvia-light);
  color: var(--salvia);
  border-radius: 10px;
  padding: 3px 10px;
  font-size: 10.5px;
  font-weight: 600;
}
.meeting-commit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.meeting-commit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--crema);
}
.meeting-commit-row i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--arena);
  flex-shrink: 0;
}
.meeting-commit-row i.done { background: var(--salvia); }
.meeting-commit-row span {
  flex: 1; min-width: 0;
  font-size: 11.5px; color: var(--grafito);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.meeting-commit-row span.done { opacity: 0.55; text-decoration: line-through; }
.meeting-commit-row b { font-size: 10px; color: var(--muted); font-weight: 500; flex-shrink: 0; }
.meeting-manage-btn {
  width: 100%;
  margin-top: 10px;
  border: none;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  background: var(--salvia-light);
  color: var(--salvia);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
}
.meeting-notes { min-height: 64px; resize: none; margin: 10px 0; width: 100%; box-sizing: border-box; }

.commit-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--crema);
}
.commit-row:last-child { border-bottom: none; }
.commit-check {
  width: 20px; height: 20px;
  border-radius: 7px;
  border: 1.5px solid var(--arena);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  padding: 0;
}
.commit-check.done { background: var(--salvia); border-color: var(--salvia); }
.commit-main {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.commit-main strong {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--grafito);
  line-height: 1.45;
}
.commit-main strong.done { text-decoration: line-through; opacity: 0.6; }
.commit-main b { font-size: 10.5px; font-weight: 600; color: var(--grafito); }
.commit-meta { display: flex; align-items: center; gap: 6px; }
.commit-meta i { font-style: normal; font-size: 10px; color: var(--muted); }
.commit-meta i.overdue { color: var(--terra); font-weight: 700; }
.commit-meta em {
  font-style: normal;
  background: var(--crema);
  border-radius: 8px;
  padding: 1px 7px;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--grafito);
}
.commit-main small { font-size: 9.5px; color: var(--muted); }
.commit-trash {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--crema);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--terra);
  flex-shrink: 0;
}
.commit-text-input { min-height: 56px; resize: none; }


.meeting-delete-btn {
  width: 100%;
  border: 1px solid var(--terra);
  border-radius: 14px;
  padding: 13px;
  cursor: pointer;
  background: transparent;
  color: var(--terra);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
}


/* Numpad inline: pegado al monto, antes de las categorías */
.numpad-inline {
  margin: 4px 0 14px;
}
.numpad-inline .numpad-key {
  padding: 9px 0;
  font-size: 17px;
}


/* Dashboard: resumen secundario de 90 días y ritmo mensual de metas */
.dash90-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.dash90-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash90-grid span {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dash90-grid b {
  font-size: 14px;
  color: var(--grafito);
}
.dash90-count {
  font-size: 11px;
  color: var(--muted);
}
.dash-goal-month {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--terra);
}
.dash-goal-month.ok {
  color: var(--salvia);
}

/* Planes y suscripciones */
.plans-page {
  min-height: 100%;
  background: var(--crema);
  padding-bottom: 90px;
}
.plans-hero {
  background: var(--salvia);
  padding: 52px 22px 24px;
  color: var(--white);
}
.plans-hero h1 {
  margin-top: 14px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}
.plans-hero p {
  max-width: 430px;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  line-height: 1.5;
}
.plans-content {
  padding: 16px 18px 24px;
}

/* Acerca de */
.about-page {
  min-height: 100%;
  background: var(--crema);
  padding-bottom: 90px;
}

.about-hero {
  background: var(--salvia);
  padding: 52px 22px 24px;
  color: var(--white);
}

.about-hero h1 {
  margin-top: 14px;
  font-size: 22px;
  line-height: 1.2;
}

.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 28px 32px;
  text-align: center;
}

.about-logo {
  width: min(240px, 72vw);
  height: auto;
  object-fit: contain;
}

.about-content > p {
  margin: 18px 0 34px;
  color: var(--muted);
  font-size: 12px;
}

.about-details {
  width: min(100%, 360px);
  margin: 0 0 34px;
  border-top: 1px solid var(--arena);
  border-bottom: 1px solid var(--arena);
}

.about-details > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 2px;
}

.about-details dt,
.about-details dd {
  margin: 0;
  font-size: 13px;
}

.about-details dt {
  color: var(--muted);
}

.about-details dd {
  color: var(--grafito);
  font-weight: 700;
}

.about-content > small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.plans-current-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 12px;
  font-size: 11px;
  color: var(--muted);
}
.plans-current-row strong {
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--salvia-light);
  color: var(--salvia);
  font-size: 10px;
}
.plans-owner-note {
  margin-bottom: 12px;
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--terra-light);
  color: var(--terra);
  font-size: 10.5px;
  line-height: 1.45;
}
.plans-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plan-card {
  --plan-accent: var(--grafito);
  --plan-tint: #f2f0ed;
  border: 1.5px solid transparent;
  border-radius: 16px;
  padding: 15px 16px;
  background: var(--white);
}
.plan-card.plan-basic {
  --plan-accent: var(--salvia);
  --plan-tint: var(--salvia-light);
}
.plan-card.plan-pro {
  --plan-accent: var(--terra);
  --plan-tint: var(--terra-light);
}
.plan-card.active {
  border-color: var(--plan-accent);
  box-shadow: 0 8px 22px rgba(95, 91, 87, 0.10);
}
.plan-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.plan-eyebrow {
  display: block;
  color: var(--plan-accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.plan-card h2 {
  margin-top: 2px;
  color: var(--grafito);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}
.plan-active-badge {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--plan-tint);
  color: var(--plan-accent);
  font-size: 9px;
  font-weight: 700;
}
.plan-description {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}
.plan-features {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 11px;
}
.plan-features > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-features > div > span {
  width: 17px;
  height: 17px;
  border-radius: 6px;
  background: var(--plan-tint);
  color: var(--plan-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.plan-features small {
  color: var(--grafito);
  font-size: 10.5px;
}
.plan-action {
  width: 100%;
  margin-top: 13px;
  border: none;
  border-radius: 11px;
  padding: 10px;
  background: var(--plan-accent);
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.plan-action:disabled {
  background: var(--plan-tint);
  color: var(--plan-accent);
  cursor: default;
}
.plan-premium .plan-action:disabled {
  border: 1px solid var(--arena);
  background: var(--crema);
  color: var(--muted);
}
.plans-activation-backdrop {
  z-index: 120;
}
.plans-activation-sheet {
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}
.plans-activation-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  margin-bottom: 12px;
  background: var(--terra-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.plans-activation-sheet h2 {
  color: var(--grafito);
  font-size: 17px;
  letter-spacing: 0;
}
.plans-activation-sheet p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}
.plans-activation-sheet .save-preferences-btn {
  margin-top: 18px;
}


/* Pull-to-refresh */
.ptr-indicator {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: var(--white);
  border-radius: 999px;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}
.ptr-spinner {
  display: block;
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--arena);
  border-top-color: var(--salvia);
  border-radius: 50%;
  animation: ptr-spin 0.7s linear infinite;
}
@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}

/* Movimientos: selectores primarios de fondo y período */
.tx-selectors {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.tx-selector {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tx-selector > span {
  font-size: 9.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-left: 2px;
}
.tx-selector select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--arena);
  border-radius: 999px;
  background: var(--white);
  color: var(--grafito);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}
.tx-summary-period {
  margin: 0 0 6px;
  text-align: center;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
