agreed, a cat D isn't so bad, i'm pretty sure keying three panels will write a car off in some cases. get damage report, find out exactly why its a Cat D, find out which garage did the repair work, before and after pics, and get someone to inspect the car before you buy.
Just be aware if its a cat D you'll be buying cheap and selling cheap, but if you don't ever plan on selling, you could be on to a good deal.