<header class="h-16 flex items-center justify-between px-6 bg-white border-b border-slate-200 shadow-sm z-40 relative">
    
    <button @click="sidebarOpen = !sidebarOpen" class="text-slate-500 hover:text-cyan-600 focus:outline-none transition-colors p-2 rounded-md hover:bg-slate-100">
        <svg class="w-6 h-6" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
            <path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h7"></path>
        </svg>
    </button>
    
    <div class="flex items-center space-x-4 md:space-x-6 ml-auto">
        
        <button class="relative p-2 text-slate-500 hover:text-cyan-600 transition-colors rounded-full hover:bg-slate-100 focus:outline-none">
            <svg class="w-6 h-6" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"></path></svg>
            <span class="absolute top-1.5 right-1.5 block h-2.5 w-2.5 rounded-full bg-red-500 ring-2 ring-white"></span>
        </button>

        <div x-data="{ profileOpen: false }" class="relative">
            <button @click="profileOpen = !profileOpen" @click.away="profileOpen = false" class="flex items-center space-x-3 focus:outline-none">
                <div class="text-right hidden sm:block">
                    <p class="text-sm font-bold text-slate-800 leading-tight">{{ auth()->user()->name ?? 'Administrator' }}</p>
                    <p class="text-[10px] text-cyan-600 font-bold uppercase tracking-wider">Super Admin</p>
                </div>
                <div class="h-9 w-9 rounded-full bg-gradient-to-r from-cyan-500 to-purple-600 text-white flex items-center justify-center font-bold text-sm shadow-md">
                    {{ substr(auth()->user()->name ?? 'A', 0, 1) }}
                </div>
            </button>

            <div x-show="profileOpen" 
                 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 right-0 mt-3 w-48 bg-white rounded-xl shadow-lg border border-slate-100 z-50 overflow-hidden" style="display: none;">
                
                <a href="#" class="block px-4 py-3 text-sm text-slate-700 hover:bg-slate-50 hover:text-cyan-600 transition-colors border-b border-slate-100">
                    My Profile
                </a>
                <a href="#" class="block px-4 py-3 text-sm text-slate-700 hover:bg-slate-50 hover:text-cyan-600 transition-colors border-b border-slate-100">
                    Account Settings
                </a>
                
                <form method="POST" action="{{ route('admin.logout') }}">
                    @csrf
                    <button type="submit" class="w-full text-left block px-4 py-3 text-sm font-bold text-red-600 hover:bg-red-50 transition-colors">
                        Sign Out
                    </button>
                </form>
            </div>
        </div>
    </div>
</header>