/* Elysium Patrimonio — estilos propios de cada vista. */

/* ── Inicio ───────────────────────────────────────────────────────────────── */

.dash { display: flex; flex-direction: column; gap: 16px; }
.dash-hero { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1180px) { .dash-hero { grid-template-columns: minmax(0, 1fr); } }

.spend-card {
    display: flex;
    flex-direction: column;
    border-color: rgba(220, 179, 92, 0.22);
}
.spend-card .card-head { margin-bottom: 6px; }
.spend-value {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.6vw, 2.6rem);
    font-weight: 560;
    letter-spacing: -0.035em;
    line-height: 1.05;
    color: var(--text);
}
.spend-sub { font-size: 0.86rem; margin-top: 6px; }
.spend-bar { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.spend-foot { margin-top: auto; padding-top: 16px; display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-2); border-top: 1px solid var(--line); margin-inline: -20px; padding-inline: 20px; margin-bottom: -4px; }
.spend-card .spend-bar + .spend-foot, .spend-card .link-btn + .spend-foot { margin-top: 18px; }
.spend-card > .link-btn { margin-top: 16px; display: inline-flex; align-items: center; gap: 4px; }

.dreams-card {
    border-color: rgba(220, 179, 92, 0.28);
    box-shadow: var(--shadow-soft), 0 0 24px -10px rgba(220, 179, 92, 0.12);
}
.dream-list { display: flex; flex-direction: column; gap: 8px; }
.dream {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 18px;
    color: inherit;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    transition: background 0.2s, transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.dream:hover {
    background: var(--surface-hover);
    border-color: var(--gold-line);
    transform: translateX(4px);
    box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.4);
    color: inherit;
}
.dream .ring-center { color: var(--gold-text); }
.dream-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dream-main b { font-size: 1.08rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dream-main small { color: var(--text-2); font-size: 0.78rem; }
.dream-main small.is-danger { color: var(--danger); }
.dream-pct {
    font-family: var(--font-display);
    font-weight: 580;
    font-size: 1.45rem;
    letter-spacing: -0.03em;
    color: var(--gold-text);
    text-shadow: 0 2px 12px rgba(220, 179, 92, 0.25);
}

.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    color: var(--text);
}
a.alert-item:hover { border-color: var(--line-strong); color: var(--text); }
.alert-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--accent-soft); color: var(--accent); }
.alert-item.is-warning .alert-icon { background: var(--warn-soft); color: var(--warn); }
.alert-item.is-danger .alert-icon { background: var(--danger-soft); color: var(--danger); }
.alert-item.is-success .alert-icon { background: var(--gold-soft); color: var(--gold-text); }
.alert-item.is-danger { border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-body { min-width: 0; }
.alert-body h3 { font-size: 0.9rem; font-weight: 620; }
.alert-body p { color: var(--text-2); font-size: 0.84rem; margin-top: 2px; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.link-btn.is-muted { color: var(--text-3); }
.link-btn.is-muted:hover { color: var(--text); }
.alert-list.is-compact .alert-item { padding: 10px 12px; }
.alert-list.is-compact .alert-body p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.calm { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 0.9rem; padding: 6px 2px; }
.calm .i, .ok-icon { color: var(--ok); }

.upcoming { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.upcoming li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 4px; }
.upcoming-main { display: flex; flex-direction: column; min-width: 0; }
.upcoming-main b { font-size: 0.88rem; font-weight: 580; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-main small { color: var(--text-3); font-size: 0.74rem; }
.upcoming-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-weight: 600; font-size: 0.88rem; }
.upcoming li.is-overdue .upcoming-main small { color: var(--warn); }

.level-panel { display: flex; flex-direction: column; gap: 12px; color: inherit; background: linear-gradient(160deg, var(--gold-soft), var(--surface) 55%); border-color: var(--gold-line); }
.level-track { display: flex; flex-direction: column; gap: 6px; }
.level-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.level-stats div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border-radius: 14px; background: var(--surface-sunken); border: 1px solid var(--line); }
.level-stats .i { color: var(--gold-text); }
.level-stats b { font-size: 1.3rem; font-weight: 560; font-family: var(--font-display); }
.level-stats small { color: var(--text-3); font-size: 0.72rem; }
.next-badge { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }

/* Móvil: el orden cambia para que lo más consultado quede arriba. */
@media (max-width: 760px) {
    .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-kpis .kpi { min-height: 116px; }
    .dash-kpis .spark { display: none; }
    .kpi-value { font-size: 1.28rem; }
}

/* ── Movimientos ──────────────────────────────────────────────────────────── */

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.search-field { position: relative; flex: 1; min-width: 220px; }
.search-field .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-field input { padding-left: 40px !important; }
.period-summary { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 14px 16px; border-radius: 16px; background: var(--surface-sunken); border: 1px solid var(--line); margin-bottom: 14px; }
.period-summary .kv b { font-size: 1.05rem; }
.list-day .amt { font-weight: 600; letter-spacing: 0; text-transform: none; }
.load-more { display: flex; justify-content: center; padding: 16px 0 4px; }

.tx-detail { display: flex; flex-direction: column; gap: 16px; }
.tx-detail-amount { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0 6px; font-family: var(--font-display); font-size: 2.6rem; font-weight: 300; letter-spacing: -0.04em; }
.tx-detail-amount small { font-family: var(--font); font-size: 0.85rem; letter-spacing: 0; color: var(--text-3); }
.tx-detail-amount.is-income .amt { color: var(--pos); }
.detail-list { margin: 0; display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; }
.detail-list > div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list > div.is-block { flex-direction: column; align-items: flex-start; gap: 4px; }
.detail-list dt { color: var(--text-3); font-size: 0.8rem; }
.detail-list dd { margin: 0; display: flex; align-items: center; gap: 8px; text-align: right; min-width: 0; }
.detail-list .is-block dd { text-align: left; color: var(--text-2); }
.detail-list dd.mono { font-family: var(--font-mono); font-size: 0.72rem; word-break: break-all; }
.receipt-preview, .receipt-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft); color: var(--text); font-size: 0.86rem; }
.receipt-preview span, .receipt-chip span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-preview .i, .receipt-chip .i { color: var(--accent); }
.receipt-chip.is-new { background: var(--gold-soft); }

