/* ============================================
   TAILWIND DASHBOARD TEMPLATE - THEME STYLES
   Integrado con el sistema de Caja de Ahorros
   ============================================ */

/* Variables de Color Optimizadas para Caja de Ahorros
   Basado en psicología del color para finanzas:
   - Azul-Verde (Teal): Confianza + Prosperidad
   - Verde Esmeralda: Crecimiento financiero
   - Púrpura: Sofisticación y riqueza
*/
:root {
    /* Color Principal - Teal/Turquesa (Confianza + Crecimiento) */
    --color-primary-50: #e6f7f7;
    --color-primary-100: #b3e8e8;
    --color-primary-200: #80d9d9;
    --color-primary-300: #4dcaca;
    --color-primary-400: #26bcbc;
    --color-primary-500: #0d9488;  /* Teal principal */
    --color-primary-600: #0a7a71;
    --color-primary-700: #086159;
    --color-primary-800: #064842;
    --color-primary-900: #043029;

    /* Color Secundario - Verde Esmeralda (Prosperidad) */
    --color-success-50: #d1fae5;
    --color-success-100: #a7f3d0;
    --color-success-200: #6ee7b7;
    --color-success-300: #34d399;
    --color-success-400: #10b981;
    --color-success-500: #059669;  /* Verde esmeralda */
    --color-success-600: #047857;
    --color-success-700: #065f46;
    --color-success-800: #064e3b;
    --color-success-900: #022c22;

    /* Color Acento - Púrpura (Sofisticación) */
    --color-accent-50: #f5f3ff;
    --color-accent-100: #ede9fe;
    --color-accent-200: #ddd6fe;
    --color-accent-300: #c4b5fd;
    --color-accent-400: #a78bfa;
    --color-accent-500: #8b5cf6;  /* Púrpura principal */
    --color-accent-600: #7c3aed;
    --color-accent-700: #6d28d9;
    --color-accent-800: #5b21b6;
    --color-accent-900: #4c1d95;

    /* Grises Neutros (Profesionalismo) */
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #bfc4cd;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    /* Alias para compatibilidad */
    --color-violet-500: var(--color-accent-500);
    --color-violet-600: var(--color-accent-600);
    --color-violet-700: var(--color-accent-700);
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */

#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    background: #1f2937;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    z-index: 40;
    transition: transform 0.3s ease, width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar oculto en móviles por defecto */
@media (max-width: 1023px) {
    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.open {
        transform: translateX(0);
    }
}

/* Sidebar colapsado en desktop */
@media (min-width: 1024px) {
    #sidebar {
        transform: translateX(0);
    }

    #sidebar.collapsed {
        width: 80px;
    }

    #sidebar.collapsed .sidebar-text {
        opacity: 0;
        display: none;
    }

    #sidebar.collapsed .sidebar-logo-text {
        display: none;
    }

    #sidebar.collapsed .sidebar-nav-title {
        opacity: 0;
        display: none;
    }
}

/* Logo del Sidebar */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 2px solid #0d9488;
    transition: all 0.3s ease;
    height: 76px;
    box-sizing: border-box;
}

.sidebar-logo-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
}

/* Navegación del Sidebar */
.sidebar-nav {
    padding: 20px 12px;
}

.sidebar-nav-section {
    margin-bottom: 24px;
}

.sidebar-nav-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: #9ca3af;
    padding: 0 12px 8px;
    letter-spacing: 0.05em;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 4px;
    color: #d1d5db;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.sidebar-nav-item:hover {
    background: rgba(13, 148, 136, 0.2);
    color: #5eead4;
}

.sidebar-nav-item.active {
    background: #0d9488;
    color: white;
}

.sidebar-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-text {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

/* Backdrop para móviles */
#sidebarBackdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 35;
    backdrop-filter: blur(2px);
}

#sidebarBackdrop.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* ============================================
   CONTENT WRAPPER ADJUSTMENTS
   ============================================ */

#contentWrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

/* Ajuste para sidebar en desktop */
@media (min-width: 1024px) {
    #contentWrapper {
        margin-left: 260px;
    }

    body.sidebar-collapsed #contentWrapper {
        margin-left: 80px;
    }
}

/* ============================================
   HEADER IMPROVEMENTS
   ============================================ */

.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(12px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    gap: 16px;
    height: 76px;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Hamburger Button */
.hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hamburger-btn:active {
    transform: scale(0.95);
}

.hamburger-icon {
    width: 24px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ============================================
   DARK MODE ADJUSTMENTS
   ============================================ */

body.dark-mode #sidebar {
    background: var(--color-gray-800);
    border-right: 1px solid var(--color-gray-700);
}

body.dark-mode .sidebar-logo {
    border-bottom-color: var(--color-gray-700);
}

body.dark-mode .sidebar-logo-text {
    color: var(--color-primary-400);
}

body.dark-mode .sidebar-nav-title {
    color: #6b7280;
}

body.dark-mode .sidebar-nav-item {
    color: #9ca3af;
}

body.dark-mode .sidebar-nav-item:hover {
    background: var(--color-gray-700);
    color: var(--color-primary-400);
}

body.dark-mode .sidebar-nav-item.active {
    background: var(--color-primary-600);
    color: white;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
    .header-content {
        padding: 12px 16px;
    }

    #contentWrapper {
        margin-left: 0 !important;
    }
}

/* ============================================
   SCROLLBAR CUSTOMIZATION
   ============================================ */

#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 3px;
}

body.dark-mode #sidebar::-webkit-scrollbar-thumb {
    background: var(--color-gray-700);
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */

.content-section {
    animation: fadeInSection 0.3s ease-in;
}

.content-section.hidden {
    display: none !important;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

#sidebar.open {
    animation: slideInLeft 0.3s ease-out;
}
