So, how is the Salary Cap calculated during the offseason, when team rosters can total up to a maximum of 90 players?

Obviously, it would be impossible for teams to fit all 90 players under the Salary Cap, so the CBA contains provisions that limit the Salary Cap calculation to the highest 51 Salary Cap numbers on the team and all signing (and option) bonus prorations and all rosters bonuses.  This rule – the Rule of 51 – is in effect from the beginning of the league year in March until the first game of the regular season.