@extends('portal.layout') @section('title', 'Scenario Analysis — Report #'.str_pad($report->id, 5, '0', STR_PAD_LEFT)) @section('content') @php $score = $report->feasibility_score ?? 0; $scoreColor = $score >= 70 ? '#22c55e' : ($score >= 40 ? '#eab308' : '#ef4444'); $baseFar = $report->zoneRule?->max_far ?? ($report->result_data['max_far'] ?? '—'); $baseHeight = $report->zoneRule?->max_height_m ?? ($report->result_data['max_height_m'] ?? '—'); $typeBadgeColors = [ 'what_if' => '#60a5fa', 'optimizer' => '#22c55e', 'tdr' => '#f97316', 'premium_fsi' => '#eab308', 'amalgamation' => '#a78bfa', ]; @endphp
@include('portal.partials.report-sidebar')
{{-- Page Header --}}
Scenario Engine

Multi-Scenario Analysis

Compare what-if scenarios, optimize configurations, evaluate TDR & premium FSI, or analyze plot amalgamation.

{{-- Base Report Context --}}
Base Plot
{{ $report->address ?? ($report->city?->name ?? 'Plot') }}
Area {{ number_format($report->plot_area_sqm) }} sqm
Road {{ $report->road_width_m }}m
FAR {{ $baseFar }}
Height {{ $baseHeight }}m
Score {{ $score }}/100
{{-- Analysis Type Navigation --}}
{{-- What-If --}} {{-- Optimizer --}} {{-- TDR --}} {{-- Premium FSI --}} {{-- Amalgamation --}}
{{-- Loading overlay --}}
{{-- ===== WHAT-IF PANEL ===== --}}
What-If Scenario Builder
Create up to 5 scenarios — adjust road width, FAR, height, project type, setbacks and compare outcomes side-by-side.
{{-- ===== OPTIMIZER PANEL ===== --}}
Auto-Optimizer
Automatically tests all project types to find the most profitable building configuration with optimal unit mix.
Residential
Apartments & Housing
Commercial
Office & Retail
Mixed Use
Residential + Commercial
Industrial
Factory & Warehouse
{{-- ===== TDR PANEL ===== --}}
TDR (Transfer of Development Rights) Calculator
Calculate additional buildable area from TDR purchase and cost-benefit at different levels. Leave blank to use state defaults.
{{-- ===== PREMIUM FSI PANEL ===== --}}
Premium FSI Calculator
Calculate break-even for purchasing premium FSI from the government. Shows incremental cost-benefit at each 0.1 FSI step.
{{-- ===== AMALGAMATION PANEL ===== --}}
Amalgamation Analysis
Compare combined feasibility of merging adjacent plots vs developing individually. Add up to 4 adjacent plots.
{{-- Primary Plot --}}
Primary Plot (from report)
{{ number_format($report->plot_area_sqm) }} sqm — Road: {{ $report->road_width_m }}m — {{ $report->zone?->name ?? '' }}
{{-- ===== RESULTS AREA ===== --}}
{{-- What-If Results --}} {{-- Optimizer Results --}} {{-- TDR Results --}} {{-- Premium FSI Results --}} {{-- Amalgamation Results --}}
{{-- ===== SAVED SCENARIOS ===== --}} @if($savedScenarios->count())
Saved Analyses
{{ $savedScenarios->count() }} saved scenario{{ $savedScenarios->count() !== 1 ? 's' : '' }}
@foreach($savedScenarios as $saved) @php $bc = $typeBadgeColors[$saved->type] ?? '#2563eb'; @endphp
@if($saved->type === 'what_if') @elseif($saved->type === 'optimizer') @elseif($saved->type === 'tdr') @elseif($saved->type === 'premium_fsi') @else @endif
{{ $saved->title }}
{{ $saved->created_at->diffForHumans() }}
{{ str_replace('_', ' ', $saved->type) }}
@endforeach
@endif {{-- Error display --}}
{{-- .report-content --}}
{{-- .report-layout --}} @endsection @section('scripts') @endsection