details.more { border-radius: 16px; border: 1px solid var(--line); background: var(--surface-sunken); }
details.more > summary { list-style: none; cursor: pointer; padding: 12px 14px; font-size: 0.86rem; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { color: var(--text); border-bottom: 1px solid var(--line); }
details.more > .form { padding: 14px; }

/* ── Metas ────────────────────────────────────────────────────────────────── */

.goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.goal-card { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; color: inherit; }
.goal-cover {
    position: relative;
    height: 132px;
    overflow: hidden;
    background: linear-gradient(150deg, #0e1c38, #060b18);
    isolation: isolate;
}
.goal-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.goal-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(3, 6, 12, 0.7)); }
.goal-cover .guilloche { position: absolute; width: 300px; height: 300px; right: -70px; top: -84px; color: var(--gold); opacity: 0.35; z-index: -1; }
.goal-cover .goal-kind { position: absolute; left: 16px; top: 14px; z-index: 1; }
.goal-cover .goal-pct { position: absolute; right: 16px; bottom: 10px; z-index: 1; font-family: var(--font-display); font-size: 2.1rem; font-weight: 250; letter-spacing: -0.04em; color: #fff; }
.goal-kind { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(3, 6, 12, 0.55); backdrop-filter: blur(8px); color: var(--gold-hi); font-size: 0.72rem; font-weight: 650; letter-spacing: 0.04em; }
.goal-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.goal-body h3 { font-family: var(--font-serif); font-weight: 500; font-size: 1.28rem; letter-spacing: -0.01em; }
.goal-numbers { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.84rem; color: var(--text-2); }
.goal-numbers b { color: var(--text); font-size: 1rem; }
.goal-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-3); }
.goal-card.is-done .goal-cover { background: linear-gradient(150deg, #3a2c08, #0c0a04); }
.goal-add { display: grid; place-items: center; min-height: 260px; border: 1.5px dashed var(--gold-line); background: var(--gold-soft); color: var(--gold-text); cursor: pointer; text-align: center; font-weight: 600; }
.goal-add .i { margin: 0 auto 10px; }

.kind-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.kind-option { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-sunken); color: var(--text); cursor: pointer; font-weight: 600; font-size: 0.88rem; transition: border-color 0.18s, transform 0.18s var(--ease); }
.kind-option:hover { border-color: var(--gold-line); transform: translateY(-2px); }
.kind-option .cat-chip { width: 50px; height: 50px; border-radius: 16px; }

.goal-hero { position: relative; overflow: hidden; border-radius: var(--radius-xl); min-height: 280px; display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(22px, 3vw, 34px); color: #fff; background: linear-gradient(150deg, #0e1c38, #050a15); border: 1px solid var(--gold-line); isolation: isolate; box-shadow: var(--shadow); }
.goal-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.goal-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(3, 6, 12, 0.1) 0%, rgba(3, 6, 12, 0.82) 100%); }
.goal-hero .guilloche { position: absolute; width: 520px; height: 520px; right: -150px; top: -140px; color: var(--gold); opacity: 0.3; z-index: -1; }
.goal-hero h2 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -0.02em; margin: 8px 0 6px; }
.goal-hero p { color: rgba(255, 255, 255, 0.78); max-width: 60ch; }
.goal-hero .hero-numbers { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 18px; align-items: flex-end; }
.goal-hero .hero-numbers div { display: flex; flex-direction: column; gap: 2px; }
.goal-hero .hero-numbers small { color: rgba(255, 255, 255, 0.6); font-size: 0.74rem; }
.goal-hero .hero-numbers b { font-size: 1.15rem; font-weight: 560; }
.goal-hero .ring-wrap { position: absolute; right: clamp(22px, 3vw, 34px); top: clamp(22px, 3vw, 30px); }
.goal-hero .ring-center { color: #fff; font-size: 1.05rem; font-family: var(--font-display); font-weight: 400; }
.goal-hero-actions { position: absolute; left: clamp(22px, 3vw, 34px); top: clamp(18px, 3vw, 26px); display: flex; gap: 8px; }
.goal-hero-actions .icon-btn { background: rgba(3, 6, 12, 0.45); border-color: rgba(255, 255, 255, 0.18); color: #fff; backdrop-filter: blur(8px); }
.milestones { display: flex; justify-content: space-between; margin-top: 10px; font-size: 0.72rem; color: var(--text-3); }
.milestones span.is-reached { color: var(--gold-text); font-weight: 650; }
.scenario { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface-sunken); border: 1px solid var(--line); }
.scenario + .scenario { margin-top: 8px; }
.scenario b { font-size: 0.92rem; }
.scenario small { display: block; color: var(--text-3); font-size: 0.78rem; }
.scenario .gain { text-align: right; color: var(--gold-text); font-weight: 650; font-size: 0.9rem; }
.scenario .gain small { color: var(--text-3); font-weight: 450; }
.contrib-list { display: flex; flex-direction: column; }
.contrib-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.contrib-list > div:last-child { border-bottom: 0; }
.contrib-list small { color: var(--text-3); display: block; font-size: 0.74rem; }

/* ── Simulador ────────────────────────────────────────────────────────────── */

.sim { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .sim { grid-template-columns: minmax(0, 1fr); } }
.sim-form { position: sticky; top: 96px; }
@media (max-width: 1000px) { .sim-form { position: static; } }
.verdict { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 22px; border: 1px solid var(--line-strong); background: var(--surface); isolation: isolate; }
.verdict .guilloche { position: absolute; width: 260px; height: 260px; right: -70px; top: -70px; opacity: 0.18; z-index: -1; }
.verdict.is-yes { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: linear-gradient(150deg, var(--ok-soft), var(--surface) 60%); }
.verdict.is-yes .guilloche { color: var(--ok); }
.verdict.is-caution { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: linear-gradient(150deg, var(--warn-soft), var(--surface) 60%); }
.verdict.is-caution .guilloche { color: var(--warn); }
.verdict.is-wait, .verdict.is-no { border-color: var(--accent-line); background: linear-gradient(150deg, var(--accent-soft), var(--surface) 60%); }
.verdict.is-wait .guilloche { color: var(--accent); }
.verdict h2 { font-size: 1.6rem; letter-spacing: -0.03em; margin: 6px 0 8px; }
.verdict ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 0.9rem; display: flex; flex-direction: column; gap: 4px; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .compare { grid-template-columns: minmax(0, 1fr); } }
.compare .card { display: flex; flex-direction: column; gap: 10px; }
.compare dl { margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.86rem; }
.compare dl div { display: flex; justify-content: space-between; gap: 12px; }
.compare dt { color: var(--text-2); }
.compare dd { margin: 0; font-weight: 600; text-align: right; }
.compare .big { font-family: var(--font-display); font-size: 1.7rem; font-weight: 400; letter-spacing: -0.03em; }
.dti-meter { display: flex; flex-direction: column; gap: 6px; }
.dti-scale { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-3); }

