.sidebar-user-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px;
    align-items: center;
    gap: 12px;
}

.sidebar-user-copy {
    min-width: 0;
    overflow: visible;
    white-space: normal;
}

#private-view .sidebar-user-copy .sidebar-name,
#private-view .sidebar-user-copy .sidebar-role {
    max-width: 100%;
    white-space: normal;
}

#private-view .sidebar-user-copy .sidebar-name {
    font-size: 18px;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

#private-view .sidebar-user-copy .sidebar-role {
    line-height: 1.35;
    overflow-wrap: anywhere;
}

#private-view .staff-avatar-button {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    border: 2px solid rgba(226, 35, 42, 0.75);
    border-radius: 50%;
    background: #242424;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

#private-view .staff-avatar-button:hover,
#private-view .staff-avatar-button:focus-visible {
    border-color: #ff3940;
    outline: 3px solid rgba(226, 35, 42, 0.25);
    outline-offset: 2px;
}

.staff-avatar-button img,
.staff-avatar-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.staff-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    background: linear-gradient(145deg, #2f2f2f, #171717);
}

#staff-avatar-modal .staff-avatar-modal-panel {
    width: min(720px, calc(100vw - 32px)) !important;
    max-height: min(820px, calc(100dvh - 40px));
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box;
    color: #fff;
    background: #171717 !important;
}

.staff-avatar-modal-panel h2,
.staff-avatar-modal-panel .modal-subtitle {
    color: #fff !important;
}

.staff-avatar-modal-panel .modal-subtitle {
    color: #bdbdbd !important;
}

.staff-avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 24px 0;
}

.staff-avatar-option {
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.staff-avatar-option img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    object-fit: cover;
    clip-path: circle(50% at 50% 50%);
    transform: scale(1.14);
    transform-origin: center;
}

.staff-avatar-option:hover,
.staff-avatar-option:focus-visible {
    transform: translateY(-2px);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55);
}

.staff-avatar-option.is-selected {
    box-shadow:
        0 0 0 3px #e2232a,
        0 0 0 6px rgba(226, 35, 42, 0.2);
}

.staff-avatar-option.is-selected:hover,
.staff-avatar-option.is-selected:focus-visible {
    box-shadow:
        0 0 0 3px #ff3940,
        0 0 0 6px rgba(226, 35, 42, 0.25);
}

.staff-avatar-check {
    position: absolute;
    right: 7%;
    bottom: 7%;
    width: 28px;
    height: 28px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #e2232a;
    color: #fff;
    font-size: 0.75rem;
}

.staff-avatar-option.is-selected .staff-avatar-check {
    display: flex;
}

.staff-avatar-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

@media (max-width: 600px) {
    #staff-avatar-modal .staff-avatar-modal-panel {
        width: calc(100vw - 20px) !important;
        max-height: calc(100dvh - 20px);
        padding: 58px 16px 20px !important;
    }

    .staff-avatar-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .staff-avatar-check {
        width: 24px;
        height: 24px;
        right: 4%;
        bottom: 4%;
    }

    .staff-avatar-actions {
        position: sticky;
        bottom: 0;
        flex-direction: column-reverse;
        padding-top: 12px;
        padding-bottom: max(4px, env(safe-area-inset-bottom));
        background: linear-gradient(180deg, rgba(23, 23, 23, 0), #171717 22%);
    }

    .staff-avatar-actions button {
        width: 100%;
        min-height: 48px;
    }
}
