                <!-- Page Title -->
                <div class="d-flex justify-content-between align-items-center mb-4">
                    <h3 class="mb-0" style="color: var(--sidebar-bg);">
                        <i class="bi bi-speedometer2 me-2"></i>Dashboard
                    </h3>
                    <div>
                        <span class="text-muted"><?php echo date('l, d F Y'); ?></span>
                    </div>
                </div>

                <!-- Stats Cards -->
                <div class="row mb-4">
                    <div class="col-md-4">
                        <div class="stat-card stat-card-1">
                            <div class="d-flex justify-content-between align-items-center">
                                <div>
                                    <h1 class="display-4 fw-bold"><?php echo count($total_results); ?></h1>
                                    <h6>Total Data Hasil TKA</h6>
                                </div>
                                <i class="bi bi-file-earmark-text" style="font-size: 3rem; opacity: 0.7;"></i>
                            </div>
                            <a href="<?php echo base_url('admin/hasil_tka'); ?>" class="btn btn-light btn-sm mt-2">
                                Lihat Data <i class="bi bi-arrow-right"></i>
                            </a>
                        </div>
                    </div>

                    <div class="col-md-4">
                        <div class="stat-card stat-card-2">
                            <div class="d-flex justify-content-between align-items-center">
                                <div>
                                    <h1 class="display-4 fw-bold"><?php echo count($active_tokens); ?></h1>
                                    <h6>Token Aktif</h6>
                                </div>
                                <i class="bi bi-key" style="font-size: 3rem; opacity: 0.7;"></i>
                            </div>
                            <a href="<?php echo base_url('admin/tokens'); ?>" class="btn btn-light btn-sm mt-2">
                                Kelola Token <i class="bi bi-arrow-right"></i>
                            </a>
                        </div>
                    </div>

                    <div class="col-md-4">
                        <div class="stat-card stat-card-3">
                            <div class="d-flex justify-content-between align-items-center">
                                <div>
                                    <h1 class="display-4 fw-bold"><?php echo count($total_tokens); ?></h1>
                                    <h6>Total Token</h6>
                                </div>
                                <i class="bi bi-key-fill" style="font-size: 3rem; opacity: 0.7;"></i>
                            </div>
                            <a href="<?php echo base_url('admin/tokens'); ?>" class="btn btn-light btn-sm mt-2">
                                Lihat Semua <i class="bi bi-arrow-right"></i>
                            </a>
                        </div>
                    </div>
                </div>

                <!-- Quick Actions -->
                <div class="row">
                    <div class="col-md-8">
                        <div class="card">
                            <div class="card-header">
                                <h5 class="mb-0"><i class="bi bi-lightning me-2"></i>Quick Actions</h5>
                            </div>
                            <div class="card-body">
                                <div class="row">
                                    <div class="col-md-4 mb-3">
                                        <a href="<?php echo site_url('admin/import_hasil_tka'); ?>"
                                            class="btn btn-primary w-100">
                                            <i class="bi bi-upload me-2"></i>Import Data Excel
                                        </a>
                                    </div>
                                    <div class="col-md-4 mb-3">
                                        <a href="<?php echo site_url('admin/tokens'); ?>" class="btn btn-success w-100">
                                            <i class="bi bi-plus-circle me-2"></i>Generate Token Baru
                                        </a>
                                    </div>
                                    <div class="col-md-4 mb-3">
                                        <a href="<?php echo site_url('admin/hasil_tka'); ?>"
                                            class="btn btn-info w-100 text-white">
                                            <i class="bi bi-eye me-2"></i>Lihat Data TKA
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Recent Activity -->
                        <div class="card mt-4">
                            <div class="card-header">
                                <h5 class="mb-0"><i class="bi bi-clock-history me-2"></i>Recent Activity</h5>
                            </div>
                            <div class="card-body">
                                <div class="list-group">
                                    <div class="list-group-item border-0">
                                        <div class="d-flex w-100 justify-content-between">
                                            <h6 class="mb-1">Login Sistem</h6>
                                            <small>Hari ini</small>
                                        </div>
                                        <p class="mb-1">Anda login ke sistem sebagai
                                            <?php echo $this->session->userdata('level'); ?></p>
                                    </div>
                                    <div class="list-group-item border-0">
                                        <div class="d-flex w-100 justify-content-between">
                                            <h6 class="mb-1">Dashboard Diakses</h6>
                                            <small>Hari ini</small>
                                        </div>
                                        <p class="mb-1">Anda mengakses dashboard admin</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-4">
                        <!-- System Info -->
                        <div class="card">
                            <div class="card-header">
                                <h5 class="mb-0"><i class="bi bi-info-circle me-2"></i>System Information</h5>
                            </div>
                            <div class="card-body">
                                <ul class="list-unstyled">
                                    <li class="mb-2">
                                        <i class="bi bi-server me-2 text-primary"></i>
                                        <strong>Database:</strong> MySQL
                                    </li>
                                    <li class="mb-2">
                                        <i class="bi bi-code-slash me-2 text-primary"></i>
                                        <strong>Framework:</strong> CodeIgniter 3
                                    </li>
                                    <li class="mb-2">
                                        <i class="bi bi-bootstrap me-2 text-primary"></i>
                                        <strong>CSS Framework:</strong> Bootstrap 5
                                    </li>
                                    <li class="mb-2">
                                        <i class="bi bi-calendar-check me-2 text-primary"></i>
                                        <strong>Last Updated:</strong> <?php echo date('d/m/Y'); ?>
                                    </li>
                                    <li>
                                        <i class="bi bi-person-check me-2 text-primary"></i>
                                        <strong>Your Role:</strong> <?php echo $this->session->userdata('level'); ?>
                                    </li>
                                </ul>
                            </div>
                        </div>

                        <!-- Quick Links -->
                        <div class="card mt-4">
                            <div class="card-header">
                                <h5 class="mb-0"><i class="bi bi-link me-2"></i>Quick Links</h5>
                            </div>
                            <div class="card-body">
                                <div class="d-grid gap-2">
                                    <a href="<?php echo site_url(); ?>" target="_blank" class="btn btn-outline-primary">
                                        <i class="bi bi-globe me-2"></i>Frontend Website
                                    </a>
                                    <a href="<?php echo site_url('admin/admins'); ?>" class="btn btn-outline-success">
                                        <i class="bi bi-people me-2"></i>Manage Admins
                                    </a>
                                    <?php if ($this->session->userdata('level') == 'admin'): ?>
                                        <a href="<?php echo site_url('admin/tambah_admin'); ?>"
                                            class="btn btn-outline-info">
                                            <i class="bi bi-person-plus me-2"></i>Tambah Admin
                                        </a>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>