﻿/* ============================================================
   Cloudy — Topnav oscuro moderno (Azure Portal / Teams)
   Nomenclatura: .cl-*
   ============================================================ */

/* ══════════════════════════════════════════════════════════
   BARRA PRINCIPAL — oscura
   ══════════════════════════════════════════════════════════ */

.cl-topnav {
    position: sticky;
    top: 0;
    z-index: 1035;
    background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), 0 6px 20px rgba(15, 23, 42, 0.15);
}
    /* Línea de acento superior */
    .cl-topnav::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #0d6efd 0%, #6366f1 35%, #8b5cf6 65%, #0d6efd 100%);
        pointer-events: none;
    }

.cl-topnav-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 56px;
    padding: 3px 0.85rem 0 0.85rem;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
}

@media (min-width: 768px) {
    .cl-topnav-inner {
        height: 58px;
        padding: 3px 1.25rem 0 1.25rem;
        gap: 0.75rem;
    }
}

/* ── Brand ── */
.cl-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: #fff;
    flex-shrink: 0;
}

.cl-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0d6efd 0%, #6366f1 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.4);
    flex-shrink: 0;
}

.cl-brand-text {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.01em;
    color: #fff;
}

.cl-brand:hover .cl-brand-text {
    color: #93c5fd;
}

@media (min-width: 768px) {
    .cl-brand-mark {
        width: 34px;
        height: 34px;
        font-size: 1.05rem;
    }

    .cl-brand-text {
        font-size: 1.05rem;
    }
}

/* ── Toggle móvil ── */
.cl-topnav-toggle {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-left: auto;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

    .cl-topnav-toggle:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

@media (min-width: 992px) {
    .cl-topnav-toggle {
        display: none;
    }
}

/* ══════════════════════════════════════════════════════════
   SECCIONES (nav)
   ══════════════════════════════════════════════════════════ */
.cl-nav {
    display: none;
    align-items: center;
    gap: 0.15rem;
    margin-left: 0.75rem;
    flex: 1;
    min-width: 0;
}

@media (min-width: 992px) {
    .cl-nav {
        display: flex;
    }
}

/* Móvil: despliegue en columna claro (contraste) */
@media (max-width: 991.98px) {
    .cl-nav.is-open {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--cl-border);
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
        padding: 0.5rem;
        gap: 0.15rem;
        margin-left: 0;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        z-index: 1034;
        color: var(--cl-text);
    }

        .cl-nav.is-open .cl-nav-trigger {
            color: var(--cl-text);
            width: 100%;
            justify-content: flex-start;
            padding: 0.75rem 1rem;
            font-size: 0.9rem;
        }

            .cl-nav.is-open .cl-nav-trigger:hover {
                background: var(--cl-surface-2);
                color: var(--cl-brand-500);
            }

            .cl-nav.is-open .cl-nav-trigger.active {
                color: var(--cl-brand-500);
                background: var(--cl-brand-50);
            }

        .cl-nav.is-open .cl-nav-caret {
            margin-left: auto;
            color: var(--cl-text-muted);
        }

        .cl-nav.is-open .cl-nav-section {
            width: 100%;
        }

        .cl-nav.is-open .cl-nav-menu {
            position: static !important;
            transform: none !important;
            width: 100% !important;
            box-shadow: none;
            border: none;
            border-left: 2px solid var(--cl-brand-100);
            margin: 0 0 0.25rem 1rem;
            padding: 0.25rem 0;
            background: transparent;
        }
}

/* ── Trigger de sección ── */
.cl-nav-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.8rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

    .cl-nav-trigger i {
        font-size: 0.95rem;
    }

    .cl-nav-trigger:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

    .cl-nav-trigger.active {
        background: rgba(13, 110, 253, 0.18);
        color: #93c5fd;
        font-weight: 600;
    }

.cl-nav-caret {
    font-size: 0.7rem;
    opacity: 0.55;
    transition: transform 0.15s ease;
}

