Make sure you select the option "Sort calendar by position". This will allow you to sort the position of each category manually, by clicking (holding) on its tag and dragging each category to the desired position.
To sort the position of the items within each category, click "open" next to the category. Then repeat the same process, drag and drop, until you obtain the desired order.
Changes will appear instantly in your calendar after refreshing the page.