<h1><i class="fa-solid fa-shield-halved"></i> SuperAdmin Control Center</h1>

<div class="dashboard-grid">

<div class="dashboard-card">
<h3>Organizations</h3>
<h1><?= $stats['organizations'] ?></h1>
</div>

<div class="dashboard-card">
<h3>Conferences</h3>
<h1><?= $stats['conferences'] ?></h1>
</div>

<div class="dashboard-card">
<h3>Submissions</h3>
<h1><?= $stats['submissions'] ?></h1>
</div>

<div class="dashboard-card">
<h3>Reviews</h3>
<h1><?= $stats['reviews'] ?></h1>
</div>

<div class="dashboard-card">
<h3>Users</h3>
<h1><?= $stats['users'] ?></h1>
</div>

<div class="dashboard-card">
<h3>Reviewers</h3>
<h1><?= $stats['reviewers'] ?></h1>
</div>

</div>

<hr style="margin:40px 0;">

<h2><i class="fa-solid fa-clock"></i> Latest Submissions</h2>

<table>
<tr>
<th>ID</th>
<th>Title</th>
<th>Status</th>
<th>Date</th>
</tr>

<?php foreach($latestSubmissions as $s): ?>
<tr>
<td><?= $s['id'] ?></td>
<td><?= htmlspecialchars($s['title'] ?? '') ?></td>
<td><?= $s['status'] ?></td>
<td><?= $s['created_at'] ?></td>
</tr>
<?php endforeach; ?>
</table>

<hr style="margin:40px 0;">

<h2><i class="fa-solid fa-chart-pie"></i> Submission Status Overview</h2>

<table>
<tr>
<th>Status</th>
<th>Total</th>
</tr>

<?php foreach($statusDistribution as $row): ?>
<tr>
<td><?= $row['status'] ?></td>
<td><?= $row['total'] ?></td>
</tr>
<?php endforeach; ?>
</table>

<hr style="margin:40px 0;">

<h2><i class="fa-solid fa-bolt"></i> Quick Actions</h2>

<a class="btn" href="/easychair/admin/organizations">Manage Organizations</a>
<a class="btn" href="/easychair/admin/conferences">Manage Conferences</a>
<a class="btn" href="/easychair/admin/submissions">View Submissions</a>
<a class="btn" href="/easychair/admin/reviewers">Manage Reviewers</a>
<a class="btn" href="/easychair/admin/assignments">Assignment Engine</a>

