a

/* Style for disabled select */
select:disabled {
    background-color: #f3f4f6;
    /* gray-100 */
    cursor: not-allowed;
}

.dark select:disabled {
    background-color: #4b5563;
    /* gray-600 */
}

/* Ensure tooltips are visible in dark mode */
.chartjs-tooltip {
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    border-radius: 4px !important;
    padding: 6px !important;
}

.dark .chartjs-tooltip {
    background: rgba(255, 255, 255, 0.8) !important;
    color: black !important;
}

/* Animation for notifications */
@keyframes slideIn {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }

    50% {
        transform: translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification {
    animation: slideIn 2s ease-out forwards;
}

/* Custom scrollbar for better UX */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-track {
    background: #374151;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Transition effects for dark mode toggle */
.dark-mode-transition {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Transiciones deshabilitadas para mejor rendimiento */
/*
button, .hover-lift, .card-hover {
    transition: all 0.2s ease;
}
*/

/* Subtle hover effects for cards and sections */
.hover-lift:hover {
    transform: translateY(-1px);
}

.card-hover:hover {
    box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.15);
}

.dark .card-hover:hover {
    box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.4);
}

/* Styles for financial summary cards */
/* Efectos de tarjetas deshabilitados para mejor rendimiento */
/*
.summary-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
*/

.dark .summary-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dark .summary-card:hover {
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.4), 0 4px 10px -2px rgba(0, 0, 0, 0.3);
}

/* Styles for AI advisor section */
.ai-advisor-container {
    border-left: 4px solid #6366f1;
    transition: border-color 0.3s ease;
}

.dark .ai-advisor-container {
    border-left-color: #818cf8;
}

/* Loading spinner animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* Forzar fondo gris en ambos modos */
body {
    background-color: #f3f4f6 !important;
    /* gray-100 para modo claro */
}

html.dark body {
    background-color: #374151 !important;
    /* gray-700 para modo oscuro (gris más claro) */
    color: #e5e7eb !important;
    /* gray-200 */
}

/* Asegurar que los contenedores también tengan el fondo correcto */
.container {
    background-color: #f3f4f6 !important;
    /* gray-100 para modo claro */
}

html.dark .container {
    background-color: #374151 !important;
    /* gray-700 para modo oscuro (gris más claro) */
}

/* Estilos para el botón flotante de voz */
#floatingVoiceBtn {
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    /* green-500 */
}

#floatingVoiceBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    /* green-500 */
}

#floatingVoiceBtn:active {
    transform: scale(0.95);
}

/* Animación removida del botón flotante - solo para botón AI */

/* Estados del botón flotante */
#floatingVoiceBtn.listening {
    background-color: #dc2626;
    /* red-600 */
    animation: none;
}

#floatingVoiceBtn.listening:hover {
    background-color: #b91c1c;
    /* red-700 */
}

/* Transición suave para mostrar/ocultar */
#floatingVoiceBtn.hidden {
    opacity: 0;
    pointer-events: none;
}

#floatingVoiceBtn.scale-0 {
    transform: scale(0);
}

#floatingVoiceBtn.scale-100 {
    transform: scale(1);
}

/* Asegurar colores verdes por defecto */
#floatingVoiceBtn:not(.listening) {
    background-color: #16a34a !important;
    /* green-600 */
}

#floatingVoiceBtn:not(.listening):hover {
    background-color: #15803d !important;
    /* green-700 */
}

/* Botón de voz del header removido completamente - ahora solo existe el botón flotante */

/* Corregir el selector para el modo oscuro - usar html.dark en lugar de .dark */
html.dark select:disabled {
    background-color: #4b5563 !important;
    /* gray-600 */
}

html.dark .chartjs-tooltip {
    background: rgba(255, 255, 255, 0.8) !important;
    color: black !important;
}

html.dark ::-webkit-scrollbar-track {
    background: #374151 !important;
}

html.dark ::-webkit-scrollbar-thumb {
    background: #4b5563 !important;
}

html.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280 !important;
}

html.dark .summary-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2) !important;
}

html.dark .ai-advisor-container {
    border-left-color: #818cf8 !important;
}

/* Asegurar que todos los paneles y tarjetas tengan el fondo correcto en modo oscuro */
html.dark .bg-white {
    background-color: #1f2937;
    /* gray-800 */
}

/* Asegurar fondo transparente para elementos de lista de categorías */
.category-list-item {
    background-color: transparent !important;
}

/* Asegurar que la lista de categorías en el modal de configuración no tenga gradiente de fondo */
#settingsModal #categoryListContainer li {
    background: transparent !important;
    background-color: transparent !important;
    color: #ffffff !important;
    /* Blanco para todo el texto en los elementos de lista */
}

html.dark .text-gray-800 {
    color: #e5e7eb;
    /* gray-200 */
}

html.dark .text-gray-600 {
    color: #e5e7eb;
    /* gray-200 */
}

html.dark .border-gray-200 {
    border-color: #374151 !important;
    /* gray-700 */
}

/* Asegurar que los encabezados de sección sean visibles en modo oscuro */
html.dark h2,
html.dark h3,
html.dark h4 {
    color: #e5e7eb;
    /* gray-200 */
}

/* Asegurar que las tablas sean visibles en modo oscuro */
html.dark table,
html.dark th,
html.dark td {
    border-color: #374151 !important;
    /* gray-700 */
}

html.dark thead tr {
    background-color: #1f2937 !important;
    /* gray-800 */
    color: #e5e7eb !important;
    /* gray-200 */
}

html.dark tbody tr {
    background-color: #1f2937 !important;
    /* gray-800 */
    color: #e5e7eb !important;
    /* gray-200 */
}

/* Asegurar que los botones sean visibles en modo oscuro */
html.dark button {
    background-color: #374151;
    color: #e5e7eb;
    border-color: #4b5563;
}

/* Excepciones para botones específicos que deben mantener sus colores */
html.dark button#newTransactionBtn {
    background-color: rgba(16, 185, 129, 0.8) !important;
    /* verde semi-transparente */
    color: white !important;
    border-color: rgba(16, 185, 129, 0.6) !important;
}

html.dark button#settingsBtn,
html.dark button#darkModeToggleBtn {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
}

/* Style for collapse toggle buttons in dark mode */
html.dark .collapse-toggle {
    background-color: transparent !important;
    border-color: transparent !important;
}

