<div class="container-fluid">

<h2 class="fw-bold mb-4">
Enterprise Workflow Optimization Center
</h2>

<div class="row g-3 mb-4">

<?php foreach($funnel as $f): ?>

<div class="col-md">

<div class="card border-0 shadow-sm">

<div class="card-body text-center">

<div class="text-muted">
<?= htmlspecialchars($f['stage']) ?>
</div>

<h3>
<?= (int)$f['total'] ?>
</h3>

</div>

</div>

</div>

<?php endforeach; ?>

</div>

<div class="card border-0 shadow-sm mb-4">

<div class="card-header fw-bold">
Workflow Recommendations
</div>

<div class="card-body">

<?php foreach($recommendations as $r): ?>

<div class="alert alert-<?= htmlspecialchars($r['severity']) ?>">

<strong>
<?= htmlspecialchars($r['title']) ?>
</strong>

<br>

<?= htmlspecialchars($r['message']) ?>

</div>

<?php endforeach; ?>

<?php if(empty($recommendations)): ?>

<div class="alert alert-success">
Workflow operating within expected thresholds.
</div>

<?php endif; ?>

</div>

</div>

<div class="card border-0 shadow-sm">

<div class="card-header fw-bold">
Workflow Funnel
</div>

<div class="table-responsive">

<table class="table table-striped">

<thead>
<tr>
<th>Stage</th>
<th>Total</th>
</tr>
</thead>

<tbody>

<?php foreach($funnel as $f): ?>

<tr>

<td>
<?= htmlspecialchars($f['stage']) ?>
</td>

<td>
<?= (int)$f['total'] ?>
</td>

</tr>

<?php endforeach; ?>

</tbody>

</table>

</div>

</div>

</div>
