<?php

declare(strict_types=1);

ob_start();

?>

<div class="mb-4">

    <h2 class="mb-1">
        Welcome,
        <?= htmlspecialchars(
            $fullName,
            ENT_QUOTES,
            'UTF-8'
        ) ?>
    </h2>

    <p class="text-muted">
        NPS Database Administration
    </p>

</div>


<div class="row g-4">

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

        <div class="card stat-card shadow-sm">

            <div class="card-body">

                <div class="d-flex justify-content-between">

                    <div>

                        <div class="text-muted">
                            Total Users
                        </div>

                        <h2 class="mt-2 mb-0">
                            <?= (int) ($totalUsers ?? 0) ?>
                        </h2>

                    </div>

                    <div class="fs-1 text-secondary">

                        <i class="bi bi-people"></i>

                    </div>

                </div>

            </div>

        </div>

    </div>


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

        <div class="card stat-card shadow-sm">

            <div class="card-body">

                <div class="d-flex justify-content-between">

                    <div>

                        <div class="text-muted">
                            Active Users
                        </div>

                        <h2 class="mt-2 mb-0">
                            <?= (int) ($activeUsers ?? 0) ?>
                        </h2>

                    </div>

                    <div class="fs-1 text-secondary">

                        <i class="bi bi-person-check"></i>

                    </div>

                </div>

            </div>

        </div>

    </div>


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

        <div class="card stat-card shadow-sm">

            <div class="card-body">

                <div class="d-flex justify-content-between">

                    <div>

                        <div class="text-muted">
                            Roles
                        </div>

                        <h2 class="mt-2 mb-0">
                            <?= (int) ($totalRoles ?? 0) ?>
                        </h2>

                    </div>

                    <div class="fs-1 text-secondary">

                        <i class="bi bi-person-badge"></i>

                    </div>

                </div>

            </div>

        </div>

    </div>


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

        <div class="card stat-card shadow-sm">

            <div class="card-body">

                <div class="d-flex justify-content-between">

                    <div>

                        <div class="text-muted">
                            Permissions
                        </div>

                        <h2 class="mt-2 mb-0">
                            <?= (int) ($totalPermissions ?? 0) ?>
                        </h2>

                    </div>

                    <div class="fs-1 text-secondary">

                        <i class="bi bi-shield-check"></i>

                    </div>

                </div>

            </div>

        </div>

    </div>

</div>


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

    <div class="card-header bg-white py-3">

        <h5 class="mb-0">
            Administration
        </h5>

    </div>

    <div class="card-body">

        <div class="row g-3">

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

                <a
                    href="/public/users"
                    class="btn btn-outline-dark w-100 py-3">

                    <i class="bi bi-people me-2"></i>

                    Manage Users

                </a>

            </div>

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

                <a
                    href="/public/roles"
                    class="btn btn-outline-dark w-100 py-3">

                    <i class="bi bi-person-badge me-2"></i>

                    Manage Roles

                </a>

            </div>

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

                <a
                    href="/public/permissions"
                    class="btn btn-outline-dark w-100 py-3">

                    <i class="bi bi-shield-lock me-2"></i>

                    Manage Permissions

                </a>

            </div>

        </div>

    </div>

</div>

<?php

$content = ob_get_clean();

$title = 'Administration Dashboard';

include APP_PATH .
    '/Modules/Administration/Views/layouts/admin.php';