.cl-nav-section.dropdown .cl-nav-trigger[aria-expanded="true"] .cl-nav-caret {
    transform: rotate(-180deg);
}

/* ══════════════════════════════════════════════════════════
   DROPDOWN MENU (nav enriquecido) — claro
   ══════════════════════════════════════════════════════════ */
.cl-nav-menu {
    min-width: 340px;
    padding: 0.4rem;
    border-radius: var(--cl-radius);
    border: 1px solid var(--cl-border);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    margin-top: 8px;
    z-index: 1070 !important;
    background: #fff;
}

.cl-nav-menu-header {
    padding: 0.55rem 0.75rem 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cl-text-subtle);
    margin: 0;
}

.cl-nav-menu .dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    color: var(--cl-text);
    text-decoration: none;
    transition: background 0.15s ease;
}

    .cl-nav-menu .dropdown-item:hover {
        background: var(--cl-surface-2);
        color: var(--cl-brand-500);
    }

    .cl-nav-menu .dropdown-item i {
        font-size: 1.1rem;
        width: 22px;
        text-align: center;
        color: var(--cl-brand-500);
        margin-top: 2px;
        flex-shrink: 0;
    }

    .cl-nav-menu .dropdown-item > div {
        display: flex;
        flex-direction: column;
        gap: 1px;
        min-width: 0;
        flex: 1;
    }

    .cl-nav-menu .dropdown-item strong {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--cl-text);
        line-height: 1.25;
    }

    .cl-nav-menu .dropdown-item small {
        font-size: 0.75rem;
        color: var(--cl-text-muted);
        line-height: 1.3;
        display: block;
    }

/* ══════════════════════════════════════════════════════════
   ACCIONES DERECHA (search, campanita, avatar)
   ══════════════════════════════════════════════════════════ */
.cl-topnav-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    flex-shrink: 0;
}

@media (min-width: 992px) {
    .cl-topnav-actions {
        margin-left: 0.5rem;
    }
}

/* ── Botón de búsqueda — destacado sobre el fondo oscuro ── */
.cl-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.75);
    height: 38px;
    padding: 0 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    min-width: 38px;
    justify-content: center;
    font-family: inherit;
}

    .cl-search-btn:hover {
        background: rgba(255, 255, 255, 0.14);
        border-color: rgba(255, 255, 255, 0.28);
        color: #fff;
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
    }

    .cl-search-btn:focus-visible {
        outline: 2px solid #60a5fa;
        outline-offset: 2px;
    }

    .cl-search-btn i {
        font-size: 0.95rem;
    }

.cl-search-text {
    display: none;
}

.cl-search-kbd {
    display: none;
}

@media (min-width: 992px) {
    .cl-search-btn {
        min-width: 260px;
        justify-content: flex-start;
        padding: 0 0.5rem 0 0.85rem;
    }

    .cl-search-text {
        display: block;
        flex: 1;
        text-align: left;
        color: rgba(255, 255, 255, 0.55);
    }

    .cl-search-btn:hover .cl-search-text {
        color: rgba(255, 255, 255, 0.85);
    }

    .cl-search-kbd {
        display: inline-block;
        font-family: var(--cl-font-mono);
        font-size: 0.65rem;
        font-weight: 600;
        background: rgba(255, 255, 255, 0.12);
        color: rgba(255, 255, 255, 0.75);
        padding: 2px 6px;
        border-radius: 4px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        letter-spacing: 0.02em;
    }
}

/* ── Botón icono genérico ── */
.cl-icon-btn {
    position: relative;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

    .cl-icon-btn:hover {
        background: rgba(255, 255, 255, 0.09);
        color: #fff;
    }
/* Variante clara (para drawer blanco) */
.cl-icon-btn-light {
    color: var(--cl-text-muted);
}

    .cl-icon-btn-light:hover {
        background: var(--cl-surface-2);
        color: var(--cl-text);
    }

/* ── Badge numérico ── */
.cl-icon-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--cl-danger);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0f172a;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

    .cl-icon-badge.pulse {
        animation: cl-badge-pulse 1.6s infinite;
    }

