:root {
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 80px;
    --header-height: 64px;
    
    /* 🎨 Design System - Colores */
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-primary-light: #dbeafe;
    --color-success: #10b981;
    --color-success-light: #d1fae5;
    --color-danger: #ef4444;
    --color-danger-light: #fee2e2;
    --color-warning: #f59e0b;
    --color-warning-light: #fef3c7;
    --color-info: #8b5cf6;
    --color-info-light: #ede9fe;
    
    /* 🎨 Espaciado */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* 🎨 Bordes y Sombras */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 🎨 Transiciones */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
}
body { font-family: 'Inter', sans-serif; transition: background-color 0.3s, color 0.3s; }
.modal-backdrop { background-color: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); }

.sidebar {
    width: var(--sidebar-width);
    transition: width 0.3s ease-in-out, transform 0.3s ease-in-out;
}
.main-content {
    padding-left: var(--sidebar-width);
    transition: padding-left 0.3s ease-in-out;
}

.sidebar-collapsed .sidebar { width: var(--sidebar-width-collapsed); }
.sidebar-collapsed .main-content { padding-left: var(--sidebar-width-collapsed); }
.sidebar-collapsed .sidebar h1,
.sidebar-collapsed .sidebar .nav-link span,
.sidebar-collapsed .sidebar #logoutBtn span,
.sidebar-collapsed .sidebar #themeSwitcher > span {
    opacity: 0; width: 0; visibility: hidden; overflow: hidden;
}
.sidebar .nav-link span, .sidebar h1, .sidebar #logoutBtn span, .sidebar #themeSwitcher > span {
    transition: opacity 0.2s ease-in-out, width 0.3s ease-in-out;
    white-space: nowrap;
}
.sidebar-collapsed .sidebar .px-6,
.sidebar-collapsed .sidebar .nav-link,
.sidebar-collapsed .sidebar #logoutBtn {
    justify-content: center; padding-left: 0; padding-right: 0; gap: 0;
}
.sidebar-collapsed #sidebar-toggle svg { transform: rotate(180deg); }
#sidebar-toggle svg { transition: transform 0.3s ease-in-out; }
.sidebar-collapsed .sidebar #themeSwitcher {
    justify-content: center; background-color: transparent !important;
}

/* 📱 RESPONSIVE DESIGN - MOBILE FIRST */

@media (max-width: 768px) {
    .main-content { 
        padding-left: 0; 
        padding-top: 0;
    }
    .sidebar-collapsed .main-content { 
        padding-left: 0; 
    }
    .sidebar { 
        transform: translateX(-100%); 
        width: var(--sidebar-width);
        position: fixed;
        z-index: 1000;
        height: 100vh;
    }
    .sidebar.open { 
        transform: translateX(0); 
    }
    .sidebar-collapsed .sidebar { 
        width: var(--sidebar-width); 
    }
    
    /* Mobile Header */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 999;
        background: white;
        border-bottom: 1px solid #e5e7eb;
    }
    
    /* Mobile Menu Button */
    .mobile-menu-btn {
        display: block !important;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
        background: var(--color-primary);
        color: white;
        border: none;
        border-radius: 0.5rem;
        padding: 0.75rem;
        cursor: pointer;
        box-shadow: var(--shadow-md);
    }
    
    /* Mobile Content */
    .main-content {
        margin-top: 4rem;
        padding: 1rem;
    }
    
    /* Mobile Tables */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile Table Responsive */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        width: 100%;
        margin-bottom: 0;
        border-collapse: collapse;
    }
    
    .table-responsive th,
    .table-responsive td {
        white-space: nowrap;
        padding: 0.5rem;
        border-bottom: 1px solid #e5e7eb;
    }
    
    /* Mobile Table Cards (Alternative view) */
    .table-card-view {
        display: none;
    }
    
    @media (max-width: 640px) {
        .table-responsive {
            display: none;
        }
        
        .table-card-view {
            display: block;
        }
        
        .table-card {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            padding: 1rem;
            margin-bottom: 1rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }
        
        .table-card-header {
            font-weight: 600;
            color: #374151;
            margin-bottom: 0.5rem;
        }
        
        .table-card-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.25rem 0;
            border-bottom: 1px solid #f3f4f6;
        }
        
        .table-card-row:last-child {
            border-bottom: none;
        }
        
        .table-card-label {
            font-weight: 500;
            color: #6b7280;
            font-size: 0.875rem;
        }
        
        .table-card-value {
            color: #111827;
            font-weight: 500;
        }
    }
    
    /* Mobile Cards */
    .kpi-card-modern {
        margin-bottom: 1rem;
    }
    
    /* Mobile Modals */
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    /* Mobile Forms */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Mobile Buttons */
    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        width: 100%;
        justify-content: center;
    }
}

