Senate Republicans managed to shove their version of the tax bill out the door last week. But if you thought that frenzy of late-night dealmaking would give way to a moment of calm in American governance, I have bad news: Congress and President Trump now have four days to avert a government shutdown.

At issue is legislation authorizing federal spending for the next fiscal year. Since any final deal must clear the filibuster in the Senate, Republicans will need at least eight Democrats to sign on. And current authorizations run out by the end of Friday. If the two parties can't reach an accord by then, the federal government will go dark.

What's standing in the way of agreement? A few things.

First off are spending limits. Back in 2011, another budget showdown between congressional Republicans and then-President Obama resulted in a deal that placed certain caps on government spending going forward. No one really likes them, and defense hawks in the GOP would like to raise the limit on military spending. But if that happens, Democrats want to make sure nondefense spending gets an equivalent boost.

Another problem is the Children's Health Insurance Program (CHIP). It's broadly popular and provides health coverage for about nine million low-income children. CHIP's funding expired in October, and Republicans haven't gotten around to ponying up the money to keep it going. Fortunately, the states haven't run out of money yet. But their wiggle room is rapidly running out.

The House GOP is working on at least a short-term fix, but not everyone in the party is happy about it. Sen. Orrin Hatch (R-Utah) recently griped that it's hard to find money for CHIP when the U.S. also spends "billions and billions and trillions of dollars" on other programs "to help people who won't help themselves." CHIP costs $14 billion a year to fund, and the tax bill Hatch just voted for would add at least a trillion dollars in new deficit spending over the next decade, but who's counting?

But the real stumbling block looks like it will be immigration.

Back in 2012, President Obama started the Deferred Action for Childhood Arrivals (DACA) program, which protected about 800,000 children of unauthorized immigrants from deportation, and allowed them to work legally in the country. Congress originally tried to do this legislatively through the 2010 DREAM Act, but it failed. So Obama stepped in, using the executive branch's discretion on how to prioritize immigration law enforcement instead.

However, that also meant the DACA program lived or died depending on the occupant of the White House. President Trump decided in September to cancel it, and the program will officially end in March 2018.

Democrats are insisting that Congress finally figure out a permanent legislative fix for "DREAMers" — the people the DREAM Act would've helped — in exchange for their votes to authorize federal spending for the new fiscal year.

They also have some help from the other party: Politico reports that over two dozen moderate Republicans in the House are pushing for a DACA fix as well. And Sen. Jeff Flake (R-Ariz.) claims he got promises from GOP leadership and the White House to restore protections for DREAMers in exchange for his vote on the tax bill.

Publicly, though, Republicans do not sound happy about this. "There's not going to be a government shutdown. It's just not going to happen," Senate Majority Leader Mitch McConnell (R-Ky.) told ABC. "I don't think that Democrats would be very smart to say they want to shut down the government over a non-emergency that we can address anytime between now and March. That's a very untenable position."

Now, besides those three big issues, there's another looming complication: Donald J. Trump.

Possibly the strangest reason to think a spending deal might fall through is the fact that President Trump reportedly thinks a government shutdown would actually be good for him politically. He fears a previous deal he did with Democratic leadership left him looking weak, and that he needs to take a hard line on immigration to stay in the good graces of his base.

What's really bizarre is Trump sounds confident he can blame a shutdown on the Democrats. But the history of public opinion suggests that when things go wrong, voters default to holding the party in the White House responsible.

Government shutdowns aren't the end of the world, but they're massive headaches for everyone and don't do the economy any favors. Big mandatory programs like Medicare and Social Security and other key parts of the welfare state keep going, and lots of government services designated as "essential" don't stop. But lots of other stuff — from various government agencies to national parks to museums — get shuttered, and plenty of government workers are either furloughed or laid off. The last government shutdown lasted 17 days in 2013, and it did not go over well with the public.

So far, everyone sounds confident they'll strike a deal in time. It's just not clear what the route to agreement looks like right now. And even if lawmakers can do a deal, they'll likely just extend federal funding for another two weeks, and buy themselves time to negotiate a more permanent solution.

No one wants a shutdown. But no one wants to get rolled, either. They've only got four days to make up their minds, and the president doesn't have a clue about what he's doing.

So everybody better settle in for another nail-biter.