<?= $this->extend('layout/main') ?>

<?= $this->section('content') ?>
<div class="space-y-8">
    
    <!-- Title -->
    <div>
        <h2 class="text-2xl font-bold text-on-surface">Dashboard Administrator</h2>
        <p class="text-sm text-secondary">Ringkasan master data pengguna dan santri Pondok Pesantren.</p>
    </div>

    <!-- Overview Grid -->
    <div class="grid grid-cols-1 sm:grid-cols-2 gap-6">
        
        <!-- Total Users Card -->
        <div class="bg-surface rounded-xl p-6 border border-outline shadow-sm flex items-center justify-between hover:shadow-md transition cursor-pointer" onclick="window.location.href='/admin/users'">
            <div>
                <p class="text-sm font-semibold text-secondary mb-1 uppercase tracking-wider">Total Pengguna</p>
                <h3 class="text-4xl font-black text-primary"><?= esc($usersCount ?? 0) ?></h3>
            </div>
            <div class="w-16 h-16 rounded-full bg-surface-container-low flex items-center justify-center text-primary">
                <span class="material-symbols-outlined text-3xl">manage_accounts</span>
            </div>
        </div>

        <!-- Total Santri Card -->
        <div class="bg-surface rounded-xl p-6 border border-outline shadow-sm flex items-center justify-between hover:shadow-md transition cursor-pointer" onclick="window.location.href='/admin/santri'">
            <div>
                <p class="text-sm font-semibold text-secondary mb-1 uppercase tracking-wider">Total Santri</p>
                <h3 class="text-4xl font-black text-tertiary"><?= esc($santriCount ?? 0) ?></h3>
            </div>
            <div class="w-16 h-16 rounded-full bg-surface-container-high flex items-center justify-center text-tertiary">
                <span class="material-symbols-outlined text-3xl">badge</span>
            </div>
        </div>

    </div>

    <div class="bg-primary/5 rounded-xl p-6 border border-primary/20 mt-8">
        <h3 class="text-lg font-bold text-primary mb-2 flex items-center gap-2">
            <span class="material-symbols-outlined">lightbulb</span> Panduan Admin
        </h3>
        <p class="text-sm text-secondary mb-4">
            Selamat datang di panel kontrol Administrator. Melalui panel ini Anda dapat:
        </p>
        <ul class="list-disc list-inside text-sm text-on-surface-variant space-y-2">
            <li>Menambahkan dan mengelola akun akses untuk <span class="font-bold">Wali Santri</span>, <span class="font-bold">Kesantrian</span>, dan <span class="font-bold">Satpam</span> melalui menu <b>Data Pengguna</b>.</li>
            <li>Memasukkan data induk <span class="font-bold">Santri</span> dan menghubungkannya dengan akun Wali Santri yang sesuai melalui menu <b>Data Santri</b>.</li>
        </ul>
    </div>

</div>
<?= $this->endSection() ?>
