Regarding the permanent residency:
You are not lucky as just some years ago the friendly nation visa was reformed. Before you could establish PR with less than 10k.
Now most people who do not receive a pension either put money into a local bank (300k) or buy real estate (200k). Investment timeframe is 3 years. If you are undecided between those options, the bank deposit is more favourable.
The Panamanian real estate market for expat properties in many areas is highly distressed and very illiquid with properties selling a lot below what they are listed for. In order to make a decent purchase you need intensive knowledge of the local market. If you come from a major European or US city, do not get fooled by the prices that might look very cheap in comparison to the market of your home country.
Another option:
There are also some lawyers who create first a company which later on gives you an employment contract and applies for a work permit for you. The company needs to be operative and apply for a RUC number.
Doing this can eventually lead to a PR after a 2 year probation period. Right now, the government does not check if social security contributions are paid. As government regulations / controls can change, there is no warranty that this option will get you the PR in the end after the probation period. I would be cautious.