<div class="row g-2 mb-3">
    <div class="col-md-3">
        <label>Branch</label>
        <select name="branch_id" class="form-control">
            <?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $branch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option value="<?php echo e($branch->id); ?>"
                    <?php if(old('branch_id', $shift->branch_id ?? '') == $branch->id): echo 'selected'; endif; ?>>
                    <?php echo e($branch->name); ?>

                </option>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>
    </div>

    <div class="col-md-2">
        <label>Code</label>
        <input name="code" class="form-control"
               value="<?php echo e(old('code', $shift->code ?? '')); ?>" required>
    </div>

    <div class="col-md-4">
        <label>Shift Name</label>
        <input name="name" class="form-control"
               value="<?php echo e(old('name', $shift->name ?? '')); ?>" required>
    </div>

    <div class="col-md-2">
        <label>Color</label>
        <input type="color" name="color" class="form-control"
               value="<?php echo e(old('color', $shift->color ?? '#0d6efd')); ?>">
    </div>

    <div class="col-md-3">
        <label>If Absent</label>
        <select name="absent_status" class="form-control">
            <option value="A" <?php if(old('branch_id', $shift->branch_id ?? '') == 'A'): echo 'selected'; endif; ?>>A</option>
            <option value="HA" <?php if(old('branch_id', $shift->branch_id ?? '') == 'HA'): echo 'selected'; endif; ?>>HA</option>
            <option value="H" <?php if(old('branch_id', $shift->branch_id ?? '') == 'H'): echo 'selected'; endif; ?>>H</option>
        </select>
    </div>

    <div class="col-md-2 d-flex align-items-end">
        <div class="form-check">
            <input type="checkbox" name="status" class="form-check-input"
                   value="1"
                   <?php if(old('status', $shift->status ?? true)): echo 'checked'; endif; ?>>
            <label class="form-check-label">Active</label>
        </div>
    </div>
</div>
<div class="card mb-3">
    <div class="card-header fw-semibold">Shift Start</div>

    <div class="card-body">
        <div class="row g-2">
            <div class="col-md-2">
                <label>Work Start</label>
                <input type="time" name="work_start_time" class="form-control"
                       value="<?php echo e(old('work_start_time', $shift->work_start_time ?? '')); ?>" required>
            </div>

            <div class="col-md-2">
                <label>Late Grace (min)</label>
                <input type="number" min="0" name="late_grace_minutes"
                       class="form-control"
                       value="<?php echo e(old('late_grace_minutes', $shift->late_grace_minutes ?? 0)); ?>">
            </div>

            <div class="col-md-2">
                <label>Late After</label>
                <input type="time" name="late_after_time" class="form-control"
                       value="<?php echo e(old('late_after_time', $shift->late_after_time ?? '')); ?>">
            </div>

            <div class="col-md-2">
                <label>Half Day After</label>
                <input type="time" name="half_day_after_time" class="form-control"
                       value="<?php echo e(old('half_day_after_time', $shift->half_day_after_time ?? '')); ?>">
            </div>

            <div class="col-md-2">
                <label>Early OT Before</label>
                <input type="time" name="early_ot_before_time" class="form-control"
                       value="<?php echo e(old('early_ot_before_time', $shift->early_ot_before_time ?? '')); ?>">
            </div>

            <div class="col-md-2">
                <label>Early OT Min (min)</label>
                <input type="number" min="0" name="early_ot_minimum_minutes"
                       class="form-control"
                       value="<?php echo e(old('early_ot_minimum_minutes', $shift->early_ot_minimum_minutes ?? 0)); ?>">
            </div>
        </div>
    </div>
</div>
<div class="card mb-3">
    <div class="card-header fw-semibold">Shift End</div>

    <div class="card-body">
        <div class="row g-2">
            <div class="col-md-2">
                <label>Work End</label>
                <input type="time" name="work_end_time" class="form-control"
                       value="<?php echo e(old('work_end_time', $shift->work_end_time ?? '')); ?>" required>
            </div>

            <div class="col-md-2">
                <label>Early Grace (min)</label>
                <input type="number" min="0" name="early_grace_minutes"
                       class="form-control"
                       value="<?php echo e(old('early_grace_minutes', $shift->early_grace_minutes ?? 0)); ?>">
            </div>

            <div class="col-md-2">
                <label>Early Before</label>
                <input type="time" name="early_before_time" class="form-control"
                       value="<?php echo e(old('early_before_time', $shift->early_before_time ?? '')); ?>">
            </div>

            <div class="col-md-2">
                <label>Half Day Before</label>
                <input type="time" name="half_day_before_time" class="form-control"
                       value="<?php echo e(old('half_day_before_time', $shift->half_day_before_time ?? '')); ?>">
            </div>

            <div class="col-md-2">
                <label>OT Start After</label>
                <input type="time" name="ot_start_after_time" class="form-control"
                       value="<?php echo e(old('ot_start_after_time', $shift->ot_start_after_time ?? '')); ?>">
            </div>

            <div class="col-md-2">
                <label>OT Min (min)</label>
                <input type="number" min="0" name="ot_minimum_minutes"
                       class="form-control"
                       value="<?php echo e(old('ot_minimum_minutes', $shift->ot_minimum_minutes ?? 0)); ?>">
            </div>
        </div>
    </div>
</div>
<div class="card mb-3">
    <div class="card-header fw-semibold">Work Time Rules</div>

    <div class="card-body">
        <div class="row g-2">
            <div class="col-md-4">
                <label>Minimum Work to Count Attendance (min)</label>
                <input type="number" min="0"
                       name="minimum_half_day_minutes"
                       class="form-control"
                       value="<?php echo e(old('minimum_half_day_minutes', $shift->minimum_half_day_minutes ?? 240)); ?>">
                <small class="text-muted">
                    Below this → Absent (worked time still paid)
                </small>
            </div>

           
        </div>
    </div>
</div>


<hr>


<?php echo $__env->make('core::shifts/partials/slots', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
<?php /**PATH /home/codeproh/va.laraoffice.com/app/Modules/HR/Core/Providers/../Views/shifts/partials/form.blade.php ENDPATH**/ ?>