<?php foreach ($permissions as $group => $items): ?>
<div class="border rounded p-3 mb-3">
    <b class="text-primary"><?= strtoupper($group) ?></b>

    <div class="row mt-2">
        <?php foreach ($items as $p): ?>
        <div class="col-md-4">
            <label class="d-flex align-items-center gap-2">
                <input type="checkbox"
                       name="permissions[]"
                       value="<?= $p['id'] ?>">
                <?= esc($p['name']) ?>
            </label>
        </div>
        <?php endforeach ?>
    </div>
</div>
<?php endforeach ?>
