<?php foreach ($groups as $grup => $items): ?>
<div class="card mb-3">
  <div class="card-header"><i class="bi bi-folder2-open me-1"></i><?= e($grup) ?></div>
  <div class="card-body"><div class="row g-2">
    <?php foreach ($items as $code => $r): ?>
      <div class="col-md-6 col-xl-4">
        <a class="d-flex gap-2 p-2 rounded border text-decoration-none text-body h-100 align-items-start"
           href="<?= url('/laporan/'.$code) ?>" style="transition:background .12s" onmouseover="this.style.background='#eef3fb'" onmouseout="this.style.background=''">
          <i class="bi bi-<?= e($r['icon']) ?> fs-5 text-primary mt-1"></i>
          <span>
            <strong style="font-size:13px"><?= e($r['nama']) ?></strong>
            <span class="d-block small text-body-secondary"><?= e($r['deskripsi']) ?></span>
          </span>
        </a>
      </div>
    <?php endforeach; ?>
  </div></div>
</div>
<?php endforeach; ?>
