<?php $__env->startSection('title', 'Admin Dashboard'); ?>
<?php $__env->startSection('page-title', 'Admin Dashboard'); ?>
<?php $__env->startSection('content'); ?>
<div class="row g-3 mb-4">
    <div class="col-md-3 col-6"><div class="stat-card"><div class="stat-card-label">Users</div><div class="stat-card-value"><?php echo e($stats['users']); ?></div></div></div>
    <div class="col-md-3 col-6"><div class="stat-card"><div class="stat-card-label">Resellers</div><div class="stat-card-value"><?php echo e($stats['resellers']); ?></div></div></div>
    <div class="col-md-3 col-6"><div class="stat-card"><div class="stat-card-label">Total Blogs</div><div class="stat-card-value"><?php echo e($stats['blogs']); ?></div></div></div>
    <div class="col-md-3 col-6"><div class="stat-card"><div class="stat-card-label">Categories</div><div class="stat-card-value"><?php echo e($stats['categories']); ?></div></div></div>
    <div class="col-md-3 col-6"><div class="stat-card"><div class="stat-card-label">Packages</div><div class="stat-card-value"><?php echo e($stats['packages']); ?></div></div></div>
    <div class="col-md-3 col-6"><div class="stat-card"><div class="stat-card-label">Unpaid Invoices</div><div class="stat-card-value"><?php echo e($stats['invoices_unpaid']); ?></div></div></div>
    <div class="col-md-3 col-6"><div class="stat-card"><div class="stat-card-label">Paid Invoices</div><div class="stat-card-value"><?php echo e($stats['invoices_paid']); ?></div></div></div>
    <div class="col-md-3 col-6"><div class="stat-card"><div class="stat-card-label">Total Revenue</div><div class="stat-card-value">$<?php echo e(number_format($stats['revenue'], 2)); ?></div></div></div>
</div>

<div class="row g-3">
    <div class="col-md-6">
        <div class="content-card">
            <div class="content-card-header"><h3>Recent Invoices</h3><a href="<?php echo e(route('admin.invoices.index')); ?>" class="small">View all →</a></div>
            <table class="table">
                <thead><tr><th>#</th><th>User</th><th>Amount</th><th>Status</th></tr></thead>
                <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $recent_invoices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $inv): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td><a href="<?php echo e(route('admin.invoices.show', $inv)); ?>"><?php echo e($inv->invoice_number); ?></a></td>
                        <td><?php echo e($inv->user->name ?? '—'); ?></td>
                        <td>$<?php echo e(number_format($inv->amount, 2)); ?></td>
                        <td><span class="badge <?php echo e($inv->statusBadgeClass()); ?>"><?php echo e(ucfirst($inv->status)); ?></span></td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr><td colspan="4" class="text-center text-muted py-3">No invoices yet</td></tr>
                <?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>
    <div class="col-md-6">
        <div class="content-card">
            <div class="content-card-header"><h3>Recent Blogs</h3><a href="<?php echo e(route('admin.blogs.index')); ?>" class="small">View all →</a></div>
            <table class="table">
                <thead><tr><th>Title</th><th>Author</th><th>Date</th></tr></thead>
                <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $recent_blogs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $b): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td><?php echo e(\Illuminate\Support\Str::limit($b->title, 50)); ?></td>
                        <td><?php echo e($b->author->name ?? '—'); ?></td>
                        <td class="small"><?php echo e($b->created_at->diffForHumans()); ?></td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr><td colspan="3" class="text-center text-muted py-3">No blogs yet</td></tr>
                <?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>

    <div class="col-12">
        <div class="content-card">
            <div class="content-card-header"><h3>Recent User Signups</h3><a href="<?php echo e(route('admin.users.index')); ?>" class="small">View all →</a></div>
            <table class="table">
                <thead><tr><th>Name</th><th>Username</th><th>Email</th><th>Role</th><th>Joined</th></tr></thead>
                <tbody>
                <?php $__currentLoopData = $recent_users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $u): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><a href="<?php echo e(route('admin.users.edit', $u)); ?>"><?php echo e($u->name); ?></a></td>
                        <td>{{ $u->username }}</td>
                        <td><?php echo e($u->email); ?></td>
                        <td><span class="user-role-badge role-<?php echo e($u->role); ?>"><?php echo e($u->role); ?></span></td>
                        <td class="small"><?php echo e($u->created_at->diffForHumans()); ?></td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp82\htdocs\blog\resources\views/admin/dashboard.blade.php ENDPATH**/ ?>