Panama tourist visa - Google Search
Panama Tourist Visas - getting a tourist card or visa for entry into Panama
Your airline will give you the card, fill it out, and that's that. If you want an extension, get one while you are there. It may mean a boring morning in line, but its free.
Right now there is definite lag in getting a snail mail passport due to the new Canada, Mexico and Caribbean travel rules--and they all cost a minimum of $96. If you need one in a jiffy, expect to pay, but you can get one in about three days if it is an emergency. You can also get an expedited passport through official channels in about two weeks. Just plan accordingly.
Cheers.