What happens when good girls go bad? That’s the question at the root of Jenna Bans’ new NBC drama “Good Girls,” which finds three friends — played by Retta, Mae Whitman and Christina Hendricks — pushed to their limits by extraordinary situations. Each of their own reasons, they end up robbing a grocery store — and yet manage to stay sympathetic to viewers.

A graduate of Shondaland, with credits on “Grey’s Anatomy” and “Scandal,” among others, Bans says she’s learned not be afraid to take risks on screen. Here, she tells Variety how the election fueled her to write the show, how she strikes the right done for the dark comedy, and what Shonda Rhimes taught her about making compelling TV.

How did you come up with the idea for the show?

It was in the heights of the election late last summer. I think the “Access Hollywood” tape had just come out and there were a ton of rallies [with people shouting] “Lock her up.” Our collective view of women was just in the ether. I was talking to my mom, and I said, “I can’t just believe the sexism is so overt.” And my mom, who’s a matter of fact lawyer from Minnesota — there was  a very long pause. She was like, “Where have you been?” That just got me thinking. I owed NBC a pilot, and I wanted to write something escapist and fun and chockfull of wish fulfillment and something that made my mom feel better about her life. It was a love letter to my mother, who was really depressed and down about the way the election was going.

Every day I would spend an hour reading the news, because every day it was something crazier and crazier coming out. And then I would start writing. So I feel like somehow the election fueled me — the heightened view of women. I remember watching this news show where the scroll at the bottom was, “Are women fit to be commander in chief?” That’s the news scroll! It was just bonkers to me that we were having that discussion but then at the same time, I realized how naive I had been to think that that wasn’t a discussion anymore. I’m waking up at 42 and realizing that the discussion needs to be had. So the show is kind of a huge wakeup call for me too, and it’s been really fun to explore that.

How does all of that filter into these three very interesting female characters?

I remember my mom said something about the Hillary loss like, “It was just our time.” I started thinking about this idea that you spend your entire life following the rules and doing everything right and being a good person. And you have this expectation that life should work out for you and if it doesn’t, what do you do then? That’s what made me start thinking about the characters as these rule followers to these different varying extents that are suddenly realizing that life has not turned out the way they planned, and they’re in terrible desperate financial situations and driven to do something super bonkers because of it. That they rob a grocery store in the pilot changes the trajectory of their lives and seemed like a fun starting off point for a show.

How did NBC respond when you pitched the show? 

When we pitched the show to NBC, it was all female executives: Jen Salke, Pearlena Igbokwe. I’ve never had an easier pitch. I think I got three sentences in before Jen Salke screamed, “We have to do this.” It was the easiest time I’ve ever had. They just really got it right away, and they were really excited to do the show.

How did you find the right tone? It’s a comedy, but it gets dark.

It is a hard thing to nail. I’m not a good joke writer at all. My husband [Justin Spitzer], who created “Superstore,” he’s a great joke writer. But what always strikes me as funny is the absurdity of real people in really absurd situations. So I thought if I could put them make these characters as grounded and real and interesting as possible and just throw them into these heightened situations, they’ll do the rest. We do an episode where the Mae Whitman character has loaded her Bluetooth music onto a stolen car and they’re like, “Well, now you can’t get it off — you can never get those things off.” And then it gets very heightened from there, but it starts off in a real place. It’s also something you figure out as you go along. You throw something at the wall and hope it works and then you course adjust as you continue.

What made them right for their parts?

I think I pitched this show to that room of female executives with a picture of Retta. I have been a fan for the longest time ever and wanted to see her do drama, and she’s one of the best dramatic actresses I’ve ever worked with. I think she’s going to blow everybody away. Christina — I was a huge fan of hers from “Mad Men” — and thought she was so funny. [Ed note: Hendricks replaced Kathleen Rose Perkins, who played the role in the pilot.] As Joan, some of her zingers were so hilarious but they always came from a real character place. And Mae Whitman — who doesn’t love TV’s Mae Whitman, from everything awesome she’s ever been in.

So  the casting process was weirdly pretty easy. They just embodied these characters and then it was just course-correcting in terms of tone. Once you see them together, you start to write towards their strengths. You see a lot more scenes as the season goes on of them just bantering and having fun with each other because they’re really good friends in real life and the chemistry just jumps off the screen. They feel like they’ve been friends forever. But it’s not people you’ve ever seen together.

How much do you let them improv?

