Watch turnover days, not unit counts

"How many units left" is static; "how many days it can sell" is a business signal. Once turnover days exceed the credit period you can absorb, stop ordering.

Build slack into replenishment

Write the replenishment cycle down: days from order to inbound, days to sell a batch. When those two line up, you avoid both stockouts and dead stock.