<?php $pageTitle = 'My Students'; ?>
<div class="mb-4"><p class="text-secondary">Students enrolled in your courses</p></div>
<?php if (empty($students)): ?>
    <div class="empty-state"><i class="fas fa-users"></i><h5>No Students</h5><p>No students are enrolled in your courses yet.</p></div>
<?php else: ?>
<div class="card-cix">
    <div class="table-responsive">
        <table class="table-cix">
            <thead><tr><th>#</th><th>Name</th><th>Email</th><th>Student #</th><th>Status</th></tr></thead>
            <tbody>
            <?php foreach ($students as $i => $s): ?>
            <tr>
                <td><?= $i + 1 ?></td>
                <td><strong><?= e($s['first_name'] . ' ' . $s['last_name']) ?></strong></td>
                <td class="text-secondary"><?= e($s['email']) ?></td>
                <td style="color:var(--secondary);font-weight:600;"><?= e($s['student_number'] ?? '') ?></td>
                <td><span class="badge-cix <?= $s['enrollment_status'] === 'active' ? 'badge-active' : 'badge-pending' ?>"><?= e(ucfirst($s['enrollment_status'])) ?></span></td>
            </tr>
            <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</div>
<?php endif; ?>
