@extends('layouts.app')

@section('title', 'لوحة تقارير المخزون')

@section('content')
<div class="min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 py-8 px-4 md:px-8">
    <div class="max-w-7xl mx-auto">
        <!-- Page Header -->
        <div class="mb-8">
            <h1 class="text-4xl font-bold text-gray-900 mb-2">لوحة تقارير المخزون</h1>
            <p class="text-gray-600">ملخص إحصائيات المخزون والأصناف المخزنة</p>
        </div>

        <!-- Statistics Cards -->
        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-6 mb-8">
            <!-- Total Items -->
            <div class="bg-white rounded-xl shadow-lg p-6 border-l-4 border-blue-500 hover:shadow-xl transition-shadow">
                <div class="flex items-center justify-between">
                    <div>
                        <p class="text-gray-600 text-sm font-medium">إجمالي الأصناف</p>
                        <p class="text-3xl font-bold text-gray-900 mt-2">{{ number_format($statistics['count'] ?? 0) }}</p>
                    </div>
                    <div class="p-3 rounded-full bg-blue-100">
                        <svg class="w-8 h-8 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"></path>
                        </svg>
                    </div>
                </div>
            </div>

            <!-- Total Quantity -->
            <div class="bg-white rounded-xl shadow-lg p-6 border-l-4 border-green-500 hover:shadow-xl transition-shadow">
                <div class="flex items-center justify-between">
                    <div>
                        <p class="text-gray-600 text-sm font-medium">إجمالي الكمية</p>
                        <p class="text-3xl font-bold text-gray-900 mt-2">{{ number_format((float)($statistics['total_quantity'] ?? 0), 2) }}</p>
                    </div>
                    <div class="p-3 rounded-full bg-green-100">
                        <svg class="w-8 h-8 text-green-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>
                </div>
            </div>

            <!-- Average Quantity -->
            <div class="bg-white rounded-xl shadow-lg p-6 border-l-4 border-yellow-500 hover:shadow-xl transition-shadow">
                <div class="flex items-center justify-between">
                    <div>
                        <p class="text-gray-600 text-sm font-medium">متوسط الكمية</p>
                        <p class="text-3xl font-bold text-gray-900 mt-2">{{ number_format((float)($statistics['average_quantity'] ?? 0), 2) }}</p>
                    </div>
                    <div class="p-3 rounded-full bg-yellow-100">
                        <svg class="w-8 h-8 text-yellow-600" 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>
                    </div>
                </div>
            </div>

            <!-- Low Stock Count -->
            <div class="bg-white rounded-xl shadow-lg p-6 border-l-4 border-red-500 hover:shadow-xl transition-shadow">
                <div class="flex items-center justify-between">
                    <div>
                        <p class="text-gray-600 text-sm font-medium">أصناف ناقصة</p>
                        <p class="text-3xl font-bold text-red-600 mt-2">{{ number_format($lowStockCount ?? 0) }}</p>
                    </div>
                    <div class="p-3 rounded-full bg-red-100">
                        <svg class="w-8 h-8 text-red-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4v2m0 4v2M6.5 4h11C20 4 21 5 21 6.5v11c0 1.5-1 2.5-2.5 2.5h-11C4 20 3 19 3 17.5v-11C3 5 4 4 5.5 4z"></path>
                        </svg>
                    </div>
                </div>
            </div>

            <!-- Stock Value -->
            <div class="bg-white rounded-xl shadow-lg p-6 border-l-4 border-purple-500 hover:shadow-xl transition-shadow">
                <div class="flex items-center justify-between">
                    <div>
                        <p class="text-gray-600 text-sm font-medium">قيمة المخزون</p>
                        <p class="text-3xl font-bold text-gray-900 mt-2">{{ number_format((float)($statistics['total_value'] ?? 0), 2) }}</p>
                    </div>
                    <div class="p-3 rounded-full bg-purple-100">
                        <svg class="w-8 h-8 text-purple-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                        </svg>
                    </div>
                </div>
            </div>
        </div>

        <!-- Quick Links and Reports -->
        <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
            <!-- Quick Actions -->
            <div class="bg-white rounded-xl shadow-lg p-6">
                <h2 class="text-xl font-bold text-gray-900 mb-6 flex items-center">
                    <svg class="w-6 h-6 text-blue-600 ml-2" 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>
                    روابط سريعة
                </h2>
                <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                    <a href="{{ route('inventory.items.index') }}" class="p-4 bg-blue-50 hover:bg-blue-100 rounded-lg transition-colors flex items-center">
                        <svg class="w-5 h-5 text-blue-600 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                        </svg>
                        <span class="text-gray-900 font-medium">الأصناف</span>
                    </a>

                    <a href="{{ route('inventory.warehouses.index') }}" class="p-4 bg-green-50 hover:bg-green-100 rounded-lg transition-colors flex items-center">
                        <svg class="w-5 h-5 text-green-600 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"></path>
                        </svg>
                        <span class="text-gray-900 font-medium">المخازن</span>
                    </a>

                    <a href="{{ route('inventory.issues.index') }}" class="p-4 bg-red-50 hover:bg-red-100 rounded-lg transition-colors flex items-center">
                        <svg class="w-5 h-5 text-red-600 ml-2" 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 2v12a2 2 0 002 2h10a2 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="text-gray-900 font-medium">أذون الصرف</span>
                    </a>

                    <a href="{{ route('inventory.receipts.index') }}" class="p-4 bg-yellow-50 hover:bg-yellow-100 rounded-lg transition-colors flex items-center">
                        <svg class="w-5 h-5 text-yellow-600 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"></path>
                        </svg>
                        <span class="text-gray-900 font-medium">أذون الاستلام</span>
                    </a>

                    <a href="{{ route('inventory.transfers.index') }}" class="p-4 bg-indigo-50 hover:bg-indigo-100 rounded-lg transition-colors flex items-center">
                        <svg class="w-5 h-5 text-indigo-600 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3v-9"></path>
                        </svg>
                        <span class="text-gray-900 font-medium">إذن تحويل</span>
                    </a>

                    <a href="{{ route('inventory.reports.index') }}" class="p-4 bg-purple-50 hover:bg-purple-100 rounded-lg transition-colors flex items-center">
                        <svg class="w-5 h-5 text-purple-600 ml-2" 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="text-gray-900 font-medium">التقارير</span>
                    </a>
                </div>
            </div>

            <!-- Available Reports -->
            <div class="bg-white rounded-xl shadow-lg p-6">
                <h2 class="text-xl font-bold text-gray-900 mb-6 flex items-center">
                    <svg class="w-6 h-6 text-green-600 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4M7 12a5 5 0 1110 0 5 5 0 01-10 0z"></path>
                    </svg>
                    التقارير المتاحة
                </h2>
                <div class="space-y-3">
                    <a href="{{ route('inventory.reports.stock-balances') }}" class="p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors flex justify-between items-center group">
                        <span class="text-gray-900 font-medium">أرصدة الأصناف</span>
                        <svg class="w-5 h-5 text-gray-400 group-hover:text-gray-600 transition-colors" 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>
                    </a>

                    <a href="{{ route('inventory.reports.inventory-movements') }}" class="p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors flex justify-between items-center group">
                        <span class="text-gray-900 font-medium">حركة المخزون</span>
                        <svg class="w-5 h-5 text-gray-400 group-hover:text-gray-600 transition-colors" 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>
                    </a>

                    <a href="{{ route('inventory.reports.low-stock-items') }}" class="p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors flex justify-between items-center group">
                        <span class="text-gray-900 font-medium">الأصناف الناقصة</span>
                        <svg class="w-5 h-5 text-gray-400 group-hover:text-gray-600 transition-colors" 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>
                    </a>

                    <a href="{{ route('inventory.reports.inventory-value') }}" class="p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors flex justify-between items-center group">
                        <span class="text-gray-900 font-medium">قيمة المخزون</span>
                        <svg class="w-5 h-5 text-gray-400 group-hover:text-gray-600 transition-colors" 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>
                    </a>

                    <a href="{{ route('inventory.reports.inventory-summary') }}" class="p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors flex justify-between items-center group">
                        <span class="text-gray-900 font-medium">ملخص المخزون</span>
                        <svg class="w-5 h-5 text-gray-400 group-hover:text-gray-600 transition-colors" 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>
                    </a>

                    <a href="{{ route('inventory.reports.warehouse-summary') }}" class="p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors flex justify-between items-center group">
                        <span class="text-gray-900 font-medium">ملخص المخازن</span>
                        <svg class="w-5 h-5 text-gray-400 group-hover:text-gray-600 transition-colors" 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>
                    </a>
                </div>
            </div>
        </div>

        <!-- Low Stock Alert -->
        @if($lowStockCount > 0)
        <div class="mt-8 bg-yellow-50 border-l-4 border-yellow-400 p-6 rounded-r-lg">
            <div class="flex items-start">
                <div class="flex-shrink-0">
                    <svg class="h-6 w-6 text-yellow-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4v2m0 4v2M6.5 4h11C20 4 21 5 21 6.5v11c0 1.5-1 2.5-2.5 2.5h-11C4 20 3 19 3 17.5v-11C3 5 4 4 5.5 4z"></path>
                    </svg>
                </div>
                <div class="mr-4">
                    <h3 class="text-lg font-medium text-yellow-800">تنبيه: أصناف ناقصة</h3>
                    <p class="mt-2 text-sm text-yellow-700">
                        هناك <strong>{{ $lowStockCount }}</strong> أصناف بمستويات مخزون منخفضة.
                        <a href="{{ route('inventory.reports.low-stock-items') }}" class="font-semibold underline hover:no-underline">عرض التفاصيل &larr;</a>
                    </p>
                </div>
            </div>
        </div>
        @endif

        <!-- All Reports Section -->
        <div class="mt-12 mb-8">
            <div class="flex items-center justify-between mb-6">
                <h2 class="text-2xl font-bold text-gray-900 flex items-center">
                    <svg class="w-8 h-8 text-blue-600 ml-3" 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>
                    جميع التقارير المتاحة
                </h2>
            </div>

            <!-- Reports Grid -->
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
                <!-- المرحلة 1: التقارير الأساسية -->
                <div class="group">
                    <div class="bg-white rounded-xl shadow-lg p-6 h-full hover:shadow-xl transition-all duration-200 border-t-4 border-blue-500">
                        <div class="flex items-center mb-3">
                            <i class="fas fa-chart-pie text-blue-600 text-xl ml-2"></i>
                            <h3 class="text-lg font-semibold text-gray-900">أرصدة الأصناف</h3>
                        </div>
                        <p class="text-gray-600 text-sm mb-4">عرض أرصدة جميع الأصناف الحالية في المخازن</p>
                        <a href="{{ route('inventory.reports.stock-balances') }}" class="inline-flex items-center px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors duration-200 font-medium text-sm">
                            <span>عرض التقرير</span>
                            <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="M9 5l7 7-7 7"></path>
                            </svg>
                        </a>
                    </div>
                </div>

                <div class="group">
                    <div class="bg-white rounded-xl shadow-lg p-6 h-full hover:shadow-xl transition-all duration-200 border-t-4 border-green-500">
                        <div class="flex items-center mb-3">
                            <i class="fas fa-arrows-alt text-green-600 text-xl ml-2"></i>
                            <h3 class="text-lg font-semibold text-gray-900">حركة المخزون</h3>
                        </div>
                        <p class="text-gray-600 text-sm mb-4">عرض تفاصيل حركة الأصناف (الوارد والصرف)</p>
                        <a href="{{ route('inventory.reports.inventory-movements') }}" class="inline-flex items-center px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors duration-200 font-medium text-sm">
                            <span>عرض التقرير</span>
                            <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="M9 5l7 7-7 7"></path>
                            </svg>
                        </a>
                    </div>
                </div>

                <div class="group">
                    <div class="bg-white rounded-xl shadow-lg p-6 h-full hover:shadow-xl transition-all duration-200 border-t-4 border-red-500">
                        <div class="flex items-center mb-3">
                            <i class="fas fa-exclamation-triangle text-red-600 text-xl ml-2"></i>
                            <h3 class="text-lg font-semibold text-gray-900">الأصناف الناقصة</h3>
                        </div>
                        <p class="text-gray-600 text-sm mb-4">الأصناف التي وصلت حدها الأدنى من المخزون</p>
                        <a href="{{ route('inventory.reports.low-stock-items') }}" class="inline-flex items-center px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors duration-200 font-medium text-sm">
                            <span>عرض التقرير</span>
                            <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="M9 5l7 7-7 7"></path>
                            </svg>
                        </a>
                    </div>
                </div>

                <div class="group">
                    <div class="bg-white rounded-xl shadow-lg p-6 h-full hover:shadow-xl transition-all duration-200 border-t-4 border-yellow-500">
                        <div class="flex items-center mb-3">
                            <i class="fas fa-warehouse text-yellow-600 text-xl ml-2"></i>
                            <h3 class="text-lg font-semibold text-gray-900">ملخص المخازن</h3>
                        </div>
                        <p class="text-gray-600 text-sm mb-4">ملخص شامل لحالة جميع المخازن</p>
                        <a href="{{ route('inventory.reports.warehouse-summary') }}" class="inline-flex items-center px-4 py-2 bg-yellow-600 text-white rounded-lg hover:bg-yellow-700 transition-colors duration-200 font-medium text-sm">
                            <span>عرض التقرير</span>
                            <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="M9 5l7 7-7 7"></path>
                            </svg>
                        </a>
                    </div>
                </div>

                <div class="group">
                    <div class="bg-white rounded-xl shadow-lg p-6 h-full hover:shadow-xl transition-all duration-200 border-t-4 border-purple-500">
                        <div class="flex items-center mb-3">
                            <i class="fas fa-list-alt text-purple-600 text-xl ml-2"></i>
                            <h3 class="text-lg font-semibold text-gray-900">ملخص المخزون</h3>
                        </div>
                        <p class="text-gray-600 text-sm mb-4">إجمالي ملخص المخزون مع الإحصائيات</p>
                        <a href="{{ route('inventory.reports.inventory-summary') }}" class="inline-flex items-center px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors duration-200 font-medium text-sm">
                            <span>عرض التقرير</span>
                            <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="M9 5l7 7-7 7"></path>
                            </svg>
                        </a>
                    </div>
                </div>

                <div class="group">
                    <div class="bg-white rounded-xl shadow-lg p-6 h-full hover:shadow-xl transition-all duration-200 border-t-4 border-indigo-500">
                        <div class="flex items-center mb-3">
                            <i class="fas fa-money-bill-wave text-indigo-600 text-xl ml-2"></i>
                            <h3 class="text-lg font-semibold text-gray-900">قيمة المخزون</h3>
                        </div>
                        <p class="text-gray-600 text-sm mb-4">تقرير القيمة الإجمالية للمخزون</p>
                        <a href="{{ route('inventory.reports.inventory-value') }}" class="inline-flex items-center px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors duration-200 font-medium text-sm">
                            <span>عرض التقرير</span>
                            <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="M9 5l7 7-7 7"></path>
                            </svg>
                        </a>
                    </div>
                </div>

                <!-- المرحلة 2: مستندات المخزن -->
                <div class="group">
                    <div class="bg-white rounded-xl shadow-lg p-6 h-full hover:shadow-xl transition-all duration-200 border-t-4 border-cyan-500">
                        <div class="flex items-center mb-3">
                            <i class="fas fa-arrow-down text-cyan-600 text-xl ml-2"></i>
                            <h3 class="text-lg font-semibold text-gray-900">تقرير الوارد</h3>
                        </div>
                        <p class="text-gray-600 text-sm mb-4">تفاصيل جميع عمليات الاستقبال</p>
                        <a href="{{ route('inventory.reports.receipts') }}" class="inline-flex items-center px-4 py-2 bg-cyan-600 text-white rounded-lg hover:bg-cyan-700 transition-colors duration-200 font-medium text-sm">
                            <span>عرض التقرير</span>
                            <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="M9 5l7 7-7 7"></path>
                            </svg>
                        </a>
                    </div>
                </div>

                <div class="group">
                    <div class="bg-white rounded-xl shadow-lg p-6 h-full hover:shadow-xl transition-all duration-200 border-t-4 border-pink-500">
                        <div class="flex items-center mb-3">
                            <i class="fas fa-arrow-up text-pink-600 text-xl ml-2"></i>
                            <h3 class="text-lg font-semibold text-gray-900">تقرير الصرف</h3>
                        </div>
                        <p class="text-gray-600 text-sm mb-4">تفاصيل جميع عمليات الصرف</p>
                        <a href="{{ route('inventory.reports.issues') }}" class="inline-flex items-center px-4 py-2 bg-pink-600 text-white rounded-lg hover:bg-pink-700 transition-colors duration-200 font-medium text-sm">
                            <span>عرض التقرير</span>
                            <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="M9 5l7 7-7 7"></path>
                            </svg>
                        </a>
                    </div>
                </div>

                <div class="group">
                    <div class="bg-white rounded-xl shadow-lg p-6 h-full hover:shadow-xl transition-all duration-200 border-t-4 border-orange-500">
                        <div class="flex items-center mb-3">
                            <i class="fas fa-exchange-alt text-orange-600 text-xl ml-2"></i>
                            <h3 class="text-lg font-semibold text-gray-900">تقرير التحويل</h3>
                        </div>
                        <p class="text-gray-600 text-sm mb-4">تفاصيل عمليات التحويل بين المخازن</p>
                        <a href="{{ route('inventory.reports.transfers') }}" class="inline-flex items-center px-4 py-2 bg-orange-600 text-white rounded-lg hover:bg-orange-700 transition-colors duration-200 font-medium text-sm">
                            <span>عرض التقرير</span>
                            <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="M9 5l7 7-7 7"></path>
                            </svg>
                        </a>
                    </div>
                </div>
            </div>
        </div>

        <!-- Additional Reports Section -->
        <div class="mt-12">
            <div class="flex items-center justify-between mb-6">
                <h2 class="text-2xl font-bold text-gray-900 flex items-center">
                    <svg class="w-8 h-8 text-purple-600 ml-3" 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>
                    تقارير متقدمة
                </h2>
                <a href="#" class="text-gray-600 hover:text-gray-900 text-sm font-medium">عرض المزيد</a>
            </div>

            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
                <a href="{{ route('inventory.reports.slow-moving-items') }}" class="p-4 bg-white rounded-lg border border-gray-200 hover:border-blue-500 hover:shadow-md transition-all duration-200 group">
                    <h4 class="font-semibold text-gray-900 group-hover:text-blue-600 mb-2">الأصناف بطيئة الحركة</h4>
                    <p class="text-sm text-gray-600">أصناف قد تكون بطيئة الحركة</p>
                </a>

                <a href="{{ route('inventory.reports.abc-analysis') }}" class="p-4 bg-white rounded-lg border border-gray-200 hover:border-green-500 hover:shadow-md transition-all duration-200 group">
                    <h4 class="font-semibold text-gray-900 group-hover:text-green-600 mb-2">تحليل ABC</h4>
                    <p class="text-sm text-gray-600">تصنيف الأصناف حسب الأهمية</p>
                </a>

                <a href="{{ route('inventory.reports.warehouse-efficiency') }}" class="p-4 bg-white rounded-lg border border-gray-200 hover:border-yellow-500 hover:shadow-md transition-all duration-200 group">
                    <h4 class="font-semibold text-gray-900 group-hover:text-yellow-600 mb-2">كفاءة المخزن</h4>
                    <p class="text-sm text-gray-600">قياس كفاءة استخدام المخزن</p>
                </a>

                <a href="{{ route('inventory.reports.turnover-rate') }}" class="p-4 bg-white rounded-lg border border-gray-200 hover:border-red-500 hover:shadow-md transition-all duration-200 group">
                    <h4 class="font-semibold text-gray-900 group-hover:text-red-600 mb-2">معدل الدوران</h4>
                    <p class="text-sm text-gray-600">حساب معدل دوران الأصناف</p>
                </a>

                <a href="{{ route('inventory.reports.variance-analysis') }}" class="p-4 bg-white rounded-lg border border-gray-200 hover:border-indigo-500 hover:shadow-md transition-all duration-200 group">
                    <h4 class="font-semibold text-gray-900 group-hover:text-indigo-600 mb-2">تحليل الانحرافات</h4>
                    <p class="text-sm text-gray-600">تحليل الفروقات عن المخطط</p>
                </a>

                <a href="{{ route('inventory.reports.storage-cost') }}" class="p-4 bg-white rounded-lg border border-gray-200 hover:border-purple-500 hover:shadow-md transition-all duration-200 group">
                    <h4 class="font-semibold text-gray-900 group-hover:text-purple-600 mb-2">تكاليف التخزين</h4>
                    <p class="text-sm text-gray-600">حساب تكاليف تخزين الأصناف</p>
                </a>

                <a href="{{ route('inventory.reports.waste-returns') }}" class="p-4 bg-white rounded-lg border border-gray-200 hover:border-pink-500 hover:shadow-md transition-all duration-200 group">
                    <h4 class="font-semibold text-gray-900 group-hover:text-pink-600 mb-2">النفايات والمرتجعات</h4>
                    <p class="text-sm text-gray-600">تقرير النفايات والمرتجعات</p>
                </a>

                <a href="{{ route('inventory.reports.trends-analysis') }}" class="p-4 bg-white rounded-lg border border-gray-200 hover:border-orange-500 hover:shadow-md transition-all duration-200 group">
                    <h4 class="font-semibold text-gray-900 group-hover:text-orange-600 mb-2">تحليل الاتجاهات</h4>
                    <p class="text-sm text-gray-600">تحليل اتجاهات المخزون</p>
                </a>
            </div>
        </div>
    </div>
</div>
@endsection
