@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {

    /* Nueva paleta más profesional */
    --color-primary: #1a2a6c; /* Azul profundo institucional */
    --color-accent: #b38e5d;  /* Dorado elegante */
    --color-danger: #e74c3c;
    --color-success: #27ae60;
    --color-white: #ffffff;
    --color-info-dark: #5a6a7a;
    --color-background: #f0f2f5;
    --color-dark: #2c3e50;
    
    /* Sombras suaves */
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --card-border-radius: 1.2rem;



    --border-raius-1: 0.4rem;
    --border-raius-2: 0.8rem;
    --border-raius-3: 1.2rem;

    --card-padding: 1.8rem;
    --padding-1: 1.2rem;

    --box-shadow: 0 2rem 3rem var(--color-light);



    --primary: #2c3e50;
            --accent: #277cae;
            --bg-light: #f4f7f6;
            --white: #ffffff;

            /* NUEVAS VARIABLES PARA EL MODAL */
    --modal-body-bg: #ffffff;
    --modal-body-text: #444444;
    --modal-footer-bg: #fafafa;
    --info-item-border: #5a6a7a; /* Usando tu --color-info-dark suave */

}

/* -------------------DARK THEME VARIABLES-----------------------*/
.dark-theme-variables{
    --color-background: #181a1e;
    --color-white: #202528;
    --color-dark: #edeffd;
    --color-dark-variant: #a3bdcc;
    --color-light: rgba(0, 0, 0, 0.4);
    --box-shadow: 0 2rem 3rem var(--color-light);

    /* CAMBIOS PARA EL MODAL EN MODO OSCURO */
    --modal-body-bg: #202528;      /* Fondo oscuro para el cuerpo */
    --modal-body-text: #edeffd;    /* Texto claro */
    --modal-footer-bg: #181a1e;    /* Fondo del footer un poco más oscuro */
    --info-item-border: #333942;   /* Bordes sutiles para los bloques de info */
}

*{
    margin: 0;
    padding: 0;
    outline: 0;
    appearance: none;
    border: 0;
    text-decoration: none;
    list-style: none;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    width: 100vw;
    height: 100vh;
    font-family: poppins, sans-serif;
    font-size: 0.88rem;
    background: var(--color-background);
    user-select: none;
    overflow-x: hidden;
    color: var(--color-dark);
}

.container{
    display: grid;
    width: 96%;
    margin: 0 auto;
    gap: 1.8rem;
    grid-template-columns: 14rem auto 23rem;
}

a {
    color: var(--color-dark);
}

img{
    display: block;
    width: 100%;
}

h1{
    font-weight: 800;
    font-size: 1.8rem;
}

h2{
    font-size: 1.4rem;
}

h3{
    font-size: 0.87rem;
}

h4{
    font-size: 0.8rem;
}

h5{
    font-size: 0.77rem;
}

small{
    font-size: 0.9rem;
}

.profile-photo{
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    overflow: hidden;
}

.text-muted {
    color: var(--color-info-dark);
}

p{
    color: var(--color-dark-variant);
}

b{
    color: var(--color-dark);
}

.primary{
    color: var(--color-primary);
}

.danger{
    color: var(--color-danger);
}

.succes{
    color: var(--color-success);
}

.warning{
    color: var(--color-warning);
}

main {
    margin-top: 1.4rem;
}

main .insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Adaptable */
    gap: 1.5rem;
    margin-top: 1rem;
}

main .insights > div {
    background: var(--color-white);
    padding: 1.5rem;
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow);
    border-left: 5px solid transparent; /* Efecto elegante */
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

main .insights > div:hover {
    transform: translateY(-5px);
    border-left: 5px solid var(--color-accent);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Iconos circulares */
main .insights > div span {
    background: var(--color-background);
    color: var(--color-primary);
    padding: 0.8rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: inline-block;
}

/* Títulos de secciones */
.departamento h1 {
    font-size: 1.4rem;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-accent);
    display: inline-block;
    padding-bottom: 5px;
    padding-top: 15px;
    margin-bottom: 1rem;
    text-decoration: none; /* Quitamos el subrayado simple */
}

/* Estilo de los textos en tarjetas */
.middle h2 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
}

.bottom small {
    display: block;
    margin-top: 0.3rem;
    font-weight: 500;
}



.right{
    margin-top: 1.4rem;
}
/*
.right .top{
    display: flex;
    justify-content: end;
    gap: 2rem;
}*/
.right .top {
    display: flex;
    justify-content: end;
    gap: 2rem;
    position: fixed;    /* Hace que el contenedor se quede estático al hacer scroll */
    top: 1.4rem;        /* Mantiene la distancia superior original */
    right: 2%;          /* Lo alinea con el margen del contenedor principal (96% de ancho) */
    z-index: 10;        /* Asegura que quede por encima de las tarjetas y el fondo */
}

