@extends('central.super.layout') @section('title', __('super.reports.title')) @section('content') {{-- KPI stat cards --}}
{{ __('super.reports.total_tenants') }}
{{ number_format($totalTenants) }}
{{ $activeTenants }} {{ __('super.reports.active') }}
{{ __('super.reports.active_subscriptions') }}
{{ number_format($activeSubscriptions) }}
{{ __('super.reports.mrr') }}
{{ $currencySymbol }}{{ number_format($mrr, 2) }}
{{ __('super.reports.churn_rate') }}
{{ $churnRate }}%
{{ __('super.reports.last_30_days') }}
{{-- Charts row --}}
{{-- Tenant growth --}}

{{ __('super.reports.tenant_growth') }}

{{-- Tenant status donut --}}

{{ __('super.reports.tenant_status') }}

@if(array_sum($tenantStatuses) > 0)
@else

{{ __('super.reports.no_data') }}

@endif
{{-- Revenue + Subscriptions by plan --}}
{{-- Revenue trend --}}

{{ __('super.reports.revenue_trend') }}

{{ $currencySymbol }}{{ number_format($totalRevenue, 2) }} {{ __('super.reports.total') }}
{{-- Subscriptions by plan --}}

{{ __('super.reports.by_plan') }}

@if($subscriptionsByPlan->isNotEmpty())
@else

{{ __('super.reports.no_data') }}

@endif
{{-- Top plans by revenue + Recent tenants --}}
{{-- Top plans by revenue --}}

{{ __('super.reports.top_plans') }}

@if($topPlansByRevenue->isNotEmpty())
@php $maxRevenue = $topPlansByRevenue->max('revenue'); @endphp @foreach($topPlansByRevenue as $plan)
{{ $plan->plan_name }} {{ $currencySymbol }}{{ number_format($plan->revenue, 2) }}
@php $pct = $maxRevenue > 0 ? ($plan->revenue / $maxRevenue * 100) : 0; @endphp

{{ $plan->transactions }} {{ __('super.reports.transactions') }}

@endforeach
@else

{{ __('super.reports.no_data') }}

@endif
{{-- Recent tenants --}}

{{ __('super.reports.recent_tenants') }}

{{ __('super.reports.view_all') }}
@if($recentTenants->isNotEmpty())
@foreach($recentTenants as $t) @endforeach
{{ __('super.reports.tenant') }} {{ __('super.reports.domain') }} {{ __('super.common.status') }} {{ __('super.reports.registered') }}
{{ $t->company_name ?? $t->id }} {{ $t->domains->first()->domain ?? '—' }} @php $badgeMap = [ 'active' => 'active', 'trial' => 'trial', 'pending' => 'pending', 'provisioning' => 'pending', 'suspended' => 'suspended', 'cancelled' => 'cancelled', 'failed' => 'failed', 'rejected' => 'rejected', ]; @endphp {{ ucfirst($t->status) }} {{ $t->created_at->format('M d, Y') }}
@else

{{ __('super.reports.no_tenants') }}

@endif
@push('scripts') @endpush @endsection