/* ============================================================
   Clikkie - Design System
   Modo Oscuro + Modo Claro
   ============================================================ */

.rates-tab { padding: 0.6rem 1rem; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); border: none; background: transparent; cursor: pointer; border-bottom: 2px solid transparent; }
.rates-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.rates-tab i { margin-right: 0.35rem; }
.zenith-btn-sm { padding: 0.35rem 0.6rem; font-size: 0.8rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); cursor: pointer; }
.zenith-btn-sm:hover { background: var(--accent-lighter); }
.zenith-tag { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; }

/* ── CSS Variables ── */
:root {
    /* Light Mode (default) - Purple Theme */
    --bg-primary: #f3f1f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eeebf5;
    --bg-hover: #e8e4f2;
    --border: #ddd8ea;
    --border-light: #e8e4f0;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a62;
    --text-muted: #8a8a9e;
    --text-inverse: #ffffff;
    --accent: #7c3aed;
    --accent-light: #a78bfa;
    --accent-lighter: rgba(124, 58, 237, 0.1);
    --accent-bg: #7c3aed;
    --success: #10b981;
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.1);
    --purple: #7c3aed;
    --purple-light: rgba(124, 58, 237, 0.1);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --sidebar-bg: #ffffff;
    --sidebar-active: rgba(124, 58, 237, 0.08);
    --card-highlight: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    --chart-grid: #e4e0ee;
    --input-bg: #f3f1f9;
    --modal-overlay: rgba(0, 0, 0, 0.4);
    --scrollbar-track: #eeebf5;
    --scrollbar-thumb: #cfc8de;
}

[data-theme="dark"] {
    /* Background hierarchy 3 niveles (recomendado por ui-ux-pro-max).
       NO pure black: evita OLED smear + reduce fatiga visual prolongada. */
    --bg-primary:   #0a0a14;   /* deepest — body background */
    --bg-secondary: #14142a;   /* base — cards, surface elevation 1 */
    --bg-tertiary:  #1c1c38;   /* elevated — tags, secondary surfaces */
    --bg-hover:     #252548;   /* interactive hover */

    /* Borders: hairlines sutiles en lugar de solid colors */
    --border:       rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.05);

    /* Tipografía con contraste WCAG AAA (7:1 sobre bg-primary) */
    --text-primary:   #ededef;   /* 14.5:1 — primary */
    --text-secondary: #c9c9d4;   /* 10.5:1 — secondary */
    --text-muted:     #8a8f98;   /* 4.8:1 — muted, pasa WCAG AA */
    --text-inverse:   #0a0a14;

    --accent:         #8b5cf6;   /* purpura un toque más luminoso para dark */
    --accent-light:   #a78bfa;
    --accent-lighter: rgba(139, 92, 246, 0.16);
    --accent-bg:      #7c3aed;

    --success:        #34d399;   /* verde más luminoso en dark */
    --danger:         #f87171;   /* rojo menos saturado */
    --danger-light:   rgba(248, 113, 113, 0.16);
    --warning:        #fbbf24;
    --warning-light:  rgba(251, 191, 36, 0.16);
    --info:           #60a5fa;
    --info-light:     rgba(96, 165, 250, 0.16);
    --purple:         #a78bfa;
    --purple-light:   rgba(167, 139, 250, 0.16);

    /* Shadows más sutiles en dark (con negro intenso para destacar elevación) */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.65), 0 4px 12px rgba(0, 0, 0, 0.30);

    --sidebar-bg: #14142a;
    --sidebar-active: rgba(139, 92, 246, 0.16);
    --card-highlight: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    --chart-grid: rgba(255, 255, 255, 0.06);
    --input-bg: rgba(255, 255, 255, 0.04);
    --modal-overlay: rgba(0, 0, 0, 0.72);
    --scrollbar-track: #0a0a14;
    --scrollbar-thumb: rgba(255, 255, 255, 0.12);
}

/* Subtle ambient effect en dark — gradient muy sutil en el body para evitar
   pantalla "muerta" sin perder legibilidad. Inspirado en patterns Linear/Notion. */
[data-theme="dark"] body {
    background-image:
        radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(167, 139, 250, 0.04) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Focus visible profesional en dark — ring morado con offset (a11y WCAG) */
[data-theme="dark"] :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Modales en dark: borde sutil + shadow más profundo */
[data-theme="dark"] .modal-content {
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-lg);
}

/* Cards: borde hairline sutil en lugar de solid en dark */
[data-theme="dark"] .zenith-card,
[data-theme="dark"] .zenith-card-highlight,
[data-theme="dark"] .stats-widget,
[data-theme="dark"] .account-card,
[data-theme="dark"] .fixed-card,
[data-theme="dark"] .category-card {
    border-color: var(--border);
}

/* Hover sobre cards: leve glow accent en dark (más profundo que light) */
[data-theme="dark"] .card-interactive:hover,
[data-theme="dark"] .row-clickable:hover {
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.18), var(--shadow-md);
}

/* Tablas en dark: header con fondo sutilmente elevado */
[data-theme="dark"] .table-zenith th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Inputs en dark: borde más visible al focus */
[data-theme="dark"] .zenith-input:focus,
[data-theme="dark"] .zen-select-trigger:focus-visible,
[data-theme="dark"] .zen-select-trigger[aria-expanded="true"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-lighter);
}

/* Tags / badges con contraste mejorado */
[data-theme="dark"] .badge,
[data-theme="dark"] .zenith-tag {
    border: 1px solid var(--border);
}

