<?php \App\Core\View::render('reports/_toolbar', ['show' => ['date' => true, 'customer' => true, 'priority' => true, 'queue' => true], 'filters' => $filters, 'query' => $query], null); ?>
<div class="card">
  <div class="table-wrap">
    <table class="table">
      <thead><tr><th>Ticket</th><th>Customer</th><th>Queue</th><th>Priority</th><th>Response</th><th>Resolution</th><th>Justification</th></tr></thead>
      <tbody>
      <?php foreach ($rows as $r) : ?>
        <tr>
          <td class="mono"><?= e($r['ticket_no']) ?></td>
          <td><?= e($r['customer_name']) ?></td>
          <td class="text-sm"><?= e($r['queue_name']) ?></td>
          <td><span class="badge badge-outline"><?= e($r['priority']) ?></span></td>
          <td><?= $r['is_response_breached'] ? '<span class="badge badge-breach">Breached</span>' : '—' ?></td>
          <td><?= $r['is_resolution_breached'] ? '<span class="badge badge-breach">Breached</span>' : '—' ?></td>
          <td class="text-sm"><?= e($r['breach_justification']) ?: '<span class="text-faint">Unexplained</span>' ?></td>
        </tr>
      <?php endforeach; ?>
      <?php if (empty($rows)) : ?><tr><td colspan="7" class="text-faint">No breaches recorded.</td></tr><?php endif; ?>
      </tbody>
    </table>
  </div>
</div>
