Paul Manafort, a valued customer of the Trump Organization who had spent $3.7 million to buy Apartment 43G in Trump Tower, appeared to be just what Donald Trump wanted in March 2016: A consummate Washington insider, deeply experienced in the byzantine art of wrangling convention delegates, yet also someone who could claim to be an outsider, a successful entrepreneur with overseas clients.

Manafort’s offer to take on the planning for the Republican convention in Cleveland that summer was almost too good to be true: The legendary Washington political consultant and lobbyist, a man who visibly enjoyed the fruits of his labor, was curiously volunteering to work for free.

The candidate liked what he saw. Manafort was in.

What no one in Trump’s inner circle knew was that just as they were bringing Manafort aboard, the man who would manage the campaign through the vital transition from the primaries to the convention and beyond was scrambling to save his own business.

Manafort managed to get through his six months at the pinnacle of the Trump campaign without letting on that his consulting business was tanking and that he was making moves that would lead inexorably to the federal trial now underway in Alexandria, Va. — an ordeal that could end with Manafort spending the rest of his life in prison.

From March to August of the election year, there was no sign, according to Trump campaign insiders, that Manafort was in crisis.

“Nothing, zero, zip, nada,” said Michael Caputo, a longtime friend of Manafort’s who also worked on the campaign that spring. “Paul Manafort is the iceman. He finds stress nourishing. He’s not just calm in the face of stress — it’s something he thrives on.”

But as Manafort’s trial on tax and bank fraud charges enters its home stretch, emails and other documents submitted as evidence show that the man who had taken on the enormous task of turning around a troubled presidential campaign was at the same time carrying out what prosecutors portray as a global fraud scheme.

At the least, the documents make clear that despite the heavy demands of the campaign, Manafort was also busy maneuvering to salvage his own finances, with an eye toward building a new phase of his career.

Manafort knew he was in danger well before he sought the Trump campaign job. His most lucrative client had gone dry: Viktor Yanukovych, the ex-president of Ukraine, was in exile. Manafort’s expenses quickly outpaced his income.

In April 2015, Manafort sent a panicked email to his longtime deputy, Rick Gates, about his tax situation, which included an estimated $500,000 jump in his tax bill. “WTF? How could I be blindsided like this,” he wrote. “You told me you were on top of this.”

In January 2016, Manafort’s bookkeeper, Heather Washkuhn, emailed him to warn that “$120K is urgently needed for your personal bills.” He owed money on property taxes, home improvements, insurance policies, credit cards — let alone more than $1 million in federal taxes.

Around the same time, Manafort was applying for several bank loans in an effort to raise cash to maintain a lifestyle that included multiple homes, nearly $1 million in suits purchased from one Manhattan boutique, and all manner of antiques and home improvements.

He applied to refinance a condo he owned in Manhattan’s SoHo neighborhood, claiming that he used it as a second home rather than as an investment property. In an email on Jan. 26, Manafort told his then-son-in-law that an appraiser was coming to look at the loft: “Remember, he believes you and Jessica [Manafort’s daughter] are living there,” Manafort wrote.

When Manafort wrote to Trump’s friend Tom Barrack on Feb. 29, 2016, to offer his services to the campaign, he presented a rosy picture.

“I have managed presidential campaigns around the world,” he wrote in a memo first reported by the New York Times. “. . . I have avoided the political establishment in Washington since 2005. I will not bring Washington baggage.”

And the cherry on top: “I am not looking for a paid job.”

In retrospect, red flags were flying. “Why did someone who made that kind of money want to come here and work for no money?” asked Barry Bennett, a senior adviser to Trump’s campaign.

Bennett said the campaign should have paused to look into the complications that Manafort’s work for Ukraine might pose. “No one said, ‘Let’s do a little research to see if he’s okay,’ ” Bennett said. “No one did any research at all.”

Trump at that moment was just a few months removed from being little more than a punchline — and a few months away from taking the oath of office as the nation’s 45th president. Even as his unlikely campaign was gathering steam, it was struggling to win over a party establishment that was still largely aligned against him.

Barrack heartily endorsed hiring Manafort, calling him “a killer.” Ivanka Trump printed out Manafort’s email and gave it to her father.

Around the same time Manafort was pressing for the Trump job, he was applying for bank loans. But some bank officers were having trouble with his paperwork. In early February, Citizens Bank informed him that he had failed a liquidity test because of an outstanding debt.

On Feb. 24, a Citizens Bank mortgage sales employee wrote to Gates and Manafort, asking why Manafort’s loan application showed that he owned a Brooklyn townhouse free and clear — and therefore could use it as collateral — when insurance records showed “that there are mortgages listed on these properties.”

Gates testified that Manafort then asked him to get a copy of an older insurance policy to send to the bank, and he did so.