@keyframes cl-badge-pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.85;
    }

    70% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(0.9);
        opacity: 0.85;
    }
}

/* ══════════════════════════════════════════════════════════
   AVATAR DE USUARIO EN TOPNAV OSCURO
   ══════════════════════════════════════════════════════════ */
.cl-avatar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    padding: 0.28rem 0.6rem 0.28rem 0.3rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease;
    color: #fff;
}

    .cl-avatar-btn:hover {
        background: rgba(255, 255, 255, 0.08);
    }

.cl-avatar-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.cl-avatar-initials {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd 0%, #6366f1 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cl-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.cl-avatar-wrap.has-photo .cl-avatar-initials {
    display: none;
}

.cl-avatar-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
}

.cl-avatar-btn:hover .cl-avatar-name {
    color: #fff;
}

.cl-avatar-caret {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
    transition: transform 0.15s ease;
}

.cl-avatar-btn[aria-expanded="true"] .cl-avatar-caret {
    transform: rotate(-180deg);
}

@media (max-width: 991.98px) {
    .cl-avatar-name {
        max-width: 120px;
    }
}

@media (max-width: 575.98px) {
    .cl-avatar-name {
        display: none;
    }

    .cl-avatar-caret {
        display: none;
    }

    .cl-avatar-btn {
        padding: 0.25rem;
    }
}

/* ══════════════════════════════════════════════════════════
   MENÚ DE USUARIO (blanco)
   ══════════════════════════════════════════════════════════ */
.cl-user-menu {
    min-width: 300px;
    padding: 0;
    overflow: hidden;
    border-radius: var(--cl-radius);
    border: 1px solid var(--cl-border);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    z-index: 1070 !important;
    background: #fff;
}

.cl-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1.1rem 1.15rem;
    background: linear-gradient(135deg, #0d6efd 0%, #0b2b5c 100%);
    color: #fff;
}

.cl-user-avatar-wrap {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,0.22);
    border: 2px solid rgba(255,255,255,0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cl-user-avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1;
}

.cl-user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.cl-user-avatar-wrap.has-photo .cl-user-avatar-initials {
    display: none;
}

.cl-user-info {
    min-width: 0;
    flex: 1;
}

.cl-user-name {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-user-email {
    font-size: 0.76rem;
    color: rgba(255,255,255,0.85);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .cl-user-email i {
        margin-right: 4px;
        font-size: 0.72rem;
    }

.cl-user-menu-body {
    padding: 0.4rem;
}

    .cl-user-menu-body .dropdown-item {
        display: flex;
        align-items: flex-start;
        gap: 0.7rem;
        padding: 0.65rem 0.75rem;
        border-radius: 6px;
        color: var(--cl-text);
        transition: background 0.15s ease;
        text-decoration: none;
    }

        .cl-user-menu-body .dropdown-item:hover {
            background: var(--cl-surface-2);
        }

        .cl-user-menu-body .dropdown-item.text-danger:hover {
            background: #fef2f2;
            color: #b91c1c;
        }

        .cl-user-menu-body .dropdown-item i {
            font-size: 1.05rem;
            width: 22px;
            text-align: center;
            color: var(--cl-brand-500);
            margin-top: 2px;
            flex-shrink: 0;
        }

        .cl-user-menu-body .dropdown-item.text-danger i {
            color: #dc3545;
        }

        .cl-user-menu-body .dropdown-item > div {
            display: flex;
            flex-direction: column;
            gap: 1px;
            min-width: 0;
            flex: 1;
        }

        .cl-user-menu-body .dropdown-item strong {
            font-size: 0.86rem;
            font-weight: 600;
            color: inherit;
        }

        .cl-user-menu-body .dropdown-item small {
            font-size: 0.73rem;
            color: var(--cl-text-muted);
            line-height: 1.25;
        }

        .cl-user-menu-body .dropdown-item.text-danger:hover small {
            color: #b91c1c;
        }

    .cl-user-menu-body .dropdown-divider {
        margin: 0.35rem 0.25rem;
        border-color: var(--cl-border-2);
    }

/* ══════════════════════════════════════════════════════════
   DRAWER DE NOTIFICACIONES
   ══════════════════════════════════════════════════════════ */
.cl-notif-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 100vw;
    background: #fff;
    box-shadow: -12px 0 40px rgba(15,23,42,0.22);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 1060;
    display: flex;
    flex-direction: column;
}

    .cl-notif-drawer.visible {
        transform: translateX(0);
    }

    .cl-notif-drawer .drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.15rem;
        border-bottom: 1px solid var(--cl-border);
        background: #fff;
        font-size: 0.95rem;
    }

    .cl-notif-drawer .drawer-list {
        flex: 1;
        overflow-y: auto;
        padding: 0.25rem 0;
    }