.right .theme-toggler{
    background: var(--color-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 1.6rem;
    width: 4.2rem;
    cursor: pointer;
    border-radius: var(--border-raius-1);
}

.right .theme-toggler span{
    font-size: 1.2rem;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.right .theme-toggler span.active{
    background: var(--color-primary);
    color: white;
    border-radius: var(--border-raius-1);
}

@media screen and (max-width: 1200px) {
    .container{
        width: 94%;
        grid-template: 7rem auto 23rem;
    }
    main .insights{
        grid-template-columns: 1fr;
        gap: 1rem;
    }

}

@media screen and (max-width: 768px) {
    aside {
        width: 100%;
        position: fixed; /* Lo mantenemos arriba como barra de navegación */
        top: 0;
        z-index: 3;
        background: var(--color-white);
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .top-head {
        padding: 0.5rem 1rem;
        justify-content: flex-start; /* Alineado a la izquierda en móvil */
    }

    .logo-institucional {
        max-width: 130px; /* Más pequeño en móvil para no robar espacio */
    }

    /* Ajuste para que el contenido principal no se esconda bajo el logo fijo */
    main {
        margin-top: 20rem !important; 
    }

    /* El botón de modo oscuro debe bajar un poco para no tapar el logo */
   .right .top {
        position: fixed;
        top: 0.5rem;       /* Un poco más arriba en móviles para centrarlo con el logo */
        right: 1rem;       /* Pegado a la derecha en pantallas chicas */
        height: auto;
        z-index: 1001;     /* Por encima del modal (1000) y del aside fijo (3) */
    }
    .container{
        width: 100%;
        grid-template-columns: 1fr;
    }
    main{
        margin-top: 8rem;
        padding: 0 1rem;
    }
   

    .right .top .theme-toggler {
        width: 4.2rem;     /* Mantiene su tamaño estándar */
        position: static;  /* Quitamos el absolute y el left: 66% que causaban conflicto */
    }
}

/* Ajuste extra para teléfonos muy pequeños */
@media screen and (max-width: 480px) {
    .logo-institucional {
        max-width: 110px;
    }
}


/* Caja del Modal */
.modal-content {
    background: var(--modal-body-bg); /* Cambiado de var(--white) */
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 25px;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--box-shadow);
    animation: slideIn 0.3s ease-out;
    border: none;
}

/* Encabezado - Mantiene el color primario institucional */
.modal-header {
    background: var(--color-primary); 
    color: white;
    padding: 20px;
    position: sticky;
    top: 0;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 { 
    margin: 0; 
    font-size: 1.5rem; 
    color: white; /* Asegura texto blanco siempre en header */
}
.modal-header p { 
    margin: 5px 0 0; 
    opacity: 0.8; 
    font-size: 0.9rem; 
    color: white; 
}

.close-btn {
    position: absolute;
    right: 20px; 
    top: 20px;
    font-size: 24px;
    color: white;
    cursor: pointer;
}

/* Cuerpo del Modal */
.modal-body { 
    padding: 25px; 
    color: var(--modal-body-text); /* Cambiado de #444 */
}

.section-title {
    color: var(--color-accent); /* Vinculado a tu dorado/azul accent */
    border-bottom: 2px solid var(--color-background); /* Línea dinámica */
    padding-bottom: 5px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

/* Bloques de información general */
.info-item {
    background: var(--color-background); /* Fondo dinámico gris/oscuro */
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--info-item-border);
    transition: background 0.2s, transform 0.2s;
}

.info-item:hover {
    background: var(--modal-footer-bg);
    transform: translateY(-2px);
}

.info-item label { 
    display: block; 
    font-size: 0.75rem; 
    font-weight: bold; 
    color: var(--color-info-dark); /* Color grisáceo para etiquetas */
}

.info-item span { 
    font-size: 0.95rem; 
    font-weight: 500; 
    color: var(--modal-body-text); 
}

ul { padding-left: 20px; margin: 10px 0; }
li { margin-bottom: 8px; font-size: 0.9rem; color: var(--modal-body-text); }

/* Footer del Modal */
.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--color-background);
    text-align: right;
    background: var(--modal-footer-bg); /* Cambiado de #fafafa */
}

/* Botón Entendido */
.btn-open {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    background: var(--color-primary) !important;
    color: white;
    transition: opacity 0.3s;
}

.btn-open:hover {
    opacity: 0.9;
}

        .modal-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.6);
            display: none; /* Oculto por defecto */
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }

       

        @keyframes slideIn {
            from { transform: translateY(-20px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }

        


        .top-head {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    transition: all 0.3s ease;
}

.logo-institucional {
    width: 100%;
    max-width: 150px; /* Tamaño ideal en escritorio */
    height: auto;
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.1)); /* Sombra suave para realzar el escudo */
}