<?php $pageTitle = 'Roles & Permissions'; ?>
<div class="mb-4"><p class="text-secondary">System roles and their permission counts</p></div>
<div class="card-cix">
    <table class="table-cix"><thead><tr><th>Role</th><th>Slug</th><th>Permissions</th><th>Users</th><th>System</th></tr></thead>
    <tbody><?php foreach ($roles as $r): ?>
    <tr><td><strong><?= e($r['name']) ?></strong></td><td class="text-secondary"><?= e($r['slug']) ?></td>
    <td><span class="badge-cix badge-submitted"><?= (int)$r['perm_count'] ?> permissions</span></td>
    <td><?= (int)$r['user_count'] ?> users</td>
    <td><?= $r['is_system'] ? '<span class="badge-cix badge-active">System</span>' : '' ?></td></tr>
    <?php endforeach; ?></tbody></table>
</div>