/* Scrollbar más ancho y visible en dark */
[data-theme="dark"] ::-webkit-scrollbar { width: 8px; height: 8px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    border: 1px solid transparent;
    background-clip: padding-box;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
    background-clip: padding-box;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

/* ── Typography (sistema de marca Clikkie) ──
   Hanken Grotesk = títulos · Inter = cuerpo (body) · JetBrains Mono = montos/datos */
h1, h2, h3, h4 {
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
#page-title { font-family: 'Hanken Grotesk', system-ui, sans-serif; letter-spacing: -0.01em; }

/* Montos / valores grandes SIEMPRE en mono con cifras tabulares */
.summary-value, .sw-amount, .ledger .bal, .streak-num,
.ck-amount, .table-zenith td .amount {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
}

/* ── Cards ── */
.zenith-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    /* Solo las props que realmente cambian en hover (incl. el lift de
       .card-interactive). Evita que el navegador "vigile" todas las propiedades
       en cada interacción de la card más repetida de la app. */
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.zenith-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.zenith-card-highlight {
    background: var(--card-highlight);
    border: none;
    border-radius: 16px;
    padding: 1.5rem;
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.zenith-card-highlight p,
.zenith-card-highlight .summary-label {
    color: rgba(255,255,255,0.8);
}

.zenith-card-highlight .summary-value {
    color: #ffffff;
}

/* ── Summary Cards ── */
.summary-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
}

.summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* ── Sidebar ── */
.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    min-height: 100vh;
    transition: background-color 0.3s;
}

.sidebar-logo {
    font-family: 'Gabarito', system-ui, sans-serif;  /* wordmark de marca */
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 1.5rem 1.25rem 0.5rem;
}

.sidebar a {
    color: var(--text-secondary);
    padding: 0.65rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 10px;
    transition: all 0.15s;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar a:hover {
    background: var(--sidebar-active);
    color: var(--accent);
}

.sidebar a.active {
    background: var(--sidebar-active);
    color: var(--accent);
    font-weight: 600;
}

.sidebar a .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* ── Top Bar ── */
.topbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topbar-search {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    width: 300px;
    font-size: 0.85rem;
    transition: border-color 0.2s;
}

.topbar-search:focus {
    outline: none;
    border-color: var(--accent);
}

.topbar-search::placeholder {
    color: var(--text-muted);
}

/* ── Inputs ── */
.zenith-input {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.zenith-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-lighter);
}

.zenith-input::placeholder {
    color: var(--text-muted);
}

/* Quitar las flechas (spinners) nativas de los inputs numéricos: se ven crudas
   y rompen el look del tema. Aplica a todo input[type=number] de la app. */
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ── Toasts (notificaciones tipo Ark-UI, en vanilla) ── */
.toast-container {
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}
.toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 380px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 4px solid var(--toast-accent, var(--info));
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15,23,42,0.18), 0 2px 8px rgba(15,23,42,0.08);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.34s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.hide { transform: translateX(120%); opacity: 0; }
.toast-icon { font-size: 1.2rem; line-height: 1; margin-top: 1px; color: var(--toast-accent, var(--info)); flex-shrink: 0; display: flex; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }
.toast-desc { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; word-break: break-word; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px; flex-shrink: 0; transition: color 0.2s, background 0.2s; display: flex; }
.toast-close:hover { color: var(--text-primary); background: var(--bg-hover); }
.toast--success { --toast-accent: var(--success); }
.toast--error   { --toast-accent: var(--danger); }
.toast--warning { --toast-accent: var(--warning); }
.toast--info    { --toast-accent: var(--info); }
@media (max-width: 480px) {
    .toast-container { left: 16px; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
    .toast { min-width: 0; max-width: none; width: 100%; }
}

/* ── Aprende: racha + quiz ── */
.streak-flame { font-size: 2.8rem; line-height: 1; color: var(--text-muted); transition: color 0.3s, transform 0.3s; }
.streak-flame.on { color: #f59e0b; filter: drop-shadow(0 2px 10px rgba(245,158,11,0.45)); animation: flamePulse 2.2s ease-in-out infinite; }
@keyframes flamePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.streak-num { font-size: 2rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.streak-num .streak-unit { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.streak-week { display: flex; gap: 6px; margin-top: 0.75rem; }
.streak-week .sw-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sw-day { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--border); background: var(--bg-tertiary); color: var(--text-muted); font-size: 0.8rem; transition: all 0.2s; }
.sw-day.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.sw-day.today { box-shadow: 0 0 0 2px var(--accent-lighter); }
.sw-day.today:not(.active) { border-color: var(--accent); color: var(--accent); }
.sw-day.future { opacity: 0.4; }
.sw-lbl { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; }

/* Streak card un poco más alta y CTA del quiz */
#section-quiz .streak-flame { font-size: 3.2rem; }
#section-quiz > .grid > .zenith-card { min-height: 230px; }

.quiz-cta-card { display: flex; align-items: center; justify-content: center; }
.quiz-cta-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.5rem; padding: 1rem 0.5rem; max-width: 420px; }
.quiz-cta-ico { width: 60px; height: 60px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; color: #fff; background: var(--card-highlight); box-shadow: 0 10px 28px -8px rgba(124,58,237,0.6); margin-bottom: 0.25rem; }
.quiz-cta-title { font-family: 'Hanken Grotesk', system-ui, sans-serif; font-size: 1.25rem; font-weight: 800; color: var(--text-primary); }
.quiz-cta-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }
.quiz-cta-stat { font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.quiz-cta-btn { margin-top: 0.5rem; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.6rem; font-size: 0.95rem; }

/* Pantalla del quiz (overlay full-screen) */
.quiz-screen { position: fixed; inset: 0; z-index: 1100; background: var(--bg-primary);
    display: flex; flex-direction: column; animation: quizScreenIn 0.28s cubic-bezier(0.22,1,0.36,1); }
.quiz-screen.hidden { display: none !important; }
@keyframes quizScreenIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.quiz-screen-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border); background: var(--bg-secondary); flex-shrink: 0; }
.quiz-screen-close { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-secondary);
    color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: background 0.2s; }
.quiz-screen-close:hover { background: var(--bg-hover); }
.quiz-screen-progress { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); flex: 1; }
.quiz-screen-streak { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 0.3rem;
    font-family: 'JetBrains Mono', monospace; }
.quiz-screen-body { flex: 1; overflow-y: auto; padding: 1.5rem 1rem; display: flex; flex-direction: column; align-items: center; }
.quiz-q-wrap { width: 100%; max-width: 560px; }
.quiz-fb-actions { display: flex; gap: 0.75rem; margin-top: 1rem; justify-content: flex-end; }
.quiz-fb-actions .zenith-btn, .quiz-fb-actions .zenith-btn-outline { flex: 1; }

.quiz-question { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin-bottom: 1.25rem; line-height: 1.4;
    font-family: 'Hanken Grotesk', system-ui, sans-serif; }
.quiz-options { display: flex; flex-direction: column; gap: 0.6rem; }
.quiz-opt { text-align: left; padding: 0.85rem 1rem; border-radius: 12px; border: 1.5px solid var(--border);
    background: var(--bg-secondary); color: var(--text-primary); font-size: 0.9rem; cursor: pointer;
    transition: border-color 0.18s, background 0.18s, transform 0.12s; }
