<?php $__env->startSection('titulo','Área'); ?>
<?php $__env->startSection('contenido'); ?>
<?php $editando = (bool) $registro->id; ?>
<h4><i class="fa fa-map-location-dot"></i> <?php echo e($editando?'Editar':'Nueva'); ?> área</h4>
<form method="POST" action="<?php echo e($editando ? route('areas.update',$registro) : route('areas.store')); ?>" class="card p-3">
  <?php echo csrf_field(); ?> <?php if($editando): ?> <?php echo method_field('PUT'); ?> <?php endif; ?>
  <div class="row g-3">
    <div class="col-md-3"><label class="form-label small">Código *</label>
      <input name="codigo" value="<?php echo e(old('codigo',$registro->codigo)); ?>" class="form-control" maxlength="20" required></div>
    <div class="col-md-9"><label class="form-label small">Nombre *</label>
      <input name="nombre" value="<?php echo e(old('nombre',$registro->nombre)); ?>" class="form-control" required></div>
    <div class="col-md-12"><label class="form-label small">Descripción</label>
      <textarea name="descripcion" class="form-control" rows="2"><?php echo e(old('descripcion',$registro->descripcion)); ?></textarea></div>
    <div class="col-md-3"><label class="form-label small">Color</label>
      <input type="color" name="color" value="<?php echo e(old('color',$registro->color ?: '#1565C0')); ?>" class="form-control form-control-color"></div>
    <div class="col-md-3 d-flex align-items-end">
      <div class="form-check form-switch">
        <input type="hidden" name="activo" value="0">
        <input type="checkbox" name="activo" value="1" class="form-check-input" <?php echo e(old('activo',$registro->activo??1)?'checked':''); ?>>
        <label class="form-check-label">Activa</label>
      </div>
    </div>
  </div>
  <div class="mt-3 text-end">
    <a href="<?php echo e(route('areas.index')); ?>" class="btn btn-outline-secondary">Cancelar</a>
    <button class="btn btn-primario"><i class="fa fa-save"></i> Guardar</button>
  </div>
</form>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\mto\resources\views/catalogos/areas_form.blade.php ENDPATH**/ ?>