@extends('layouts.portal') @section('title', 'Admin Dashboard') @section('page_title', 'Admin Dashboard') @section('page_subtitle', 'System Overview & Management') @section('sidebar') @include('admin.partials.sidebar', ['active' => 'dashboard']) @endsection @section('content')

Welcome back, {{ auth()->user()->name }}! 👋

Here's what's happening with your system today.

{{ now()->format('l, F j, Y') }} System Online

Quick Actions

Activity Overview

{{ $stats['total_wills'] ?? 0 }}

Wills

{{ $stats['total_clients'] ?? 0 }}

Clients

{{ $stats['pending_wills'] ?? 0 }}

Pending

@forelse($recentActivities as $activity)

{{ $activity['title'] }}

{{ $activity['message'] }}

{{ $activity['time'] }}

@empty

No recent activity

@endforelse

Monthly Income

{{ now()->format('F Y') }}

Total Revenue

RM{{ number_format($monthlyIncome['total_income'], 2) }}

{{ $monthlyIncome['total_income'] > 0 ? round($monthlyIncome['agent_commission'] / $monthlyIncome['total_income'] * 100, 1) : 0 }}%

Agent Commission

RM{{ number_format($monthlyIncome['agent_commission'], 2) }}

{{ $monthlyIncome['total_income'] > 0 ? round($monthlyIncome['lawyer_commission'] / $monthlyIncome['total_income'] * 100, 1) : 0 }}%

Lawyer Commission

RM{{ number_format($monthlyIncome['lawyer_commission'], 2) }}

Your Net Profit

RM{{ number_format($monthlyIncome['admin_profit'], 2) }}

Margin

{{ $monthlyIncome['total_income'] > 0 ? round($monthlyIncome['admin_profit'] / $monthlyIncome['total_income'] * 100, 1) : 0 }}%

@endsection