The troubles snowballed. In mid-March, Gates told Manafort they would have trouble getting a loan from Citizens because their firm’s income was “not going to even get close” to their revenue from previous years “because [the firm] at that time has no clients.”

Around the same time, Jessica Manafort texted her sister, Andrea: “Guess who called Dad last night and asked him to run his convention?”

“Trump,” Andrea responded.

The texts are part of a cache of more than 285,000 messages hacked from Andrea Manafort’s phone and deposited on the “dark net” in 2016. Manafort has said some of the messages are authentic but declined to comment on individual notes.

On March 28, Trump confirmed that Manafort was coming aboard. His first assignment was to manage Trump delegates for the convention, a job he had also done for Gerald Ford in 1976 and later for Ronald Reagan and George H.W. Bush.

Less than two weeks later, Manafort emailed his Russian employee Konstantin Kilimnik, who had managed his Kiev office and served as his liaison with Oleg Deripaska, a Russian aluminum magnate with whom he had done business.

“I assume you have shown our friends my media coverage, right?” Manafort asked, referring to the many stories in the news about his influential new job.

“Absolutely,” Kilimnik replied. “Every article.”

“How do we use to get whole?” Manafort asked, according to emails described to The Washington Post last year.

The FBI has assessed that Kilimnik has ties to Russian intelligence, which Kilimnik has denied.

Some Trump campaign officials say they didn’t see it at the time but now believe that Manafort was using his job in Trump Tower in an effort to resuscitate his business. They believed he leaked news of his hiring and then used his campaign job “to position himself to either get more foreign business or hold foreigners at bay,” Bennett said. “He was desperate.”

On April 7, a friend texted Andrea Manafort a link to a story reporting that her father was taking on an “expanded role” in the campaign.

“You’re surprised?? I told you this was the game,” Andrea replied.

On April 13, the company that provided Paul Manafort’s firm with health insurance sent a cut-off notice: “If we do not receive $16,464.22, your . . . coverage will terminate for non-payment effective 5/1/2016. . . . Partial payment cannot be accepted.”

Washkuhn, the bookkeeper, emailed Manafort on April 21 asking for an urgent transfer of funds into the firm’s account so the health insurance could be paid.

That same day, Manafort was at a luxury resort in Hollywood, Fla., leading a closed-door briefing for Republican National Committee members. His mission was to convince them that Trump had been playing a “part” but would now pivot toward a more presidential “persona.”

“He gets it,” Manafort said. “The part that he’s been playing is now evolving into the part that you’ve been expecting.”

Trump, Manafort promised, would tone down his rhetoric and tweet less. “‘You can’t change somebody’s character,” he told the group, “but you can change the way somebody presents himself.”

In the first week of May, as Trump sealed the nomination by winning the Indiana primary, officers at the Banc of California concluded that they “would not feel comfortable” lending Manafort $2 million because “we have little tangible equity support” for such a loan.

On May 7, Kilimnik came to the United States and met with Manafort to discuss their firm’s unpaid bills and other business matters, according to a statement Kilimnik gave The Post last year.

The next day, Manafort went on “Fox News Sunday” to try to calm Republicans who were worried that Trump was dividing their party. “Trump understands this,” Manafort said. “. . . Remember, he ran as an outsider.”

On May 16, Citizens Bank loan officer David Fallarino urged Manafort and Gates to produce documents showing that their firm had more income or else Manafort might not qualify for a loan.

“Understandably you all have 1000 things going on,” the banker wrote. “Just making sure you know the ball is in your court to move the loan forward.”

“I need this done by COB tomorrow,” Manafort emailed Gates at 3 a.m. the next day.

Citizens Bank ultimately denied the loan application after it discovered that Manafort had not disclosed all his debts, which a bank employee called “very unusual.”

But Manafort went on to get $16 million in loans from a banker at Federal Savings Bank who appeared to be interested in a job with Trump, according to testimony at Manafort’s trial Friday.

As his business troubles mounted, Manafort’s campaign job expanded. On June 20, Trump fired campaign manager Corey Lewandowski and made Manafort chairman.

Two weeks later, Manafort wrote Kilimnik, indicating that if Deripaska, the Russian mogul, was interested in “private briefings” about the campaign, “we can accommodate.” A Deripaska spokeswoman has said he was never offered or received such briefings.

On Aug. 19, Trump pushed out Manafort, replacing him with Breitbart News Chairman Stephen K. Bannon.

The move came amid reports that the FBI was working with Ukraine’s anti-corruption agency, which had discovered a “black ledger” showing $12.7 million in alleged payments to Manafort between 2007 and 2012 from Yanukovych’s party, the Party of Regions.

As Manafort’s troubles blossomed, the Trump administration argued that he was never more than an ancillary figure in Trump World. Then-White House press secretary Sean Spicer said last year that Manafort had “played a very limited role for a very limited amount of time.”

Now Manafort, 69, resides in the Alexandria jail.