.afford-result { margin-top: 8px; min-height: 12px; }
.afford-card { display: flex; gap: 14px; padding: 16px; border-radius: 18px; border: 1px solid var(--line-strong); background: var(--surface-sunken); animation: view-in 0.3s var(--ease-out); }
.afford-card h3 { font-size: 1.2rem; letter-spacing: -0.02em; }
.afford-card p { color: var(--text-2); font-size: 0.88rem; margin-top: 4px; }
.afford-card .afford-extra { color: var(--text); }
.afford-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex-shrink: 0; }
.afford-card.is-ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); }
.afford-card.is-ok .afford-icon { color: var(--ok); background: color-mix(in srgb, var(--ok) 18%, transparent); }
.afford-card.is-warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.afford-card.is-warn .afford-icon { color: var(--warn); background: color-mix(in srgb, var(--warn) 18%, transparent); }
.afford-card.is-accent { border-color: var(--accent-line); background: var(--accent-soft); }
.afford-card.is-accent .afford-icon { color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.afford-card.is-danger .afford-icon { color: var(--danger); background: var(--danger-soft); }
.afford-basis { margin-top: 14px; }

/* ── Presupuestos, cuentas, deudas ────────────────────────────────────────── */

.budget-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 12px; border-radius: 16px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; color: inherit; }
.budget-row:hover { background: var(--surface-hover); }
.budget-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.budget-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.budget-top b { font-size: 0.94rem; font-weight: 600; }
.budget-top span { font-size: 0.84rem; color: var(--text-2); }
.budget-sub { display: flex; justify-content: space-between; gap: 12px; font-size: 0.76rem; color: var(--text-3); }
.budget-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.nature-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 150px; gap: 14px; align-items: center; padding: 10px 0; font-size: 0.88rem; }
.nature-bars { position: relative; display: flex; flex-direction: column; gap: 5px; }
.nature-row small { color: var(--text-3); }
@media (max-width: 760px) { .nature-row { grid-template-columns: minmax(0, 1fr) auto; } .nature-bars { grid-column: 1 / -1; order: 3; } }

