

<?php $__env->startSection('content'); ?>
    <div class="mb-8 flex items-end justify-between gap-4">
        <div>
            <p class="section-kicker">Overview</p>
            <h1 class="section-title text-4xl"><?php echo e(__('Dashboard')); ?></h1>
        </div>
    </div>

    <div class="grid gap-6 md:grid-cols-2 xl:grid-cols-5">
        <div class="admin-card"><p class="text-sm uppercase tracking-[0.2em] text-slate-400">Services</p><p class="mt-4 font-display text-5xl font-bold"><?php echo e($serviceCount); ?></p></div>
        <div class="admin-card"><p class="text-sm uppercase tracking-[0.2em] text-slate-400">Industries</p><p class="mt-4 font-display text-5xl font-bold"><?php echo e($industryCount); ?></p></div>
        <div class="admin-card"><p class="text-sm uppercase tracking-[0.2em] text-slate-400">Clients</p><p class="mt-4 font-display text-5xl font-bold"><?php echo e($clientCount); ?></p></div>
        <div class="admin-card"><p class="text-sm uppercase tracking-[0.2em] text-slate-400">Projects</p><p class="mt-4 font-display text-5xl font-bold"><?php echo e($projectCount); ?></p></div>
        <div class="admin-card"><p class="text-sm uppercase tracking-[0.2em] text-slate-400">Pages</p><p class="mt-4 font-display text-5xl font-bold"><?php echo e($pageCount); ?></p></div>
    </div>

    <div class="mt-10">
        <div class="mb-5 flex items-center justify-between gap-3">
            <p class="section-kicker mb-0">Project Requests</p>
            <a href="<?php echo e(route('admin.projects.index')); ?>" class="btn-secondary px-4 py-2">View All</a>
        </div>

        <?php if($latestProjects->isEmpty()): ?>
            <div class="admin-card">
                <p class="text-lg font-semibold">No project requests yet.</p>
                <p class="mt-2 text-sm text-slate-500 dark:text-slate-400">When someone submits the contact form on the website, details will appear here.</p>
            </div>
        <?php else: ?>
            <div class="grid gap-6 lg:grid-cols-2 xl:grid-cols-3">
                <?php $__currentLoopData = $latestProjects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $project): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <article class="admin-card border-brand-100/70 dark:border-brand-500/20">
                        <div class="flex items-start justify-between gap-3">
                            <div>
                                <p class="text-xs font-bold uppercase tracking-[0.2em] text-brand-500">Project</p>
                                <h2 class="mt-2 text-2xl font-bold"><?php echo e($project->name); ?></h2>
                            </div>
                            <div class="flex items-center gap-2">
                                <?php ($sentAt = $project->submitted_at ?? $project->created_at); ?>
                                <span class="rounded-full bg-slate-200 px-3 py-1 text-xs font-semibold text-black dark:bg-slate-300 dark:text-black" title="<?php echo e(optional($sentAt)->format('Y-m-d H:i:s')); ?>">
                                    <?php echo e(optional($sentAt)->diffForHumans()); ?>

                                </span>
                                <form method="POST" action="<?php echo e(route('admin.projects.destroy', $project)); ?>" onsubmit="return confirm('Delete this project request?');">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('DELETE'); ?>
                                    <button type="submit" class="rounded-full bg-slate-500 px-3 py-1 text-xs font-semibold text-white transition hover:bg-red-600">Delete</button>
                                </form>
                            </div>
                        </div>

                        <div class="mt-5 grid gap-3 rounded-2xl border border-slate-200/80 bg-transparent p-4 text-sm dark:border-slate-700/80">
                            <div>
                                <p class="text-xs uppercase tracking-[0.2em] text-slate-400">Email</p>
                                <a href="mailto:<?php echo e($project->email); ?>" class="mt-1 block font-semibold text-brand-600 hover:text-brand-500 dark:text-brand-300"><?php echo e($project->email); ?></a>
                            </div>
                            <div>
                                <p class="text-xs uppercase tracking-[0.2em] text-slate-400">Phone</p>
                                <a href="https://wa.me/<?php echo e(preg_replace('/\D+/', '', $project->phone)); ?>" target="_blank" class="mt-1 block font-semibold text-brand-600 hover:text-brand-500 dark:text-brand-300"><?php echo e($project->phone); ?></a>
                            </div>
                            <div>
                                <p class="text-xs uppercase tracking-[0.2em] text-slate-400">Service</p>
                                <p class="mt-1 font-semibold"><?php echo e($project->service); ?></p>
                            </div>
                        </div>

                        <div class="mt-4 rounded-2xl border border-slate-200 p-4 dark:border-slate-700">
                            <p class="text-xs uppercase tracking-[0.2em] text-slate-400">Details</p>
                            <p class="mt-2 whitespace-pre-line leading-7 text-slate-700 dark:text-slate-200"><?php echo e($project->details); ?></p>
                        </div>
                    </article>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        <?php endif; ?>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin', ['title' => __('Dashboard').' | Nivex'], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\Nivex\resources\views/admin/dashboard.blade.php ENDPATH**/ ?>