Gross margin includes cost directly related to the sales of an item; labor, logistics, BOM.
It does not include rent, aministrative cost, R&D, etc. These are subtracted for net profit. Its hard to quantify these in to the item. So they are subtracted from gross profit at the end of the month/quarter/year.