<?php if (isset($component)) { $__componentOriginal91fdd17964e43374ae18c674f95cdaa3 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal91fdd17964e43374ae18c674f95cdaa3 = $attributes; } ?>
<?php $component = App\View\Components\AdminLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('admin-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AdminLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <div class="p-6">
        <div class="flex justify-between items-center mb-6">
            <h2 class="text-2xl font-bold text-white">عروض الأسعار</h2>
            <a href="<?php echo e(route('admin.quotations.create')); ?>"
               class="bg-amber-500 hover:bg-amber-600 text-black font-semibold py-2 px-4 rounded-lg transition">
                + عرض سعر جديد
            </a>
        </div>

        <?php if(session('success')): ?>
            <div class="bg-green-500/20 text-green-400 p-4 rounded-lg mb-4"><?php echo e(session('success')); ?></div>
        <?php endif; ?>

        <div class="bg-gray-800 rounded-xl overflow-hidden">
            <table class="w-full text-right">
                <thead class="bg-gray-700">
                    <tr>
                        <th class="p-4 text-gray-300">رقم العرض</th>
                        <th class="p-4 text-gray-300">العميل</th>
                        <th class="p-4 text-gray-300">المبلغ</th>
                        <th class="p-4 text-gray-300">الحالة</th>
                        <th class="p-4 text-gray-300">صالح حتى</th>
                        <th class="p-4 text-gray-300">إجراءات</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $quotations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $q): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr class="border-t border-gray-700 hover:bg-gray-750">
                            <td class="p-4 text-white font-mono"><?php echo e($q->quotation_number); ?></td>
                            <td class="p-4 text-gray-300"><?php echo e($q->customer?->name ?? '-'); ?></td>
                            <td class="p-4 text-amber-400 font-bold"><?php echo e(number_format($q->total_amount, 2)); ?> ج.م</td>
                            <td class="p-4">
                                <span class="px-3 py-1 rounded-full text-xs font-semibold
                                    <?php echo e($q->status === 'DRAFT' ? 'bg-gray-600 text-gray-300' : ''); ?>

                                    <?php echo e($q->status === 'SENT' ? 'bg-blue-500/20 text-blue-400' : ''); ?>

                                    <?php echo e($q->status === 'ACCEPTED' ? 'bg-green-500/20 text-green-400' : ''); ?>

                                    <?php echo e($q->status === 'CONVERTED' ? 'bg-amber-500/20 text-amber-400' : ''); ?>

                                    <?php echo e($q->status === 'EXPIRED' ? 'bg-red-500/20 text-red-400' : ''); ?>">
                                    <?php echo e($q->status); ?>

                                </span>
                            </td>
                            <td class="p-4 text-gray-400"><?php echo e($q->valid_until?->format('Y-m-d')); ?></td>
                            <td class="p-4 flex gap-2">
                                <a href="<?php echo e(route('admin.quotations.show', $q)); ?>" class="text-blue-400 hover:text-blue-300">عرض</a>
                                <?php if($q->status !== 'CONVERTED'): ?>
                                    <form action="<?php echo e(route('admin.quotations.convert', $q)); ?>" method="POST" class="inline">
                                        <?php echo csrf_field(); ?>
                                        <button type="submit" class="text-green-400 hover:text-green-300" onclick="return confirm('تحويل لفاتورة؟')">تحويل لفاتورة</button>
                                    </form>
                                <?php endif; ?>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="6" class="p-8 text-center text-gray-500">لا توجد عروض أسعار</td></tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>

        <div class="mt-4"><?php echo e($quotations->links()); ?></div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal91fdd17964e43374ae18c674f95cdaa3)): ?>
<?php $attributes = $__attributesOriginal91fdd17964e43374ae18c674f95cdaa3; ?>
<?php unset($__attributesOriginal91fdd17964e43374ae18c674f95cdaa3); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal91fdd17964e43374ae18c674f95cdaa3)): ?>
<?php $component = $__componentOriginal91fdd17964e43374ae18c674f95cdaa3; ?>
<?php unset($__componentOriginal91fdd17964e43374ae18c674f95cdaa3); ?>
<?php endif; ?>
<?php /**PATH C:\Users\shoko\OneDrive\Desktop\Elhamd-main\Elhamd-Laravel\resources\views/admin/quotations/index.blade.php ENDPATH**/ ?>