<?php
$checklist = $checklist ?? [];
?>
<div class="enterprise-settings-fields">
    <div class="enterprise-field enterprise-field--full">
        <label class="enterprise-field-label">Name <span class="text-danger">*</span></label>
        <input type="text" name="name" class="form-control" maxlength="200" required
               value="<?= esc(old('name', $checklist['name'] ?? '')) ?>" placeholder="e.g. Site safety audit">
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">Code</label>
        <input type="text" name="code" class="form-control" maxlength="50"
               value="<?= esc(old('code', $checklist['code'] ?? '')) ?>" placeholder="e.g. SAFE-01">
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">Status</label>
        <select name="status" class="form-select">
            <?php foreach (['active', 'inactive'] as $s): ?>
                <option value="<?= $s ?>" <?= old('status', $checklist['status'] ?? 'active') === $s ? 'selected' : '' ?>>
                    <?= esc(ucfirst($s)) ?>
                </option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="enterprise-field enterprise-field--full">
        <label class="enterprise-field-label">Description</label>
        <textarea name="description" class="form-control" rows="3"><?= esc(old('description', $checklist['description'] ?? '')) ?></textarea>
    </div>
</div>
