You make the very common mistake of international politics - in truth, on international level there isn't any law at all
For law to be a law, for the "rule of the law" one requires at least monopoly on violence. And when each entity has its own military force (and multiple entities wield nuclear weaponry) that becomes very problematic
And even when most entities agree on some set of rules, it's still down to individual interests of the members on how to react to infractions.
You can still bomb all the bakeries and water desalination plants and go away scot-free, or you can hunt your own citizens and strip protections off of churches and languages and still be hailed as beacon of freedom or smth - as long as you have enough weight behind you
All that to say, while balance of power and national interests prohibit "automatic sanctions" (or automatic anything, as was noted in the comments), there's still the basic principle of "action and reaction"
Entities react on actions of others, and act within their reach and abilities
What actions are possible on international level?
One obvious example is militarian, "Ultima ratio" so to say. You can see how your example of "Panama seizing american possessions" got answered with "USA will just invade, lol" kind of reply
The other possibility is trade - it's quite possible to express many of sanctions against Russia as simply "some countries stopped trading with some entities and threat to stop trading with anyone trading with those entities" (which becomes a cost-benefit analysis not guaranteed to comply)
But what might answer closest to the spirit of your question is the notion of "international law courts"
By that I mean that some countries have set up some organizations (not necessarily with "international" in the name), with some sets of rules, that allow countries to participate in legal battles with each other (or other entities) under judgement of some 3rd party, which supposedly enforces its decisions within its "reach and abilities"
So for example if Costa-Rica seizes some Peruvian business, it might get brought to Chinese court which, after proclaiming said seizing illegal, would direct Chinese law enforcement to seize some Costa-Rican possessions (in China) for Peru to control
As always, some vested interested is still present (3rd party =/= independent or unaffected), but with stakes low enough and with procedures legal and muddied enough to not cause reactions to such action of 3rd party - some semblance of real laws can be created