<div class="toolbar">
  <div></div>
  <a href="<?= url('/admin/sla/new') ?>" class="btn btn-primary">+ New SLA policy</a>
</div>
<div class="card">
  <div class="table-wrap">
    <table class="table">
      <thead><tr><th>Name</th><th>Applies to</th><th>Calendar</th><th>24×7</th><th>Effective from</th><th>Version</th><th>Status</th></tr></thead>
      <tbody>
      <?php foreach ($policies as $p) : ?>
        <tr>
          <td><a class="row-link" href="<?= url('/admin/sla/' . $p['id']) ?>"><?= e($p['name']) ?></a></td>
          <td class="text-sm">Contract tier = <?= e($p['contract_tier'] ?? 'Any') ?></td>
          <td class="text-sm"><?= e($p['calendar_name']) ?></td>
          <td><?= $p['is_24x7'] ? '✓' : '—' ?></td>
          <td class="text-sm"><?= fmt_d($p['effective_from']) ?></td>
          <td class="text-sm">v<?= $p['version'] ?></td>
          <td><span class="badge <?= $p['is_active']?'badge-resolved':'badge-closed' ?>"><?= $p['is_active']?'Active':'Inactive' ?></span></td>
        </tr>
      <?php endforeach; ?>
      </tbody>
    </table>
  </div>
</div>