.quiz-opt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-lighter); }
.quiz-opt:active:not(:disabled) { transform: scale(0.99); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt.correct { border-color: var(--success); background: rgba(16,185,129,0.12); color: var(--success); font-weight: 600; }
.quiz-opt.wrong { border-color: var(--danger); background: var(--danger-light); color: var(--danger); }
.quiz-feedback { margin-top: 1rem; padding: 1rem; border-radius: 12px; border-left: 4px solid var(--info); background: var(--bg-tertiary); }
.quiz-feedback.ok { border-left-color: var(--success); }
.quiz-feedback.no { border-left-color: var(--warning); }
.quiz-fb-msg { font-weight: 600; color: var(--text-primary); font-size: 0.92rem; }
.quiz-fb-explain { font-size: 0.84rem; color: var(--text-secondary); margin-top: 0.4rem; line-height: 1.5; }

.reward-row { display: flex; align-items: center; gap: 12px; padding: 0.75rem 0.9rem; border-radius: 12px;
    border: 1px solid var(--border); background: var(--bg-tertiary); }
.reward-row .reward-ico { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0; }
.reward-row.locked .reward-ico { background: var(--bg-hover); color: var(--text-muted); }
.reward-row.claimable { border-color: var(--accent); background: var(--accent-lighter); }
.reward-row.claimable .reward-ico { background: var(--accent); color: #fff; }
.reward-row.claimed { opacity: 0.7; }
.reward-row.claimed .reward-ico { background: rgba(16,185,129,0.15); color: var(--success); }
.reward-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.reward-info b { font-size: 0.9rem; color: var(--text-primary); }
.reward-info span { font-size: 0.78rem; color: var(--text-muted); }
.reward-claim-btn { flex-shrink: 0; padding: 0.5rem 1rem; font-size: 0.85rem; }

.spending-ico { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0; background: var(--info-light); color: var(--info); }
.spending-ico.good { background: rgba(16,185,129,0.15); color: var(--success); }
.spending-ico.bad { background: var(--danger-light); color: var(--danger); }
.spending-ico.flat { background: var(--bg-tertiary); color: var(--text-muted); }

/* ── Checkout / Mejora a Pro ── */
.plan-opt { display: flex; align-items: center; gap: 12px; padding: 0.85rem 1rem; border-radius: 14px;
    border: 1.5px solid var(--border); background: var(--bg-secondary); cursor: pointer; margin-bottom: 0.5rem; transition: border-color 0.18s, background 0.18s; }
.plan-opt:hover { border-color: var(--accent-light); }
.plan-opt.sel { border-color: var(--accent); background: var(--accent-lighter); }
.plan-opt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plan-opt-main b { font-size: 0.95rem; color: var(--text-primary); }
.plan-opt-main span { font-size: 0.75rem; color: var(--text-muted); line-height: 1.35; }
.plan-opt-price { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.05rem; color: var(--accent); white-space: nowrap; }
.plan-opt-price small { font-size: 0.6rem; color: var(--text-muted); font-weight: 500; }
.pay-data { background: var(--bg-tertiary); border-radius: 12px; padding: 0.5rem 0.85rem; }
.pay-row { display: flex; align-items: center; gap: 8px; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.pay-row:last-child { border-bottom: none; }
.pay-row span { font-size: 0.8rem; color: var(--text-muted); width: 78px; flex-shrink: 0; }
.pay-row b { flex: 1; font-size: 0.88rem; color: var(--text-primary); font-family: 'JetBrains Mono', monospace; word-break: break-all; }
.pay-copy { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px; flex-shrink: 0; }
.pay-copy:hover { color: var(--accent); background: var(--bg-hover); }
.pay-note { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; display: flex; gap: 6px; align-items: flex-start; }
.pay-note i { margin-top: 2px; flex-shrink: 0; }

/* ── Buttons ── */
.zenith-btn {
    background: var(--accent-bg);
    color: var(--text-inverse);
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.zenith-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.zenith-btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}

.zenith-btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-lighter);
}

.zenith-btn-danger {
    background: var(--danger);
}

.zenith-btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.78rem;
    border-radius: 8px;
}

/* ── Tables ── */
.table-zenith {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-zenith th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
}

.table-zenith td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
}

.table-zenith tr:hover td {
    background: var(--accent-lighter);
}

.table-zenith tr:last-child td {
    border-bottom: none;
}

/* ── Badges ── */
.badge {
    padding: 0.2rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-expense { background: var(--danger-light); color: var(--danger); }
.badge-income { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.badge-transfer { background: var(--purple-light); color: var(--purple); }

/* ── Theme Toggle ── */
.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.25s ease forwards;
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(4px);
}

/* Defensa: .hidden gana siempre, sin importar el orden de los stylesheets. */
.modal-overlay.hidden,
.hidden {
    display: none !important;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

/* ── Reminder Items ── */
.reminder-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    transition: all 0.15s;
}

.reminder-item:hover {
    border-color: var(--accent);
}

.reminder-overdue {
    border-left: 3px solid var(--danger);
}

.reminder-soon {
    border-left: 3px solid var(--warning);
}

.reminder-ok {
    border-left: 3px solid var(--success);
}

/* ── Account Card ── */
.account-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.account-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.account-card.usd::before {
    background: var(--accent);
}

.account-card.ves::before {
    background: var(--purple);
}

.account-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

/* ── Fixed Expense Card ── */
.fixed-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.2s;
}

.fixed-card:hover {
    box-shadow: var(--shadow-md);
}

/* ── Category Card ── */
.category-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.category-card:hover {
    box-shadow: var(--shadow-sm);
}

/* ── User Avatar ── */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--card-highlight);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ── Sidebar legacy: oculto universalmente, la nav es bottom-nav ── */
.sidebar,
.mobile-header,
#sidebar-overlay {
    display: none !important;
}

/* ── Layout universal: full-width content + padding bottom para bottom-nav ── */
body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }

#app { flex-direction: column !important; }
#app > .flex-1 { max-height: none !important; }

.topbar {
    display: flex !important;
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 20;
}

@media (max-width: 768px) {
    .topbar-search { width: 150px; }
    .summary-value { font-size: 1.3rem; }
    .topbar { padding: 0.875rem 1rem !important; }
}

/* ─────────────────────────────────────────────────────────
   BOTTOM NAV — 5 items balanceados (todos con label siempre)
   Cada item ocupa exactamente 1/5 del ancho → ningún descentrado.
   ───────────────────────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    z-index: 40;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 2px;
    padding: 6px;
    border-radius: 22px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18),
                0 2px 8px rgba(15, 23, 42, 0.08);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    max-width: 520px;
    margin-inline: auto;
}

[data-theme="dark"] .bottom-nav,
.dark .bottom-nav {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.40),
                0 2px 8px rgba(0, 0, 0, 0.30);
    background: rgba(31, 41, 55, 0.92);
}

.bn-item {
    --bn-active: var(--accent, #7c3aed);
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    flex: 1 1 0;          /* TODOS ocupan exactamente lo mismo */
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    transition: color 0.25s ease, background 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.bn-item:hover { color: var(--text-secondary); }

