{{-- ═══ HEADER ═══ --}}

📊 Relatório NPS & Avaliações

{{ $hotel->name }} @if($hotel->slug) · {{ $hotel->slug }} @endif
Período: {{ \Carbon\Carbon::parse($from)->format('d/m/Y') }} a {{ \Carbon\Carbon::parse($to)->format('d/m/Y') }}
{{-- ═══ HERO: Score NPS + KPIs ═══ --}}
@php $scoreClass = $npsScore !== null ? ($npsScore >= 50 ? '' : ($npsScore >= 25 ? 'ok' : 'bad')) : ''; $scoreLabel = $npsScore !== null ? ($npsScore >= 75 ? 'Excelente' : ($npsScore >= 50 ? 'Muito Bom' : ($npsScore >= 25 ? 'Razoável' : 'Crítico'))) : '—'; @endphp
@if($npsScore !== null){{ $npsScore >= 0 ? '+' : '' }}{{ $npsScore }}@else—@endif
Net Promoter Score
{{ $scoreLabel }}
{{ $totalReviews }}
Total
{{ $promoters }}
😊 Promotores
{{ $promoterPct }}%
{{ $passives }}
😐 Passivos
{{ $passivePct }}%
{{ $detractors }}
😞 Detratores
{{ $detractorPct }}%
{{-- ═══ MÉDIAS POR CATEGORIA ═══ --}}
Notas Médias por Categoria
@php $cats = [ 'Geral' => $avgOverall, 'Limpeza' => $avgCleanliness, 'Atendimento' => $avgService, 'Localização' => $avgLocation, 'Custo-Ben.' => $avgValue, 'Conforto' => $avgComfort, ]; @endphp @foreach($cats as $cat => $val) @if($val > 0) @endif @endforeach
Categoria Média Indicador
{{ $cat }} {{ number_format($val, 1) }} ⭐
{{-- ═══ DISTRIBUIÇÃO DE NOTAS ═══ --}}
Distribuição de Notas (0–10)
@php $maxQty = $scoreDistribution->max('qty') ?: 1; @endphp @for($score = 0; $score <= 10; $score++) @php $qty = $scoreDistribution[$score]->qty ?? 0; $pct = round($qty / $maxQty * 100); $color = $score >= 9 ? '#22c55e' : ($score >= 7 ? '#f59e0b' : '#ef4444'); @endphp @endfor
{{ $score }}
{{ $qty }}
{{-- ═══ AVALIAÇÕES RECENTES ═══ --}} @if($reviews->count() > 0)
Avaliações (últimas {{ $reviews->count() }})
@foreach($reviews as $review) @php $badgeClass = $review->nps_score >= 9 ? 'nps-p' : ($review->nps_score >= 7 ? 'nps-n' : 'nps-d'); @endphp @endforeach
NPS Hóspede Reserva Geral Data Comentário
{{ $review->nps_score }} {{ $review->guest?->full_name ?? 'Anônimo' }} {{ $review->reservation?->locator ?? '—' }} @if($review->overall_rating) {{ $review->overall_rating }}★ @else — @endif {{ $review->submitted_at?->format('d/m/Y') }} {{ \Illuminate\Support\Str::limit($review->comment ?? '', 90) }}
@endif {{-- ═══ FOOTER ═══ --}}