/* Fix dropdown text color in dark mode */
html.dark #period-dropdown-options a {
    color: #e5e7eb !important;
    /* gray-200 */
}

html.dark #period-dropdown-options a:hover {
    background-color: #4b5563 !important;
    /* gray-600 */
}


/* Mejorar visibilidad del logo en ambos modos - VERSIÓN UNIFICADA */
img[src="finai_logo.png"] {
    height: 6.75rem !important;
    /* Tamaño aumentado otro 50% más */
    width: auto !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    border-radius: 6px;
    margin-right: 1rem !important;
}

/* Logo aún más grande en desktop */
@media (min-width: 1024px) {
    img[src="finai_logo.png"] {
        height: 5.25rem !important;
        filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
        margin-right: 1.25rem !important;
    }
}

html.dark img[src="finai_logo.png"] {
    filter: brightness(1.2) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

/* Ajustar para móviles */
@media (max-width: 768px) {
    img[src="finai_logo.png"] {
        height: 3.36rem !important;
        /* Tamaño aumentado 20% para móviles */
        transform: scale(1.2);
    }
}

/* Estilo tipo banner para el encabezado */
header .flex.items-center {
    background: linear-gradient(135deg, #4338ca 0%, #3b82f6 100%);
    padding: 0.5rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.15), 0 4px 10px -2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    min-height: auto;
}

/* Mejoras específicas para desktop */
@media (min-width: 1024px) {
    header .flex.items-center {
        padding: 0.125rem 0.75rem;
        margin-bottom: 0.25rem;
        min-height: auto;
        align-items: center;
        height: fit-content;
    }

    header .flex.items-center h1 {
        font-size: 2.3625rem;
        margin-bottom: 0;
        line-height: 1.1;
        margin-top: 0.5rem;
    }

    header .flex.items-center p {
        font-size: 1.205rem;
        margin-top: 0.3rem;
        line-height: 1.1;
    }

    /* Mejorar sistema de botones para desktop - formato más compacto */
    header .mt-4.md\:mt-0.flex.space-x-2 {
        margin-top: 0;
        margin-left: auto;
    }

    header .mt-4.md\:mt-0.flex.space-x-2 button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        border-radius: 0.375rem;
        transition: all 0.2s ease;
        min-width: 120px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    header .mt-4.md\:mt-0.flex.space-x-2 button:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    header button#newTransactionBtn {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
        font-weight: 600;
    }

    header button#settingsBtn {
        background: rgba(255, 255, 255, 0.9);
        color: #374151;
        border: 1px solid #d1d5db;
        min-width: 100px;
        height: 32px;
    }

    header button#settingsBtn i {
        color: #4b5563;
    }

    header button#settingsBtn:hover {
        background: white;
        color: #1f2937;
    }

    header button#settingsBtn:hover i {
        color: #374151;
    }

    /* Mejores espaciados en las tarjetas del dashboard */
    .bg-white.dark\:bg-gray-800.rounded-lg.shadow-lg.p-6 {
        padding: 2rem;
        margin-bottom: 1rem;
    }

    /* Mejor espaciado en la tabla de transacciones */
    .overflow-x-auto table {
        margin-top: 1rem;
    }

    /* Mejor espaciado en los controles de filtro */
    .mb-4.flex.flex-col.space-y-2.sm\:flex-row.sm\:space-x-4.sm\:space-y-0.items-center {
        margin-bottom: 2rem;
    }

    /* Mejor espaciado en la sección de presupuestos */
    #budgetSectionContent {
        padding: 2rem;
    }

    /* Mejor espaciado en los gráficos */
    .h-64.flex.items-center.justify-center {
        height: 20rem;
    }
}

/* Eliminar cualquier fondo adicional en el contenedor del título */
header .flex.items-center>div.flex.items-center {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    flex-wrap: nowrap !important;
}

/* Ajustar colores del título para que se vea bien sobre el fondo del banner */
header .flex.items-center h1 {
    color: white !important;
}

header .flex.items-center h1 span {
    color: #34d399 !important;
    /* verde-400 */
}

header .flex.items-center p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Mantener el estilo en modo oscuro */
html.dark header .flex.items-center {
    background: #1f2937 !important;
    /* gray-800 for a darker gray banner */
}

/* Estilos para los botones en el banner */
/* Efectos de botones del header deshabilitados para mejor rendimiento */
/*
header .mt-4.md\:mt-0.flex.space-x-2 button {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

header .mt-4.md\:mt-0.flex.space-x-2 button:hover {
    background-color: rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}
*/

/* Iconos en los botones */
header .mt-4.md\:mt-0.flex.space-x-2 button i {
    color: white !important;
    font-size: 1rem !important;
    margin-right: 0.5rem !important;
}

/* Estilo específico para el botón de nuevo movimiento */
header button#newTransactionBtn {
    background-color: rgba(16, 185, 129, 0.8) !important;
    /* verde semi-transparente */
    border: 1px solid rgba(16, 185, 129, 0.6);
}

header button#newTransactionBtn:hover {
    background-color: rgba(16, 185, 129, 1) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* Ajustes responsivos para los botones del banner */
