{{-- Decorative orbs --}}
{{ \Illuminate\Support\Carbon::now()->translatedFormat('l, F j, Y') }}

{{ $greeting }}, {{ $userName }} 👋

{{ __("Here's what's happening with") }} {{ $teamName }} {{ __('today.') }}

@if ($canCreateInvoice) {{ __('New Invoice') }} @endif @if ($canCreateQuote) {{ __('New Quote') }} @endif @if ($canCreateJob) {{ __('New Job') }} @endif
@unless ($hasData) {{ __('Add your first customer') }} @else @php // Shared tone palette for the health strip, KPI status pills and bars. $toneText = ['good' => 'text-emerald-600', 'warn' => 'text-amber-600', 'bad' => 'text-rose-600', 'neutral' => 'text-slate-400']; $tonePill = [ 'good' => 'bg-emerald-50 text-emerald-700 ring-emerald-200', 'warn' => 'bg-amber-50 text-amber-700 ring-amber-200', 'bad' => 'bg-rose-50 text-rose-700 ring-rose-200', 'neutral' => 'bg-slate-100 text-slate-500 ring-slate-200', ]; $toneDot = ['good' => 'bg-emerald-500', 'warn' => 'bg-amber-500', 'bad' => 'bg-rose-500', 'neutral' => 'bg-slate-400']; $toneBar = ['good' => '#10b981', 'warn' => '#f59e0b', 'bad' => '#f43f5e', 'neutral' => '#94a3b8']; @endphp @if ($canViewFinancials && ! empty($healthStrip)) {{-- z-40: the card's hover-lift transform makes a stacking context, so the card itself must sit above later sections for its popovers to show. --}}

{{ __('Executive Health') }}

{{-- `contents` on a phone dissolves this wrapper, so the chip and its detail are both grid cells: the detail can then take the full row instead of being a 256px popover hanging off the right edge of a 160px chip, half of it past the screen. From sm it is the positioned wrapper again and the detail is a popover. --}} @foreach ($healthStrip as $chip)

{{ $chip['label'] }}

{{ $chip['status'] }}

{{ $chip['summary'] }}

{{ $chip['recommendation'] }}

@endforeach
@endif
@foreach ($kpis as $kpi) {{-- Accent corner glow --}}

{{ $kpi['label'] }}

@if (! empty($kpi['status'])) {{ $kpi['status']['label'] }} @endif

{{ $kpi['value'] }}

@if (! empty($kpi['meta']))

{{ $kpi['meta'] }}

@endif @if ($kpi['pct'] !== null)
{{ $kpi['pct'] }}% {{ $kpi['pct_caption'] }}
@endif @if ($kpi['progress'] !== null)
@endif
@if (! empty($kpi['delta']['arrow'])) @endif {{ $kpi['delta']['text'] }}
@endforeach
@if ($canViewFinancials && ! empty($warnings))

{{ __('Some figures may be incomplete') }}

{{ __('Fix the data gaps below so these numbers can be trusted.') }}

@foreach ($warnings as $warning) {{-- Same trick as the health strip: on a phone the wrapper dissolves so the detail panel becomes a full-width item of the wrap row rather than a 288px card hanging off a chip near the right edge. --}}
@if (! empty($warning['items']))

{{ __('Affected records') }}

@foreach ($warning['items'] as $item) @if (! empty($item['url'])) {{ $item['label'] }} @else {{ $item['label'] }} @endif @endforeach
@if (($warning['more'] ?? 0) > 0) {{ __('+ :count more', ['count' => $warning['more']]) }} · {{ __('view all') }} @endif
@endif
@endforeach
@endif @if ($canViewFinancials && $executive) @php $tileTone = ['neg' => 'text-rose-600', 'pos' => 'text-slate-900']; @endphp

{{ __('Executive Performance') }}

{{ $executive['range'] }} · {{ __('all figures in') }} {{ $baseCode }}

{{ $executive['health_label'] }} {{-- No overheads booked yet ⇒ no hurdle to measure against, so the badge is hidden. --}} @if ($executive['has_hurdle']) @php $hurdleBadge = ['good' => 'emerald', 'warn' => 'amber', 'bad' => 'rose'][$executive['hurdle_tone']] ?? 'slate'; @endphp {{ __('GP :pct% of hurdle', ['pct' => $executive['hurdle_progress']]) }} @endif
@foreach ($executive['tiles'] as $tile)

{{ $tile['label'] }}

