/* ============================================================
   PROYECTO GRIT — Design System
   Paleta: Dark base + Amber accent
   Tipografía: Inter (Google Fonts)
   ============================================================ */

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

/* ── Variables ── */
:root {
  --bg-base:     #080808;
  --bg-surface:  #111111;
  --bg-elevated: #1a1a1a;
  --bg-overlay:  #222222;
  --bg-input:    #161616;

  --accent:      #f59e0b;
  --accent-dim:  rgba(245,158,11,0.12);
  --accent-glow: rgba(245,158,11,0.25);
  --accent-hover:#d97706;

  --income:      #10b981;
  --income-dim:  rgba(16,185,129,0.12);
  --expense:     #ef4444;
  --expense-dim: rgba(239,68,68,0.12);

  --text-1:      #f5f5f5;
  --text-2:      #a3a3a3;
  --text-3:      #525252;

  --border:      rgba(255,255,255,0.07);
  --border-focus:rgba(245,158,11,0.6);

  --font:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 24px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.6);
  --shadow:    0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.6);
  --shadow-accent: 0 4px 24px rgba(245,158,11,0.2);

  --transition: 0.18s ease;
}

/* ── LEDGER GRIT · dirección visual ───────────────────────
   Continuación del hero de GRIT: luz cálida, espacio y capas, no UI financiera. */
