<?php $__env->startSection('title', 'Roles & Permissions'); ?>
<?php $__env->startSection('kicker', 'Assign module access per role'); ?>

<?php $__env->startSection('content'); ?>
    <div class="module-tabs">
        <a href="<?php echo e(route('users.index')); ?>"><i data-lucide="users"></i><span>Users</span></a>
        <a href="<?php echo e(route('users.permissions')); ?>" class="active"><i data-lucide="shield-check"></i><span>Roles & Permissions</span></a>
        <a href="<?php echo e(route('settings.user-positions')); ?>"><i data-lucide="briefcase-business"></i><span>User Positions</span></a>
        <a href="<?php echo e(route('reports.user-activity')); ?>"><i data-lucide="activity"></i><span>Activity</span></a>
    </div>

    <div class="row g-4">
        <?php $__currentLoopData = $roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="col-xl-6">
                <div class="content-card h-100">
                    <div class="d-flex justify-content-between align-items-center mb-3">
                        <div>
                            <div class="section-title"><?php echo e($role->name); ?></div>
                            <div class="text-muted small"><?php echo e($role->description); ?></div>
                        </div>
                        <span class="badge badge-soft"><?php echo e($role->permissions->count()); ?> permissions</span>
                    </div>
                    <form method="POST" action="<?php echo e(route('users.permissions.sync', $role)); ?>">
                        <?php echo csrf_field(); ?>
                        <div class="row g-2">
                            <?php $__currentLoopData = $permissions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $permission): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="col-md-6">
                                    <label class="form-check">
                                        <input class="form-check-input" type="checkbox" name="permissions[]" value="<?php echo e($permission->id); ?>" <?php if($role->permissions->contains($permission)): echo 'checked'; endif; ?>>
                                        <span class="form-check-label"><?php echo e($permission->label); ?></span>
                                    </label>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                        <button class="btn btn-primary mt-3"><i data-lucide="save"></i><span>Save Role</span></button>
                    </form>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/anglican/resources/views/system-users/permissions.blade.php ENDPATH**/ ?>