@extends('layouts.app')

@section('title', 'Demandes')
@section('page-title', 'Demandes')

@section('content')
<div class="space-y-4 sm:space-y-6">
    <!-- En-tête -->
    <div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
        <div class="min-w-0">
            <h1 class="text-xl sm:text-2xl font-bold text-gray-900 truncate">Demandes</h1>
            <p class="mt-1 text-sm text-gray-600">Gérez les demandes d'approvisionnement et de transfert</p>
        </div>
        <button class="w-full sm:w-auto inline-flex items-center justify-center px-4 py-2.5 sm:px-5 bg-blue-600 hover:bg-blue-700 text-white text-sm sm:text-base font-semibold rounded-lg shadow-sm hover:shadow-md transition-all flex-shrink-0">
            <svg class="w-5 h-5 mr-2 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
            </svg>
            Nouvelle demande
        </button>
    </div>

    <!-- Onglets de statut -->
    <div class="border-b border-gray-200 -mx-4 sm:mx-0 px-4 sm:px-0 overflow-x-auto">
        <nav class="-mb-px flex gap-4 sm:gap-8 min-w-max sm:min-w-0">
            <button class="border-b-2 border-blue-600 text-blue-600 py-3 sm:py-4 px-2 sm:px-3 text-xs sm:text-sm font-semibold whitespace-nowrap flex-shrink-0">
                Toutes
            </button>
            <button class="border-b-2 border-transparent text-gray-600 hover:text-gray-900 hover:border-gray-300 py-3 sm:py-4 px-2 sm:px-3 text-xs sm:text-sm font-medium transition-colors whitespace-nowrap flex-shrink-0">
                En attente
            </button>
            <button class="border-b-2 border-transparent text-gray-600 hover:text-gray-900 hover:border-gray-300 py-3 sm:py-4 px-2 sm:px-3 text-xs sm:text-sm font-medium transition-colors whitespace-nowrap flex-shrink-0">
                Validées
            </button>
            <button class="border-b-2 border-transparent text-gray-600 hover:text-gray-900 hover:border-gray-300 py-3 sm:py-4 px-2 sm:px-3 text-xs sm:text-sm font-medium transition-colors whitespace-nowrap flex-shrink-0">
                Rejetées
            </button>
        </nav>
    </div>

    <!-- Filtres -->
    <div class="bg-white shadow-sm border border-gray-200 rounded-xl p-3 sm:p-4">
        <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4">
            <div>
                <input type="text" placeholder="Rechercher..." class="w-full px-4 py-2.5 border border-gray-200 rounded-lg bg-white text-gray-900 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all">
            </div>
            <div>
                <select class="w-full px-4 py-2.5 border border-gray-200 rounded-lg bg-white text-gray-900 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all">
                    <option>Tous les départements</option>
                </select>
            </div>
            <div>
                <input type="date" class="w-full px-4 py-2.5 border border-gray-200 rounded-lg bg-white text-gray-900 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all">
            </div>
        </div>
    </div>

    <!-- Tableau des demandes -->
    <div class="bg-white shadow-sm border border-gray-200 rounded-xl overflow-hidden">
        <div class="table-responsive">
            <table class="min-w-full divide-y divide-gray-200">
                <thead class="bg-gray-50">
                    <tr>
                        <th class="px-6 py-4 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider">
                            N° Demande
                        </th>
                        <th class="px-6 py-4 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider">
                            Département
                        </th>
                        <th class="px-6 py-4 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider">
                            Date
                        </th>
                        <th class="px-6 py-4 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider">
                            Produits
                        </th>
                        <th class="px-6 py-4 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider">
                            Statut
                        </th>
                        <th class="px-6 py-4 text-right text-xs font-semibold text-gray-700 uppercase tracking-wider">
                            Actions
                        </th>
                    </tr>
                </thead>
                <tbody class="bg-white divide-y divide-gray-200">
                    <tr class="hover:bg-blue-50/50 transition-colors">
                        <td colspan="6" class="px-6 py-12 text-center">
                            <div class="flex flex-col items-center">
                                <svg class="w-16 h-16 text-gray-300 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
                                </svg>
                                <p class="text-sm font-medium text-gray-600 mb-1">Aucune demande enregistrée</p>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
@endsection
