<?php $__env->startSection('title', 'Devis'); ?>

<?php $__env->startSection('content'); ?>
<h1 class="text-2xl font-bold text-slate-800 mb-8">Demandes de devis</h1>

<?php if($devis->isEmpty()): ?>
<div class="bg-white rounded-xl p-12 text-center border border-slate-100">
    <p class="text-slate-500">Aucune demande de devis.</p>
</div>
<?php else: ?>
<div class="bg-white rounded-xl shadow-sm border border-slate-100 overflow-hidden">
    <table class="w-full">
        <thead class="bg-slate-50 border-b border-slate-200">
            <tr>
                <th class="text-left px-6 py-4 text-sm font-semibold text-slate-700">Nom</th>
                <th class="text-left px-6 py-4 text-sm font-semibold text-slate-700">Prestation</th>
                <th class="text-left px-6 py-4 text-sm font-semibold text-slate-700">Statut</th>
                <th class="text-left px-6 py-4 text-sm font-semibold text-slate-700">Date</th>
                <th class="text-right px-6 py-4 text-sm font-semibold text-slate-700">Actions</th>
            </tr>
        </thead>
        <tbody>
            <?php $__currentLoopData = $devis; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $devi): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr class="border-b border-slate-100 hover:bg-slate-50/50">
                <td class="px-6 py-4">
                    <a href="<?php echo e(route('dashboard.devis.show', $devi)); ?>" class="font-medium text-slate-800 hover:text-amber-600"><?php echo e($devi->nom); ?></a>
                </td>
                <td class="px-6 py-4 text-slate-600"><?php echo e($devi->type_prestation ?? '-'); ?></td>
                <td class="px-6 py-4">
                    <?php
                    $statutClasses = [
                    'en_attente' => 'bg-amber-100 text-amber-700',
                    'en_cours' => 'bg-blue-100 text-blue-700',
                    'accepte' => 'bg-green-100 text-green-700',
                    'refuse' => 'bg-red-100 text-red-700',
                    ];
                    ?>
                    <span class="text-xs px-2 py-1 rounded-full <?php echo e($statutClasses[$devi->statut] ?? 'bg-slate-100 text-slate-600'); ?>">
                        <?php echo e(ucfirst(str_replace('_', ' ', $devi->statut))); ?>

                    </span>
                </td>
                <td class="px-6 py-4 text-slate-500 text-sm"><?php echo e($devi->created_at->format('d/m/Y')); ?></td>
                <td class="px-6 py-4 text-right">
                    <div class="flex items-center justify-end gap-2">
                        <a href="<?php echo e(route('dashboard.devis.show', $devi)); ?>" class="inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-medium text-amber-600 hover:bg-amber-50 transition">
                            <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/>
                            </svg>
                            Voir
                        </a>
                        <form action="<?php echo e(route('dashboard.devis.destroy', $devi)); ?>" method="POST" class="inline" onsubmit="return confirm('Supprimer cette demande de devis ?')">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('DELETE'); ?>
                            <button type="submit" class="inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-medium text-red-600 hover:bg-red-50 transition">
                                <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
                                </svg>
                                Supprimer
                            </button>
                        </form>
                    </div>
                </td>
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody>
    </table>
</div>

<div class="mt-6">
    <?php echo e($devis->links()); ?>

</div>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.dashboard', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Softsys\emelec_2\resources\views/dashboard/devis/index.blade.php ENDPATH**/ ?>