/* ========================================================
   MENÚ LATERAL MODERNO - CUIDAGEST
   ======================================================== */

#menu {
    grid-area: menu;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    width: 100%;
    position: relative;
    z-index: 2;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

#menu ul {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 15px auto 0 auto;
    gap: 10px;
    width: calc(100% - 18px);
    align-items: center;
    padding: 0;
}

/* 1. PASTILLA BASE DEL BOTÓN */
#menu ul li {
    background-color: var(--containers-gray, #f8fafc);
    color: #334155;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 7px 10px;
    border-radius: 10px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Hover suave */
#menu ul li:hover {
    background-color: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    color: #0f172a;
}

/* Estado Activo / Seleccionado */
#menu ul li.active {
    background-color: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 3px 10px rgba(38, 56, 89, 0.08);
    color: #1e293b;
    font-weight: 700;
}

/* 2. LÍNEA INDICADORA LATERAL CON SEPARACIÓN */
#menu ul li::after {
    content: '';
    position: absolute;
    top: 7px;
    right: 2px; /* Pegada al extremo derecho para dar espacio al icono */
    height: 0;
    width: 3.5px;
    background-color: #263859;
    border-radius: 3px;
    transition: height 0.25s ease-in-out;
}

#menu ul li:hover::after,
#menu ul li.active::after {
    height: calc(100% - 14px);
}

/* 3. CONTENEDOR CUADRADO DEL ICONO */
#menu ul li svg {
    width: 36px;
    height: 36px;
    padding: 8px;
    border-radius: 8px;
    flex-shrink: 0;
    box-sizing: border-box;
    fill: #ffffff !important;
    color: #ffffff !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#menu ul li:hover svg {
    transform: scale(1.04);
}

/* PALETA POR MÓDULO */
#menu ul li.inicio svg {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

#menu ul li.espacios svg {
    background: linear-gradient(135deg, #6b21a8, #9333ea);
    box-shadow: 0 2px 6px rgba(147, 51, 234, 0.28);
}

#menu ul li.personal svg {
    background: linear-gradient(135deg, #0e7490, #06b6d4);
    box-shadow: 0 2px 6px rgba(6, 182, 212, 0.28);
}

#menu ul li.dashboard svg {
    background: linear-gradient(135deg, #c2410c, #ea580c);
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.28);
}

#menu ul li.asistencias svg {
    background: linear-gradient(135deg, #15803d, #16a34a);
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.28);
}

#menu ul li.usuarios svg {
    background: linear-gradient(135deg, #3730a3, #4f46e5);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.28);
}

#menu ul li.soporte svg {
    background: linear-gradient(135deg, #475569, #64748b);
    box-shadow: 0 2px 6px rgba(100, 116, 139, 0.28);
}

/* 4. TEXTO CON ENCOGIMIENTO Y DIFUMINADO SUAVE */
#menu ul li span {
    font-size: 13.5px;
    font-weight: 600;
    opacity: 1;
    max-width: 140px;
    margin-left: 10px;
    overflow: hidden;
    white-space: nowrap;
    display: inline-block;
    transition: opacity 0.2s ease-in-out, max-width 0.3s ease-in-out, margin-left 0.3s ease-in-out;
}

/* 5. MENÚ EXPANDIDO Y COLAPSADO */
body.active {
    grid-template-columns: 240px 1fr;
}

body.inactive {
    grid-template-columns: 80px 1fr; /* Más holgura para que el icono respire */
    grid-template-areas:
        'header header'
        'menu main'
        'footer footer';
}

body.inactive #menu ul {
    width: calc(100% - 16px);
}

body.inactive #menu ul li {
    padding: 7px 11px; /* Centra el icono y deja espacio antes de la línea ::after */
}

/* Al colapsar: el texto se desvanece sin saltos */
body.inactive #menu ul li span {
    opacity: 0;
    max-width: 0;
    margin-left: 0;
    pointer-events: none;
}
#menu ul li.reportes svg {
    background: linear-gradient(135deg, #b45309, #f59e0b);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}