@extends('layouts.app') @section('title', __('Billing')) @section('content')

💳 {{ __('Billing') }}

{{-- Subscription status --}} @php($status = $subscription?->status ?? 'trialing')
{{ __('Current plan') }}
{{ $plan->name }}
{{ $plan->priceIqd() }} / {{ __('month') }}
{{ __(ucfirst($status)) }} @if($subscription?->current_period_ends_at)
{{ $status === 'trialing' ? __('Trial ends') : __('Renews') }}: {{ $subscription->current_period_ends_at->format('d M Y') }} ({{ $subscription->current_period_ends_at->diffForHumans() }})
@endif @if(! is_null($trialDaysLeft))
{{ $trialDaysLeft }} {{ __('trial days left') }}
@endif
@if($status === 'trialing')
🎁 {{ __('You are on a :days-day free trial — no payment method required. Subscribe any time before it ends.', ['days' => $plan->trial_days]) }}
@elseif($status === 'grace')
⚠ {{ __('Your subscription has expired. You have a short grace period before access is suspended — please renew.') }}
@elseif($status === 'suspended')
🔒 {{ __('Access is suspended. Submit a payment below to reactivate your clinic immediately.') }}
@endif
{{-- Usage overview: WhatsApp (month), storage, staff, dentists --}}

📊 {{ __('Plan usage') }}

@php($meters = [ ['label' => __('WhatsApp this month'), 'u' => $usage, 'fmt' => fn ($v) => number_format($v), 'suffix' => ''], ['label' => __('Storage'), 'u' => $storageUsage, 'fmt' => fn ($v) => number_format($v), 'suffix' => ' MB'], ['label' => __('Staff seats'), 'u' => $staffUsage, 'fmt' => fn ($v) => $v, 'suffix' => ''], ['label' => __('Dentists'), 'u' => $dentistUsage, 'fmt' => fn ($v) => $v, 'suffix' => ''], ]) @foreach($meters as $m) @php($u = $m['u'])
{{ $m['label'] }}
{{ ($m['fmt'])($u['used']) }}{{ $m['suffix'] }} @if(! is_null($u['limit'])) / {{ ($m['fmt'])($u['limit']) }}{{ $m['suffix'] }} @else / ∞ @endif
@endforeach
{{ __('Limits are soft — your clinic keeps working past them; we’ll nudge you to upgrade.') }}
{{-- Card payment (Paddle) --}}

💳 {{ __('Pay by card') }}

{{ __('Instant activation via our secure card processor.') }}

@if($paddleLink) {{ __('Subscribe by card') }} @else @endif
{{-- Manual proof (Zain Cash / SuperQi) --}}

📱 {{ __('Pay with Zain Cash / SuperQi') }}

{{ __('Transfer the amount, then upload your receipt. We verify and activate within hours.') }}

@csrf
@error('proof')
{{ $message }}
@enderror
{{-- Payment history --}}

{{ __('Payment history') }}

@forelse($payments as $p) @empty @endforelse
{{ __('Date') }}{{ __('Method') }}{{ __('Amount') }}{{ __('Status') }}
{{ $p->created_at->format('d M Y') }} {{ $p->gateway->label() }} {{ $p->amountFormatted() }} {{ $p->status->label() }} @if($p->proof_path) {{ __('View proof') }} @endif
{{ __('No payments yet.') }}
@endsection