.modulo:hover { background: rgba(255, 255, 255, 0.035); }

.modulo:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.55);
    outline-offset: -2px;
    background: rgba(255, 255, 255, 0.035);
}

.modulo .icono {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(30, 41, 59, 0.6);
    color: #94A3B8;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    border: 1px solid rgba(30, 41, 59, 0.8);
    margin-top: 1px;
}

.modulo .icono svg {
    width: 14px;
    height: 14px;
}

.modulo:hover .icono {
    background: rgba(179, 5, 15, 0.15);
    border-color: rgba(179, 5, 15, 0.4);
    color: #fff;
}

.modulo .icono.rojo,
.modulo .icono.azul,
.modulo .icono.naranja,
.modulo .icono.verde {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(30, 41, 59, 0.8);
    color: #94A3B8;
}

.modulo:hover .icono.rojo,
.modulo:hover .icono.azul,
.modulo:hover .icono.naranja,
.modulo:hover .icono.verde {
    background: rgba(179, 5, 15, 0.15);
    border-color: rgba(179, 5, 15, 0.4);
    color: #fff;
}

.modulo .texto {
    flex: 1;
    text-align: left;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 4px;
    min-height: 30px;
}

.modulo .texto span {
    display: block;
    color: #CBD5E1;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modulo:hover .texto span { color: #fff; }

.modulo .texto small {
    display: block;
    color: #94A3B8;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.3;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modulo:hover .texto small { color: #94A3B8; }

.modulo .flecha {
    color: #475569;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.2s ease;
    flex-shrink: 0;
    margin-top: 6px;
    line-height: 1;
}

.modulo:hover .flecha { color: #94A3B8; }

.modulo .badge-pendientes {
    flex-shrink: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-top: 5px;
    border-radius: 9px;
    background: var(--enaex-rojo, #B3050F);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    letter-spacing: 0;
    box-shadow: 0 0 0 2px rgba(179, 5, 15, 0.25);
}

.sidebar.collapsed .modulo { position: relative; }

.sidebar.collapsed .modulo .badge-pendientes {
    position: absolute;
    top: 4px;
    right: 6px;
    min-width: 10px;
    width: 10px;
    height: 10px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    font-size: 0;
    line-height: 10px;
}

.modulo .flecha.abierto {
    transform: rotate(90deg);
    color: #fff;
}

a.modulo.dashboard-link {
    text-decoration: none;
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid rgba(30, 41, 59, 0.5);
    border-radius: 0 0 10px 10px;
}

a.modulo.dashboard-link:hover {
    background: rgba(255, 255, 255, 0.035);
}

.submenu {
    position: relative;
    margin: 2px 0 10px 25px;
    padding-left: 16px;
    border-left: 1px solid rgba(30, 41, 59, 0.9);
}

.submenu a {
    position: relative;
    display: block;
    padding: 8px 12px;
    color: #94A3B8;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.submenu a::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 50%;
    width: 12px;
    height: 1px;
    background: rgba(30, 41, 59, 0.9);
    transition: background 0.2s ease;
}

.submenu a::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #1E293B;
    transition: background 0.2s ease, transform 0.2s ease;
}

.submenu a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.035);
}

.submenu a:hover::before { background: #475569; }

.submenu a:hover::after {
    background: var(--enaex-rojo);
    transform: translateY(-50%) scale(1.3);
}

.modulo.ruta-activa {
    background: linear-gradient(90deg, rgba(184, 134, 11, .14), rgba(184, 134, 11, .04) 70%, transparent);
    box-shadow: inset 3px 0 0 #b8860b;
}

.modulo.ruta-activa .icono {
    background: rgba(184, 134, 11, .18);
    border-color: rgba(184, 134, 11, .55);
    color: #E0A82E;
}

.modulo.ruta-activa .texto span {
    color: #fff;
}

.modulo.ruta-activa .texto small {
    color: #cbd5e1;
}

.modulo.ruta-activa .flecha {
    color: #E0A82E;
}

.submenu a.active,
.submenu a:active.active {
    color: #fff;
    background: rgba(184, 134, 11, .12);
    box-shadow: inset 2px 0 0 #b8860b;
    font-weight: 600;
}

.submenu a.active::before {
    background: #b8860b;
    height: 2px;
}

.submenu a.active::after {
    background: #E0A82E;
    transform: translateY(-50%) scale(1.4);
    box-shadow: 0 0 0 3px rgba(224, 168, 46, .18);
}

.modulo {
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.16s ease;
}

.modulo:hover {
    transform: translateX(2px);
}

.modulo:active {
    transform: translateX(0) scale(.99);
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(30, 41, 59, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    background: #0A0F1C;
    flex-shrink: 0;
}

.sidebar-footer > div:not(.logout-confirm) {
    width: 1px;
    height: 18px;
    background: rgba(30, 41, 59, 0.9);
    flex-shrink: 0;
}

.sidebar-footer button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 10px;
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
    font-family: inherit;
}

.sidebar-footer button:hover {
    color: var(--enaex-rojo);
    background: rgba(179, 5, 15, 0.08);
}

.sidebar-footer button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.55);
    outline-offset: -2px;
}