A lot. If they can come up with something better, I am all for it. They just always get it generally as written. But then they you know they feel really free I think to explore and improv. There’s very few improvs I feel like that we’ve cut. I remember Retta did this hilarious thing in the pilot that was not scripted. Christina Hendricks has just found out her husband’s been cheating on her. Retta walks in and she’s like, “I got Bugles!” I think the line [as scripted] was like, “‘The Bachelorette’s’ on! What are you guys doing?” And she walked in and acted like they had a sale on caramel Bugles at Kroger’s and she got the last bag. It felt so real and instantly told you that this was a routine they did — ate Bugles while watching “The Bachelorette.”

What kind of notes or directions did you get from NBC on the show?

In the original pilot, we killed David Hornsby [Annie’s boss, Boomer] in the very last scene. Yeah, he was unequivocally dead. Dead as a doornail. In the new pilot, we decided to leave it open because David Hornsby is so brilliant. I think it was a note from Jen Salke who really felt like that was a step too far to make them just out-and-out murderers, and I think she was right. So now you don’t know whether he’s dead or alive, but we pulled back on having him killed. I think that Beth used to smash his head with the ceramic top of the toilet — which was maybe a little far. Maybe I was a little too angry when I wrote that. I had to be pulled back a little bit.

How far can you push the women? Is anything off-limits?

What we realized this season which I didn’t know with the pilot is that they are not Walter White from “Breaking Bad” — which was a genius show and I loved it — but it didn’t take that much for him to become not a good person, I think. I think these women are good people and they have strong moral centers and they are still mothers and taking care of their family and lives. And so I think the conflict in the show for us comes from them struggling to still be good people while they are in these heightened situations and they’ve broken the law and gotten themselves in some hot water. So we’re testing that. I think by the end of the first season we’ve taken them further than they were in the pilot in terms of doing things they never thought they would do.

But at the same time we don’t want them to lose their moral centers, and the [characters] even talk about that by the finale: “How far are we going to go here? Once we cross this line there’s no going back.” We talk about that a lot in the writers room and it ends up on the screen, too, in terms of the characters talking about it — like, you can rob a grocery store and still be a good person in their minds. But can you rob 10 grocery stores and still be a good person? And we get a lot of comedy out of it, too.

How did you strike the balance of not making the guys into punching bags?

The greatest marriage on the show is obviously Retta’s, for the Ruby character. He’s kind of the ideal husband. Which obviously makes her question what she’s gotten herself into in terms of lying to him. He’s becoming a cop on the show. And she really feels bad about that and that’s something she’ll sort of struggle with. The Dean character played by Matt Lillard grows a lot during the first season. I think he realizes right away his f–k up as a lot of men do. He screwed his much younger secretary. And Christina Hendricks finds out about it. And I think he really does an abrupt turnaround to try to win her back and become a better person. He does it through some questionable moves but I think you’ll see he’s less of a punching bag and a little more multi-dimensional. And then what I love about the Greg and Annie relationship — played by Mae Whitman and Zach Gilford — is that they have this kid together. They had the Sadie character at 17. They didn’t know what they were doing. They’re in very different situations now — Zach’s character is essentially a kept husband. He is married to a rich slightly older woman. And he and Annie have very different ideas for raising their daughter. But I think he comes at it from wanting the best for his daughter. So I think while they’re a little punching bag, a little more villainous in the pilot, we sort of move away from that pretty fast.

How much do you and your husband trade notes?

All of the time! It’s the best thing about being married to a writer. But we really need to set a limit how much we talk shop because we’re both doing shows this year. As you can imagine, it takes up a lot of dinner table conversation when we’re home for dinner. But yeah, we run storylines past each other. We actually have a Cloud 9 appearance later in the season. The women end up robbing — well, it’s not exactly robbing but end up using Cloud 9 as a way to get what they want. We don’t really talk about it — it’s just kind of there. I don’t know if there will be much crossover audience, but if there is, they’re in for a treat because Cloud 9 has a pretty strong presence. We built Cloud 9 [on our set] in Atlanta and Retta, who’s close with [“Superstore” stars] America Ferrera and Ben Feldman sent them a picture of herself in Cloud 9. They were like, “What’s going on? Where are you? What set are you on?” I don’t think Justin ever told them. So they were just completely shocked by it.

As a graduate of Shondaland, what did you learn from that experience that you’re bringing to the show?

I just think what’s so great about Shonda is just never shying away from telling the boldest, most controversial stories. I can’t tell you how many times I’ve been in the writers room with her — whether it ended up successful or not, she pitched something that was so unexpected and so surprising that 90 percent of the writers in the room, myself included, would go, “Whoa, that’s too far. We can’t do that, that’s too far!” And she would just be unafraid of telling the most interesting story whether or not it ruffled people’s feathers because they felt they were attached to a certain character acting a certain way. She would just go for it. So in the simplest terms the thing I’m taking most from her is just to be unafraid of telling bold stories and grabbing people’s attention. It’s fearless storytelling, and she’s the queen of it.