

<?php $__env->startSection('content'); ?>
<div class="py-12 bg-gray-50 min-h-screen">
    <div class="max-w-4xl mx-auto sm:px-6 lg:px-8 space-y-8">
        
        <!-- Header Section -->
        <div class="flex flex-col gap-2">
            <a href="<?php echo e(route('staffproduksi.produksi.index')); ?>" class="text-[10px] font-black text-green-700 uppercase tracking-widest hover:text-green-900 flex items-center gap-2">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18" />
                </svg>
                Kembali ke Rekap
            </a>
            <div class="bg-white p-8 rounded-2xl border border-gray-100 shadow-sm">
                <h2 class="text-2xl font-black text-gray-800 uppercase tracking-tight">Edit Produksi</h2>
                <p class="text-[10px] font-black text-gray-400 uppercase tracking-widest mt-1">
                    Mengubah data produksi tanggal: <?php echo e(\Carbon\Carbon::parse($tanggal)->translatedFormat('d M Y')); ?>

                </p>
            </div>
        </div>

        <?php if($errors->any()): ?>
            <div class="p-6 bg-red-50 border border-red-100 rounded-2xl text-red-600">
                <p class="text-xs font-black uppercase tracking-widest mb-2">Terjadi Kesalahan:</p>
                <ul class="list-disc list-inside text-[10px] font-bold">
                    <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li><?php echo e($error); ?></li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
            </div>
        <?php endif; ?>

        <form action="<?php echo e(route('staffproduksi.produksi.update', $tanggal)); ?>" method="POST">
            <?php echo csrf_field(); ?>
            <?php echo method_field('PUT'); ?>
            
            <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
                
                <!-- Sidebar Info -->
                <div class="lg:col-span-1">
                    <div class="bg-white p-8 rounded-2xl shadow-sm border border-gray-100 sticky top-8">
                        <label class="block text-[10px] font-black text-gray-400 uppercase tracking-widest mb-4">Tanggal Produksi</label>
                        <input type="date" value="<?php echo e($tanggal); ?>" readonly
                               class="w-full bg-gray-50 border-gray-200 rounded-xl px-4 py-3 text-sm font-black text-gray-400 cursor-not-allowed">
                        <p class="mt-6 text-[10px] font-medium text-gray-400 leading-relaxed uppercase tracking-widest">
                            Tanggal tidak dapat diubah. Hapus data jika tanggal salah.
                        </p>
                    </div>
                </div>

                <!-- Main Form -->
                <div class="lg:col-span-2">
                    <div class="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden">
                        <div class="p-8 border-b border-gray-100 bg-gray-50/50 flex justify-between items-center">
                            <h3 class="text-sm font-black text-gray-800 uppercase tracking-widest">Penyesuaian Jumlah</h3>
                            <span class="text-[8px] font-black text-green-700 bg-green-50 px-3 py-1 rounded-full uppercase tracking-widest">Mode Edit</span>
                        </div>
                        
                        <div class="divide-y divide-gray-100">
                            <?php $__currentLoopData = $daftarProduk; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $produk): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php $existing = $dataExisting->where('produk_id', $produk->id)->first(); ?>
                                <div class="p-8 flex items-center justify-between gap-4">
                                    <div>
                                        <h4 class="font-black text-gray-800 text-sm"><?php echo e($produk->nama_produk); ?></h4>
                                        <p class="text-[10px] font-black text-gray-400 uppercase tracking-widest mt-1"><?php echo e($produk->berat); ?> <?php echo e($produk->satuan); ?></p>
                                        <input type="hidden" name="produksi[<?php echo e($index); ?>][produk_id]" value="<?php echo e($produk->id); ?>">
                                    </div>

                                    <div class="w-32">
                                        <input type="number" name="produksi[<?php echo e($index); ?>][jumlah_produksi]" min="0" 
                                               value="<?php echo e(old('produksi.'.$index.'.jumlah_produksi', $existing ? $existing->jumlah_produksi : 0)); ?>"
                                               class="w-full border-gray-200 rounded-xl px-4 py-3 text-right font-black text-sm text-green-700 focus:border-green-700 focus:ring-green-700">
                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>

                        <div class="p-8 bg-gray-50 border-t border-gray-100 flex justify-end gap-3">
                            <a href="<?php echo e(route('staffproduksi.produksi.index')); ?>" class="px-6 py-3 text-[10px] font-black text-gray-400 uppercase tracking-widest hover:text-gray-700 transition-all">
                                Batal
                            </a>
                            <button type="submit" class="px-8 py-3 bg-green-700 text-white rounded-xl text-[10px] font-black uppercase tracking-widest hover:bg-green-800 shadow-lg shadow-green-200 transition-all">
                                Simpan Perubahan
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\TempeZhi\resources\views/staffproduksi/produksi/edit.blade.php ENDPATH**/ ?>