

<?php $__env->startSection('title', 'Admin Dashboard'); ?>

<?php $__env->startSection('admin-content'); ?>
    <!-- Page Header -->
    <div class="page-header">
        <div>
            <h3 class="page-title">Admin Dashboard</h3>
            <p class="text-muted mb-0">Overview of platform performance</p>
        </div>
        <div class="text-muted small">
            <i class="bi bi-clock me-1"></i> Last updated: <?php echo e(now()->format('M d, Y H:i')); ?>

        </div>
    </div>

    <!-- Stats Widgets -->
    <div class="row g-3 mb-4">
        <div class="col-md-3 col-6">
            <div class="stat-card stat-card-primary">
                <div class="stat-icon">
                    <i class="bi bi-people"></i>
                </div>
                <div class="stat-content">
                    <span class="stat-value"><?php echo e($stats['users']); ?></span>
                    <span class="stat-label">Total Users</span>
                    <a href="<?php echo e(route('admin.users')); ?>" class="text-white text-opacity-75 text-decoration-none small">View Users →</a>
                </div>
            </div>
        </div>
        <div class="col-md-3 col-6">
            <div class="stat-card stat-card-success">
                <div class="stat-icon">
                    <i class="bi bi-shop"></i>
                </div>
                <div class="stat-content">
                    <span class="stat-value"><?php echo e($stats['sellers']); ?></span>
                    <span class="stat-label">Sellers</span>
                    <a href="<?php echo e(route('admin.sellers')); ?>" class="text-white text-opacity-75 text-decoration-none small">Manage Sellers →</a>
                </div>
            </div>
        </div>
        <div class="col-md-3 col-6">
            <div class="stat-card stat-card-warning">
                <div class="stat-icon">
                    <i class="bi bi-box-seam"></i>
                </div>
                <div class="stat-content">
                    <span class="stat-value"><?php echo e($stats['products']); ?></span>
                    <span class="stat-label">Products</span>
                    <a href="<?php echo e(route('admin.products')); ?>" class="text-white text-opacity-75 text-decoration-none small">Manage Products →</a>
                </div>
            </div>
        </div>
        <div class="col-md-3 col-6">
            <div class="stat-card stat-card-info">
                <div class="stat-icon">
                    <i class="bi bi-file-earmark-text"></i>
                </div>
                <div class="stat-content">
                    <span class="stat-value"><?php echo e($stats['rfqs']); ?></span>
                    <span class="stat-label">RFQs</span>
                    <a href="<?php echo e(route('admin.rfqs')); ?>" class="text-white text-opacity-75 text-decoration-none small">View RFQs →</a>
                </div>
            </div>
        </div>
    </div>

    <!-- Recent Activity & Quick Actions -->
    <div class="row g-4">
        <div class="col-md-8">
            <div class="card h-100">
                <div class="card-header d-flex justify-content-between align-items-center">
                    <h6 class="fw-bold mb-0">Recent Activity</h6>
                    <span class="badge bg-light text-dark">Real-time</span>
                </div>
                <div class="card-body p-0">
                    <div class="list-group list-group-flush">
                        <?php $__empty_1 = true; $__currentLoopData = $recentActivity; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $activity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <?php
                                $icon = 'bi-circle';
                                $color = 'secondary';
                                $title = 'Activity';
                                $description = '';
                                
                                switch($activity->type) {
                                    case 'user':
                                        $icon = 'bi-person-plus';
                                        $color = 'primary';
                                        $title = 'New User Registered';
                                        $description = 'New user "' . $activity->name . '" has joined.';
                                        break;
                                    case 'seller':
                                        $icon = 'bi-shop';
                                        $color = 'success';
                                        $title = 'New Seller Registration';
                                        $description = 'Seller "' . $activity->company_name . '" registered.';
                                        break;
                                    case 'product':
                                        $icon = 'bi-box-seam';
                                        $color = 'warning';
                                        $title = 'New Product Added';
                                        $description = 'Product "' . Str::limit($activity->name, 30) . '" added by ' . ($activity->seller->company_name ?? 'Unknown') . '.';
                                        break;
                                    case 'rfq':
                                        $icon = 'bi-megaphone';
                                        $color = 'info';
                                        $title = 'New RFQ Posted';
                                        $description = 'Requirement for "' . Str::limit($activity->title, 30) . '" posted.';
                                        break;
                                }
                            ?>
                            <div class="list-group-item py-3 border-bottom-0">
                                <div class="d-flex align-items-start">
                                    <div class="avatar-circle bg-<?php echo e($color); ?> bg-opacity-10 text-<?php echo e($color); ?> me-3" style="width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;">
                                        <i class="bi <?php echo e($icon); ?>"></i>
                                    </div>
                                    <div class="flex-grow-1">
                                        <div class="d-flex w-100 justify-content-between">
                                            <h6 class="mb-1 fw-semibold"><?php echo e($title); ?></h6>
                                            <small class="text-muted"><?php echo e($activity->created_at->diffForHumans()); ?></small>
                                        </div>
                                        <p class="mb-0 small text-muted"><?php echo e($description); ?></p>
                                    </div>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <div class="list-group-item py-4 text-center text-muted">
                                <i class="bi bi-inbox h4 d-block mb-2"></i>
                                No recent activity found.
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="card-footer bg-transparent text-center py-3 border-top">
                    <a href="#" class="text-decoration-none small fw-bold text-primary">View All Activity</a>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="card h-100">
                <div class="card-header">
                    <h6 class="fw-bold mb-0">Quick Actions</h6>
                </div>
                <div class="card-body">
                    <div class="d-grid gap-3">
                        <a href="<?php echo e(route('admin.sellers')); ?>" class="btn btn-light text-start p-3 d-flex align-items-center hover-shadow transition">
                            <i class="bi bi-check-circle text-primary fs-4 me-3"></i>
                            <div>
                                <div class="fw-bold text-dark">Verify Sellers</div>
                                <small class="text-muted">Review pending KYC</small>
                            </div>
                        </a>
                        <a href="<?php echo e(route('admin.products')); ?>" class="btn btn-light text-start p-3 d-flex align-items-center hover-shadow transition">
                            <i class="bi bi-check-square text-success fs-4 me-3"></i>
                            <div>
                                <div class="fw-bold text-dark">Approve Products</div>
                                <small class="text-muted">Check new listings</small>
                            </div>
                        </a>
                        <a href="<?php echo e(route('admin.banners.index')); ?>" class="btn btn-light text-start p-3 d-flex align-items-center hover-shadow transition">
                            <i class="bi bi-images text-info fs-4 me-3"></i>
                            <div>
                                <div class="fw-bold text-dark">Review Banners</div>
                                <small class="text-muted">Manage site visuals</small>
                            </div>
                        </a>
                        <button class="btn btn-light text-start p-3 d-flex align-items-center" disabled>
                            <i class="bi bi-gear text-secondary fs-4 me-3"></i>
                            <div>
                                <div class="fw-bold text-muted">System Settings</div>
                                <small class="text-muted">Coming soon</small>
                            </div>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/u281583269/domains/theminiport.com/public_html/resources/views/admin/dashboard.blade.php ENDPATH**/ ?>