@media (max-width: 768px) {
    header .mt-4.md\:mt-0.flex.space-x-2 button {
        padding: 0.5rem !important;
        font-size: 0.75rem !important;
        border-radius: 50% !important;
        min-width: 2.2rem !important;
        width: 2.2rem !important;
        height: 2.2rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        aspect-ratio: 1/1 !important;
    }

    header .mt-4.md\:mt-0.flex.space-x-2 {
        margin-top: 0.5rem !important;
    }

    header .mt-4.md\:mt-0.flex.space-x-2 {
        position: absolute !important;
        top: 0.5rem !important;
        right: 0.5rem !important;
        margin-top: 0 !important;
        /* Remove negative margin */
    }

    /* Hacer que los iconos sean más pequeños en móvil */
    header .mt-4.md\:mt-0.flex.space-x-2 button i {
        font-size: 0.85rem !important;
        margin-right: 0 !important;
    }

    /* Ajustar el espaciado entre botones */
    header .mt-4.md\:mt-0.flex.space-x-2 {
        gap: 0.5rem !important;
    }

    /* Hacer que el banner se adapte mejor */
    header .flex.items-center {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 0.75rem !important;
    }

    /* Asegurar que los botones ocupen el ancho completo */
    header .mt-4.md\:mt-0.flex.space-x-2 {
        width: 100% !important;
        justify-content: flex-end !important;
    }

    /* Ocultar texto en botones y mostrar solo iconos */
    header .mt-4.md\:mt-0.flex.space-x-2 button span {
        display: none !important;
    }

    /* --- Reglas específicas para móvil (movidas aquí) --- */

    /* Mantener el color del banner de modo claro en modo oscuro para móviles */
    html.dark header .flex.items-center {
        background: linear-gradient(135deg, #4338ca 0%, #3b82f6 100%) !important;
    }

    /* Ocultar botón "Nuevo Movimiento" en móvil */
    header button#newTransactionBtn {
        display: none !important;
    }

    /* Posicionar el icono de configuración en la esquina superior derecha en modo móvil */
    header .mobile-settings-icon {
        position: absolute !important;
        top: 0.01rem !important;
        /* Ajustado para mover ligeramente hacia arriba */
        right: 0.5rem !important;
        z-index: 10 !important;
    }

    /* Contenedor relativo para el posicionamiento absoluto del icono móvil */
    header .flex.items-center {
        position: relative !important;
    }

    /* Restaurar gap original en móvil */
    .grid.grid-cols-1.lg\:grid-cols-3 {
        gap: 1.5rem !important;
    }

    /* Hacer el modal de transacción ocupar toda la pantalla en móvil */
    /* Temporarily commented out for debugging mobile modal visibility */
    /* 
    #transactionModal {
        align-items: flex-start !important;
    }

    #transactionModal > div {
        width: 100% !important;
        max-width: none !important;
        height: 100vh !important;
        max-height: none !important;
        overflow-y: auto !important;
        padding: 2rem !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    */

    #transactionForm> :not([hidden])~ :not([hidden]) {
        margin-top: 0.75rem !important;
        /* Reducir espacio entre elementos del form (era space-y-4) */
    }

    /* --- Fin de reglas específicas para móvil --- */

    .mobile-transaction-list {
        max-height: 300px;
        /* Adjust as needed for mobile */
        overflow-y: auto;
    }

    /* Ensure mobile transaction list and individual cards are completely hidden when the section is collapsed */
    #transactionHistoryContent.hidden .mobile-transaction-list {
        display: none !important;
        max-height: 0 !important;
        overflow: hidden !important;
        /* Also remove any potential gap/space from the list container */
        gap: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    #transactionHistoryContent.hidden .mobile-transaction-list .mobile-transaction-card {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Ensure the collapse-content is completely hidden when the parent section is collapsed on mobile */
    @media (max-width: 768px) {
        .transaction-history-container .collapse-content.hidden {
            display: none !important;
        }

        /* Remove padding from the transaction history container when collapsed on mobile */
        .transaction-history-container:has(.collapse-content.hidden) {
            padding-top: 1.5rem !important;
            /* Restore top padding */
            padding-bottom: 1.5rem !important;
            /* Restore bottom padding */
            padding-left: 1.5rem !important;
            /* Keep horizontal padding if needed, adjust as per design */
            padding-right: 1.5rem !important;
            /* Keep horizontal padding if needed, adjust as per design */
        }
    }

    /* Ensure date input text is visible in dark mode on mobile */
    html.dark input[type="date"] {
        color: #e5e7eb !important;
        /* gray-200 */
    }
}

/* Contenedor relativo GLOBAL para el header (necesario para el icono móvil absoluto) */
header .flex.items-center {
    position: relative !important;
}




#aiAdvisorContent {
    background-color: rgba(75, 192, 192, 0.2) !important;
    /* Verde transparente para modo claro */
}

html.dark #aiAdvisorContent {
    background-color: rgba(27, 94, 32, 0.2) !important;
    /* Verde oscuro transparente para modo oscuro */
}

/* Estilos para el formato Markdown en el contenedor de IA */
#aiAdvisorContent strong,
#aiAdvisorContent b {
    font-weight: 700 !important;
    color: inherit !important;
}

#aiAdvisorContent em,
#aiAdvisorContent i {
    font-style: italic !important;
    color: inherit !important;
}

#aiAdvisorContent ul {
    list-style-type: disc !important;
    padding-left: 1.5rem !important;
    margin: 0.5rem 0 !important;
}

#aiAdvisorContent ol {
    list-style-type: decimal !important;
    padding-left: 1.5rem !important;
    margin: 0.5rem 0 !important;
}

#aiAdvisorContent li {
    margin-bottom: 0.25rem !important;
}

#aiAdvisorContent p {
    margin-bottom: 0.75rem !important;
}

#aiAdvisorContent h1,
#aiAdvisorContent h2,
#aiAdvisorContent h3,
#aiAdvisorContent h4 {
    font-weight: 600 !important;
    margin-top: 1rem !important;
    margin-bottom: 0.5rem !important;
    color: inherit !important;
}

/* Asegurar que los estilos Markdown también funcionen en modo oscuro */
html.dark #aiAdvisorContent strong,
html.dark #aiAdvisorContent b,
html.dark #aiAdvisorContent em,
html.dark #aiAdvisorContent i,
html.dark #aiAdvisorContent h1,
html.dark #aiAdvisorContent h2,
html.dark #aiAdvisorContent h3,
html.dark #aiAdvisorContent h4 {
    color: #ffffff !important;
}

/* Mejorar visibilidad en modales para modo oscuro */
html.dark #transactionModal .text-gray-700,
html.dark #transactionModal label,
html.dark #transactionModal input,
html.dark #transactionModal select,
html.dark #transactionModal textarea {
    color: #e5e7eb !important;
    /* gray-200 para mejor legibilidad */
}

html.dark #transactionModal input,
html.dark #transactionModal select,
html.dark #transactionModal textarea {
    background-color: #374151 !important;
    /* gray-700 */
    border-color: #4b5563 !important;
    /* gray-600 */
}

html.dark #transactionModal input::placeholder,
html.dark #transactionModal textarea::placeholder {
    color: #9ca3af !important;
    /* gray-400 */
}

/* Asegurar que los textos de ayuda sean visibles */
html.dark #transactionModal .text-xs.text-gray-500 {
    color: #9ca3af !important;
    /* gray-400 */
}

/* Mejorar contraste para los botones en el modal */
html.dark #transactionModal button.bg-indigo-600 {
    background-color: #4f46e5 !important;
    /* indigo-600 */
    color: white !important;
}

