Hello,
You can achieve this by adding following expression to
~\CMSPages\PortalTemplate.aspx.cs page to
OnPreRender method:
string docName = CMS.CMSHelper.CMSContext.CurrentDocument.DocumentName.ToString().ToLower();
this.DocumentBase.BodyClass = this.DocumentBase.BodyClass + " " + docName;
Best regards
Ondrej Vasil