<!DOCTYPE html>
<html lang="id" class="h-full bg-slate-100">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Verifikasi Invoice</title>
    <script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="min-h-full py-10 px-4">
    <div class="max-w-4xl mx-auto space-y-6">
        <div class="text-center">
            <p class="text-sm font-semibold uppercase tracking-[0.2em] text-slate-500">Verifikasi Dokumen</p>
            <h1 class="mt-3 text-3xl font-bold text-slate-900"><?php echo e($invoice->invoice_number ?: 'Draft #' . $invoice->id); ?></h1>
            <p class="mt-2 text-slate-500">Kode verifikasi: <?php echo e($invoice->verification_code); ?></p>
        </div>

        <div class="grid grid-cols-1 lg:grid-cols-3 gap-5">
            <div class="lg:col-span-2 bg-white rounded-3xl shadow-sm border border-slate-200 p-6 space-y-5">
                <div class="flex flex-wrap gap-2">
                    <span class="inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold <?php echo e($invoice->status === 'issued' ? 'bg-blue-100 text-blue-700' : ($invoice->status === 'cancelled' ? 'bg-rose-100 text-rose-700' : 'bg-amber-100 text-amber-700')); ?>"><?php echo e(ucfirst($invoice->status)); ?></span>
                    <span class="inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold <?php echo e($invoice->payment_status === 'paid' ? 'bg-emerald-100 text-emerald-700' : ($invoice->payment_status === 'partial' ? 'bg-sky-100 text-sky-700' : 'bg-amber-100 text-amber-700')); ?>"><?php echo e(ucfirst($invoice->payment_status)); ?></span>
                </div>

                <div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-sm">
                    <div class="rounded-2xl bg-slate-50 border border-slate-200 p-4">
                        <p class="text-xs font-semibold uppercase tracking-wide text-slate-400 mb-1">Pelanggan</p>
                        <p class="text-lg font-semibold text-slate-900"><?php echo e($invoice->customer->name); ?></p>
                        <p class="text-slate-500 mt-1"><?php echo e($invoice->customer->whatsapp ?: '-'); ?></p>
                    </div>
                    <div class="rounded-2xl bg-slate-50 border border-slate-200 p-4">
                        <p class="text-xs font-semibold uppercase tracking-wide text-slate-400 mb-1">Ringkasan</p>
                        <p class="text-slate-600">Tanggal: <?php echo e(optional($invoice->invoice_date)->format('d M Y') ?: '-'); ?></p>
                        <p class="text-slate-600">Diterbitkan oleh: <?php echo e($invoice->issuer?->name ?: '-'); ?></p>
                        <p class="text-slate-600">Sumber: <?php echo e(ucfirst($invoice->source_type)); ?></p>
                    </div>
                </div>

                <div class="rounded-2xl border border-slate-200 overflow-hidden">
                    <table class="w-full text-sm">
                        <thead class="bg-slate-50 text-left">
                            <tr>
                                <th class="px-4 py-3 font-semibold text-slate-500">Item</th>
                                <th class="px-4 py-3 font-semibold text-slate-500">Qty</th>
                                <th class="px-4 py-3 font-semibold text-slate-500 text-right">Total</th>
                            </tr>
                        </thead>
                        <tbody class="divide-y divide-slate-100">
                            <?php $__currentLoopData = $invoice->items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td class="px-4 py-3">
                                    <p class="font-medium text-slate-900"><?php echo e($item->description); ?></p>
                                    <p class="text-xs text-slate-400"><?php echo e(ucfirst(str_replace('_', ' ', $item->item_type))); ?></p>
                                </td>
                                <td class="px-4 py-3 text-slate-600"><?php echo e(rtrim(rtrim(number_format((float) $item->qty, 2, '.', ''), '0'), '.')); ?> <?php echo e($item->unit); ?></td>
                                <td class="px-4 py-3 text-right font-semibold text-slate-900">Rp <?php echo e(number_format((float) $item->line_total, 0, ',', '.')); ?></td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="bg-white rounded-3xl shadow-sm border border-slate-200 p-6">
                <p class="text-xs font-semibold uppercase tracking-wide text-slate-400">Nilai Invoice</p>
                <p class="mt-2 text-3xl font-bold text-slate-900">Rp <?php echo e(number_format((float) $invoice->grand_total, 0, ',', '.')); ?></p>
                <p class="mt-2 text-sm text-slate-500">Sisa tagihan: Rp <?php echo e(number_format((float) $invoice->balance_due, 0, ',', '.')); ?></p>
                <div class="mt-6 rounded-2xl bg-slate-50 border border-slate-200 p-4 text-sm text-slate-600">
                    Dokumen ini valid jika data pada halaman verifikasi sesuai dengan invoice yang Anda terima.
                </div>
            </div>
        </div>
    </div>
</body>
</html><?php /**PATH C:\laragon\www\Service-sistem\resources\views/invoices/verify.blade.php ENDPATH**/ ?>