{{ $tile['value'] }}

@if (! empty($tile['sub']))

{{ $tile['sub'] }}

@endif
@endforeach
@endif @if ($canViewFinancials || $canViewTargets)
@if ($canViewFinancials)

{{ __('Revenue Overview') }}

{{ $baseCode }} {{ number_format($revenueChart['current'], 2) }}

{{ __('Cash collected') }} · {{ $revenueChart['periodLabel'] }}

@if ($revenueChart['delta'] !== null)

{{ number_format(abs($revenueChart['delta']), 1) }}% {{ $revenueChart['compareLabel'] }}

@endif
@if ($canSetTargets)
@if ($editingTargets)
{{ $revenueChart['periodLabel'] }}: @error('revenueTargetInput') {{ $message }} @enderror
@else @endif
@endif
@endif @if ($canViewTargets)

{{ __('Performance vs Targets') }}

{{ __('View all') }}
@forelse ($performance['bars'] as $bar)
{{ $bar['label'] }} {{ $bar['pct'] }}%

{{ $bar['detail'] }}

@empty

{{ __('No active targets.') }}
{{ __('Set a target') }}

@endforelse
@if (! empty($performance['bars']))

{{ $performance['mood']['emoji'] }} {{ $performance['mood']['label'] }}

{{ __('Overall achievement') }}

@endif
@endif
@endif @if ($floor || ($canViewInventory && $stock) || $overdue['accessible'])
@if ($floor)

{{ __('Today on the Floor') }}

{{ __('All jobs') }}
@foreach ($floor['rows'] as $row) @php $rowValueTone = $row['tone'] === 'neutral' ? 'text-slate-900' : ($toneText[$row['tone']] ?? 'text-slate-900'); @endphp {{ $row['label'] }} {{ $row['detail'] }} {{ $row['value'] }} @endforeach
@endif @if ($canViewInventory && $stock) @php $stockRows = [ ['label' => __('Stock Value'), 'detail' => trans_choice('{1} :count item tracked|[2,*] :count items tracked', $stock['tracked'], ['count' => number_format($stock['tracked'])]), 'value' => $stock['base_code'] . ' ' . number_format($stock['stock_value'], 0), 'icon' => 'banknotes', 'tone' => 'neutral', 'link' => route('inventory.index')], ['label' => __('Low Stock'), 'detail' => __('At or below reorder level'), 'value' => number_format($stock['low_count']), 'icon' => 'exclamation-triangle', 'tone' => $stock['low_count'] > 0 ? 'warn' : 'good', 'link' => route('inventory.reorder')], ['label' => __('Out of Stock'), 'detail' => __('Nothing on hand'), 'value' => number_format($stock['out_count']), 'icon' => 'archive-box-x-mark', 'tone' => $stock['out_count'] > 0 ? 'bad' : 'good', 'link' => route('inventory.reorder')], ]; @endphp

{{ __('Stock Levels') }}

{{ __('Inventory') }}
@foreach ($stockRows as $row) @php $rowValueTone = $row['tone'] === 'neutral' ? 'text-slate-900' : ($toneText[$row['tone']] ?? 'text-slate-900'); @endphp {{ $row['label'] }} {{ $row['detail'] }} {{ $row['value'] }} @endforeach
@endif @if ($overdue['accessible'])

{{ __('Overdue') }}

@if ($overdue['total'] > 0) {{ $overdue['total'] }} {{ __('items') }} @endif
@if (! empty($overdue['items']))
@foreach ($overdue['items'] as $item) @php $row = 'flex items-center gap-3 rounded-xl border border-slate-100 bg-slate-50/50 px-3 py-2.5 transition hover:border-rose-200 hover:bg-rose-50/40'; @endphp @if ($item['link']) @else @endif @endforeach
@else

{{ __('Nothing overdue') }}

{{ __('Invoices, jobs and bills are all on time.') }}

@endif
@endif
@endif @if ($canViewFinancials)

{{ __('Monthly Summary') }}

{{ __('This month overview') }}

@foreach ($summary as $item)

{{ $item['label'] }}

{{ $item['value'] }}

@if ($item['delta'] !== null) @php $good = $item['delta'] >= 0 ? $item['up_is_good'] : ! $item['up_is_good']; @endphp

{{ number_format(abs($item['delta']), 1) }}% {{ __('vs last month') }}

@else

{{ __('No prior data') }}

@endif
@endforeach
@endif @endunless