@extends('portal._layout') @section('title', __('portal.page_title_account')) @section('topbar')
{{ $tenant?->name ?? config('leadhub.branding.app_name', 'LeadHub') }}
@csrf
@endsection @section('content')

{{ __('portal.greeting_hi', ['name' => $lead->first_name ?: __('portal.greeting_there')]) }}

{{ __('portal.greeting_sub') }}

{{-- Pipeline progress --}} @if($lead->pipeline && $allStages->isNotEmpty())

{{ __('portal.where_you_are') }}

@php $currentIndex = $allStages->search(fn($s) => $s->id === $lead->pipeline_stage_id); $total = $allStages->count(); $pct = $currentIndex === false ? 0 : (int) round((($currentIndex + 1) / $total) * 100); @endphp
{{-- NOTE: width is DYNAMIC — driven by $pct percentage --}}
@foreach($allStages as $i => $stage) @php $isCurrent = $stage->id === $lead->pipeline_stage_id; $isPast = $currentIndex !== false && $i < $currentIndex; @endphp
{{-- NOTE: background DYNAMIC — color depends on stage state (current/past/future) --}}
@if($isPast) ✓ @else {{ $i + 1 }} @endif
{{-- NOTE: color + font-weight DYNAMIC — highlight current stage --}}
{{ $stage->name }}
@endforeach
@endif {{-- Assigned rep + deal --}} @if($lead->assignedUser || $lead->deal_value)

{{ __('portal.your_account') }}

@if($lead->assignedUser)
{{ __('portal.your_contact') }}
{{ $lead->assignedUser->name }}
@endif @if($lead->deal_value)
{{ __('portal.deal_value') }}
{{ $lead->deal_currency ?? '$' }} {{ number_format($lead->deal_value, 2) }}
@endif @if($lead->expected_close_date)
{{ __('portal.expected_close') }}
{{-- Carbon::toFormattedDateString() returns the English "M j, Y" format ("Apr 17, 2026") and ignores app locale. translatedFormat() walks the same tokens through the current Symfony translator so non-English buyers see the localised month abbreviation. --}}
{{ $lead->expected_close_date->translatedFormat('M j, Y') }}
@endif
@endif {{-- Activity timeline (public-safe only) --}} @if($activities->isNotEmpty())

{{ __('portal.recent_activity') }}

@endif {{-- Documents / upload --}}

{{ __('portal.documents') }}

@if($lead->attachments->isNotEmpty()) @else

{{ __('portal.no_documents_yet') }}

@endif
@csrf @error('file')

{{ $message }}

@enderror {{ __('portal.max_upload_size') }}
@endsection