.ledger-page { background: #000; }
.ledger-page .navbar { position: absolute; width: 100%; }
.ledger-page .navbar-logo, .ledger-page .navbar-menu-trigger { color: #f4f1ee; }
.ledger-shell { max-width: none; padding: 0 0 120px; overflow: hidden; }
.ledger-hero { min-height: min(680px, 92svh); display: grid; place-items: center; padding: 136px 24px 96px; background: #000; isolation: isolate; }
.ledger-hero::after { display: none; }
.ledger-hero-copy { position: relative; z-index: 2; width: min(100%, 760px); text-align: center; }
.back-home-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 20px; color: #8c8783; font-size: .78rem; font-weight: 600; text-decoration: none; transition: color .2s ease; }
.back-home-link:hover { color: #f3eeea; }
.ledger-eyebrow { color: #77716d; font-size: .65rem; letter-spacing: .15em; font-weight: 700; }
.ledger-hero h1 { display: flex; flex-direction: column; color: #f7f4f1; font-size: clamp(2.65rem, 7vw, 6.1rem); font-weight: 700; letter-spacing: -.068em; line-height: .94; }
.ledger-hero h1 span { color: inherit; opacity: 0; animation: ledgerReveal .95s cubic-bezier(.16,1,.3,1) .24s forwards; }
.ledger-hero h1 span:last-child { color: #a6a09d; font-size: .66em; animation-delay: .42s; }
.ledger-hero-copy > p:not(.ledger-eyebrow) { margin: 28px auto 0; color: #8c8783; font-size: .96rem; line-height: 1.65; opacity: 0; animation: ledgerReveal .8s cubic-bezier(.16,1,.3,1) .65s forwards; }
.ledger-hero .ledger-eyebrow { opacity: 0; animation: ledgerReveal .7s cubic-bezier(.16,1,.3,1) .1s forwards; }
.ledger-actions { justify-content: center; margin-top: 31px; opacity: 0; animation: ledgerReveal .8s cubic-bezier(.16,1,.3,1) .82s forwards; }
.ledger-actions .form-control { min-width: 172px; border-color: rgba(255,255,255,.13); border-radius: 99px; background: rgba(255,255,255,.045); color: #bcb7b3; font-size: .78rem; }
.ledger-page .btn-primary { background: #f2efec; color: #111; border-radius: 99px; box-shadow: none; font-weight: 700; transition: transform .25s ease, background .25s ease; }
.ledger-page .btn-primary:hover { background: #fff; transform: translateY(-2px); }
.ledger-orb { position: absolute; z-index: -1; width: min(57vw, 740px); aspect-ratio: 1; border: 1px solid rgba(255,240,226,.28); border-radius: 50%; background: radial-gradient(circle at 50% 42%, rgba(255,237,219,.075), rgba(255,213,173,.02) 43%, transparent 70%); box-shadow: inset 0 0 48px rgba(255,222,188,.09), 0 0 32px rgba(255,201,146,.09); }
.ledger-orb-top { top: -55%; animation: ledgerOrbTop 24s cubic-bezier(.45,0,.55,1) infinite alternate; }.ledger-orb-bottom { bottom: -66%; animation: ledgerOrbBottom 21s cubic-bezier(.45,0,.55,1) -6s infinite alternate; }
.ledger-stats { width: min(100% - 48px, 1120px); margin: 0 auto; grid-template-columns: 1.35fr repeat(3, 1fr); gap: 0; border-top: 1px solid rgba(255,255,255,.1); border-bottom: 1px solid rgba(255,255,255,.1); }
.ledger-stats > *, .ledger-stats .stat-card { min-height: 176px; padding: 33px 28px; border: 0; border-radius: 0; border-right: 1px solid rgba(255,255,255,.1); background: transparent; box-shadow: none; opacity: 0; animation: ledgerReveal .8s cubic-bezier(.16,1,.3,1) forwards; }
.ledger-stats > *:last-child { border-right: 0; }.ledger-stats > *:nth-child(1) { animation-delay: .24s; }.ledger-stats > *:nth-child(2) { animation-delay: .34s; }.ledger-stats > *:nth-child(3) { animation-delay: .44s; }.ledger-stats > *:nth-child(4) { animation-delay: .54s; }
.ledger-stats .stat-card:hover { transform: none; border-color: transparent; }.ledger-balance-card { background: radial-gradient(circle at 0 0, rgba(255,220,187,.08), transparent 62%) !important; }.ledger-balance-card strong { color: #f6f3f0; font-size: clamp(2.2rem,4vw,3.5rem); }.ledger-balance-card span, .ledger-balance-card small, .ledger-stats .stat-card .stat-label, .ledger-stats .stat-card .stat-sub { color: #77716d; }.ledger-stats .stat-card .stat-value { color: #e8e3df; font-size: 2rem; }.ledger-stats .stat-card.income .stat-value, .ledger-stats .stat-card.expense .stat-value, .ledger-stats .stat-card.saving .stat-value { color: #e8e3df; }
.ledger-story { width: min(100% - 48px, 1120px); margin: 96px auto; padding: 0; border: 0; border-radius: 0; background: transparent; grid-template-columns: 1.15fr .85fr; }.ledger-story h2 { font-size: clamp(2rem,4vw,3.5rem); letter-spacing: -.06em; }.ledger-flow { display: grid; gap: 5px; margin-top: 24px; color: #88827e; font-size: 1.02rem; }.ledger-flow i { color: #6c6662; padding-left: 12px; }.ledger-flow b { color: #e8e3df; }.saving-rate { border-left-color: rgba(255,255,255,.1); }.saving-rate span, .saving-rate small { color: #807a76; }.saving-rate strong { color: #f0ece8; }.saving-rate .progress { background: #242220; }.saving-rate .progress i { background: linear-gradient(90deg,#837b74,#eee6df); }
.ledger-grid { width: min(100% - 48px, 1120px); margin: auto; gap: 72px; }.ledger-panel { min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }.ledger-panel-header { padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.1); }.ledger-panel-header h2, .section-header h2 { color: #eae5e1; font-size: 1.5rem; letter-spacing: -.05em; }.ledger-page .btn-secondary { color: #aaa39e; border-color: rgba(255,255,255,.13); border-radius: 99px; background: transparent; }.ledger-page .btn-secondary:hover { color: #f3eeea; background: rgba(255,255,255,.06); }
.account-row, .recent-row { border-bottom-color: rgba(255,255,255,.07); }.account-row b, .recent-row strong { color: #e7e2de; }.account-icon, .recent-type { background: rgba(255,255,255,.055); color: #bdb5af; border-radius: 50%; }.recent-type.income, .recent-type.expense, .recent-row strong.income, .recent-row strong.expense { color: #e7e2de; }.recent-row small, .ledger-empty { color: #716c68; }.ledger-history-link { color: #d4cdc7; }.ledger-history-link:hover { color: #fff; }.ledger-history { width: min(100% - 48px, 1120px); margin: 112px auto 0; }.ledger-history .section-header { border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 18px; }.ledger-history .table-wrapper { border: 0; border-radius: 0; }.ledger-history thead { background: transparent; }.ledger-history th { color: #6f6965; border-bottom-color: rgba(255,255,255,.1); }.ledger-history td { border-bottom-color: rgba(255,255,255,.07); }.ledger-history .amount-income, .ledger-history .amount-expense { color: #e7e2de; }.ledger-history .badge-income, .ledger-history .badge-expense { background: transparent; border: 1px solid rgba(255,255,255,.12); color: #b6b0ab; }
.ledger-page .modal { border-color: rgba(255,240,226,.14); background: #151414; box-shadow: 0 30px 90px rgba(0,0,0,.75); }.ledger-page .ledger-eyebrow { color: #77716d; }.ledger-page .form-control { border-color: rgba(255,255,255,.11); background: #0e0e0e; }.ledger-type-toggle { background: #0c0c0c; }.ledger-type-toggle button.active { background: #282625; }.ledger-page .btn-danger { border-radius: 99px; }
.dashboard-page .modal { border-color: rgba(255,240,226,.14); background-color: #151414; background-image: linear-gradient(125deg,rgba(255,255,255,.1) 0%,rgba(255,255,255,.015) 16%,rgba(205,210,220,.08) 32%,rgba(255,255,255,.015) 48%,rgba(215,218,226,.09) 66%,rgba(255,255,255,.015) 82%,rgba(200,204,214,.06) 100%); box-shadow: 0 30px 90px rgba(0,0,0,.75); }.dashboard-page .ledger-eyebrow { color: #77716d; }.dashboard-page .btn-primary { background: #f2efec; color: #111; border-radius: 99px; box-shadow: none; font-weight: 700; transition: transform .25s ease, background .25s ease; }.dashboard-page .btn-primary:hover { background: #fff; transform: translateY(-2px); }
@keyframes ledgerReveal { from { opacity: 0; transform: translateY(18px); filter: blur(5px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }
@keyframes ledgerOrbTop { 0% { transform: translate3d(-11%,-1%,0) scale(.92); opacity:.65; } 50% { transform: translate3d(9%,9%,0) scale(1.06); opacity:1; } 100% { transform: translate3d(19%,-6%,0) scale(.97); opacity:.74; } }
@keyframes ledgerOrbBottom { 0% { transform: translate3d(14%,8%,0) scale(1.05); opacity:.67; } 50% { transform: translate3d(-12%,-8%,0) scale(.91); opacity:1; } 100% { transform: translate3d(-3%,5%,0) scale(1.09); opacity:.72; } }
@media (prefers-reduced-motion: reduce) { .ledger-hero *, .ledger-stats > *, .ledger-orb { animation: none !important; opacity: 1 !important; filter: none !important; transform: none !important; } }
@media (max-width: 900px) { .ledger-stats { grid-template-columns: repeat(2, 1fr); }.ledger-stats > *, .ledger-stats .stat-card { border-bottom: 1px solid rgba(255,255,255,.1); }.ledger-stats > *:nth-child(2) { border-right: 0; }.ledger-story { gap: 45px; }.ledger-grid { gap: 52px; } }
@media (max-width: 600px) { .ledger-hero { min-height: 610px; padding: 126px 24px 70px; }.ledger-orb { width: 130vw; }.ledger-hero h1 { font-size: clamp(2.7rem,14vw,4rem); }.ledger-actions { flex-direction: column; }.ledger-actions .form-control, .ledger-actions .btn { width: 100%; }.ledger-stats, .ledger-story, .ledger-grid, .ledger-history { width: min(100% - 32px, 1120px); }.ledger-stats { grid-template-columns: 1fr; }.ledger-stats > *, .ledger-stats .stat-card { min-height: 136px; border-right: 0; }.ledger-story { margin: 72px auto; }.saving-rate { padding-left: 0; }.ledger-grid { gap: 48px; }.ledger-history { margin-top: 82px; } }

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
button { font-family: var(--font); cursor: pointer; border: none; outline: none; }
input, select, textarea { font-family: var(--font); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--bg-overlay); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Typography ── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; color: var(--text-1); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p { color: var(--text-2); }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page-content { padding: 32px 0 64px; }

/* ── AUTH PAGE ── */
.auth-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.auth-brand {
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1200 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 80%, rgba(245,158,11,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 56px;
}
.auth-brand-logo .logo-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; color: #000;
}
.auth-brand-logo .logo-text {
  font-size: 1.2rem; font-weight: 800;
  letter-spacing: 0.05em; color: var(--text-1);
}
.auth-tagline {
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-1);
  margin-bottom: 24px;
}
.auth-tagline span { color: var(--accent); }
.auth-description { color: var(--text-2); font-size: 1.05rem; max-width: 380px; margin-bottom: 48px; }
.auth-features { display: flex; flex-direction: column; gap: 16px; }
.auth-feature {
  display: flex; align-items: center; gap: 14px;
}
.auth-feature-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.auth-feature-text { font-size: 0.9rem; color: var(--text-2); }
.auth-feature-text strong { color: var(--text-1); }

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 64px;
  background: var(--bg-surface);
}
.auth-box { width: 100%; max-width: 420px; }
.auth-box h2 { font-size: 1.6rem; margin-bottom: 8px; }
.auth-box .subtitle { color: var(--text-2); margin-bottom: 32px; font-size: 0.9rem; }

/* Auth tabs */
.auth-tabs {
  display: flex;
  background: var(--bg-elevated);
  border-radius: var(--r);
  padding: 4px;
  margin-bottom: 32px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: calc(var(--r) - 2px);
  color: var(--text-2);
  background: transparent;
  transition: all var(--transition);
}
.auth-tab.active {
  background: var(--bg-overlay);
  color: var(--text-1);
  box-shadow: var(--shadow-sm);
}
.auth-tab:hover:not(.active) { color: var(--text-1); }

/* ── NAVBAR ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: transparent;
  backdrop-filter: none;
  border-bottom: none;
  height: 64px;
  display: flex; align-items: center;
}
.navbar-inner {
  width: 100%; max-width: 1280px; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.navbar-logo {
  position: relative;
  display: block;
  width: 128px;
  height: 44px;
  overflow: hidden;
  text-decoration: none;
}
.navbar-logo img { position: absolute; width: 200px; max-width: none; top: -61px; left: -15px; }
.navbar-menu { display: flex; align-items: center; }
.navbar-menu-panel {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 0;
  margin-right: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateX(10px);
  transition: max-width 520ms cubic-bezier(0.16, 1, 0.3, 1), margin-right 520ms cubic-bezier(0.16, 1, 0.3, 1), opacity 240ms ease, transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.navbar-menu.is-open .navbar-menu-panel {
  max-width: 440px;
  margin-right: 12px;
  opacity: 1;
  transform: translateX(0);
}
.navbar-menu-panel a,
.navbar-menu-panel button {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease;
}
.navbar-menu-panel a:hover,
.navbar-menu-panel button:hover {
  background: rgba(255,255,255,0.065);
  color: var(--text-1);
}
.navbar-menu-panel .coming-soon { opacity: 0.43; pointer-events: none; }
.navbar-menu-panel .badge {
  font-size: 10px; font-weight: 700;
  background: var(--bg-overlay);
  color: var(--text-3);
  padding: 2px 6px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.navbar-menu-separator { width: 1px; height: 18px; margin: 0 3px; background: var(--border); }
.navbar-menu-panel #btn-logout { color: #d6d1cd; }
.navbar-menu-trigger {
  min-width: 64px;
  padding: 8px 13px;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  color: #ece9e7;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.navbar-menu-trigger:hover {
  border-color: rgba(255, 235, 217, 0.34);
  background: rgba(255,255,255,0.09);
  transform: translateY(-1px);
}
.navbar-menu-trigger[aria-expanded="true"] { background: rgba(255,255,255,0.11); }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-1);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-control::placeholder { color: var(--text-3); }
select.form-control { appearance: none; cursor: pointer; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-error {
  font-size: 0.82rem; color: var(--expense);
  margin-top: 8px; display: none;
}
.form-error.visible { display: block; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 0.9rem; font-weight: 600;
  border-radius: var(--r);
  transition: all var(--transition);
  cursor: pointer; border: none;
}
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-1);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-overlay); border-color: rgba(255,255,255,0.12); }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-1); }
.btn-danger {
  background: var(--expense-dim);
  color: var(--expense);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-sm { padding: 7px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn .spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-secondary .spinner, .btn-ghost .spinner {
  border-color: rgba(255,255,255,0.2);
  border-top-color: var(--text-1);
}

/* ── CARDS ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}
.card-elevated {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color var(--transition), transform var(--transition);
}
.stat-card:hover { border-color: rgba(255,255,255,0.12); transform: translateY(-2px); }
.stat-card .stat-label {
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3);
}
.stat-card .stat-value {
  font-size: 2rem; font-weight: 800; line-height: 1;
}
.stat-card .stat-sub { font-size: 0.8rem; color: var(--text-3); }
.stat-card.income .stat-value { color: var(--income); }
.stat-card.expense .stat-value { color: var(--expense); }
.stat-card.saving .stat-value { color: var(--accent); }

/* Feature cards (dashboard) */
.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px;
  cursor: pointer;
  transition: all 0.22s ease;
  text-decoration: none;
  display: flex; flex-direction: column; gap: 16px;
  position: relative; overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 0% 0%, var(--accent-dim) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.feature-card:hover { border-color: rgba(245,158,11,0.3); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-card:hover::before { opacity: 1; }
.feature-card.disabled {
  cursor: default; opacity: 0.5;
}
.feature-card.disabled:hover { transform: none; box-shadow: none; border-color: var(--border); }
.feature-card.disabled:hover::before { opacity: 0; }
.feature-icon {
  width: 48px; height: 48px;
  background: var(--accent-dim);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.feature-card h3 { font-size: 1.1rem; color: var(--text-1); }
.feature-card p { font-size: 0.875rem; color: var(--text-2); line-height: 1.5; }
.feature-arrow {
  margin-top: auto;
  font-size: 0.8rem; font-weight: 600;
  color: var(--accent);
  display: flex; align-items: center; gap: 6px;
}
.feature-card .coming-badge {
  font-size: 0.7rem; font-weight: 700;
  background: var(--bg-overlay);
  color: var(--text-3);
  padding: 4px 10px; border-radius: 99px;
  align-self: flex-start;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ── TABLES ── */
.table-wrapper { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-elevated); }
thead th {
  padding: 12px 16px;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3); text-align: left;
  border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-elevated); }
tbody td { padding: 14px 16px; font-size: 0.875rem; color: var(--text-1); vertical-align: middle; }
.badge-income, .badge-expense {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.75rem; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
}
.badge-income { background: var(--income-dim); color: var(--income); }
.badge-expense { background: var(--expense-dim); color: var(--expense); }
.amount-income { color: var(--income); font-weight: 700; }
.amount-expense { color: var(--expense); font-weight: 700; }
.table-actions { display: flex; gap: 8px; }
.table-empty {
  text-align: center; padding: 64px 24px;
  color: var(--text-3); font-size: 0.9rem;
}
.table-empty .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; visibility: hidden;
  transition: all 0.2s ease;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px;
  width: 100%; max-width: 520px;
  transform: scale(0.95) translateY(16px);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-lg);
}
.modal-backdrop.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.modal-header h3 { font-size: 1.1rem; }
.modal-close {
  width: 32px; height: 32px;
  background: var(--bg-overlay); border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 16px;
  cursor: pointer; transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-base); color: var(--text-1); }
.modal-footer { display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end; }

/* ── RECURSOS — Document viewer ── */
.recursos-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
.resources-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: sticky; top: 88px;
}
.resources-sidebar-header {
  padding: 16px 20px;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.resource-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.resource-item:last-child { border-bottom: none; }
.resource-item:hover { background: var(--bg-elevated); }
.resource-item.active { background: var(--accent-dim); }
.resource-item.active .resource-title { color: var(--accent); }
.resource-icon { font-size: 18px; flex-shrink: 0; }
.resource-title { font-size: 0.875rem; font-weight: 600; color: var(--text-1); line-height: 1.3; }
.resource-desc { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }

.doc-viewer {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 48px;
  min-height: 500px;
}
.doc-viewer-placeholder {
  height: 400px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; color: var(--text-3); text-align: center;
}
.doc-viewer-placeholder .icon { font-size: 3rem; }

/* Markdown styles inside viewer */
.doc-viewer h1 { font-size: 2rem; margin-bottom: 16px; color: var(--text-1); }
.doc-viewer h2 { font-size: 1.4rem; margin: 32px 0 12px; color: var(--text-1); padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.doc-viewer h3 { font-size: 1.1rem; margin: 24px 0 8px; color: var(--text-1); }
.doc-viewer p { color: var(--text-2); margin-bottom: 16px; line-height: 1.75; }
.doc-viewer ul, .doc-viewer ol { color: var(--text-2); margin: 0 0 16px 24px; line-height: 1.75; }
.doc-viewer li { margin-bottom: 6px; }
.doc-viewer strong { color: var(--text-1); font-weight: 600; }
.doc-viewer em { color: var(--accent); font-style: normal; font-weight: 600; }
.doc-viewer blockquote {
  border-left: 3px solid var(--accent);
  margin: 24px 0; padding: 16px 20px;
  background: var(--accent-dim); border-radius: 0 var(--r) var(--r) 0;
  color: var(--text-2);
}
.doc-viewer code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px;
  font-size: 0.85em; color: var(--accent);
}
.doc-viewer hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ── MISC ── */
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 1.8rem; margin-bottom: 8px; }
.page-header p { font-size: 0.9rem; color: var(--text-2); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-header h2 { font-size: 1rem; font-weight: 700; }
.month-selector {
  display: flex; align-items: center; gap: 8px;
}
.month-selector select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-1);
  padding: 8px 12px;
  font-size: 0.875rem;
}
.divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 20px;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  transform: translateY(80px); opacity: 0;
  transition: all 0.25s ease;
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(16,185,129,0.3); }
.toast.success .toast-icon { color: var(--income); }
.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.error .toast-icon { color: var(--expense); }

/* ── LEDGER GRIT ── */
.ledger-shell { padding-top: 20px; padding-bottom: 96px; }
.ledger-hero { min-height: 230px; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 48px 0; position: relative; overflow: hidden; }
.ledger-hero::after { content: ''; position: absolute; width: 560px; height: 280px; right: -130px; top: -150px; border-radius: 50%; background: radial-gradient(ellipse, rgba(245,158,11,.11), transparent 68%); pointer-events: none; }
.ledger-eyebrow { color: var(--accent); font-size: .68rem; letter-spacing: .16em; font-weight: 800; margin-bottom: 9px; }
.ledger-hero h1 { font-size: clamp(2.55rem, 5.6vw, 4.5rem); letter-spacing: -.07em; line-height: .98; position: relative; z-index: 1; }
.ledger-hero h1 span { color: var(--text-2); }
.ledger-actions { display: flex; gap: 10px; align-items: center; position: relative; z-index: 1; }
.ledger-actions .form-control { width: auto; min-width: 168px; padding: 10px 34px 10px 12px; }
.ledger-stats { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.ledger-balance-card { min-height: 160px; padding: 26px; display: flex; flex-direction: column; gap: 8px; border: 1px solid rgba(245,158,11,.28); border-radius: var(--r-lg); background: linear-gradient(135deg, rgba(245,158,11,.13), rgba(245,158,11,.025)); box-shadow: var(--shadow-accent); }
.ledger-balance-card span, .ledger-balance-card small { color: var(--text-2); font-size: .82rem; }.ledger-balance-card strong { color: var(--text-1); font-size: clamp(2rem, 3.5vw, 3rem); letter-spacing: -.06em; line-height: 1.12; }.ledger-balance-card small { color: var(--text-3); }
.ledger-stats .stat-card { min-height: 160px; padding: 26px; justify-content: center; }
.ledger-story { display: grid; grid-template-columns: 1.35fr 1fr; gap: 38px; margin-bottom: 14px; padding: 30px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-surface); }.ledger-story h2 { letter-spacing: -.045em; }.ledger-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; color: var(--text-2); }.ledger-flow b { color: var(--text-1); }.ledger-flow i { font-style: normal; color: var(--accent); }
.saving-rate { align-self: center; padding-left: 34px; border-left: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 7px; }.saving-rate span { color: var(--text-2); font-size: .85rem; }.saving-rate strong { font-size: 1.55rem; line-height: 1; }.saving-rate .progress { grid-column: 1 / -1; height: 7px; margin: 8px 0 4px; background: var(--bg-overlay); border-radius: 999px; overflow: hidden; }.saving-rate .progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .65s cubic-bezier(.16,1,.3,1); }.saving-rate small { grid-column: 1 / -1; color: var(--text-3); }
.ledger-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 14px; }.ledger-panel { min-height: 280px; padding: 26px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-surface); }.ledger-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 23px; }.ledger-panel-header h2, .section-header h2 { font-size: 1.2rem; letter-spacing: -.035em; }
.accounts-list { display: grid; gap: 4px; }.account-row, .recent-row, .manager-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }.account-row:last-child, .recent-row:last-child, .manager-row:last-child { border-bottom: 0; }.account-row b { margin-left: auto; }.account-icon, .recent-type { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px; background: var(--bg-overlay); color: var(--accent); font-size: .8rem; }.recent-list { display: grid; }.recent-row { justify-content: space-between; }.recent-row > div { display: flex; align-items: center; gap: 10px; }.recent-row b { display: block; font-size: .88rem; }.recent-row small { display: block; color: var(--text-3); font-size: .72rem; }.recent-type.income, .recent-row strong.income { color: var(--income); }.recent-type.expense, .recent-row strong.expense { color: var(--expense); }.ledger-history-link { color: var(--accent); background: transparent; font-size: .82rem; font-weight: 700; padding: 19px 0 0; }.ledger-history-link:hover { color: var(--text-1); }.ledger-empty { color: var(--text-3); font-size: .88rem; padding: 20px 0; }.ledger-history { margin-top: 44px; }.ledger-history .section-header { margin-bottom: 16px; }
.ledger-modal { max-width: 560px; }.ledger-type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 20px; background: var(--bg-input); border-radius: var(--r-sm); }.ledger-type-toggle button { padding: 10px; background: transparent; border-radius: 6px; color: var(--text-2); font-weight: 700; }.ledger-type-toggle button.active { background: var(--bg-overlay); color: var(--text-1); }.ledger-amount { font-size: 1.8rem; font-weight: 700; letter-spacing: -.04em; }.form-label span { font-weight: 400; text-transform: none; letter-spacing: normal; color: var(--text-3); }
.manager-modal { max-width: 530px; }.manager-add { display: grid; grid-template-columns: 1.4fr .8fr auto; gap: 8px; margin-bottom: 18px; }.manager-list { max-height: 330px; overflow: auto; }.manager-row small { margin-left: auto; color: var(--text-3); }.manager-row button { width: 27px; height: 27px; border-radius: 7px; background: transparent; color: var(--text-3); font-size: 1.25rem; }.manager-row button:hover { color: var(--expense); background: var(--expense-dim); }

/* ── DASHBOARD welcome ── */
.welcome-bar {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px 40px;
  margin-bottom: 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: relative; overflow: hidden;
}
.welcome-bar::after {
  content: 'G';
  position: absolute; right: 40px; top: 50%; transform: translateY(-50%);
  font-size: 120px; font-weight: 900; color: rgba(245,158,11,0.06);
  line-height: 1; pointer-events: none;
}
.welcome-bar h1 { font-size: 1.5rem; margin-bottom: 4px; }
.welcome-bar p { color: var(--text-2); font-size: 0.9rem; }
.welcome-bar .welcome-badge {
  background: var(--accent-dim);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 99px;
  padding: 6px 16px;
  font-size: 0.8rem; font-weight: 600;
  color: var(--accent);
}

/* ── DASHBOARD · Hero de bienvenida ────────────────────────── */
.dashboard-home {
  max-width: none;
  padding: 0;
}
.dashboard-page .navbar {
  position: absolute;
  width: 100%;
}
.dashboard-hero {
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 140px 24px 88px;
  background: #000;
}
.dashboard-hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
  text-align: center;
}
.dashboard-greeting {
  margin-bottom: 18px;
  color: #a3a3a3;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  opacity: 0;
  animation: dashboardHeroReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}
.dashboard-hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #f5f5f5;
  font-size: clamp(2.7rem, 7vw, 6.25rem);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 0.94;
}
.dashboard-hero-title > span {
  opacity: 0;
  animation: dashboardHeroReveal 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}
.dashboard-hero-glow {
  color: #fff9f3;
  white-space: nowrap;
  font-size: clamp(2rem, 6vw, 6.25rem);
  text-shadow:
    0 0 7px rgba(255, 255, 255, 0.95),
    0 0 20px rgba(255, 220, 187, 0.8),
    0 0 48px rgba(255, 177, 107, 0.48);
}
.dashboard-hero-title > span:last-child {
  margin-top: 8px;
  color: #a6a09d;
  font-size: 0.62em;
  font-weight: 600;
  letter-spacing: -0.045em;
  animation-delay: 0.55s;
}
.dashboard-hero-description {
  max-width: 480px;
  margin: 30px auto 0;
  color: #8c8783;
  font-size: clamp(0.92rem, 1.3vw, 1.05rem);
  line-height: 1.65;
  opacity: 0;
  animation: dashboardHeroReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.75s forwards;
}
.dashboard-hero-orb {
  position: absolute;
  z-index: -1;
  width: min(56vw, 720px);
  aspect-ratio: 1;
  border: 1px solid rgba(122, 14, 18, 0.5);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(122, 14, 18, 0.18), rgba(122, 14, 18, 0.045) 42%, transparent 70%);
  box-shadow:
    inset 0 0 48px rgba(122, 14, 18, 0.24),
    0 0 3px rgba(160, 35, 39, 0.45),
    0 0 32px rgba(122, 14, 18, 0.28),
    0 18px 48px rgba(0, 0, 0, 0.65);
}
.dashboard-hero-orb-top {
  top: -48%;
  animation: dashboardOrbTopDrift 24s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}