html.dark #transactionModal button.bg-indigo-600:hover {
    background-color: #4338ca !important;
    /* indigo-700 */
}

html.dark #transactionModal button.bg-red-600 {
    background-color: #dc2626 !important;
    /* red-600 */
    color: white !important;
}

html.dark #transactionModal button.bg-red-600:hover {
    background-color: #b91c1c !important;
    /* red-700 */
}

html.dark #transactionModal button.bg-gray-200 {
    background-color: #4b5563 !important;
    /* gray-600 */
    color: #e5e7eb !important;
    /* gray-200 */
}

html.dark #transactionModal button.bg-gray-200:hover {
    background-color: #6b7280 !important;
    /* gray-500 */
}

/* Mejorar visibilidad en modal de configuración para modo oscuro */
html.dark #settingsModal .text-gray-700,
html.dark #settingsModal label,
html.dark #settingsModal input,
html.dark #settingsModal select,
html.dark #settingsModal textarea {
    color: #e5e7eb !important;
    /* gray-200 */
}

html.dark #settingsModal input,
html.dark #settingsModal select,
html.dark #settingsModal textarea {
    background-color: #374151 !important;
    /* gray-700 */
    border-color: #4b5563 !important;
    /* gray-600 */
}

html.dark #settingsModal input::placeholder,
html.dark #settingsModal textarea::placeholder {
    color: #9ca3af !important;
    /* gray-400 */
}

html.dark #settingsModal .text-xs.text-gray-500 {
    color: #9ca3af !important;
    /* gray-400 */
}

/* Estilos mejorados para el modal de configuración */
#settingsModal .space-y-6>div {
    background: rgba(255, 255, 255, 0.5) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 0.75rem !important;
    padding: 1rem !important;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* Sección de apariencia más compacta */
#settingsModal .space-y-6>div:nth-child(1) {
    padding: 0.75rem 1rem !important;
}

#settingsModal .space-y-6>div:hover {
    background: rgba(255, 255, 255, 0.7) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-1px) !important;
}

html.dark #settingsModal .space-y-6>div {
    background: rgba(31, 41, 55, 0.5) !important;
    border-color: rgba(75, 85, 99, 0.3) !important;
}

html.dark #settingsModal .space-y-6>div:hover {
    background: rgba(31, 41, 55, 0.7) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Iconos para las secciones */
#settingsModal .space-y-6>div:nth-child(1)::before {
    content: '🎨' !important;
    font-size: 1.2rem !important;
    margin-right: 0.5rem !important;
}

#settingsModal .space-y-6>div:nth-child(2)::before {
    content: '💾' !important;
    font-size: 1.5rem !important;
    margin-right: 0.5rem !important;
}

#settingsModal .space-y-6>div:nth-child(3)::before {
    content: '🔄' !important;
    font-size: 1.5rem !important;
    margin-right: 0.5rem !important;
}

#settingsModal .space-y-6>div:nth-child(4)::before {
    content: '🏷️' !important;
    font-size: 1.5rem !important;
    margin-right: 0.5rem !important;
}

/* Mejorar botones en configuración */
#settingsModal button {
    border-radius: 0.5rem !important;
    font-weight: 500 !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease !important;
}

#settingsModal button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

/* Colores específicos para botones de backup */
#manualBackupButton {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
}

#manualBackupButton:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}

#loadBackupButton {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    color: white !important;
}

#loadBackupButton:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
}

/* Mejorar inputs y selects */
#settingsModal input,
#settingsModal select {
    border-radius: 0.5rem !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}

#settingsModal input:focus,
#settingsModal select:focus {
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1) !important;
    border-color: #4f46e5 !important;
}

/* Mejorar el footer del modal */
#settingsModal .flex.justify-end {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border-radius: 0 0 0.5rem 0.5rem !important;
}

html.dark #settingsModal .flex.justify-end {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%) !important;
}

/* Mejorar el botón de guardar */
#saveSettingsBtn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2) !important;
}

#saveSettingsBtn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3) !important;
}

/* Botón de añadir categoría con colores consistentes */
#addCategoryBtn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
}

#addCategoryBtn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
}

/* Mejorar títulos de secciones */
#settingsModal label.block {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
}

/* Sección de apariencia más compacta */
#settingsModal .space-y-6>div:nth-child(1) label {
    margin-bottom: 0.25rem !important;
    font-size: 0.9rem !important;
}

#settingsModal .space-y-6>div:nth-child(1) button {
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
}

/* Layout más compacto para la sección de apariencia */
#settingsModal .space-y-6>div:nth-child(1) {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.75rem !important;
}

#settingsModal .space-y-6>div:nth-child(1) label {
    margin-bottom: 0 !important;
    margin-right: 1rem !important;
    flex: 1 !important;
}

#settingsModal .space-y-6>div:nth-child(1) button {
    flex-shrink: 0 !important;
}

html.dark #settingsModal label.block {
    color: #e5e7eb !important;
}

/* Mejorar el header del modal */
#settingsModal .flex.justify-between.items-center {
    background: linear-gradient(135deg, #4338ca 0%, #3b82f6 100%) !important;
    color: white !important;
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

#settingsModal h3 {
    color: white !important;
    font-weight: 700 !important;
}

#settingsModal #closeSettingsBtn {
    color: rgba(255, 255, 255, 0.8) !important;
}

#settingsModal #closeSettingsBtn:hover {
    color: white !important;
}

/* Mejorar el contenedor de botones de backup */
#settingsModal .flex.flex-wrap.gap-3 {
    background: rgba(255, 255, 255, 0.8) !important;
    border-radius: 0.5rem !important;
    padding: 1rem !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

html.dark #settingsModal .flex.flex-wrap.gap-3 {
    background: rgba(31, 41, 55, 0.8) !important;
    border-color: rgba(75, 85, 99, 0.3) !important;
}

/* Mejorar la sección de categorías */
#categoryManagementSection {
    border-left: 4px solid #4f46e5 !important;
    padding-left: 1rem !important;
}

#categoryManagementSection h4 {
    color: #4f46e5 !important;
    font-weight: 600 !important;
}

html.dark #categoryManagementSection h4 {
    color: #6366f1 !important;
}

/* Mejorar checkboxes */
#settingsModal input[type="checkbox"] {
    accent-color: #4f46e5 !important;
    transform: scale(1.1) !important;
    cursor: pointer !important;
}

