<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-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\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>

     <?php $__env->slot('header', null, []); ?> 

        <div class="flex flex-col md:flex-row md:items-center md:justify-between gap-4">

            <!-- Title -->
            <div>

                <h2 class="text-2xl font-bold text-slate-800">
                    Raw Materials
                </h2>

                <p class="text-slate-500 text-sm mt-1">
                    Manage all manufacturing raw materials
                </p>

            </div>

        </div>

     <?php $__env->endSlot(); ?>

    <!-- Main Card -->
    <div class="bg-white rounded-2xl shadow-sm border border-slate-200 overflow-hidden">

        <!-- Top Bar -->
        <div class="flex flex-col md:flex-row md:items-center md:justify-between gap-4 p-5 border-b bg-slate-50">

            <!-- Search -->
            <div class="relative w-full md:w-80">

                <input type="text"
                        value="<?php echo e(request('search')); ?>"
                       placeholder="Search material..."
                       class="w-full rounded-xl border border-slate-300 pl-11 pr-4 py-3 focus:border-blue-500 focus:ring-blue-500 shadow-sm">

                <i class="bi bi-search absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"></i>

            </div>

            <!-- Add Button -->
            <a href="<?php echo e(route('materials.create')); ?>"
               class="bg-blue-600 hover:bg-blue-700 text-white px-5 py-3 rounded-xl shadow-sm transition flex items-center justify-center gap-2 whitespace-nowrap">

                <i class="bi bi-plus-circle"></i>

                Add Material

            </a>

        </div>

        <!-- Table -->
        <div class="overflow-x-auto">

            <table class="w-full">

                <thead class="bg-slate-100">

                    <tr>

                        <th class="p-4 text-left font-semibold text-slate-700">
                            Name
                        </th>

                        <th class="p-4 text-left font-semibold text-slate-700">
                            Code
                        </th>

                        <th class="p-4 text-left font-semibold text-slate-700">
                            Unit
                        </th>

                        <th class="p-4 text-left font-semibold text-slate-700">
                            Price
                        </th>

                        <th class="p-4 text-left font-semibold text-slate-700">
                            Stock
                        </th>

                        <th class="p-4 text-center font-semibold text-slate-700">
                            Action
                        </th>

                    </tr>

                </thead>

                <tbody>

                    <?php $__currentLoopData = $materials; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $material): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                        <tr class="border-t hover:bg-slate-50 transition">

                            <!-- Name -->
                            <td class="p-4 font-medium text-slate-800">
                                <?php echo e($material->name); ?>

                            </td>

                            <!-- Code -->
                            <td class="p-4 text-slate-600">
                                <?php echo e($material->code); ?>

                            </td>

                            <!-- Unit -->
                            <td class="p-4">
                                <?php echo e($material->unit); ?>

                            </td>

                            <!-- Price -->
                            <td class="p-4 font-semibold text-green-600">
                                ₹ <?php echo e($material->price); ?>

                            </td>

                            <!-- Stock -->
                            <td class="p-4">
                                <?php echo e($material->stock); ?>

                            </td>

                            <!-- Actions -->
                            <td class="p-4">

                                <div class="flex flex-wrap justify-center gap-2">

                                    <!-- View -->
                                    <a href="<?php echo e(route('materials.show', $material->id)); ?>"
                                       class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg text-sm transition">

                                        View

                                    </a>

                                    <!-- Edit -->
                                    <a href="<?php echo e(route('materials.edit', $material->id)); ?>"
                                       class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-lg text-sm transition">

                                        Edit

                                    </a>

                                    <!-- Delete -->
                                    <form action="<?php echo e(route('materials.destroy', $material->id)); ?>"
                                          method="POST">

                                        <?php echo csrf_field(); ?>
                                        <?php echo method_field('DELETE'); ?>

                                        <button type="submit"
                                                onclick="return confirm('Delete this material?')"
                                                class="bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg text-sm transition">

                                            Delete

                                        </button>

                                    </form>

                                </div>

                            </td>

                        </tr>

                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                </tbody>

            </table>

        </div>

    </div>

 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?><?php /**PATH C:\xampp\htdocs\manufacturing-system\resources\views/materials/index.blade.php ENDPATH**/ ?>