/* ==========================================================================
   CONFIGURACIÓN PREMIUM Y MONOCROMÁTICA
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    /* Mismo fondo que el Login */
    background: url('../IMG/fondologin.jpg') no-repeat center center fixed;
    background-size: cover;
    height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden; /* Importante para el layout del panel */
    color: #e5e5e5; /* Texto gris claro predeterminado */
}

/* Capa de contraste monocromático del login */
.overlay-background {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.9) 100%);
    backdrop-filter: grayscale(100%);
    -webkit-backdrop-filter: grayscale(100%);
    z-index: 1;
}

/* ==========================================================================
   LAYOUT DEL PANEL
   ========================================================================= */
.main-content-wrapper {
    display: flex;
    position: relative;
    z-index: 2;
    height: calc(100vh - 70px); /* Resta la altura del header */
    width: 100%;
}

/* ==========================================================================
   BARRA SUPERIOR (TOP HEADER)
   ========================================================================= */
.top-header {
    height: 70px;
    width: 100%;
    position: relative;
    z-index: 3;
    background: rgba(18, 18, 18, 0.85); /* Negro carbón translúcido del login */
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    font-size: 22px;
    color: #ffffff;
}

.brand-logo h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
}

.header-center h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #ffffff;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: #666666;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.sidebar-toggle-btn:hover {
    color: #ffffff;
}

/* Perfil de Usuario */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: 15px;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e5e5e5;
}

.avatar-circle svg {
    width: 22px;
    height: 22px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    color: #8a8a8a;
    font-size: 12px;
}

.logout-btn {
    background: none;
    border: none;
    color: #8a8a8a;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.3s;
    margin-left: 10px;
}

.logout-btn:hover {
    color: #ffffff;
}

/* ==========================================================================
   BARRA LATERAL DE NAVEGACIÓN
   ========================================================================= */
.sidebar-navigation {
    width: 240px;
    height: 100%;
    background: rgba(18, 18, 18, 0.7); /* Vidrio oscuro */
    backdrop-filter: blur(25px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 30px 0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.sidebar-navigation.collapsed {
    width: 70px;
}

.nav-links {
    list-style: none;
    width: 100%;
}

.nav-links li {
    width: 100%;
    position: relative;
    transition: background 0.3s ease;
}

.nav-links li a {
    display: flex;
    align-items: center;
    padding: 14px 25px;
    text-decoration: none;
    color: #8a8a8a;
    font-size: 14px;
    font-weight: 500;
    gap: 15px;
    transition: all 0.3s ease;
}

.nav-links li span {
    transition: opacity 0.3s;
}

.nav-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-navigation.collapsed li a {
    padding: 14px;
    justify-content: center;
}

.sidebar-navigation.collapsed li span {
    display: none;
    opacity: 0;
}

/* Estados Active/Hover de la navegación */
.nav-links li:hover a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.02);
}

.nav-links li.active a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-links li.active a::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2.5px;
    background: #ffffff;
    border-radius: 0 4px 4px 0;
}

/* ==========================================================================
   ÁREA DE CONTENIDO (GRID)
   ========================================================================= */
.dashboard-grid {
    flex: 1;
    padding: 30px;
    height: 100%;
    overflow-y: auto; /* Permite scroll solo en el contenido */
}

/* Tarjetas de Resumen (Stat Cards) */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 25px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03); /* Glassmorphism sutil */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    animation: statCardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.stat-header h3 {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
}

.stat-icon {
    font-size: 20px;
}

.gray-icon { color: #666666; }
.green-icon { color: #10b981; } /* Solo el icono tiene el verde */

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 5px;
}

.stat-desc {
    color: #8a8a8a;
    font-size: 12px;
}

/* Secciones de Detalle */
.detail-sections {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.detail-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.detail-card h3 {
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-icon {
    color: #666666;
    font-size: 16px;
}

.placeholder-graphic {
    width: 100%;
    height: 300px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666666;
}

/* Alertas */
.alert-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.alert-list li {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.15);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.alert-icon {
    font-size: 18px;
}

.alert-info {
    display: flex;
    flex-direction: column;
}

.alert-title {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

.alert-desc {
    font-size: 11px;
    color: #8a8a8a;
}

.warning-icon { color: #f59e0b; }
.info-icon { color: #8a8a8a; }

/* ==========================================================================
   ANIMACIONES Y RESPONSIVIDAD
   ========================================================================= */
@keyframes statCardIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive (Tablets) */
@media (max-width: 992px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .detail-sections {
        grid-template-columns: 1fr;
    }
}

/* Mobile responsive (Teléfonos) */
@media (max-width: 768px) {
    .top-header {
        padding: 0 15px;
    }

    .brand-logo h1 {
        display: none;
    }

    .sidebar-navigation {
        position: absolute;
        width: 240px;
        top: 0; left: -240px; /* Oculto a la izquierda */
        z-index: 4;
        transition: left 0.3s ease;
    }

    .sidebar-navigation.mobile-active {
        left: 0; /* Visible */
    }

    .main-content-wrapper {
        height: auto;
    }

    .dashboard-grid {
        padding: 15px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }
}
/* ==========================================================================
   MEJORAS DE ANIMACIÓN EN LA BARRA LATERAL (PC)
   ========================================================================= */
.sidebar-navigation {
    width: 240px;
    height: 100%;
    background: rgba(18, 18, 18, 0.75);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    /* Transición ultra suave para el ancho */
    transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1); 
    overflow-x: hidden;
}

/* Estado: Guardado / Colapsado en Escritorio */
.sidebar-navigation.collapsed {
    width: 75px;
}

/* Suavizar la desaparición de los textos del menú al encogerse */
.nav-links li a span {
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sidebar-navigation.collapsed .nav-links li a span {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px);
}

/* ==========================================================================
   RESPONSIVIDAD AVANZADA (MÓVILES)
   ========================================================================= */
@media (max-width: 768px) {
    .sidebar-navigation {
        position: fixed; /* Se vuelve flotante sobre el contenido */
        top: 70px; /* Inicia justo debajo del header */
        left: -240px; /* Completamente oculto a la izquierda por defecto */
        width: 240px;
        height: calc(100vh - 70px);
        z-index: 999;
        /* Efecto de deslizamiento premium */
        transition: left 0.4s cubic-bezier(0.25, 1, 0.5, 1); 
        box-shadow: none;
    }

    /* Estado: Desplegado en Móviles */
    .sidebar-navigation.mobile-active {
        left: 0; /* Entra suavemente a la pantalla */
        box-shadow: 20px 0 40px rgba(0, 0, 0, 0.6);
    }

    /* Forzar que los textos se vean siempre bien en el despliegue móvil */
    .sidebar-navigation.mobile-active .nav-links li a span {
        opacity: 1;
        transform: none;
    }

    /* El grid principal ahora ocupa todo el ancho en móviles sin empujarse */
    .main-content-wrapper {
        position: relative;
    }
    
    .dashboard-grid {
        width: 100%;
        padding: 20px 15px;
    }
}