<div class="enterprise-data-panel mb-4">
    <div class="enterprise-data-panel__toolbar">
        <form action="<?= current_url() ?>" method="get">
            <div class="enterprise-filter-grid">
                <div>
                    <label class="enterprise-field-label">From</label>
                    <input type="date" name="from" class="form-control form-control-sm" value="<?= esc($filters['dateFrom']) ?>">
                </div>
                <div>
                    <label class="enterprise-field-label">To</label>
                    <input type="date" name="to" class="form-control form-control-sm" value="<?= esc($filters['dateTo']) ?>">
                </div>
                <div>
                    <label class="enterprise-field-label">Employee</label>
                    <select name="employee_id" class="form-select form-select-sm">
                        <option value="">All</option>
                        <?php foreach ($employees as $e): ?>
                            <option value="<?= $e['id'] ?>" <?= ($filters['employeeId'] ?? null) == $e['id'] ? 'selected' : '' ?>><?= esc($e['full_name']) ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
                <div class="enterprise-filter-actions d-flex gap-2 flex-wrap">
                    <button type="submit" class="btn btn-sm btn-primary">Apply</button>
                    <a href="<?= base_url('attendance/late') ?>" class="btn btn-sm btn-outline-secondary">Late</a>
                    <a href="<?= base_url('attendance/early-exit') ?>" class="btn btn-sm btn-outline-secondary">Early Exit</a>
                    <a href="<?= base_url('attendance/overtime') ?>" class="btn btn-sm btn-outline-secondary">Overtime</a>
                    <?= view('Modules\Reports\Views\partials\export_buttons', [
                        'actionPath' => uri_string(),
                        'query'      => [
                            'from'        => $filters['dateFrom'] ?? '',
                            'to'          => $filters['dateTo'] ?? '',
                            'employee_id' => $filters['employeeId'] ?? '',
                        ],
                    ]) ?>
                </div>
            </div>
        </form>
    </div>
</div>