.bn-item .bn-icon {
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bn-item .bn-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bn-item.active {
    color: var(--bn-active);
    background: var(--accent-lighter, rgba(124, 58, 237, 0.10));
}

.bn-item.active .bn-icon {
    animation: bnIconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bn-item.active .bn-label {
    font-weight: 700;
}

@keyframes bnIconBounce {
    0%, 100% { transform: translateY(0); }
    20% { transform: translateY(-0.3em); }
    40% { transform: translateY(0); }
    60% { transform: translateY(-0.1em); }
    80% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .bn-item .bn-icon,
    .bn-item.active .bn-icon,
    .bn-item .bn-label,
    .bn-item.active::after { animation: none !important; transition: none !important; }
}

/* ─────────────────────────────────────────────────────────
   ZEN TABS — versión vanilla del Radix Tabs (pill style)
   Para tabs internos (Compromisos, Tasas, etc.)
   ───────────────────────────────────────────────────────── */
.zen-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.zen-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.zen-tab:hover { color: var(--text-secondary); }

.zen-tab.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] .zen-tab.active,
.dark .zen-tab.active {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.30);
}

.zen-tab-panel { display: none; }
.zen-tab-panel.active { display: block; animation: fadeIn 0.2s ease; }

/* ─────────────────────────────────────────────────────────
   ZEN SELECT — adaptación vanilla del Radix DropdownMenu
   Wrappea cada <select> nativo en un trigger + popup menu custom.
   El native select queda oculto pero sigue siendo la fuente de la verdad.
   ───────────────────────────────────────────────────────── */
.zen-select-wrap {
    position: relative;
    display: inline-block;
    min-width: 120px;
}

/* Native select escondido pero accesible programáticamente */
.zen-select-wrap > select {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.zen-select-trigger {
    appearance: none;
    width: 100%;
    height: 40px;
    padding: 0 12px 0 14px;
    background: var(--input-bg, var(--bg-secondary));
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    text-align: left;
    line-height: 1;
    white-space: nowrap;
}

.zen-select-trigger:hover { border-color: var(--accent); }
.zen-select-trigger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.zen-select-trigger[aria-expanded="true"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-lighter);
}

.zen-select-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}
.zen-select-value:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}

.zen-select-chevron {
    flex-shrink: 0;
    opacity: 0.55;
    transition: transform 0.2s ease, opacity 0.15s ease;
}
.zen-select-trigger:hover .zen-select-chevron { opacity: 0.9; }
.zen-select-trigger[aria-expanded="true"] .zen-select-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.zen-select-menu {
    position: absolute;
    z-index: 9000;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15),
                0 2px 8px rgba(15, 23, 42, 0.08);
    animation: zenSelectOpen 0.18s cubic-bezier(0.34, 1.20, 0.64, 1);
    transform-origin: top center;
}
.zen-select-menu[hidden] { display: none !important; }

[data-theme="dark"] .zen-select-menu,
.dark .zen-select-menu {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.40),
                0 2px 8px rgba(0, 0, 0, 0.30);
}

@keyframes zenSelectOpen {
    from { opacity: 0; transform: translateY(-4px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Soporta abrir hacia arriba si no hay espacio abajo */
.zen-select-menu[data-side="top"] {
    top: auto;
    bottom: calc(100% + 6px);
    transform-origin: bottom center;
}

.zen-select-item {
    appearance: none;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 8px 10px 8px 32px;
    text-align: left;
    font-size: 0.88rem;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    transition: background 0.12s ease, color 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.zen-select-item:hover,
.zen-select-item:focus-visible {
    background: var(--bg-hover, var(--bg-tertiary));
    outline: none;
}
.zen-select-item:disabled { opacity: 0.45; pointer-events: none; }

.zen-select-item.selected {
    color: var(--accent);
    font-weight: 600;
}
.zen-select-item.selected::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
}

/* En mobile el menu ocupa todo el ancho del trigger */
@media (max-width: 640px) {
    .zen-select-menu { max-height: 60vh; }
}

/* ─────────────────────────────────────────────────────────
   ZEN CHECKBOX — adaptación vanilla del Radix Checkbox
   El <input type=checkbox> nativo queda oculto pero presente; el visual
   se actualiza con CSS sibling selector (cero JS para state transitions).
   ───────────────────────────────────────────────────────── */
.zen-cb-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.zen-cb-wrap > input[type="checkbox"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    z-index: 1;
}

.zen-cb-box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--bg-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
    color: #fff;
    pointer-events: none;  /* clicks pasan al input subyacente */
}

.zen-cb-box svg {
    width: 14px;
    height: 14px;
    stroke-dasharray: 22;
    stroke-dashoffset: 22;
    transition: stroke-dashoffset 0.25s cubic-bezier(0.34, 1.20, 0.64, 1);
}

/* Estado checked: bg primary + check visible */
.zen-cb-wrap > input[type="checkbox"]:checked ~ .zen-cb-box {
    background: var(--accent);
    border-color: var(--accent);
}
.zen-cb-wrap > input[type="checkbox"]:checked ~ .zen-cb-box svg {
    stroke-dashoffset: 0;
}

/* Hover */
.zen-cb-wrap:hover > .zen-cb-box {
    border-color: var(--accent);
}
.zen-cb-wrap:hover > input[type="checkbox"]:checked ~ .zen-cb-box {
    background: var(--accent);
    filter: brightness(1.05);
}

/* Active (mousedown) */
.zen-cb-wrap > input[type="checkbox"]:active ~ .zen-cb-box {
    transform: scale(0.92);
}

/* Focus visible */
.zen-cb-wrap > input[type="checkbox"]:focus-visible ~ .zen-cb-box {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Disabled */
.zen-cb-wrap > input[type="checkbox"]:disabled {
    cursor: not-allowed;
}
.zen-cb-wrap > input[type="checkbox"]:disabled ~ .zen-cb-box {
    opacity: 0.45;
}

/* Indeterminate (via JS setting indeterminate=true) — usa la clase helper */
.zen-cb-wrap.is-indeterminate > .zen-cb-box {
    background: var(--accent);
    border-color: var(--accent);
}
.zen-cb-wrap.is-indeterminate > .zen-cb-box::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}
.zen-cb-wrap.is-indeterminate > .zen-cb-box svg {
    display: none;
}

/* Tamaños */
.zen-cb-wrap.cb-sm > .zen-cb-box { width: 16px; height: 16px; }
.zen-cb-wrap.cb-sm > .zen-cb-box svg { width: 11px; height: 11px; }
.zen-cb-wrap.cb-lg > .zen-cb-box { width: 22px; height: 22px; }
.zen-cb-wrap.cb-lg > .zen-cb-box svg { width: 15px; height: 15px; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────────
   DASHBOARD MOBILE-FIRST: group labels + card densidad
   ───────────────────────────────────────────────────────── */
.dash-group-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 1.25rem 0 0.5rem;
    padding-left: 2px;
}

.dash-group-label:first-of-type { margin-top: 0; }

@media (max-width: 640px) {
    /* Densidad mobile: cards más compactas, números legibles */
    .zenith-card { padding: 0.875rem !important; border-radius: 16px !important; }
    .zenith-card-highlight { padding: 0.875rem !important; border-radius: 16px !important; }
    .summary-label { font-size: 0.7rem !important; }
    .summary-value { font-size: 1.05rem !important; line-height: 1.2 !important; font-variant-numeric: tabular-nums; }
    .summary-icon { width: 32px !important; height: 32px !important; font-size: 0.9rem !important; }
    .spark-mini { height: 40px !important; margin-top: 0.35rem !important; }

    /* La primera card (Saldo USD) ocupa toda la fila para hero */
    #section-dashboard .grid.grid-cols-2 > .zenith-card-highlight:first-child {
        grid-column: 1 / -1;
    }
    #section-dashboard .grid.grid-cols-2 > .zenith-card-highlight:first-child .summary-value {
        font-size: 1.5rem !important;
    }

    /* Charts más bajos en mobile para verse completos sin scroll */
    #savings-chart, #line-chart, #donut-chart, #donut-balances,
    #rates-line-chart-usdt, #rates-line-chart-bcv { min-height: 200px; }
}

