@extends('layouts.admin')
@section('title', 'Dashboard')
@push('styles')
@endpush
@section('content')
{{-- ═══ PAGE HEADER ════════════════════════════════════════ --}}
{{-- ═══ ALERTAS OPERACIONAIS ════════════════════════════════ --}}
@if($alerts->count() > 0)
{{-- Receita Hoje --}}
Receita Hoje
R$ {{ number_format($revenueToday,2,',','.') }}
Mês: R$ {{ number_format($revenueMonth,2,',','.') }}
{{-- Ocupação --}}
Ocupação
{{ $occupancyRate }}%
{{ $inHouse }} de {{ $totalRooms }} UHs
{{-- Movimentos Hoje --}}
Movimentos Hoje
{{ $arrivalsToday }}
Chegadas
{{ $departuresToday }}
Saídas
{{-- Saldo Pendente --}}
Saldo Pendente
R$ {{ number_format(max(0,$pendingBalance),2,',','.') }}
in-house sem quitação
{{-- RevPAR --}}
RevPAR
R$ {{ number_format($revPAR,2,',','.') }}
receita/UH disponível/dia
{{-- NPS Score do Mês --}}
NPS do Mês
@if($npsScore !== null)
{{ $npsScore >= 0 ? '+' : '' }}{{ $npsScore }}
{{ $npsCount }} avaliações
@else
—
sem dados este mês
@endif
{{-- ═══ ATALHOS ══════════════════════════════════════════════ --}}
@php
$shortcuts = [
['href' => route('admin.map.index'), 'icon' => 'plus-circle', 'label' => 'Nova Reserva', 'color' => '#6366f1'],
['href' => route('admin.map.index'), 'icon' => 'map', 'label' => 'Mapa', 'color' => '#06b6d4'],
['href' => route('admin.reservations.index', ['status'=>'confirmed']), 'icon' => 'log-in', 'label' => 'Check-in', 'color' => '#22c55e'],
['href' => route('admin.reservations.index', ['status'=>'checked_in']), 'icon' => 'log-out', 'label' => 'Check-out', 'color' => '#f59e0b'],
['href' => route('admin.financial.cashbox'), 'icon' => 'wallet', 'label' => 'Meu Caixa', 'color' => '#10b981'],
['href' => route('admin.day-use.index'), 'icon' => 'coffee', 'label' => 'Day Use', 'color' => '#d97706'],
['href' => route('admin.events.index'), 'icon' => 'calendar-days', 'label' => 'Eventos', 'color' => '#8b5cf6'],
['href' => route('admin.nps.index'), 'icon' => 'star', 'label' => 'NPS', 'color' => '#f59e0b'],
];
@endphp
@foreach($shortcuts as $s)
{{ $s['label'] }}
@endforeach
{{-- ═══ GRÁFICOS ECHARTS ═════════════════════════════════════ --}}
{{-- Próximas chegadas --}}
@forelse($upcomingArrivals as $res)
{{ strtoupper(substr($res->guest?->first_name ?? 'G', 0, 1)) }}
{{ $res->guest?->full_name }}
{{ $res->room?->name ?? 'Sem UH' }} · {{ $res->nights }} diária(s)
@if($res->guest?->vip_level && $res->guest->vip_level !== 'none')
{{ strtoupper($res->guest->vip_level) }}
@endif
{{ $res->check_in_expected->format('d/m') }}
{{ $res->locator }}
@empty
Nenhuma chegada programada.
@endforelse
{{-- Próximos Eventos --}}
@if($upcomingEvents->count() > 0)
@foreach($upcomingEvents as $evt)
{{ $evt->name }}
{{ $evt->space?->name ?? 'Sem Salão' }}
@if($evt->status === 'confirmed')
CONFIRMADO
@else
PENDENTE
@endif
{{ $evt->event_date->format('d/m') }}
{{ $evt->start_time ?? '' }}
@endforeach
@endif
{{-- Relatórios rápidos --}}
{{-- Sidebar: pagamentos + status --}}
@forelse($recentPayments as $p)
{{ $p->reservation?->locator }} · {{ $p->reservation?->guest?->full_name }}
{{ $p->method?->name }} · {{ $p->paid_at->diffForHumans() }}
R$ {{ number_format((float)$p->amount,2,',','.') }}
@empty
Nenhum pagamento hoje.
@endforelse
{{-- Status do Sistema --}}
Status do Sistema
@php
$items = [
['label' => 'Hotel', 'value' => $hotelName],
['label' => 'Perfil', 'value' => $userRole],
['label' => 'Data/Hora', 'value' => now()->format('d/m/Y H:i')],
['label' => 'Fase Atual', 'value' => 'Fase 29 — Superadmin SaaS'],
['label' => 'Caixa', 'value' => $openCashbox ? '✓ Aberto' : '× Fechado'],
];
@endphp
@foreach($items as $it)
{{ $it['label'] }}
{{ $it['value'] }}
@endforeach
@endsection
@push('scripts')
@endpush