.account-card { display: flex; flex-direction: column; gap: 14px; color: inherit; cursor: pointer; }
.account-card .row-between { align-items: flex-start; }
.account-balance { font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; letter-spacing: -0.03em; }
.account-type { font-size: 0.76rem; color: var(--text-3); }
.worth-bar { display: flex; height: 12px; border-radius: 12px; overflow: hidden; gap: 2px; background: var(--surface-sunken); }
.worth-bar span { display: block; height: 100%; }
.worth-bar .is-assets { background: var(--c-income); }
.worth-bar .is-liabilities { background: var(--c-expense); }

.debt-card { display: flex; flex-direction: column; gap: 14px; }
.debt-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.freedom { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--gold-soft); border: 1px solid var(--gold-line); font-size: 0.88rem; }
.freedom .i { color: var(--gold); }

/* ── Comprobantes ─────────────────────────────────────────────────────────── */

.receipt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.receipt-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; color: inherit; font: inherit; }
.receipt-card:hover { border-color: var(--line-strong); }
.receipt-thumb { height: 110px; border-radius: 12px; background: var(--surface-sunken); display: grid; place-items: center; overflow: hidden; color: var(--text-3); position: relative; }
.receipt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.receipt-thumb .guilloche { position: absolute; width: 160px; height: 160px; opacity: 0.15; color: var(--gold); }
.receipt-card b { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-card small { color: var(--text-3); font-size: 0.76rem; }
.inbox-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface-sunken); border: 1px solid var(--line); }
.inbox-item + .inbox-item { margin-top: 8px; }

