<div class="container-fluid">

<div class="mb-4">
    <h2 class="fw-bold">
        Research Intelligence Center
    </h2>
</div>

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

<div class="col-md-3">
<div class="card shadow-sm border-0">
<div class="card-body text-center">
<div class="text-muted">Authors</div>
<h2><?= (int)$stats['authors'] ?></h2>
</div>
</div>
</div>

<div class="col-md-3">
<div class="card shadow-sm border-0">
<div class="card-body text-center">
<div class="text-muted">Reviewers</div>
<h2><?= (int)$stats['reviewers'] ?></h2>
</div>
</div>
</div>

<div class="col-md-3">
<div class="card shadow-sm border-0">
<div class="card-body text-center">
<div class="text-muted">Accepted</div>
<h2><?= (int)$stats['accepted'] ?></h2>
</div>
</div>
</div>

<div class="col-md-3">
<div class="card shadow-sm border-0">
<div class="card-body text-center">
<div class="text-muted">Published</div>
<h2><?= (int)$stats['published'] ?></h2>
</div>
</div>
</div>

</div>

<div class="row">

<div class="col-md-6">

<div class="card shadow-sm border-0 mb-4">
<div class="card-header fw-bold">
Top Authors
</div>

<table class="table table-striped mb-0">
<thead>
<tr>
<th>Author</th>
<th>Submissions</th>
</tr>
</thead>
<tbody>

<?php foreach($topAuthors as $a): ?>

<tr>
<td><?= htmlspecialchars($a['author_name']) ?></td>
<td><?= (int)$a['submissions'] ?></td>
</tr>

<?php endforeach; ?>

</tbody>
</table>

</div>

</div>

<div class="col-md-6">

<div class="card shadow-sm border-0 mb-4">
<div class="card-header fw-bold">
Top Reviewers
</div>

<table class="table table-striped mb-0">
<thead>
<tr>
<th>Reviewer</th>
<th>Reviews</th>
</tr>
</thead>
<tbody>

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

<tr>
<td><?= htmlspecialchars($r['reviewer_name']) ?></td>
<td><?= (int)$r['reviews'] ?></td>
</tr>

<?php endforeach; ?>

</tbody>
</table>

</div>

</div>

</div>

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

<div class="card-header fw-bold">
Track Intelligence
</div>

<table class="table table-striped mb-0">

<thead>
<tr>
<th>Track</th>
<th>Submissions</th>
<th>Accepted</th>
</tr>
</thead>

<tbody>

<?php foreach($trackAnalytics as $t): ?>

<tr>

<td>
<?= htmlspecialchars($t['name_en']) ?>
</td>

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

<td>
<?= (int)$t['accepted_count'] ?>
</td>

</tr>

<?php endforeach; ?>

</tbody>

</table>

</div>

</div>
