<script setup>
import AppLayout from '@/Layouts/AppLayout.vue';
import { ref, computed } from 'vue';
import { useForm, router, Head } from '@inertiajs/vue3';

const props = defineProps({
  title: String,
  talleres: { type: Object, default: () => ({ data: [] }) },
  tipos: { type: Array, default: () => [] },
  filtros: { type: Object, default: () => ({}) },
});

const showModal = ref(false);
const editingId = ref(null);
const search = ref(props.filtros.search || '');
const filterTipo = ref(props.filtros.tipo || '');

const form = useForm({
  ruc: '',
  razon_social: '',
  tipo: 'multimarca',
  ciudad: '',
  contacto: '',
  telefono: '',
  email: '',
});

const tiposLabels = {
  dealer: 'Concesionario (Dealer)',
  multimarca_dealer: 'Multimarca Dealer',
  multimarca: 'Multimarca Estándar',
  taller_asegurado: 'Taller del Asegurado',
};

function openCreate() {
  form.reset();
  editingId.value = null;
  showModal.value = true;
}

function openEdit(t) {
  editingId.value = t.id;
  form.ruc = t.ruc;
  form.razon_social = t.razon_social;
  form.tipo = t.tipo || 'multimarca';
  form.ciudad = t.ciudad || '';
  form.contacto = t.contacto || '';
  form.telefono = t.telefono || '';
  form.email = t.email || '';
  showModal.value = true;
}

function submit() {
  if (editingId.value) {
    form.put(route('talleres.update', editingId.value), {
      onSuccess: () => { showModal.value = false; },
    });
  } else {
    form.post(route('talleres.store'), {
      onSuccess: () => { showModal.value = false; },
    });
  }
}

function destroy(id) {
  if (confirm('¿Está seguro de eliminar este taller?')) {
    router.delete(route('talleres.destroy', id));
  }
}

function doSearch() {
  router.get(route('talleres.index'), { 
    search: search.value,
    tipo: filterTipo.value 
  }, { preserveState: true });
}

// Stats
const totalTalleres = computed(() => props.talleres.data.length);
</script>

