@php $searchTrim = trim($search); $totalRemaining = $totalLimit - $totalSpent; $pctLabel = $totalLimit > 0 ? number_format($pctUsed, 0) : '0'; $firstOverBudget = collect($filtered)->first(function ($row) { $limit = (float) ($row['limit'] ?? 0); $spent = (float) ($row['spent'] ?? 0); return $limit > 0 && $spent > $limit; }); @endphp

{{ $heroPeriod }}

{{ __('budgets.budgets_page.hero_remaining_label') }}

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

{{ __('budgets.budgets_page.hero_remaining_hint', ['pct' => $pctLabel, 'per_day' => \App\Support\Money::formatEur($perDay)]) }}

{{ __('budgets.budgets_page.hero_limit_label') }}

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

{{ __('budgets.budgets_page.hero_spent_label') }}

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

{{ __('budgets.budgets_page.insight_over_budget') }}

{{ $overBudgetCount }}

{{ __('budgets.budgets_page.insight_near_limit') }}

{{ $nearLimitCount }}

{{ __('budgets.budgets_page.insight_top_spend') }}

@if ($topSpending) {{ $topSpending['name'] }} ยท {{ \App\Support\Money::formatEur((float) ($topSpending['spent'] ?? 0)) }} @else โ€” @endif

@if ($firstOverBudget) @php $firstOverLimit = (float) ($firstOverBudget['limit'] ?? 0); $firstOverSpent = (float) ($firstOverBudget['spent'] ?? 0); $firstOverAmount = max($firstOverSpent - $firstOverLimit, 0); @endphp

{{ __('budgets.budgets_page.alert_over_budget_title', ['name' => $firstOverBudget['name'] ?? '']) }}

{{ __('budgets.budgets_page.alert_over_budget_body', ['amount' => \App\Support\Money::formatEur($firstOverAmount)]) }}

@endif

{{ __('budgets.budgets_page.categories') }}

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

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

{{ $searchTrim !== '' ? __('budgets.budgets_page.empty_filtered') : __('budgets.budgets_page.empty_hint') }}

@endif @foreach ($filtered as $i => $b) @php $limit = (float) ($b['limit'] ?? 1); $spent = (float) ($b['spent'] ?? 0); $pct = $limit > 0 ? ($spent / $limit) * 100 : 0; $over = $pct >= 100; $remaining = $limit - $spent; $statusTone = 'primary'; $statusLabel = __('budgets.budgets_page.status_on_track'); if ($pct > 100) { $statusTone = 'expense'; $statusLabel = __('budgets.budgets_page.status_over_budget'); } elseif ($pct >= 85) { $statusTone = 'warning'; $statusLabel = __('budgets.budgets_page.status_near_limit'); } @endphp
{{ $b['icon'] ?? '๐Ÿ“Š' }}

{{ $b['name'] }}

{{ __('budgets.budgets_page.period_labels.' . ($b['period'] ?? 'monthly')) }}

{{ \App\Support\Money::formatEur($spent) }} {{ __('budgets.budgets_page.of_limit', ['amount' => \App\Support\Money::formatEur($limit)]) }}
{{ __('budgets.budgets_page.pct_used', ['pct' => number_format($pct, 0)]) }} @if ($remaining > 0) {{ __('budgets.budgets_page.remaining_amount', ['amount' => \App\Support\Money::formatEur($remaining)]) }} @else {{ __('budgets.budgets_page.over_budget_amount', ['amount' => \App\Support\Money::formatEur(abs($remaining))]) }} @endif
@endforeach
@if ($mobileSearchOpen)

@if (trim($search) !== '') {{ __('budgets.budgets_page.mobile_results', ['count' => count($filtered)]) }} @else {{ __('budgets.budgets_page.mobile_hint') }} @endif

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

{{ $editing === 'new' ? __('budgets.budgets_page.new_budget') : __('budgets.budgets_page.edit_budget') }}

@if ($editing !== 'new') @endif
@if (count($smartSuggestions) > 0)

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

@foreach (array_slice($smartSuggestions, 0, 3) as $s) @php $tone = $s['tone'] ?? 'default'; @endphp

{{ $s['label'] }}

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

{{ $s['detail'] }}

@endif
@endforeach
@endif
@foreach ($categories as $cid => $c) @if ($cid !== 'income') @endif @endforeach
@foreach (['weekly', 'monthly', 'yearly'] as $p) @endforeach
@endif