.nav-link.active { background-color: #3b82f6; color: white; }
.nav-link.active svg { color: white; }
html.dark .nav-link.active { background-color: #2563eb; }

/* Estilos para hover en elementos activos - mantiene el contraste */
.nav-link.active:hover { 
    background-color: #2563eb; 
    color: white; 
}
.nav-link.active:hover svg { 
    color: white; 
}
html.dark .nav-link.active:hover { 
    background-color: #1d4ed8; 
    color: white; 
}
html.dark .nav-link.active:hover svg { 
    color: white; 
}
.kpi-card:hover, .grid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.05);
}
.kpi-card, .grid-card { transition: all 0.2s ease-in-out; }
.sortable-header { cursor: pointer; user-select: none; }
.sort-indicator { display: inline-block; width: 1em; color: #3b82f6; }

.toast-notification {
    position: fixed; bottom: 20px; right: 20px; padding: 1rem 1.5rem; border-radius: 0.5rem;
    color: white; font-weight: 500; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(200%); transition: transform 0.5s ease-in-out; z-index: 100;
}
.toast-notification.show { transform: translateY(0); }
.toast-notification.success { background-color: #10b981; }
.toast-notification.error { background-color: #ef4444; }

.switch-container {
    position: relative; display: inline-flex; background-color: #e5e7eb;
    border-radius: 0.5rem; padding: 0.25rem;
}
html.dark .switch-container { background-color: #374151; }

.switch-indicator {
    position: absolute; top: 0.25rem; bottom: 0.25rem;
    width: calc(50% - 0.25rem); background-color: white; border-radius: 0.375rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease-in-out;
}
html.dark .switch-indicator { background-color: #3b82f6; }

/* Switch con 4 opciones */
#categories-switch-indicator {
    width: calc(25% - 0.25rem);
    left: 0.25rem;
    transform: translateX(0%);
}

.switch-mode-btn {
    position: relative; z-index: 10; border: none; background: none;
    transition: color 0.2s ease-in-out;
}
.searchable-dropdown-option:hover { background-color: #f3f4f6; }
html.dark .searchable-dropdown-option:hover { background-color: #374151; }

/* Estilos para el botón de limpiar en el dropdown de búsqueda */
.clear-dd-btn {
    /* Posicionamiento y centrado perfecto */
    position: absolute;
    top: 50%;
    right: 0.5rem; /* 8px */
    transform: translateY(-50%) scale(0.75); /* Inicia un poco más pequeño */
    
    /* Estilo del círculo */
    height: 1.5rem; /* 24px */
    width: 1.5rem; /* 24px */
    border-radius: 9999px; /* Círculo perfecto */
    background-color: #e5e7eb; /* gris claro */
    color: #6b7280; /* gris oscuro para la 'x' */
    
    /* Centrado del ícono 'x' dentro del círculo */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Transiciones suaves */
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
    pointer-events: none; /* Evita clics cuando está invisible */
}

/* Estilo para el modo oscuro */
html.dark .clear-dd-btn {
    background-color: #4b5563; /* gris más oscuro */
    color: #d1d5db; /* gris claro para la 'x' */
}

/* Efecto hover */
.clear-dd-btn:hover {
    background-color: #d1d5db; /* gris un poco más oscuro */
}
html.dark .clear-dd-btn:hover {
    background-color: #6b7280;
}

/* Clase para hacerlo visible */
.clear-dd-btn.visible {
    opacity: 1;
    transform: translateY(-50%) scale(1); /* Vuelve a su tamaño normal */
    pointer-events: auto; /* Permite clics */
}

/* Ajuste del padding del input para que el texto no se vaya debajo del botón */
.w-full.pr-8 {
    padding-right: 2.5rem; /* 40px */
}

.quick-add-btn {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    background-color: #10b981; /* Verde igual que el botón de pagos */
    color: white;
    border-radius: 9999px;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

html.dark .quick-add-btn {
    background-color: #10b981;
    color: white;
}

.quick-add-btn:hover {
    transform: translateY(-50%) scale(1.1);
    background-color: #059669;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Ajuste para los selects con el nuevo botón */
.relative select {
    padding-right: 2.5rem; /* Espacio para el botón + */
}

/* Asegura que el backdrop del modal apilado no se oscurezca dos veces */
.modal-backdrop + .modal-backdrop {
    background-color: transparent;
}

/* Estilo de Foco Consistente */
input:focus, select:focus, textarea:focus, button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
    border-color: #3b82f6 !important; /* El !important asegura que sobreescriba otros estilos */
}

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

.new-row-animation {
    animation: fadeInRow 0.5s ease-out forwards;
}

/* Estilos para el botón inteligente */
#smartAddDropdown {
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.2s ease-in-out;
    pointer-events: none;
    display: none;
}

#smartAddDropdown.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    display: block;
}

#smartAddDropdown button {
    transition: background-color 0.15s ease;
}

#smartAddDropdown button:hover {
    background-color: #f3f4f6;
}

html.dark #smartAddDropdown button:hover {
    background-color: #374151;
}

/* ============================================================
   🎨 DESIGN SYSTEM - COMPONENTES UNIFICADOS
   ============================================================ */

/* 📦 KPI Cards - Estilo Unificado */
.kpi-card-modern {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

html.dark .kpi-card-modern {
    background: #1f2937;
    border-color: #374151;
}

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

.kpi-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--card-accent-color, var(--color-primary));
    transition: width var(--transition-base);
}

.kpi-card-modern:hover::before {
    width: 6px;
}

.kpi-card-modern .kpi-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-sm);
}