/* Tap targets mínimos 44px (Apple HIG) */
@media (max-width: 768px) {
    .zenith-btn, .zenith-btn-outline {
        min-height: 40px;
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }
    .zenith-btn-sm { min-height: 36px; padding: 0.35rem 0.5rem !important; }
    .zenith-input { min-height: 40px; }
}

/* Override del wrapper para que no scrollee horizontal en mobile */
@media (max-width: 768px) {
    .zenith-card.overflow-x-auto { overflow-x: visible !important; padding: 0.5rem !important; }
    #bulk-actions-bar { padding: 0.5rem 0.75rem !important; font-size: 0.8rem; }
}

/* ─────────────────────────────────────────────────────────
   EMPTY STATES — celebratorios y útiles
   Para tablas vacías (transactions, payables, receivables, etc.)
   ───────────────────────────────────────────────────────── */
.empty-state-row td {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}
.empty-state-row:hover td { background: transparent !important; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
    animation: emptyFade 0.35s cubic-bezier(0.34, 1.20, 0.64, 1);
}

@keyframes emptyFade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--accent-lighter);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    margin-bottom: 0.25rem;
}
.empty-state-icon--success {
    background: rgba(16, 185, 129, 0.14);
    color: var(--success);
}

.empty-state-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.empty-state-hint {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 360px;
    line-height: 1.5;
}
.empty-state-hint b {
    color: var(--text-secondary);
    font-weight: 600;
}

@media (max-width: 640px) {
    .empty-state { padding: 2rem 1rem; }
    .empty-state-icon { width: 56px; height: 56px; font-size: 1.5rem; border-radius: 16px; }
    .empty-state-title { font-size: 0.98rem; }
    .empty-state-hint { font-size: 0.82rem; }
}

/* ─────────────────────────────────────────────────────────
   STATS WIDGET — número grande + delta + SVG area chart
   (Vanilla adapt del React component stats-widget.tsx)
   ───────────────────────────────────────────────────────── */
.stats-widget {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem !important;
    border-radius: 18px !important;
}

.sw-info {
    display: flex;
    flex-direction: column;
    flex: 1 1 50%;
    min-width: 0;
}

.sw-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.sw-period { font-weight: 600; }

.sw-delta {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 999px;
}
.sw-delta.up   { color: var(--success); background: var(--success-light, rgba(16,185,129,0.12)); }
.sw-delta.down { color: var(--danger);  background: var(--danger-light,  rgba(239,68,68,0.12)); }
.sw-delta:empty { display: none; }

.sw-amount {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    margin: 0;
}

.sw-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.sw-chart {
    width: 45%;
    height: 64px;
    flex-shrink: 0;
    overflow: visible;
}

.sw-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: swDraw 1.1s ease-out forwards;
}

.sw-area {
    opacity: 0;
    animation: swFade 1.1s ease-out 0.2s forwards;
}

@keyframes swDraw { to { stroke-dashoffset: 0; } }
@keyframes swFade { to { opacity: 1; } }

@media (max-width: 640px) {
    .stats-widget { padding: 0.85rem !important; }
    .sw-amount { font-size: 1.15rem; }
    .sw-chart { width: 42%; height: 48px; }
}

/* ─────────────────────────────────────────────────────────
   APPLE ACTIVITY RINGS — 3 anillos concéntricos animados
   Ocupa todo el alto del card (≥260px) para que sea el foco visual
   ───────────────────────────────────────────────────────── */
.activity-rings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0.5rem;
    min-height: 260px;
    flex-wrap: wrap;
}

.ar-svg-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    flex-shrink: 0;
}

.ar-svg-wrap svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ar-track { stroke: var(--bg-hover); }

.ar-arc {
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.4s cubic-bezier(0.34, 1.10, 0.64, 1);
    filter: drop-shadow(0 0 6px rgba(0,0,0,0.18));
}

.ar-legend {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    flex: 0 1 auto;
}

