@php $icons = ['🎯', '🛡️', '✈️', '💻', '📈', '🏠', '🚗', '💍', '🎓', '🏖️']; $goalSearchTrim = trim($goalSearch); @endphp

{{ __('budgets.goals_page.total_saved') }}

{{ \App\Support\Money::formatEur($totalSaved) }}

{{ __('budgets.goals_page.total_target') }}

{{ \App\Support\Money::formatEur($totalTarget) }}

{{ __('budgets.goals_page.progress') }}

{{ $progressPct }}%

{{ __('budgets.goals_page.insight_on_track') }}

{{ $onTrackGoals }}

{{ __('budgets.goals_page.insight_needs_attention') }}

{{ $needsAttentionGoals }}

{{ __('budgets.goals_page.insight_completed') }}

{{ $completedGoals }}

{{ __('budgets.goals_page.goals_count', ['count' => $allGoalsCount]) }}

@if (count($listGoals) === 0)

{{ __('budgets.goals_page.empty_title') }}

{{ $goalSearchTrim !== '' ? __('budgets.goals_page.empty_filtered') : __('budgets.goals_page.empty_hint') }}

@endif @foreach ($listGoals as $g) @php $target = (float) ($g['target'] ?? 0); $saved = (float) ($g['saved'] ?? 0); $pct = $target > 0 ? min(100, ($saved / $target) * 100) : 0; $remaining = $target - $saved; $monthly = (float) ($g['monthlyContribution'] ?? 0); $monthsLeft = $monthly > 0 ? (int) ceil($remaining / $monthly) : 0; $prio = (string) ($g['priority'] ?? 'medium'); $prioEmoji = $prio === 'high' ? '🔴' : ($prio === 'medium' ? '🟡' : '🟢'); @endphp
{{ $g['icon'] ?? '🎯' }}

{{ $g['name'] }}

{{ $prioEmoji }} {{ __('budgets.goals_page.priority_' . $prio) }}

{{ \App\Support\Money::formatEur($saved) }} {{ __('budgets.goals_page.of', ['amount' => \App\Support\Money::formatEur($target)]) }}
{{ __('budgets.goals_page.card_remaining', ['amount' => \App\Support\Money::formatEur($remaining)]) }} {{ __('budgets.goals_page.months_at_rate', ['months' => $monthsLeft, 'amount' => \App\Support\Money::formatEur($monthly)]) }}
@endforeach
@if ($mobileSearchOpen)

@if ($goalSearchTrim !== '') {{ __('budgets.goals_page.mobile_results', ['count' => count($listGoals)]) }} @else {{ __('budgets.goals_page.mobile_hint') }} @endif

@endif @if ($editing !== null)

@if ($editing === 'new') {{ __('budgets.goals_page.new_goal_title') }} @else {{ __('budgets.goals_page.edit_goal_title') }} @endif

@if ($editing !== 'new') @endif
@foreach ($icons as $ic) @endforeach
@if (count($smartSuggestions) > 0)

{{ __('budgets.goals_page.smart_actions') }}

@foreach (array_slice($smartSuggestions, 0, 3) as $suggestion) @php $tone = $suggestion['tone'] ?? 'default'; $dot = $tone === 'positive' ? 'bg-primary' : ($tone === 'warning' ? 'bg-warning' : 'bg-foreground/35'); @endphp

{{ $suggestion['label'] }}

@if (! empty($suggestion['detail']))

{{ $suggestion['detail'] }}

@endif
@endforeach
@endif
@foreach (['low', 'medium', 'high'] as $p) @endforeach
@php $t = (float) ($editTarget ?? 0); $m = (float) ($editMonthly ?? 0); $s = (float) ($editSaved ?? 0); $showProj = $t > 0 && $m > 0; $projMonths = $showProj ? (int) ceil(($t - $s) / $m) : 0; @endphp @if ($showProj)
{{ __('budgets.goals_page.projection') }}

{{ __('budgets.goals_page.projection_line', [ 'rate' => \App\Support\Money::formatEur($m), 'target' => \App\Support\Money::formatEur($t), 'months' => $projMonths, ]) }}

@endif
@endif