:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #764ba2;
    --bg-color: #f4f7f6; /* Un gris un poco más claro y moderno */
    --card-radius: 20px; /* Reducido de 24px para ser más elegante */
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.05); /* Sombra mucho más suave */
}

html, body {
    height: 100%;
    background-color: var(--bg-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
    color: #2c3e50; /* Texto no negro absoluto, más elegante */
}

/* --- UTILIDADES VISUALES --- */

/* Tarjetas Generales */
.card-custom {
    border: none;
    border-radius: var(--card-radius);
    background-color: white;
    box-shadow: var(--shadow-soft);
    transition: transform 0.15s ease-in-out;
}

/* Botones Refinados */
.btn-primary-custom {
    background: var(--primary-gradient);
    border: none;
    border-radius: 50px;
    padding: 10px 20px; /* Más chicos */
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.3);
    color: white;
}
.btn-primary-custom:active { transform: scale(0.98); }

/* --- SOLUCIÓN CÍRCULOS PERFECTOS --- */
.rounded-circle-custom {
    width: 42px;
    height: 42px;
    min-width: 42px;  /* OBLIGATORIO: Evita que se aplaste */
    min-height: 42px; /* OBLIGATORIO */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;   /* OBLIGATORIO: No permite deformarse */
}

/* --- CARRUSEL DE TARJETAS (UNIFORMIDAD) --- */
.scrolling-wrapper {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 12px; /* Espacio constante entre tarjetas */
    padding: 10px 20px 20px 20px; /* Padding lateral para que no se corten */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrolling-wrapper::-webkit-scrollbar { display: none; }

.card-tarjeta-horizontal {
    flex: 0 0 auto; /* No estirar, respetar ancho fijo */
    width: 260px;   /* ANCHO FIJO PARA TODAS */
    height: 145px;  /* ALTO FIJO PARA TODAS */
    background: white;
    border-radius: 18px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s;
}

.card-tarjeta-horizontal:active { transform: scale(0.98); }

/* Tarjeta "Nueva Cuenta" idéntica a las otras */
.card-tarjeta-horizontal.add-new {
    border: 1.5px dashed #cbd5e0;
    box-shadow: none;
    background: transparent;
    align-items: center;
    justify-content: center;
}

/* --- HEADER MÁS FINO --- */
.hero-section-custom {
    padding-bottom: 40px !important; /* Menos aire innecesario */
    background: var(--primary-gradient);
    border-radius: 0 0 30px 30px; /* Curva más sutil */
    box-shadow: 0 10px 25px rgba(118, 75, 162, 0.2);
}

.glass-pill {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 8px 12px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- NAVEGACIÓN INFERIOR --- */
.bottom-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    height: 70px; /* Más bajita */
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.03);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}
.nav-item { text-align: center; color: #b0b8c1; font-size: 0.7rem; width: 60px; }
.nav-item i { font-size: 1.3rem; margin-bottom: 2px; display: block; }
.nav-item.active { color: var(--primary-color); }

/* Botón flotante central */
.fab-container { position: relative; top: -20px; }
.fab-button {
    width: 55px; /* Más chico y fino */
    height: 55px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(118, 75, 162, 0.4);
    color: white; font-size: 28px;
    border: 4px solid var(--bg-color);
}
/* --- OVERLAY MEJORADO --- */
.fab-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.95); /* Fondo más sólido para limpieza */
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: none; 
    opacity: 0; 
    transition: opacity 0.2s ease-in-out;
}
.fab-overlay.active { display: block; opacity: 1; }

/* Opciones del menú (Ahora aplicadas directo al link <a>) */
.fab-option { 
    position: absolute;
    bottom: 30px; 
    left: 50%;
    width: 90px; /* Ancho fijo para centrado perfecto */
    margin-left: -45px; /* (Ancho / 2) para centrar en el eje 0 */
    display: flex; 
    flex-direction: column; 
    align-items: center;
    text-decoration: none !important;
    transform: scale(0.5) translateY(50px); /* Efecto de brote */
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 2005; 
}

/* Estado Activo */
.fab-overlay.active .fab-option {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* --- COORDENADAS SIMÉTRICAS PERFECTAS (Radio ~135px) --- */

/* 1. Categorías (Izquierda baja) */
.fab-overlay.active .fan-1 { 
    bottom: 70px; 
    margin-left: -175px; /* -45 (centro) - 130 (desplazamiento) */
    transition-delay: 0.05s; 
}

/* 2. Ingreso (Izquierda alta) */
.fab-overlay.active .fan-2 { 
    bottom: 155px; 
    margin-left: -105px; /* -45 (centro) - 60 (desplazamiento) */
    transition-delay: 0.1s; 
}

/* 3. Transferencia (Derecha alta - ESPEJO PERFECTO) */
.fab-overlay.active .fan-3 { 
    bottom: 155px; 
    margin-left: 15px; /* -45 (centro) + 60 (desplazamiento) */
    transition-delay: 0.15s; 
}

/* 4. Gasto (Derecha baja - ESPEJO PERFECTO) */
.fab-overlay.active .fan-4 { 
    bottom: 70px; 
    margin-left: 85px; /* -45 (centro) + 130 (desplazamiento) */
    transition-delay: 0.2s; 
}

/* Estilo de los iconos */
.fab-icon {
    width: 60px; height: 60px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: white; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); 
    margin-bottom: 8px;
    transition: transform 0.2s;
}
.fab-option:active .fab-icon { transform: scale(0.9); }
.fab-label { 
    font-size: 0.8rem; font-weight: 700; color: #555; 
    text-align: center; text-shadow: 0 0 10px rgba(255,255,255,1);
}

/* Botón de Cerrar (X) */
.fab-close-btn {
    position: absolute;
    bottom: 35px; /* Ajuste fino para coincidir con el botón inferior */
    left: 50%;
    transform: translateX(-50%) rotate(0deg);
    width: 65px; height: 65px; /* Un poco más grande para tapar el de abajo */
    background-color: #fff;
    border: 1px solid #eee;
    color: #e74c3c;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    z-index: 2010;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.2s;
}
.fab-overlay.active .fab-close-btn { transform: translateX(-50%) rotate(90deg); }
.fab-close-btn:active { background-color: #f9f9f9; }

/* Estilo de los iconos */
.fab-icon {
    width: 55px; height: 55px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center;
    font-size: 24px; color: white; 
    box-shadow: 0 8px 20px rgba(0,0,0,0.2); 
    margin-bottom: 8px;
}
.fab-option:active .fab-icon { transform: scale(0.95); }
.fab-label { font-size: 0.8rem; font-weight: 700; color: #444; text-align: center; }
.bg-ingreso { background-color: #2ecc71; }
.bg-gasto { background-color: #e74c3c; }
.bg-transfer { background-color: #f1c40f; }

/* Ocultar barra de scroll pero permitir deslizar */
.scroll-horizontal {
        overflow-x: auto;
        white-space: nowrap;
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
}
.scroll-horizontal::-webkit-scrollbar {
    display: none;
}

/* Estilo de la etiqueta (Chip) en la barra superior */
.active-filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    background-color: white;
    border: 1px solid #e0e0e0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
    margin-right: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}