<?php $pageTitle='My Payments'; ?>
<div class="driver-page"><div class="page-heading"><div><p class="eyebrow">Driver Portal</p><h1>Settlements & Payments</h1><p>Review completed-load pay, deductions, payment status, and submitted reimbursements.</p></div><a class="btn btn-primary" href="<?= url('/driver/expenses') ?>">Submit Expense</a></div><div class="panel"><div class="panel-header"><div><p class="eyebrow">Settlements</p><h2>Driver Pay History</h2></div></div><div class="mobile-card-list"><?php foreach($settlements as$s):?><div class="mobile-record-card"><div><strong><?= e($s['settlement_number'].' · '.($s['load_number']??'Multiple loads')) ?></strong><span>Gross <?= money($s['gross_amount']) ?> · Deductions <?= money($s['deductions']) ?></span></div><div class="align-right"><strong><?= money($s['net_amount']) ?></strong><a class="btn btn-light btn-sm" href="<?= url('/settlements/pdf?id='.$s['id']) ?>">PDF</a><span class="badge badge-<?= status_class($s['status']) ?>"><?= e(readable_status($s['status'])) ?></span></div></div><?php endforeach;?><?php if(!$settlements):?><p class="empty">No settlements available.</p><?php endif;?></div></div><div class="panel"><div class="panel-header"><div><p class="eyebrow">Reimbursements</p><h2>Expense Status</h2></div></div><div class="mobile-card-list"><?php foreach($expenses as$x):?><div class="mobile-record-card"><div><strong><?= e($x['expense_number'].' · '.($x['category_name']??'Expense')) ?></strong><span><?= money((float)$x['amount']+(float)$x['tax_amount']) ?> · <?= e(date_display($x['expense_date'])) ?></span></div><span class="badge badge-<?= status_class($x['status']) ?>"><?= e(readable_status($x['status'])) ?></span></div><?php endforeach;?></div></div></div>
