<?php $__env->startSection('header_title', $title); ?>
<?php $__env->startSection('header_subtitle', $subtitle); ?>

<?php $__env->startSection('content'); ?>
    <div class="mb-6">
        <a href="<?php echo e($backRoute); ?>" class="text-sm font-medium text-slate-400 hover:text-white transition-colors flex items-center gap-2">
            <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18" /></svg>
            Voltar à listagem
        </a>
    </div>

    <div class="bg-slate-900 border border-white/5 rounded-2xl p-6 md:p-8 shadow-xl max-w-4xl">
        <?php if($errors->any()): ?>
            <div class="mb-6 p-4 rounded-xl bg-red-500/10 border border-red-500/20 text-red-400 text-sm">
                <ul class="list-disc list-inside">
                    <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li><?php echo e($error); ?></li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
            </div>
        <?php endif; ?>

        <form action="<?php echo e($action); ?>" method="POST" class="space-y-6">
            <?php echo csrf_field(); ?>
            <?php if($method !== 'POST'): ?>
                <?php echo method_field($method); ?>
            <?php endif; ?>

            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                <?php $__currentLoopData = $fields; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="<?php echo e(($field['type'] ?? 'text') === 'textarea' ? 'md:col-span-2' : ''); ?>">
                        <label class="block text-sm font-medium text-slate-300 mb-2"><?php echo e($field['label']); ?></label>

                        <?php if(($field['type'] ?? 'text') === 'select'): ?>
                            <select name="<?php echo e($field['name']); ?>" class="block w-full px-4 py-3 bg-slate-950 border border-white/10 rounded-xl text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all sm:text-sm">
                                <?php if(isset($field['empty'])): ?>
                                    <option value=""><?php echo e($field['empty']); ?></option>
                                <?php endif; ?>
                                <?php $__currentLoopData = $field['options']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $optionValue => $optionLabel): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($optionValue); ?>" <?php if(old($field['name'], $field['value'] ?? '') == $optionValue): echo 'selected'; endif; ?>><?php echo e($optionLabel); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        <?php elseif(($field['type'] ?? 'text') === 'textarea'): ?>
                            <textarea name="<?php echo e($field['name']); ?>" rows="4" class="block w-full px-4 py-3 bg-slate-950 border border-white/10 rounded-xl text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all sm:text-sm"><?php echo e(old($field['name'], $field['value'] ?? '')); ?></textarea>
                        <?php else: ?>
                            <input type="<?php echo e($field['type'] ?? 'text'); ?>" name="<?php echo e($field['name']); ?>" value="<?php echo e(old($field['name'], $field['value'] ?? '')); ?>" step="<?php echo e($field['step'] ?? ''); ?>" class="block w-full px-4 py-3 bg-slate-950 border border-white/10 rounded-xl text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all sm:text-sm">
                        <?php endif; ?>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>

            <div class="mt-8 pt-6 border-t border-white/5 flex items-center justify-end gap-4">
                <a href="<?php echo e($backRoute); ?>" class="px-5 py-2.5 text-sm font-medium text-slate-300 hover:text-white transition-colors">Cancelar</a>
                <button type="submit" class="px-6 py-2.5 bg-blue-600 hover:bg-blue-500 text-white text-sm font-semibold rounded-xl shadow-lg shadow-blue-500/20 transition-all flex items-center gap-2">
                    <svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg>
                    <?php echo e($submitLabel); ?>

                </button>
            </div>
        </form>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\secure-vision-app\resources\views\admin\shared\form.blade.php ENDPATH**/ ?>