.sidebar-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 12px;
    margin-bottom: 6px;
    min-width: 0;
    flex-shrink: 0;
}

.sidebar-header-profile {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
    flex: 1 1 0;
    overflow: visible;
}

.sidebar-header-profile-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.sidebar-avatar-trigger {
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
    line-height: 0;
    display: block;
}

.sidebar-avatar-trigger:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.sidebar-header-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    object-fit: contain;
    object-position: center;
    background: rgba(0, 0, 0, 0.15);
    display: block;
}

.sidebar-header-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: visible;
    align-items: flex-start;
}

.sidebar-header-info-link {
    text-decoration: none;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
    transition: background 0.15s;
}

.sidebar-header-info-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-header-info-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.sidebar-header-greeting {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-header-name-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.sidebar-header-name {
    font-size: 14px;
    color: white;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-verified-badge {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-header-userid {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 400;
    margin: 0;
    padding: 0;
    max-width: 100%;
    white-space: normal;
    word-break: break-all;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.sidebar-header-icons {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Topo quando a sidebar está recolhida: avatar, sino, engrenagem (nessa ordem) */
.sidebar-header-icons-only {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    margin-bottom: 4px;
    min-width: 0;
    flex-shrink: 0;
}

.sidebar-header-icons-only .sidebar-header-img-narrow {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.sidebar-header-icon {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 14px;
}

.sidebar-header-icon:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-header-icon-bell {
    position: relative;
}

.sidebar-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #fff;
    color: #5B8BB5;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Mobile: header mais compacto para o drawer caber na altura sem cortar o footer */
@media (max-width: 768px) {
    .sidebar-header {
        gap: 6px;
        padding: 8px 10px;
        margin-bottom: 4px;
    }

    .sidebar-header-img {
        width: 34px;
        height: 34px;
    }

    .sidebar-header-greeting {
        font-size: 11px;
    }

    .sidebar-header-name {
        font-size: 13px;
    }

    .sidebar-header-icons {
        gap: 4px;
    }

    .sidebar-header-icons-only {
        gap: 4px;
        padding: 8px 0;
        margin-bottom: 2px;
    }

    .sidebar-header-icons-only .sidebar-header-img-narrow {
        width: 32px;
        height: 32px;
    }

    .sidebar-header-icon {
        width: 26px;
        height: 26px;
        border-radius: 6px;
        font-size: 12px;
    }

    .sidebar-badge {
        min-width: 14px;
        height: 14px;
        padding: 0 3px;
        font-size: 9px;
        top: -2px;
        right: -2px;
    }
}

/* Telas altas (ex.: 1440p): header e ícones mais confortáveis */
@media (min-height: 1100px) {
    .sidebar-header {
        gap: 10px;
        padding: 16px 14px;
        margin-bottom: 8px;
    }

    .sidebar-header-img {
        width: 48px;
        height: 48px;
    }

    .sidebar-header-greeting {
        font-size: 13px;
    }

    .sidebar-header-name {
        font-size: 14px;
    }

    .sidebar-header-icons {
        gap: 8px;
    }

    .sidebar-header-icons-only {
        gap: 8px;
        padding: 14px 0;
        margin-bottom: 6px;
    }

    .sidebar-header-icons-only .sidebar-header-img-narrow {
        width: 46px;
        height: 46px;
    }

    .sidebar-header-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        font-size: 16px;
    }

    .sidebar-badge {
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        font-size: 11px;
        top: -4px;
        right: -4px;
    }
}