/* Mejorar el contenedor de auto-backup */
#settingsModal .flex.items-center.space-x-4 {
    background: rgba(255, 255, 255, 0.6) !important;
    border-radius: 0.5rem !important;
    padding: 1rem !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

html.dark #settingsModal .flex.items-center.space-x-4 {
    background: rgba(31, 41, 55, 0.6) !important;
    border-color: rgba(75, 85, 99, 0.3) !important;
}

/* Mejorar el contenedor de nueva categoría */
#settingsModal .flex.flex-col.sm\:flex-row {
    background: rgba(255, 255, 255, 0.8) !important;
    border-radius: 0.5rem !important;
    padding: 1rem !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

html.dark #settingsModal .flex.flex-col.sm\:flex-row {
    background: rgba(31, 41, 55, 0.8) !important;
    border-color: rgba(75, 85, 99, 0.3) !important;
}

/* Animación sutil para las secciones - removida para mejorar rendimiento */

/* Add padding to the bottom of the main container on small screens
   to prevent overlap with the fixed bottom navigation */
@media (max-width: 640px) {

    /* Corresponds to sm:hidden in #mobileBottomNav */
    .container {
        /* Adjust height based on nav bar height + some extra space */
        padding-bottom: 60px !important;
        /* Reducido para barra más corta */
    }
}

html.dark #settingsModal button.bg-green-600 {
    background-color: #16a34a !important;
    /* green-600 */
    color: white !important;
}

html.dark #settingsModal button.bg-green-600:hover {
    background-color: #15803d !important;
    /* green-700 */
}

html.dark #settingsModal button.bg-gray-200 {
    background-color: #4b5563 !important;
    /* gray-600 */
    color: #e5e7eb !important;
    /* gray-200 */
}

html.dark #settingsModal button.bg-gray-200:hover {
    background-color: #6b7280 !important;
    /* gray-500 */
}

/* FAB styles removed as we are using a bottom navigation bar (#mobileBottomNav) */

/* Estilos para botones de navegación inferior en modo claro */
#mobileIncomeBtn,
#mobileExpenseBtn {
    background: linear-gradient(135deg, #4338ca 0%, #3b82f6 100%);
    /* Match light mode banner */
    color: white;
    border: none;
    /* Remove potential borders that might clash with gradient */
    box-shadow: 0 4px 15px rgba(67, 56, 202, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    transform: translateY(0);
}

#mobileIncomeBtn::before,
#mobileExpenseBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#mobileIncomeBtn:hover::before,
#mobileExpenseBtn:hover::before {
    opacity: 1;
}

/* Ajustar color de hover en modo claro */
#mobileIncomeBtn:hover,
#mobileExpenseBtn:hover {
    background: linear-gradient(135deg, #3730a3 0%, #2563eb 100%);
    /* Darker gradient for hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 56, 202, 0.4);
}

#mobileIncomeBtn:active,
#mobileExpenseBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(67, 56, 202, 0.3);
    transition-duration: 0.1s;
}

/* Estilos para modo oscuro */
html.dark #mobileIncomeBtn,
html.dark #mobileExpenseBtn {
    background: linear-gradient(135deg, #4338ca 0%, #3b82f6 100%);
    /* Same as light mode banner */
    color: white !important;
    border: none;
    /* Same as light mode */
    box-shadow: 0 4px 15px rgba(67, 56, 202, 0.5);
}

html.dark #mobileIncomeBtn::before,
html.dark #mobileExpenseBtn::before {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);
}

html.dark #mobileIncomeBtn:hover,
html.dark #mobileExpenseBtn:hover {
    background: linear-gradient(135deg, #3730a3 0%, #2563eb 100%);
    /* Same as light mode hover */
    border: none;
    /* Same as light mode hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 56, 202, 0.6);
}

html.dark #mobileIncomeBtn:active,
html.dark #mobileExpenseBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(67, 56, 202, 0.4);
}

/* Asegurar que los iconos (imágenes) no se vean afectados por el color del texto */
#mobileIncomeBtn img,
#mobileExpenseBtn img {
    /* No se necesita estilo de color aquí, pero podríamos añadir filtros si fuera necesario */
}

/* Ensure date and pagination text is visible in dark mode */
html.dark .mobile-transaction-card .text-gray-700 {
    color: #ffffff !important;
    /* White for visibility */
}

html.dark .pagination-container span {
    color: #ffffff !important;
    /* White for visibility */
}

/* Ensure transaction type filter text is visible in dark mode */
html.dark #transactionTypeFilter {
    color: #ffffff !important;
    /* White for visibility */
}

/* Ensure section title icons are green in dark mode */
html.dark h2 i {
    color: #34d399 !important;
    /* verde-400 */
}

/* --- Estilos para el botón de IA en la barra de navegación inferior --- */

/* Icono (cerebro) - Verde */
#mobileBottomNav #mobileAiBtn i {
    color: #34d399;
    transition: color 0.2s ease-in-out;
}

html.dark #mobileBottomNav #mobileAiBtn i {
    color: #34d399 !important;
}

#mobileBottomNav #mobileAiBtn:hover i {
    color: #10b981;
    /* verde-500 */
}

html.dark #mobileBottomNav #mobileAiBtn:hover i {
    color: #6ee7b7 !important;
    /* verde-300 */
}

/* Texto (Resumen IA) - Azul */
#mobileBottomNav #mobileAiBtn span {
    color: #3b82f6;
    /* azul-500 */
    transition: color 0.2s ease-in-out;
}

html.dark #mobileBottomNav #mobileAiBtn span {
    color: #60a5fa !important;
    /* azul-400 */
}

#mobileBottomNav #mobileAiBtn:hover span {
    color: #2563eb;
    /* azul-600 */
}

html.dark #mobileBottomNav #mobileAiBtn:hover span {
    color: #93c5fd !important;
    /* azul-300 */
}


/* ======================================== */
/* Dark Mode Fixes for Budget Section       */
/* ======================================== */

/* Force dark background on the main budget container and inner content box */
html.dark #budgetSectionContent,
html.dark div.lg\:col-span-3>div.bg-white[class*="dark:bg-gray-800"]

/* More specific selector for the outer box */
    {
    background-color: #1f2937 !important;
    /* gray-800 */
    color: #e5e7eb !important;
    /* gray-200 */
}

