<div class="row">
    <div class="col-12">
        <div class="card glass-card">
            <div class="card-header"><h5 class="card-title">Attendance Report</h5></div>
            <div class="card-body">
                <?php $this->include('Reports/partials/filter_date') ?>
                <div class="table-responsive mt-3">
                    <table class="table table-hover">
                        <thead>
                            <tr><th>Employee</th><th class="text-center">Present</th><th class="text-center">Absent</th><th class="text-center">Late</th><th class="text-center">Leave</th><th class="text-center">Attendance %</th></tr>
                        </thead>
                        <tbody>
                            <?php if (empty($data)): ?>
                            <tr><td colspan="6" class="text-center py-4 text-muted">No data available.</td></tr>
                            <?php else: ?>
                                <?php foreach ($data as $row): ?>
                                <tr>
                                    <td><?= e($row->employee_name) ?></td>
                                    <td class="text-center"><?= $row->present_days ?></td>
                                    <td class="text-center"><?= $row->absent_days ?></td>
                                    <td class="text-center"><?= $row->late_days ?></td>
                                    <td class="text-center"><?= $row->leave_days ?></td>
                                    <td class="text-center">
                                        <div class="progress" style="height:20px;">
                                            <div class="progress-bar bg-gold" style="width:<?= $row->attendance_percentage ?>%"><?= $row->attendance_percentage ?>%</div>
                                        </div>
                                    </td>
                                </tr>
                                <?php endforeach; ?>
                            <?php endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
