@php
    /** @var \App\Modules\HR\Recruitment\DTOs\RecruitmentReportFilters $filters */
    $selected = $filters->toQuery();
    $deptOpts = ['' => __('recruitment.filters.all')] + ($filterOptions['departments'] ?? []);
    $vacOpts = ['' => __('recruitment.filters.all')] + ($filterOptions['vacancies'] ?? []);
    $recOpts = ['' => __('recruitment.filters.all')] + ($filterOptions['recruiters'] ?? []);
@endphp

<div class="card border-0 shadow-sm mb-4">
    <div class="card-body">
        <form method="GET" action="{{ $action }}" class="row g-3 align-items-end">
            <div class="col-md-2">
                <x-ui.form.input name="date_from" type="date" :label="__('recruitment.reports.filters.date_from')" :value="$selected['date_from'] ?? null" />
            </div>
            <div class="col-md-2">
                <x-ui.form.input name="date_to" type="date" :label="__('recruitment.reports.filters.date_to')" :value="$selected['date_to'] ?? null" />
            </div>
            <div class="col-md-2">
                <x-ui.form.select name="department_id" :label="__('recruitment.reports.filters.department')" :options="$deptOpts" :selected="$selected['department_id'] ?? null" />
            </div>
            <div class="col-md-2">
                <x-ui.form.select name="vacancy_id" :label="__('recruitment.reports.filters.vacancy')" :options="$vacOpts" :selected="$selected['vacancy_id'] ?? null" />
            </div>
            <div class="col-md-2">
                <x-ui.form.select name="recruiter_id" :label="__('recruitment.reports.filters.recruiter')" :options="$recOpts" :selected="$selected['recruiter_id'] ?? null" />
            </div>
            @if ($showStatus ?? true)
                <div class="col-md-2">
                    <x-ui.form.input name="status" :label="__('recruitment.reports.filters.status')" :value="$selected['status'] ?? null" :placeholder="__('recruitment.reports.filters.status_hint')" />
                </div>
            @endif
            <div class="col-md-2">
                <x-ui.buttons.primary type="submit" icon="fe fe-filter">{{ __('recruitment.filters.apply') }}</x-ui.buttons.primary>
            </div>
        </form>
    </div>
</div>
