:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --bg-dark: #0f172a;
    --card-dark: #1e293b;
    --text-light: #f8fafc;
    --text-muted: #cbd5e1; 
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

::placeholder {
    color: #cbd5e1 !important;
    opacity: 0.9 !important;
}

body {
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a 50%),
                radial-gradient(circle at bottom left, #1e293b, #0f172a 50%);
    background-attachment: fixed;
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* ================= LOGIN ESTILOS ================= */
.login-bg {
    background: linear-gradient(-45deg, #0f172a, #1e1b4b, #312e81, #1e293b);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 450px;
    margin: 1.5rem;
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
}

@media (max-width: 576px) {
    .glass-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
}

.form-control-glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control-glass:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
    color: #fff;
}

.form-control-glass::placeholder {
    color: var(--text-muted);
}

.btn-primary-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary-gradient:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px -10px var(--primary-color);
}

/* ================= SIDEBAR & DASHBOARD ================= */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    flex: 1;
}

#sidebar {
    min-width: 250px;
    max-width: 250px;
    background: var(--card-dark);
    color: #fff;
    transition: all 0.3s ease;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

#sidebar.active {
    margin-left: -250px;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 15px;
}

#sidebar ul.components {
    padding: 20px 0;
    flex-grow: 1;
}

#sidebar ul li a {
    padding: 12px 25px;
    font-size: 1.05em;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    transition: all 0.3s;
    text-decoration: none;
    border-left: 4px solid transparent;
}

#sidebar ul li a:hover, #sidebar ul li.active > a {
    color: #fff;
    background: rgba(67, 97, 238, 0.1);
    border-left: 4px solid var(--primary-color);
}

#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
    background: transparent; /* El fondo lo pone el body */
}

.navbar-custom {
    background: var(--card-dark) !important;
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 20px;
}

.navbar-custom .btn-menu {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    transition: 0.3s;
}

.navbar-custom .btn-menu:hover {
    background: rgba(255, 255, 255, 0.2);
}

.card-stat {
    background: var(--card-dark);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 25px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card-stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -10px rgba(0,0,0,0.5);
}

.card-stat .icon-box {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
}

.bg-icon-primary { background: rgba(67, 97, 238, 0.1); color: var(--primary-color); }
.bg-icon-success { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.bg-icon-warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.bg-icon-danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

.table-custom {
    color: var(--text-light);
}
.table-custom thead th {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 2px solid var(--glass-border);
    border-top: none;
    color: var(--text-muted);
}
.table-custom tbody td {
    border-bottom: 1px solid var(--glass-border);
    background: var(--card-dark);
    vertical-align: middle;
}

@media (max-width: 768px) {
    #sidebar {
        margin-left: -250px;
        position: fixed;
        height: 100vh;
        z-index: 999;
    }
    #sidebar.active {
        margin-left: 0;
    }
}
.form-section-title {
    color: var(--primary-color);
    letter-spacing: 1px;
    font-size: 0.8rem;
    position: relative;
    padding-bottom: 8px;
    margin-bottom: 20px;
}

.form-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

.input-group-premium {
    display: flex; /* Añadido para alinear icono e input en un solo renglón */
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.input-group-premium:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.input-group-premium .input-group-text {
    background: transparent;
    border: none;
    color: var(--primary-color);
    padding-left: 15px;
    padding-right: 5px;
    display: flex;
    align-items: center;
}

.input-group-premium .form-control, 
.input-group-premium .form-select {
    flex: 1; /* Para que el input ocupe el resto del espacio */
    background: transparent;
    border: none;
    color: white;
    padding: 12px;
    width: 100%;
}

.input-group-premium .form-control:focus,
.input-group-premium .form-select:focus {
    box-shadow: none;
}

/* Fix para la visibilidad de las opciones en el select (fondo claro para que el hover sea oscuro) */
.input-group-premium .form-select option {
    background-color: #ffffff; 
    color: #000000;
}

.card-premium {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
}

.btn-premium {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px var(--primary-color);
}
