:root {
    /* Nueva Paleta de Colores - Inspiración Fintech */
    --primary-color: #059669; /* Verde Esmeralda */
    --primary-dark: #064e3b;
    --primary-light: #ecfdf5;
    
    --sidebar-bg: #0f172a; /* Slate 900 - Muy elegante y profesional */
    --sidebar-text: #f1f5f9;
    --sidebar-hover: #1e293b;
    --sidebar-active: #059669;

    --bg-color: #f8fafc; /* Fondo suave azulado/grisáceo */
    --text-color: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */

    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --card-radius: 1rem;

    --border-color: #e2e8f0;
    --accent-color: var(--primary-color);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg) !important;
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar-header {
    margin-bottom: 2.5rem;
    padding-bottom: 0.5rem;
}

.sidebar-brand {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--sidebar-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.025em;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3);
}

.sidebar-brand:hover {
    color: var(--sidebar-text);
}

.sidebar-section-title {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    padding-left: 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8; /* Slate 400 */
    opacity: 0.8;
}

.nav-link {
    color: #94a3b8 !important; /* Slate 400 por defecto en sidebar */
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: var(--transition);
}

.nav-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-text) !important;
}

.nav-link.active {
    background-color: var(--sidebar-active);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.nav-link i {
    font-size: 1.25rem;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none !important;
    padding: 0.5rem;
    border-radius: 0.75rem;
    transition: var(--transition);
}

.user-profile:hover {
    background-color: var(--sidebar-hover);
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: var(--sidebar-text);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}

.user-role {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2.5rem;
    background-color: var(--bg-color);
}

/* Cards */
.card {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--card-radius) !important;
    box-shadow: var(--card-shadow) !important;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1) !important;
}

/* Utility Card classes for Dashboard */
.bg-primary-light { background-color: #ecfdf5 !important; }
.bg-info-light { background-color: #f0f9ff !important; }
.bg-warning-light { background-color: #fffbeb !important; }
.bg-danger-light { background-color: #fef2f2 !important; }

.bg-primary-soft { background-color: rgba(16, 185, 129, 0.1) !important; }
.bg-success-soft { background-color: rgba(16, 185, 129, 0.1) !important; }
.bg-danger-soft { background-color: rgba(239, 68, 68, 0.1) !important; }

.text-primary { color: #059669 !important; }
.text-info { color: #0ea5e9 !important; }
.text-warning { color: #f59e0b !important; }
.text-danger { color: #ef4444 !important; }
.text-success { color: #10b981 !important; }

/* Tables */
.table {
    color: var(--text-color);
}

.table thead th {
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    background-color: #f8fafc;
}

.table td {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #fbfbfb;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    border-radius: 0.75rem;
    transition: var(--transition);
    border: none;
}

.btn-primary:hover {
    background-color: var(--primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

/* Modern Badge */
.badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.5rem;
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Forms */
.form-control,
.form-select {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: var(--text-color);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    background-color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
    color: var(--text-color);
    outline: none;
}

.form-label {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.btn-light {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--text-color);
    border-radius: 0.75rem;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-light:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.btn-icon:hover {
    background-color: #f1f5f9;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    color: var(--text-muted);
    border-color: var(--border-color);
    border-radius: 0.75rem;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-outline-secondary:hover {
    background-color: #f8fafc;
    color: var(--text-color);
    border-color: #cbd5e1;
}

/* Pagination */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border: 1px solid #e2e8f0;
    color: var(--text-muted);
    border-radius: 0.5rem !important;
    padding: 0.5rem 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.page-link:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.page-item.disabled .page-link {
    background-color: #f8fafc;
    border-color: #f1f5f9;
    color: #cbd5e1;
}

/* Custom Table Utilities */
.table-responsive {
    border-radius: 0 0 var(--card-radius) var(--card-radius);
}

.ps-4 { padding-left: 1.5rem !important; }
.pe-4 { padding-right: 1.5rem !important; }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 1rem 0.5rem;
    }
    .sidebar-brand span, .nav-link span, .user-info, .sidebar-section-title {
        display: none;
    }
    .main-content {
        margin-left: 80px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
        width: 260px;
    }
    .sidebar.show span, .sidebar.show .user-info, .sidebar.show .sidebar-section-title {
        display: block;
    }
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
}