<template>
  <Head :title="title" />

  <AppLayout :title="title">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
      <!-- Header Premium -->
      <div class="mb-10 flex flex-col md:flex-row md:items-end justify-between gap-6">
        <div>
          <span class="text-xs font-bold uppercase tracking-widest text-primary-600 mb-2 block">Red de Servicios</span>
          <h1 class="text-4xl font-extrabold text-slate-900 tracking-tight">Talleres <span class="text-slate-400 font-light">Autorizados</span></h1>
          <p class="text-slate-500 mt-2 max-w-xl">Gestión de la red de talleres, clasificación por especialidad y control de contactos operativos.</p>
        </div>

        <button @click="openCreate" class="group relative px-8 py-3 bg-slate-900 text-white rounded-2xl font-bold overflow-hidden transition-all hover:pr-12 shadow-xl shadow-slate-200">
            <span class="relative z-10">Nuevo Taller</span>
            <svg class="absolute right-4 top-1/2 -translate-y-1/2 w-5 h-5 opacity-0 group-hover:opacity-100 transition-all" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
            </svg>
        </button>
      </div>

      <!-- Stats Cards Row -->
      <div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-10">
        <div v-for="(stat, idx) in [
            { label: 'Centros de Colisión', val: totalTalleres, icon: 'Tool', color: 'blue' },
            { label: 'Concesionarios', val: '12', icon: 'Award', color: 'amber' },
            { label: 'Capacidad Total', val: '85%', icon: 'Activity', color: 'emerald' },
            { label: 'Nivel SLA', val: '94.2%', icon: 'CheckCircle', color: 'indigo' }
        ]" :key="idx" class="bg-white p-6 rounded-3xl border border-slate-100 shadow-sm">
            <div class="flex items-center gap-4">
                <div :class="`w-12 h-12 rounded-2xl bg-${stat.color}-50 flex items-center justify-center text-${stat.color}-600`">
                    <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path v-if="stat.icon === 'Tool'" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" /><path v-if="stat.icon === 'Tool'" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
                        <path v-if="stat.icon === 'Award'" d="M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z" />
                        <path v-if="stat.icon === 'Activity'" d="M13 10V3L4 14h7v7l9-11h-7z" />
                        <path v-if="stat.icon === 'CheckCircle'" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
                    </svg>
                </div>
                <div>
                    <p class="text-[10px] font-bold text-slate-400 uppercase tracking-widest">{{ stat.label }}</p>
                    <p class="text-xl font-bold text-slate-900">{{ stat.val }}</p>
                </div>
            </div>
        </div>
      </div>

      <!-- Filters & Search -->
      <div class="flex flex-col md:flex-row items-center gap-4 mb-8 bg-slate-50/50 p-4 rounded-2xl border border-slate-100">
        <div class="relative flex-1 group">
          <input 
            v-model="search" 
            @keyup.enter="doSearch"
            type="text" 
            placeholder="Buscar por RUC, Razón Social o Ciudad..."
            class="w-full pl-12 pr-4 py-3 bg-white border-transparent rounded-xl text-sm focus:ring-2 focus:ring-primary-500 focus:bg-white transition-all shadow-sm group-hover:shadow-md"
          />
          <svg class="absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
          </svg>
        </div>
        
        <select v-model="filterTipo" @change="doSearch" class="px-4 py-3 bg-white border-transparent rounded-xl text-sm focus:ring-2 focus:ring-primary-500 shadow-sm min-w-[200px]">
          <option value="">Todos los tipos</option>
          <option v-for="t in tipos" :key="t" :value="t">{{ tiposLabels[t] }}</option>
        </select>

        <button @click="doSearch" class="px-6 py-3 bg-slate-800 text-white rounded-xl text-sm font-bold hover:bg-slate-900 transition-colors">Actualizar Vista</button>
      </div>

      <!-- Main Layout -->
      <div class="hidden md:block bg-white rounded-[2.5rem] border border-slate-100 shadow-xl overflow-hidden glass-morphism">
        <table class="w-full text-left border-collapse">
          <thead>
            <tr class="bg-slate-50/50">
              <th class="px-8 py-5 text-xs font-bold text-slate-400 uppercase tracking-widest border-b border-slate-100 uppercase">Taller / Razón Social</th>
              <th class="px-8 py-5 text-xs font-bold text-slate-400 uppercase tracking-widest border-b border-slate-100 uppercase">Clasificación</th>
              <th class="px-8 py-5 text-xs font-bold text-slate-400 uppercase tracking-widest border-b border-slate-100 uppercase">Ubicación / Código</th>
              <th class="px-8 py-5 text-xs font-bold text-slate-400 uppercase tracking-widest border-b border-slate-100 uppercase">Contacto Operativo</th>
              <th class="px-8 py-5 text-xs font-bold text-slate-400 uppercase tracking-widest border-b border-slate-100 text-center uppercase">Acciones</th>
            </tr>
          </thead>
          <tbody class="divide-y divide-slate-50">
            <tr v-for="t in talleres.data" :key="t.id" class="group hover:bg-primary-50/30 transition-colors">
              <td class="px-8 py-6">
                <div class="flex items-center gap-4">
                    <div class="w-12 h-12 rounded-2xl bg-slate-100 flex items-center justify-center text-slate-500 font-bold group-hover:bg-primary-600 group-hover:text-white transition-colors">
                        <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z" /></svg>
                    </div>
                    <div>
                        <p class="font-bold text-slate-900 leading-tight tracking-tight uppercase">{{ t.razon_social }}</p>
                        <p class="text-xs text-slate-400 mt-1 font-mono uppercase">{{ t.ruc }}</p>
                    </div>
                </div>
              </td>
              <td class="px-8 py-6">
                <span :class="{
                    'bg-slate-900 text-white': t.tipo === 'dealer',
                    'bg-indigo-50 text-indigo-700': t.tipo === 'multimarca_dealer',
                    'bg-emerald-50 text-emerald-700': t.tipo === 'multimarca',
                    'bg-amber-50 text-amber-700': t.tipo === 'taller_asegurado',
                }" class="px-3 py-1 rounded-full text-[10px] font-black uppercase tracking-widest shadow-sm">
                    {{ tiposLabels[t.tipo] }}
                </span>
              </td>
              <td class="px-8 py-6">
                <p class="text-sm font-bold text-slate-700 uppercase">{{ t.ciudad || 'Sin ciudad' }}</p>
                <p class="text-[10px] text-slate-400 font-bold tracking-tighter mt-1">{{ t.codigo_sistema }}</p>
              </td>
              <td class="px-8 py-6">
                <div class="flex flex-col gap-1">
                    <p class="text-xs font-black text-slate-800 tracking-wider uppercase group-hover:text-primary-600 transition-colors">{{ t.contacto || 'SIN CONTACTO' }}</p>
                    <div class="flex items-center gap-2 text-[10px] text-slate-400 font-bold">
                        <svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"/></svg>
                        {{ t.telefono || '—' }}
                    </div>
                </div>
              </td>
              <td class="px-8 py-6 text-center">
                <div class="flex items-center justify-center gap-3 opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0 translate-x-4">
                    <button @click="openEdit(t)" class="p-2.5 bg-slate-50 text-slate-600 rounded-2xl hover:bg-primary-600 hover:text-white transition-all shadow-sm">
                        <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/></svg>
                    </button>
                    <button @click="destroy(t.id)" class="p-2.5 bg-slate-50 text-red-600 rounded-2xl hover:bg-red-600 hover:text-white transition-all shadow-sm">
                        <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/></svg>
                    </button>
                </div>
              </td>
            </tr>
            <tr v-if="!talleres.data.length">
                <td colspan="5" class="px-8 py-20 text-center">
                    <div class="w-24 h-24 bg-slate-50 rounded-full flex items-center justify-center mx-auto mb-6 transform transition-transform hover:scale-110">
                        <svg class="w-12 h-12 text-slate-200" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" /></svg>
                    </div>
                    <p class="text-slate-400 font-bold uppercase tracking-widest text-xs">No se encontraron talleres en la red.</p>
                </td>
            </tr>
          </tbody>
        </table>
      </div>

      <!-- Mobile Cards -->
      <div class="md:hidden space-y-3">
        <template v-if="talleres.data.length > 0">
          <div v-for="t in talleres.data" :key="t.id" class="bg-white rounded-2xl border border-slate-100 shadow-sm p-4 space-y-3">
            <div class="flex items-center gap-3">
              <div class="w-10 h-10 rounded-xl bg-slate-100 flex items-center justify-center text-slate-500 flex-shrink-0">
                <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z" /></svg>
              </div>
              <div class="min-w-0 flex-1">
                <p class="font-bold text-slate-900 text-sm truncate uppercase">{{ t.razon_social }}</p>
                <p class="text-[10px] text-slate-400 font-mono uppercase">{{ t.ruc }}</p>
              </div>
            </div>
            <div>
              <span :class="{
                'bg-slate-900 text-white': t.tipo === 'dealer',
                'bg-indigo-50 text-indigo-700': t.tipo === 'multimarca_dealer',
                'bg-emerald-50 text-emerald-700': t.tipo === 'multimarca',
                'bg-amber-50 text-amber-700': t.tipo === 'taller_asegurado',
              }" class="inline-block px-2 py-0.5 rounded-full text-[9px] font-bold uppercase">
                {{ tiposLabels[t.tipo] }}
              </span>
            </div>
            <div class="grid grid-cols-2 gap-2 text-xs">
              <div>
                <span class="text-[9px] text-slate-400 font-bold uppercase block">Ubicación</span>
                <p class="font-bold text-slate-700">{{ t.ciudad || 'Sin ciudad' }}</p>
                <p class="text-[10px] text-slate-400 font-bold">{{ t.codigo_sistema }}</p>
              </div>
              <div>
                <span class="text-[9px] text-slate-400 font-bold uppercase block">Contacto</span>
                <p class="font-bold text-slate-800 uppercase">{{ t.contacto || 'SIN CONTACTO' }}</p>
                <p class="text-[10px] text-slate-400">{{ t.telefono || '—' }}</p>
              </div>
            </div>
            <div class="flex items-center justify-end gap-2 pt-2 border-t border-slate-50">
              <button @click="openEdit(t)" class="p-2 bg-slate-50 text-slate-600 rounded-xl hover:bg-primary-600 hover:text-white transition-all">
                <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/></svg>
              </button>
              <button @click="destroy(t.id)" class="p-2 bg-slate-50 text-red-600 rounded-xl hover:bg-red-600 hover:text-white transition-all">
                <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/></svg>
              </button>
            </div>
          </div>
        </template>
        <div v-else class="bg-white rounded-2xl border border-slate-100 shadow-sm p-8 text-center">
          <p class="text-slate-400 font-medium">No se encontraron talleres.</p>
        </div>
      </div>

      <!-- Pagination Placeholder -->
      <div class="mt-8 flex justify-between items-center px-4">
        <p class="text-[10px] font-black text-slate-400 uppercase tracking-[0.2em]">Red de Talleres: {{ totalTalleres }} Registros</p>
      </div>
    </div>

    <!-- Modal Premium -->
    <div v-if="showModal" class="fixed inset-0 z-[100] overflow-y-auto">
        <div class="flex items-center justify-center min-h-screen px-4 py-8">
            <div @click="showModal = false" class="fixed inset-0 bg-slate-900/60 backdrop-blur-md transition-opacity"></div>
            
            <div class="relative bg-white w-full max-w-2xl rounded-[3rem] shadow-2xl overflow-hidden glass-morphism border border-white/40">
                <div class="px-12 py-10 border-b border-slate-50 flex items-center justify-between bg-slate-50/50">
                    <div>
                        <h3 class="text-3xl font-black text-slate-900 tracking-tighter uppercase">{{ editingId ? 'Editar' : 'Nuevo' }} Taller</h3>
                        <p class="text-[10px] text-slate-400 font-black uppercase tracking-[0.2em] mt-1 italic">Configuración de nodo de red autorizado</p>
                    </div>
                    <button @click="showModal = false" class="w-12 h-12 rounded-2xl bg-white shadow-xl flex items-center justify-center text-slate-400 hover:text-slate-900 transition-all hover:rotate-90">✕</button>
                </div>

                <form @submit.prevent="submit" class="p-12 space-y-8">
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-10">
                        <div class="space-y-6">
                            <h4 class="text-[10px] font-black text-primary-600 uppercase tracking-[0.3em] flex items-center gap-2">
                                <span class="w-4 h-px bg-primary-600"></span> Identidad Corporativa
                            </h4>
                            
                            <div>
                                <label class="text-[10px] font-black uppercase text-slate-400 mb-3 block tracking-widest italic">Razón Social *</label>
                                <input v-model="form.razon_social" type="text" class="w-full px-6 py-4 bg-slate-50/50 border-2 border-transparent rounded-[1.5rem] text-sm font-bold focus:ring-0 focus:border-primary-500 focus:bg-white transition-all uppercase" required />
                            </div>

                            <div class="grid grid-cols-2 gap-4">
                                <div>
                                    <label class="text-[10px] font-black uppercase text-slate-400 mb-3 block tracking-widest italic">RUC *</label>
                                    <input v-model="form.ruc" type="text" class="w-full px-6 py-4 bg-slate-50/50 border-2 border-transparent rounded-[1.5rem] text-sm font-mono focus:ring-0 focus:border-primary-500 focus:bg-white transition-all" required />
                                </div>
                                <div>
                                    <label class="text-[10px] font-black uppercase text-slate-400 mb-3 block tracking-widest italic">Tipo Taller *</label>
                                    <select v-model="form.tipo" class="w-full px-6 py-4 bg-slate-50/50 border-2 border-transparent rounded-[1.5rem] text-xs font-bold focus:ring-0 focus:border-primary-500 focus:bg-white transition-all uppercase" required>
                                        <option v-for="t in tipos" :key="t" :value="t">{{ tiposLabels[t] }}</option>
                                    </select>
                                </div>
                            </div>

                            <div>
                                <label class="text-[10px] font-black uppercase text-slate-400 mb-3 block tracking-widest italic">Ciudad Sede</label>
                                <input v-model="form.ciudad" type="text" class="w-full px-6 py-4 bg-slate-50/50 border-2 border-transparent rounded-[1.5rem] text-sm font-bold focus:ring-0 focus:border-primary-500 focus:bg-white transition-all uppercase" />
                            </div>
                        </div>

                        <div class="space-y-6">
                            <h4 class="text-[10px] font-black text-primary-600 uppercase tracking-[0.3em] flex items-center gap-2">
                                <span class="w-4 h-px bg-primary-600"></span> Contacto Directo
                            </h4>
                            
                            <div>
                                <label class="text-[10px] font-black uppercase text-slate-400 mb-3 block tracking-widest italic">Persona de Contacto</label>
                                <input v-model="form.contacto" type="text" class="w-full px-6 py-4 bg-slate-50/50 border-2 border-transparent rounded-[1.5rem] text-sm font-bold focus:ring-0 focus:border-primary-500 focus:bg-white transition-all uppercase" />
                            </div>

                            <div>
                                <label class="text-[10px] font-black uppercase text-slate-400 mb-3 block tracking-widest italic">Email Corporativo</label>
                                <input v-model="form.email" type="email" class="w-full px-6 py-4 bg-slate-50/50 border-2 border-transparent rounded-[1.5rem] text-sm font-bold focus:ring-0 focus:border-primary-500 focus:bg-white transition-all shadow-inner uppercase" />
                            </div>

                            <div>
                                <label class="text-[10px] font-black uppercase text-slate-400 mb-3 block tracking-widest italic">Teléfono / WhatsApp</label>
                                <input v-model="form.telefono" type="text" class="w-full px-6 py-4 bg-slate-50/50 border-2 border-transparent rounded-[1.5rem] text-sm font-bold focus:ring-0 focus:border-primary-500 focus:bg-white transition-all shadow-inner" />
                            </div>
                        </div>
                    </div>

                    <div class="flex justify-end gap-6 pt-10 border-t border-slate-50">
                        <button type="button" @click="showModal = false" class="px-8 py-4 text-xs font-black text-slate-400 uppercase tracking-[0.2em] hover:text-slate-900 transition-colors italic">Descartar</button>
                        <button type="submit" :disabled="form.processing" class="px-12 py-4 bg-slate-900 text-white rounded-[1.5rem] font-black uppercase text-[10px] tracking-[0.2em] hover:bg-primary-600 disabled:opacity-50 shadow-2xl shadow-slate-200 transition-all active:scale-95 transform">
                            {{ form.processing ? 'Integrando...' : (editingId ? 'Actualizar Nodo' : 'Finalizar Registro') }}
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
  </AppLayout>
</template>

<style scoped>
.glass-morphism {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
</style>

