.modern-navbar {
    min-height: 64px;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9) !important;
}

.modern-navbar-title {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.modern-navbar-title .small-label {
    font-size: 11px;
    color: #8a94a6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.modern-navbar-title .current-title {
    font-size: 15px;
    color: #1f2937;
    font-weight: 700;
}

.modern-user-toggle {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 999px;
    text-decoration: none !important;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    transition: all .2s ease;
}

.modern-user-toggle:hover,
.modern-user-toggle:focus {
    background: #eef4ff;
    border-color: #d7e5ff;
    box-shadow: 0 8px 20px rgba(21, 114, 232, 0.12);
}

.modern-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 3px;
    background: #ffffff;
    border: 2px solid #e7efff;
    object-fit: contain;
}

.modern-profile-summary {
    flex-direction: column;
    line-height: 1.1;
    max-width: 180px;
}

.modern-profile-summary .profile-greeting {
    font-size: 11px;
    color: #8a94a6;
    font-weight: 600;
}

.modern-profile-summary .profile-name {
    font-size: 13px;
    color: #111827;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modern-chevron {
    font-size: 10px;
    color: #8a94a6;
}

.modern-user-menu {
    width: 310px;
    padding: 0;
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.modern-user-card {
    padding: 18px;
    background: linear-gradient(135deg, #1572e8, #2f5bea);
    color: #ffffff;
}

.modern-user-card-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.modern-user-card img {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: #ffffff;
    padding: 6px;
    object-fit: contain;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .12);
}

.modern-user-card h6 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
}

.modern-user-card p {
    margin: 4px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, .84);
    word-break: break-word;
}

.modern-menu-body {
    padding: 10px;
    background: #ffffff;
}

.modern-menu-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 11px 12px !important;
    border-radius: 12px;
    color: #334155 !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all .2s ease;
}

.modern-menu-item:hover {
    background: #f1f5f9;
    color: #1572e8 !important;
}

.modern-menu-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.modern-menu-item.logout {
    color: #dc2626 !important;
}

.modern-menu-item.logout:hover {
    background: #fff1f2;
    color: #b91c1c !important;
}

.modern-logout-modal .modal-content {
    border: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}

.modern-logout-modal .modal-header {
    border-bottom: 0;
    background: #f8fafc;
}

.modern-logout-modal .modal-footer {
    border-top: 0;
}

@media (max-width: 575.98px) {
    .modern-navbar {
        min-height: 58px;
    }

    .modern-user-toggle {
        padding: 5px;
        gap: 0;
        background: transparent;
        border-color: transparent;
    }

    .modern-avatar {
        width: 36px;
        height: 36px;
    }

    .modern-user-menu {
        width: calc(100vw - 24px);
        margin-right: 12px;
    }

    .modern-user-card {
        padding: 16px;
    }

    .modern-user-card img {
        width: 58px;
        height: 58px;
    }
}

/* =========================================================
   AVATAR PEQUEÑO DEL NAVBAR
========================================================= */

.modern-user-toggle {
    height: 52px;
    overflow: visible !important;
}

.profile-avatar-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible !important;
}

.profile-avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff7d6, #e8f8d9);
    border: 2px solid #d8ecb6;
    box-shadow: 0 6px 16px rgba(32, 148, 72, 0.18);
}

.profile-avatar-img {
    position: absolute;
    width: 62px;
    height: 62px;
    max-width: none;
    object-fit: contain;
    left: 50%;
    top: -13px;
    transform: translateX(-50%);
    transform-origin: center bottom;
    z-index: 5;
    pointer-events: none;
    filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.18));
    animation: profileAvatarFloat 3.2s ease-in-out infinite;
}

.modern-user-toggle:hover .profile-avatar-img {
    animation: profileAvatarBounce 0.65s ease;
}

.modern-user-toggle:active .profile-avatar-img {
    animation: profileAvatarReact 0.35s ease;
}


/* =========================================================
   AVATAR GRANDE DEL DROPDOWN
========================================================= */

.modern-user-menu {
    overflow: visible !important;
}

.modern-user-card {
    overflow: visible !important;
    padding-top: 24px;
    padding-bottom: 18px;
}

.modern-user-card-content {
    overflow: visible !important;
}

.dropdown-profile-avatar {
    position: relative;
    width: 72px;
    height: 72px;
    min-width: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible !important;
}

