<?php $pageTitle='Border Crossings'; ?>
<div class="page-heading"><div><p class="eyebrow">International Operations</p><h1>Border Crossings</h1><p>Manage customs readiness, packets, driver progress, holds, fees, and detention.</p></div><?php if(can('border.manage')):?><a class="btn btn-primary" href="<?= url('/borders/create') ?>">New Crossing</a><?php endif;?></div>
<?php if(current_role()!=='driver') require app_path('Views/components/search_header.php'); ?>
<div class="panel"><div class="table-wrap"><table><thead><tr><th>Crossing</th><th>Load / Driver</th><th>Port</th><th>Schedule</th><th>Status</th><th>Waiting</th><th></th></tr></thead><tbody><?php foreach($crossings as $c):?><tr><td><strong><?= e($c['crossing_number']) ?></strong><br><small><?= e($c['origin_country'].' → '.$c['destination_country']) ?></small></td><td><?= e($c['load_number']) ?><br><small><?= e($c['driver_name']??'') ?></small></td><td><?= e($c['crossing_name']) ?><br><small><?= e($c['port_code']??'') ?></small></td><td><?= e(datetime_display($c['planned_at'])) ?></td><td><span class="badge badge-<?= status_class($c['status']) ?>"><?= e(readable_status($c['status'])) ?></span></td><td><?= e((string)($c['detention_minutes']??0)) ?> min<br><small><?= money($c['detention_amount']??0) ?></small></td><td><a class="btn btn-light btn-sm" href="<?= url('/borders/show?id='.$c['id']) ?>">Open</a></td></tr><?php endforeach;?><?php if(!$crossings):?><tr><td colspan="7" class="empty">No border crossings found.</td></tr><?php endif;?></tbody></table></div></div>
