.profile-dropdown {
    position: relative;
}

.profile-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.profile-button:hover {
    background-color: var(--zf-primary-light);
}

.profile-avatar-wrap {
    position: relative;
    display: inline-flex;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-presence-dot {
    position: absolute;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--zf-primary, #6D28D9);
    bottom: -1px;
    right: -1px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.profile-initials {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
}

.profile-name {
    font-weight: 500;
    color: #fff;
}

.profile-button i {
    color: #fff;
}

.profile-menu {
    min-width: 250px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.profile-info {
    padding: 0.5rem 0;
}

.profile-info strong {
    font-size: 0.875rem;
}

.profile-info small {
    font-size: 0.75rem;
}

.dropdown-item {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

.dropdown-item i {
    width: 1.25rem;
}

.dropdown-item:hover {
    background-color: var(--zf-primary-light);
    color: var(--zf-primary);
}

.dropdown-item.active {
    background-color: var(--zf-primary-light);
    color: var(--zf-primary);
}

.dropdown-item.text-danger:hover {
    background-color: #fee2e2;
}

/* Context badge */
.context-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.context-badge--tenant {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.context-badge--employee {
    background-color: #dcfce7;
    color: #15803d;
}

.context-badge--platform {
    background-color: #f3e8ff;
    color: #7c3aed;
}

/* Context group headers */
.context-group-header {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
    padding-top: 0.5rem;
    padding-bottom: 0.25rem;
}

/* Dark mode */
html[data-theme="dark"] .profile-button:hover {
    background-color: var(--zf-primary-light);
}

html[data-theme="dark"] .profile-name {
    color: #E6EDF3;
}

html[data-theme="dark"] .profile-menu {
    background: #161B22;
    border-color: #30363D;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .dropdown-item {
    color: #C9D1D9;
}

html[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--zf-primary-light);
    color: var(--zf-primary);
}

html[data-theme="dark"] .dropdown-item.active {
    background-color: var(--zf-primary-light);
    color: var(--zf-primary);
}

html[data-theme="dark"] .dropdown-item.text-danger {
    --bs-danger-rgb: 248, 81, 73;
}

html[data-theme="dark"] .dropdown-item.text-danger:hover {
    background-color: rgba(248, 81, 73, 0.15);
}

html[data-theme="dark"] .profile-menu .dropdown-header {
    color: #E6EDF3;
}

html[data-theme="dark"] .profile-info strong {
    color: #E6EDF3;
}

html[data-theme="dark"] .profile-menu .dropdown-divider {
    border-top-color: #30363D;
}

html[data-theme="dark"] .context-badge--tenant {
    background-color: rgba(59, 130, 246, 0.15);
    color: #93bbfd;
}

html[data-theme="dark"] .context-badge--employee {
    background-color: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

html[data-theme="dark"] .context-badge--platform {
    background-color: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
}

html[data-theme="dark"] .context-group-header {
    color: #6b7280;
}

@media (max-width: 768px) {
    .profile-name {
        display: none !important;
    }
}