/* Force dark background on the "Crear Nuevo Presupuesto" box */
html.dark #budgetSectionContent>div.bg-white[class*="dark:bg-gray-800"] {
    background-color: #374151 !important;
    /* gray-700 */
    border: 1px solid #4b5563;
}

/* Ensure text within the budget section is light */
html.dark #budgetSectionContent p,
html.dark #budgetSectionContent h4 {
    color: #e5e7eb !important;
    /* gray-200 */
}

/* Style the "Añadir Presupuesto" button for dark mode */
html.dark #addBudgetBtn {
    background-color: #16a34a !important;
    /* green-600 */
    color: white !important;
    border: 1px solid #15803d !important;
    /* green-700 */
}

html.dark #addBudgetBtn:hover {
    background-color: #15803d !important;
    /* green-700 */
}

/* Style dynamically added budget list items */
html.dark #budgetList>div {
    /* Assuming each item is a direct child div */
    background-color: #374151 !important;
    /* gray-700 */
    border: 1px solid #4b5563 !important;
    color: #e5e7eb !important;
    /* gray-200 */
    padding: 0.75rem !important;
    /* Add some padding */
    border-radius: 0.375rem !important;
    /* Add rounded corners */
}

/* Ensure text inside budget list items is light */
html.dark #budgetList>div * {
    /* Target all descendants */
    color: #e5e7eb !important;
    /* gray-200 */
}

/* Style the progress bar text (Exceso/Restante) */
html.dark #budgetList .text-red-600 {
    /* Assuming 'Exceso' uses text-red-600 */
    color: #f87171 !important;
    /* red-400 */
}

html.dark #budgetList .text-green-600 {
    /* Assuming 'Restante' uses text-green-600 */
    color: #34d399 !important;
    /* green-400 */
}

/* Style the progress bar background */
html.dark #budgetList .bg-gray-200 {
    /* Assuming this class for the bar background */
    background-color: #4b5563 !important;
    /* gray-600 */
}

/* Style the progress bar fill */
html.dark #budgetList .bg-green-500 {
    /* Assuming this class for the green fill */
    background-color: #10b981 !important;
    /* green-500 */
}

html.dark #budgetList .bg-red-500 {
    /* Assuming this class for the red fill (over budget) */
    background-color: #ef4444 !important;
    /* red-500 */
}

/* Style the delete button within budget items */
html.dark #budgetList button {
    /* General style for buttons inside items */
    background-color: #4b5563 !important;
    /* gray-600 */
    color: #e5e7eb !important;
    /* gray-200 */
    border: 1px solid #6b7280 !important;
    /* gray-500 */
}

html.dark #budgetList button:hover {
    background-color: #6b7280 !important;
    /* gray-500 */
}

/* Assuming delete button has a specific class or icon, e.g., .delete-budget-btn or uses fas fa-trash */
html.dark #budgetList button i.fa-trash {
    color: #fca5a5 !important;
    /* red-300 */
}

html.dark #budgetList button:hover i.fa-trash {
    color: #f87171 !important;
    /* red-400 */
}

/* ================================================ */
/* Dark Mode Fixes for Category Management (Modal)  */
/* ================================================ */

/* Ensure heading and labels are light */
html.dark #categoryManagementSection h4,
html.dark #categoryManagementSection label {
    color: #e5e7eb !important;
    /* gray-200 */
}

/* Ensure input and select have light text and dark background/border */
/* (These might be covered by general modal rules but reinforcing) */
html.dark #newCategoryType,
html.dark #newCategoryName {
    color: #e5e7eb !important;
    /* gray-200 */
    background-color: #374151 !important;
    /* gray-700 */
    border-color: #4b5563 !important;
    /* gray-600 */
}

html.dark #newCategoryName::placeholder {
    color: #9ca3af !important;
    /* gray-400 */
}

/* Style the "Añadir" category button for dark mode */
html.dark #addCategoryBtn {
    background-color: #4f46e5 !important;
    /* indigo-600 */
    color: white !important;
    border-color: #4338ca !important;
    /* indigo-700 */
}

html.dark #addCategoryBtn:hover {
    background-color: #4338ca !important;
    /* indigo-700 */
}

/* Ensure text in dynamically added category list items is light */
html.dark #categoryListContainer * {
    color: #ffffff !important;
    /* white for better visibility */
}

/* Style any buttons (e.g., delete) within the category list */
html.dark #categoryListContainer button {
    background-color: #4b5563 !important;
    /* gray-600 */
    color: #e5e7eb !important;
    /* gray-200 */
    border: 1px solid #6b7280 !important;
    /* gray-500 */
    padding: 0.25rem 0.5rem !important;
    /* Adjust padding if needed */
    font-size: 0.875rem !important;
    /* Adjust font size if needed */
}

html.dark #categoryListContainer button:hover {
    background-color: #6b7280 !important;
    /* gray-500 */
}

/* Example: Styling a delete icon within the button */
html.dark #categoryListContainer button i.fa-trash {
    color: #fca5a5 !important;
    /* red-300 */
}

html.dark #categoryListContainer button:hover i.fa-trash {
    color: #f87171 !important;
    /* red-400 */
}

/* Ensure budget category select and amount input text is visible in dark mode */
html.dark #budgetItemCategory,
html.dark #budgetItemAmount {
    color: #e5e7eb !important;
    /* Use light gray (gray-200) and !important for specificity */
}

/* Ensure placeholder text is also visible in dark mode */
html.dark #budgetItemAmount::placeholder {
    color: #9ca3af !important;
    /* Lighter gray for placeholder (gray-400) */
}

/* Ensure date filter labels ("Desde:", "Hasta:") are visible in dark mode */
html.dark label[for="startDateFilter"],
html.dark label[for="endDateFilter"] {
    color: #e5e7eb !important;
    /* Use light gray (gray-200) for better visibility */
}


/* Ensure date input calendar icon and text are visible in dark mode */
html.dark input[type="date"] {
    color-scheme: dark;
    /* Hint to browser to use dark UI for internal elements */
    color: #e5e7eb !important;
    /* Reiterate light text color just in case */
}

/* ======================================== */
/* Modal Animations                         */
/* ======================================== */

@keyframes modalFadeInUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalFadeOutDown {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-5px);
    }
}

