/* --- Estilos del Branding (Logo y Sidebar) --- */
.brand-link {
    display: flex !important;
    flex-direction: column !important; /* Logo arriba, texto abajo */
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 10px 15px 10px !important;
    height: auto !important;
    overflow: visible !important;
    transition: all 0.3s ease-in-out;
}

.custom-logo-img, .brand-image {
    width: 200px !important; /* Mucho más grande para abarcar bien el ancho del sidebar */
    height: auto !important; /* Permitir que la altura se ajuste proporcionalmente al ancho */
    max-height: 100px !important; /* Limite de altura razonable */
    margin: 10px auto 15px auto !important; /* Más respiro arriba y abajo */
    border-radius: 10px; /* Bordes suaves */
    object-fit: contain;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); /* Sombra elegante */
    transition: all 0.3s ease-in-out;
    background-color: #ffffff; /* Asegurar fondo limpio por si la imagen es transparente */
    padding: 5px; /* Un poco de aire interno para que la sombra se vea mejor */
    float: none !important; /* Jazzmin usa float left por defecto, lo quitamos para centrar */
}

.brand-link .brand-text {
    display: block !important;
    font-size: 0.7rem !important; /* Texto un poco más prominente */
    font-weight: 800 !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    color: #ffffff !important;
    text-align: center !important;
    letter-spacing: 0.5px;
}

/* Subtexto "Control Center" */
.brand-subtext {
    font-size: 10px !important; 
    color: #3b82f6 !important; /* Azul acorde a los indicadores del Dashboard */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 4px;
    display: block;
    text-align: center !important;
}

/* --- Ajustes del Dashboard --- */
.card-primary.shadow, .card-dark.shadow {
    transition: transform 0.2s;
}

.card-primary.shadow:hover {
    transform: translateY(-2px);
}

/* --- Ocultar elementos innecesarios --- */
.main-footer .float-right {
    display: none !important; /* Oculta la versión de Jazzmin */
}

/* --- ESTILOS EXCLUSIVOS PARA EL LOGIN --- */

/* 1. Fondo general: Degradado oscuro profesional */
.login-page {
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%) !important;
    color: #ffffff !important;
}

/* 2. El Logo: Brillo sutil para que resalte */
.login-logo img {
    max-height: 250px !important;
    /* filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.3)); Remove shadow to avoid border look */
    border-radius: 12px; /* Soften corners if image is rectangular */
    margin-bottom: 20px;
}

/* 3. La Caja de Login (Card) con efecto de cristal (Glassmorphism) */
.login-box .card {
    background: rgba(30, 41, 59, 0.7) !important;
    backdrop-filter: blur(12px); /* Efecto de desenfoque */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5) !important;
}

.login-box .card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #3b82f6 !important; /* El azul de tus indicadores */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 4. Campos de Texto (Inputs) */
.login-box .form-control {
    background: rgba(15, 23, 42, 0.5) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    color: #fff !important;
    border-radius: 8px !important;
}

.login-box .form-control:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* 5. El Botón: Azul sólido e imponente */
.login-box .btn-primary {
    background-color: #3b82f6 !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600;
    padding: 10px;
    transition: all 0.3s ease;
}

.login-box .btn-primary:hover {
    background-color: #2563eb !important;
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

/* --- EFECTO TECH PARA EL LOGIN --- */
.login-page::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Cuadrícula tecnológica */
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -1;
    animation: moveGrid 20s linear infinite;
}

/* Animación de movimiento lento */
@keyframes moveGrid {
    from { background-position: 0 0; }
    to { background-position: 30px 60px; }
}

/* Brillos aleatorios (Pseudo-partículas) */
.login-page::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.1) 0%, transparent 20%),
                radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.1) 0%, transparent 20%);
    z-index: -1;
}

/* dashboard_custom.css */

/* --- Ajustes de la Barra Lateral y Logo --- */

/* Fix: Fondo del logo colapsado (Responsive y Minimized) */
body.sidebar-collapse .brand-link {
    width: 4.6rem !important; /* Ancho exacto de la barra colapsada (AdminLTE default) */
    padding: 15px 0 !important; /* Centrar contenido verticalmente */
    overflow: hidden !important;
}

body.sidebar-collapse .custom-logo-img,
body.sidebar-collapse .brand-image {
    width: 45px !important; /* Reducir tamaño del logo al colapsar */
    height: 45px !important;
    max-height: 45px !important;
    margin: 0 auto !important; /* Quitar margen inferior */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Ocultar texto cuando está colapsado para evitar desbordamiento */
body.sidebar-collapse .brand-text,
body.sidebar-collapse .brand-subtext {
    display: none !important;
}

/* Ajustes Responsive (Móviles) */
@media (max-width: 768px) {
    .brand-link {
        padding: 15px 10px 10px 10px !important;
    }
    .custom-logo-img, .brand-image {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 8px !important;
    }
    .brand-link .brand-text {
        font-size: 1.1rem !important;
    }
}

/* Force Brand Link to be DARK to match Sidebar */
.brand-link {
    background-color: #343a40 !important; 
    border-bottom: 1px solid #4b545c !important;
    width: 250px !important; /* Forzar ancho completo cuando está expandido */
    transition: width 0.3s ease-in-out;
    position: absolute !important;
    top: 0;
    left: 0;
    z-index: 1039 !important;
}

/* Adjust Sidebar to start BELOW the tall brand link */
.main-sidebar .sidebar {
    margin-top: 180px !important; 
    height: calc(100vh - 180px) !important;
}

.brand-text {
    color: #ffffff !important; 
}
/* El texto ABS COMMAND se vuelve oscuro */

/* --- OVERRIDE NAVBAR FOR SANDSTONE THEME --- */
/* Force navbar to be dark even if Sandstone theme is active */
.main-header.navbar {
    background-color: #343a40 !important; /* Dark Gray matching sidebar */
    border-bottom: 1px solid #4b545c !important; /* Border to match sidebar separator */
}

.main-header.navbar .nav-link, 
.main-header.navbar .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
}

.main-header.navbar .nav-link:hover,
.main-header.navbar .navbar-nav .nav-link:hover {
    color: #ffffff !important;
}

/* Ensure branding area (top left) also stays dark if not covered by sidebar */
.brand-link.navbar-dark, 
.brand-link.bg-dark {
     background-color: #343a40 !important;
}