

<?php $__env->startSection('title', 'Katalog Akses'); ?>
<?php $__env->startSection('subtitle', 'Master data hak akses sistem'); ?>

<?php $__env->startSection('breadcrumb'); ?>
    <li class="flex items-center">
        <i class="fas fa-chevron-right text-xs text-secondary-400 mx-2"></i>
        <span class="text-sm font-medium text-secondary-700">Katalog Akses</span>
    </li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('actions'); ?>
    <a href="<?php echo e(route('access-catalogs.create')); ?>" class="px-5 py-2.5 bg-primary-500 hover:bg-primary-600 text-white font-medium rounded-xl shadow-lg shadow-primary-500/25 transition-all flex items-center">
        <i class="fas fa-plus mr-2"></i>Tambah Katalog
    </a>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<!-- Stats -->
<div class="grid grid-cols-2 lg:grid-cols-4 gap-4 mb-4">
    <a href="<?php echo e(route('access-catalogs.index')); ?>" 
       class="glass-card rounded-xl p-4 text-center hover:border-primary-400 transition-all <?php echo e(!$selectedCategory ? 'ring-2 ring-primary-500 bg-primary-50/50 border-primary-500' : ''); ?>">
        <p class="text-2xl font-bold text-primary-600"><?php echo e($categoryCounts->sum()); ?></p>
        <p class="text-xs text-secondary-500">Semua</p>
    </a>
    <?php $__currentLoopData = ['physical' => 'Akses Fisik', 'digital' => 'Digital', 'network' => 'Network', 'application' => 'Aplikasi', 'cloud' => 'Cloud', 'file' => 'File', 'other' => 'Lainnya']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <a href="<?php echo e(route('access-catalogs.index', ['category' => $key])); ?>" 
           class="glass-card rounded-xl p-4 text-center hover:border-primary-400 transition-all <?php echo e($selectedCategory === $key ? 'ring-2 ring-primary-500 bg-primary-50/50 border-primary-500' : ''); ?>">
            <p class="text-2xl font-bold text-primary-600"><?php echo e($categoryCounts[$key] ?? 0); ?></p>
            <p class="text-xs text-secondary-500"><?php echo e($label); ?></p>
        </a>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>

<!-- Table -->
<div class="glass-card rounded-2xl overflow-hidden">
    <table class="w-full">
        <thead class="bg-secondary-50/50">
            <tr>
                <th class="px-6 py-4 text-left text-xs font-semibold text-secondary-500 uppercase">Kode</th>
                <th class="px-6 py-4 text-left text-xs font-semibold text-secondary-500 uppercase">Nama</th>
                <th class="px-6 py-4 text-left text-xs font-semibold text-secondary-500 uppercase">Kategori</th>
                <th class="px-6 py-4 text-left text-xs font-semibold text-secondary-500 uppercase">Criticality</th>
                <th class="px-6 py-4 text-left text-xs font-semibold text-secondary-500 uppercase">Owner</th>
                <th class="px-6 py-4 text-center text-xs font-semibold text-secondary-500 uppercase">Status</th>
                <th class="px-6 py-4 text-right text-xs font-semibold text-secondary-500 uppercase">Aksi</th>
            </tr>
        </thead>
        <tbody class="divide-y divide-secondary-100">
            <?php $__empty_1 = true; $__currentLoopData = $accessCatalogs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $catalog): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr class="group hover:bg-white/60 transition-colors">
                    <td class="px-6 py-4">
                        <span class="px-2 py-1 bg-primary-100 text-primary-700 rounded text-xs font-mono"><?php echo e($catalog->code); ?></span>
                    </td>
                    <td class="px-6 py-4">
                        <p class="text-sm font-medium text-secondary-800"><?php echo e($catalog->name); ?></p>
                        <p class="text-xs text-secondary-500 truncate max-w-xs"><?php echo e($catalog->description); ?></p>
                    </td>
                    <td class="px-6 py-4">
                        <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-<?php echo e($catalog->category === 'physical' ? 'blue' : ($catalog->category === 'digital' ? 'purple' : ($catalog->category === 'network' ? 'cyan' : ($catalog->category === 'application' ? 'amber' : ($catalog->category === 'cloud' ? 'sky' : 'emerald'))))); ?>-100 text-<?php echo e($catalog->category === 'physical' ? 'blue' : ($catalog->category === 'digital' ? 'purple' : ($catalog->category === 'network' ? 'cyan' : ($catalog->category === 'application' ? 'amber' : ($catalog->category === 'cloud' ? 'sky' : 'emerald'))))); ?>-800">
                            <?php echo e($catalog->getCategoryLabelAttribute()); ?>

                        </span>
                    </td>
                    <td class="px-6 py-4">
                        <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-<?php echo e($catalog->criticality_level === 'critical' ? 'rose' : ($catalog->criticality_level === 'high' ? 'orange' : ($catalog->criticality_level === 'medium' ? 'amber' : 'emerald'))); ?>-100 text-<?php echo e($catalog->criticality_level === 'critical' ? 'rose' : ($catalog->criticality_level === 'high' ? 'orange' : ($catalog->criticality_level === 'medium' ? 'amber' : 'emerald'))); ?>-800">
                            <?php echo e(ucfirst($catalog->criticality_level)); ?>

                        </span>
                    </td>
                    <td class="px-6 py-4 text-sm text-secondary-600"><?php echo e($catalog->ownerDepartment->name ?? '-'); ?></td>
                    <td class="px-6 py-4 text-center">
                        <span class="w-2.5 h-2.5 rounded-full <?php echo e($catalog->is_active ? 'bg-emerald-400' : 'bg-gray-400'); ?> inline-block"></span>
                    </td>
                    <td class="px-6 py-4 text-right">
                        <div class="flex items-center justify-end space-x-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200">
                            <a href="<?php echo e(route('access-catalogs.edit', $catalog)); ?>" class="p-2 text-amber-600 hover:bg-amber-50 rounded-lg transition-colors" title="Edit">
                                <i class="fas fa-edit"></i>
                            </a>
                            <form action="<?php echo e(route('access-catalogs.destroy', $catalog)); ?>" method="POST" class="inline" onsubmit="return confirm('Hapus katalog ini?')">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('DELETE'); ?>
                                <button type="submit" class="p-2 text-rose-600 hover:bg-rose-50 rounded-lg transition-colors" title="Hapus">
                                    <i class="fas fa-trash-alt"></i>
                                </button>
                            </form>
                        </div>
                    </td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="7" class="px-6 py-12 text-center text-secondary-400">
                        <i class="fas fa-inbox text-3xl mb-2"></i>
                        <p>Belum ada katalog akses</p>
                    </td>
                </tr>
            <?php endif; ?>
        </tbody>
    </table>
</div>

<div class="mt-6">
    <?php echo e($accessCatalogs->appends(request()->query())->links()); ?>

</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\codingan\access-control-management\resources\views/access-catalogs/index.blade.php ENDPATH**/ ?>