<!-- التكامل مع الأنظمة الحكومية -->
<div x-data="{ open: {{ request()->routeIs('government-integrations.*') ? 'true' : 'false' }} }" class="mb-1">
    <button @click="open = !open" class="group flex items-center p-3 py-2 text-base font-medium rounded-md
        {{ request()->routeIs('government-integrations.*') ? 'bg-red-100 text-red-800' : 'text-gray-700 hover:bg-red-50 hover:text-red-800' }}">
        <svg xmlns="http://www.w3.org/2000/svg" class="ml-3 flex-shrink-0 h-6 w-6 
            {{ request()->routeIs('government-integrations.*') ? 'text-red-700' : 'text-gray-500 group-hover:text-red-700' }}" 
            fill="none" viewBox="0 0 24 24" stroke="currentColor">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" 
                d="M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z" />
        </svg>
        <span>التكامل مع الأنظمة الحكومية</span>
        <svg :class="{'rotate-180': open, 'rotate-0': !open}" class="mr-auto h-5 w-5 transform transition-transform duration-200" 
            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>
    <div x-show="open" x-transition class="pr-4 mr-4 border-r border-gray-200">
        @permission('government_integrations.view')
        <a href="{{ route('government-integrations.index') }}" class="group flex items-center p-3 py-2 text-sm font-medium rounded-md
            {{ request()->routeIs('government-integrations.index') ? 'text-red-800 bg-red-100' : 'text-gray-700 hover:text-red-800 hover:bg-red-50' }}">
            <span class="ml-2 w-1 h-1 rounded-full {{ request()->routeIs('government-integrations.index') ? 'bg-red-600' : 'bg-gray-500' }}"></span>
            <span>جميع التكاملات</span>
        </a>
        @endpermission

        @permission('qowa.view')
        <a href="{{ route('government-integrations.qowa.create') }}" class="group flex items-center p-3 py-2 text-sm font-medium rounded-md
            {{ request()->routeIs('government-integrations.qowa.*') ? 'text-red-800 bg-red-100' : 'text-gray-700 hover:text-red-800 hover:bg-red-50' }}">
            <span class="ml-2 w-1 h-1 rounded-full {{ request()->routeIs('government-integrations.qowa.*') ? 'bg-red-600' : 'bg-gray-500' }}"></span>
            <span>منصة قوى</span>
        </a>
        @endpermission

        @permission('baladi.view')
        <a href="{{ route('government-integrations.baladi.create') }}" class="group flex items-center p-3 py-2 text-sm font-medium rounded-md
            {{ request()->routeIs('government-integrations.baladi.*') ? 'text-red-800 bg-red-100' : 'text-gray-700 hover:text-red-800 hover:bg-red-50' }}">
            <span class="ml-2 w-1 h-1 rounded-full {{ request()->routeIs('government-integrations.baladi.*') ? 'bg-red-600' : 'bg-gray-500' }}"></span>
            <span>منصة بلدي</span>
        </a>
        @endpermission

        @permission('sadad.view')
        <a href="{{ route('government-integrations.sadad.create') }}" class="group flex items-center p-3 py-2 text-sm font-medium rounded-md
            {{ request()->routeIs('government-integrations.sadad.*') ? 'text-red-800 bg-red-100' : 'text-gray-700 hover:text-red-800 hover:bg-red-50' }}">
            <span class="ml-2 w-1 h-1 rounded-full {{ request()->routeIs('government-integrations.sadad.*') ? 'bg-red-600' : 'bg-gray-500' }}"></span>
            <span>منصة سداد</span>
        </a>
        @endpermission

        @permission('zatca.settings.view')
        <a href="{{ route('zatca.settings.index') }}" class="group flex items-center p-3 py-2 text-sm font-medium rounded-md
            {{ request()->routeIs('zatca.settings.*') ? 'text-red-800 bg-red-100' : 'text-gray-700 hover:text-red-800 hover:bg-red-50' }}">
            <span class="ml-2 w-1 h-1 rounded-full {{ request()->routeIs('zatca.settings.*') ? 'bg-red-600' : 'bg-gray-500' }}"></span>
            <span>نظام ZATCA</span>
        </a>
        @endpermission

        @permission('einvoices.view')
        <a href="{{ route('einvoices.index') }}" class="group flex items-center p-3 py-2 text-sm font-medium rounded-md
            {{ request()->routeIs('einvoices.*') ? 'text-red-800 bg-red-100' : 'text-gray-700 hover:text-red-800 hover:bg-red-50' }}">
            <span class="ml-2 w-1 h-1 rounded-full {{ request()->routeIs('einvoices.*') ? 'bg-red-600' : 'bg-gray-500' }}"></span>
            <span>الفواتير الإلكترونية</span>
        </a>
        @endpermission
    </div>
</div>
