@extends('investor.layouts.app') @php $pageTitle = 'Dashboard'; @endphp @section('content') {{-- Welcome --}}

Welcome back, {{ auth()->user()->first_name }}

Here's your investment portfolio at a glance.

{{-- ── Stats Row ── --}}
Total Invested
@if($totalInvested >= 10000000) ₹{{ number_format($totalInvested/10000000, 2) }} Cr @elseif($totalInvested >= 100000) ₹{{ number_format($totalInvested/100000, 2) }} L @else ₹{{ number_format($totalInvested) }} @endif
Current Value
@if($totalCurrentValue >= 10000000) ₹{{ number_format($totalCurrentValue/10000000, 2) }} Cr @elseif($totalCurrentValue >= 100000) ₹{{ number_format($totalCurrentValue/100000, 2) }} L @else ₹{{ number_format($totalCurrentValue) }} @endif
{{ $growthPercent >= 0 ? '▲' : '▼' }} {{ abs($growthPercent) }}%
Total Gain
@if(abs($totalGrowth) >= 100000) {{ $totalGrowth >= 0 ? '+' : '-' }}₹{{ number_format(abs($totalGrowth)/100000, 2) }} L @else {{ $totalGrowth >= 0 ? '+' : '' }}₹{{ number_format($totalGrowth) }} @endif
Active Investments
{{ $investments->where('status','active')->count() }}
{{ $investments->count() }} total
{{-- ── Portfolio Summary ── --}}
My Portfolio View All →
@if($investments->count()) @foreach($investments->take(4) as $inv) @php $img = $inv->property->images->where('is_primary',true)->first() ?? $inv->property->images->first(); @endphp
@if($img) @endif

{{ $inv->property->title }}

{{ $inv->investment_date->format('d M Y') }} · {{ $inv->property->full_location }}

₹{{ number_format(($inv->current_value ?? $inv->invested_amount)/100000, 1) }}L

@php $g = $inv->growth_percent; @endphp

{{ $g >= 0 ? '▲' : '▼' }} {{ abs($g) }}%

@endforeach @else

No investments yet

Your portfolio will appear here once your advisor adds your investments.

Explore Opportunities →
@endif
{{-- ── Right column ── --}}
{{-- Upcoming Payments --}}
Upcoming Payments View All →
@if($pendingPayments->count()) @foreach($pendingPayments as $pay)

{{ $pay->installment_label }}

Due: {{ $pay->due_date->format('d M Y') }}

₹{{ number_format($pay->amount) }}

{{ $pay->is_overdue ? 'Overdue' : 'Pending' }}
@endforeach @else
No pending payments
@endif
{{-- Construction Updates --}}
Latest Updates
@if($constructionUpdates->count()) @foreach($constructionUpdates as $update)
@if($update->photo_url) @else
@endif

{{ $update->title }}

{{ $update->property->title }} · {{ $update->update_month }}

{{ $update->completion_percentage }}%
@endforeach @else
No updates yet
@endif
{{-- Recent Documents --}} @if($recentDocuments->count())
Recent Documents View Vault →
@endif @endsection