/* ===== Pesuma · tokens del kit de marca (se carga después de pesuma.css, -v2 y -v5) =====
   Fuente: docs/marca/pesuma/pesuma.design-tokens.json · correspondencia: docs/brand/PESUMA_DESIGN_TOKENS.md
   Redefine las variables --fz-* que ya usan las otras hojas, así todas heredan los colores de Pesuma.
   Regla: el verde decorativo (#10B981) nunca va como texto en modo claro (2,5:1). */

:root {
    /* superficies y texto */
    --fz-card: #ffffff;
    --fz-border: #d6e0ea;
    --fz-track: #edf3f7;
    --fz-ring-track: #d6e0ea;
    --fz-muted: #526477;
    /* estados (texto ≥ 4,5:1 sobre blanco y sobre sus tintes) */
    --fz-success: #047857;
    --fz-danger: #b42332;
    --fz-warning: #895800;
    --fz-info: #175cd3;
    --fz-accent: #10b981;
    /* colores «de tono» que las hojas usan como texto, ícono o relleno */
    --fz-green: #047857;
    --fz-rose: #b42332;
    --fz-amber: #895800;
    --fz-sky: #175cd3;
    /* acción principal */
    --fz-primary: #0b2545;
    --fz-on-primary: #ffffff;
    --fz-focus: #175cd3;
    /* series de gráficos */
    --fz-chart-debt: #175cd3;
    --fz-chart-income: #047857;
    --fz-chart-expenses: #8a4ddd;
    --fz-chart-savings: #0b6676;
    --fz-chart-budget: #a05b00;
    --fz-shadow: 0 1px 2px rgb(11 37 69 / .04), 0 4px 16px rgb(11 37 69 / .06);
}

html.dark {
    --fz-card: #10253a;
    --fz-border: #36536a;
    --fz-track: #19334b;
    --fz-ring-track: #2c4459;
    --fz-muted: #b7c9d7;
    --fz-success: #55e0ae;
    --fz-danger: #ff8494;
    --fz-warning: #ffd37a;
    --fz-info: #7cc9f9;
    --fz-accent: #34d4a7;
    --fz-green: #55e0ae;
    --fz-rose: #ff8494;
    --fz-amber: #ffd37a;
    --fz-sky: #7cc9f9;
    --fz-primary: #55e0ae;
    --fz-on-primary: #052d25;
    --fz-focus: #7cc9f9;
    --fz-chart-debt: #75b8ff;
    --fz-chart-income: #55e0ae;
    --fz-chart-expenses: #d2b0ff;
    --fz-chart-savings: #5ed9e6;
    --fz-chart-budget: #ffd37a;
    --fz-shadow: 0 1px 0 rgb(255 255 255 / .03) inset, 0 4px 16px rgb(0 0 0 / .18);

    /* Filament: en oscuro la acción principal es verde (el navy se pierde sobre el fondo navy) */
    --primary-50: #e8f6f0;
    --primary-100: #c6eedd;
    --primary-200: #a7f3d0;
    --primary-300: #77f0c2;
    --primary-400: #55e0ae;
    --primary-500: #04704f;
    --primary-600: #047857;
    --primary-700: #065f46;
    --primary-800: #064e3b;
    --primary-900: #143c39;
    --primary-950: #0b2a28;
}

/* Fondo: superficies del kit (sin el negro zinc anterior) */
.fi-body { background: #f7f9fc; }
html.dark .fi-body {
    background:
        radial-gradient(1200px 600px at 100% -10%, rgb(85 224 174 / .06), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgb(124 201 249 / .05), transparent 60%),
        #071827;
    background-attachment: fixed;
}

/* Foco visible y del color del kit */
:focus-visible { outline-color: var(--fz-focus); }

/* Botón principal propio: navy en claro, verde menta en oscuro (sin degradado: contraste estable) */
.fz-btn-primary { background: var(--fz-primary); color: var(--fz-on-primary); box-shadow: 0 6px 16px -10px rgb(11 37 69 / .6); }
html.dark .fz-btn-primary { box-shadow: 0 6px 16px -10px rgb(85 224 174 / .5); }
.fz-stepper li.is-on span { background: var(--fz-primary); color: var(--fz-on-primary); }

/* Rellenos que antes eran verde vivo con texto blanco encima */
.fz-cal-cell.is-today .fz-cal-day { background: var(--fz-primary); color: var(--fz-on-primary); }
.fz-switch.is-on { background: var(--fz-primary); }
.fz-cal-progress i { background: var(--fz-green); }
.fz-budget .fz-bar > span { background: var(--fz-green); }

/* Tintes: más presentes que el 10 % anterior, con el texto en el tono oscuro */
.fz-chips button.is-on { border-color: var(--fz-green); color: var(--fz-success); background: color-mix(in srgb, var(--fz-green) 10%, var(--fz-card)); }
.fz-cal-cell.is-sel { border-color: var(--fz-green); box-shadow: 0 0 0 1px var(--fz-green) inset; background: color-mix(in srgb, var(--fz-green) 6%, var(--fz-card)); }

/* La deuda es neutral (azul), no roja: el rojo queda para lo vencido */
.fz-bar-debt > span { background: var(--fz-chart-debt); }

/* Texto financiero nunca por debajo de 12 px (kit: caption = 12) */
.fz-nudge-body small, .fz-pane-head p, .fz-field > small { font-size: .8rem; }

/* Explicación de una cifra (p. ej. tarjeta que se sigue usando en el simulador) */
.fz-explain {
    margin: 0 0 1rem; padding: .75rem .9rem; border-radius: .85rem; font-size: .9rem; line-height: 1.45;
    background: color-mix(in srgb, var(--fz-info) 8%, var(--fz-card)); border: 1px solid color-mix(in srgb, var(--fz-info) 30%, transparent);
}

/* Gráfico de líneas propio: ejes legibles y leyenda con la forma de cada serie */
.fz-chart-y, .fz-chart-x { font-size: .75rem; }
.fz-chart-legend { font-size: .8rem; }
.fz-chart-legend i { width: 1.4rem; height: 3px; border-radius: 2px; vertical-align: 3px; background: var(--c); }
.fz-chart-legend i.is-fill { height: .7rem; vertical-align: -1px; background: linear-gradient(var(--c) 0 3px, color-mix(in srgb, var(--c) 25%, transparent) 3px); }
.fz-chart-legend i.is-dashed { background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 9px); }

