/* ==========================================
   1. FONDO CON LUCES DE NEÓN VIRTUALES (Ambient Glow)
   ========================================== */
body {
    background-color: #0b0e14 !important; 
    /* Luces ambientales: Violeta, Azul y Cian */
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(56, 43, 240, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(192, 38, 211, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(0, 242, 254, 0.05) 0%, transparent 60%) !important;
    background-attachment: fixed;
    color: #e2e8f0 !important;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================
   2. REGLAS GLOBALES (Glass Panels estilo Devoryn)
   ========================================== */
.card, .bg-white, .bg-light, .glass-panel {
    background: rgba(20, 25, 37, 0.5) !important; /* Más transparente */
    backdrop-filter: blur(24px) !important; /* Desenfoque más intenso */
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important; /* Borde ultra sutil */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important; /* Sombra profunda */
    border-radius: 20px !important;
    color: #f8fafc !important; 
}

/* Forzar que los textos oscuros viejos se vuelvan claros */
.text-dark { color: #f8fafc !important; }

/* ==========================================
   3. ESTILO DE LA BARRA LATERAL (SIDEBAR Pill Style)
   ========================================== */
.sidebar {
    width: 260px;
    height: calc(100vh - 2rem);
    position: fixed;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-link {
    color: #94a3b8;
    text-decoration: none;
    padding: 12px 18px; /* Más espaciado */
    border-radius: 12px; /* Forma de píldora redonda */
    margin-bottom: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

/* Hover sin línea azul, usa fondo blanco semitransparente elegante */
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255, 255, 255, 0.06); 
    color: #ffffff;
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: none; /* Quitamos la línea dura antigua */
}

.main-content {
    margin-left: 290px;
    padding: 1rem 1rem 1rem 0;
    min-height: 100vh;
}

/* ==========================================
   4. TABLAS E INPUTS ESTILO PREMIUM
   ========================================== */
.table {
    color: #cbd5e1 !important;
    --bs-table-bg: transparent !important;
    margin-bottom: 0;
}
.table th {
    color: #64748b !important;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    padding-bottom: 15px;
}
.table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
    padding: 15px 10px !important;
}

/* ==========================================
   5. INPUTS Y SELECTS (Optimizados para Formularios Densos)
   ========================================== */
/* 💡 INPUTS DE TEXTO (Normales) */
.form-control, .input-group-text {
    background-color: rgba(15, 20, 30, 0.6) !important; 
    border: 1px solid rgba(255, 255, 255, 0.12) !important; 
    color: #ffffff !important;
    border-radius: 6px !important; 
    transition: all 0.3s ease;
    padding: 6px 10px !important; 
    font-size: 0.85rem !important; 
    line-height: 1.4;
}

/* 💡 MENÚS DESPLEGABLES (Selects - Necesitan espacio para la flecha) */
.form-select {
    background-color: rgba(15, 20, 30, 0.6) !important; 
    border: 1px solid rgba(255, 255, 255, 0.12) !important; 
    color: #ffffff !important;
    border-radius: 6px !important; 
    transition: all 0.3s ease;
    /* Arriba, Derecha (35px para la flecha), Abajo, Izquierda */
    padding: 6px 35px 6px 10px !important; 
    font-size: 0.85rem !important; 
    line-height: 1.4;
    text-overflow: ellipsis; /* Pone "..." si el nombre del producto es súper largo */
}

.form-control::placeholder {
    color: #64748b !important;
    font-style: normal;
}

/* 💡 INPUTS: Al pasar el mouse */
.form-control:hover, .form-select:hover {
    border-color: rgba(255, 255, 255, 0.3) !important; 
    background-color: rgba(15, 20, 30, 0.9) !important;
}

/* 💡 INPUTS: Foco color Índigo/Violeta */
.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important; /* Anillo de luz más sutil */
    border-color: #6366f1 !important;
    background-color: #0f172a !important;
}

/* Opciones desplegables oscuras */
select option {
    background-color: #0f172a !important; 
    color: #e2e8f0 !important; 
    font-weight: 500;
    padding: 10px;
}
select:focus > option:checked { 
    background: #6366f1 !important; 
    color: #ffffff !important; 
}

/* ==========================================
   6. SCROLLBAR (Barra de desplazamiento minimalista)
   ========================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1); /* Gris muy transparente */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================
   7. ESTILIZADO DE SELECTS (Opciones Oscuras)
   ========================================== */
select option {
    background-color: #0f172a !important; 
    color: #e2e8f0 !important; 
    font-weight: 500;
    padding: 10px;
}
select:focus > option:checked { 
    background: #6366f1 !important; /* Fondo Índigo al seleccionar */
    color: #ffffff !important; 
}

/* ==========================================
   8. ALERTAS FLOTANTES (Estilo Toast)
   ========================================== */
.alerta-flotante {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 9999;
    min-width: 320px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5); /* Sombra más pronunciada */
    animation: entrarDerecha 0.5s ease-out forwards;
}

@keyframes entrarDerecha {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}