If:
1) the car ran perfectly before this happened
2) this never happened before
3) You didn't do ANYTHING to the car prior to this happening
4) The car didn't get washed, or rained on, or go through a huge puddle or get peed on by a huge dog, or in any other way get wet
5) The battery is healthy
6) the car didn't hit another car, get hit by another car, hit a curb or pothole or take any other large shock load
. . . then I would say this is some relatively simple problem, such as a bad electrical connector. When the engine is idling (bad and low, like you say), get under the hood and give every connector a good wiggle. If nothing changes, get under the driver's dash and wiggle the ECU connector. If that doesn't make any diff (if the motor suddenly speeds up when you wiggle something, then that's the prob), check that the TPS hasn't come loose or gotten wet somehow inside. This is a typical symptom of a wet TPS (throttle position switch). Next, check that your alternator is working. Low voltage would also cause this prob. Next, check — no, remove and clean — your battery terminals, reattach. Try it again.
I suggest these things because again and again and again I read about people buying expensive new parts and putting them in, only to find it doesn't solve their problem. (I've been as guilty of this as anyone else.) My experience is that stuff like fuel pressure regulators and fuel pumps and AFMs don't just "go out," they give plenty of notice over time as they slowly go downhill. Since it sounds like this just happened out of the blue, look for the simple, the obvious the the CHEAP. Then work your way up to the complicated and expensive. Don't worry, more than likely, your Z has many more miles in her. Good luck, and let us know what you find!