<nav class="fixed top-0 left-0 lg:left-[260px] h-[72px] w-full lg:w-[calc(100%-260px)] bg-white border-b border-gray-200 shadow-sm z-50">
    <div class="relative h-full max-w-full pl-6 pr-2 sm:pl-8 sm:pr-2 lg:pl-10 lg:pr-3 flex items-center justify-between">
        
        <div class="flex items-end gap-2 min-w-0 pb-1">
            <div class="h-[64px] flex items-end overflow-hidden shrink-0">
                <img
                    src="<?php echo e(asset('images/mega-theron-logo.png')); ?>"
                    alt="Mega Theron Group"
                    class="h-[64px] w-auto object-contain block"
                />
            </div>

            <div class="flex flex-col items-start min-w-0">
                <h1 class="text-2xl font-semibold text-gray-900 tracking-tight leading-tight truncate">
                    <?php if(isset($header)): ?>
                        <?php echo e($header); ?>

                    <?php else: ?>
                        <?php echo e(__('Enterprise OS')); ?>

                    <?php endif; ?>
                </h1>
            </div>
        </div>

        
        <div class="flex items-center justify-end gap-2 min-w-[180px]">
            <button
                @click="sidebarOpen = !sidebarOpen"
                class="lg:hidden inline-flex items-center justify-center p-2 rounded-md text-gray-600 hover:bg-gray-100"
            >
                <svg class="h-6 w-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
                </svg>
            </button>

            <?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 ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('dropdown'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['align' => 'right','width' => '56']); ?>
                 <?php $__env->slot('trigger', null, []); ?> 
                    <button
                        class="inline-flex items-center gap-3 px-4 py-2 rounded-xl border border-neutral-700 bg-neutral-800 text-sm text-white shadow-sm hover:bg-neutral-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 focus:ring-offset-white"
                    >
                        <div class="text-left leading-tight">
                            <div class="text-sm font-semibold text-white truncate">
                                <?php echo e(trim(Auth::user()->name.' '.(Auth::user()->surname ?? ''))); ?>

                            </div>
                            <div class="text-xs text-neutral-300">
                                <?php echo e(Auth::user()->hasSystemAdminRole() ? 'System Admin' : (Auth::user()->getRoleNames()->first() ?? 'No Role')); ?>

                            </div>
                        </div>
                        <svg class="h-4 w-4 text-neutral-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
                            <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, []); ?> 
                    <?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')]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?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 && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('profile.edit'))]); ?>
                        <?php echo e(__('Profile')); ?>

                     <?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 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'),'class' => 'text-red-700 hover:bg-red-50 focus:bg-red-50','onclick' => 'event.preventDefault(); this.closest(\'form\').submit();']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?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 && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('logout')),'class' => 'text-red-700 hover:bg-red-50 focus:bg-red-50','onclick' => 'event.preventDefault(); this.closest(\'form\').submit();']); ?>
                            <?php echo e(__('Log Out')); ?>

                         <?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>
                 <?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>
</nav>

<div class="fixed inset-0 bg-black/40 z-40 lg:hidden" x-show="sidebarOpen" x-transition.opacity @click="sidebarOpen = false"></div>

<aside
    id="app-sidebar"
    class="fixed top-0 left-0 h-screen w-[260px] bg-neutral-800 border-r border-neutral-700 z-40 transform transition-transform duration-200 ease-out overflow-y-auto"
    :class="sidebarOpen ? 'translate-x-0' : '-translate-x-full lg:translate-x-0'"
>
    <div class="px-1 py-4 space-y-2">
        <?php $__currentLoopData = config('mtt_dashboard_menu', []); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php echo $__env->make('layouts.partials.nav-item', ['item' => $item, 'depth' => 0, 'keyPath' => 'root'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
</aside>

<script>
    document.addEventListener('DOMContentLoaded', () => {
        const toggles = document.querySelectorAll('.nav-group-toggle');
        const sidebar = document.getElementById('app-sidebar');

        const getParts = (toggle) => {
            const container = toggle.closest('.nav-group-container');
            const children = container ? Array.from(container.children).find((el) => el.classList?.contains('nav-children')) : null;
            const divider = container ? Array.from(container.children).find((el) => el.classList?.contains('nav-group-divider')) : null;
            const chevron = toggle.querySelector('.nav-chevron');

            return { children, divider, chevron };
        };

        const setExpanded = (toggle, expanded) => {
            const { children, divider, chevron } = getParts(toggle);
            if (!children || !chevron) {
                return;
            }

            children.classList.toggle('hidden', !expanded);
            if (divider) {
                divider.classList.toggle('hidden', !expanded);
            }
            chevron.classList.toggle('rotate-180', expanded);
        };

        const scrollIntoViewIfNeeded = (element) => {
            if (!sidebar || !element) {
                return;
            }

            const sidebarRect = sidebar.getBoundingClientRect();
            const elementRect = element.getBoundingClientRect();

            // Scroll down if the element bottom is below the visible area.
            if (elementRect.bottom > sidebarRect.bottom) {
                const delta = elementRect.bottom - sidebarRect.bottom + 8;
                sidebar.scrollTop += delta;
            }

            // Scroll up if the element top is above the visible area.
            if (elementRect.top < sidebarRect.top) {
                const delta = sidebarRect.top - elementRect.top + 8;
                sidebar.scrollTop -= delta;
            }
        };

        const isExpanded = (toggle) => {
            const { children } = getParts(toggle);
            if (!children) {
                return false;
            }

            return !children.classList.contains('hidden');
        };

        const collapseDescendants = (toggle) => {
            const { children } = getParts(toggle);
            if (!children) {
                return;
            }

            const descendants = children.querySelectorAll('.nav-group-toggle');
            descendants.forEach((descendantToggle) => setExpanded(descendantToggle, false));
        };

        toggles.forEach((toggle) => {
            const forceOpen = toggle.dataset.forceOpen === '1';
            const { children, chevron } = getParts(toggle);
            if (!children || !chevron) {
                return;
            }

            setExpanded(toggle, forceOpen);
            if (forceOpen) {
                scrollIntoViewIfNeeded(children);
            }

            toggle.addEventListener('click', (event) => {
                event.preventDefault();
                const expanded = !isExpanded(toggle);
                setExpanded(toggle, expanded);

                if (expanded) {
                    const parentKey = toggle.dataset.navParentKey;
                    const depth = toggle.dataset.navDepth;

                    toggles.forEach((siblingToggle) => {
                        if (siblingToggle === toggle) {
                            return;
                        }

                        if (
                            siblingToggle.dataset.navParentKey === parentKey
                            && siblingToggle.dataset.navDepth === depth
                        ) {
                            setExpanded(siblingToggle, false);
                            collapseDescendants(siblingToggle);
                        }
                    });

                    scrollIntoViewIfNeeded(children);
                } else {
                    collapseDescendants(toggle);
                }
            });
        });
    });
</script><?php /**PATH C:\Projects\mtt-os\resources\views\layouts\navigation.blade.php ENDPATH**/ ?>