<?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([]); ?>
    <div class="py-12 bg-gray-50 min-h-screen">
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-8">
            
            <!-- Header Section -->
            <div class="bg-white p-8 rounded-2xl border border-gray-100 shadow-sm flex flex-col md:flex-row justify-between items-start md:items-center gap-4">
                <div>
                    <h2 class="text-2xl font-black text-gray-800 uppercase tracking-tight">Informasi Stok Produk Jadi</h2>
                    <p class="text-[10px] font-black text-gray-400 uppercase tracking-widest mt-1">Daftar pemantauan stok produk siap jual.</p>
                </div>
                <a href="<?php echo e(route('stokproduk.export')); ?>" 
                   class="bg-green-700 text-white px-6 py-3 rounded-xl text-[10px] font-black uppercase tracking-widest hover:bg-green-800 transition-all shadow-lg shadow-green-200 active:scale-95">
                    Export Excel
                </a>
            </div>

            <!-- Main Table Card -->
            <div class="bg-white shadow-sm rounded-2xl border border-gray-100 overflow-hidden">
                <div class="overflow-x-auto">
                    <table class="w-full text-left">
                        <thead class="bg-gray-50 text-gray-400">
                            <tr>
                                <th class="px-8 py-4 text-[10px] font-black uppercase tracking-widest">Nama Produk</th>
                                <th class="px-4 py-4 text-[10px] font-black uppercase tracking-widest text-center">Stok di Rak</th>
                                <th class="px-4 py-4 text-[10px] font-black uppercase tracking-widest text-center">Sudah Dipesan</th>
                                <th class="px-4 py-4 text-[10px] font-black uppercase tracking-widest text-center">Sisa Siap Jual</th>
                            </tr>
                        </thead>
                        <tbody class="divide-y divide-gray-100">
                            <?php $__currentLoopData = $stokProduks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php $tersedia = $item->jumlah_stok - $item->jumlah_booked; ?>
                                <tr class="hover:bg-gray-50/50 transition-colors">
                                    <td class="px-8 py-5">
                                        <div class="font-black text-gray-800 text-sm"><?php echo e($item->produk->nama_produk); ?></div>
                                        <div class="text-[10px] font-black text-gray-400 uppercase tracking-widest mt-1"><?php echo e($item->produk->berat); ?> <?php echo e($item->produk->satuan); ?></div>
                                    </td>
                                    <td class="px-4 py-5 text-center font-black text-gray-700 text-sm">
                                        <?php echo e(number_format($item->jumlah_stok)); ?> pcs
                                    </td>
                                    <td class="px-4 py-5 text-center font-black text-orange-600 text-sm">
                                        <?php echo e(number_format($item->jumlah_booked)); ?> pcs
                                    </td>
                                    <td class="px-4 py-5 text-center">
                                        <span class="inline-block px-4 py-1.5 rounded-lg text-[10px] font-black uppercase tracking-widest border
                                            <?php echo e($tersedia <= 5 ? 'bg-red-50 text-red-600 border-red-100' : 'bg-green-50 text-green-600 border-green-100'); ?>">
                                            <?php echo e(number_format($tersedia)); ?> pcs
                                        </span>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>

                <!-- Glossary -->
                <div class="p-8 bg-gray-50 border-t border-gray-100 text-[10px] font-black text-gray-400 uppercase tracking-widest space-y-3">
                    <div class="flex items-start gap-3">
                        <span class="text-gray-700 w-24">Stok di Rak</span>
                        <span class="text-gray-500 font-medium lowercase italic">Jumlah total barang fisik yang tersedia di gudang.</span>
                    </div>
                    <div class="flex items-start gap-3">
                        <span class="text-gray-700 w-24">Sudah Dipesan</span>
                        <span class="text-gray-500 font-medium lowercase italic">Jumlah produk yang terikat pesanan pelanggan namun belum keluar gudang.</span>
                    </div>
                    <div class="flex items-start gap-3">
                        <span class="text-gray-700 w-24">Sisa Siap Jual</span>
                        <span class="text-gray-500 font-medium lowercase italic">Stok murni yang aman untuk transaksi pesanan baru.</span>
                    </div>
                </div>
            </div>
        </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 D:\TempeZhi\resources\views/staffgudang/stokproduk/index.blade.php ENDPATH**/ ?>