<?php if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } ?> <div class="ov-panel"> <div class="ov-panel-hdr"> <span class="ov-panel-title"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg> Order Pipeline</span> <a href="?view=fulfillment" class="ov-panel-link">View All &rarr;</a> </div> <div class="ov-pipeline"><?php foreach ($pipeline as $stage => $count): $h = max(8, ($count / $pipeMax) * 90); $colors = ['Pending'=>'#e6a817','Paid'=>'#2ecc71','Packaged'=>'#3498db','Shipped'=>'#9b59b6','Delivered'=>'#00b4d8']; $c = $colors[$stage] ?? '#888'; ?> <div class="ov-pipe-col"> <div class="ov-pipe-bar-wrap"> <div class="ov-pipe-val"><?= $count ?></div> <div class="ov-pipe-bar" style="height:<?= $h ?>px;background:<?= $c ?>"></div> </div> <div class="ov-pipe-lbl"><?= $stage ?></div> </div><?php endforeach; ?> </div> <div class="ov-pipeline-totals"> <span>Total active: <strong><?= array_sum($pipeline) ?></strong></span> <span>Delivery rate: <strong><?= array_sum($pipeline) > 0 ? round(($pipeline['Delivered'] / array_sum($pipeline)) * 100) : 0 ?>%</strong></span> </div> </div>