<?php if (isset($component)) { $__componentOriginal91fdd17964e43374ae18c674f95cdaa3 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal91fdd17964e43374ae18c674f95cdaa3 = $attributes; } ?>
<?php $component = App\View\Components\AdminLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('admin-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\AdminLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <div class="p-4 md:p-6">
        <?php if (isset($component)) { $__componentOriginal6912374916afbfe53350098c2f0b0678 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal6912374916afbfe53350098c2f0b0678 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.session-status','data' => ['class' => 'mb-4','status' => session('status')]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('session-status'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'mb-4','status' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(session('status'))]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal6912374916afbfe53350098c2f0b0678)): ?>
<?php $attributes = $__attributesOriginal6912374916afbfe53350098c2f0b0678; ?>
<?php unset($__attributesOriginal6912374916afbfe53350098c2f0b0678); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal6912374916afbfe53350098c2f0b0678)): ?>
<?php $component = $__componentOriginal6912374916afbfe53350098c2f0b0678; ?>
<?php unset($__componentOriginal6912374916afbfe53350098c2f0b0678); ?>
<?php endif; ?>

        <!-- Stat Cards -->
        <div class="grid gap-4 mb-8 md:grid-cols-2 lg:grid-cols-4">
            <!-- User Stats -->
            <div class="bg-white rounded-lg shadow-md p-4">
                <div class="flex items-center justify-between mb-2">
                    <h3 class="text-sm font-medium text-gray-500">Total Users</h3>
                    <i class="ri-user-line text-purple-500 text-xl"></i>
                </div>
                <div class="text-2xl font-bold"><?php echo e($userStats['total']); ?></div>
                <div class="mt-2 flex justify-between text-xs">
                    <span class="text-gray-500">KYC Verified: <?php echo e($userStats['kyc_verified']); ?></span>
                    <span class="text-green-500">+<?php echo e($userStats['new_this_month']); ?> this month</span>
                </div>
            </div>

            <!-- Transaction Stats -->
            <div class="bg-white rounded-lg shadow-md p-4">
                <div class="flex items-center justify-between mb-2">
                    <h3 class="text-sm font-medium text-gray-500">Total Transactions</h3>
                    <i class="ri-exchange-dollar-line text-blue-500 text-xl"></i>
                </div>
                <div class="text-2xl font-bold"><?php echo e($transactionStats['total_count']); ?></div>
                <div class="mt-2 flex justify-between text-xs">
                    <span class="text-gray-500">Volume: $<?php echo e(number_format($transactionStats['total_volume'], 2)); ?></span>
                    <span class="text-green-500"><?php echo e($transactionStats['pending_count']); ?> pending</span>
                </div>
            </div>

            <!-- Card Stats -->
            <div class="bg-white rounded-lg shadow-md p-4">
                <div class="flex items-center justify-between mb-2">
                    <h3 class="text-sm font-medium text-gray-500">Active Cards</h3>
                    <i class="ri-bank-card-line text-green-500 text-xl"></i>
                </div>
                <div class="text-2xl font-bold"><?php echo e($cardStats['active_cards']); ?></div>
                <div class="mt-2 flex justify-between text-xs">
                    <span class="text-gray-500">Total Balance: $<?php echo e(number_format($cardStats['total_balance'], 2)); ?></span>
                    <span class="text-yellow-500"><?php echo e($cardStats['frozen_cards']); ?> frozen</span>
                </div>
            </div>

            <!-- Crypto Stats -->
            <div class="bg-white rounded-lg shadow-md p-4">
                <div class="flex items-center justify-between mb-2">
                    <h3 class="text-sm font-medium text-gray-500">Total Crypto Value</h3>
                    <i class="ri-coin-line text-yellow-500 text-xl"></i>
                </div>
                <div class="text-2xl font-bold">$<?php echo e(number_format($cryptoStats['total_value_usd'], 2)); ?></div>
                <div class="mt-2 flex justify-between text-xs">
                    <span class="text-gray-500">Active Wallets: <?php echo e($cryptoStats['active_wallets']); ?></span>
                    <span class="text-blue-500"><?php echo e($cryptoStats['currencies_count']); ?> currencies</span>
                </div>
            </div>
        </div>

       <!-- Recent Transactions -->
