When President Obama took office, two-thirds of his top aides were men. Women complained of having to elbow their way into important meetings. And when they got in, their voices were sometimes ignored.

So female staffers adopted a meeting strategy they called “amplification”: When a woman made a key point, other women would repeat it, giving credit to its author. This forced the men in the room to recognize the contribution – and denied them the chance to claim the idea as their own.

“We just started doing it, and made a purpose of doing it. It was an everyday thing,” said one former Obama aide who requested anonymity to speak frankly. Obama noticed, she said, and began calling more often on women and junior aides.

For decades, women have struggled to crack the code of power in the White House, where grueling hours, hyper-aggressive colleagues and lack of access to the boss have proven challenging to women from both parties. The West Wing is also home to the ultimate glass ceiling: Men have had a lock on the Oval Office for more than 200 years.

That could change if Democrat Hillary Clinton prevails in November. Not only would she break a gender barrier by winning the presidency, she also could bring in a female chief of staff – another first in the White House – like she did as first lady, as a senator and as Obama’s secretary of state.

SECOND-TERM STRIDES

During Obama’s second term, women gained parity with men in the president’s inner circle; Clinton has actually had women outnumber men at times among her senior staff.

Despite his barbs directed against women, Republican Party nominee Donald Trump has installed some female managers while working in the male-dominated construction industry, and has at least three women playing senior roles in his campaign.

The White House is unlike any workplace in America. Power is defined by proximity to a single individual: the president. Being “in the room” – whether it’s the Oval Office or the 7:30 a.m. senior staff meeting where the chief of staff hashes out the administration’s top priorities – is crucial to exerting influence.

And the job is a constant race against the clock: Presidents have as few as four years to pursue an agenda and cement a legacy. Burnout is endemic, and top White House aides typically leave after less than three years.

“Given the short period you are in the White House, you leverage every minute to ensure that you can be there, fully committed and totally present,” said Juleanna Glover, who served as press secretary to Vice President Dick Cheney during President George W. Bush’s first term.

Women often struggle just to get a foot in the door. Presidents typically select their most senior advisers from the male-dominated ranks of their campaigns. As late as the Eisenhower administration, the only women working in the West Wing were secretaries – and they were barred from dining with men in the White House mess.

“Regardless of the weather, we had to slog out to any hole-in-the-wall we could find,” recalled Patty Herman, who worked there until she met and married the White House correspondent for CBS. “Now, I understand, that’s changed.”

Once your foot is in the door, you have to get a seat at the table. Anne Wexler, who served as Jimmy Carter’s assistant for public outreach, complained that chief of staff Hamilton Jordan never invited her to a key daily meeting where aides offered ideas to the president, even though Jordan publicly described Wexler as “the most competent woman in Democratic politics.”

“Personally, I never spent a great deal of time with the president,” Wexler said in a 1980 interview for Carter’s presidential library. “I think that was a mistake on Carter’s part.”

Bonnie Newman got a job in the Reagan administration in 1981 after playing squash with Helene von Damm, who had acted as Ronald Reagan’s personal secretary since the 1960s. Although von Damm had “access and proximity” to the president, Newman recalled, “There weren’t a whole lot of other women” in the West Wing: “So when you looked around, you looked a little out of place.”

Under Bill Clinton, several women gained greater influence, including the first lady, who spearheaded Clinton’s signature health-care reform initiative. But Hillary Clinton retreated to a more traditional role after the initiative floundered. And Bill Clinton’s affair with intern Monica Lewinsky served to undermine his claims of gender progress.

‘A TOUGH CIRCLE TO BREAK INTO’

In the early days of the Obama administration, the West Wing was a well-documented bastion of testosterone, due largely to the dominating roles of men such as chief of staff Rahm Emanuel, now mayor of Chicago, and former economics adviser Lawrence H. Summers. At a dinner in November 2009, several senior female aides complained to the president that men enjoyed greater access and often muscled them out of key policy discussions.

“If you didn’t come in from the campaign, it was a tough circle to break into,” said Anita Dunn, who left her post as White House communications director shortly after that meeting. Dunn says it was a matter of simple math: “Given the makeup of the campaign, there were just more men than women.”

The atmosphere has changed considerably in Obama’s second term. Many of the original players have moved on. Today, Obama’s closest aides – the ones who sit in the 7:30 a.m. meeting – are equally divided between men and women. Overall, the average man still earns about 16 percent more than the average woman. But half of all White House departments – from the National Security Council to the Office of Legislative Affairs – are headed by women.

“I think having a critical mass makes a difference,” said White House senior adviser Valerie Jarrett, who came in with the president and remains one of his top aides. “It’s fair to say that there was a lot of testosterone flowing in those early days. Now we have a little more estrogen that provides a counterbalance.”

National Security Adviser Susan E. Rice also has served throughout Obama’s administration. In previous positions, Rice said, she had to push to get into key gatherings. “It’s not pleasant to have to appeal to a man to say, ‘Include me in that meeting,'” she said.

Now, Domestic Policy Council Director Cecilia Muñoz said, “the folks who were jockeying to get into meetings or struggling over manifests are just kind of not around anymore.”