<form method="POST" action="{{ $action }}">@csrf @if(($method ?? 'POST') !== 'POST') @method($method) @endif
<div class="card"><div class="card-body"><div class="row g-3">
<div class="col-md-6"><x-ui.form.input name="code" :label="__('organization.fields.code')" :value="$record?->code" required /></div>
<div class="col-md-6"><x-ui.form.input name="name" :label="__('organization.fields.name')" :value="$record?->name" required /></div>
@if($entity==='section'||$entity==='team')<div class="col-md-6"><x-ui.form.select name="department_id" :label="__('organization.fields.department')" :options="$departmentOptions" :selected="old('department_id',$record?->department_id)" /></div>@endif
@if($entity==='team')<div class="col-md-6"><x-ui.form.select name="section_id" :label="__('organization.fields.section')" :options="$sectionOptions" :selected="old('section_id',$record?->section_id)" /></div>@endif
@if($entity==='job_grade')<div class="col-md-4"><x-ui.form.input name="level" type="number" min="1" :label="__('organization.fields.level')" :value="$record?->level ?? 1" required /></div><div class="col-md-4"><x-ui.form.input name="min_salary" type="number" step="0.01" :label="__('organization.fields.min_salary')" :value="$record?->min_salary" /></div><div class="col-md-4"><x-ui.form.input name="max_salary" type="number" step="0.01" :label="__('organization.fields.max_salary')" :value="$record?->max_salary" /></div>@endif
@if($entity==='work_location')<div class="col-md-6"><x-ui.form.select name="branch_id" :label="__('organization.fields.branch')" :options="$branchOptions" :selected="old('branch_id',$record?->branch_id)" /></div><div class="col-md-6"><x-ui.form.input name="address" :label="__('organization.fields.address')" :value="$record?->address" /></div>@endif
<div class="col-12"><x-ui.form.input name="description" :label="__('organization.fields.description')" :value="$record?->description" /></div>
@if($record)<div class="col-md-4"><x-ui.form.select name="is_active" :label="__('organization.fields.status')" :options="[1=>__('organization.status.active'),0=>__('organization.status.inactive')]" :selected="$record->is_active?1:0" /></div>@endif
</div></div><div class="card-footer d-flex justify-content-end gap-2"><x-ui.buttons.secondary :href="route('hr.'.$route.'.index')">{{ __('common.cancel') }}</x-ui.buttons.secondary><x-ui.buttons.primary type="submit">{{ __('common.save') }}</x-ui.buttons.primary></div></div></form>