.notification-item {
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid var(--cl-border-2);
    cursor: pointer;
    transition: background 0.15s ease;
}

    .notification-item:hover {
        background: var(--cl-surface-2);
    }

    .notification-item.is-unread {
        background: var(--cl-brand-50);
    }

        .notification-item.is-unread:hover {
            background: var(--cl-brand-100);
        }

    .notification-item .notification-msg {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .notification-item .unread-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--cl-brand-500);
        flex-shrink: 0;
        margin-top: 6px;
        box-shadow: 0 0 0 3px rgba(13,110,253,0.15);
    }

.notification-delete-btn {
    background: transparent;
    border: none;
    padding: 3px 7px;
    border-radius: 6px;
    color: var(--cl-text-subtle);
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.notification-item:hover .notification-delete-btn {
    opacity: 1;
}

.notification-delete-btn:hover {
    background: #fee2e2;
    color: var(--cl-danger);
}

.notification-delete-all-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--cl-danger);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    margin-right: 4px;
}

    .notification-delete-all-btn:hover:not(:disabled) {
        background: #fee2e2;
        transform: scale(1.05);
    }

    .notification-delete-all-btn:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }

@media (hover: none) {
    .notification-delete-btn {
        opacity: 1;
    }
}

/* ══════════════════════════════════════════════════════════
   FIX Z-INDEX
   ══════════════════════════════════════════════════════════ */
.dropdown-menu {
    z-index: 1070;
}

.cl-topnav .dropdown-menu {
    z-index: 1070 !important;
}

.swal2-container {
    z-index: 1055 !important;
}