.ar-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ar-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ar-value {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.ar-unit {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: 6px;
    font-weight: 500;
}

/* En mobile los rings se centran arriba y la leyenda baja debajo */
@media (max-width: 640px) {
    .activity-rings {
        gap: 1rem;
        flex-direction: column;
        min-height: auto;
        padding: 0.75rem 0;
    }
    .ar-svg-wrap { width: 170px; height: 170px; }
    .ar-value { font-size: 1.1rem; }
    .ar-legend { width: 100%; }
    .ar-row { flex-direction: row; justify-content: space-between; align-items: center; gap: 0.5rem; }
}

/* ─────────────────────────────────────────────────────────
   BOOT LOADER — lava-lamp con 4 bubbles (vanilla del React component)
   ───────────────────────────────────────────────────────── */
.boot-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: var(--bg-primary, #ffffff);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.boot-loader--leaving {
    opacity: 0;
    pointer-events: none;
}

.boot-loader-text {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    animation: bootPulse 1.8s ease-in-out infinite;
}

.lava-lamp {
    position: relative;
    width: 60px;
    height: 120px;
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(76, 29, 149, 0.30),
                0 4px 12px rgba(15, 23, 42, 0.15),
                inset 0 0 24px rgba(255, 255, 255, 0.05);
}

.lava-lamp::before {
    content: "";
    position: absolute;
    top: 6px; left: 8px; right: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    filter: blur(2px);
}

@keyframes bootDrop {
    0%   { transform: translateY(0px) scale(1); }
    50%  { transform: translateY(90px) scale(1.05); }
    100% { transform: translateY(0px) scale(1); }
}

@keyframes bootPulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.85; }
}

.bubble {
    position: absolute;
    top: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    filter: blur(0.3px);
}

