@extends('layouts.app') @section('title', 'Panel Comercio · Dashboard') @section('content')

Dashboard Comercio

@if($profile) {{ $profile->brand_name }} @else Aún no has creado tu perfil @endif
@include('comercio.partials.alerts') @include('comercio.partials.nav') @if(!$profile)
⚠️ Te falta crear tu perfil
Sin perfil no podrás publicar productos en la página principal.
Crear perfil ahora
@endif {{-- ====== Eventos / Pagos (KPIs) ====== --}}
Eventos confirmados
{{ $eventStats['confirmados_count'] ?? 0 }}
Valor eventos (confirmados)
${{ number_format($eventStats['confirmados_total'] ?? 0, 0, ',', '.') }}
CLP
Pagado (confirmados)
${{ number_format($eventStats['pagado_total'] ?? 0, 0, ',', '.') }}
CLP
Pendiente por cobrar
${{ number_format($eventStats['deuda_total'] ?? 0, 0, ',', '.') }}
CLP
{{-- ====== Gráficos ====== --}}
Eventos confirmados vs Pagos (últimos 6 meses)
* Confirmados = cantidad de eventos confirmados por mes. Pagos = suma pagada por mes (CLP).
Pagos acordados vs Pagado
Acordado ${{ number_format($chart['acordado_total'] ?? 0, 0, ',', '.') }}
Pagado ${{ number_format($chart['pagado_total'] ?? 0, 0, ',', '.') }}
Pendiente ${{ number_format(max(0, ($chart['acordado_total'] ?? 0) - ($chart['pagado_total'] ?? 0)), 0, ',', '.') }}
{{-- ====== Productos ====== --}}
Productos totales
{{ $stats['products_total'] }}
Activos (visibles)
{{ $stats['products_active'] }}
Ocultos
{{ $stats['products_hidden'] }}
{{-- ====== Tu sección actual (Acciones + Últimos productos) ====== --}}
Acciones rápidas
@if(!$profile)
* Primero crea tu perfil para habilitar productos y eventos.
@endif
Últimos productos
Ver todos →
@if($latest->count() === 0)
Aún no hay productos.
@else
@foreach($latest as $p)
{{ $p->name }}
@if($p->category) {{ $p->category }} · @endif @if($p->is_active) Activo @else Oculto @endif
@if(!is_null($p->price))
${{ number_format($p->price, 0, ',', '.') }}
CLP
@else
A convenir
@endif Editar →
@endforeach
@endif
{{-- Chart.js --}} @endsection