@php
    $notifikasiCount = \App\Models\ObatMasuk::where('tanggal_kadaluarsa', '<=', now()->addMonths(3))
        ->where('tanggal_kadaluarsa', '>', now())
        ->count();
@endphp

<header class="bg-white border-b border-[#E5E7F2] px-6 py-4">
    <div class="flex items-center justify-between">
        <div>
            <h1 class="text-xl font-bold text-[#2F347A]">@yield('title', 'Dashboard MedData')</h1>
        </div>
        
        <div class="flex items-center gap-4">
            <!-- Notification Bell -->
            <button onclick="document.getElementById('notificationModal').classList.remove('hidden')" 
                    class="relative p-2 text-[#7A7FAE] hover:text-[#4A538F] hover:bg-[#F4F6FF] rounded-lg transition-colors">
                <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="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"/>
                </svg>
                @if($notifikasiCount > 0)
                    <span class="absolute -top-1 -right-1 w-5 h-5 bg-red-500 text-white text-xs font-bold rounded-full flex items-center justify-center">
                        {{ $notifikasiCount > 9 ? '9+' : $notifikasiCount }}
                    </span>
                @endif
            </button>
        </div>
    </div>
</header>
