<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('header', null, []); ?> 
        <h2 class="font-semibold text-xl text-gray-800 leading-tight">
            <?php echo e(__('Admin Dashboard')); ?>

        </h2>
     <?php $__env->endSlot(); ?>

    <div class="py-12">
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
            <!-- Admin Alert -->
            <div class="bg-gray-50 border border-gray-200 text-gray-700 px-4 py-3 rounded mb-6">
                <strong>Admin Mode:</strong> You have administrative privileges.
            </div>

            <!-- Stats Grid -->
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="p-6">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-sm font-medium text-gray-600">Total Users</p>
                                <p class="text-3xl font-bold text-gray-900"><?php echo e($stats['total_users']); ?></p>
                            </div>
                            <div class="p-3 rounded-full bg-gray-100">
                                <span class="text-2xl">👥</span>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="p-6">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-sm font-medium text-gray-600">Total Items</p>
                                <p class="text-3xl font-bold text-gray-900"><?php echo e($stats['total_items']); ?></p>
                                <p class="text-xs text-gray-500"><?php echo e($stats['active_items']); ?> active</p>
                            </div>
                            <div class="p-3 rounded-full bg-gray-100">
                                <span class="text-2xl">🎵</span>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="p-6">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-sm font-medium text-gray-600">Pending Sales</p>
                                <p class="text-3xl font-bold text-gray-900"><?php echo e($stats['pending_sales']); ?></p>
                            </div>
                            <div class="p-3 rounded-full bg-gray-100">
                                <span class="text-2xl">⏳</span>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="p-6">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-sm font-medium text-gray-600">Completed Sales</p>
                                <p class="text-3xl font-bold text-gray-900"><?php echo e($stats['completed_transactions']); ?></p>
                            </div>
                            <div class="p-3 rounded-full bg-gray-100">
                                <span class="text-2xl">✅</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Quick Actions -->
            <div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8">
                <a href="<?php echo e(route('admin.items.index')); ?>" class="bg-white hover:bg-gray-50 border border-gray-200 p-6 rounded-lg transition-colors">
                    <div class="text-3xl mb-2">🎸</div>
                    <h3 class="font-semibold mb-1 text-gray-900">Manage Items</h3>
                    <p class="text-sm text-gray-600">View, edit, ban, or delete items</p>
                </a>

                <a href="<?php echo e(route('admin.users.index')); ?>" class="bg-white hover:bg-gray-50 border border-gray-200 p-6 rounded-lg transition-colors">
                    <div class="text-3xl mb-2">👤</div>
                    <h3 class="font-semibold mb-1 text-gray-900">Manage Users</h3>
                    <p class="text-sm text-gray-600">View, ban, or promote users</p>
                </a>

                <a href="<?php echo e(route('admin.reports.index')); ?>" class="bg-white hover:bg-gray-50 border border-gray-200 p-6 rounded-lg transition-colors">
                    <div class="text-3xl mb-2">⚠️</div>
                    <h3 class="font-semibold mb-1 text-gray-900">Report Queue</h3>
                    <p class="text-sm text-gray-600">Review user and item reports</p>
                </a>

                <a href="<?php echo e(route('admin.analytics.index')); ?>" class="bg-white hover:bg-gray-50 border border-gray-200 p-6 rounded-lg transition-colors">
                    <div class="text-3xl mb-2">📊</div>
                    <h3 class="font-semibold mb-1 text-gray-900">Analytics</h3>
                    <p class="text-sm text-gray-600">User behavior and trends</p>
                </a>

                <a href="<?php echo e(route('admin.audit-log.index')); ?>" class="bg-white hover:bg-gray-50 border border-gray-200 p-6 rounded-lg transition-colors">
                    <div class="text-3xl mb-2">🔍</div>
                    <h3 class="font-semibold mb-1 text-gray-900">Audit Log</h3>
                    <p class="text-sm text-gray-600">Admin action history</p>
                </a>

                <a href="<?php echo e(route('admin.announcements.index')); ?>" class="bg-white hover:bg-gray-50 border border-gray-200 p-6 rounded-lg transition-colors">
                    <div class="text-3xl mb-2">📣</div>
                    <h3 class="font-semibold mb-1 text-gray-900">Announcements</h3>
                    <p class="text-sm text-gray-600">Manage pop-ups and banners</p>
                </a>

                <a href="<?php echo e(route('admin.trust-services.index')); ?>" class="bg-white hover:bg-gray-50 border border-gray-200 p-6 rounded-lg transition-colors">
                    <div class="text-3xl mb-2">🔗</div>
                    <h3 class="font-semibold mb-1 text-gray-900">Trust Services</h3>
                    <p class="text-sm text-gray-600">Manage verification platforms</p>
                </a>
            </div>

            <!-- Recent Activity -->
            <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
                <!-- Recent Users -->
                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="p-6">
                        <div class="flex justify-between items-center mb-4">
                            <h2 class="text-lg font-semibold text-gray-900">Recent Users</h2>
                            <a href="<?php echo e(route('admin.users.index')); ?>" class="text-gray-600 hover:opacity-60 transition-opacity text-sm">View All</a>
                        </div>
                        <div class="space-y-3">
                            <?php $__empty_1 = true; $__currentLoopData = $stats['recent_users']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                <div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
                                    <div>
                                        <p class="font-medium"><?php echo e($user->name); ?></p>
                                        <p class="text-sm text-gray-600"><?php echo e($user->email); ?></p>
                                        <p class="text-xs text-gray-500"><?php echo e($user->created_at->diffForHumans()); ?></p>
                                    </div>
                                    <div class="flex space-x-1">
                                        <?php if($user->is_admin): ?>
                                            <span class="bg-gray-100 text-gray-700 text-xs px-2 py-1 rounded">Admin</span>
                                        <?php endif; ?>
                                        <?php if(!$user->is_active): ?>
                                            <span class="bg-red-50 text-red-600 text-xs px-2 py-1 rounded">Banned</span>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                <p class="text-gray-500 text-sm">No recent users</p>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>

                <!-- Recent Items -->
                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="p-6">
                        <div class="flex justify-between items-center mb-4">
                            <h2 class="text-lg font-semibold text-gray-900">Recent Items</h2>
                            <a href="<?php echo e(route('admin.items.index')); ?>" class="text-gray-600 hover:opacity-60 transition-opacity text-sm">View All</a>
                        </div>
                        <div class="space-y-3">
                            <?php $__empty_1 = true; $__currentLoopData = $stats['recent_items']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                <div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
                                    <div class="flex-1">
                                        <p class="font-medium text-sm"><?php echo e(Str::limit($item->title, 40)); ?></p>
                                        <p class="text-xs text-gray-600"><?php echo e($item->user->name); ?> • <?php echo e($item->category ? $item->category->name : 'No Category'); ?></p>
                                        <p class="text-xs text-gray-500"><?php echo e($item->created_at->diffForHumans()); ?></p>
                                    </div>
                                    <div class="flex flex-col items-end space-y-1">
                                        <?php if($item->price): ?>
                                            <span class="text-sm font-medium">$<?php echo e(number_format($item->price, 2)); ?></span>
                                        <?php endif; ?>
                                        <span class="bg-<?php echo e($item->status === 'active' ? 'green' : ($item->status === 'removed' ? 'red' : 'gray')); ?>-100 text-<?php echo e($item->status === 'active' ? 'green' : ($item->status === 'removed' ? 'red' : 'gray')); ?>-800 text-xs px-2 py-1 rounded">
                                            <?php echo e(ucfirst($item->status)); ?>

                                        </span>
                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                <p class="text-gray-500 text-sm">No recent items</p>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Recent Audit Activity -->
            <div class="mt-8 bg-white overflow-hidden shadow-sm sm:rounded-lg">
                <div class="p-6">
                    <div class="flex justify-between items-center mb-4">
                        <h2 class="text-lg font-semibold text-gray-900">Recent Admin Activity</h2>
                        <a href="<?php echo e(route('admin.audit-log.index')); ?>" class="text-gray-600 hover:opacity-60 transition-opacity text-sm">View All</a>
                    </div>
                    <div class="space-y-2">
                        <?php $__empty_1 = true; $__currentLoopData = \App\Models\AdminAuditLog::with('admin')->latest()->take(8)->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $log): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <?php
                                $actionColors = [
                                    'ban_user' => 'bg-red-50 text-red-600',
                                    'ban_item' => 'bg-red-50 text-red-600',
                                    'remove_item' => 'bg-red-50 text-red-600',
                                    'delete_item' => 'bg-red-50 text-red-600',
                                    'grant_admin' => 'bg-gray-100 text-gray-600',
                                    'revoke_admin' => 'bg-gray-100 text-gray-600',
                                    'impersonate_start' => 'bg-gray-100 text-gray-600',
                                    'impersonate_stop' => 'bg-gray-100 text-gray-600',
                                    'unban_user' => 'bg-gray-100 text-gray-600',
                                    'approve_item' => 'bg-gray-100 text-gray-600',
                                    'update_user' => 'bg-gray-100 text-gray-600',
                                    'update_item' => 'bg-gray-100 text-gray-600',
                                ];
                                $color = $actionColors[$log->action] ?? 'bg-gray-100 text-gray-600';
                            ?>
                            <div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
                                <div class="flex items-center gap-3">
                                    <span class="inline-flex px-2 py-1 rounded text-xs font-medium <?php echo e($color); ?>">
                                        <?php echo e(str_replace('_', ' ', $log->action)); ?>

                                    </span>
                                    <span class="text-sm text-gray-700">
                                        <?php echo e($log->admin?->name ?? 'Unknown'); ?>

                                        <?php if($log->meta): ?>
                                            &mdash;
                                            <?php echo e($log->meta['user_name'] ?? $log->meta['target_name'] ?? $log->meta['item_title'] ?? ($log->target_type . ' #' . $log->target_id)); ?>

                                        <?php endif; ?>
                                    </span>
                                </div>
                                <span class="text-xs text-gray-400 whitespace-nowrap ml-4"><?php echo e($log->created_at->diffForHumans()); ?></span>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <p class="text-gray-400 text-sm">No admin actions recorded yet.</p>
                        <?php endif; ?>
                    </div>
                </div>
            </div>

            <!-- Quick Links -->
            <div class="mt-8 bg-white overflow-hidden shadow-sm sm:rounded-lg">
                <div class="p-6">
                    <h2 class="text-lg font-semibold text-gray-900 mb-4">Quick Links</h2>
                    <div class="grid grid-cols-1 md:grid-cols-5 gap-4">
                        <a href="<?php echo e(route('admin.reports.index')); ?>" class="flex items-center p-3 text-gray-700 hover:bg-gray-50 rounded-lg transition-colors">
                            <span class="text-2xl mr-3">📋</span>
                            <span>Reports Queue</span>
                        </a>
                        <a href="<?php echo e(route('admin.settings.index')); ?>" class="flex items-center p-3 text-gray-700 hover:bg-gray-50 rounded-lg transition-colors">
                            <span class="text-2xl mr-3">⚙️</span>
                            <span>Settings</span>
                        </a>
                        <a href="<?php echo e(route('admin.users.index', ['status' => 'inactive'])); ?>" class="flex items-center p-3 text-gray-700 hover:bg-gray-50 rounded-lg transition-colors">
                            <span class="text-2xl mr-3">🚫</span>
                            <span>Banned Users</span>
                        </a>
                        <a href="<?php echo e(route('admin.items.index', ['status' => 'sale_pending'])); ?>" class="flex items-center p-3 text-gray-700 hover:bg-gray-50 rounded-lg transition-colors">
                            <span class="text-2xl mr-3">💰</span>
                            <span>Pending Sales</span>
                        </a>
                        <a href="<?php echo e(route('items.index')); ?>" class="flex items-center p-3 text-gray-700 hover:bg-gray-50 rounded-lg transition-colors">
                            <span class="text-2xl mr-3">🏠</span>
                            <span>View Main Site</span>
                        </a>
                    </div>
                </div>

                <?php if(config('app.multi_site')): ?>
                <!-- Site Management -->
                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="p-6">
                        <h2 class="text-lg font-semibold text-gray-900 mb-4">Site Management</h2>
                        <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                            <a href="<?php echo e(route('sites.music.index')); ?>" class="flex items-center p-4 border border-gray-200 bg-white hover:bg-gray-50 rounded-lg transition-colors group">
                                <div class="flex-1">
                                    <div class="flex items-center mb-2">
                                        <span class="text-2xl mr-3">🎵</span>
                                        <h3 class="font-medium text-gray-900">Music Marketplace</h3>
                                    </div>
                                    <p class="text-sm text-gray-600"><?php echo e(\App\Models\Item::whereHas('category', function($q) { $q->where('site_group', 'music'); })->count()); ?> items</p>
                                </div>
                                <svg class="w-5 h-5 text-gray-400 group-hover:text-gray-600" fill="currentColor" viewBox="0 0 20 20">
                                    <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path>
                                </svg>
                            </a>

                            <a href="<?php echo e(route('sites.art.index')); ?>" class="flex items-center p-4 border border-gray-200 bg-white hover:bg-gray-50 rounded-lg transition-colors group">
                                <div class="flex-1">
                                    <div class="flex items-center mb-2">
                                        <span class="text-2xl mr-3">🎨</span>
                                        <h3 class="font-medium text-gray-900">Art Marketplace</h3>
                                    </div>
                                    <p class="text-sm text-gray-600"><?php echo e(\App\Models\Item::whereHas('category', function($q) { $q->where('site_group', 'art'); })->count()); ?> items</p>
                                </div>
                                <svg class="w-5 h-5 text-gray-400 group-hover:text-gray-600" fill="currentColor" viewBox="0 0 20 20">
                                    <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path>
                                </svg>
                            </a>

                            <a href="<?php echo e(route('sites.tools.index')); ?>" class="flex items-center p-4 border border-gray-200 bg-white hover:bg-gray-50 rounded-lg transition-colors group">
                                <div class="flex-1">
                                    <div class="flex items-center mb-2">
                                        <span class="text-2xl mr-3">🔧</span>
                                        <h3 class="font-medium text-gray-900">Tools Marketplace</h3>
                                    </div>
                                    <p class="text-sm text-gray-600"><?php echo e(\App\Models\Item::whereHas('category', function($q) { $q->where('site_group', 'tools'); })->count()); ?> items</p>
                                </div>
                                <svg class="w-5 h-5 text-gray-400 group-hover:text-gray-600" fill="currentColor" viewBox="0 0 20 20">
                                    <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path>
                                </svg>
                            </a>
                        </div>
                    </div>
                </div>
                <?php endif; ?>
            </div>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?><?php /**PATH /var/www/html/resources/views/admin/dashboard.blade.php ENDPATH**/ ?>