<div class="main-content">
  <div class="container-fluid">


    <div class="row mb-4">
      <div class="col-12">
        <h1><i class="bi bi-speedometer2 me-2"></i>Dashboard SIDIK</h1>
        <h1><i class="bi bi-speedometer2 me-2"></i>Dashboard SIDIK</h1>
        <p>Selamat datang, <strong><?= htmlspecialchars($this->session->userdata('nama_pegawai')) ?></strong>!</p>
      </div>
    </div>

    <!-- Statistik Pegawai -->
    <div class="row mb-4">
      <div class="col-md-4"><div class="card text-center"><div class="card-body"><h5>Total Pegawai</h5><h2><?= $stats['total_pegawai'] ?></h2></div></div></div>
      <div class="col-md-4"><div class="card text-center"><div class="card-body"><h5>Struktural</h5><h2><?= $stats['jabatan_struktural'] ?></h2></div></div></div>
      <div class="col-md-4"><div class="card text-center"><div class="card-body"><h5>Fungsional</h5><h2><?= $stats['jabatan_fungsional'] ?></h2></div></div></div>
    </div>

    <!-- Status Dialog Kinerja -->
    <div class="card">
      <div class="card-header">Status Dialog Kinerja</div>
      <div class="table-responsive">
        <table class="table table-bordered">
          <thead>
            <tr>
              <th>Template</th>
              <th>Draft</th>
              <th>On Proses</th>
              <th>Selesai</th>
            </tr>
          </thead>
          <tbody>
            <?php for ($t = 1; $t <= 5; $t++): ?>
              <tr>
                <td>Template <?= $t ?></td>
                <td><?= $dialog_matrix[$t]['draft'] ?? 0 ?></td>
                <td><?= $dialog_matrix[$t]['on_proses'] ?? 0 ?></td>
                <td><?= $dialog_matrix[$t]['selesai'] ?? 0 ?></td>
              </tr>
            <?php endfor; ?>
          </tbody>
        </table>
      </div>
    </div>

  </div>
</div>