One can withhold deposit for unpaid rent, lost keys/remotes, repairs beyond normal wear/tear, and cleaning.
In CA a landlord must provide a written notice to their tenants about their right to request an optional inspection prior to moving out. In this optional inspection conducted no earlier than 15 days from the move out date, the landlord can indicate the list of items that needs fixing to receive a full deposit refund.
I own rental properties, and personally see it hassle free to return the entire deposit. The few occasions I did deduct were to replace remote controls. The unit is rekeyed between tenants, so don’t as much care for missing keys. Likewise, the tenant never cleans enough and do end up cleaning the unit as part of the general maintenance and checkup.
Don’t have a reference but remember reading this – if the tenants dispute the refund and wins, the case is reported/cited on the landlords credit report. Not sure how prevalent it is, but the hassle of going to court is not worth my time.
You might already know this, security deposit should be returned within 21 days and CA requires an itemized cost report along with receipts for any deductions > $100. Finally in case the landlord completes any work on their own, the cost must be calculated for reasonable hours with nominal/minimum hourly rates.