<div class="bg-white rounded-lg shadow-md overflow-hidden mb-8">
    <div class="p-4 border-b flex justify-between items-center">
        <h2 class="text-lg font-semibold">Recent Transactions</h2>
        <a href="<?php echo e(route('admin.transactions')); ?>" class="text-sm text-purple-600 hover:text-purple-800">View All</a>
    </div>
    <div class="overflow-x-auto">
        <table class="w-full">
            <thead class="bg-gray-50">
                <tr>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">User</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Crypto</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
                </tr>
            </thead>
            <tbody class="bg-white divide-y divide-gray-200">
                <?php $__empty_1 = true; $__currentLoopData = $recentTransactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $transaction): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td class="px-6 py-4 whitespace-nowrap">
                            <div class="flex items-center">
                                <div class="h-8 w-8 rounded-full bg-purple-100 flex items-center justify-center">
                                    <span class="text-sm font-medium text-purple-600">
                                        <?php echo e(strtoupper(substr($transaction->user->name, 0, 1))); ?>

                                    </span>
                                </div>
                                <div class="ml-3">
                                    <div class="text-sm font-medium"><?php echo e($transaction->user->name); ?></div>
                                    <div class="text-xs text-gray-500"><?php echo e($transaction->user->email); ?></div>
                                </div>
                            </div>
                        </td>
                        <td class="px-6 py-4 whitespace-nowrap">
                            <span class="text-sm capitalize"><?php echo e($transaction->type); ?></span>
                        </td>
                        <td class="px-6 py-4 whitespace-nowrap text-sm">
                            <?php echo e(strtoupper($transaction->which_crypto)); ?>

                        </td>
                        <td class="px-6 py-4 whitespace-nowrap text-sm">
                            <?php if($transaction->type === 'withdrawal'): ?>
                                $<?php echo e(number_format($transaction->amount_out * $transaction->rate, 2)); ?>

                            <?php else: ?>
                                $<?php echo e(number_format($transaction->amount_in * $transaction->rate, 2)); ?>

                            <?php endif; ?>
                        </td>
                        <td class="px-6 py-4 whitespace-nowrap">
                            <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full
                                <?php if($transaction->status === 'completed'): ?> bg-green-100 text-green-800
                                <?php elseif($transaction->status === 'pending'): ?> bg-yellow-100 text-yellow-800
                                <?php elseif($transaction->status === 'failed'): ?> bg-red-100 text-red-800
                                <?php else: ?> bg-blue-100 text-blue-800 <?php endif; ?>">
                                <?php echo e(ucfirst($transaction->status)); ?>

                            </span>
                        </td>
                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
                            <?php echo e($transaction->created_at->diffForHumans()); ?>

                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td colspan="6" class="px-6 py-4 text-center text-gray-500">
                            No transactions found
                        </td>
                    </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
</div>

        <!-- KYC and Card Stats Grid -->
        <div class="grid gap-4 md:grid-cols-2">
            <!-- Pending KYC Submissions -->
            <div class="bg-white rounded-lg shadow-md overflow-hidden">
                <div class="p-4 border-b flex justify-between items-center">
                    <h2 class="text-lg font-semibold">Pending KYC Verifications</h2>
                    <a href="<?php echo e(route('admin.kyc')); ?>?status=pending" class="text-sm text-purple-600 hover:text-purple-800">View All</a>
                </div>
                <div class="p-4">
                    <?php $__empty_1 = true; $__currentLoopData = $pendingKyc; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <div class="flex items-center justify-between py-2">
                            <div class="flex items-center">
                                <div class="h-8 w-8 rounded-full bg-purple-100 flex items-center justify-center">
                                    <span class="text-sm font-medium text-purple-600">
                                        <?php echo e(strtoupper(substr($user->name, 0, 1))); ?>

                                    </span>
                                </div>
                                <div class="ml-3">
                                    <div class="text-sm font-medium"><?php echo e($user->name); ?></div>
                                    <div class="text-xs text-gray-500">Submitted <?php echo e($user->updated_at->diffForHumans()); ?></div>
                                </div>
                            </div>
                            <a href="<?php echo e(route('admin.kyc.show', $user)); ?>" 
                               class="text-sm text-purple-600 hover:text-purple-800">Review</a>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <p class="text-gray-500 text-center py-4">No pending KYC verifications</p>
                    <?php endif; ?>
                </div>
            </div>

            <!-- Recent Card Activities -->
            <div class="bg-white rounded-lg shadow-md overflow-hidden">
                <div class="p-4 border-b flex justify-between items-center">
                    <h2 class="text-lg font-semibold">Recent Card Activities</h2>
                </div>
                <div class="p-4">
                    <?php $__empty_1 = true; $__currentLoopData = $recentCardActivities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $activity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <div class="flex items-center justify-between py-2">
                            <div class="flex items-center space-x-3">
                                <i class="ri-bank-card-line text-gray-400"></i>
                                <div>
                                    <div class="text-sm"><?php echo e($activity->description); ?></div>
                                    <div class="text-xs text-gray-500">
                                        <?php echo e($activity->created_at->diffForHumans()); ?>

                                    </div>
                                </div>
                            </div>
                            <span class="text-sm <?php echo e($activity->amount > 0 ? 'text-green-600' : 'text-red-600'); ?>">
                                $<?php echo e(number_format(abs($activity->amount), 2)); ?>

                            </span>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <p class="text-gray-500 text-center py-4">No recent card activities</p>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal91fdd17964e43374ae18c674f95cdaa3)): ?>
<?php $attributes = $__attributesOriginal91fdd17964e43374ae18c674f95cdaa3; ?>
<?php unset($__attributesOriginal91fdd17964e43374ae18c674f95cdaa3); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal91fdd17964e43374ae18c674f95cdaa3)): ?>
<?php $component = $__componentOriginal91fdd17964e43374ae18c674f95cdaa3; ?>
<?php unset($__componentOriginal91fdd17964e43374ae18c674f95cdaa3); ?>
<?php endif; ?><?php /**PATH /home/blockcino/public_html/resources/views/admin/dashboard.blade.php ENDPATH**/ ?>