.kpi-card-modern .kpi-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

html.dark .kpi-card-modern .kpi-label {
    color: #9ca3af;
}

.kpi-card-modern .kpi-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-card-modern .kpi-subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* 🎯 Tabs Modernos - Estilo Unificado */
.tabs-modern {
    display: flex;
    gap: 0.25rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
}

html.dark .tabs-modern {
    background: #374151;
}

.tab-modern {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    white-space: nowrap;
}

html.dark .tab-modern {
    color: #9ca3af;
}

.tab-modern:hover {
    color: #374151;
}

html.dark .tab-modern:hover {
    color: #f3f4f6;
}

.tab-modern.active {
    background: white;
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

html.dark .tab-modern.active {
    background: #1f2937;
    color: var(--color-primary);
}

.tab-modern .tab-icon {
    display: inline-block;
    margin-right: 0.5rem;
}

/* 📱 Tabs Responsive en Móvil */
@media (max-width: 640px) {
    .tabs-modern {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .tabs-modern::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .tab-modern {
        flex: 0 0 auto; /* No encogerse, tamaño natural */
        min-width: fit-content;
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
    
    /* Ocultar iconos en móvil para ahorrar espacio (opcional) */
    .tab-modern .tab-icon {
        display: none;
    }
}

/* 🔘 Botones - Estilo Unificado */
.btn-modern {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

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

.btn-modern:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

html.dark .btn-secondary {
    background: #374151;
    color: #f3f4f6;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

html.dark .btn-secondary:hover {
    background: #4b5563;
}

/* 📊 Contenedor de Gráficos - Estilo Unificado */
.chart-container-modern {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
}

html.dark .chart-container-modern {
    background: #1f2937;
    border-color: #374151;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid #f3f4f6;
}

html.dark .chart-header {
    border-bottom-color: #374151;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

html.dark .chart-title {
    color: #f9fafb;
}

/* 📋 Tablas - Estilo Unificado */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead {
    background: #f9fafb;
}

html.dark .table-modern thead {
    background: #1f2937;
}

.table-modern th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

html.dark .table-modern th {
    color: #9ca3af;
}

.table-modern td {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

html.dark .table-modern td {
    border-top-color: #374151;
}

.table-modern tbody tr {
    transition: background-color var(--transition-fast);
}

.table-modern tbody tr:hover {
    background: #f9fafb;
}

html.dark .table-modern tbody tr:hover {
    background: #1f2937;
}

/* 🏷️ Badges - Estilo Unificado */
.badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    border: 1px solid transparent;
}

.badge-primary {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.badge-success {
    background: var(--color-success-light);
    color: var(--color-success);
    border-color: var(--color-success);
}

.badge-danger {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.badge-warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
    border-color: var(--color-warning);
}

.badge-info {
    background: var(--color-info-light);
    color: var(--color-info);
    border-color: var(--color-info);
}

/* 🎴 Cards - Estilo Unificado */
.card-modern {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
    transition: all var(--transition-base);
}

html.dark .card-modern {
    background: #1f2937;
    border-color: #374151;
}

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

/* 📱 MOBILE SMALL (320px - 640px) */
@media (max-width: 640px) {
    /* Mobile Small Tables */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Mobile Small Cards */
    .kpi-card-modern {
        padding: 1rem;
    }
    
    .kpi-value {
        font-size: 1.5rem;
    }
    
    /* Mobile Small Forms */
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Mobile Small Buttons */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Mobile Small Modals */
    .modal-content {
        margin: 0.5rem;
        border-radius: 0.5rem;
    }
    
    /* Mobile Small Navigation */
    .mobile-menu-btn {
        top: 0.5rem;
        left: 0.5rem;
        padding: 0.5rem;
    }
}

/* 📱 MOBILE LARGE (641px - 768px) */
@media (min-width: 641px) and (max-width: 768px) {
    .main-content {
        padding: 1.5rem;
    }
    
    .kpi-card-modern {
        padding: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* 📱 TABLET (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        padding-left: 200px;
    }
    
    .grid-modern.grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-modern.grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 📱 DESKTOP SMALL (1025px - 1280px) */
@media (min-width: 1025px) and (max-width: 1280px) {
    .grid-modern.grid-cols-5 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-modern.grid-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid #f3f4f6;
}

html.dark .card-header {
    border-bottom-color: #374151;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
}

html.dark .card-title {
    color: #f9fafb;
}

/* 📱 Responsive Grid System */
.grid-modern {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1024px) {
    .grid-modern.grid-cols-5,
    .grid-modern.grid-cols-4,
    .grid-modern.grid-cols-3 { 
        grid-template-columns: repeat(2, 1fr) !important; 
    }
}

@media (max-width: 640px) {
    .grid-modern.grid-cols-5,
    .grid-modern.grid-cols-4,
    .grid-modern.grid-cols-3,
    .grid-modern.grid-cols-2 { 
        grid-template-columns: repeat(2, 1fr) !important; 
    }
    
    .grid-modern.grid-cols-1 {
        grid-template-columns: repeat(1, 1fr) !important;
    }
    
    /* En móvil, el último KPI (Total por Cobrar) ocupa toda la fila */
    .grid-modern.grid-cols-5 > .kpi-card-modern:last-child {
        grid-column: 1 / -1; /* Ocupa de la primera a la última columna */
    }
}

/* 📱 Sidebar Overlay para Mobile */
#sidebar-overlay {
    transition: opacity 0.3s ease;
    opacity: 0;
}

#sidebar-overlay:not(.hidden) {
    opacity: 1;
}

/* 🎨 Utilidades de Color */
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-info { color: var(--color-info); }

.bg-primary { background: var(--color-primary); }
.bg-success { background: var(--color-success); }
.bg-danger { background: var(--color-danger); }
.bg-warning { background: var(--color-warning); }
.bg-info { background: var(--color-info); }

/* Utility class para enlaces sin subrayado */
.no-underline { text-decoration: none !important; }
a.no-underline:hover { text-decoration: none !important; }