/* Animaciones de modal deshabilitadas para mejor rendimiento */
/*
.modal-enter {
    animation: modalFadeInUp 0.2s ease-out forwards;
}

.modal-exit {
    animation: modalFadeOutDown 0.15s ease-in forwards;
}
*/

/* ======================================== */
/* Modern AI Advisor Section Styles         */
/* ======================================== */

.ai-section-container {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    /* Gradiente azul oscuro a azul brillante */
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6), 0 10px 40px rgba(0, 0, 0, 0.1);
    /* Sombra brillante azul con profundidad */
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    /* Efecto glassmorphism optimizado */
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.2s ease;
}

/* Disable backdrop filters on mobile for performance */
@media (max-width: 768px) {

    .ai-section-container,
    .ai-generate-button,
    .mobile-bottom-nav {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

.ai-section-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
    /* animation: shimmer 4s ease-in-out infinite; */
    /* DESHABILITADO para mejor rendimiento */
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Efectos hover deshabilitados para mejor rendimiento */
/*
.ai-section-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6), 0 4px 15px rgba(0, 0, 0, 0.1);
}
*/

/* Color verde para el icono del cerebro en el título de la sección IA */
.ai-section-container h2 i {
    color: #34d399;
    /* verde-400 */
    filter: drop-shadow(0 0 5px rgba(52, 211, 153, 0.5));
}

html.dark .ai-section-container {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    /* Gradiente gris oscuro */
    box-shadow: 0 0 35px rgba(129, 140, 248, 0.4), 0 10px 40px rgba(0, 0, 0, 0.2);
    /* Sombra brillante índigo sutil con profundidad */
}

html.dark .ai-section-container::before {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);
}

/* ======================================== */
/* AI Modal Styles                         */
/* ======================================== */

#aiModal>div {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    /* Gradiente azul oscuro a azul brillante */
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6), 0 10px 40px rgba(0, 0, 0, 0.1);
    /* Sombra brillante azul con profundidad */
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    /* Efecto glassmorphism */
    -webkit-backdrop-filter: blur(10px);
}

#aiModal>div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
    animation: shimmer 3s ease-in-out infinite;
}

html.dark #aiModal>div {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    /* Gradiente gris oscuro */
    box-shadow: 0 0 35px rgba(129, 140, 248, 0.4), 0 10px 40px rgba(0, 0, 0, 0.2);
    /* Sombra brillante índigo sutil con profundidad */
}

html.dark #aiModal>div::before {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);
}

/* AI Modal Header */
#aiModal .flex.justify-between.items-center {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

html.dark #aiModal .flex.justify-between.items-center {
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* AI Modal Title Styling */
#aiModal h3 {
    color: white !important;
}

#aiModal h3 span.font-extrabold {
    color: #34d399 !important;
    /* verde-400 */
}

#aiModal h3 i {
    color: #34d399 !important;
    /* verde-400 */
    filter: drop-shadow(0 0 5px rgba(52, 211, 153, 0.5));
}

/* AI Modal Close Button */
#aiModal #closeAiModalBtn {
    color: white !important;
    transition: all 0.3s ease;
}

#aiModal #closeAiModalBtn:hover {
    color: rgba(255, 255, 255, 0.8) !important;
    transform: scale(1.1);
}

.ai-generate-button {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    /* Gradiente verde moderno sutil */
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    /* Tamaño de fuente ligeramente mayor */
    letter-spacing: 0.025em;
    /* Espaciado de letras moderno */
    padding: 0.875rem 2rem;
    /* Padding ligeramente mayor */
    border-radius: 50px;
    /* Bordes más redondeados pero no completamente redondos */
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Borde sutil moderno */
    box-shadow: 0 4px 20px rgba(22, 163, 74, 0.25), 0 2px 8px rgba(22, 163, 74, 0.15);
    /* Sombra moderna suave */
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    /* Transición suave */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Centrar horizontalmente */
    text-align: center;
    /* Centrar texto */
    cursor: pointer;
    position: relative;
    /* overflow: hidden; */
    /* Deshabilitado para quitar ripple */
    backdrop-filter: blur(8px);
    /* Efecto glassmorphism sutil */
    -webkit-backdrop-filter: blur(8px);
}

/* Efectos ::before deshabilitados para mejor rendimiento */
/*
.ai-generate-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.ai-generate-button:hover::before {
    left: 100%;
}
*/

.ai-generate-button:hover {
    transform: translateY(-3px) scale(1.02);
    /* Movimiento + escala sutil */
    box-shadow: 0 8px 30px rgba(22, 163, 74, 0.35), 0 4px 15px rgba(22, 163, 74, 0.2);
    /* Sombra más pronunciada verde */
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    /* Gradiente más vibrante verde en hover */
}

.ai-generate-button:active {
    transform: translateY(-1px) scale(0.98);
    /* Efecto de presión */
    box-shadow: 0 2px 10px rgba(22, 163, 74, 0.2);
    /* Sombra reducida */
}

.ai-generate-button:disabled {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 4px 20px rgba(22, 163, 74, 0.25), 0 2px 8px rgba(22, 163, 74, 0.15);
    cursor: not-allowed;
    transform: translateY(0);
    opacity: 0.6;
}

/* Ripple effect deshabilitado para mejor rendimiento */
/*
.ai-generate-button {
    position: relative;
    overflow: hidden;
}

.ai-generate-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}
*/

/* Efecto active deshabilitado para mejor rendimiento */
/*
.ai-generate-button:active::after {
    width: 300px;
    height: 300px;
}
*/

.ai-content-box {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    min-height: 250px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e5e7eb;
    /* gris-200 - Color de texto claro por defecto */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.ai-content-box:hover {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 8px 30px rgba(0, 0, 0, 0.2);
}

.ai-content-box p,
.ai-content-box strong,
.ai-content-box ul,
.ai-content-box li {
    color: #e5e7eb !important;
    /* Asegurar que todo el texto sea claro */
    line-height: 1.6;
    font-size: 1rem;
}

/* Estilos para los gráficos dentro de la sección de IA */
.ai-content-box #balanceChartContainer,
.ai-content-box #aiChartContainer {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 0.5rem;
}

