Code:
add_filter('admin_body_class', function($classes) {
global $current_user;
if(is_array($current_user->roles)) {
foreach($current_user->roles as $role) {
$classes .= "user-role-{$role} ";
}
}
return rtrim($classes);
});
Classes will look like this:
<body class="... user-role-administrator ...">