Still configuring my site and learning about Zen Cart!

I have worked out how to set up and apply product attributes like size, colour etc.
What I can't yet do is link it to stock levels to prevent the ordering of out of stock items.

For example, if I have an item in 3 colours, I may have 5 red, 10 blue and 3 green. This is a total of 18 items.
But if I sell all 3 green, how do I stop a customer ordering another green, because I still have a total of 15 left!

basically I can't see how to set a stock level for each attribute.

Thanks in advance for your help