President Trump’s refugee restrictions dominated days’ worth of news cycles, but it’s only half of his approach to Syria. The other half is designed to keep Syrians from becoming refugees in the first place.

The idea of creating “safe zones” in Syria was high on the agenda Wednesday when Trump spoke on the phone with his Turkish counterpart, Recep Tayyip Erdogan. Turkish sources tell me the two leaders didn’t get into details, but CIA Director Mike Pompeo will visit Turkey on Thursday to try to flesh it out.

Trump vowed back in November to build “a big beautiful safe zone,” where, he said, Syrian refugees will “have whatever it is so people can live, and they’ll be happier.” And in his first week at the White House, he once again promised to “absolutely do safe zones in Syria.”

That’s where Erdogan comes in. He’s long advocated carving out an area in Syria where refugees can feel safe under Turkish protection and stem the tide of migrants into neighboring Turkey and on to continental Europe.

But President Obama shot the idea down. He was wary of any serious American involvement in the Syrian crisis, and, just as importantly, he had soured on Erdogan by the time the idea was broached.

That was a big change from early in his presidency, when Obama consulted Erdogan more than any other regional leader and cited Turkey as proof that democracy can flourish under an Islamist ruler.

Erdogan liked to brag about Turkey’s foreign-policy doctrine of “no problems” with its neighbors, but even Obama eventually woke up to the reality that Turkey was in fact at war with each of its neighbors — and that Erdogan methodically suffocated Turkey’s democracy.

Erdogan, meanwhile, was angry with Obama for supporting the YPG, a Kurdish faction that became our only fighting ally in Syria. (Turkey considers it a terrorist organization.)

For better or worse, Trump’s leadership style prioritizes transactional realism over America’s traditional moralism. As such, he might have more patience with authoritarians like Erdogan.

Erdogan is also working with Vladimir Putin on Syria because, with Iran, Russia is the most powerful foreign actor in the conflict. And Putin doesn’t necessarily oppose creating humanitarian safe zones.

And why not? Half of Syria’s population is homeless. Its neighbors — Jordan, Lebanon and Turkey — carry most of the burden of handling the refugees.

And they’re exhausted. Europe is facing a populist backlash against its permissive refugee resettlement. Same here, though Obama took in just a minuscule number of Syrians to begin with.

Hence, despite the obvious challenges in getting under control a bloody civil war that has so far killed a half-million, keeping Syrians in Syria is starting to look like it’s worth the effort.

With nearly 2 million Syrians in camps inside Turkey, Erdogan would love to move them back into Turkish-controlled areas inside Syria. Meanwhile, Trump could answer critics of his immigration ban: Safe zones, he’ll argue, will alleviate the humanitarian crisis better than taking in asylum seekers.

The catch: Moscow, always fearing an American occupation and US military “mission creep,” won’t bless any of this before seeing the details.

Ah, the details.

“We have in history different examples of safe zones, and some of them were tragic,” new UN Secretary-General Antonio Guterres said recently. Specifically, the United Nations is traumatized by Srebrenica, a supposedly “safe” zone in Bosnia, where in one 1995 week, 8,000 Muslims were massacred as UN guards helplessly watched.

Would anyone have better luck in similarly bloody Syria? Can any zone, no matter how well guarded, be completely safe?

Also, occupying a slice of Syria could turn expensive and bloody. Trump indicated that Gulf states would finance the project. Turkey, which already occupies parts of northern Syria, would shoulder most of the military burden. But America would still need to take a larger military and diplomatic role, which was more than Obama was willing to do.

Done right, safe zones could ease one of the biggest challenges the Syrian war presents to the West. Yes, it’s a complex operation, but not necessarily undoable.

Question is, can Trump (or more likely Pompeo, Defense Secretary James Mattis and the rest of the team) work out the details?

Because, good or bad, no idea will succeed unless it’s well-planned and well-executed. For that to happen, the chaotic early days of the Trump presidency will have to give way to competence and order — and soon.