.dropdown-profile-avatar-bg {
    position: absolute;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff7d6, #e8f8d9);
    border: 3px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    z-index: 1;
}

.modern-user-card .dropdown-profile-avatar-img {
    position: absolute !important;
    width: 92px !important;
    height: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
    min-height: 92px !important;
    max-height: 92px !important;
    object-fit: contain !important;
    left: 50% !important;
    top: -18px !important;
    transform: translateX(-50%);
    transform-origin: center bottom;
    z-index: 2;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    pointer-events: none;
    filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.18));
    animation: dropdownAvatarFloat 3.4s ease-in-out infinite;
}

.modern-user-card:hover .dropdown-profile-avatar-img {
    animation: dropdownAvatarBounce 0.65s ease;
}

.modern-user-card:active .dropdown-profile-avatar-img {
    animation: dropdownAvatarReact 0.35s ease;
}


/* =========================================================
   PERMITIR QUE LOS AVATARES SOBRESALGAN
========================================================= */

.topbar-user,
.topbar-nav,
.navbar-nav,
.navbar-header,
.main-header,
.main-panel,
.modern-user-card,
.modern-user-card-content {
    overflow: visible !important;
}


/* =========================================================
   ANIMACIONES
========================================================= */

@keyframes profileAvatarFloat {
    0% {
        transform: translateX(-50%) translateY(0) rotate(0deg);
    }

    25% {
        transform: translateX(-50%) translateY(-3px) rotate(-2deg);
    }

    50% {
        transform: translateX(-50%) translateY(0) rotate(0deg);
    }

    75% {
        transform: translateX(-50%) translateY(-2px) rotate(2deg);
    }

    100% {
        transform: translateX(-50%) translateY(0) rotate(0deg);
    }
}

@keyframes profileAvatarBounce {
    0% {
        transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
    }

    35% {
        transform: translateX(-50%) translateY(-8px) scale(1.08) rotate(-5deg);
    }

    70% {
        transform: translateX(-50%) translateY(1px) scale(0.98) rotate(3deg);
    }

    100% {
        transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
    }
}

@keyframes profileAvatarReact {
    0% {
        transform: translateX(-50%) scale(1) rotate(0deg);
    }

    50% {
        transform: translateX(-50%) scale(1.12) rotate(-6deg);
    }

    100% {
        transform: translateX(-50%) scale(1) rotate(0deg);
    }
}

@keyframes dropdownAvatarFloat {
    0% {
        transform: translateX(-50%) translateY(0) rotate(0deg);
    }

    25% {
        transform: translateX(-50%) translateY(-4px) rotate(-2deg);
    }

    50% {
        transform: translateX(-50%) translateY(0) rotate(0deg);
    }

    75% {
        transform: translateX(-50%) translateY(-3px) rotate(2deg);
    }

    100% {
        transform: translateX(-50%) translateY(0) rotate(0deg);
    }
}

@keyframes dropdownAvatarBounce {
    0% {
        transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
    }

    35% {
        transform: translateX(-50%) translateY(-9px) scale(1.1) rotate(-5deg);
    }

    70% {
        transform: translateX(-50%) translateY(2px) scale(0.98) rotate(4deg);
    }

    100% {
        transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
    }
}

@keyframes dropdownAvatarReact {
    0% {
        transform: translateX(-50%) scale(1) rotate(0deg);
    }

    50% {
        transform: translateX(-50%) scale(1.13) rotate(-7deg);
    }

    100% {
        transform: translateX(-50%) scale(1) rotate(0deg);
    }
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 575.98px) {
    .profile-avatar-wrapper {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }

    .profile-avatar-circle {
        width: 40px;
        height: 40px;
    }

    .profile-avatar-img {
        width: 58px;
        height: 58px;
        top: -12px;
    }

    .dropdown-profile-avatar {
        width: 64px;
        height: 64px;
        min-width: 64px;
    }

    .dropdown-profile-avatar-bg {
        width: 58px;
        height: 58px;
    }

    .modern-user-card .dropdown-profile-avatar-img {
        width: 82px !important;
        height: 82px !important;
        min-width: 82px !important;
        max-width: 82px !important;
        min-height: 82px !important;
        max-height: 82px !important;
        top: -16px !important;
    }
}