<div class="container-fluid py-4">

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

<div class="col-md-3">
<div class="card border-0 shadow-sm">
<div class="card-body text-center">
<h5>Platform Health</h5>
<h1><?= (float)$platformHealth ?>%</h1>
</div>
</div>
</div>

<div class="col-md-3">
<div class="card border-0 shadow-sm">
<div class="card-body text-center">
<h5>Active Alerts</h5>
<h1><?= (int)$activeAlerts ?></h1>
</div>
</div>
</div>

<div class="col-md-3">
<div class="card border-0 shadow-sm">
<div class="card-body text-center">
<h5>Pending Decisions</h5>
<h1><?= (int)$pendingDecisions ?></h1>
</div>
</div>
</div>

<div class="col-md-3">
<div class="card border-0 shadow-sm">
<div class="card-body text-center">
<h5>Executed Decisions</h5>
<h1><?= (int)$executedDecisions ?></h1>
</div>
</div>
</div>

</div>

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

<div class="col-md-6">
<div class="card border-0 shadow-sm">
<div class="card-body">
<h4>Best Conference</h4>
<h3>
<?= htmlspecialchars($bestConference['short_name'] ?? 'N/A') ?>
</h3>
<p class="text-muted">
Health:
<?= isset($bestConference['health_score']) ? (float)$bestConference['health_score'] . '%' : 'N/A' ?>
</p>
</div>
</div>
</div>

<div class="col-md-6">
<div class="card border-0 shadow-sm">
<div class="card-body">
<h4>Highest Risk Conference</h4>
<h3>
<?= htmlspecialchars($highestRiskConference['short_name'] ?? 'N/A') ?>
</h3>
<p class="text-muted">
Health:
<?= isset($highestRiskConference['health_score']) ? (float)$highestRiskConference['health_score'] . '%' : 'N/A' ?>
</p>
</div>
</div>
</div>

</div>

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

<div class="card-body">

<h2>
Executive Governance Cockpit
</h2>

<table class="table table-bordered table-hover">

<thead>

<tr>
<th>Conference</th>
<th>Coverage %</th>
<th>Tracks</th>
<th>Submissions</th>
<th>Reviews</th>
<th>Overdue</th>
<th>Health Score</th>
<th>Status</th>
</tr>

</thead>

<tbody>

<?php foreach($conferenceHealth as $row): ?>

<tr>

<td>
<?= htmlspecialchars($row['short_name'] ?? ('Conference #' . (int)$row['id'])) ?>
</td>

<td><?= (float)$row['coverage_percent'] ?></td>

<td><?= (int)$row['total_tracks'] ?></td>

<td><?= (int)$row['submissions'] ?></td>

<td><?= (int)$row['reviews'] ?></td>

<td><?= (int)$row['overdue_reviews'] ?></td>

<td><?= (float)$row['health_score'] ?></td>

<td><?= htmlspecialchars($row['health_status']) ?></td>

</tr>

<?php endforeach; ?>

</tbody>

</table>

</div>

</div>

</div>
