:root {
    --primary-color: #0b5ed7;
    --primary-gradient: linear-gradient(135deg, #0b5ed7 0%, #00d4ff 100%);
    --secondary-color: #6c757d;
    --dark-bg: #f4f7fe;
    --card-bg: #ffffff;
    --accent-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #2d3436;
    --sidebar-width: 260px;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-strong: 0 15px 35px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: url('https://www.transparenttextures.com/patterns/cubes.png');
    opacity: 0.1;
    animation: move-bg 60s linear infinite;
}

@keyframes move-bg {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(-50px, -50px);
    }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 10;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 50px 40px;
    border-radius: 28px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slide-up 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-weight: 800;
    color: #1e3c72;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #2a5298;
    outline: none;
    box-shadow: 0 0 0 4px rgba(42, 82, 152, 0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 60, 114, 0.3);
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border-left: 4px solid #c62828;
}

.login-logo {
    width: 120px;
    height: auto;
    margin: 0 auto 20px;
    display: block;
}

/* --- Layout Principal --- */
.main-wrapper {
    display: flex !important;
    width: 100%;
    align-items: stretch;
    position: relative;
}

#sidebar {
    min-width: 260px;
    max-width: 260px;
    background: #1e3c72;
    color: #fff;
    transition: all 0.3s;
    min-height: 100vh;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
}

#sidebar ul {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

#sidebar ul li {
    list-style: none !important;
}

#sidebar.active {
    margin-left: -260px;
}

#sidebar .sidebar-header {
    padding: 20px 15px;
    background: rgba(0, 0, 0, 0.1);
    text-align: center;
}

.sidebar-logo {
    max-width: 100%;
    height: auto;
    max-height: 50px;
    object-fit: contain;
}

#sidebar .sidebar-header strong {
    display: none;
}


#sidebar ul li a {
    padding: 12px 25px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
}

#sidebar ul li a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

#sidebar ul li a:hover,
#sidebar ul li.active>a {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid #fff;
}

#sidebar ul li ul li a {
    padding-left: 60px;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.05);
}

.content-area {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
}

.user-avatar {
    width: 35px;
    height: 35px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e3c72;
}

/* --- Glassmorphism Components --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
}

.premium-card {
    border: none;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-strong);
}

/* Card totales por rol con gradiente */
.totales-rol-card {
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.totales-rol-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4) !important;
}

/* --- Stats Enhancements --- */
.stats-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px !important;
    border: none;
}

.stats-card .card-body {
    position: relative;
    z-index: 2;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 1;
}

.stats-icon-wrapper {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* --- Table Styles --- */
.premium-table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.premium-table thead th {
    background: transparent;
    border: none;
    color: var(--secondary-color);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 25px;
}

.premium-table tbody tr {
    background: #ffffff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease;
}

.premium-table tbody tr:hover {
    transform: scale(1.01);
    background: #fdfdfd;
}

.premium-table tbody td {
    border: none;
    padding: 15px 25px;
}

.premium-table tbody td:first-child {
    border-radius: 12px 0 0 12px;
}

.premium-table tbody td:last-child {
    border-radius: 0 12px 12px 0;
}

/* --- Micro-animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Responsividad Sidebar */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -260px;
    }

    #sidebar.active {
        margin-left: 0;
    }

    #sidebar .sidebar-header h3 {
        display: none;
    }

    #sidebar .sidebar-header strong {
        display: block;
    }
}