<nav x-data="{ open: false, sidebarOpen: false, dropdownManajemen: false, dropdownOperasional: false, dropdownDokter: false }"
     @keydown.escape="sidebarOpen = false; dropdownManajemen = false; dropdownOperasional = false; dropdownDokter = false"
     class="bg-white dark:bg-slate-800 border-b border-gray-200 dark:border-slate-700 shadow-sm transition-colors duration-200 relative z-30">

    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        <div class="flex justify-between h-16">

            
            <div class="flex items-center gap-3">
                
                <button @click="sidebarOpen = !sidebarOpen"
                        class="sm:hidden inline-flex items-center justify-center p-2 rounded-lg text-slate-600 dark:text-slate-200
                               hover:bg-teal-50 dark:hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-teal-500 transition">
                    <svg class="h-5 w-5" stroke="currentColor" fill="none" viewBox="0 0 24 24">
                        <path :class="{'hidden': sidebarOpen, 'inline-flex': !sidebarOpen}" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/>
                        <path :class="{'hidden': !sidebarOpen, 'inline-flex': sidebarOpen}" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
                    </svg>
                </button>

                
                <a href="<?php echo e(route('dashboard')); ?>" class="flex items-center gap-2 group shrink-0">
                    <div class="flex items-center justify-center w-14 h-14 group-hover:scale-110 transition-transform -ml-2">
                        <img src="<?php echo e(asset('storage/logo.png')); ?>" alt="Logo" class="w-full h-full object-contain scale-125 drop-shadow-sm">
                    </div>
                    <div class="hidden sm:block leading-tight">
                        <span class="font-bold text-base text-teal-600 dark:text-teal-300 block">KKD</span>
                        <span class="text-xs text-slate-500 dark:text-slate-400 block">Klinik Kesehatan Digital</span>
                    </div>
                </a>
            </div>

            
            <?php $role = Auth::user()->role ?? 'guest'; ?>

            <div class="hidden sm:flex sm:items-center sm:gap-0.5">

                
                <?php if($role === 'petugas'): ?>
                    <?php if (isset($component)) { $__componentOriginalc295f12dca9d42f28a259237a5724830 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc295f12dca9d42f28a259237a5724830 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.nav-link','data' => ['href' => route('dashboard'),'active' => request()->routeIs('dashboard'),'class' => 'kkd-nav-item']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('nav-link'); ?>
<?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(['href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('dashboard')),'active' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(request()->routeIs('dashboard')),'class' => 'kkd-nav-item']); ?>
                        <i class="fas fa-home text-xs"></i><span>Dashboard</span>
                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $attributes = $__attributesOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__attributesOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $component = $__componentOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__componentOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>
                    <?php if (isset($component)) { $__componentOriginalc295f12dca9d42f28a259237a5724830 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc295f12dca9d42f28a259237a5724830 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.nav-link','data' => ['href' => route('petugas.pasien.index'),'active' => request()->routeIs('petugas.pasien.*'),'class' => 'kkd-nav-item']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('nav-link'); ?>
<?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(['href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('petugas.pasien.index')),'active' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(request()->routeIs('petugas.pasien.*')),'class' => 'kkd-nav-item']); ?>
                        <i class="fas fa-hospital-user text-xs"></i><span>Pasien</span>
                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $attributes = $__attributesOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__attributesOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $component = $__componentOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__componentOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>
                    <?php if (isset($component)) { $__componentOriginalc295f12dca9d42f28a259237a5724830 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc295f12dca9d42f28a259237a5724830 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.nav-link','data' => ['href' => route('pasien.riwayat-penghapusan.index'),'active' => request()->routeIs('pasien.riwayat-penghapusan.*'),'class' => 'kkd-nav-item']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('nav-link'); ?>
<?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(['href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('pasien.riwayat-penghapusan.index')),'active' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(request()->routeIs('pasien.riwayat-penghapusan.*')),'class' => 'kkd-nav-item']); ?>
                        <i class="fas fa-history text-xs"></i><span>Riwayat Penghapusan</span>
                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $attributes = $__attributesOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__attributesOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $component = $__componentOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__componentOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>
                    <?php if (isset($component)) { $__componentOriginalc295f12dca9d42f28a259237a5724830 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc295f12dca9d42f28a259237a5724830 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.nav-link','data' => ['href' => route('petugas.pemeriksaan.index'),'active' => request()->routeIs('petugas.pemeriksaan.*'),'class' => 'kkd-nav-item']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('nav-link'); ?>
<?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(['href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('petugas.pemeriksaan.index')),'active' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(request()->routeIs('petugas.pemeriksaan.*')),'class' => 'kkd-nav-item']); ?>
                        <i class="fas fa-clipboard-list text-xs"></i><span>Pemeriksaan</span>
                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $attributes = $__attributesOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__attributesOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $component = $__componentOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__componentOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>
                <?php endif; ?>

                
                <?php if(in_array($role, ['admin', 'super_admin'])): ?>
                    <?php if (isset($component)) { $__componentOriginalc295f12dca9d42f28a259237a5724830 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc295f12dca9d42f28a259237a5724830 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.nav-link','data' => ['href' => route('admin.dashboard'),'active' => request()->routeIs('admin.dashboard'),'class' => 'kkd-nav-item']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('nav-link'); ?>
<?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(['href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('admin.dashboard')),'active' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(request()->routeIs('admin.dashboard')),'class' => 'kkd-nav-item']); ?>
                        <i class="fas fa-home text-xs"></i><span>Dashboard</span>
                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $attributes = $__attributesOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__attributesOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $component = $__componentOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__componentOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>

                    
                    <div class="relative" x-data="{ open: false }" @mouseenter="open = true" @mouseleave="open = false">
                        <button @click="open = !open"
                                class="kkd-nav-item inline-flex items-center gap-2 px-3 py-2 rounded-md text-sm font-medium
                                       text-slate-700 dark:text-slate-200 hover:text-teal-600 dark:hover:text-teal-300
                                       hover:bg-teal-50 dark:hover:bg-slate-700 transition-all duration-150"
                                :class="{ 'text-teal-600 dark:text-teal-300 bg-teal-50 dark:bg-slate-700': open }">
                            <i class="fas fa-layer-group text-xs"></i>
                            <span>Manajemen</span>
                            <i class="fas fa-chevron-down text-xs transition-transform duration-200" :class="{'rotate-180': open}"></i>
                        </button>
                        <div x-show="open" x-cloak
                             x-transition:enter="transition ease-out duration-150"
                             x-transition:enter-start="opacity-0 scale-95 -translate-y-1"
                             x-transition:enter-end="opacity-100 scale-100 translate-y-0"
                             x-transition:leave="transition ease-in duration-100"
                             x-transition:leave-start="opacity-100 scale-100"
                             x-transition:leave-end="opacity-0 scale-95"
                             class="absolute top-full left-0 mt-1 w-52 bg-white dark:bg-slate-800 rounded-xl shadow-lg border border-gray-100 dark:border-slate-700 py-1.5 z-50">
                            <a href="<?php echo e(route('admin.users.index')); ?>"
                               class="kkd-dropdown-item <?php echo e(request()->routeIs('admin.users.*') ? 'kkd-dropdown-active' : ''); ?>">
                                <i class="fas fa-users w-4 text-center"></i><span>Users</span>
                            </a>
                            <a href="<?php echo e(route('admin.dokter.index')); ?>"
                               class="kkd-dropdown-item <?php echo e(request()->routeIs('admin.dokter.*') ? 'kkd-dropdown-active' : ''); ?>">
                                <i class="fas fa-user-md w-4 text-center"></i><span>Dokter</span>
                            </a>
                            <a href="<?php echo e(route('petugas.pasien.index')); ?>"
                               class="kkd-dropdown-item <?php echo e(request()->routeIs('petugas.pasien.*') ? 'kkd-dropdown-active' : ''); ?>">
                                <i class="fas fa-hospital-user w-4 text-center"></i><span>Pasien</span>
                            </a>
                            <a href="<?php echo e(route('pasien.riwayat-penghapusan.index')); ?>"
                               class="kkd-dropdown-item <?php echo e(request()->routeIs('pasien.riwayat-penghapusan.*') ? 'kkd-dropdown-active' : ''); ?>">
                                <i class="fas fa-history w-4 text-center"></i><span>Riwayat Penghapusan</span>
                            </a>
                            <a href="<?php echo e(route('petugas.pemeriksaan.index')); ?>"
                               class="kkd-dropdown-item <?php echo e(request()->routeIs('petugas.pemeriksaan.*') ? 'kkd-dropdown-active' : ''); ?>">
                                <i class="fas fa-clipboard-list w-4 text-center"></i><span>Pemeriksaan</span>
                            </a>
                            
                            <div class="my-1 border-t border-gray-100 dark:border-slate-700"></div>
                            
                            <a href="<?php echo e(route('admin.locked-users.index')); ?>"
                               class="kkd-dropdown-item <?php echo e(request()->routeIs('admin.locked-users.*') ? 'kkd-dropdown-active' : ''); ?>">
                                <i class="fas fa-user-lock w-4 text-center text-red-400"></i>
                                <span>Blokir Login</span>
                                <?php
                                    $lockedCount = \App\Http\Controllers\Auth\LockedUsersController::countLocked();
                                ?>
                                <?php if($lockedCount > 0): ?>
                                    <span class="ml-auto inline-flex items-center justify-center min-w-[1.1rem] h-4 px-1 rounded-full text-[0.6rem] font-bold bg-red-500 text-white">
                                        <?php echo e($lockedCount); ?>

                                    </span>
                                <?php endif; ?>
                            </a>
                        </div>
                    </div>

                    
                    <div class="relative" x-data="{ open: false }" @mouseenter="open = true" @mouseleave="open = false">
                        <button @click="open = !open"
                                class="kkd-nav-item inline-flex items-center gap-2 px-3 py-2 rounded-md text-sm font-medium
                                       text-slate-700 dark:text-slate-200 hover:text-teal-600 dark:hover:text-teal-300
                                       hover:bg-teal-50 dark:hover:bg-slate-700 transition-all duration-150"
                                :class="{ 'text-teal-600 dark:text-teal-300 bg-teal-50 dark:bg-slate-700': open }">
                            <i class="fas fa-clinic-medical text-xs"></i>
                            <span>Klinik</span>
                            <i class="fas fa-chevron-down text-xs transition-transform duration-200" :class="{'rotate-180': open}"></i>
                        </button>
                        <div x-show="open" x-cloak
                             x-transition:enter="transition ease-out duration-150"
                             x-transition:enter-start="opacity-0 scale-95 -translate-y-1"
                             x-transition:enter-end="opacity-100 scale-100 translate-y-0"
                             x-transition:leave="transition ease-in duration-100"
                             x-transition:leave-start="opacity-100 scale-100"
                             x-transition:leave-end="opacity-0 scale-95"
                             class="absolute top-full left-0 mt-1 w-52 bg-white dark:bg-slate-800 rounded-xl shadow-lg border border-gray-100 dark:border-slate-700 py-1.5 z-50">
                            <a href="<?php echo e(route('admin.konsultasi.index')); ?>"
                               class="kkd-dropdown-item <?php echo e(request()->routeIs('admin.konsultasi.*') ? 'kkd-dropdown-active' : ''); ?>">
                                <i class="fas fa-stethoscope w-4 text-center"></i><span>Konsultasi</span>
                            </a>
                            <a href="<?php echo e(route('admin.pembayaran.index')); ?>"
                               class="kkd-dropdown-item <?php echo e(request()->routeIs('admin.pembayaran.*') ? 'kkd-dropdown-active' : ''); ?>">
                                <i class="fas fa-money-bill-wave w-4 text-center"></i><span>Pembayaran</span>
                            </a>
                            <div class="my-1 border-t border-gray-100 dark:border-slate-700"></div>
                            <a href="<?php echo e(route('admin.laporan.index')); ?>"
                               class="kkd-dropdown-item <?php echo e(request()->routeIs('admin.laporan.*') ? 'kkd-dropdown-active' : ''); ?>">
                                <i class="fas fa-chart-bar w-4 text-center"></i><span>Laporan</span>
                            </a>
                        </div>
                    </div>
                <?php endif; ?>

                
                <?php if($role === 'dokter'): ?>
                    <?php if (isset($component)) { $__componentOriginalc295f12dca9d42f28a259237a5724830 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc295f12dca9d42f28a259237a5724830 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.nav-link','data' => ['href' => route('dokter.dashboard'),'active' => request()->routeIs('dokter.dashboard'),'class' => 'kkd-nav-item']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('nav-link'); ?>
<?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(['href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('dokter.dashboard')),'active' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(request()->routeIs('dokter.dashboard')),'class' => 'kkd-nav-item']); ?>
                        <i class="fas fa-stethoscope text-xs"></i><span>Dashboard</span>
                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $attributes = $__attributesOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__attributesOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $component = $__componentOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__componentOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>
                    <?php if (isset($component)) { $__componentOriginalc295f12dca9d42f28a259237a5724830 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc295f12dca9d42f28a259237a5724830 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.nav-link','data' => ['href' => route('dokter.konsultasi.index'),'active' => request()->routeIs('dokter.konsultasi.*'),'class' => 'kkd-nav-item']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('nav-link'); ?>
<?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(['href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('dokter.konsultasi.index')),'active' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(request()->routeIs('dokter.konsultasi.*')),'class' => 'kkd-nav-item']); ?>
                        <i class="fas fa-notes-medical text-xs"></i><span>Konsultasi</span>
                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $attributes = $__attributesOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__attributesOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $component = $__componentOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__componentOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>
                    <?php if (isset($component)) { $__componentOriginalc295f12dca9d42f28a259237a5724830 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc295f12dca9d42f28a259237a5724830 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.nav-link','data' => ['href' => route('dokter.my-patients'),'active' => request()->routeIs('dokter.my-patients'),'class' => 'kkd-nav-item']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('nav-link'); ?>
<?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(['href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('dokter.my-patients')),'active' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(request()->routeIs('dokter.my-patients')),'class' => 'kkd-nav-item']); ?>
                        <i class="fas fa-user-injured text-xs"></i><span>Pasien Saya</span>
                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $attributes = $__attributesOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__attributesOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc295f12dca9d42f28a259237a5724830)): ?>
<?php $component = $__componentOriginalc295f12dca9d42f28a259237a5724830; ?>
<?php unset($__componentOriginalc295f12dca9d42f28a259237a5724830); ?>
<?php endif; ?>

                    
                    <div class="relative" x-data="{ open: false }" @mouseenter="open = true" @mouseleave="open = false">
                        <button @click="open = !open"
                                class="kkd-nav-item inline-flex items-center gap-2 px-3 py-2 rounded-md text-sm font-medium
                                       text-slate-700 dark:text-slate-200 hover:text-teal-600 dark:hover:text-teal-300
                                       hover:bg-teal-50 dark:hover:bg-slate-700 transition-all duration-150">
                            <i class="fas fa-ellipsis-h text-xs"></i>
                            <span>Lainnya</span>
                            <i class="fas fa-chevron-down text-xs transition-transform duration-200" :class="{'rotate-180': open}"></i>
                        </button>
                        <div x-show="open" x-cloak
                             x-transition:enter="transition ease-out duration-150"
                             x-transition:enter-start="opacity-0 scale-95 -translate-y-1"
                             x-transition:enter-end="opacity-100 scale-100 translate-y-0"
                             x-transition:leave="transition ease-in duration-100"
                             x-transition:leave-start="opacity-100 scale-100"
                             x-transition:leave-end="opacity-0 scale-95"
                             class="absolute top-full left-0 mt-1 w-52 bg-white dark:bg-slate-800 rounded-xl shadow-lg border border-gray-100 dark:border-slate-700 py-1.5 z-50">
                            <a href="<?php echo e(route('dokter.jadwal-kontrol')); ?>"
                               class="kkd-dropdown-item <?php echo e(request()->routeIs('dokter.jadwal-kontrol') ? 'kkd-dropdown-active' : ''); ?>">
                                <i class="fas fa-calendar-alt w-4 text-center"></i><span>Jadwal Kontrol</span>
                            </a>
                            <a href="<?php echo e(route('dokter.review.index')); ?>"
                               class="kkd-dropdown-item <?php echo e(request()->routeIs('dokter.review.*') ? 'kkd-dropdown-active' : ''); ?>">
                                <i class="fas fa-clipboard-check w-4 text-center"></i><span>Review</span>
                            </a>
                        </div>
                    </div>
                <?php endif; ?>

            </div>

            
            <div class="flex items-center gap-2 sm:gap-1.5">

                
                <button @click="darkMode = !darkMode"
                        class="w-10 h-10 flex items-center justify-center rounded-lg bg-gray-100 dark:bg-slate-700 hover:bg-gray-200 dark:hover:bg-slate-600 focus:outline-none focus:ring-2 focus:ring-teal-500 transition-all duration-200 shrink-0"
                        :title="darkMode ? 'Mode Terang' : 'Mode Gelap'">
                    <i class="fas fa-sun text-yellow-500 dark:hidden text-sm"></i>
                    <i class="fas fa-moon text-teal-300 hidden dark:inline-block text-sm"></i>
                </button>

                
                <?php if(in_array($role, ['admin', 'dokter', 'petugas', 'super_admin'])): ?>
                    <div x-data="notificationSystem()" x-init="startPolling()" class="relative shrink-0">
                        <button @click="toggleDropdown()" class="w-10 h-10 flex items-center justify-center rounded-lg relative bg-gray-100 dark:bg-slate-700 hover:bg-gray-200 dark:hover:bg-slate-600 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-teal-500">
                            <i class="fas fa-bell text-slate-600 dark:text-slate-200 text-sm"></i>
                            <template x-if="unreadCount > 0">
                                <span class="absolute -top-1 -right-1 bg-red-500 text-white rounded-full h-4 w-4 flex items-center justify-center animate-pulse font-bold" style="font-size:0.6rem" x-text="unreadCount > 9 ? '9+' : unreadCount"></span>
                            </template>
                        </button>
                        
                        <!-- Dropdown Notifications -->
                        <div x-show="open" @click.away="open = false" x-cloak
                             x-transition:enter="transition ease-out duration-150"
                             x-transition:enter-start="opacity-0 scale-95 translate-y-2"
                             x-transition:enter-end="opacity-100 scale-100 translate-y-0"
                             x-transition:leave="transition ease-in duration-100"
                             x-transition:leave-start="opacity-100 scale-100"
                             x-transition:leave-end="opacity-0 scale-95 translate-y-2"
                             class="absolute right-0 mt-2 w-80 sm:w-96 bg-white dark:bg-slate-800 rounded-xl shadow-lg border border-gray-100 dark:border-slate-700 py-1 z-50 overflow-hidden max-h-96">
                            <div class="px-4 py-3 border-b border-gray-100 dark:border-slate-700 flex justify-between items-center bg-gray-50 dark:bg-slate-700/50">
                                <h3 class="text-sm font-semibold text-slate-800 dark:text-slate-100">Notifikasi</h3>
                                <button x-show="unreadCount > 0" @click="markAllAsRead()" class="text-xs text-teal-600 dark:text-teal-400 hover:underline font-medium">Tandai semua dibaca</button>
                            </div>
                            <div class="max-h-80 overflow-y-auto">
                                <template x-if="notifications.length === 0">
                                    <div class="px-4 py-8 text-center text-sm text-slate-500 dark:text-slate-400 flex flex-col items-center">
                                        <div class="w-12 h-12 bg-slate-100 dark:bg-slate-700 rounded-full flex items-center justify-center mb-3">
                                            <i class="fas fa-bell-slash text-xl text-slate-300 dark:text-slate-500"></i>
                                        </div>
                                        Belum ada notifikasi
                                    </div>
                                </template>
                                <template x-for="notif in notifications" :key="notif.id">
                                    <a :href="notif.data.url" @click="markAsRead(notif.id)" class="block px-4 py-3 hover:bg-teal-50 dark:hover:bg-slate-700 border-b border-gray-50 dark:border-slate-700/50 transition">
                                        <div class="flex items-start gap-3">
                                            <div class="flex-shrink-0 mt-1">
                                                <div class="w-8 h-8 rounded-full bg-white dark:bg-slate-800 shadow-sm border border-gray-100 dark:border-slate-600 flex items-center justify-center">
                                                    <i :class="notif.data.icon || 'fas fa-bell text-teal-500'"></i>
                                                </div>
                                            </div>
                                            <div class="flex-1 min-w-0">
                                                <p class="text-sm font-semibold text-slate-800 dark:text-slate-100 truncate" x-text="notif.data.title"></p>
                                                <p class="text-xs text-slate-600 dark:text-slate-400 line-clamp-2 mt-0.5 leading-snug" x-text="notif.data.message"></p>
                                                <p class="text-[0.65rem] text-slate-400 dark:text-slate-500 mt-1.5 font-medium" x-text="notif.created_at"></p>
                                            </div>
                                        </div>
                                    </a>
                                </template>
                            </div>
                        </div>
                    </div>
                <?php endif; ?>

                
                <div class="relative">
                    <?php if (isset($component)) { $__componentOriginaldf8083d4a852c446488d8d384bbc7cbe = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginaldf8083d4a852c446488d8d384bbc7cbe = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dropdown','data' => ['align' => 'right','width' => '56']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dropdown'); ?>
<?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(['align' => 'right','width' => '56']); ?>
                         <?php $__env->slot('trigger', null, []); ?> 
                            <button class="inline-flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium
                                           text-slate-700 dark:text-slate-100 bg-gray-100 dark:bg-slate-700
                                           hover:bg-gray-200 dark:hover:bg-slate-600 border border-transparent
                                           focus:outline-none focus:ring-2 focus:ring-teal-500 transition-all duration-150
                                           active:scale-95">
                                <div class="w-8 h-8 rounded-full bg-gradient-to-br from-teal-500 to-teal-600 flex items-center justify-center text-white font-bold text-xs shadow">
                                    <?php echo e(strtoupper(substr(Auth::user()->name ?? '', 0, 1))); ?>

                                </div>
                                <div class="hidden md:block text-left leading-tight">
                                    <div class="text-xs font-semibold text-slate-800 dark:text-slate-100 max-w-[100px] truncate"><?php echo e(Auth::user()->name ?? ''); ?></div>
                                    <div class="text-xs text-slate-500 dark:text-slate-400 capitalize"><?php echo e($role); ?></div>
                                </div>
                                <svg class="h-3.5 w-3.5 text-slate-500 dark:text-slate-400 fill-current hidden md:block" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
                                    <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/>
                                </svg>
                            </button>
                         <?php $__env->endSlot(); ?>
                         <?php $__env->slot('content', null, []); ?> 
                            
                            <div class="px-4 py-3 border-b border-gray-100 dark:border-slate-700">
                                <div class="flex items-center gap-3">
                                    <div class="w-10 h-10 rounded-full bg-gradient-to-br from-teal-500 to-teal-600 flex items-center justify-center text-white font-bold text-sm shadow">
                                        <?php echo e(strtoupper(substr(Auth::user()->name ?? '', 0, 1))); ?>

                                    </div>
                                    <div>
                                        <div class="font-semibold text-sm text-slate-800 dark:text-slate-100"><?php echo e(Auth::user()->name ?? ''); ?></div>
                                        <div class="text-xs text-slate-500 dark:text-slate-400"><?php echo e(Auth::user()->email ?? ''); ?></div>
                                        <div class="text-xs text-teal-600 dark:text-teal-300 capitalize font-medium mt-0.5"><?php echo e($role); ?></div>
                                    </div>
                                </div>
                            </div>
                            <?php if (isset($component)) { $__componentOriginal68cb1971a2b92c9735f83359058f7108 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal68cb1971a2b92c9735f83359058f7108 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dropdown-link','data' => ['href' => route('profile.edit'),'class' => 'flex items-center gap-2.5 text-slate-700 dark:text-slate-200 hover:text-teal-600 dark:hover:text-teal-300']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dropdown-link'); ?>
<?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(['href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('profile.edit')),'class' => 'flex items-center gap-2.5 text-slate-700 dark:text-slate-200 hover:text-teal-600 dark:hover:text-teal-300']); ?>
                                <i class="fas fa-user-circle text-slate-400 dark:text-slate-500 w-4 text-center"></i><span>Profile</span>
                             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal68cb1971a2b92c9735f83359058f7108)): ?>
<?php $attributes = $__attributesOriginal68cb1971a2b92c9735f83359058f7108; ?>
<?php unset($__attributesOriginal68cb1971a2b92c9735f83359058f7108); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal68cb1971a2b92c9735f83359058f7108)): ?>
<?php $component = $__componentOriginal68cb1971a2b92c9735f83359058f7108; ?>
<?php unset($__componentOriginal68cb1971a2b92c9735f83359058f7108); ?>
<?php endif; ?>
                            <?php if(in_array($role, ['admin', 'super_admin'])): ?>
                                <?php if (isset($component)) { $__componentOriginal68cb1971a2b92c9735f83359058f7108 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal68cb1971a2b92c9735f83359058f7108 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dropdown-link','data' => ['href' => route('admin.pengaturan.index'),'class' => 'flex items-center gap-2.5 text-slate-700 dark:text-slate-200 hover:text-teal-600 dark:hover:text-teal-300']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dropdown-link'); ?>
<?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(['href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('admin.pengaturan.index')),'class' => 'flex items-center gap-2.5 text-slate-700 dark:text-slate-200 hover:text-teal-600 dark:hover:text-teal-300']); ?>
                                    <i class="fas fa-sliders-h text-slate-400 dark:text-slate-500 w-4 text-center"></i><span>Pengaturan</span>
                                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal68cb1971a2b92c9735f83359058f7108)): ?>
<?php $attributes = $__attributesOriginal68cb1971a2b92c9735f83359058f7108; ?>
<?php unset($__attributesOriginal68cb1971a2b92c9735f83359058f7108); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal68cb1971a2b92c9735f83359058f7108)): ?>
<?php $component = $__componentOriginal68cb1971a2b92c9735f83359058f7108; ?>
<?php unset($__componentOriginal68cb1971a2b92c9735f83359058f7108); ?>
<?php endif; ?>
                            <?php endif; ?>
                            <div class="border-t border-gray-100 dark:border-slate-700 mt-1 pt-1">
                                <form method="POST" action="<?php echo e(route('logout')); ?>">
                                    <?php echo csrf_field(); ?>
                                    <?php if (isset($component)) { $__componentOriginal68cb1971a2b92c9735f83359058f7108 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal68cb1971a2b92c9735f83359058f7108 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dropdown-link','data' => ['href' => route('logout'),'onclick' => 'event.preventDefault(); this.closest(\'form\').submit();','class' => 'flex items-center gap-2.5 text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 hover:bg-red-50 dark:hover:bg-red-900/20']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dropdown-link'); ?>
<?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(['href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('logout')),'onclick' => 'event.preventDefault(); this.closest(\'form\').submit();','class' => 'flex items-center gap-2.5 text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 hover:bg-red-50 dark:hover:bg-red-900/20']); ?>
                                        <i class="fas fa-sign-out-alt w-4 text-center"></i><span>Log Out</span>
                                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal68cb1971a2b92c9735f83359058f7108)): ?>
<?php $attributes = $__attributesOriginal68cb1971a2b92c9735f83359058f7108; ?>
<?php unset($__attributesOriginal68cb1971a2b92c9735f83359058f7108); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal68cb1971a2b92c9735f83359058f7108)): ?>
<?php $component = $__componentOriginal68cb1971a2b92c9735f83359058f7108; ?>
<?php unset($__componentOriginal68cb1971a2b92c9735f83359058f7108); ?>
<?php endif; ?>
                                </form>
                            </div>
                         <?php $__env->endSlot(); ?>
                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginaldf8083d4a852c446488d8d384bbc7cbe)): ?>
<?php $attributes = $__attributesOriginaldf8083d4a852c446488d8d384bbc7cbe; ?>
<?php unset($__attributesOriginaldf8083d4a852c446488d8d384bbc7cbe); ?>
<?php endif; ?>
<?php if (isset($__componentOriginaldf8083d4a852c446488d8d384bbc7cbe)): ?>
<?php $component = $__componentOriginaldf8083d4a852c446488d8d384bbc7cbe; ?>
<?php unset($__componentOriginaldf8083d4a852c446488d8d384bbc7cbe); ?>
<?php endif; ?>
                </div>
            </div>
        </div>
    </div>

    

    
    <div x-show="sidebarOpen" @click="sidebarOpen = false"
         x-transition:enter="transition-opacity ease-out duration-200"
         x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100"
         x-transition:leave="transition-opacity ease-in duration-150"
         x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0"
         class="fixed inset-0 bg-black/50 dark:bg-black/70 backdrop-blur-sm z-40 sm:hidden" style="display:none"></div>

    
    <div x-show="sidebarOpen"
         x-transition:enter="transition ease-out duration-250"
         x-transition:enter-start="opacity-0 -translate-x-full"
         x-transition:enter-end="opacity-100 translate-x-0"
         x-transition:leave="transition ease-in duration-200"
         x-transition:leave-start="opacity-100 translate-x-0"
         x-transition:leave-end="opacity-0 -translate-x-full"
         class="fixed inset-y-0 left-0 z-50 w-72 sm:hidden overflow-y-auto bg-white dark:bg-slate-800 shadow-2xl border-r border-gray-200 dark:border-slate-700 scrollbar-thin"
         style="display:none">

        
        <div class="flex items-center justify-between p-4 border-b border-teal-600/30 bg-gradient-to-r from-teal-500 to-teal-600">
            <div class="flex items-center gap-3">
                <div class="flex items-center justify-center w-12 h-12 -ml-2"><img src="<?php echo e(asset('storage/logo.png')); ?>" alt="Logo" class="w-full h-full object-contain scale-125 drop-shadow-sm"></div>
                <div>
                    <h2 class="font-bold text-white text-sm">KKD</h2>
                    <p class="text-teal-100 text-xs">Klinik Kesehatan Digital</p>
                </div>
            </div>
            <button @click="sidebarOpen = false" class="p-1.5 rounded-lg bg-white/20 hover:bg-white/30 text-white transition-colors">
                <i class="fas fa-times text-sm"></i>
            </button>
        </div>

        
        <div class="m-3 p-3 rounded-xl bg-teal-50 dark:bg-slate-700 border border-teal-100 dark:border-slate-600">
            <div class="flex items-center gap-3">
                <div class="w-10 h-10 rounded-full bg-gradient-to-br from-teal-500 to-teal-600 flex items-center justify-center text-white font-bold shadow-md">
                    <?php echo e(strtoupper(substr(Auth::user()->name ?? '', 0, 1))); ?>

                </div>
                <div class="min-w-0">
                    <div class="text-sm font-semibold text-slate-800 dark:text-slate-100 truncate"><?php echo e(Auth::user()->name ?? ''); ?></div>
                    <div class="text-xs text-slate-600 dark:text-slate-400 capitalize"><?php echo e($role); ?> • KKD</div>
                </div>
            </div>
        </div>

        
        <div class="px-3 pb-4 space-y-0.5">

            
            <?php if($role === 'petugas'): ?>
                <p class="kkd-sidebar-section">Operasional</p>
                <a href="<?php echo e(route('dashboard')); ?>" class="kkd-sidebar-item <?php echo e(request()->routeIs('dashboard') ? 'kkd-sidebar-active' : ''); ?>">
                    <i class="fas fa-home w-4 text-center text-teal-500"></i><span>Dashboard</span>
                </a>
                <a href="<?php echo e(route('petugas.pasien.index')); ?>" class="kkd-sidebar-item <?php echo e(request()->routeIs('petugas.pasien.*') ? 'kkd-sidebar-active' : ''); ?>">
                    <i class="fas fa-hospital-user w-4 text-center text-slate-400 dark:text-slate-500"></i><span>Manajemen Pasien</span>
                </a>
                <a href="<?php echo e(route('pasien.riwayat-penghapusan.index')); ?>" class="kkd-sidebar-item <?php echo e(request()->routeIs('pasien.riwayat-penghapusan.*') ? 'kkd-sidebar-active' : ''); ?>">
                    <i class="fas fa-history w-4 text-center text-slate-400 dark:text-slate-500"></i><span>Riwayat Penghapusan</span>
                </a>
                <a href="<?php echo e(route('petugas.pemeriksaan.index')); ?>" class="kkd-sidebar-item <?php echo e(request()->routeIs('petugas.pemeriksaan.*') ? 'kkd-sidebar-active' : ''); ?>">
                    <i class="fas fa-clipboard-list w-4 text-center text-slate-400 dark:text-slate-500"></i><span>Pemeriksaan Manual</span>
                </a>
            <?php endif; ?>

            
            <?php if(in_array($role, ['admin', 'super_admin'])): ?>
                <p class="kkd-sidebar-section">Admin Panel</p>
                <a href="<?php echo e(route('admin.dashboard')); ?>" class="kkd-sidebar-item <?php echo e(request()->routeIs('admin.dashboard') ? 'kkd-sidebar-active' : ''); ?>">
                    <i class="fas fa-home w-4 text-center text-teal-500 dark:text-teal-400"></i><span>Dashboard</span>
                </a>

                
                <?php $mLockedCount = \App\Http\Controllers\Auth\LockedUsersController::countLocked(); ?>
                <div x-data="{ acc: <?php echo e(request()->routeIs('admin.users.*') || request()->routeIs('admin.dokter.*') || request()->routeIs('petugas.pasien.*') || request()->routeIs('petugas.pemeriksaan.*') || request()->routeIs('admin.locked-users.*') ? 'true' : 'false'); ?> }">
                    <button @click="acc = !acc" class="kkd-sidebar-item w-full justify-between">
                        <div class="flex items-center gap-3">
                            <i class="fas fa-layer-group w-4 text-center text-slate-400 dark:text-slate-500"></i>
                            <span>Manajemen</span>
                        </div>
                        <div class="flex items-center gap-1.5">
                            <?php if($mLockedCount > 0): ?>
                                <span class="inline-flex items-center justify-center min-w-[1.1rem] h-4 px-1 rounded-full text-[0.6rem] font-bold bg-red-500 text-white">
                                    <?php echo e($mLockedCount); ?>

                                </span>
                            <?php endif; ?>
                            <i class="fas fa-chevron-down text-xs text-slate-400 transition-transform duration-200" :class="{'rotate-180': acc}"></i>
                        </div>
                    </button>
                    <div x-show="acc" x-collapse class="ml-7 mt-0.5 space-y-0.5 border-l-2 border-teal-100 dark:border-slate-600 pl-3">
                        <a href="<?php echo e(route('admin.users.index')); ?>" class="kkd-sidebar-sub <?php echo e(request()->routeIs('admin.users.*') ? 'kkd-sidebar-sub-active' : ''); ?>">
                            <i class="fas fa-users w-3.5 text-center"></i><span>Users</span>
                        </a>
                        <a href="<?php echo e(route('admin.dokter.index')); ?>" class="kkd-sidebar-sub <?php echo e(request()->routeIs('admin.dokter.*') ? 'kkd-sidebar-sub-active' : ''); ?>">
                            <i class="fas fa-user-md w-3.5 text-center"></i><span>Dokter</span>
                        </a>
                        <a href="<?php echo e(route('petugas.pasien.index')); ?>" class="kkd-sidebar-sub <?php echo e(request()->routeIs('petugas.pasien.*') ? 'kkd-sidebar-sub-active' : ''); ?>">
                            <i class="fas fa-hospital-user w-3.5 text-center"></i><span>Pasien</span>
                        </a>
                        <a href="<?php echo e(route('pasien.riwayat-penghapusan.index')); ?>" class="kkd-sidebar-sub <?php echo e(request()->routeIs('pasien.riwayat-penghapusan.*') ? 'kkd-sidebar-sub-active' : ''); ?>">
                            <i class="fas fa-history w-3.5 text-center"></i><span>Riwayat Penghapusan</span>
                        </a>
                        <a href="<?php echo e(route('petugas.pemeriksaan.index')); ?>" class="kkd-sidebar-sub <?php echo e(request()->routeIs('petugas.pemeriksaan.*') ? 'kkd-sidebar-sub-active' : ''); ?>">
                            <i class="fas fa-clipboard-list w-3.5 text-center"></i><span>Pemeriksaan</span>
                        </a>
                        
                        <div class="my-1 border-t border-gray-100 dark:border-slate-700 -ml-3"></div>
                        
                        <a href="<?php echo e(route('admin.locked-users.index')); ?>"
                           class="kkd-sidebar-sub <?php echo e(request()->routeIs('admin.locked-users.*') ? 'kkd-sidebar-sub-active' : ''); ?> flex items-center justify-between">
                            <div class="flex items-center gap-2">
                                <i class="fas fa-user-lock w-3.5 text-center text-red-400"></i>
                                <span>Blokir Login</span>
                            </div>
                            <?php if($mLockedCount > 0): ?>
                                <span class="inline-flex items-center justify-center min-w-[1.1rem] h-4 px-1 rounded-full text-[0.6rem] font-bold bg-red-500 text-white animate-pulse">
                                    <?php echo e($mLockedCount); ?>

                                </span>
                            <?php endif; ?>
                        </a>
                    </div>
                </div>

                
                <div x-data="{ acc: <?php echo e(request()->routeIs('admin.konsultasi.*') || request()->routeIs('admin.pembayaran.*') || request()->routeIs('admin.laporan.*') ? 'true' : 'false'); ?> }">
                    <button @click="acc = !acc" class="kkd-sidebar-item w-full justify-between">
                        <div class="flex items-center gap-3">
                            <i class="fas fa-clinic-medical w-4 text-center text-slate-400 dark:text-slate-500"></i>
                            <span>Klinik</span>
                        </div>
                        <i class="fas fa-chevron-down text-xs text-slate-400 transition-transform duration-200" :class="{'rotate-180': acc}"></i>
                    </button>
                    <div x-show="acc" x-collapse class="ml-7 mt-0.5 space-y-0.5 border-l-2 border-teal-100 dark:border-slate-600 pl-3">
                        <a href="<?php echo e(route('admin.konsultasi.index')); ?>" class="kkd-sidebar-sub <?php echo e(request()->routeIs('admin.konsultasi.*') ? 'kkd-sidebar-sub-active' : ''); ?>">
                            <i class="fas fa-stethoscope w-3.5 text-center"></i><span>Konsultasi</span>
                        </a>
                        <a href="<?php echo e(route('admin.pembayaran.index')); ?>" class="kkd-sidebar-sub <?php echo e(request()->routeIs('admin.pembayaran.*') ? 'kkd-sidebar-sub-active' : ''); ?>">
                            <i class="fas fa-money-bill-wave w-3.5 text-center"></i><span>Pembayaran</span>
                        </a>
                        <a href="<?php echo e(route('admin.laporan.index')); ?>" class="kkd-sidebar-sub <?php echo e(request()->routeIs('admin.laporan.*') ? 'kkd-sidebar-sub-active' : ''); ?>">
                            <i class="fas fa-chart-bar w-3.5 text-center"></i><span>Laporan</span>
                        </a>
                    </div>
                </div>
            <?php endif; ?>

            
            <?php if($role === 'dokter'): ?>
                <p class="kkd-sidebar-section">Dokter Dashboard</p>
                <a href="<?php echo e(route('dokter.dashboard')); ?>" class="kkd-sidebar-item <?php echo e(request()->routeIs('dokter.dashboard') ? 'kkd-sidebar-active' : ''); ?>">
                    <i class="fas fa-stethoscope w-4 text-center text-teal-500 dark:text-teal-400"></i><span>Dashboard</span>
                </a>
                <a href="<?php echo e(route('dokter.konsultasi.index')); ?>" class="kkd-sidebar-item <?php echo e(request()->routeIs('dokter.konsultasi.*') ? 'kkd-sidebar-active' : ''); ?>">
                    <i class="fas fa-notes-medical w-4 text-center text-slate-400 dark:text-slate-500"></i><span>Konsultasi Saya</span>
                </a>
                <a href="<?php echo e(route('dokter.my-patients')); ?>" class="kkd-sidebar-item <?php echo e(request()->routeIs('dokter.my-patients') ? 'kkd-sidebar-active' : ''); ?>">
                    <i class="fas fa-user-injured w-4 text-center text-slate-400 dark:text-slate-500"></i><span>Pasien Saya</span>
                </a>
                <a href="<?php echo e(route('dokter.jadwal-kontrol')); ?>" class="kkd-sidebar-item <?php echo e(request()->routeIs('dokter.jadwal-kontrol') ? 'kkd-sidebar-active' : ''); ?>">
                    <i class="fas fa-calendar-alt w-4 text-center text-slate-400 dark:text-slate-500"></i><span>Jadwal Kontrol</span>
                </a>
                <a href="<?php echo e(route('dokter.review.index')); ?>" class="kkd-sidebar-item <?php echo e(request()->routeIs('dokter.review.*') ? 'kkd-sidebar-active' : ''); ?>">
                    <i class="fas fa-clipboard-check w-4 text-center text-slate-400 dark:text-slate-500"></i><span>Review</span>
                </a>
            <?php endif; ?>

            
            <div class="pt-3 mt-3 border-t border-gray-200 dark:border-slate-700 space-y-0.5">
                <a href="<?php echo e(route('profile.edit')); ?>" class="kkd-sidebar-item">
                    <i class="fas fa-user-edit w-4 text-center text-slate-400 dark:text-slate-500"></i><span>Edit Profile</span>
                </a>
                
                <button @click="darkMode = !darkMode" class="kkd-sidebar-item w-full text-left">
                    <i class="fas fa-sun w-4 text-center text-yellow-500 dark:hidden"></i>
                    <i class="fas fa-moon w-4 text-center text-teal-300 hidden dark:inline-block"></i>
                    <span x-text="darkMode ? 'Mode Terang' : 'Mode Gelap'"></span>
                </button>
                <form method="POST" action="<?php echo e(route('logout')); ?>">
                    <?php echo csrf_field(); ?>
                    <button type="submit" class="kkd-sidebar-item w-full text-left text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/30 hover:text-red-700 dark:hover:text-red-300">
                        <i class="fas fa-sign-out-alt w-4 text-center"></i><span>Log Out</span>
                    </button>
                </form>
            </div>

        </div>
    </div>

</nav>

<style>
    /* Prevent FOUC (Flash of Unstyled Content) with Alpine.js */
    [x-cloak] { display: none !important; }

    /* Smooth dark mode transition */
    html {
        transition: background-color 0.2s, color 0.2s;
    }

    /* Custom scrollbar for sidebar */
    .fixed.inset-y-0.left-0::-webkit-scrollbar {
        width: 6px;
    }

    .fixed.inset-y-0.left-0::-webkit-scrollbar-track {
        background: rgb(240, 253, 250);
    }

    .dark .fixed.inset-y-0.left-0::-webkit-scrollbar-track {
        background: rgb(30, 41, 59);
    }

    .fixed.inset-y-0.left-0::-webkit-scrollbar-thumb {
        background: rgb(20, 184, 166);
        border-radius: 3px;
    }

    .fixed.inset-y-0.left-0::-webkit-scrollbar-thumb:hover {
        background: rgb(13, 148, 136);
    }
</style>

<script>
    document.addEventListener('alpine:init', () => {
        Alpine.data('notificationSystem', () => ({
            open: false,
            unreadCount: 0,
            notifications: [],
            interval: null,
            
            startPolling() {
                this.fetchNotifications();
                // 10 detik interval polling
                this.interval = setInterval(() => this.fetchNotifications(), 10000);
            },
            
            toggleDropdown() {
                this.open = !this.open;
                if (this.open && this.unreadCount > 0) {
                    this.fetchNotifications();
                }
            },
            
            async fetchNotifications() {
                try {
                    const response = await fetch('/notifications/unread', {
                        headers: {
                            'Accept': 'application/json',
                            'X-Requested-With': 'XMLHttpRequest'
                        }
                    });
                    if (response.ok) {
                        const data = await response.json();
                        this.unreadCount = data.unread_count;
                        this.notifications = data.notifications;
                    }
                } catch (error) {
                    console.error('Ada masalah saat fetch notifikasi:', error);
                }
            },
            
            async markAsRead(id) {
                try {
                    let csrfMeta = document.querySelector('meta[name="csrf-token"]');
                    if (!csrfMeta) return;

                    await fetch(`/notifications/${id}/mark-as-read`, {
                        method: 'POST',
                        headers: {
                            'X-CSRF-TOKEN': csrfMeta.content,
                            'Accept': 'application/json',
                            'X-Requested-With': 'XMLHttpRequest'
                        }
                    });
                    // Kurangi secara lokal biar instan di UI
                    this.unreadCount = Math.max(0, this.unreadCount - 1);
                    this.notifications = this.notifications.filter(n => n.id !== id);
                } catch (error) {
                    console.error('Error mark as read:', error);
                }
            },
            
            async markAllAsRead() {
                try {
                    let csrfMeta = document.querySelector('meta[name="csrf-token"]');
                    if (!csrfMeta) return;

                    await fetch(`/notifications/mark-all-as-read`, {
                        method: 'POST',
                        headers: {
                            'X-CSRF-TOKEN': csrfMeta.content,
                            'Accept': 'application/json',
                            'X-Requested-With': 'XMLHttpRequest'
                        }
                    });
                    this.unreadCount = 0;
                    this.notifications = [];
                } catch (error) {
                    console.error('Error mark all as read:', error);
                }
            }
        }));
    });
</script><?php /**PATH C:\laragon\www\KESEHATAN\resources\views/layouts/navigation.blade.php ENDPATH**/ ?>