<?php $__env->startSection('content'); ?>
<?php if (isset($component)) { $__componentOriginalb08eb6e359b0cda244088e0d0db6136c = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalb08eb6e359b0cda244088e0d0db6136c = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard-hero','data' => ['title' => 'Super Manager Dashboard','subtitle' => 'Full System Control','icon' => 'fa-shield-alt']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard-hero'); ?>
<?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(['title' => 'Super Manager Dashboard','subtitle' => 'Full System Control','icon' => 'fa-shield-alt']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalb08eb6e359b0cda244088e0d0db6136c)): ?>
<?php $attributes = $__attributesOriginalb08eb6e359b0cda244088e0d0db6136c; ?>
<?php unset($__attributesOriginalb08eb6e359b0cda244088e0d0db6136c); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalb08eb6e359b0cda244088e0d0db6136c)): ?>
<?php $component = $__componentOriginalb08eb6e359b0cda244088e0d0db6136c; ?>
<?php unset($__componentOriginalb08eb6e359b0cda244088e0d0db6136c); ?>
<?php endif; ?>

<div class="p-6">
    <div class="space-y-8">

        <!-- Statistics Grid -->
        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
            <!-- Total Users -->
            <div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
                <div class="flex items-center justify-between mb-4">
                    <div class="w-12 h-12 bg-blue-500/20 rounded-lg flex items-center justify-center">
                        <i class="fas fa-users text-blue-500 text-xl"></i>
                    </div>
                    <span class="text-green-400 text-sm">
                        <i class="fas fa-arrow-up mr-1"></i>+12%
                    </span>
                </div>
                <h3 class="text-gray-400 text-sm mb-1">Total Users</h3>
                <p class="text-2xl font-bold text-white"><?php echo e($stats['total_users'] ?? 0); ?></p>
            </div>

            <!-- Active Users -->
            <div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
                <div class="flex items-center justify-between mb-4">
                    <div class="w-12 h-12 bg-green-500/20 rounded-lg flex items-center justify-center">
                        <i class="fas fa-user-check text-green-500 text-xl"></i>
                    </div>
                    <span class="text-green-400 text-sm">
                        <i class="fas fa-arrow-up mr-1"></i>+8%
                    </span>
                </div>
                <h3 class="text-gray-400 text-sm mb-1">Active Users</h3>
                <p class="text-2xl font-bold text-white"><?php echo e($stats['active_users'] ?? 0); ?></p>
            </div>

            <!-- Inactive Users -->
            <div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
                <div class="flex items-center justify-between mb-4">
                    <div class="w-12 h-12 bg-red-500/20 rounded-lg flex items-center justify-center">
                        <i class="fas fa-user-times text-red-500 text-xl"></i>
                    </div>
                    <span class="text-red-400 text-sm">
                        <i class="fas fa-arrow-down mr-1"></i>-3%
                    </span>
                </div>
                <h3 class="text-gray-400 text-sm mb-1">Inactive Users</h3>
                <p class="text-2xl font-bold text-white"><?php echo e($stats['inactive_users'] ?? 0); ?></p>
            </div>

            <!-- OTP Status -->
            <div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
                <div class="flex items-center justify-between mb-4">
                    <div class="w-12 h-12 bg-purple-500/20 rounded-lg flex items-center justify-center">
                        <i class="fas fa-shield-alt text-purple-500 text-xl"></i>
                    </div>
                    <?php if($stats['otp_enabled'] ?? false): ?>
                        <span class="px-2 py-1 bg-green-500/20 text-green-400 text-xs rounded-full">Enabled</span>
                    <?php else: ?>
                        <span class="px-2 py-1 bg-red-500/20 text-red-400 text-xs rounded-full">Disabled</span>
                    <?php endif; ?>
                </div>
                <h3 class="text-gray-400 text-sm mb-1">OTP Verification</h3>
                <p class="text-2xl font-bold text-white"><?php echo e(($stats['otp_enabled'] ?? false) ? 'Active' : 'Inactive'); ?></p>
            </div>
        </div>

        <!-- Users by Role -->
        <div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
            <div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
                <h3 class="text-lg font-semibold text-white mb-4">
                    <i class="fas fa-chart-pie mr-2 text-blue-500"></i>Users by Role
                </h3>
                <div class="space-y-3">
                    <?php
                        $colors = ['bg-blue-500', 'bg-green-500', 'bg-purple-500', 'bg-amber-500', 'bg-pink-500', 'bg-cyan-500', 'bg-red-500', 'bg-indigo-500', 'bg-teal-500', 'bg-orange-500'];
                        $totalUsers = $stats['total_users'] ?? 1;
                    ?>
                    <?php $__currentLoopData = $stats['users_by_role'] ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role => $count): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php
                            $percentage = round(($count / $totalUsers) * 100);
                            $color = $colors[$loop->index % count($colors)];
                        ?>
                        <div>
                            <div class="flex justify-between text-sm mb-1">
                                <span class="text-gray-400"><?php echo e($role); ?></span>
                                <span class="text-white"><?php echo e($count); ?></span>
                            </div>
                            <div class="w-full bg-gray-700 rounded-full h-2">
                                <div class="<?php echo e($color); ?> h-2 rounded-full" style="width: <?php echo e($percentage); ?>%"></div>
                            </div>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>

            <!-- Recent Logins -->
            <div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
                <h3 class="text-lg font-semibold text-white mb-4">
                    <i class="fas fa-sign-in-alt mr-2 text-green-500"></i>Recent Activity
                </h3>
                <div class="space-y-4">
                    <div class="flex items-center justify-between p-3 bg-gray-700/50 rounded-lg">
                        <div class="flex items-center">
                            <div class="w-10 h-10 bg-green-500/20 rounded-full flex items-center justify-center mr-3">
                                <i class="fas fa-sign-in-alt text-green-500"></i>
                            </div>
                            <div>
                                <p class="text-white text-sm font-medium">Recent Logins (7 days)</p>
                                <p class="text-gray-500 text-xs">Active user sessions</p>
                            </div>
                        </div>
                        <span class="text-white font-semibold"><?php echo e($stats['recent_logins'] ?? 0); ?></span>
                    </div>

                    <div class="flex items-center justify-between p-3 bg-gray-700/50 rounded-lg">
                        <div class="flex items-center">
                            <div class="w-10 h-10 bg-blue-500/20 rounded-full flex items-center justify-center mr-3">
                                <i class="fas fa-user-plus text-blue-500"></i>
                            </div>
                            <div>
                                <p class="text-white text-sm font-medium">New Users (7 days)</p>
                                <p class="text-gray-500 text-xs">New registrations</p>
                            </div>
                        </div>
                        <span class="text-white font-semibold">--</span>
                    </div>

                    <div class="flex items-center justify-between p-3 bg-gray-700/50 rounded-lg">
                        <div class="flex items-center">
                            <div class="w-10 h-10 bg-purple-500/20 rounded-full flex items-center justify-center mr-3">
                                <i class="fas fa-shield-alt text-purple-500"></i>
                            </div>
                            <div>
                                <p class="text-white text-sm font-medium">2FA Enabled</p>
                                <p class="text-gray-500 text-xs">Users with 2FA</p>
                            </div>
                        </div>
                        <span class="text-white font-semibold">--</span>
                    </div>
                </div>
            </div>
        </div>

        <!-- Quick Actions -->
        <div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
            <h3 class="text-lg font-semibold text-white mb-4">
                <i class="fas fa-bolt mr-2 text-amber-500"></i>Quick Actions
            </h3>
            <div class="grid grid-cols-2 md:grid-cols-4 gap-4">
                <a href="<?php echo e(route('users.index')); ?>" class="p-4 bg-gray-700/50 hover:bg-gray-700 rounded-lg text-center transition group">
                    <i class="fas fa-users text-2xl text-blue-500 mb-2 group-hover:scale-110 transition-transform"></i>
                    <p class="text-gray-300 text-sm">Manage Users</p>
                </a>
                <a href="<?php echo e(route('roles.index')); ?>" class="p-4 bg-gray-700/50 hover:bg-gray-700 rounded-lg text-center transition group">
                    <i class="fas fa-user-tag text-2xl text-green-500 mb-2 group-hover:scale-110 transition-transform"></i>
                    <p class="text-gray-300 text-sm">Role Assignment</p>
                </a>
                <a href="<?php echo e(route('otp.settings')); ?>" class="p-4 bg-gray-700/50 hover:bg-gray-700 rounded-lg text-center transition group">
                    <i class="fas fa-shield-alt text-2xl text-purple-500 mb-2 group-hover:scale-110 transition-transform"></i>
                    <p class="text-gray-300 text-sm">OTP Settings</p>
                </a>
                <a href="#" class="p-4 bg-gray-700/50 hover:bg-gray-700 rounded-lg text-center transition group">
                    <i class="fas fa-cog text-2xl text-amber-500 mb-2 group-hover:scale-110 transition-transform"></i>
                    <p class="text-gray-300 text-sm">System Settings</p>
                </a>
            </div>
        </div>

        
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('view self-paced courses')): ?>
        <div class="bg-gradient-to-r from-indigo-700 to-purple-800 rounded-xl p-6 border border-indigo-600">
            <div class="flex items-center justify-between flex-wrap gap-4">
                <div class="flex items-center gap-4">
                    <div class="w-14 h-14 bg-white/20 rounded-xl flex items-center justify-center flex-shrink-0">
                        <i class="fas fa-graduation-cap text-white text-2xl"></i>
                    </div>
                    <div>
                        <h3 class="text-lg font-bold text-white">Self-Paced Learning Portal</h3>
                        <p class="text-indigo-200 text-sm">Manage courses, exams, enrollments and certificates</p>
                    </div>
                </div>
                <a href="<?php echo e(route('self-paced.dashboard.index')); ?>"
                   class="flex items-center gap-2 px-5 py-2.5 bg-white text-indigo-700 font-semibold rounded-lg hover:bg-indigo-50 transition text-sm flex-shrink-0">
                    <i class="fas fa-arrow-right"></i>Open Portal
                </a>
            </div>
        </div>
        <?php endif; ?>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/www/sshia.org/sshia/resources/views/dashboard/super-manager.blade.php ENDPATH**/ ?>