Trains, Buses and Trams in Rabat

How do you use the public transport system in Rabat, is there a centralised card for everything, do you pay cash? Which is the cheapest? Which is the most frequent? Which is the most far reaching/connected? Any insight would be helpful, thanks!