<!-- Sidebar Navigation -->
<div x-data="{ sidebarOpen: false }" class="flex h-screen bg-gray-50">
    <!-- Mobile sidebar overlay -->
    <div x-show="sidebarOpen"
         x-transition:enter="transition-opacity ease-linear duration-300"
         x-transition:enter-start="opacity-0"
         x-transition:enter-end="opacity-100"
         x-transition:leave="transition-opacity ease-linear duration-300"
         x-transition:leave-start="opacity-100"
         x-transition:leave-end="opacity-0"
         class="fixed inset-0 z-40 lg:hidden"
         @click="sidebarOpen = false"
         style="display: none;">
        <div class="absolute inset-0 bg-gray-600 opacity-75"></div>
    </div>

    <!-- Sidebar -->
    <div class="fixed inset-y-0 left-0 z-50 w-64 bg-white shadow-xl transform transition-transform duration-300 ease-in-out lg:translate-x-0 lg:static lg:inset-0"
         :class="sidebarOpen ? 'translate-x-0' : '-translate-x-full lg:translate-x-0'">
        
        <!-- Sidebar Header -->
        <div class="flex items-center justify-between h-16 px-6 bg-gradient-to-r from-blue-600 to-indigo-700">
            <div class="flex items-center">
                <div class="w-8 h-8 bg-white rounded-lg flex items-center justify-center">
                    <svg class="w-5 h-5 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
                    </svg>
                </div>
                <span class="ml-3 text-white font-bold text-lg">Slarry Laundry</span>
            </div>
            <button @click="sidebarOpen = false" class="lg:hidden text-white hover:text-gray-200">
                <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
                </svg>
            </button>
        </div>

        <!-- Navigation Menu -->
        <nav class="mt-8 px-4">
            <div class="space-y-2">
                <!-- Dashboard -->
                <a href="<?php echo e(route('dashboard')); ?>" 
                   class="flex items-center px-4 py-3 text-gray-700 rounded-lg hover:bg-blue-50 hover:text-blue-700 transition-colors duration-200 group <?php echo e(request()->routeIs('dashboard') ? 'bg-blue-50 text-blue-700 border-r-4 border-blue-700' : ''); ?>">
                    <svg class="w-5 h-5 mr-3 <?php echo e(request()->routeIs('dashboard') ? 'text-blue-700' : 'text-gray-400 group-hover:text-blue-700'); ?>" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z"></path>
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 5a2 2 0 012-2h2a2 2 0 012 2v6H8V5z"></path>
                    </svg>
                    <span class="font-medium">Dashboard</span>
                </a>

                <!-- Customers -->
                <?php if(Auth::user()->hasPermission('manage_customers')): ?>
                    <a href="<?php echo e(route('customers.index')); ?>"
                       class="flex items-center px-4 py-3 text-gray-700 rounded-lg hover:bg-blue-50 hover:text-blue-700 transition-colors duration-200 group <?php echo e(request()->routeIs('customers.*') ? 'bg-blue-50 text-blue-700 border-r-4 border-blue-700' : ''); ?>">
                        <svg class="w-5 h-5 mr-3 <?php echo e(request()->routeIs('customers.*') ? 'text-blue-700' : 'text-gray-400 group-hover:text-blue-700'); ?>" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path>
                        </svg>
                        <span class="font-medium">Customers</span>
                    </a>
                <?php endif; ?>

                <!-- Orders -->
                <?php if(Auth::user()->hasPermission('manage_orders')): ?>
                    <a href="<?php echo e(route('orders.index')); ?>"
                       class="flex items-center px-4 py-3 text-gray-700 rounded-lg hover:bg-blue-50 hover:text-blue-700 transition-colors duration-200 group <?php echo e(request()->routeIs('orders.*') ? 'bg-blue-50 text-blue-700 border-r-4 border-blue-700' : ''); ?>">
                        <svg class="w-5 h-5 mr-3 <?php echo e(request()->routeIs('orders.*') ? 'text-blue-700' : 'text-gray-400 group-hover:text-blue-700'); ?>" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path>
                        </svg>
                        <span class="font-medium">Orders</span>
                    </a>
                <?php endif; ?>

                <!-- Items & Pricing (Admin only) -->
                <?php if(Auth::user()->hasPermission('manage_items')): ?>
                    <a href="<?php echo e(route('items.index')); ?>"
                       class="flex items-center px-4 py-3 text-gray-700 rounded-lg hover:bg-blue-50 hover:text-blue-700 transition-colors duration-200 group <?php echo e(request()->routeIs('items.*') ? 'bg-blue-50 text-blue-700 border-r-4 border-blue-700' : ''); ?>">
                        <svg class="w-5 h-5 mr-3 <?php echo e(request()->routeIs('items.*') ? 'text-blue-700' : 'text-gray-400 group-hover:text-blue-700'); ?>" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"></path>
                        </svg>
                        <span class="font-medium">Items & Pricing</span>
                    </a>
                <?php endif; ?>

                <!-- Reports -->
                <?php if(Auth::user()->hasPermission('view_reports')): ?>
                    <a href="<?php echo e(route('reports.index')); ?>"
                       class="flex items-center px-4 py-3 text-gray-700 rounded-lg hover:bg-blue-50 hover:text-blue-700 transition-colors duration-200 group <?php echo e(request()->routeIs('reports.*') ? 'bg-blue-50 text-blue-700 border-r-4 border-blue-700' : ''); ?>">
                        <svg class="w-5 h-5 mr-3 <?php echo e(request()->routeIs('reports.*') ? 'text-blue-700' : 'text-gray-400 group-hover:text-blue-700'); ?>" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"></path>
                        </svg>
                        <span class="font-medium">Reports</span>
                    </a>
                <?php endif; ?>



                <!-- User Management (Admin only) -->
                <?php if(Auth::user()->hasPermission('manage_users')): ?>
                    <a href="<?php echo e(route('users.index')); ?>"
                       class="flex items-center px-4 py-3 text-gray-700 rounded-lg hover:bg-blue-50 hover:text-blue-700 transition-colors duration-200 group <?php echo e(request()->routeIs('users.*') ? 'bg-blue-50 text-blue-700 border-r-4 border-blue-700' : ''); ?>">
                        <svg class="w-5 h-5 mr-3 <?php echo e(request()->routeIs('users.*') ? 'text-blue-700' : 'text-gray-400 group-hover:text-blue-700'); ?>" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z"></path>
                        </svg>
                        <span class="font-medium">User Management</span>
                    </a>
                <?php endif; ?>
            </div>
        </nav>

        <!-- User Profile Section -->
        <div class="absolute bottom-0 left-0 right-0 p-4 border-t border-gray-200 bg-white">
            <div class="flex items-center">
                <div class="w-10 h-10 bg-gradient-to-r from-blue-500 to-indigo-600 rounded-full flex items-center justify-center text-white font-bold">
                    <?php echo e(strtoupper(substr(Auth::user()->name, 0, 1))); ?>

                </div>
                <div class="ml-3 flex-1">
                    <p class="text-sm font-medium text-gray-900"><?php echo e(Auth::user()->name); ?></p>
                    <p class="text-xs text-gray-500 capitalize"><?php echo e(Auth::user()->role); ?></p>
                </div>
                <div class="relative" x-data="{ open: false }">
                    <button @click="open = !open" class="text-gray-400 hover:text-gray-600 focus:outline-none">
                        <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"></path>
                        </svg>
                    </button>
                    
                    <!-- Dropdown Menu -->
                    <div x-show="open" 
                         @click.away="open = false"
                         x-transition:enter="transition ease-out duration-100"
                         x-transition:enter-start="transform opacity-0 scale-95"
                         x-transition:enter-end="transform opacity-100 scale-100"
                         x-transition:leave="transition ease-in duration-75"
                         x-transition:leave-start="transform opacity-100 scale-100"
                         x-transition:leave-end="transform opacity-0 scale-95"
                         class="absolute bottom-full right-0 mb-2 w-48 bg-white rounded-lg shadow-lg border border-gray-200 py-1">
                        <a href="<?php echo e(route('profile.edit')); ?>" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">
                            Profile Settings
                        </a>
                        <form method="POST" action="<?php echo e(route('logout')); ?>">
                            <?php echo csrf_field(); ?>
                            <button type="submit" class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">
                                Sign Out
                            </button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Main Content Area -->
    <div class="flex-1 flex flex-col overflow-hidden">
        <!-- Top Header -->
        <header class="bg-white shadow-sm border-b border-gray-200">
            <div class="px-6 py-4">
                <div class="flex items-center justify-between">
                    <!-- Left Side: Mobile Menu + Breadcrumb + Page Title -->
                    <div class="flex items-center space-x-4 flex-1">
                        <button @click="sidebarOpen = true" class="lg:hidden text-gray-500 hover:text-gray-700 focus:outline-none p-2 rounded-lg hover:bg-gray-100 transition-all duration-200">
                            <svg class="w-6 h-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"></path>
                            </svg>
                        </button>

                        <div class="flex-1">
                            <!-- Breadcrumb Navigation -->
                            <nav class="flex items-center space-x-2 text-sm text-gray-500 mb-1">
                                <a href="<?php echo e(route('dashboard')); ?>" class="hover:text-blue-600 transition-colors duration-200">Dashboard</a>
                                <?php if(!request()->routeIs('dashboard')): ?>
                                    <svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
                                    </svg>
                                    <?php if(request()->routeIs('customers.*')): ?>
                                        <span class="text-blue-600 font-medium">Customers</span>
                                    <?php elseif(request()->routeIs('orders.*')): ?>
                                        <span class="text-blue-600 font-medium">Orders</span>
                                    <?php elseif(request()->routeIs('items.*')): ?>
                                        <span class="text-blue-600 font-medium">Items & Pricing</span>
                                    <?php elseif(request()->routeIs('reports.*')): ?>
                                        <span class="text-blue-600 font-medium">Reports</span>

                                    <?php elseif(request()->routeIs('users.*')): ?>
                                        <span class="text-blue-600 font-medium">User Management</span>
                                    <?php endif; ?>
                                <?php endif; ?>
                            </nav>

                            <!-- Page Header Content -->
                            <div class="flex items-center justify-between">
                                <div>
                                    <?php echo e($header ?? ''); ?>

                                </div>

                                <!-- Page-specific Actions -->
                                <div class="flex items-center space-x-3">
                                    <?php if(request()->routeIs('customers.index') && Auth::user()->hasPermission('manage_customers')): ?>
                                        <a href="<?php echo e(route('customers.create')); ?>"
                                           class="bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 text-white font-semibold py-2.5 px-5 rounded-xl transition-all duration-200 flex items-center shadow-lg hover:shadow-xl text-sm">
                                            <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path>
                                            </svg>
                                            Add New Customer
                                        </a>
                                    <?php elseif(request()->routeIs('orders.index') && Auth::user()->hasPermission('manage_orders')): ?>
                                        <a href="<?php echo e(route('orders.create')); ?>"
                                           class="bg-gradient-to-r from-green-600 to-green-700 hover:from-green-700 hover:to-green-800 text-white font-semibold py-2.5 px-5 rounded-xl transition-all duration-200 flex items-center shadow-lg hover:shadow-xl text-sm">
                                            <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path>
                                            </svg>
                                            Create New Order
                                        </a>
                                    <?php elseif(request()->routeIs('items.index') && Auth::user()->hasPermission('manage_items')): ?>
                                        <a href="<?php echo e(route('items.create')); ?>"
                                           class="bg-gradient-to-r from-purple-600 to-purple-700 hover:from-purple-700 hover:to-purple-800 text-white font-semibold py-2.5 px-5 rounded-xl transition-all duration-200 flex items-center shadow-lg hover:shadow-xl text-sm">
                                            <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path>
                                            </svg>
                                            Add New Item
                                        </a>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- Right Side: Notifications & User Menu -->
                    <div class="flex items-center space-x-3 ml-6">
                        <!-- Notifications -->
                        <button class="text-gray-400 hover:text-gray-600 focus:outline-none p-2 rounded-lg hover:bg-gray-100 transition-all duration-200 relative">
                            <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-5 5v-5zM10.5 3.5a6 6 0 0 1 6 6v2l1.5 1.5v1h-13v-1L6.5 11.5v-2a6 6 0 0 1 6-6z"></path>
                            </svg>
                            <!-- Notification Badge -->
                            <span class="absolute -top-1 -right-1 w-3 h-3 bg-red-500 rounded-full"></span>
                        </button>

                        <!-- User Avatar -->
                        <div class="w-8 h-8 bg-gradient-to-r from-blue-500 to-indigo-600 rounded-full flex items-center justify-center text-white font-semibold text-sm">
                            <?php echo e(strtoupper(substr(Auth::user()->name, 0, 1))); ?>

                        </div>
                    </div>
                </div>
            </div>
        </header>

        <!-- Main Content -->
        <main class="flex-1 overflow-y-auto bg-gray-50">
            <?php echo e($slot); ?>

        </main>
    </div>
</div>
<?php /**PATH C:\Users\Dotmartcodes\Documents\laundry\resources\views/layouts/sidebar.blade.php ENDPATH**/ ?>