@extends('layouts.app')
@section('title', __('Dashboard'))
@section('page-title', __('Hi, :name', ['name' => $user->name]))
@section('page-subtitle', __('Your space at :tenant', ['tenant' => $user->tenant?->name]))
@php
$fmt = fn ($v, $d = 0) => number_format((float) $v, $d, ',', ' ');
$money = fn ($v) => number_format((float) $v, 2, ',', ' ').' '.$kpis['currency'];
@endphp
@section('content')
{{-- ─── KPI strip ──────────────────────────────────────────────── --}}
{{ $fmt($kpis['requests_total']) }}
{{ __('all time') }}
{{ $fmt($kpis['pending']) }}
{{ __('being prepared') }}
{{ $fmt($kpis['completed']) }}
{{ __('ready or sent') }}
@if($kpis['outstanding_count'] > 0)
{{ $money($kpis['outstanding_total']) }}
@else
—
@endif
@if($kpis['outstanding_count'] > 0)
{{ trans_choice(':n unpaid invoice|:n unpaid invoices', $kpis['outstanding_count'], ['n' => $kpis['outstanding_count']]) }}
@else
{{ __('All paid') }}
@endif
{{-- Activity chart --}}
{{ __('Last 30 days') }}
{{ __('Your requests submitted per day') }}
@php $totalRecent = array_sum($recentChart['vals']); @endphp
{{ __('Total') }}
{{ $fmt($totalRecent) }}
@if($totalRecent === 0)
{{ __('No activity in the last 30 days.') }}
@else
{!! \App\Services\Charting\ChartRenderer::render('area', [[
'label' => __('Requests'),
'values' => $recentChart['vals'],
]], [
'categories' => $recentChart['cats'],
'width' => 760,
'height' => 220,
]) !!}
@endif
{{-- Quick actions --}}
{{ __('Quick actions') }}
{{-- ─── Recent results ─────────────────────────────────────────── --}}
@endsection