/* Botón «Guardar» del registro rápido: color sólido con texto legible (antes blanco sobre verde claro) */
.fz-qe-save button { background: var(--fz-primary); color: var(--fz-on-primary); box-shadow: 0 10px 24px -12px rgb(11 37 69 / .6); }
.fz-qe-save button.is-out { background: #b42332; color: #fff; box-shadow: 0 10px 24px -12px rgb(180 35 50 / .6); }
html.dark .fz-qe-save button.is-out { background: #ff8494; color: #3b0a12; }


/* Mínimo de 12 px para todo texto (kit: caption = 12, nunca menos en información financiera).
   Generado a partir de las reglas de pesuma.css, -v2 y -v5 que estaban por debajo. */
.fz-pill, .fz-table th, .fz-chart-y, .fz-chart-x, .fz-hero-label, .fz-ring .fz-ring-of, .fz-factors small,
.fz-tl-date, .fz-chip, .fz-tab, .fz-qe-h, .fz-cat-name, .fz-cat-meta, .fz-kpi span, .fz-kpi small,
.fz-budget-edit label, .fz-tl-action, .fz-cal-wd > span, .fz-cal-ev, .fz-cal-more, .fz-cal-bal, .fz-cal-sum,
.fz-cal-detail-wd, .fz-cal-list-body small, .fz-cal-list small .fz-chip, .fz-cal-noday li small, .fz-eyebrow,
.fz-field-label, .fz-nudge-body small, .fz-devices small, .fz-rem-list time, .fz-rem-app,
.fz-people-name .fz-chip, .fz-role-card small, .fz-invite-head small, .fz-auto-chip, .fz-stepper li span,
.fz-imp-main small, .fz-imp-src, .fz-ob-fine, .fz-ob-f > span:first-child, .fz-ob-hint, .fz-ob-live span,
.fz-ob-live small, .fz-acc-id-body .fz-chip, .fz-acc-counts span, .fz-ai-left, .fz-ai-kind,
.fz-ai-fields label > span, .fz-ai-fields em, .fz-ai-privacy, .fz-chat-panel h3, .fz-chat-row small, .fz-used,
.fz-sources, .fz-sources p, .fz-chat .fz-ai-privacy, .fz-attach-chip small { font-size: .75rem; }

/* Selector de apariencia en las pantallas de entrada (login, registro, recuperar contraseña, verificar correo) */
.fz-preauth-theme { position: absolute; top: max(.75rem, env(safe-area-inset-top)); right: max(.75rem, env(safe-area-inset-right)); z-index: 10;
    display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--fz-muted); }
.fz-preauth-theme .fi-theme-switcher { display: flex; gap: .15rem; padding: .2rem; border-radius: .75rem; background: var(--fz-card); border: 1px solid var(--fz-border); }
.fz-preauth-theme .fi-theme-switcher-btn { min-width: 2.75rem; min-height: 2.75rem; }
@media (max-width: 380px) { .fz-preauth-theme-label { display: none; } }

/* Mi cuenta → Seguridad: dos pasos y sesiones abiertas (TR-013, TR-144) */
.fz-acc-2fa { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 0 0 1rem; padding: .75rem .9rem; border-radius: .85rem;
    background: color-mix(in srgb, var(--fz-info) 7%, var(--fz-card)); border: 1px solid var(--fz-border); }
.fz-acc-2fa > svg { width: 1.4rem; height: 1.4rem; color: var(--fz-info); flex: none; }
.fz-acc-2fa > span { flex: 1 1 14rem; font-size: .9rem; }
.fz-acc-sessions { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .25rem; }
.fz-acc-sessions li { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--fz-border); }
.fz-acc-sessions li > svg { width: 1.3rem; height: 1.3rem; color: var(--fz-muted); flex: none; }
.fz-acc-sessions li > span { flex: 1; display: grid; }
.fz-acc-sessions small { font-size: .8rem; color: var(--fz-muted); }

/* Avisos de una deuda: atrasada, interés pendiente, usura, costo real (DEC-022) */
.fz-debt-warning { color: var(--fz-danger, #b42318); font-size: .8rem; font-weight: 600; white-space: normal; }