.dashboard-hero-orb-bottom {
  bottom: -58%;
  animation: dashboardOrbBottomDrift 21s cubic-bezier(0.45, 0, 0.55, 1) -7s infinite alternate;
}
.dashboard-home > :not(.dashboard-hero) {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.dashboard-home .welcome-bar { margin-top: 64px; }
.dashboard-home > .divider { margin-top: 32px; }

/* ── DASHBOARD · Carrusel de accesos ───────────────────────── */
.dashboard-home > .dashboard-carousel {
  max-width: none;
  margin: 0;
}
.dashboard-carousel {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  padding: 132px 24px 104px;
  background:
    linear-gradient(to bottom, #000 0%, #080808 13%, #0c0c0c 100%);
}
.dashboard-carousel::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 180px;
  background: linear-gradient(to bottom, #000, transparent);
  pointer-events: none;
}
.dashboard-carousel-heading {
  position: relative;
  z-index: 1;
  text-align: center;
}
.dashboard-carousel-heading p,
.dashboard-card-kicker {
  color: #77716d;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.dashboard-carousel-heading h2 {
  margin-top: 8px;
  color: #efedeb;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  letter-spacing: -0.05em;
}
.dashboard-scroll-reveal .dashboard-carousel-heading,
.dashboard-scroll-reveal .dashboard-carousel-stage,
.dashboard-scroll-reveal .dashboard-carousel-controls {
  opacity: 0;
  transform: translateY(32px);
  filter: blur(7px);
  transition: opacity 850ms cubic-bezier(0.16, 1, 0.3, 1), transform 850ms cubic-bezier(0.16, 1, 0.3, 1), filter 680ms ease;
}
.dashboard-scroll-reveal.is-visible .dashboard-carousel-heading,
.dashboard-scroll-reveal.is-visible .dashboard-carousel-stage,
.dashboard-scroll-reveal.is-visible .dashboard-carousel-controls {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.dashboard-scroll-reveal.is-visible .dashboard-carousel-stage { transition-delay: 140ms; }
.dashboard-scroll-reveal.is-visible .dashboard-carousel-controls { transition-delay: 250ms; }
.dashboard-carousel-stage {
  position: relative;
  width: min(100%, 620px);
  height: 350px;
  margin: 52px auto 34px;
  perspective: 1100px;
}
.dashboard-carousel-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  padding: 48px;
  border: 1px solid rgba(255, 240, 226, 0.13);
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 212, 174, 0.1), transparent 46%),
    linear-gradient(145deg, #1a1919, #101010 75%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  color: #f7f5f3;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 22px, -140px) scale(0.82);
  transition:
    transform 760ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 560ms ease,
    filter 560ms ease;
  will-change: transform, opacity;
}
.dashboard-carousel-card h3 {
  color: #f7f5f3;
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  letter-spacing: -0.055em;
}
.dashboard-carousel-card p {
  max-width: 390px;
  color: #aaa4a0;
  font-size: 1rem;
  line-height: 1.65;
}
.dashboard-card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: #eee9e5;
  font-size: 0.86rem;
  font-weight: 700;
}
.dashboard-card-link b {
  font-size: 1.15rem;
  font-weight: 400;
  transition: transform 180ms ease;
}
.dashboard-carousel-card.is-active {
  z-index: 3;
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) rotateX(0deg) scale(1);
}
.dashboard-carousel-card.is-active:hover .dashboard-card-link b { transform: translateX(4px); }

