<div class="enterprise-settings-fields enterprise-settings-fields--single">
    <div class="enterprise-field">
        <label class="enterprise-field-label">Employee <span class="text-danger">*</span></label>
        <select name="employee_id" class="form-select" required>
            <option value="">Select employee...</option>
            <?php foreach ($employees as $e): ?>
                <option value="<?= $e['id'] ?>" <?= old('employee_id') == $e['id'] ? 'selected' : '' ?>>
                    <?= esc($e['full_name']) ?> (<?= esc($e['employee_number']) ?>)
                </option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">Date <span class="text-danger">*</span></label>
        <input type="date" name="attendance_date" class="form-control" value="<?= esc(old('attendance_date', date('Y-m-d'))) ?>" required>
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">Shift</label>
        <select name="shift_id" class="form-select">
            <option value="">Auto-detect from assignment</option>
            <?php foreach ($shifts as $s): ?>
                <option value="<?= $s['id'] ?>" <?= old('shift_id') == $s['id'] ? 'selected' : '' ?>>
                    <?= esc($s['name']) ?> (<?= esc(substr($s['start_time'], 0, 5)) ?> – <?= esc(substr($s['end_time'], 0, 5)) ?>)
                </option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="row g-3">
        <div class="col-md-6">
            <div class="enterprise-field">
                <label class="enterprise-field-label">Clock In</label>
                <input type="time" name="clock_in" class="form-control" value="<?= esc(old('clock_in')) ?>">
            </div>
        </div>
        <div class="col-md-6">
            <div class="enterprise-field">
                <label class="enterprise-field-label">Clock Out</label>
                <input type="time" name="clock_out" class="form-control" value="<?= esc(old('clock_out')) ?>">
            </div>
        </div>
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">Status</label>
        <select name="status" class="form-select">
            <?php foreach (['present', 'absent', 'late', 'half_day', 'on_leave', 'holiday'] as $st): ?>
                <option value="<?= $st ?>" <?= old('status', 'present') === $st ? 'selected' : '' ?>><?= ucwords(str_replace('_', ' ', $st)) ?></option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">Notes</label>
        <textarea name="notes" class="form-control" rows="2"><?= esc(old('notes')) ?></textarea>
    </div>
</div>
