:root {
    --brand: #ffde00;
    --brand-dark: #0a0f1c;
    --muted: #9ca3af;
}

.nav-profile {
    position: relative;
}

.nav-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    cursor: pointer;
    font: inherit;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.nav-profile-btn:hover,
.nav-profile.is-open .nav-profile-btn {
    border-color: rgba(255, 222, 0, 0.35);
    background: rgba(255, 222, 0, 0.08);
}

.nav-profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--brand-dark);
    font-size: 0.78rem;
    font-weight: 800;
    flex-shrink: 0;
}

.nav-profile-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
    text-align: left;
}

.nav-profile-name {
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.1;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-profile-role {
    font-size: 0.68rem;
    color: var(--muted);
    line-height: 1.1;
}

.nav-profile-chevron {
    width: 16px;
    height: 16px;
    color: var(--muted);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-profile.is-open .nav-profile-chevron {
    transform: rotate(180deg);
}

.nav-profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 15, 28, 0.98);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 60;
}

.nav-profile.is-open .nav-profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-profile-meta {
    padding: 10px 12px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 6px;
}

.nav-profile-meta strong {
    display: block;
    font-size: 0.92rem;
    color: #fff;
    margin-bottom: 2px;
}

.nav-profile-meta span {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    word-break: break-all;
}

.nav-profile-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-profile-menu a svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-profile-menu a:hover {
    background: rgba(255, 222, 0, 0.1);
    color: var(--brand);
    text-decoration: none;
}

.nav-profile-menu a[hidden] {
    display: none !important;
}

.nav-profile-logout {
    color: #fca5a5 !important;
}

.nav-profile-logout:hover {
    background: rgba(248, 113, 113, 0.12) !important;
    color: #fecaca !important;
}

.nav-profile-mobile {
    width: 100%;
}

.nav-profile-mobile .nav-profile-btn {
    width: 100%;
    justify-content: flex-start;
    border-radius: 14px;
    padding: 10px 12px;
}

.nav-profile-mobile .nav-profile-name {
    max-width: none;
}

.nav-profile-mobile .nav-profile-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 8px;
    display: none;
}

.nav-profile-mobile.is-open .nav-profile-menu {
    display: block;
}

@media (max-width: 767px) {
    .nav-profile-label {
        display: none;
    }

    .nav-profile:not(.nav-profile-mobile) .nav-profile-btn {
        padding: 4px;
        border-radius: 50%;
    }
}

[data-nav-auth-guest][hidden],
[data-nav-profile][hidden] {
    display: none !important;
}
