<?php $__env->startSection('title', 'Parámetros'); ?>
<?php $__env->startSection('content'); ?>
<div class="d-flex justify-content-between align-items-center mb-3">
    <h4 class="mb-0"><i class="bi bi-sliders me-1"></i> Parámetros</h4>
</div>

<div class="row justify-content-center"><div class="col-lg-8">
<form action="<?php echo e(route('configuracion.update')); ?>" method="POST">
    <?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?>

    
    <div class="card mb-3">
        <div class="card-header"><i class="bi bi-clock me-1"></i> Jornada laboral</div>
        <div class="card-body">
            <div class="row g-3 align-items-end">
                <div class="col-md-4">
                    <label class="form-label fw-semibold">Horas base del período</label>
                    <input type="number" name="horas_base" min="1" max="400" step="1"
                           value="<?php echo e(old('horas_base', $config['horas_base'])); ?>"
                           class="form-control <?php $__errorArgs = ['horas_base'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                    <?php $__errorArgs = ['horas_base'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"><?php echo e($message); ?></div><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    <div class="form-text">
                        Según legislación colombiana puede pasar de <strong>230</strong> a <strong>210</strong> horas (Ley 2101).
                    </div>
                </div>
                <div class="col-md-4">
                    <label class="form-label fw-semibold">Tope horas/día (L–V)</label>
                    <input type="number" name="max_horas_dia" min="1" max="24" step="1"
                           value="<?php echo e(old('max_horas_dia', $config['max_horas_dia'])); ?>"
                           class="form-control <?php $__errorArgs = ['max_horas_dia'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                    <?php $__errorArgs = ['max_horas_dia'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"><?php echo e($message); ?></div><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>
                <div class="col-md-4">
                    <label class="form-label fw-semibold">Tope horas sábado</label>
                    <input type="number" name="max_horas_sabado" min="0" max="24" step="1"
                           value="<?php echo e(old('max_horas_sabado', $config['max_horas_sabado'])); ?>"
                           class="form-control <?php $__errorArgs = ['max_horas_sabado'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                    <?php $__errorArgs = ['max_horas_sabado'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"><?php echo e($message); ?></div><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>
            </div>
        </div>
    </div>

    
    <div class="card mb-3">
        <div class="card-header"><i class="bi bi-calendar3 me-1"></i> Períodos</div>
        <div class="card-body">
            <label class="form-label fw-semibold">Día de corte por defecto</label>
            <select name="periodo_dia_corte" class="form-select" style="max-width:280px">
                <option value="25" <?php echo e((int)old('periodo_dia_corte', $config['periodo_dia_corte'])===25 ? 'selected':''); ?>>
                    Del 25 (mes anterior) al 24
                </option>
                <option value="26" <?php echo e((int)old('periodo_dia_corte', $config['periodo_dia_corte'])===26 ? 'selected':''); ?>>
                    Del 26 (mes anterior) al 25
                </option>
            </select>
            <div class="form-text">Valor sugerido al crear un período. Puede ajustarse en cada período nuevo.</div>
        </div>
    </div>

    
    <div class="card mb-3">
        <div class="card-header"><i class="bi bi-toggles me-1"></i> Módulos y validaciones</div>
        <div class="card-body">
            <div class="form-check form-switch mb-3">
                <input class="form-check-input" type="checkbox" role="switch" id="modIncap"
                       name="modulo_incapacidades" value="1"
                       <?php echo e($config['modulo_incapacidades'] ? 'checked' : ''); ?>>
                <label class="form-check-label" for="modIncap">
                    <strong>Módulo de Incapacidades</strong>
                    <div class="form-text mt-0">Si se inactiva, se oculta del menú y se bloquea su acceso.</div>
                </label>
            </div>
            <div class="form-check form-switch">
                <input class="form-check-input" type="checkbox" role="switch" id="valSab"
                       name="validar_sabados" value="1"
                       <?php echo e($config['validar_sabados'] ? 'checked' : ''); ?>>
                <label class="form-check-label" for="valSab">
                    <strong>Validar sábados según bolsa de tiempo</strong>
                    <div class="form-text mt-0">Aplica el tope de horas del sábado y avisa al excederlo.</div>
                </label>
            </div>
        </div>
    </div>

    <div class="d-flex gap-2">
        <button type="submit" class="btn btn-primary"><i class="bi bi-save me-1"></i> Guardar parámetros</button>
        <a href="<?php echo e(route('dashboard')); ?>" class="btn btn-outline-secondary">Cancelar</a>
    </div>
</form>
</div></div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/evolucionamos/public_html/ges-chronos/app/hoja-tiempo/resources/views/configuracion/index.blade.php ENDPATH**/ ?>