Costs first, profit last
The build-up starts with the materials grid: each row is a quantity times a unit cost, and the materials total is the sum of those rows. Labor is the hours you estimate for the whole job multiplied by your cost of labor - the wage plus payroll tax and downtime, not the rate you charge customers.
Direct cost is the two added together. Contingency is a percentage of that direct cost, taken before anything else is added, and overhead recovery is a percentage of the cost plus contingency: insurance, vehicles, tools, office and admin time, spread across the jobs that consume them.
Markup applies last, to every cost line above it. With no materials and no labor hours the page stops and asks for at least one of them, because there is nothing to price - and a row left without a description is labeled Item rather than dropping its money quietly.