/* Identidad de cada feature: color contenido en el perímetro, no en el contenido. */
.dashboard-carousel-card { --feature-glow: rgba(255,255,255,0.22); --feature-core: rgba(255,255,255,0.9); }
.dashboard-carousel-card:nth-child(1) { --feature-glow: rgba(197, 61, 61, 0.5); --feature-core: #ee8a83; }
.dashboard-carousel-card:nth-child(2) { --feature-glow: rgba(52, 160, 112, 0.48); --feature-core: #7ed4a6; }
.dashboard-carousel-card:nth-child(3) { --feature-glow: rgba(70, 133, 224, 0.52); --feature-core: #87b7ff; }
.dashboard-carousel-card { isolation: isolate; }
.dashboard-carousel-card > * { position: relative; z-index: 1; }
.dashboard-carousel-card.is-active::before {
  content: '';
  position: absolute;
  z-index: 0;
  inset: -2px;
  padding: 2px;
  border-radius: inherit;
  background: conic-gradient(from var(--grit-angle),
    rgba(226, 228, 235, 0.55) 0deg,
    rgba(226, 228, 235, 0.55) 296deg,
    var(--feature-glow) 322deg,
    var(--feature-core) 340deg,
    #ffffff 350deg,
    var(--feature-core) 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: featureBorderDrift 6s linear infinite;
}
.dashboard-carousel-card.is-active::after {
  content: '';
  position: absolute;
  z-index: 0;
  inset: -22px;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 100%, var(--feature-glow), transparent 66%);
  opacity: 0.2;
  filter: blur(19px);
  animation: featureHaloBreathe 5.5s ease-in-out infinite alternate;
  pointer-events: none;
}
@property --grit-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
.dashboard-carousel-card { --grit-angle: 0deg; }
@keyframes featureBorderDrift { to { --grit-angle: 360deg; } }
@keyframes featureHaloBreathe { from { opacity: 0.13; transform: scale(0.96); } to { opacity: 0.3; transform: scale(1.035); } }
.dashboard-carousel-card.is-next,
.dashboard-carousel-card.is-previous {
  z-index: 2;
  opacity: 0.37;
  filter: blur(1px);
}
.dashboard-carousel-card.is-next {
  transform: translate3d(220px, 24px, -160px) rotateY(-9deg) scale(0.86);
}
.dashboard-carousel-card.is-previous {
  transform: translate3d(-220px, 24px, -160px) rotateY(9deg) scale(0.86);
}
.dashboard-carousel-controls {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.dashboard-carousel-arrow {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 50%;
  background: rgba(255,255,255,0.035);
  color: #d8d4d1;
  font-size: 1.1rem;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.dashboard-carousel-arrow:hover {
  border-color: rgba(255, 235, 217, 0.35);
  background: rgba(255,255,255,0.09);
  transform: scale(1.06);
}
.dashboard-carousel-status { min-width: 92px; text-align: center; }
.dashboard-carousel-count {
  display: block;
  color: #e9e5e2;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.dashboard-carousel-count small {
  color: #77716d;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0;
}
.dashboard-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.dashboard-carousel-dots button {
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: #4c4947;
  transition: width 280ms ease, background 280ms ease;
}
.dashboard-carousel-dots button.is-active {
  width: 19px;
  background: #e5dfda;
}

@keyframes dashboardHeroReveal {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes dashboardOrbTopDrift {
  0% {
    transform: translate3d(-12%, -2%, 0) scale(0.9);
    opacity: 0.68;
  }
  45% {
    transform: translate3d(8%, 10%, 0) scale(1.08);
    opacity: 1;
  }
  100% {
    transform: translate3d(20%, -7%, 0) scale(0.96);
    opacity: 0.75;
  }
}

@keyframes dashboardOrbBottomDrift {
  0% {
    transform: translate3d(14%, 8%, 0) scale(1.05);
    opacity: 0.72;
  }
  50% {
    transform: translate3d(-13%, -9%, 0) scale(0.9);
    opacity: 1;
  }
  100% {
    transform: translate3d(-4%, 5%, 0) scale(1.1);
    opacity: 0.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-greeting,
  .dashboard-hero-title span,
  .dashboard-hero-description,
  .dashboard-hero-orb {
    animation: none;
    opacity: 1;
    filter: none;
    transform: none;
  }
  .dashboard-carousel-card { transition: none; }
  .dashboard-carousel-card.is-active::before,
  .dashboard-carousel-card.is-active::after { animation: none; }
}

@media (max-width: 600px) {
  .dashboard-hero { padding: 120px 20px 64px; }
  .dashboard-hero-title { font-size: clamp(2.55rem, 15vw, 4.5rem); }
  .dashboard-hero-orb { width: 125vw; }
  .dashboard-hero-orb-top { top: -28%; }
  .dashboard-hero-orb-bottom { bottom: -35%; }
  .dashboard-carousel { min-height: 660px; padding: 100px 20px 80px; }
  .dashboard-carousel-stage { height: 360px; margin-top: 42px; }
  .dashboard-carousel-card { padding: 36px 28px; }
  .dashboard-carousel-card.is-next { transform: translate3d(74px, 22px, -160px) rotateY(-7deg) scale(0.88); }
  .dashboard-carousel-card.is-previous { transform: translate3d(-74px, 22px, -160px) rotateY(7deg) scale(0.88); }
}

/* ── Animations ── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.fade-in { animation: fadeIn 0.3s ease forwards; }
.loading { animation: pulse 1.5s ease infinite; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { padding: 48px 32px; }
  .features-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .recursos-layout { grid-template-columns: 1fr; }
  .resources-sidebar { position: static; }
  .doc-viewer { padding: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .ledger-stats { grid-template-columns: repeat(2, 1fr); }.ledger-balance-card { grid-column: span 2; }.ledger-grid, .ledger-story { grid-template-columns: 1fr; }.saving-rate { padding: 22px 0 0; border: 0; border-top: 1px solid var(--border); }
  .welcome-bar { padding: 24px; }
  .welcome-bar::after { display: none; }
}
@media (max-width: 600px) {
  .navbar-inner { padding: 0 16px; }
  .navbar-user { display: none; }
  .container { padding: 0 16px; }
  /* El home es una experiencia a sangre: no debe heredar el padding de páginas internas. */
  .container.dashboard-home { padding: 0; }
  .stats-grid { grid-template-columns: 1fr; }
  .ledger-shell { padding-top: 0; }.ledger-hero { min-height: 0; align-items: flex-start; flex-direction: column; padding: 42px 0 34px; }.ledger-actions { width: 100%; }.ledger-actions .form-control { flex: 1; min-width: 0; }.ledger-stats { grid-template-columns: 1fr; }.ledger-balance-card { grid-column: auto; }.ledger-stats .stat-card, .ledger-balance-card { min-height: 125px; }.ledger-story, .ledger-panel { padding: 21px; }.manager-add { grid-template-columns: 1fr auto; }.manager-add #manager-value { grid-column: 1 / -1; }.ledger-hero h1 { font-size: 2.65rem; }
  .navbar { overflow: visible; }
  .navbar-menu { position: relative; }
  .navbar-menu-panel {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    width: 220px;
    max-width: none;
    max-height: 0;
    margin: 0;
    padding: 0 6px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: rgba(18,18,18,0.96);
    box-shadow: 0 18px 48px rgba(0,0,0,0.55);
    transform: translateY(-6px);
    transition: max-height 360ms ease, padding 360ms ease, border-color 360ms ease, opacity 180ms ease, transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  .navbar-menu.is-open .navbar-menu-panel {
    max-width: none;
    max-height: 240px;
    margin: 0;
    padding: 6px;
    border-color: var(--border);
    transform: translateY(0);
  }
  .navbar-menu-panel a,
  .navbar-menu-panel button { text-align: left; }
  .navbar-menu-separator { width: 100%; height: 1px; margin: 3px 0; }
}
