<?php $holiday = $holiday ?? []; ?>
<div class="enterprise-settings-fields enterprise-settings-fields--single">
    <div class="enterprise-field">
        <label class="enterprise-field-label">Holiday Name <span class="text-danger">*</span></label>
        <input type="text" name="name" class="form-control" value="<?= esc(old('name', $holiday['name'] ?? '')) ?>" required>
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">Date <span class="text-danger">*</span></label>
        <input type="date" name="date" class="form-control" value="<?= esc(old('date', $holiday['date'] ?? '')) ?>" required>
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">Branch</label>
        <select name="branch_id" class="form-select">
            <option value="">All branches</option>
            <?php foreach ($branches as $b): ?>
                <option value="<?= $b['id'] ?>" <?= old('branch_id', $holiday['branch_id'] ?? '') == $b['id'] ? 'selected' : '' ?>><?= esc($b['name']) ?></option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="enterprise-field">
        <div class="form-check">
            <input class="form-check-input" type="checkbox" name="is_recurring" value="1" id="is_recurring"
                <?= old('is_recurring', $holiday['is_recurring'] ?? 0) ? 'checked' : '' ?>>
            <label class="form-check-label" for="is_recurring">Recurring annually (same month/day each year)</label>
        </div>
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">Description</label>
        <textarea name="description" class="form-control" rows="3"><?= esc(old('description', $holiday['description'] ?? '')) ?></textarea>
    </div>
</div>