.bubble--a { left: 18px; background: linear-gradient(to bottom, #ec4899, #f97316); animation: bootDrop 5s ease-in-out infinite; }
.bubble--b { left: 4px;  background: linear-gradient(to bottom, #84cc16, #06b6d4); animation: bootDrop 3.5s ease-in-out infinite 0.4s; }
.bubble--c { left: 34px; background: linear-gradient(to bottom, #7c3aed, #ec4899); animation: bootDrop 4.2s ease-in-out infinite 0.2s; }
.bubble--d { left: 22px; background: linear-gradient(to bottom, #3b82f6, #06b6d4); animation: bootDrop 6s ease-in-out infinite 0.8s; }

@media (prefers-reduced-motion: reduce) {
    .bubble, .boot-loader-text { animation: none !important; }
}

/* Para pantallas muy chicas (≤380px), ocultar también la "Fecha Límite" en pagos */
@media (max-width: 380px) {
    #section-compromisos .zen-tab-panel[data-panel="compromisos:payables"] .table-zenith th:nth-child(4),
    #section-compromisos .zen-tab-panel[data-panel="compromisos:payables"] .table-zenith td:nth-child(4),
    #section-compromisos .zen-tab-panel[data-panel="compromisos:receivables"] .table-zenith th:nth-child(5),
    #section-compromisos .zen-tab-panel[data-panel="compromisos:receivables"] .table-zenith td:nth-child(5) { display: none; }
}

/* ─────────────────────────────────────────────────────────
   HAMBURGER BUTTON — SVG con 3 rect rectangulares redondeados
   ───────────────────────────────────────────────────────── */
.hamburger-btn {
    appearance: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: var(--text-primary);
    transition: background 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.hamburger-btn:hover { background: var(--bg-hover); }
.hamburger-btn:active { transform: scale(0.92); }

.hamburger-btn .hb-svg {
    display: block;
    overflow: visible;
}

/* Cada barra: rectángulo idéntico (mismo width, height, rx) → render bulletproof */
.hamburger-btn .hb-bar {
    transform-origin: 12px 12px;
    transform-box: fill-box;
    transition: transform 0.3s cubic-bezier(0.34, 1.20, 0.64, 1),
                opacity 0.2s ease;
}

/* Estado abierto: morph a X */
.hamburger-btn.open .hb-bar-1 { transform: translate(0, 5.75px) rotate(45deg); }
.hamburger-btn.open .hb-bar-2 { opacity: 0; }
.hamburger-btn.open .hb-bar-3 { transform: translate(0, -5.75px) rotate(-45deg); }

/* ─────────────────────────────────────────────────────────
   SIDE DRAWER — slide-from-left con resto de opciones
   ───────────────────────────────────────────────────────── */
.side-drawer-overlay {
    position: fixed;
    inset: 0;
    /* Sin backdrop-filter: difuminar TODO el dashboard al abrir el drawer era
       lo que hacía lento el hamburger (re-blur de pantalla completa). Un dim
       sólido logra el mismo efecto visual y abre instantáneo. */
    background: rgba(10, 12, 24, 0.58);
    z-index: 60;
    animation: sdFadeIn 0.2s ease;
}
.side-drawer-overlay.hidden { display: none !important; }

@keyframes sdFadeIn { from { opacity: 0; } to { opacity: 1; } }

.side-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(85vw, 320px);
    background: var(--bg-secondary);
    z-index: 70;
    padding: 1rem;
    overflow-y: auto;
    box-shadow: 6px 0 30px rgba(15, 23, 42, 0.20);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.side-drawer.open { transform: translateX(0); }

.side-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0 1rem;
}

.side-drawer-logo {
    font-family: 'Gabarito', system-ui, sans-serif;  /* wordmark de marca */
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.side-drawer-close {
    appearance: none;
    background: var(--bg-tertiary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: background 0.2s ease;
}
.side-drawer-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.side-drawer-section-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 1rem 0.75rem 0.5rem;
}

.side-drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.side-drawer-item {
    appearance: none;
    background: transparent;
    border: none;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}
.side-drawer-item:hover { background: var(--bg-hover); }
.side-drawer-item:active { background: var(--bg-tertiary); }

.sd-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.sd-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    flex: 1;
}

/* ─────────────────────────────────────────────────────────
   TABLAS MOBILE COMO CARDS — sin scroll, sin cortes de palabras
   Cada <tr> es una tarjeta vertical: cada celda su línea, descripción
   destacada como título. Sin grid horizontal que squishe contenido.
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .table-zenith,
    .table-zenith tbody,
    .table-zenith tr,
    .table-zenith td {
        display: block !important;
        width: 100%;
        max-width: 100%;
    }
    .table-zenith thead { display: none !important; }

    .table-zenith tbody {
        display: flex !important;
        flex-direction: column;
        gap: 8px;
    }

    .table-zenith tr {
        background: var(--bg-tertiary);
        border-radius: 14px;
        border: 1px solid var(--border-light);
        padding: 0.75rem 0.9rem !important;
        display: flex !important;
        flex-direction: column;
        gap: 4px;
    }

    .table-zenith td {
        padding: 0 !important;
        border: none !important;
        font-size: 0.82rem !important;
        line-height: 1.35;
        white-space: normal !important;
        word-break: normal;
        overflow-wrap: anywhere;
        color: var(--text-secondary);
    }

    /* Ocultar checkbox (selección múltiple no aplica en mobile, mejor swipe-to-delete) */
    .table-zenith td:has(input[type="checkbox"]) { display: none !important; }

    /* DESCRIPCIÓN como título: para Transactions es la 5ta col (sin checkbox: 4ta visible)
       Para Payables/Fixed es la 2da. Para Receivables es la 2da. Para Tasas: la 1ra (par) */
    #section-transactions .table-zenith td:nth-child(5),
    #section-compromisos .table-zenith td:nth-child(2),
    #section-rates .table-zenith td:nth-child(1) {
        font-weight: 700;
        font-size: 0.95rem !important;
        color: var(--text-primary);
        order: -2;   /* aparece arriba del todo */
        margin-bottom: 2px;
    }

    /* MONTO destacado: 4ta col en transactions, 3ra en payables, 4ta en receivables */
    #section-transactions .table-zenith td:nth-child(4),
    #section-compromisos .zen-tab-panel[data-panel="compromisos:payables"] .table-zenith td:nth-child(3),
    #section-compromisos .zen-tab-panel[data-panel="compromisos:receivables"] .table-zenith td:nth-child(4),
    #section-rates .table-zenith td:nth-child(2) {
        font-weight: 700;
        font-size: 1.1rem !important;
        color: var(--text-primary);
        font-variant-numeric: tabular-nums;
        order: -1;   /* aparece justo abajo del título */
    }

    /* TIPO (badge Ingreso/Gasto) inline con el monto */
    #section-transactions .table-zenith td:nth-child(3) {
        order: -1;
        display: inline-flex !important;
        margin-bottom: 4px;
    }

    /* SOURCE / META: pequeño y gris al final */
    #section-transactions .table-zenith td:nth-child(6),
    #section-compromisos .table-zenith td:nth-child(5),
    #section-rates .table-zenith td:nth-child(3) {
        font-size: 0.72rem !important;
        color: var(--text-muted);
        order: 1;
    }

    /* BOTONES de acción al pie de la card */
    .table-zenith td:last-child:has(button),
    .table-zenith td:last-child:has(.zenith-btn-sm) {
        display: flex !important;
        justify-content: flex-end;
        gap: 6px;
        padding-top: 6px !important;
        border-top: 1px solid var(--border-light) !important;
        margin-top: 6px;
        order: 10;
    }

    .table-zenith .zenith-btn-sm {
        min-height: 32px;
        padding: 0.3rem 0.55rem !important;
        font-size: 0.78rem;
    }

    /* Inputs dentro de Manuales */
    .table-zenith td input[type="number"] { width: 100% !important; max-width: 160px; }
}

/* En tablet/desktop tablas normales (lo dejé como compromiso del media query 768) */
@media (min-width: 641px) and (max-width: 768px) {
    .table-zenith td:last-child { white-space: nowrap; }
}

/* ── Interactive Cards ── */
.card-interactive {
    cursor: pointer;
    position: relative;
}

.card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-interactive:active {
    transform: translateY(0);
}

/* ── Row Clickable: filas de tablas y cards que se tocan para entrar al detalle ── */
.row-clickable {
    transition: background 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}
.row-clickable:hover { background: var(--bg-hover); }
.row-clickable:active { transform: scale(0.995); }

/* Para las cards de Fixed Expenses (grid de cards, no filas) — efecto un poco más visible */
.fixed-card.row-clickable:hover {
    background: var(--bg-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.fixed-card.row-clickable:active { transform: translateY(0); }

/* ── Floating theme toggler (sun↔moon crossfade) ── */
.att-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 50;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-secondary, #fff);
    color: rgba(0, 0, 0, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(76, 29, 149, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;  /* clip de los iconos rotando */
}

[data-theme="dark"] .att-fab,
.dark .att-fab {
    color: rgba(255, 255, 255, 0.82);
    background: var(--bg-secondary, #1e1b4b);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.50), 0 2px 6px rgba(0, 0, 0, 0.30);
}

.att-fab:hover { transform: scale(1.10); }
.att-fab:active { transform: scale(0.86); transition-duration: 0.12s; }

/* Mobile-safe: respeta safe-area iOS y se levanta sobre el bottom-nav */
@supports (padding: max(0px)) {
    .att-fab {
        right: max(20px, env(safe-area-inset-right));
        bottom: calc(max(20px, env(safe-area-inset-bottom)) + 76px);
    }
}

/* SVG container: solo rotación del wrapper (cx/cy/r se animan via JS) */
.att-svg {
    transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
}
[data-theme="dark"] .att-svg,
.dark .att-svg { transform: rotate(270deg); }

/* Rays: opacity + transform via CSS (esto sí funciona en todos los browsers) */
.att-rays {
    transform-origin: 12px 12px;
    transform-box: fill-box;
    transition: opacity 0.45s ease,
                transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-theme="dark"] .att-rays,
.dark .att-rays {
    opacity: 0;
    transform: scale(0) rotate(-30deg);
}

/* cx, cy, r de body y mask-circle se animan VÍA JS imperativamente
   (CSS animation de SVG geometry attrs es brittle entre browsers) */

@media (prefers-reduced-motion: reduce) {
    .att-svg, .att-rays, .att-fab { transition-duration: 0.001ms !important; }
}

/* ── Mini sparkline embebido en summary cards ── */
.spark-mini {
    height: 56px;
    width: 100%;
    pointer-events: none;
    opacity: 0.95;
    margin-top: 0.5rem;
}

.spark-mini .apexcharts-canvas {
    background: transparent !important;
}


/* Detail Modal List */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    transition: all 0.15s;
}

.detail-row:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.detail-row-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-row-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.detail-row-amount {
    font-size: 1.05rem;
    font-weight: 700;
    white-space: nowrap;
}

.detail-row-bar {
    height: 4px;
    border-radius: 2px;
    margin-top: 6px;
    background: var(--bg-hover);
    overflow: hidden;
}

.detail-row-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.detail-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Utility ── */
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-purple { color: var(--purple); }
.bg-accent-light { background: var(--accent-lighter); }
.bg-danger-light { background: var(--danger-light); }
.bg-warning-light { background: var(--warning-light); }
.bg-info-light { background: var(--info-light); }
.bg-purple-light { background: var(--purple-light); }
.text-indigo { color: #6366f1; }
.bg-indigo-light { background: rgba(99, 102, 241, 0.15); }

/* ═══════════════════════════════════════════════════════════════
   WHEEL PICKER + BOTTOM SHEET (iOS-style date/time picker)
   Adaptado del DateWheelPicker shadcn/framer-motion a vanilla.
   Cada columna usa scroll-snap nativo + JS lee el item central.
   ═══════════════════════════════════════════════════════════════ */

.bottom-sheet-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: flex-end; justify-content: center;
    animation: bsFade 0.2s ease-out;
}
.bottom-sheet-overlay.hidden { display: none; }
@keyframes bsFade { from { opacity: 0; } to { opacity: 1; } }

.bottom-sheet {
    background: var(--bg-primary);
    border-radius: 24px 24px 0 0;
    padding: 0.85rem 1rem 1.1rem;
    width: 100%; max-width: 500px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    animation: bsSlide 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: max(1.1rem, env(safe-area-inset-bottom));
    max-height: 92vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) {
    .bottom-sheet-overlay { align-items: center; }
    .bottom-sheet {
        border-radius: 24px;
        max-width: 440px;
        animation: bsZoom 0.22s ease-out;
    }
    .bottom-sheet-handle { display: none; }
}
@keyframes bsSlide { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes bsZoom { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.bottom-sheet-handle {
    width: 36px; height: 4px; border-radius: 2px;
    background: var(--border);
    margin: 0 auto 0.75rem;
}

.bottom-sheet-title {
    font-size: 1.05rem; font-weight: 700;
    color: var(--text-primary);
    text-align: center; margin-bottom: 0.6rem;
}

.wheel-quickpick {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    justify-content: center; margin-bottom: 0.55rem;
}
.wheel-quickpick button {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem; font-weight: 600;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
}
.wheel-quickpick button:hover,
.wheel-quickpick button:focus-visible {
    background: var(--accent-lighter);
    border-color: var(--accent);
    color: var(--accent);
}

.wheel-picker {
    display: flex; gap: 0.5rem;
    align-items: center; justify-content: center;
    user-select: none;
    -webkit-user-select: none;
}

.wheel-col {
    position: relative;
    height: 160px;
    flex: 0 0 auto;
    overflow: hidden;
    background: transparent;
    border-radius: 12px;
}
.wheel-col.day { width: 56px; }
.wheel-col.month { width: 112px; }
.wheel-col.year { width: 72px; }
.wheel-col.hour { width: 56px; }
.wheel-col.minute { width: 56px; }

.wheel-col::before {
    content: '';
    position: absolute; left: 4px; right: 4px;
    top: 60px; height: 40px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--accent-lighter);
    border-radius: 8px;
    pointer-events: none; z-index: 1;
}
.wheel-col::after {
    content: '';
    position: absolute; left: 0; right: 0; top: 0; bottom: 0;
    background:
        linear-gradient(to bottom, var(--bg-primary) 0%, transparent 40%),
        linear-gradient(to top, var(--bg-primary) 0%, transparent 40%);
    pointer-events: none; z-index: 2;
}

.wheel-scroll {
    position: relative; z-index: 0;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 60px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.wheel-scroll::-webkit-scrollbar { display: none; }

.wheel-item {
    height: 40px;
    scroll-snap-align: center;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.18s, opacity 0.18s, font-size 0.15s;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    opacity: 0.35;
}
.wheel-item.is-selected {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.05rem;
    opacity: 1;
}
.wheel-item.is-near { opacity: 0.7; }

.wheel-divider {
    display: flex; align-items: center; gap: 0.5rem;
    margin: 0.35rem 0 0.25rem;
    font-size: 0.65rem; font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.wheel-divider::before, .wheel-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

.bottom-sheet-actions {
    display: flex; gap: 0.5rem;
    margin-top: 0.75rem;
}
.bottom-sheet-actions button {
    flex: 1; padding: 0.7rem 1rem;
    font-size: 0.9rem; font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    border: 1px solid transparent;
}
.bottom-sheet-actions .bs-cancel {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}
.bottom-sheet-actions .bs-confirm {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.bottom-sheet-actions button:hover { opacity: 0.88; }
.bottom-sheet-actions button:active { transform: scale(0.98); }

.bs-input {
    width: 100%;
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    margin-bottom: 0.55rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.bs-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-lighter);
}

/* ─── Mobile: TODO debe caber sin scroll interno ───
   Objetivo: ~360px de alto total para entrar en cualquier viewport ≥ 568px
   (iPhone SE 1ra gen incluido). Eliminamos dividers, comprimimos ruedas. */
@media (max-width: 640px) {
    .bottom-sheet {
        padding: 0.6rem 0.6rem 0.85rem;
        padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
        overflow-y: visible;   /* sin scroll interno */
        max-height: none;
    }
    .bottom-sheet-handle { margin: 0 auto 0.4rem; }
    .bottom-sheet-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    .bs-input {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
        border-radius: 10px;
    }
    .wheel-quickpick { gap: 0.3rem; margin-bottom: 0.5rem; }
    .wheel-quickpick button {
        padding: 0.28rem 0.65rem;
        font-size: 0.72rem;
    }
    /* Dividers Fecha/Hora invisibles — se entiende por la separación visual */
    .wheel-divider { display: none; }
    .wheel-picker { gap: 0.3rem; margin-bottom: 0.35rem; }
    .wheel-picker:last-of-type { margin-bottom: 0; }
    /* Ruedas de 100px (item central a 40px, padding 30px) */
    .wheel-col { height: 100px; border-radius: 10px; }
    .wheel-col::before { top: 30px; left: 2px; right: 2px; }
    .wheel-scroll { padding: 30px 0; }
    /* Columnas un poco más estrechas para no apretar el ancho */
    .wheel-col.day { width: 48px; }
    .wheel-col.month { width: 96px; }
    .wheel-col.year { width: 62px; }
    .wheel-col.hour { width: 50px; }
    .wheel-col.minute { width: 50px; }
    .wheel-item { font-size: 0.88rem; }
    .wheel-item.is-selected { font-size: 0.98rem; }
    .bottom-sheet-actions { margin-top: 0.65rem; gap: 0.4rem; }
    .bottom-sheet-actions button {
        padding: 0.55rem 0.8rem;
        font-size: 0.88rem;
        border-radius: 10px;
    }
}

/* Pantallas ultra-compactas (iPhone SE 1ra gen, 320px) */
@media (max-width: 360px) {
    .wheel-col.month { width: 84px; }
    .wheel-col.year { width: 54px; }
    .wheel-quickpick button { padding: 0.25rem 0.5rem; font-size: 0.68rem; }
}

/* Pantallas mobile bajas (Galaxy Fold cerrado, landscape pequeño) — sin
   quickpick chips para ahorrar espacio vertical */
@media (max-height: 600px) and (max-width: 640px) {
    .wheel-quickpick { display: none; }
    .wheel-col { height: 88px; }
    .wheel-col::before { top: 24px; }
    .wheel-scroll { padding: 24px 0; }
}

