<div class="container-fluid py-4">

<div class="card border-0 shadow-sm">

<div class="card-body">

<h2 class="mb-4">
Reviewer SLA Intelligence
</h2>

<div class="table-responsive">

<table class="table table-bordered table-hover">

<thead class="table-dark">

<tr>

<th>ID</th>
<th>Submission</th>
<th>Reviewer</th>
<th>Status</th>
<th>Due Date</th>
<th>Overdue Days</th>

</tr>

</thead>

<tbody>

<?php foreach($rows as $r): ?>

<tr>

<td><?= (int)$r['id'] ?></td>

<td>
<?= htmlspecialchars($r['submission_no'] ?? '') ?>
</td>

<td>
<?= htmlspecialchars($r['reviewer_name'] ?? '') ?>
</td>

<td>
<?= htmlspecialchars($r['status'] ?? '') ?>
</td>

<td>
<?= htmlspecialchars($r['due_date'] ?? '') ?>
</td>

<td>

<?php if(($r['overdue_days'] ?? 0) >= 21): ?>

<span class="badge bg-danger">
<?= (int)$r['overdue_days'] ?>
</span>

<?php elseif(($r['overdue_days'] ?? 0) >= 14): ?>

<span class="badge bg-warning text-dark">
<?= (int)$r['overdue_days'] ?>
</span>

<?php else: ?>

<span class="badge bg-info">
<?= (int)$r['overdue_days'] ?>
</span>

<?php endif; ?>

</td>

</tr>

<?php endforeach; ?>

</tbody>

</table>

</div>

</div>

</div>

</div>