/* Estilos para el dropdown de categorías en móvil */
@media (max-width: 640px) {
    .category-dropdown-mobile-fullscreen {
        position: fixed !important;
        top: auto !important;
        /* Cambiado de 0 a auto */
        bottom: 0 !important;
        /* Anclado a la parte inferior */
        left: 0 !important;
        width: 100vw !important;
        height: 70vh !important;
        /* Ocupa el 70% de la altura */
        max-height: 70vh !important;
        margin-top: 0 !important;
        border-radius: 0 !important;
        z-index: 100 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .category-dropdown-mobile-fullscreen #category-list {
        flex-grow: 1;
        overflow-y: auto;
    }

    /* Style for the close button in mobile fullscreen */
    .category-dropdown-mobile-fullscreen #category-dropdown-close {
        flex-shrink: 0;
        padding: 0.5rem;
        border-radius: 0.375rem;
        transition: all 0.2s ease;
    }

    .category-dropdown-mobile-fullscreen #category-dropdown-close:hover {
        background-color: rgba(0, 0, 0, 0.1);
    }

    html.dark .category-dropdown-mobile-fullscreen #category-dropdown-close:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    /* AI Modal Mobile Enhancements */
    @media (max-width: 640px) {
        #aiModal>div {
            width: 95% !important;
            max-width: none !important;
            margin: 1rem !important;
        }
    }

    .ai-section-container h2 {
        font-size: 1.25rem;
        text-align: center;
    }

    .ai-generate-button {
        width: 100%;
        padding: 1rem 2rem;
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .ai-content-box {
        padding: 1rem;
        border-radius: 1rem;
        min-height: 300px;
    }

    .ai-content-box p {
        font-size: 1rem;
        line-height: 1.7;
    }

    /* Mobile Bottom Nav Professional Look */
    #mobileBottomNav {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    }

    html.dark #mobileBottomNav {
        background: rgba(31, 41, 55, 0.9);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    #mobileBottomNav button {
        border-radius: 1rem;
        transition: all 0.3s ease;
    }

    #mobileBottomNav button:active {
        transform: scale(0.95);
    }
}

/* Resaltado especial para el icono y texto del botón de Resumen AI */
#mobileAiBtn {
    background: transparent !important;
}

#mobileAiBtn i {
    position: relative !important;
}

#mobileAiBtn i::after {
    content: '💡' !important;
    position: absolute !important;
    top: -4px !important;
    right: -4px !important;
    font-size: 0.6rem !important;
    color: #fbbf24 !important;
    filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.5)) !important;
    /* animation: twinkle 2s ease-in-out infinite !important; */
    /* DESHABILITADO para mejor rendimiento */
    pointer-events: none !important;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

#mobileAiBtn:hover i::after {
    animation-duration: 1s !important;
}

#mobileAiBtn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.5) !important;
}

#mobileAiBtn:focus i {
    color: #059669 !important;
    filter: drop-shadow(0 0 12px rgba(52, 211, 153, 0.8)) !important;
}

#mobileAiBtn:focus span {
    color: #059669 !important;
    text-shadow: 0 0 12px rgba(52, 211, 153, 0.8) !important;
}

#mobileAiBtn:hover::after {
    animation-duration: 1s !important;
}

#mobileAiBtn i {
    color: #34d399 !important;
    filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.6)) !important;
    animation: gentleFloat 3s ease-in-out infinite !important;
}

@keyframes gentleFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-3px);
    }
}

#mobileAiBtn span {
    color: #667eea !important;
    text-shadow: 0 0 8px rgba(102, 126, 234, 0.6) !important;
}

#mobileAiBtn:hover i {
    color: #5a67d8 !important;
    filter: drop-shadow(0 0 12px rgba(102, 126, 234, 0.8)) !important;
    transform: scale(1.1) !important;
}

#mobileAiBtn:hover span {
    color: #5a67d8 !important;
    text-shadow: 0 0 12px rgba(102, 126, 234, 0.8) !important;
}

html.dark #mobileAiBtn:hover {
    box-shadow: 0 0 15px rgba(76, 81, 191, 0.4) !important;
}

html.dark #mobileAiBtn i {
    color: #4c51bf !important;
    filter: drop-shadow(0 0 8px rgba(76, 81, 191, 0.7)) !important;
}

html.dark #mobileAiBtn span {
    color: #4c51bf !important;
    text-shadow: 0 0 8px rgba(76, 81, 191, 0.7) !important;
}

html.dark #mobileAiBtn:hover i {
    color: #434190 !important;
    filter: drop-shadow(0 0 12px rgba(76, 81, 191, 0.9)) !important;
}

html.dark #mobileAiBtn:hover span {
    color: #434190 !important;
    text-shadow: 0 0 12px rgba(76, 81, 191, 0.9) !important;
}

#categoryManagementSection {
    background: transparent !important;
}

/* Ensure category list items have transparent background */
#categoryListContainer li {
    background: transparent !important;
    background-color: transparent !important;
}

/* --- Ajustes de alta especificidad para la lista de categorías en el modal de configuración --- */
#settingsModal .flex.justify-between.items-center.category-list-item {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    /* Sin borde para evitar que parezca botón */
    border-radius: 0 !important;
    /* Sin redondeo */
    padding: 0 !important;
    /* Sin padding extra */
    margin-bottom: 0 !important;
    /* Sin margen extra */
}

#settingsModal #categoryListContainer .category-list-item span.font-medium {
    color: #ffffff !important;
    /* Blanco puro para el nombre de la categoría */
}

#settingsModal #categoryListContainer .category-list-item span.text-xs {
    color: #ffffff !important;
    /* Blanco puro para la descripción (fija) para mejor contraste */
}

/* Asegurar que los botones de eliminar también tengan un fondo transparente */
#settingsModal #categoryListContainer .category-list-item button {
    background-color: transparent !important;
    border: none !important;
}

/* FIX: Category list items in settings modal */
#settingsModal #categoryListContainer .flex.justify-between.items-center {
    background: none !important;
    background-color: transparent !important;
}

#settingsModal #categoryListContainer .flex.justify-between.items-center span,
#settingsModal #categoryListContainer .flex.justify-between.items-center span span {
    color: #374151 !important;
    /* gray-700 for light mode */
}

html.dark #settingsModal #categoryListContainer .flex.justify-between.items-center span,
html.dark #settingsModal #categoryListContainer .flex.justify-between.items-center span span {
    color: #e5e7eb !important;
    /* gray-200 for dark mode */
}

html.dark #settingsModal #categoryListContainer .flex.justify-between.items-center button {
    color: #e5e7eb !important;
    /* gray-200 for dark mode */
}