## Why

Departments and positions that stop operating cannot be retired today. Deleting them is blocked whenever any position or any account still references them — including employees who have already quit — and that reference must be kept so payroll, contract and timesheet history stay intact. The result is that defunct departments and positions remain fully usable: they show up in every picker, and new employees can still be assigned to them.

This change introduces a status so a department or position can be taken out of service without destroying history, and makes sure an organisational unit is only retired once nobody is still working in it.

## What Changes

- Add an `is_active` status to departments and positions, active by default. Existing rows stay active.
- A department's status **cascades onto its positions**: deactivating a department deactivates every position in it, reactivating it reactivates them. A position's own status is therefore the whole answer to whether it can be assigned, and a client never has to combine it with the department's. The invariant that no position is active inside an inactive department is enforced on every write that could break it.
- Because reactivation is coarse — it also switches on positions that were turned off individually — a department reports how many of its positions are inactive, so an admin sees the effect before committing to it.
- Deactivating a department or position is refused while any employee with status `active` is still assigned to it. Employees who have quit do not block deactivation.
- Status is changed through the existing department and position update operation rather than a dedicated one, so an admin saves information and status together. Splitting them across two requests would let the status change land while the rest of the form failed to save.
- Reject assignment to an unavailable position on every write path, via a shared validation rule.
- Refuse to return an employee from `quit_job` to `active` while the position they hold is no longer available, so a retired department cannot regain working employees through the back door. The refusal asks for a different position, and the position the employee already holds does not exempt them from the check.
- Employee Excel import reports a row that resolves to an unavailable position with its own reason code, instead of a misleading "not found".
- Admin listings can see and filter inactive departments and positions; selection endpoints used for assignment exclude them.
- Fix an existing defect in `EmployeeController@changeCompany` that looks up a company by a position id when deciding whether to clear leader references, weakening the cleanup that prevents leader references dangling across companies.

No breaking changes: every existing department and position is seeded active, and the derived availability rule leaves current behaviour unchanged until something is deactivated.

## Capabilities

### New Capabilities
- `department-position-status`: the active/inactive status of departments and positions, how a department's status cascades onto its positions, the conditions for deactivating and reactivating, and how unavailable units behave across assignment and listing endpoints.

### Modified Capabilities
- `employee-excel-import`: position resolution and per-row validation gain a reason code for rows that resolve to an unavailable position, and unavailable positions stop competing as match candidates so a retired duplicate no longer makes a name ambiguous.

## Impact

**Database**
- `departments.is_active`, `positions.is_active` — `tinyInteger` default `1`, following the existing `contract_types` precedent.

**Models**
- `app/Models/Department.php`, `app/Models/Position.php` — fillable, scopes, derived availability.

**Validation**
- New rule class under `app/Rules/` — one place that answers "may this position be assigned?", alongside the existing `OnCompany` rule.

**Write paths that assign positions** (all must honour the rule)
- `EmployeeController@store`
- `EmployeeController@update`
- `EmployeeController@changeCompany`
- `EmployeeController@import`
- `Account::createOrUpdate` (`app/Models/Account.php`)

**Write paths that change employee status**
- `EmployeeController@update` — status carried in the body, today without any `positions` to validate
- `EmployeeController@updateStatus` (`PUT /admin/employees/{id}/update-status`) — today validates only `status`

**Controllers**
- `DepartmentController`, `PositionController` — `is_active` accepted on update and guarded there, status filter.
- `EmployeeController@changeCompany` — leader cleanup defect.

**Not in scope**
- No status on `companies`. The derived availability rule is kept in a single place so a company tier can be added later without touching every call site.
- No audit log of position changes. The repository has no working log infrastructure for this, and nothing currently depends on such history.
- No bulk operation for moving employees out of a unit being retired. An admin reassigns them through the existing employee update operation.
- Contract documents keep resolving `employee_department` and `employee_company` from the employee's current position. Re-rendering a contract after an employee is reassigned shows the new department; this is accepted existing behaviour.