.sidebar-footer .logout-confirm {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
    background: rgba(179, 5, 15, 0.08);
    border: 1px solid rgba(179, 5, 15, 0.25);
    border-radius: 8px;
}

.sidebar-footer .logout-confirm span {
    color: #E2E8F0;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.01em;
    flex: 1;
    text-align: center;
}

.sidebar-footer .btn-si,
.sidebar-footer .btn-no {
    flex: 0 0 auto;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer .btn-si {
    background: var(--enaex-rojo);
    color: #fff;
    border-color: var(--enaex-rojo);
}

.sidebar-footer .btn-si:hover {
    background: #9A0410;
    border-color: #9A0410;
}

.sidebar-footer .btn-no {
    background: transparent;
    color: #94A3B8;
    border-color: rgba(148, 163, 184, 0.3);
}

.sidebar-footer .btn-no:hover {
    color: #fff;
    border-color: rgba(148, 163, 184, 0.6);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 28, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 40;
}

@media (min-width: 768px) {
    .sidebar-overlay { display: none; }
}

.header-movil {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #E2E5E8;
}

.header-movil button {
    padding: 8px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #35424A;
}

.header-movil img { height: 24px; }

.header-movil .indicador {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D1D5DB;
}

.header-movil .indicador.online { background: #10B981; }

@media (min-width: 768px) {
    .header-movil { display: none; }
}

.modulo.grupo {
    margin-top: 8px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.modulo.grupo:hover { background: rgba(255, 255, 255, 0.09); }

.modulo.grupo.abierto {
    margin-bottom: 0;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

.modulo.grupo {
    gap: 12px;
}

.modulo.grupo .texto {
    padding-right: 0;
}

.modulo.grupo .texto span {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #E2E8F0;
}

.modulo.grupo .texto small {
    white-space: normal;
    overflow: visible;
    line-height: 1.25;
}

.modulo.grupo .icono {
    background: rgba(179, 5, 15, 0.12);
    border-color: rgba(179, 5, 15, 0.3);
    color: #CBD5E1;
}

.grupo-items {
    margin-bottom: 12px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0 0 12px 12px;
    background: rgba(255, 255, 255, 0.025);
}

.grupo-items.oculto { display: none; }

.grupo-items .modulo {
    padding: 8px 10px;
    margin-bottom: 2px;
}

.grupo-items .modulo .texto {
    min-height: 0;
}

.grupo-items .modulo .texto span {
    font-size: 12.5px;
    font-weight: 600;
}

.grupo-items .modulo .flecha { margin-top: 2px; }

.grupo-items .submenu { margin-left: 20px; }

.sidebar.collapsed .modulo.grupo,
.sidebar.collapsed .grupo-items {
    margin: 0 0 4px;
    border: none;
    border-radius: 10px;
    background: transparent;
}

.sidebar.collapsed .grupo-items { padding: 0; }

.sidebar.collapsed .grupo-items.oculto { display: block; }

@media (hover: none) and (pointer: coarse) {
    .modulo {
        padding: 12px;
    }

    .submenu a {
        padding: 12px;
        font-size: 13px;
    }

    .sidebar-footer button {
        min-height: 44px;
    }
}
