Merge branch 'bryam' of https://github.com/BryamE/ProyectoLauck into nLucas

This commit is contained in:
2026-04-04 16:58:10 -03:00
30 changed files with 484 additions and 328 deletions
+8 -8
View File
@@ -8,35 +8,35 @@
@if ($products->count() > 0)
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
@foreach ($products as $product)
<div class="group p-4 border border-neutral-800 rounded-xl hover:border-neon-lime hover:-translate-y-1 transition-all duration-300">
<div class="group p-4 border bg-stone-200/30 dark:bg-neutral-950/30 border-neutral-200 dark:border-neutral-800 rounded-xl hover:border-lime-500 hover:dark:border-neon-lime hover:-translate-y-1 transition-all duration-300">
{{-- Imagen si existe --}}
@if (!empty($product->image_path))
<img src="{{ asset('storage/' . $product->image_path) }}" alt="{{ $product->name }}"
class="w-full h-40 object-cover rounded mb-4">
@else
<div class="w-full border border-neutral-800 h-40 bg-stone-900 flex items-center justify-center rounded mb-4">
<span class="text-neon-lime text-md uppercase font-bold">Sin imagen</span>
<div class="w-full border border-neutral-200 dark:border-neutral-800 h-40 bg-stone-200 dark:bg-stone-900 flex items-center justify-center rounded mb-4">
<span class="text-lime-800 dark:text-neon-lime text-md uppercase font-bold">Sin imagen</span>
</div>
@endif
{{-- Nombre --}}
<h2 class="text-lg font-semibold text-white">{{ $product->name }}</h2>
<h2 class="text-lg font-semibold text-black dark:text-white">{{ $product->name }}</h2>
{{-- Descripción corta --}}
<div class="h-10 overflow-y-auto [scrollbar-width:none]">
@if (!empty($product->description))
<p class="text-sm text-gray-400 mt-2">{{ $product->description }}</p>
<p class="text-sm text-gray-700 dark:text-gray-400 mt-2">{{ $product->description }}</p>
@endif
</div>
{{-- Precio --}}
@if (!empty($product->price))
<p class="text-white group-hover:text-neon-lime font-bold mt-3 transition-colors">${{ number_format($product->price, 2, ',', '.') }}</p>
<p class="text-neutral-900 dark:text-white group-hover:text-lime-700 group-hover:dark:text-neon-lime font-bold mt-3 transition-colors">${{ number_format($product->price, 2, ',', '.') }}</p>
@endif
{{-- Botón --}}
<a href="{{ route('catalogo.show', $product) }}"
class="mt-4 block w-full bg-neon-lime/80 uppercase text-black font-semibold py-2 rounded-lg text-center shadow-md shadow-neon-lime/10 hover:bg-neutral-900/70 border border-transparent hover:text-neon-lime hover:shadow-neon-lime/20 hover:border-neutral-800 transition-all">
class="mt-4 block w-full bg-neutral-900 dark:bg-neon-lime/80 uppercase text-neon-lime dark:text-black font-semibold py-2 rounded-lg text-center shadow-md shadow-gray-900/10 dark:shadow-neon-lime/10 hover:bg-neon-lime hover:dark:bg-neutral-900/70 border border-transparent hover:text-black hover:dark:text-neon-lime hover:border-black hover:dark:border-neon-lime transition-all">
Ver +
</a>
@@ -44,7 +44,7 @@
@endforeach
</div>
@else
<p class="text-center text-gray-600 mt-10">No hay productos disponibles.</p>
<p class="text-center text-gray-400 dark:text-gray-600 mt-10">No hay productos disponibles.</p>
@endif
<div class="mt-3">
+22 -22
View File
@@ -3,23 +3,23 @@
<div class="container mx-auto px-4 py-8">
<!-- Botón Volver -->
<a href="{{ route('catalogo.index') }}" class="inline-flex items-center text-gray-400 hover:text-white mb-6 transition-colors">
<a href="{{ route('catalogo.index') }}" class="inline-flex items-center text-gray-700 dark:text-gray-400 hover:text-black hover:dark:text-white mb-6 transition-colors">
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path></svg>
Volver al Catálogo
</a>
<div class="bg-panel-bg rounded-xl shadow-2xl overflow-hidden border border-neutral-800">
<div class="bg-slate-100 dark:bg-panel-bg rounded-xl shadow-2xl overflow-hidden border border-neutral-300 dark:border-neutral-800">
<div class="grid grid-cols-1 md:grid-cols-2">
<!-- COLUMNA IZQUIERDA: IMAGEN (El cuadro verde de tu ejemplo) -->
<div class="bg-neutral-800 relative h-96 md:h-auto min-h-[500px] flex items-center justify-center py-4 group">
<!-- PANEL IZQUIERDO -->
<div class="bg-zinc-300 dark:bg-neutral-800 relative h-96 md:h-auto min-h-[500px] flex items-center justify-center py-4 group">
@if($product->image_path)
<img src="{{ asset('storage/' . $product->image_path) }}"
alt="{{ $product->name }}"
class="w-full h-full object-contain max-h-[500px] transform drop-shadow-lg">
@else
<div class="text-neutral-700 flex flex-col items-center">
<div class="text-neutral-400 dark:text-neutral-700 flex flex-col items-center">
<svg class="w-48 h-48" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5" 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></svg>
<span class="mt-4 text-gray-500 text-sm uppercase tracking-widest">Sin Imagen</span>
</div>
@@ -27,7 +27,7 @@
<!-- Badge de Tipo Flotante -->
<div class="absolute top-6 left-6">
<span class="bg-black/50 backdrop-blur text-white px-3 py-1 rounded-full text-xs font-bold uppercase tracking-wide border border-white/10">
<span class="bg-white/50 dark:bg-black/50 backdrop-blur text-black dark:text-white px-3 py-1 rounded-full text-xs font-bold uppercase tracking-wide border border-black/40 dark:border-white/10">
@if($product->type == 'bike')
Bicicleta
@elseif($product->type == 'clothing')
@@ -42,34 +42,34 @@
</div>
<!-- COLUMNA DERECHA: INFO (El cuadro azul de tu ejemplo) -->
<div class="p-8 md:p-12 flex flex-col justify-center bg-panel-bg">
<!-- PANEL DERECHO -->
<div class="p-8 md:p-12 flex flex-col justify-center bg-neutral-200 dark:bg-panel-bg">
<!-- Encabezado -->
<div class="mb-6 border-b border-neutral-800 pb-6">
<p class="text-neon-lime text-sm font-bold uppercase tracking-widest mb-2">SKU: {{ $product->sku ?? 'N/A' }}</p>
<h1 class="text-4xl font-black text-white italic mb-2 leading-tight">{{ $product->name }}</h1>
<div class="mb-6 border-b border-neutral-400 dark:border-neutral-700 pb-6">
<p class="text-stone-500 dark:text-neon-lime text-sm font-bold uppercase tracking-widest mb-2">SKU: {{ $product->sku ?? 'N/A' }}</p>
<h1 class="text-4xl font-black text-black dark:text-white italic mb-2 leading-tight">{{ $product->name }}</h1>
<!-- Stock Status -->
<div class="flex items-center gap-2 mt-4">
@if($product->stock_quantity > 5)
<span class="w-3 h-3 bg-green-500 rounded-full animate-pulse"></span>
<span class="text-green-400 text-sm font-bold">En Stock ({{ $product->stock_quantity }} unid.)</span>
<span class="w-3 h-3 bg-green-600 dark:bg-green-400 rounded-full animate-pulse"></span>
<span class="text-green-700 dark:text-green-400 text-sm font-bold">En Stock ({{ $product->stock_quantity }} unid.)</span>
@elseif($product->stock_quantity > 0)
<span class="w-3 h-3 bg-yellow-500 rounded-full animate-pulse"></span>
<span class="text-yellow-400 text-sm font-bold">¡Últimas Unidades! ({{ $product->stock_quantity }})</span>
<span class="w-3 h-3 bg-yellow-600 dark:bg-yellow-400 rounded-full animate-pulse"></span>
<span class="text-yellow-900 dark:text-yellow-400 text-sm font-bold">¡Últimas Unidades! ({{ $product->stock_quantity }})</span>
@else
<span class="w-3 h-3 bg-red-500 rounded-full"></span>
<span class="text-red-400 text-sm font-bold">Agotado</span>
<span class="text-red-700 dark:text-red-400 text-sm font-bold">Agotado</span>
@endif
</div>
</div>
<!-- Precio -->
<div class="mb-8">
<span class="block text-gray-400 text-xs uppercase mb-1">Precio Contado</span>
<span class="block text-gray-700 dark:text-gray-400 text-xs uppercase mb-1">Precio Contado</span>
<div class="flex items-baseline gap-2">
<span class="text-5xl font-black text-white">${{ number_format($product->price, 0, ',', '.') }}</span>
<span class="text-5xl font-black text-black dark:text-white">${{ number_format($product->price, 0, ',', '.') }}</span>
<span class="text-gray-500 font-medium">ARG</span>
</div>
<p class="text-gray-500 text-xs mt-2">* Consultar financiación en el local.</p>
@@ -77,20 +77,20 @@
<!-- Descripción -->
<div class="mb-8">
<h3 class="text-white font-bold uppercase text-sm mb-3">Descripción</h3>
<p class="text-gray-400 leading-relaxed">
<h3 class="text-black dark:text-white font-bold uppercase text-sm mb-3">Descripción</h3>
<p class="text-gray-700 dark:text-gray-400 leading-relaxed">
{{ $product->description ?? 'Sin descripción detallada disponible para este producto. Por favor, acérquese al local para más información.' }}
</p>
</div>
<!-- Botones de Acción -->
<div class="mt-auto grid grid-cols-1 sm:grid-cols-2 gap-4">
<button class="bg-neon-lime text-neutral-900 font-black py-4 px-6 rounded-lg hover:bg-[#b3e600] transition-all uppercase tracking-wide shadow-lg shadow-neon-lime/20 flex items-center justify-center gap-2 transform hover:-translate-y-1">
<a href="tel:+5403434220103" class="bg-neutral-900 dark:bg-neon-lime text-neon-lime dark:text-neutral-900 font-black py-4 px-6 rounded-lg hover:bg-neutral-800 hover:dark:bg-[#b3e600] transition-all uppercase tracking-wide shadow-lg shadow-black/20 dark:shadow-neon-lime/20 flex items-center justify-center gap-2 transform hover:-translate-y-1">
<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="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"></path></svg>
Consultar
</button>
<a href="https://wa.me/?text=Hola,%20me%20interesa%20el%20producto:%20{{ $product->name }}" target="_blank" class="bg-neutral-800 text-white font-bold py-4 px-6 rounded-lg hover:bg-neutral-700 border border-neutral-700 transition-all uppercase tracking-wide flex items-center justify-center gap-2">
<a href="https://wa.me/3434220103?text=Hola,%20me%20interesa%20el%20producto:%20{{ $product->name }}" target="_blank" class="bg-green-500 dark:bg-neutral-800 text-white font-bold py-4 px-6 rounded-lg hover:bg-green-600 hover:dark:bg-neutral-700 border border-white dark:border-neutral-700 transition-all uppercase tracking-wide flex items-center justify-center gap-2">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.008-.57-.008-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/></svg>
WhatsApp
</a>
+10 -15
View File
@@ -1,45 +1,40 @@
<x-layout title="Lauck - Nuevo Cliente">
<x-section-header subtitle="Gestión de Clientes" title="Nuevo " highlight="Cliente" />
<div class="w-full max-w-4xl mx-auto bg-panel-bg border border-neutral-800 rounded-xl p-8 shadow-lg">
<div class="w-full max-w-4xl mx-auto bg-gray-200 dark:bg-panel-bg border border-neutral-400 dark:border-neutral-800 rounded-xl p-8 shadow-lg">
<form action="{{ route('clients.store') }}" method="POST">
@csrf
<input type="hidden" name="origin" value="{{ request('origin') }}">
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-6">
<!-- Nombre -->
<div class="md:col-span-4">
<x-forms.label for="name" value="Nombre Completo" />
<x-forms.input id="name" name="name" type="text" :value="old('name')" required autofocus placeholder="Ej: Sergio Lauck" :error="$errors->first('name')" />
<x-forms.input id="name" name="name" type="text" :value="old('name')" required autofocus placeholder="Ej: Juan Pérez" :error="$errors->first('name')" />
</div>
<!-- Telefono -->
<div class="md:col-span-2">
<x-forms.label for="phone" value="Teléfono / WhatsApp" />
<x-forms.input id="phone" name="phone" type="text" :value="old('phone')" placeholder="Ej: 343 154..." :error="$errors->first('phone')" />
</div>
<!-- Correo -->
<div class="md:col-span-2">
<x-forms.label for="email" value="Correo Electrónico" />
<x-forms.input id="email" name="email" type="email" :value="old('email')" placeholder="cliente@ejemplo.com" :error="$errors->first('email')" />
</div>
<!-- Direccion -->
<div class="md:col-span-4">
<x-forms.label for="address" value="Dirección / Domicilio" />
<textarea id="address" name="address" rows="3" class="bg-neutral-800 border-neutral-700 text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5 placeholder-gray-500" placeholder="Calle, número, piso...">{{ old('address') }}</textarea>
<textarea id="address" name="address" rows="3" class="bg-gray-300 dark:bg-neutral-800 border border-neutral-400 dark:border-neutral-700 dark:text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5 placeholder-neutral-600 dark:placeholder-gray-400" placeholder="Calle, número, piso...">{{ old('address') }}</textarea>
@error('address')
<span class="text-red-500 text-xs mt-1">{{ $message }}</span>
@enderror
</div>
</div>
<div class="flex items-center justify-between md:justify-end space-x-4 border-t border-neutral-800 pt-6">
<a href="{{ route('clients.index') }}" class="text-gray-400 hover:text-white font-medium text-sm transition-colors">Cancelar</a>
<button type="submit" class="px-6 py-2.5 bg-neon-lime text-neutral-900 font-bold rounded-lg hover:bg-[#b3e600] transition-colors shadow-lg shadow-neon-lime/20">
<div class="flex items-center justify-between md:justify-end space-x-4 border-t border-neutral-400 dark:border-neutral-700 pt-6">
<a href="{{ route('clients.index') }}" class="text-gray-700 dark:text-gray-400 hover:text-black hover:dark:text-white font-medium text-sm transition-colors">Cancelar</a>
<button type="submit" class="px-6 py-2.5 bg-neutral-900 dark:bg-neon-lime text-neon-lime dark:text-neutral-900 font-bold rounded-lg hover:bg-neutral-800 hover:dark:bg-[#b3e600] transition-colors shadow-lg dark:shadow-neon-lime/20">
Guardar Cliente
</button>
</div>
+14 -48
View File
@@ -1,75 +1,41 @@
<x-layout title="Lauck - Editar Cliente">
<x-section-header subtitle="Gestión de Clientes" title="Editar " highlight="Cliente" />
<div class="w-full max-w-4xl mx-auto bg-panel-bg border border-neutral-800 rounded-xl p-8 shadow-lg">
<div class="w-full max-w-4xl mx-auto bg-gray-200 dark:bg-panel-bg border border-neutral-400 dark:border-neutral-800 rounded-xl p-8 shadow-lg">
<form action="{{ route('clients.update', $client) }}" method="POST">
@csrf
@method('PUT') <div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-6">
@method('PUT')
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-6">
<!-- Nombre -->
<div class="md:col-span-4">
<x-forms.label for="name" value="Nombre Completo" />
<x-forms.input
id="name"
name="name"
type="text"
:value="old('name', $client->name)"
required
autofocus
placeholder="Ej: Sergio Lauck"
:error="$errors->first('name')"
/>
<x-forms.input id="name" name="name" type="text" :value="old('name', $client->name)" required autofocus placeholder="Ej: Juan Pérez" :error="$errors->first('name')" />
</div>
<!-- Telefono -->
<div class="md:col-span-2">
<x-forms.label for="phone" value="Teléfono / WhatsApp" />
<x-forms.input
id="phone"
name="phone"
type="text"
:value="old('phone', $client->phone)"
placeholder="Ej: 343 154..."
:error="$errors->first('phone')"
/>
<x-forms.input id="phone" name="phone" type="text" :value="old('phone', $client->phone)" placeholder="Ej: 343 154..." :error="$errors->first('phone')" />
</div>
<!-- Correo -->
<div class="md:col-span-2">
<x-forms.label for="email" value="Correo Electrónico" />
<x-forms.input
id="email"
name="email"
type="email"
:value="old('email', $client->email)"
placeholder="cliente@ejemplo.com"
:error="$errors->first('email')"
/>
<x-forms.input id="email" name="email" type="email" :value="old('email', $client->email)" placeholder="cliente@ejemplo.com" :error="$errors->first('email')" />
</div>
<!-- Direccion -->
<div class="md:col-span-4">
<x-forms.label for="address" value="Dirección / Domicilio" />
<textarea
id="address"
name="address"
rows="3"
class="bg-neutral-800 border-neutral-700 text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5 placeholder-gray-500"
placeholder="Calle, número, piso..."
>{{ old('address', $client->address) }}</textarea>
<textarea id="address" name="address" rows="3" class="bg-gray-300 dark:bg-neutral-800 border border-neutral-400 dark:border-neutral-700 dark:text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5 placeholder-gray-500" placeholder="Calle, número, piso...">{{ old('address', $client->address) }}</textarea>
@error('address')
<span class="text-red-500 text-xs mt-1">{{ $message }}</span>
@enderror
</div>
</div>
<div class="flex items-center justify-between md:justify-end space-x-4 border-t border-neutral-800 pt-6">
<a href="{{ route('clients.index') }}" class="text-gray-400 hover:text-white font-medium text-sm transition-colors">
Cancelar
</a>
<button type="submit" class="px-6 py-2.5 bg-neon-lime text-neutral-900 font-bold rounded-lg hover:bg-[#b3e600] transition-colors shadow-lg shadow-neon-lime/20">
<div class="flex items-center justify-between md:justify-end space-x-4 border-t border-neutral-400 dark:border-neutral-700 pt-6">
<a href="{{ route('clients.index') }}" class="text-gray-800 dark:text-gray-400 hover:text-black hover:dark:text-white font-medium text-sm transition-colors">Cancelar</a>
<button type="submit" class="px-4 py-2.5 bg-neutral-900 dark:bg-neon-lime text-neon-lime dark:text-neutral-900 font-bold rounded-lg hover:bg-neutral-800 hover:dark:bg-[#b3e600] transition-colors shadow-lg dark:shadow-neon-lime/20">
Actualizar Cliente
</button>
</div>
+26 -26
View File
@@ -2,6 +2,8 @@
<x-section-header subtitle="Gestión de Clientes" title="Cartera de " highlight="Clientes" />
<!-- Mensajes de feedback -->
<x-ui.alert />
@if(session('success'))
<div class="bg-green-900/50 border border-green-500 text-green-300 px-4 py-3 rounded-lg mb-6 shadow-sm">
{{ session('success') }}
@@ -13,24 +15,24 @@
<form action="{{ route('clients.index') }}" method="GET" class="w-full md:w-1/2">
<div class="relative">
<div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
<svg class="w-4 h-4 text-gray-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
<svg class="w-4 h-4 text-gray-600 dark:text-gray-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/>
</svg>
</div>
<input type="text" name="search" value="{{ request('search') }}"
class="block w-full p-3 ps-10 text-sm text-white border border-neutral-700 rounded-lg bg-neutral-800 focus:ring-neon-lime focus:border-neon-lime placeholder-gray-500"
class="block w-full p-3 ps-10 text-sm text-black dark:text-white border border-neutral-400 dark:border-neutral-700 rounded-lg bg-neutral-200 dark:bg-neutral-800 placeholder-gray-600 dark:placeholder-gray-500"
placeholder="Buscar por nombre, teléfono o email...">
</div>
</form>
<a href="{{ route('clients.create') }}" class="w-full md:w-auto text-center px-5 py-3 text-sm font-bold text-neutral-900 bg-neon-lime rounded-lg hover:bg-[#b3e600] transition-colors uppercase tracking-wide shadow-lg shadow-neon-lime/20">
<a href="{{ route('clients.create') }}" class="w-full md:w-auto text-center px-5 py-3 text-sm font-bold text-neon-lime dark:text-neutral-900 bg-neutral-950 dark:bg-neon-lime rounded-lg hover:bg-neutral-900/80 hover:dark:bg-[#b3e600] transition-colors uppercase tracking-wide">
+ Nuevo Cliente
</a>
</div>
<div class="relative overflow-x-auto shadow-md sm:rounded-lg border border-neutral-800 w-full">
<table class="w-full text-sm text-left rtl:text-right text-gray-400">
<thead class="text-xs text-gray-300 uppercase bg-neutral-800 border-b border-neutral-700">
<div class="relative overflow-x-auto shadow-md sm:rounded-lg border border-gray-400 dark:border-neutral-800 w-full">
<table class="w-full text-sm text-left rtl:text-right text-neutral-900 dark:text-white">
<thead class="text-xs text-neutral-800 dark:text-gray-300 uppercase bg-gray-400 dark:bg-neutral-800 border-b border-gray-300 dark:border-neutral-700">
<tr>
<th scope="col" class="px-6 py-3">Cliente / Email</th>
<th scope="col" class="px-6 py-3">Teléfono / WhatsApp</th>
@@ -40,45 +42,43 @@
</thead>
<tbody>
@forelse($clients as $client)
<tr class="bg-neutral-900/50 border-b border-neutral-800 hover:bg-neutral-800 transition-colors group">
<tr class="bg-gray-200/50 dark:bg-neutral-900/50 border-b border-gray-400 dark:border-neutral-800 hover:bg-gray-400 hover:dark:bg-neutral-800 transition-colors group">
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-base font-bold text-white">{{ $client->name }}</div>
<div class="text-xs text-gray-500 font-mono">
<div class="text-base font-bold">{{ $client->name }}</div>
<div class="text-xs text-gray-600 dark:text-gray-400 font-mono">
{{ $client->email ?? 'Sin email registrado' }}
</div>
</td>
<td class="px-6 py-4">
@if($client->phone)
<div class="flex items-center gap-2">
<span class="font-mono text-gray-300">{{ $client->phone }}</span>
<span class="text-green-500 text-xs bg-green-900/30 px-1.5 py-0.5 rounded">WA</span>
<span class="font-mono">{{ $client->phone }}</span>
<span class="text-xs text-green-600 border border-green-600 px-1.5 py-0.5 rounded">WA</span>
</div>
@else
<span class="text-gray-600 italic">No registrado</span>
<span class="italic">No registrado</span>
@endif
</td>
<td class="px-6 py-4">
<span class="text-gray-400 truncate max-w-xs block" title="{{ $client->address }}">
<span class="truncate max-w-xs block" title="{{ $client->address }}">
{{ $client->address ?? '-' }}
</span>
</td>
<td class="px-6 py-4 text-right flex items-center justify-end gap-3">
<a href="{{ route('clients.edit', $client) }}" class="font-medium text-blue-400 hover:text-blue-300 hover:underline transition-colors">
Editar
<td class="px-6 py-4 text-right flex items-center justify-end gap-2">
<a href="{{ route('clients.edit', $client) }}" title="Editar" class="font-semibold p-2 text-blue-700 dark:text-blue-400 border-2 border-blue-700 rounded-lg hover:bg-blue-700 hover:text-white dark:hover:text-white transition-colors">
<svg class="size-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m14.304 4.844 2.852 2.852M7 7H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-4.5m2.409-9.91a2.017 2.017 0 0 1 0 2.853l-6.844 6.844L8 14l.713-3.565 6.844-6.844a2.015 2.015 0 0 1 2.852 0Z"/>
</svg>
</a>
<form action="{{ route('clients.destroy', $client) }}" method="POST" class="inline-block" onsubmit="return confirm('¿Estás seguro de que deseas eliminar este cliente? Esta acción no se puede deshacer.');">
<form action="{{route('clients.destroy',$client)}}" method="post">
@csrf
@method('DELETE')
<button type="submit" class="font-medium text-red-500 hover:text-red-400 hover:underline transition-colors cursor-pointer bg-transparent border-0 p-0">
Eliminar
<button title="Eliminar" type="submit" class="w-full sm:w-auto p-2 font-bold dark:font-medium text-red-600 dark:text-red-400 border-2 border-red-600 rounded-lg hover:bg-red-600 hover:text-white dark:hover:text-white transition-colors">
<svg class="size-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 7h14m-9 3v8m4-8v8M10 3h4a1 1 0 0 1 1 1v3H9V4a1 1 0 0 1 1-1ZM6 7h12v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7Z"/>
</svg>
</button>
</form>
</form>
</td>
</tr>
+7 -7
View File
@@ -1,16 +1,16 @@
<footer class="bg-neutral-900 border-t border-white/5 mt-auto z-10 w-full">
<footer class="bg-slate-100 dark:bg-neutral-900 border-t border-black/5 dark:border-white/5 mt-auto z-10 w-full">
<div class="w-full max-w-7xl mx-auto p-8">
<div class="sm:flex sm:items-center sm:justify-between">
<a href="{{ url('/') }}" class="flex items-center mb-4 sm:mb-0 space-x-3 rtl:space-x-reverse grayscale opacity-70 hover:grayscale-0 hover:opacity-100 transition-all">
<svg class="h-8 text-neon-lime" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2L2 7l10 5 10-5-10-5zm0 9l2.5-1.25L12 8.5l-2.5 1.25L12 11zm0 2.5l-5-2.5-5 2.5L12 22l10-8.5-5-2.5-5 2.5z"/></svg>
<span class="self-center text-xl font-bold whitespace-nowrap text-white">Cicles Lauck</span>
<svg class="h-8 text-lime-600 dark:text-neon-lime" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2L2 7l10 5 10-5-10-5zm0 9l2.5-1.25L12 8.5l-2.5 1.25L12 11zm0 2.5l-5-2.5-5 2.5L12 22l10-8.5-5-2.5-5 2.5z"/></svg>
<span class="self-center text-xl font-bold whitespace-nowrap dark:text-white">Cicles Lauck</span>
</a>
<ul class="flex flex-wrap items-center mb-6 text-sm font-medium text-gray-500 sm:mb-0">
<li><a href="#" class="hover:text-neon-lime hover:underline me-4 md:me-6 transition-colors">Soporte</a></li>
<li><a href="#" class="hover:text-neon-lime hover:underline transition-colors">Contacto</a></li>
<li><a href="#" class="hover:text-lime-600 hover:dark:text-neon-lime hover:underline me-4 md:me-6 transition-colors">Soporte</a></li>
<li><a href="#" class="hover:text-lime-600 hover:dark:text-neon-lime hover:underline transition-colors">Contacto</a></li>
</ul>
</div>
<hr class="my-6 border-neutral-800 sm:mx-auto lg:my-8">
<span class="block text-sm text-gray-600 sm:text-center">© {{ date('Y') }} <a href="#" class="hover:text-neon-lime transition-colors">Lauck Systems™</a>.</span>
<hr class="my-6 border-neutral-200 dark:border-neutral-800 sm:mx-auto lg:my-8">
<span class="block text-sm text-gray-600 sm:text-center">© {{ date('Y') }} <a href="#" class="hover:text-lime-700 hover:dark:text-neon-lime transition-colors">Lauck Systems™</a>.</span>
</div>
</footer>
@@ -1,6 +1,6 @@
@props(['disabled' => false, 'error' => null])
<input {{ $disabled ? 'disabled' : ''}} {!! $attributes->merge(['class' => 'bg-neutral-800 border-neutral-700 text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5 placeholder-gray-500 transition-colors ' . ($error ? 'border-red-500 focus:border-red-500 focus:ring-red-500' : '')]) !!}>
<input {{ $disabled ? 'disabled' : ''}} {!! $attributes->merge(['class' => 'bg-gray-300 dark:bg-neutral-800 border border-neutral-400 dark:border-neutral-700 dark:text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5 placeholder-neutral-600 dark:placeholder-gray-400 transition-colors ' . ($error ? 'border-red-500 focus:border-red-500 focus:ring-red-500' : '')]) !!}>
@if($error)
<p class="mt-1 text-xs text-red-400">{{ $error }}</p>
@@ -1,5 +1,5 @@
@props(['value'])
<label {!! $attributes->merge(['class' => 'block mb-2 text-xs font-bold text-gray-400 uppercase tracking-wider']) !!}>
<label {!! $attributes->merge(['class' => 'block mb-2 text-xs font-bold text-gray-700 dark:text-gray-300 uppercase tracking-wider']) !!}>
{{$value ?? $slot}}
</label>
+22 -1
View File
@@ -4,6 +4,25 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="csrf-token" content="{{ csrf_token() }}">
<script type="module">
// Revisamos el almacenamiento local o las preferencias del sistema
if (localStorage.getItem('theme') === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
// Función global para cambiar el tema desde cualquier botón
window.toggleTheme = function() {
if (document.documentElement.classList.contains('dark')) {
document.documentElement.classList.remove('dark');
localStorage.setItem('theme', 'light');
} else {
document.documentElement.classList.add('dark');
localStorage.setItem('theme', 'dark');
}
}
</script>
<title>{{ $title ?? 'Lauck Dashboard' }}</title>
@stack('styles')
@@ -11,7 +30,7 @@
@vite(['resources/css/app.css', 'resources/js/app.js'])
</head>
<body class="bg-dark-bg text-gray-300 font-sans antialiased min-h-screen flex flex-col relative overflow-x-hidden">
<body class="bg-gray-50 dark:bg-dark-bg text-gray-900 dark:text-gray-300 font-sans antialiased min-h-screen flex flex-col relative transition-colors overflow-x-hidden">
<!-- Fondo grilla global -->
<div class="inset-0 bg-grid-pattern opacity-[0.15] z-0 pointer-events-none fixed"></div>
@@ -35,6 +54,8 @@
if(btn && menu) {
btn.addEventListener('click', () => menu.classList.toggle('hidden'));
}
</script>
@stack('scripts')
+20 -13
View File
@@ -1,4 +1,4 @@
<nav class="bg-neutral-900/90 backdrop-blur-md border-b border-white/10 w-full z-50 sticky top-0">
<nav class="bg-slate-100/90 dark:bg-neutral-900/90 backdrop-blur-md border-b border-black/10 dark:border-white/10 w-full z-50 sticky top-0">
<div class="max-w-7xl flex flex-wrap items-center justify-between mx-auto p-4">
<!-- Logo -->
@@ -8,11 +8,11 @@
@guest
<a href="{{ url('/') }}" class="flex items-center space-x-3 rtl:space-x-reverse group">
@endguest
<div class="h-10 w-10 bg-neutral-800 rounded-full flex items-center justify-center border-2 border-transparent group-hover:border-neon-lime transition-all duration-300">
<svg class="w-6 h-6 text-white group-hover:text-neon-lime transition-colors" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg>
<div class="h-10 w-10 bg-slate-200 dark:bg-neutral-800 rounded-full flex items-center justify-center border-2 border-transparent group-hover:border-lime-700 group-hover:dark:border-neon-lime transition-all duration-300">
<svg class="w-6 h-6 dark:text-white group-hover:text-lime-700 group-hover:dark:text-neon-lime transition-colors" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg>
</div>
<span class="self-center text-2xl font-black whitespace-nowrap text-white italic tracking-wide group-hover:text-neon-lime transition-colors duration-300">
LAUCK<span class="text-neon-lime font-light not-italic">SYS</span>
<span class="self-center text-2xl font-black whitespace-nowrap dark:text-white italic tracking-wide group-hover:text-lime-700 group-hover:dark:text-neon-lime transition-colors duration-300">
LAUCK<span class="text-lime-700 dark:text-neon-lime font-light not-italic">SYS</span>
</span>
</a>
@@ -31,35 +31,42 @@
@auth
<li>
<a href="{{ url('/dashboard') }}"
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('dashboard') ? 'text-neon-lime border-b-2 border-neon-lime' : 'text-white hover:text-neon-lime' }}">
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('dashboard') ? 'text-lime-600 dark:text-neon-lime border-b-2 border-lime-600 dark:border-neon-lime' : 'dark:text-white hover:text-lime-600 hover:dark:text-neon-lime' }}">
Inicio
</a>
</li>
<li>
<a href="{{ url('/productos') }}"
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('productos*') ? 'text-neon-lime border-b-2 border-neon-lime' : 'text-white hover:text-neon-lime' }}">
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('productos*') ? 'text-lime-600 dark:text-neon-lime border-b-2 border-lime-600 dark:border-neon-lime' : 'dark:text-white hover:text-lime-600 hover:dark:text-neon-lime' }}">
Stock
</a>
</li>
<li>
<a href="{{ route('taller.index') }}"
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('taller*') ? 'text-neon-lime border-b-2 border-neon-lime' : 'text-white hover:text-neon-lime' }}">
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('taller*') ? 'text-lime-600 dark:text-neon-lime border-b-2 border-lime-600 dark:border-neon-lime' : 'dark:text-white hover:text-lime-600 hover:dark:text-neon-lime' }}">
Taller
</a>
</li>
<li>
<a href="{{ route('sales.index') }}"
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('sales*') ? 'text-neon-lime border-b-2 border-neon-lime' : 'text-white hover:text-neon-lime' }}">
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('sales*') ? 'text-lime-600 dark:text-neon-lime border-b-2 border-lime-600 dark:border-neon-lime' : 'dark:text-white hover:text-lime-600 hover:dark:text-neon-lime' }}">
Ventas
</a>
</li>
@endauth
<button onclick="toggleTheme()" class="p-2 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors rounded-full hover:bg-gray-200 dark:hover:bg-neutral-800">
<!-- Icono de Sol (Se muestra en modo oscuro) -->
<svg class="w-5 h-5 hidden dark:block" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"></path></svg>
<!-- Icono de Luna (Se muestra en modo claro) -->
<svg class="w-5 h-5 block dark:hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"></path></svg>
</button>
{{-- LÓGICA DE VISITANTE (GUEST) --}}
@guest
<li>
<a href="{{ url('/catalogo') }}"
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('catalogo*') ? 'text-neon-lime border-b-2 border-neon-lime' : 'text-white hover:text-neon-lime' }}">
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('catalogo*') ? 'text-lime-600 dark:text-neon-lime border-b-2 border-lime-600 dark:border-neon-lime' : 'dark:text-white hover:text-lime-600 hover:dark:text-neon-lime' }}">
Catalogo
</a>
</li>
@@ -69,9 +76,9 @@
<form action="{{ route('catalogo.index') }}" method="GET">
<div class="relative">
<input type="text" name="search"
class="block w-full md:w-48 p-2 ps-3 text-xs text-white border border-neutral-600 rounded-full bg-neutral-800/50 focus:ring-neon-lime focus:border-neon-lime placeholder-gray-500 transition-all focus:w-full md:focus:w-64"
class="block w-full md:w-48 p-2 ps-3 text-xs dark:text-white border border-slate-400 dark:border-neutral-600 rounded-full bg-slate-300/50 dark:bg-neutral-800/50 focus:ring-neon-lime focus:border-neon-lime placeholder-gray-500 transition-all focus:w-full md:focus:w-64"
placeholder="Buscar productos...">
<button type="submit" class="absolute top-0 end-0 p-2 text-sm font-medium h-full text-white rounded-e-lg hover:text-neon-lime">
<button type="submit" class="absolute top-0 end-0 p-2 text-sm font-medium h-full dark:text-white rounded-e-lg hover:text-lime-600 hover:dark:text-neon-lime">
<svg class="w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/>
</svg>
@@ -83,7 +90,7 @@
<!-- Botón Login Resaltado -->
<li>
<a href="{{ route('login') }}"
class="block py-2 px-5 text-center text-neutral-900 bg-neon-lime font-black rounded hover:bg-[#b3e600] transition-colors uppercase tracking-wider text-xs shadow-lg shadow-neon-lime/20 hover:shadow-neon-lime/40 transform hover:-translate-y-0.5 duration-200">
class="block py-2 px-5 text-center text-neon-lime dark:text-neutral-900 bg-neutral-900 dark:bg-neon-lime font-black rounded hover:dark:bg-[#b3e600] transition-colors uppercase tracking-wider text-xs shadow-lg shadow-gray-300 dark:shadow-neon-lime/20 hover:dark:shadow-neon-lime/40 transform hover:-translate-y-0.5 duration-200">
Ingresar
</a>
</li>
@@ -1,11 +1,11 @@
@props(['subtitle', 'title', 'highlight' => null])
<div class="w-full text-left mb-10 border-l-4 border-neon-lime pl-6 py-2">
<h2 class="text-neutral-400 text-sm font-bold uppercase tracking-widest mb-1">{{ $subtitle }}</h2>
<h1 class="font-black text-4xl md:text-5xl text-white uppercase italic">
<div class="w-full text-left mb-10 border-l-4 border-lime-600 dark:border-neon-lime pl-6 py-2">
<h2 class="text-neutral-600 dark:text-neutral-400 text-sm font-bold uppercase tracking-widest mb-1">{{ $subtitle }}</h2>
<h1 class="font-black text-4xl md:text-5xl text-black dark:text-white uppercase italic">
{{ $title }}
@if($highlight)
<span class="text-transparent bg-clip-text bg-gradient-to-r from-white to-gray-500 pe-2">{{ $highlight }}</span>
<span class="text-transparent bg-clip-text bg-gradient-to-r from-neutral-900 dark:from-white to-lime-500 dark:to-gray-500 pe-2">{{ $highlight }}</span>
@endif
</h1>
</div>
@@ -1,11 +1,11 @@
@if (session('success'))
<div class="p-4 mb-4 text-sm text-green-400 rounded-lg bg-neutral-800 border border-green-800/50" role="alert">
<div class="p-4 mb-4 text-md text-black rounded-lg bg-green-500 border border-green-800/50" role="alert">
<span class="font-bold">¡Éxito!</span> {{ session('success') }}
</div>
@endif
@if (session('error'))
<div class="p-4 mb-4 text-sm text-red-400 rounded-lg bg-neutral-800 border border-red-800/50" role="alert">
<div class="p-4 mb-4 text-md text-black rounded-lg bg-red-500 border border-red-800/50" role="alert">
<span class="font-bold">Error:</span> {{ session('error') }}
</div>
@endif
@@ -2,12 +2,12 @@
@php
$colors = [
'gray' => 'bg-gray-700 text-gray-300',
'red' => 'bg-red-900/50 text-red-300 border border-red-800',
'blue' => 'bg-blue-900/50 text-blue-300 border border-blue-800',
'green' => 'bg-green-900/50 text-green-300 border border-green-800',
'yellow' => 'bg-yellow-900/50 text-yellow-300 border border-yellow-800',
'neon' => 'bg-[#ccff00]/10 text-[#ccff00] border border-[#ccff00]/50',
'gray' => 'bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-300',
'red' => 'bg-red-200 dark:bg-red-900/50 text-red-800 dark:text-red-300 border border-red-500 dark:border-red-800',
'blue' => 'bg-blue-200 dark:bg-blue-900/50 text-blue-800 dark:text-blue-300 border border-blue-500 dark:border-blue-800',
'green' => 'bg-green-200 dark:bg-green-900/50 text-green-800 dark:text-green-300 border border-green-500 dark:border-green-800',
'yellow' => 'bg-yellow-200 dark:bg-yellow-900/50 text-yellow-800 dark:text-yellow-300 border border-yellow-500 dark:border-yellow-800',
'neon' => 'bg-lime-200 dark:bg-[#ccff00]/10 text-lime-800 dark:text-[#ccff00] border border-lime-700 dark:border-[#ccff00]/50',
];
$classes = $colors[$color] ?? $colors['gray'];
@endphp
+5 -5
View File
@@ -1,15 +1,15 @@
@props(['href' => '#', 'title', 'description', 'linkText' => 'Ver detalles'])
<a href="{{ $href }}" class="group relative block p-6 bg-panel-bg border border-neutral-800 rounded-xl hover:border-neon-lime hover:-translate-y-1 transition-all duration-300 shadow-lg hover:shadow-neon-lime/20 h-full">
<a href="{{ $href }}" class="group relative block p-6 bg-white dark:bg-panel-bg border border-neutral-200 dark:border-neutral-800 rounded-xl hover:border-neutral-600 hover:dark:border-neon-lime hover:-translate-y-1 transition-all duration-300 shadow-lg hover:dark:shadow-neon-lime/20 h-full">
<!-- slot para SVG -->
<div class="absolute top-0 right-0 p-4 opacity-10 group-hover:opacity-100 transition-opacity">
<div class="absolute top-0 right-0 p-4 opacity-30 dark:opacity-10 group-hover:opacity-100 transition-opacity">
{{ $slot }}
</div>
<h3 class="mt-4 text-xl font-bold text-white group-hover:text-neon-lime transition-colors">{{ $title }}</h3>
<p class="mt-2 text-sm text-gray-500">{{ $description }}</p>
<h3 class="mt-4 text-xl font-bold text-black dark:text-white group-hover:text-lime-500 group-hover:dark:text-neon-lime transition-colors">{{ $title }}</h3>
<p class="mt-2 text-sm text-gray-700 dark:text-gray-500">{{ $description }}</p>
<div class="mt-6 inline-flex items-center text-xs font-bold text-neon-lime uppercase tracking-wider">
<div class="mt-6 inline-flex items-center text-xs font-bold text-lime-500 dark:text-neon-lime uppercase tracking-wider">
{{ $linkText }} <span class="ml-2 group-hover:translate-x-1 transition-transform"></span>
</div>
</a>
@@ -1,10 +1,10 @@
@props(['items'])
<div class="relative w-full overflow-hidden rounded-xl border border-neutral-800 bg-panel-bg shadow-xl group" id="lauck-carousel">
<div class="relative w-full overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800 bg-slate-50 dark:bg-panel-bg shadow-xl group" id="lauck-carousel">
<!-- Título Flotante (Opcional) -->
<div class="absolute top-4 left-6 z-10 bg-black/50 backdrop-blur-sm px-3 py-1 rounded border border-neon-lime/30">
<span class="text-xs font-bold text-neon-lime uppercase tracking-widest">Destacados</span>
<div class="absolute top-4 left-6 z-10 bg-neon-lime/50 dark:bg-black/50 backdrop-blur-sm px-3 py-1 rounded border border-black/30 dark:border-neon-lime/30">
<span class="text-xs font-bold text-black dark:text-neon-lime uppercase tracking-widest">Destacados</span>
</div>
<!-- Contenedor de Slides (Track) -->
@@ -13,40 +13,40 @@
<div class="w-full flex-shrink-0 flex flex-col md:flex-row h-full relative">
<!-- Imagen / Visual (Izquierda o Fondo) -->
<div class="w-full md:w-1/2 bg-neutral-800 flex items-center justify-center relative overflow-hidden">
<div class="w-full md:w-1/2 bg-neutral-200 dark:bg-neutral-800 flex items-center justify-center relative overflow-hidden">
<!-- Decoración de fondo -->
<div class="absolute inset-0 bg-grid-pattern opacity-10"></div>
<!-- Icono Gigante (Placeholder de Bici) -->
<div class="text-neutral-700 transform group-hover:scale-110 transition-transform duration-700">
<div class="text-neutral-300 dark:text-neutral-700 transform group-hover:scale-110 transition-transform duration-700">
@if($item->image_path)
<img src="{{ asset('storage/' . $item->image_path) }}" alt="{{ $item->name }}" class="w-full h-full object-cover">
@else
<!-- Placeholder si no tiene foto -->
<div class="w-full h-full flex items-center justify-center bg-neutral-800">
<div class="w-full h-full flex items-center justify-center bg-neutral-200 dark:bg-neutral-800">
<svg class="w-48 h-48" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5" 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></svg>
</div>
@endif
</div>
<!-- Precio Flotante -->
<div class="absolute bottom-4 left-4 bg-neon-lime text-neutral-900 font-black px-4 py-2 rounded-lg text-xl shadow-lg shadow-neon-lime/20">
<div class="absolute bottom-4 left-4 bg-neutral-900 dark:bg-neon-lime text-neon-lime dark:text-neutral-900 font-black px-4 py-2 rounded-lg text-xl shadow-lg shadow-gray-800/10 dark:shadow-neon-lime/20">
${{ number_format($item->price, 0, ',', '.') }}
</div>
</div>
<!-- Info (Derecha) -->
<div class="w-full md:w-1/2 p-8 md:p-12 flex flex-col justify-center bg-gradient-to-br from-panel-bg to-neutral-900">
<h3 class="text-sm font-bold text-gray-400 uppercase tracking-widest mb-2">{{ $item->sku }}</h3>
<h2 class="text-3xl md:text-4xl font-black text-white italic mb-4 leading-tight">
<div class="w-full md:w-1/2 p-8 md:p-12 flex flex-col justify-center bg-gradient-to-br from-gray-200 dark:from-panel-bg to-neutral-100 dark:to-neutral-900">
<h3 class="text-sm font-bold text-gray-600 dark:text-gray-400 uppercase tracking-widest mb-2">{{ $item->sku }}</h3>
<h2 class="text-3xl md:text-4xl font-black text-black dark:text-white italic mb-4 leading-tight">
{{ $item->name }}
</h2>
<p class="text-gray-400 text-sm md:text-base mb-8 line-clamp-3">
<p class="text-gray-600 dark:text-gray-400 text-sm md:text-base mb-8 line-clamp-3">
{{ $item->description ?? 'Una bicicleta diseñada para el máximo rendimiento en todo terreno. Consultar especificaciones técnicas en el catálogo.' }}
</p>
<div class="flex gap-4">
<a href="{{ route('catalogo.show', $item) }}" class="px-6 py-3 bg-white text-neutral-900 font-bold uppercase tracking-wider rounded hover:bg-gray-200 transition-colors">
<a href="{{ route('catalogo.show', $item) }}" class="px-6 py-3 bg-black dark:bg-white text-neutral-100 dark:text-neutral-900 font-bold uppercase tracking-wider rounded hover:bg-neutral-800 hover:dark:bg-gray-200 transition-colors">
Ver Detalles
</a>
</div>
@@ -54,7 +54,7 @@
</div>
@empty
<!-- Slide de Fallback por si no hay datos -->
<div class="w-full flex-shrink-0 flex items-center justify-center h-full bg-neutral-800 text-gray-500">
<div class="w-full flex-shrink-0 flex items-center justify-center h-full bg-neutral-200 dark:bg-neutral-800 text-gray-500">
<p>No hay productos destacados disponibles.</p>
</div>
@endforelse
@@ -72,7 +72,7 @@
<!-- Indicadores (Puntos) -->
<div class="absolute bottom-4 left-1/2 transform -translate-x-1/2 flex space-x-2 z-20">
@foreach($items as $index => $item)
<button class="carousel-dot w-3 h-3 rounded-full bg-white/20 hover:bg-neon-lime transition-all" data-index="{{ $index }}"></button>
<button class="carousel-dot w-3 h-3 rounded-full bg-black/20 dark:bg-white/20 hover:bg-lime-500 hover:dark:bg-neon-lime transition-all" data-index="{{ $index }}"></button>
@endforeach
</div>
@@ -91,8 +91,8 @@
$track.css('transform', `translateX(${translateX}%)`);
// Actualizar puntos
$('.carousel-dot').removeClass('bg-neon-lime scale-125').addClass('bg-white/20');
$(`.carousel-dot[data-index="${currentIndex}"]`).addClass('bg-neon-lime scale-125').removeClass('bg-white/20');
$('.carousel-dot').removeClass('bg-lime-500 dark:bg-neon-lime scale-125').addClass('bg-black/20 dark:bg-white/20');
$(`.carousel-dot[data-index="${currentIndex}"]`).addClass('bg-lime-500 dark:bg-neon-lime scale-125').removeClass('bg-black/20 dark:bg-white/20');
}
function nextSlide() {
+7 -7
View File
@@ -11,43 +11,43 @@
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 w-full mb-12">
<!-- Tarjeta Catálogo -->
<x-ui.card href="{{ url('/catalogo') }}" title="Catálogo" description="Ver productos." linkText="Ir al catalogo">
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" /></svg>
<svg class="w-12 h-12 text-lime-500 dark:text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" /></svg>
</x-ui.card>
<!-- Tarjeta Clientes -->
<x-ui.card href="{{ url('/clients') }}" title="Clientes" description="Base de datos de ciclistas." linkText="Ver Clientes">
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" /></svg>
<svg class="w-12 h-12 text-lime-500 dark:text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" /></svg>
</x-ui.card>
<!-- Tarjeta Ventas -->
<x-ui.card href="{{ url('/sales') }}" title="Ventas" description="Registro de Ventas" linkText="Ver Ventas">
<svg class="w-14 h-14 text-neon-lime" viewBox="0 0 24 24">
<svg class="w-14 h-14 text-lime-500 dark:text-neon-lime" viewBox="0 0 24 24">
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M13.6 16.733c.234.269.548.456.895.534a1.4 1.4 0 0 0 1.75-.762c.172-.615-.446-1.287-1.242-1.481-.796-.194-1.41-.861-1.241-1.481a1.4 1.4 0 0 1 1.75-.762c.343.077.654.26.888.524m-1.358 4.017v.617m0-5.939v.725M4 15v4m3-6v6M6 8.5 10.5 5 14 7.5 18 4m0 0h-3.5M18 4v3m2 8a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"></path>
</svg>
</x-ui.card>
<!-- Tarjeta Taller -->
<x-ui.card href="{{ url('/taller') }}" title="Taller" description="Gestión de services y reparaciones." linkText="Ver agenda">
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24">
<svg class="w-12 h-12 text-lime-500 dark:text-neon-lime" fill="none" viewBox="0 0 24 24">
<path stroke="currentColor" stroke-linejoin="round" stroke-width="1.5" d="M7.58209 8.96025 9.8136 11.1917l-1.61782 1.6178c-1.08305-.1811-2.23623.1454-3.07364.9828-1.1208 1.1208-1.32697 2.8069-.62368 4.1363.14842.2806.42122.474.73509.5213.06726.0101.1347.0133.20136.0098-.00351.0666-.00036.1341.00977.2013.04724.3139.24069.5867.52125.7351 1.32944.7033 3.01552.4971 4.13627-.6237.8375-.8374 1.1639-1.9906.9829-3.0736l4.8107-4.8108c1.0831.1811 2.2363-.1454 3.0737-.9828 1.1208-1.1208 1.3269-2.80688.6237-4.13632-.1485-.28056-.4213-.474-.7351-.52125-.0673-.01012-.1347-.01327-.2014-.00977.0035-.06666.0004-.13409-.0098-.20136-.0472-.31386-.2406-.58666-.5212-.73508-1.3294-.70329-3.0155-.49713-4.1363.62367-.8374.83741-1.1639 1.9906-.9828 3.07365l-1.7788 1.77875-2.23152-2.23148-1.41419 1.41424Zm1.31056-3.1394c-.04235-.32684-.24303-.61183-.53647-.76186l-1.98183-1.0133c-.38619-.19746-.85564-.12345-1.16234.18326l-.86321.8632c-.3067.3067-.38072.77616-.18326 1.16235l1.0133 1.98182c.15004.29345.43503.49412.76187.53647l1.1127.14418c.3076.03985.61628-.06528.8356-.28461l.86321-.8632c.21932-.21932.32446-.52801.2846-.83561l-.14417-1.1127ZM19.4448 16.4052l-3.1186-3.1187c-.7811-.781-2.0474-.781-2.8285 0l-.1719.172c-.7811.781-.7811 2.0474 0 2.8284l3.1186 3.1187c.7811.781 2.0474.781 2.8285 0l.1719-.172c.7811-.781.7811-2.0474 0-2.8284Z"/>
</svg>
</x-ui.card>
<!-- Tarjeta Productos -->
<x-ui.card href="{{ url('/productos') }}" title="Stock" description="Administrar bicicletas y repuestos." linkText="Ir al stock">
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" /></svg>
<svg class="w-12 h-12 text-lime-500 dark:text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" /></svg>
</x-ui.card>
<!-- Tarjeta Proveedores -->
<x-ui.card href="#" title="Proveedores" description="Base de datos de proveedores." linkText="Ver Proveedores">
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<svg class="w-12 h-12 text-lime-500 dark:text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" />
</svg>
</x-ui.card>
<!-- Tarjeta Compras -->
<x-ui.card href="#" title="Gastos" description="Registro de compras y pedidos a proovedores." linkText="Ver Gastos">
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24">
<svg class="w-12 h-12 text-lime-500 dark:text-neon-lime" fill="none" viewBox="0 0 24 24">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 4h3a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3m0 3h6m-3 5h3m-6 0h.01M12 16h3m-6 0h.01M10 3v4h4V3h-4Z"/>
</svg>
</x-ui.card>
+3 -4
View File
@@ -6,10 +6,9 @@
title="Bicicletería "
highlight="Lauck"
/>
</div>
<div class="flex flex-col items-center space-y-6 w-full max-w-lg p-6">
<div class="bg-zinc-900 p-8 rounded-xl shadow-lg w-full max-w-md border-2 border-gray-500">
-->
<div class="bg-panel-bg p-8 rounded-xl shadow-lg w-full max-w-md border border-neutral-700">
<form action="{{ route('login.attempt') }}" method="POST" class="space-y-5">
@csrf
{{-- Bloque de errores --}}
+11 -23
View File
@@ -1,83 +1,71 @@
<x-layout title="Lauck - Nuevo Producto">
<x-section-header subtitle="Inventario" title="Nuevo " highlight="Producto" />
<div class="w-full max-w-4xl mx-auto bg-panel-bg border border-neutral-800 rounded-xl p-8 shadow-lg">
<div class="w-full max-w-4xl mx-auto bg-gray-200 dark:bg-panel-bg border border-neutral-400 dark:border-neutral-800 rounded-xl p-8 shadow-lg">
<form action="{{ route('productos.store') }}" method="POST" enctype="multipart/form-data">
@csrf
<!-- Grid Layout -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-6">
<!-- Nombre (Ocupa 2 columnas) -->
<!-- Nombre -->
<div class="md:col-span-4">
<x-forms.label for="name" value="Nombre del Producto" />
<x-forms.input id="name" name="name" type="text" :value="old('name')" required autofocus placeholder="Ej: Cámara 29 Válvula Auto" :error="$errors->first('name')" />
</div>
<!-- SKU -->
<div class="md:col-span-2">
<x-forms.label for="sku" value="Código SKU (Opcional)" />
<x-forms.input id="sku" name="sku" type="text" :value="old('sku')" placeholder="Dejar vacío para generar auto" :error="$errors->first('sku')" />
</div>
<!-- Tipo -->
<div class="md:col-span-2">
<x-forms.label for="type" value="Tipo de Producto" />
<select id="type" name="type" class="bg-neutral-800 border-neutral-700 text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5">
<select id="type" name="type" class="bg-gray-300 dark:bg-neutral-800 border border-neutral-400 dark:border-neutral-700 dark:text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5">
<option value="accessory" {{ old('type') == 'accessory' ? 'selected' : '' }}>Accesorio</option>
<option value="bike" {{ old('type') == 'bike' ? 'selected' : '' }}>Bicicleta</option>
<option value="clothing" {{ old('type') == 'clothing' ? 'selected' : '' }}>Indumentaria</option>
<option value="spare" {{ old('type') == 'spare' ? 'selected' : '' }}>Repuesto</option>
</select>
</div>
<!-- Precios -->
<div class="">
<x-forms.label for="price" value="Precio Venta ($)" />
<x-forms.input id="price" name="price" type="number" step="0.01" :value="old('price')" required :error="$errors->first('price')" />
</div>
<div class="">
<x-forms.label for="cost" value="Costo ($) - Solo Admin" />
<x-forms.input id="cost" name="cost" type="number" step="0.01" :value="old('cost')" :error="$errors->first('cost')" />
</div>
<!-- Stock -->
<div class="">
<x-forms.label for="stock_quantity" value="Cantidad Inicial" />
<x-forms.input id="stock_quantity" name="stock_quantity" type="number" :value="old('stock_quantity', 0)" required :error="$errors->first('stock_quantity')" />
</div>
<div class="">
<x-forms.label for="min_stock_alert" value="Alerta de Stock Mínimo" />
<x-forms.input id="min_stock_alert" name="min_stock_alert" type="number" :value="old('min_stock_alert', 5)" required />
</div>
<!-- Descripción (2 columnas) -->
<!-- Descripción -->
<div class="md:col-span-4">
<x-forms.label for="description" value="Descripción / Notas" />
<textarea id="description" name="description" rows="3" class="bg-neutral-800 border-neutral-700 text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5 placeholder-gray-500">{{ old('description') }}</textarea>
<textarea id="description" name="description" rows="3" class="bg-gray-300 dark:bg-neutral-800 border border-neutral-400 dark:border-neutral-700 dark:text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5 placeholder-neutral-600 dark:placeholder-gray-400">{{ old('description') }}</textarea>
</div>
<!-- Imagen -->
<div class="md:col-span-2">
<x-forms.label for="image" value="Imagen del Producto" />
<x-forms.input type="file" name="image" class="block w-full text-sm text-gray-400 file:mr-4 file:py-2 file:px-4 file:rounded-full
file:border-0 file:text-sm file:font-semibold file:bg-neon-lime file:text-neutral-900 hover:file:bg-[#b3e600]
<x-forms.input type="file" name="image" class="block w-full text-sm dark:text-gray-400 file:mr-4 file:py-2 file:px-4 file:rounded-full
file:border-0 file:text-sm file:font-semibold file:bg-lime-500 dark:file:bg-neon-lime file:text-neutral-900 hover:file:bg-[#b3e600]
" :error="$errors->first('image')"/>
{{-- @error('image') <span class="text-red-500 text-xs">{{ $message }}</span> @enderror --}}
</div>
</div>
<!-- Botones Acción -->
<div class="flex items-center justify-between md:justify-end space-x-4 border-t border-neutral-800 pt-6">
<a href="{{ route('productos.index') }}" class="text-gray-400 hover:text-white font-medium text-sm transition-colors">Cancelar</a>
<button type="submit" class="px-6 py-2.5 bg-neon-lime text-neutral-900 font-bold rounded-lg hover:bg-[#b3e600] transition-colors shadow-lg shadow-neon-lime/20">
<div class="flex items-center justify-between md:justify-end space-x-4 border-t border-neutral-400 dark:border-neutral-700 pt-6">
<a href="{{ route('productos.index') }}" class="px-4 py-2.5 text-red-500 border border-red-500 hover:bg-red-500 hover:text-white rounded-lg font-semibold text-sm transition-colors">Cancelar</a>
<button type="submit" class="px-6 py-2.5 bg-neutral-900 dark:bg-neon-lime text-neon-lime dark:text-neutral-900 font-bold rounded-lg hover:bg-neutral-800 hover:dark:bg-[#b3e600] transition-colors shadow-lg dark:shadow-neon-lime/20">
Guardar
</button>
</div>
</form>
</div>
</x-layout>
+12 -6
View File
@@ -1,11 +1,12 @@
<x-layout title="Lauck - Editar Producto">
<x-section-header subtitle="Inventario" title="Edicion de " highlight="Producto" />
<div class="w-full max-w-4xl mx-auto bg-panel-bg border border-neutral-800 rounded-xl p-8 shadow-lg">
<div class="w-full max-w-4xl mx-auto bg-gray-200 dark:bg-panel-bg border border-neutral-400 dark:border-neutral-800 rounded-xl p-8 shadow-lg">
<form action="{{route('productos.update',$product)}}" method="POST">
@csrf
@method('PUT')
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-6">
<!-- Nombre -->
<div class="md:col-span-4">
<x-forms.label for="name" value="Nombre del Producto" />
@@ -19,7 +20,7 @@
<!-- Tipo -->
<div class="md:col-span-2">
<x-forms.label for="type" value="Tipo de Producto" />
<select id="type" name="type" class="bg-neutral-800 border-neutral-700 text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5">
<select id="type" name="type" class="bg-gray-300 dark:bg-neutral-800 border border-neutral-400 dark:border-neutral-700 dark:text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5">
<option value="accessory" {{ $product->type == 'accessory' ? 'selected' : '' }}>Accesorio</option>
<option value="bike" {{ $product->type == 'bike' ? 'selected' : '' }}>Bicicleta</option>
<option value="clothing" {{ $product->type == 'clothing' ? 'selected' : '' }}>Indumentaria</option>
@@ -47,14 +48,19 @@
<!-- Descripción (2 columnas) -->
<div class="md:col-span-4">
<x-forms.label for="description" value="Descripción / Notas" />
<textarea id="description" name="description" rows="3" class="bg-neutral-800 border-neutral-700 text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5 placeholder-gray-500">{{$product->description}}</textarea>
<textarea id="description" name="description" rows="3" class="bg-gray-300 dark:bg-neutral-800 border border-neutral-400 dark:border-neutral-700 dark:text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5 placeholder-gray-500">{{$product->description}}</textarea>
</div>
<!-- Imagen -->
<div class="md:col-span-2">
<x-forms.label for="image" value="Imagen del Producto" />
<x-forms.input type="file" name="image" class="block w-full text-sm dark:text-gray-400 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-lime-700 dark:file:bg-neon-lime file:text-white dark:file:text-neutral-900 hover:file:bg-lime-600" :error="$errors->first('image')"/>
</div>
</div>
<!-- Botones Acción -->
<div class="flex items-center justify-between md:justify-end space-x-4 border-t border-neutral-800 pt-6">
<a href="{{ route('productos.index') }}" class="text-gray-400 hover:text-white font-medium text-sm transition-colors">Cancelar</a>
<button type="submit" class="px-6 py-2.5 bg-neon-lime text-neutral-900 font-bold rounded-lg hover:bg-[#b3e600] transition-colors shadow-lg shadow-neon-lime/20">
<div class="flex items-center justify-between md:justify-end space-x-4 border-t border-neutral-400 dark:border-neutral-700 pt-6">
<a href="{{ route('productos.index') }}" class="text-gray-800 dark:text-gray-400 hover:text-black hover:dark:text-white font-medium text-sm transition-colors">Cancelar</a>
<button type="submit" class="px-4 py-2.5 bg-neutral-900 dark:bg-neon-lime text-neon-lime dark:text-neutral-900 font-bold rounded-lg hover:bg-neutral-800 hover:dark:bg-[#b3e600] transition-colors shadow-lg dark:shadow-neon-lime/20">
Guardar
</button>
</div>
+36 -18
View File
@@ -7,41 +7,40 @@
<!-- Barra de Herramientas (Buscador + Botón Crear) -->
<div class="w-full flex flex-col md:flex-row justify-between items-center gap-4 mb-6">
<!-- Buscador -->
<form action="{{ route('productos.index') }}" method="GET" class="w-full lg:w-2/3 flex flex-col sm:flex-row gap-3">
<div class="relative w-full sm:w-2/3">
<div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
<svg class="w-4 h-4 text-gray-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
<svg class="w-4 h-4 text-gray-600 dark:text-gray-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/>
</svg>
</div>
<input type="text" name="search" value="{{ request('search') }}"
class="block w-full p-3 ps-10 text-sm text-white border border-neutral-700 rounded-lg bg-neutral-800 focus:ring-neon-lime focus:border-neon-lime placeholder-gray-500"
class="block w-full p-3 ps-10 text-sm text-black dark:text-white border border-neutral-400 dark:border-neutral-700 rounded-lg bg-neutral-200 dark:bg-neutral-800 placeholder-gray-600 dark:placeholder-gray-500"
placeholder="Buscar por nombre, SKU o marca...">
</div>
<!-- Filtro de Estado de Stock -->
<div class="w-full sm:w-1/3">
<select name="stock_status" onchange="this.form.submit()"
class="block w-full p-3 text-sm text-white border border-neutral-700 rounded-lg bg-neutral-800 focus:ring-neon-lime focus:border-neon-lime cursor-pointer">
class="block w-full p-3 text-sm text-black dark:text-white border border-neutral-300 dark:border-neutral-700 rounded-lg bg-neutral-200 dark:bg-neutral-800 focus:ring-neon-lime focus:border-neon-lime cursor-pointer">
<option value="">Todos</option>
<option value="low" {{ request('stock_status') == 'low' ? 'selected' : '' }} class="text-red-300">Stock en Alerta</option>
<option value="medium" {{ request('stock_status') == 'medium' ? 'selected' : '' }} class="text-yellow-300">Stock Bajo</option>
<option value="ok" {{ request('stock_status') == 'ok' ? 'selected' : '' }} class="text-green-300">Stock Normal</option>
<option value="low" {{ request('stock_status') == 'low' ? 'selected' : '' }} class="text-red-600 dark:text-red-300">Stock en Alerta</option>
<option value="medium" {{ request('stock_status') == 'medium' ? 'selected' : '' }} class="text-yellow-600 dark:text-yellow-300">Stock Bajo</option>
<option value="ok" {{ request('stock_status') == 'ok' ? 'selected' : '' }} class="text-green-600 dark:text-green-300">Stock Normal</option>
</select>
</div>
</form>
<!-- Botón Nuevo -->
<a href="{{ route('productos.create') }}" class="w-full md:w-auto text-center px-5 py-3 text-sm font-bold text-neutral-900 bg-neon-lime rounded-lg hover:bg-[#b3e600] transition-colors uppercase tracking-wide">
<a href="{{ route('productos.create') }}" class="w-full md:w-auto text-center px-5 py-3 text-sm font-bold text-neon-lime dark:text-neutral-900 bg-neutral-950 dark:bg-neon-lime rounded-lg hover:bg-neutral-900/80 hover:dark:bg-[#b3e600] transition-colors uppercase tracking-wide">
+ Nuevo Producto
</a>
</div>
<!-- Tabla de Productos -->
<div class="relative overflow-x-auto shadow-md sm:rounded-lg border border-neutral-800 w-full">
<table class="w-full text-sm text-left rtl:text-right text-gray-400">
<thead class="text-xs text-gray-300 uppercase bg-neutral-800 border-b border-neutral-700">
<div class="relative overflow-x-auto shadow-md sm:rounded-lg border border-gray-400 dark:border-neutral-800 w-full">
<table class="w-full text-sm text-left rtl:text-right text-neutral-900 dark:text-white">
<thead class="text-xs text-neutral-800 dark:text-gray-300 uppercase bg-gray-400 dark:bg-neutral-800 border-b border-gray-300 dark:border-neutral-700">
<tr>
<th scope="col" class="px-6 py-3">Producto / SKU</th>
<th scope="col" class="px-6 py-3">Tipo</th>
@@ -52,10 +51,10 @@
</thead>
<tbody>
@forelse($products as $product)
<tr class="bg-neutral-900/50 border-b border-neutral-800 hover:bg-neutral-800 transition-colors group">
<td class="px-6 py-4 font-medium text-white whitespace-nowrap">
<tr class="bg-gray-200/50 dark:bg-neutral-900/50 border-b border-gray-400 dark:border-neutral-800 hover:bg-gray-400 hover:dark:bg-neutral-800 transition-colors group">
<td class="px-6 py-4 font-medium whitespace-nowrap">
<div class="text-base font-bold">{{ $product->name }}</div>
<div class="text-xs text-gray-500 font-mono">{{ $product->sku }}</div>
<div class="text-xs text-gray-600 dark:text-gray-400 font-mono">{{ $product->sku }}</div>
</td>
<td class="px-6 py-4">
@if($product->type === 'bike') <x-ui.badge color="neon">Bicicleta</x-ui.badge>
@@ -63,7 +62,7 @@
@elseif($product->type === 'spare') <x-ui.badge color="gray">Repuesto</x-ui.badge>
@else <x-ui.badge color="yellow">Accesorio</x-ui.badge> @endif
</td>
<td class="px-6 py-4 font-mono text-white">
<td class="px-6 py-4 font-mono">
${{ number_format($product->price, 2) }}
</td>
<td class="px-6 py-4 text-center">
@@ -75,13 +74,32 @@
<x-ui.badge color="green">{{ $product->stock_quantity }}</x-ui.badge>
@endif
</td>
<td class="px-6 py-4 text-right">
<a href="{{ route('productos.edit', $product) }}" class="font-medium text-blue-400 hover:underline mr-3">Editar</a>
<td class="px-6 py-4 text-right flex items-center gap-2 justify-end">
<a href="{{ route('productos.show', $product) }}" title="Ver Mas" class="font-semibold p-2 text-green-700 dark:text-green-400 border-2 border-green-700 rounded-lg hover:bg-green-700 dark:hover:bg-green-600 dark:hover:border-green-600 hover:text-white dark:hover:text-white transition-colors">
<svg class="size-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
<path stroke="currentColor" stroke-width="2" d="M21 12c0 1.2-4.03 6-9 6s-9-4.8-9-6c0-1.2 4.03-6 9-6s9 4.8 9 6Z"/>
<path stroke="currentColor" stroke-width="2" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/>
</svg>
</a>
<a href="{{ route('productos.edit', $product) }}" title="Editar" class="font-semibold p-2 text-blue-800 dark:text-blue-400 border-2 border-blue-800 rounded-lg hover:bg-blue-800 hover:text-white dark:hover:text-white transition-colors">
<svg class="size-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m14.304 4.844 2.852 2.852M7 7H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-4.5m2.409-9.91a2.017 2.017 0 0 1 0 2.853l-6.844 6.844L8 14l.713-3.565 6.844-6.844a2.015 2.015 0 0 1 2.852 0Z"/>
</svg>
</a>
<form action="{{route('productos.destroy',$product)}}" method="post">
@csrf
@method('DELETE')
<button title="Eliminar" type="submit" class="w-full sm:w-auto p-2 font-bold dark:font-medium text-red-600 dark:text-red-400 border-2 border-red-600 rounded-lg hover:bg-red-600 hover:text-white dark:hover:text-white transition-colors">
<svg class="size-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 7h14m-9 3v8m4-8v8M10 3h4a1 1 0 0 1 1 1v3H9V4a1 1 0 0 1 1-1ZM6 7h12v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7Z"/>
</svg>
</button>
</form>
</td>
</tr>
@empty
<tr>
<td colspan="5" class="px-6 py-10 text-center text-gray-500">
<td colspan="5" class="px-6 py-10 text-center font-semibold">
No se encontraron productos.
</td>
</tr>
+1 -9
View File
@@ -35,15 +35,7 @@
</div>
</dl>
<div class="flex gap-5">
<a href="{{route('productos.index')}}" class="w-full sm:w-auto px-5 py-2 rounded-full text-white font-semibold bg-stone-500 hover:bg-stone-600">Volver</a>
<a href="{{ route('productos.edit', $product ) }}" class="w-full sm:w-auto px-5 py-2 rounded-full text-white font-semibold bg-blue-600 hover:bg-blue-700">Editar</a>
<form action="{{route('productos.destroy',$product)}}" method="post">
@csrf
@method('DELETE')
<button type="submit" class="w-full sm:w-auto px-5 py-2 rounded-full text-white font-semibold bg-red-600 hover:bg-red-700">
Borrar
</button>
</form>
<a href="{{route('productos.index')}}" class="w-full sm:w-auto p-2 rounded-lg text-stone-500 border-2 border-stone-500 font-semibold hover:text-white hover:bg-stone-500">Volver</a>
</div>
</div>
@@ -1,12 +0,0 @@
<x-appc>
<div class="max-w-6xl mx-auto px-4 py-8 text-white">
<a href="{{ route('catalogo') }}">Volver a catalogo</a>
<h1>Titulo: {{ $producto->name }}</h1>
<p>
<b>Categoria:</b> {{ $producto->type }}
</p>
<p>
{{ $producto->content }}
</p>
</div>
</x-appc>
+82 -38
View File
@@ -1,36 +1,85 @@
<x-layout title="Lauck - Nueva Venta">
@push('styles')
<style>
/* Select2 adaptado al Tema 'Lauck' (Neutral + Neon Lime) */
/* === MODO CLARO === */
/* Contenedor principal del input */
.select2-container--default .select2-selection--single {
background-color: #262626 !important; /* neutral-800 */
border-color: #404040 !important; /* neutral-700 */
color: white !important;
height: 42px;
background-color: #d1d5dc !important; /* Fondo blanco */
border: 1px solid #a1a1a1 !important; /* Borde gray-300 */
color: #111827 !important; /* Texto casi negro (gray-900) */
height: 32px !important;
padding: 0 0.5rem;
display: flex;
align-items: center;
border-radius: 0.5rem; /* rounded-lg */
transition: all 0.3s ease;
}
/* Texto seleccionado */
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: white !important;
line-height: 42px;
color: #111827 !important;
line-height: 32px !important;
padding-left: 12px;
}
/* La caja desplegable (Dropdown) */
.select2-dropdown {
background-color: #262626 !important; /* neutral-800 */
border-color: #404040 !important; /* neutral-700 */
color: white !important;
background-color: #d1d5dc !important;
border: 1px solid #d1d5db !important;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); /* Sombra suave para modo claro */
}
/* Color de resalto al pasar el mouse u opción seleccionada */
/* Opciones de la lista (texto normal) */
.select2-results__option {
color: #374151 !important; /* gray-700 */
}
/* Placeholder */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
color: #6b7280 !important; /* gray-500 */
}
/* Input de búsqueda interno */
.select2-search--dropdown .select2-search__field {
background-color: #f3f4f6 !important; /* gray-100 */
color: #111827 !important;
border: 1px solid #d1d5db !important;
border-radius: 0.375rem !important;
padding: 6px 12px !important;
outline: none;
}
/* Color de resalto (Hover o Navegación con teclado). Mantenemos tu color de marca */
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
background-color: #ccff00 !important; /* neon-lime */
color: #171717 !important; /* neutral-900 */
font-weight: bold;
}
/* Ajuste del placeholder */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
/* === MODO OSCURO === */
/* Contenedor principal */
:is(.dark) .select2-container--default .select2-selection--single {
background-color: #262626 !important; /* neutral-800 */
border-color: #404040 !important; /* neutral-700 */
}
/* Texto seleccionado oscuro */
:is(.dark) .select2-container--default .select2-selection--single .select2-selection__rendered {
color: white !important;
}
/* Caja desplegable oscura */
:is(.dark) .select2-dropdown {
background-color: #262626 !important;
border-color: #404040 !important;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5); /* Sombra más fuerte */
}
/* Opciones de la lista oscura */
:is(.dark) .select2-results__option {
color: #d4d4d4 !important; /* gray-300 */
}
/* Placeholder oscuro */
:is(.dark) .select2-container--default .select2-selection--single .select2-selection__placeholder {
color: #9ca3af !important; /* gray-400 */
}
/* Input de búsqueda interno oscuro */
:is(.dark) .select2-search--dropdown .select2-search__field {
background-color: #171717 !important; /* neutral-900 */
color: white !important;
border-color: #404040 !important;
}
</style>
@endpush
@@ -48,11 +97,11 @@
</div>
@endif
<div class="w-full max-w-5xl mx-auto bg-panel-bg border border-neutral-800 rounded-xl p-8 shadow-lg">
<div class="w-full max-w-5xl mx-auto bg-gray-200 dark:bg-panel-bg border border-neutral-400 dark:border-neutral-800 rounded-xl p-8 shadow-lg">
<form action="{{ route('sales.store') }}" method="POST">
@csrf
<div class="grid grid-cols-1 md:grid-cols-12 gap-6 mb-4 border-b border-neutral-700 pb-8">
<div class="grid grid-cols-1 md:grid-cols-12 gap-6 mb-4 border-b border-neutral-400 dark:border-neutral-700 pb-8">
<div class="md:col-span-10">
<x-forms.label for="client_id" value="Cliente" />
<div class="relative">
@@ -65,26 +114,24 @@
</div>
</div>
<div class="md:col-span-2 flex items-end mb-1">
<a href="{{ route('clients.create', ['origin' => 'sales']) }}" target="_blank"
class="inline-flex items-center text-neon-lime hover:text-[#b3e600] font-bold text-sm transition-colors"
title="Crear nuevo cliente">+ Nuevo Cliente</a>
<a href="{{ route('clients.create', ['origin' => 'sales']) }}" target="_blank" class="inline-flex items-center dark:text-neon-lime text-lime-700/80 hover:text-lime-500 dark:hover:text-[#b3e600] font-bold text-sm transition-colors" title="Crear nuevo cliente">+ Nuevo Cliente</a>
</div>
</div>
<div class="mb-4">
<div class="flex justify-between items-end mb-4">
<x-forms.label value="Detalle de Productos" />
<div class="text-sm text-gray-400">
Total Items: <span class="text-white font-mono" id="item-count">1</span>
<div class="text-sm dark:text-gray-400 text-neutral-800">
Total Items: <span class="dark:text-white font-mono font-bold" id="item-count">1</span>
</div>
</div>
<div id="items-container" class="space-y-3">
<div class="item-row grid grid-cols-1 md:grid-cols-12 gap-4 items-start bg-neutral-800/50 p-4 rounded-xl border border-neutral-800">
<div class="item-row grid grid-cols-1 md:grid-cols-12 gap-4 items-start bg-neutral-300/50 dark:bg-neutral-700/50 p-4 rounded-xl border dark:border-neutral-800 border-gray-400">
<div class="md:col-span-6">
<label class="block text-gray-400 text-xs mb-1.5 uppercase tracking-wider font-semibold">Producto</label>
<x-forms.label value="Producto" />
<select name="items[0][product_id]" class="w-full select2-product product-select">
<option value="" data-price="0" selected disabled>Buscar producto...</option>
@foreach($products as $product)
@@ -96,18 +143,17 @@
</div>
<div class="md:col-span-2">
<label class="block text-gray-400 text-xs mb-1.5 uppercase tracking-wider font-semibold">Cant.</label>
<input type="number" name="items[0][quantity]" value="1" min="1"
class="quantity-input bg-neutral-800 border-neutral-700 border rounded-lg text-white text-sm focus:ring-neon-lime focus:border-neon-lime block w-full p-1 px-2 h-7">
<x-forms.label value="Cant."/>
<x-forms.input type="number" name="items[0][quantity]" value="1" min="1" class="quantity-input border rounded-lg block w-full py-1! px-2"/>
</div>
<div class="md:col-span-3 text-right flex flex-col justify-center h-[42px] mt-6">
<span class="text-xs text-gray-500">Subtotal</span>
<span class="row-total text-lg font-bold text-neon-lime">$0.00</span>
<span class="text-xs dark:text-gray-400 text-gray-700">Subtotal</span>
<span class="row-total text-lg font-bold text-lime-700 dark:text-neon-lime">$0.00</span>
</div>
<div class="md:col-span-1 flex items-end justify-end h-[42px] mt-6">
<button type="button" class="btn-remove text-neutral-500 hover:text-red-500 transition-colors p-2" title="Quitar item">
<button type="button" class="btn-remove dark:text-neutral-400 text-neutral-600 hover:text-red-500 hover:dark:text-red-400 transition-colors p-2" title="Quitar item">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<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>
@@ -117,7 +163,7 @@
</div>
<div class="mt-4">
<button type="button" id="btn-add-row" class="inline-flex items-center text-neon-lime hover:text-[#b3e600] font-bold text-sm transition-colors">
<button type="button" id="btn-add-row" class="inline-flex items-center dark:text-neon-lime text-lime-600 dark:hover:text-[#b3e600] hover:text-lime-500 font-bold text-sm transition-colors">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-1" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z" clip-rule="evenodd" />
</svg>
@@ -125,19 +171,19 @@
</button>
</div>
<div class="mt-5 flex justify-end items-center border-t border-neutral-700 pt-6">
<div class="mt-5 flex justify-end items-center border-t border-neutral-400 dark:border-neutral-700 pt-6">
<div class="text-right">
<span class="block text-gray-400 text-sm mb-1">Monto Total a Pagar</span>
<span id="grand-total" class="text-3xl font-bold text-white">$0.00</span>
<span class="block text-gray-600 dark:text-gray-400 text-sm mb-1">Monto Total a Pagar</span>
<span id="grand-total" class="text-3xl font-bold">$0.00</span>
</div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 items-end border-t border-neutral-800 pt-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 items-end border-t border-neutral-400 dark:border-neutral-700 pt-6">
<div>
<x-forms.label for="payment_method" value="Método de Pago" />
<select name="payment_method" class="bg-neutral-800 border-neutral-700 text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5">
<select name="payment_method" class="bg-gray-300 dark:bg-neutral-800 border border-neutral-400 dark:border-neutral-700 text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5">
<option value="Efectivo">Efectivo</option>
<option value="Tarjeta de Débito">Tarjeta de Débito</option>
<option value="Tarjeta de Crédito">Tarjeta de Crédito</option>
@@ -146,10 +192,8 @@
</div>
<div class="flex justify-end gap-4">
<a href="{{ route('sales.index') }}" class="px-6 py-2.5 text-gray-400 hover:text-white font-medium text-sm transition-colors flex items-center">
Cancelar
</a>
<button type="submit" class="px-8 py-2.5 bg-neon-lime text-neutral-900 font-bold rounded-lg hover:bg-[#b3e600] transition-colors shadow-lg shadow-neon-lime/20 transform hover:scale-105">
<a href="{{ route('sales.index') }}" class="px-4 py-2.5 text-red-500 border border-red-500 hover:bg-red-500 hover:text-white rounded-lg font-semibold text-sm transition-colors flex items-center">Cancelar</a>
<button type="submit" class="px-8 py-2.5 bg-neutral-900 dark:bg-neon-lime text-neon-lime dark:text-neutral-900 font-bold rounded-lg hover:bg-neutral-800 hover:dark:bg-[#b3e600] transition-colors shadow-lg dark:shadow-neon-lime/20">
Confirmar Venta
</button>
</div>
+120 -18
View File
@@ -2,24 +2,69 @@
<x-section-header subtitle="Finanzas" title="Historial de " highlight="Ventas" />
<!-- Barra de Herramientas -->
<div class="w-full flex justify-between items-center mb-6">
<!-- Buscador simple (opcional visualmente, funcionalidad futura) -->
<div class="relative w-1/3">
<input type="text" placeholder="Buscar por N° Venta o Cliente..." class="bg-neutral-800 border border-neutral-700 text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5">
</div>
<div class="mb-6 bg-gray-200/50 dark:bg-neutral-800/50 p-4 rounded-xl border border-neutral-400 dark:border-neutral-800 shadow-sm">
<form action="{{ route('sales.index') }}" method="GET" class="grid grid-cols-1 md:grid-cols-12 gap-4 items-end">
<div class="md:col-span-3">
<x-forms.label value="N° Venta"/>
<div class="relative">
<div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
<svg class="w-4 h-4 text-gray-500" fill="none" viewBox="0 0 20 20">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/>
</svg>
</div>
<x-forms.input type="text" name="search" value="{{ request('search') }}" class="ps-10" placeholder="Ej: 1420"/>
</div>
</div>
<!-- Botón Nueva Venta -->
<a href="{{ route('sales.create') }}" class="px-5 py-2.5 bg-neon-lime text-neutral-900 font-bold rounded-lg hover:bg-[#b3e600] transition-colors shadow-lg shadow-neon-lime/20 flex items-center gap-2">
<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="M12 4v16m8-8H4"></path></svg>
Registrar Venta
</a>
<div class="md:col-span-4">
<x-forms.label value="Cliente"/>
<select name="client_id" class="w-full select2-filter">
<option value="">-- Todos --</option>
@foreach($clients as $client)
<option value="{{ $client->id }}" {{ request('client_id') == $client->id ? 'selected' : '' }}>
{{ $client->name }}
</option>
@endforeach
</select>
</div>
<div class="md:col-span-2">
<x-forms.label value="Desde"/>
<x-forms.input type="date" name="date_from" value="{{ request('date_from') }}"/>
</div>
<div class="md:col-span-2">
<x-forms.label value="Hasta"/>
<x-forms.input type="date" name="date_to" value="{{ request('date_to') }}"/>
</div>
<div class="md:col-span-1 flex gap-2">
<button type="submit" class="w-full bg-neutral-900 hover:bg-neutral-800 text-neon-lime dark:bg-neon-lime dark:hover:bg-[#b3e600] dark:text-neutral-900 font-bold rounded-lg text-sm p-2.5 transition-colors shadow-lg dark:shadow-neon-lime/20 flex items-center justify-center" title="Aplicar Filtros">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<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>
</button>
@if(request()->hasAny(['search', 'client_id', 'date_from', 'date_to']))
<a href="{{ route('sales.index') }}" class="w-full hover:bg-red-600 hover:text-white text-red-600 border border-red-600 font-bold rounded-lg text-sm p-2.5 flex items-center justify-center transition-colors" title="Limpiar Filtros">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</a>
@endif
</div>
</form>
</div>
<!-- Tabla de Ventas -->
<div class="relative overflow-x-auto shadow-md sm:rounded-lg border border-neutral-800 bg-panel-bg">
<table class="w-full text-sm text-left text-gray-400">
<thead class="text-xs text-gray-300 uppercase bg-neutral-800 border-b border-neutral-700">
<div class="flex justify-end mb-6">
<a href="{{ route('sales.create') }}" class="px-6 py-2.5 border bg-neon-lime border-neutral-900 text-neutral-900 hover:text-neon-lime hover:bg-neutral-900 dark:bg-neutral-800 dark:border-neon-lime dark:text-neon-lime hover:dark:bg-neon-lime hover:dark:text-neutral-900 font-bold rounded-lg transition-all shadow-lg dark:shadow-neon-lime/10 flex items-center gap-2">
<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="M12 4v16m8-8H4"></path></svg>
Nueva Venta
</a>
</div>
<div class="relative overflow-x-auto shadow-md sm:rounded-lg border border-gray-400 dark:border-neutral-800">
<table class="w-full text-sm text-left text-neutral-900 dark:text-white">
<thead class="text-xs text-neutral-800 dark:text-gray-300 uppercase bg-gray-400 dark:bg-neutral-800 border-b border-gray-300 dark:border-neutral-700">
<tr>
<th scope="col" class="px-6 py-3"># Ref</th>
<th scope="col" class="px-6 py-3">Fecha</th>
@@ -30,13 +75,70 @@
</tr>
</thead>
<tbody>
@forelse($sales as $sale)
<tr class="bg-gray-200/50 dark:bg-neutral-900/50 border-b border-gray-400 dark:border-neutral-800 hover:bg-gray-400 hover:dark:bg-neutral-800 transition-colors group">
<td class="px-6 py-4 font-mono font-bold">
#{{ str_pad($sale->id, 5, '0', STR_PAD_LEFT) }}
</td>
<td class="px-6 py-4 text-gray-600 dark:text-gray-300">
{{ $sale->created_at->format('d/m/Y H:i') }}
</td>
<td class="px-6 py-4">
@if($sale->client)
<div class="font-bold">{{ $sale->client->name }}</div>
<div class="text-xs text-gray-700 dark:text-gray-400">{{ $sale->client->phone ?? '' }}</div>
@else
<span class="italic text-gray-600 dark:text-gray-400">Consumidor Final</span>
@endif
</td>
<td class="px-6 py-4">
@php
$colors = [
'Efectivo' => 'text-white dark:text-green-400 bg-green-600/80 dark:bg-green-900/20 border-green-800',
'Transferencia' => 'text-white dark:text-blue-400 bg-blue-600/80 dark:bg-blue-900/20 border-blue-800',
'Tarjeta de Débito' => 'text-white dark:text-purple-400 bg-purple-600/80 dark:bg-purple-900/20 border-purple-800',
'Tarjeta de Crédito' => 'text-white dark:text-orange-400 bg-orange-600/80 dark:bg-orange-900/20 border-orange-800',
];
$badgeClass = $colors[$sale->payment_method] ?? 'bg-gray-400 dark:bg-gray-800 border-gray-700';
@endphp
<span class="{{ $badgeClass }} border px-2.5 py-0.5 rounded text-xs font-medium">
{{ $sale->payment_method }}
</span>
</td>
<td class="px-6 py-4 text-right font-bold text-lg text-zinc-900 dark:text-neon-lime">
${{ number_format($sale->total, 2) }}
</td>
<td class="px-6 py-4 text-center">
<a href="{{ route('sales.show', $sale) }}"
class="inline-flex items-center justify-center w-8 h-8 border-2 border-emerald-700 dark:border-green-600 rounded-4xl hover:bg-emerald-700 text-emerald-700 hover:dark:bg-green-600 dark:text-green-600 hover:text-white hover:dark:text-white transition-colors"
title="Ver Detalle">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
</svg>
</a>
</td>
</tr>
@empty
<tr>
<td colspan="6" class="px-6 py-12 text-center text-gray-500">
<div class="flex flex-col items-center justify-center">
<svg class="w-12 h-12 mb-3 text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg>
<p class="text-base">No se encontraron ventas registradas.</p>
</div>
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<!-- Paginación -->
<div class="mt-4 w-full flex justify-center">
<div class="mt-4 w-full max-w-4xl">
{{ $sales->links() }}
</div>
</x-layout>