/* ── Logros ───────────────────────────────────────────────────────────────── */

.level-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; padding: clamp(22px, 3vw, 32px); border-radius: var(--radius-xl); background: linear-gradient(150deg, #2a2108, #0b0904 70%); border: 1px solid var(--gold-line); color: #fdf8e8; isolation: isolate; box-shadow: var(--shadow); }
.level-hero .guilloche { position: absolute; width: 520px; height: 520px; right: -160px; top: -170px; color: var(--gold); opacity: 0.28; z-index: -1; }
.level-hero h2 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -0.01em; }
.level-hero p { color: rgba(253, 248, 232, 0.72); }
.level-hero .level-track small { color: rgba(253, 248, 232, 0.6); }
.level-hero .progress { background: rgba(255, 255, 255, 0.14); }
@media (max-width: 600px) { .level-hero { grid-template-columns: minmax(0, 1fr); justify-items: start; } }
.levels-road { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.levels-road span { padding: 4px 10px; border-radius: 999px; font-size: 0.72rem; background: rgba(255, 255, 255, 0.08); color: rgba(253, 248, 232, 0.55); }
.levels-road span.is-reached { background: rgba(212, 175, 55, 0.25); color: var(--gold-hi); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.badge-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 20px 14px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.badge-card.is-unlocked { border-color: var(--gold-line); background: linear-gradient(180deg, var(--gold-soft), var(--surface) 70%); }
.badge-card b { font-size: 0.92rem; }
.badge-card p { font-size: 0.76rem; color: var(--text-2); }
.badge-card .progress { width: 100%; margin-top: auto; }
.badge-card small { font-size: 0.7rem; color: var(--text-3); }
.challenge { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border-radius: 18px; background: var(--surface-sunken); border: 1px solid var(--line); }
.challenge + .challenge { margin-top: 10px; }
.challenge h3 { font-size: 0.95rem; }
.challenge p { font-size: 0.8rem; color: var(--text-2); margin-top: 2px; }
.points-table td:last-child { text-align: right; font-weight: 650; }

/* ── Ajustes ──────────────────────────────────────────────────────────────── */

.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 9px 12px; border-radius: 12px; color: var(--text-2); font-size: 0.9rem; font-weight: 540; display: flex; gap: 10px; align-items: center; }
.settings-nav a:hover, .settings-nav a.is-active { background: var(--surface-hover); color: var(--text); }
.settings-section { scroll-margin-top: 96px; }
.settings-section + .settings-section { margin-top: 16px; }
.settings-section > .card-head { margin-bottom: 18px; }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-option { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 16px; border: 1px solid var(--line-strong); background: none; cursor: pointer; color: var(--text); font-weight: 600; font-size: 0.86rem; }
.theme-option[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-swatch { height: 64px; border-radius: 10px; border: 1px solid var(--line); }
.theme-swatch.is-dark { background: radial-gradient(circle at 30% 30%, rgba(41, 151, 255, 0.35), transparent 60%), linear-gradient(150deg, #0c1322, #03060c); }
.theme-swatch.is-light { background: radial-gradient(circle at 70% 70%, rgba(212, 175, 55, 0.35), transparent 60%), linear-gradient(150deg, #fffdf8, #ebe5d8); }
.theme-swatch.is-auto { background: linear-gradient(115deg, #0c1322 50%, #f3efe6 50%); }
.category-admin { display: flex; flex-direction: column; gap: 2px; }
.category-admin button { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; border: 0; background: none; color: inherit; cursor: pointer; text-align: left; font-size: 0.9rem; }
.category-admin button:hover { background: var(--surface-hover); }
.category-admin .is-archived { opacity: 0.45; }
@media (max-width: 900px) { .settings { grid-template-columns: minmax(0, 1fr); } .settings-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; } .settings-nav a { white-space: nowrap; } }
.theme-options + .field-hint { margin-top: 8px; }

/* ── Reportes ─────────────────────────────────────────────────────────────── */

.report-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.compare-table td.is-up { color: var(--danger); }
.compare-table td.is-down { color: var(--ok); }

/* ── Menú «Más», atajos y celebración ─────────────────────────────────────── */

.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.more-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border-radius: 18px; background: var(--surface-sunken); border: 1px solid var(--line); color: var(--text); font-size: 0.82rem; font-weight: 600; text-align: center; }
.more-item small { color: var(--gold-text); font-size: 0.68rem; font-weight: 650; }
.shortcut-list { display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem; }

.celebrate { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.celebrate i {
    position: absolute;
    top: -20px;
    left: var(--x);
    width: 9px;
    height: 14px;
    border-radius: 2px;
    background: linear-gradient(160deg, var(--gold-hi), var(--gold) 60%, var(--gold-lo));
    transform: rotate(var(--r)) scale(var(--s));
    animation: fall 2.2s var(--ease) var(--d) forwards;
    opacity: 0.95;
}
@keyframes fall { to { transform: translateY(110vh) rotate(calc(var(--r) + 540deg)) scale(var(--s)); opacity: 0.2; } }

/* ── Primer uso ───────────────────────────────────────────────────────────── */

.onboarding { min-height: 100dvh; display: grid; place-items: center; padding: calc(32px + var(--safe-t)) 18px calc(32px + var(--safe-b)); }
.onboarding-card { width: 100%; max-width: 620px; }
.onboarding-card .steps { margin-bottom: 28px; }
.onboarding-card h1 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.9rem, 4vw, 2.5rem); letter-spacing: -0.02em; }
.onboarding-card > p, .onboarding-lead { color: var(--text-2); margin: 10px 0 24px; font-size: 1rem; }
.onboarding-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 28px; }
.onboarding-actions .btn-primary, .onboarding-actions .btn-gold { min-width: 160px; }

/* ── Impresión (informe mensual) ──────────────────────────────────────────── */

@media print {
    :root { color-scheme: light; }
    body { background: #fff; color: #111; font-size: 12px; }
    body::before, .sidebar, .tabbar, .topbar-actions, .demo-banner, .no-print, #toasts, #overlays { display: none !important; }
    .app { display: block; }
    .topbar { position: static; background: none; backdrop-filter: none; padding: 0 0 12px; }
    .view { padding: 0; max-width: none; animation: none; }
    .card { background: #fff; border: 1px solid #ddd; box-shadow: none; backdrop-filter: none; break-inside: avoid; }
    .is-private .amt { color: #111 !important; text-shadow: none; }
    .chart-svg .axis { fill: #555; }
}

/* Metas archivadas: una línea por meta con su botón de restaurar. */
.archived-goal { padding: 8px 2px; }
.archived-goal + .archived-goal { border-top: 1px solid var(--line); }