.gs-backdrop {
    z-index: 2000;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — móvil
   ══════════════════════════════════════════════════════════ */
@media (max-width: 575.98px) {
    .cl-brand-text {
        font-size: 0.95rem;
    }

    .cl-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .cl-avatar-wrap {
        width: 30px;
        height: 30px;
    }

    .cl-avatar-initials {
        font-size: 0.78rem;
    }

    .cl-user-menu {
        min-width: calc(100vw - 24px);
    }

    .cl-search-btn {
        height: 36px;
    }
}
/* ============================================================
   MÓVIL — Drawer con reset total de colores
   ============================================================ */
@media (max-width: 991.98px) {

    /* ─── Drawer ─── */
    .cl-topnav .cl-nav {
        display: none !important;
        position: fixed !important;
        top: 56px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        margin: 0 !important;
        padding: 0.75rem !important;
        background: #ffffff !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.1rem !important;
        overflow-y: auto !important;
        z-index: 1050 !important;
    }

        .cl-topnav .cl-nav.is-open {
            display: flex !important;
        }

        /* ═══════════════════════════════════════════════════════
       RESET MAESTRO: nada dentro del drawer hereda blanco.
       Selector de alta especificidad + !important en cada color.
       ═══════════════════════════════════════════════════════ */
        .cl-topnav .cl-nav,
        .cl-topnav .cl-nav *:not(i):not(.bi):not([class*="bi-"]) {
            color: #0f172a !important;
        }

            /* Iconos Bootstrap: color azul por defecto */
            .cl-topnav .cl-nav i.bi,
            .cl-topnav .cl-nav [class*="bi-"] {
                color: #0d6efd !important;
            }

            /* ─── Trigger del drawer ─── */
            .cl-topnav .cl-nav .cl-nav-trigger {
                display: flex !important;
                width: 100% !important;
                justify-content: flex-start !important;
                align-items: center !important;
                padding: 0.85rem 1rem !important;
                font-size: 0.95rem !important;
                font-weight: 500 !important;
                color: #0f172a !important;
                background: transparent !important;
                border: none !important;
                border-radius: 8px !important;
                text-align: left !important;
                text-decoration: none !important;
                cursor: pointer !important;
            }

                .cl-topnav .cl-nav .cl-nav-trigger span {
                    color: #0f172a !important;
                    flex: 1;
                    text-align: left;
                }

                .cl-topnav .cl-nav .cl-nav-trigger:hover,
                .cl-topnav .cl-nav .cl-nav-trigger:focus {
                    background: #f8fafc !important;
                }

                    .cl-topnav .cl-nav .cl-nav-trigger:hover span,
                    .cl-topnav .cl-nav .cl-nav-trigger:focus span,
                    .cl-topnav .cl-nav .cl-nav-trigger.active span {
                        color: #0d6efd !important;
                    }

                .cl-topnav .cl-nav .cl-nav-trigger.active {
                    background: #eff6ff !important;
                    font-weight: 600 !important;
                }

                /* Icono principal del trigger — siempre azul */
                .cl-topnav .cl-nav .cl-nav-trigger > i.bi:first-child {
                    color: #0d6efd !important;
                    font-size: 1rem !important;
                    width: 20px !important;
                    text-align: center !important;
                    margin-right: 0.5rem !important;
                    flex-shrink: 0;
                }

            /* Caret — gris a la derecha */
            .cl-topnav .cl-nav .cl-nav-caret {
                color: #94a3b8 !important;
                margin-left: auto !important;
                font-size: 0.75rem !important;
                flex-shrink: 0;
            }

            /* ─── Submenú (dropdown) ─── */
            .cl-topnav .cl-nav .cl-nav-section.dropdown {
                width: 100% !important;
                position: static !important;
            }

            .cl-topnav .cl-nav .cl-nav-menu {
                position: static !important;
                transform: none !important;
                top: auto !important;
                left: auto !important;
                right: auto !important;
                bottom: auto !important;
                margin: 0.15rem 0 0.5rem 1rem !important;
                padding: 0.2rem 0 0.2rem 0.85rem !important;
                width: calc(100% - 1rem) !important;
                max-width: calc(100% - 1rem) !important;
                min-width: 0 !important;
                background: transparent !important;
                border: none !important;
                border-left: 2px solid #dbeafe !important;
                border-radius: 0 !important;
                box-shadow: none !important;
                opacity: 1 !important;
            }

                /* ─── Items del submenú ─── */
                .cl-topnav .cl-nav .cl-nav-menu .dropdown-item {
                    display: flex !important;
                    align-items: flex-start !important;
                    gap: 0.7rem !important;
                    padding: 0.65rem 0.75rem !important;
                    color: #0f172a !important;
                    background: transparent !important;
                    font-size: 0.88rem !important;
                    border-radius: 6px !important;
                    text-decoration: none !important;
                }

                    .cl-topnav .cl-nav .cl-nav-menu .dropdown-item > div {
                        min-width: 0;
                        flex: 1;
                    }

                    .cl-topnav .cl-nav .cl-nav-menu .dropdown-item strong {
                        display: block;
                        color: #0f172a !important;
                        font-size: 0.88rem !important;
                        font-weight: 600 !important;
                        line-height: 1.25;
                    }

                    .cl-topnav .cl-nav .cl-nav-menu .dropdown-item small {
                        display: block;
                        color: #64748b !important;
                        font-size: 0.75rem !important;
                        line-height: 1.3;
                        margin-top: 1px;
                    }

                    .cl-topnav .cl-nav .cl-nav-menu .dropdown-item > i.bi {
                        color: #0d6efd !important;
                        font-size: 1rem !important;
                        width: 20px !important;
                        text-align: center !important;
                        flex-shrink: 0;
                        margin-top: 2px;
                    }

                    .cl-topnav .cl-nav .cl-nav-menu .dropdown-item:hover,
                    .cl-topnav .cl-nav .cl-nav-menu .dropdown-item:focus {
                        background: #f8fafc !important;
                    }

                        .cl-topnav .cl-nav .cl-nav-menu .dropdown-item:hover strong,
                        .cl-topnav .cl-nav .cl-nav-menu .dropdown-item:focus strong {
                            color: #0d6efd !important;
                        }

                /* Headers de sección */
                .cl-topnav .cl-nav .cl-nav-menu .cl-nav-menu-header,
                .cl-topnav .cl-nav .cl-nav-menu .dropdown-header {
                    color: #94a3b8 !important;
                    background: transparent !important;
                    padding: 0.6rem 0.75rem 0.25rem !important;
                    font-size: 0.68rem !important;
                    font-weight: 700 !important;
                    text-transform: uppercase;
                    letter-spacing: 0.05em;
                    margin: 0 !important;
                }

    body.cl-nav-open {
        overflow: hidden;
    }
}

/* El wrapper del topnav mantiene su referencia posicional */
.cl-topnav-inner {
    position: relative;
}
/* ══════════════════════════════════════════════════════════
   CAMPANITA DE NOTIFICACIONES — Fluent minimal
   ══════════════════════════════════════════════════════════ */
.notif-bell-btn {
    position: relative;
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.82);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

    .notif-bell-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

    .notif-bell-btn:focus-visible {
        outline: 2px solid #60a5fa;
        outline-offset: 2px;
    }

.notif-bell-icon {
    font-size: 1.15rem;
    line-height: 1;
    display: inline-block;
    transform-origin: 50% 0%;
}

/* Ring SOLO cuando llega notificación nueva (lo dispara el JS con .ringing) */
.notif-bell-btn.ringing .notif-bell-icon {
    animation: notif-bell-ring 0.9s ease-in-out;
}

@keyframes notif-bell-ring {
    0%, 100% {
        transform: rotate(0);
    }

    10%, 30%, 50%, 70% {
        transform: rotate(-14deg);
    }

    20%, 40%, 60%, 80% {
        transform: rotate(14deg);
    }

    90% {
        transform: rotate(-6deg);
    }
}

/* Cuando hay notificaciones sin leer, el icono se ve "activo" */
.notif-bell-btn.has-notifications .notif-bell-icon {
    color: #fff;
}

/* ─── Badge del contador ─── */
.notif-bell-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #dc3545;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0f172a;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transform-origin: center;
}

    /* Entrada con bounce — SOLO al aparecer o al cambiar de valor */
    .notif-bell-badge.pulse {
        animation: notif-badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

@keyframes notif-badge-pop {
    0% {
        transform: scale(0.4);
        opacity: 0;
    }

    60% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Contador alto: tono más intenso */
.notif-bell-btn.urgent .notif-bell-badge {
    background: #b91c1c;
}

@media (prefers-reduced-motion: reduce) {
    .notif-bell-btn.ringing .notif-bell-icon,
    .notif-bell-badge.pulse {
        animation: none;
    }
}
/* ══════════════════════════════════════════════════════════
   DROPDOWN DEL AVATAR — rol + secciones
   ══════════════════════════════════════════════════════════ */

/* Rol bajo el email en el header azul */
.cl-user-role {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

    .cl-user-role i {
        font-size: 0.72rem;
        opacity: 0.9;
    }

/* Sección "Administración" dentro del dropdown del avatar */
.cl-user-menu-section {
    padding: 0.15rem 0;
}

.cl-user-menu-header {
    padding: 0.5rem 0.75rem 0.2rem;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cl-text-subtle);
    margin: 0;
}