<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Invoice #<?php echo e($order->order_number); ?></title>
    <style>
        /* CSS KHUSUS PDF (DOMPDF) */
        body {
            font-family: 'Helvetica', 'Arial', sans-serif;
            line-height: 1.6;
            color: #334155;
            margin: 0;
            padding: 0;
        }
        .invoice-box {
            max-width: 800px;
            margin: auto;
            padding: 30px;
            background: #fff;
        }
        .header-table {
            width: 100%;
            margin-bottom: 40px;
        }
        .logo {
            font-size: 28px;
            font-weight: 900;
            color: #2563eb;
            text-transform: uppercase;
            font-style: italic;
        }
        .invoice-title {
            text-align: right;
            font-size: 24px;
            font-weight: bold;
            color: #1e293b;
        }
        .info-table {
            width: 100%;
            margin-bottom: 30px;
        }
        .info-td {
            width: 50%;
            vertical-align: top;
        }
        .label {
            font-size: 10px;
            text-transform: uppercase;
            color: #64748b;
            font-weight: bold;
            margin-bottom: 5px;
        }
        .content {
            font-size: 13px;
            font-weight: bold;
        }
        .status-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 10px;
            background: #dcfce7;
            color: #166534;
            text-transform: uppercase;
        }
        .items-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }
        .items-table th {
            background: #f1f5f9;
            color: #475569;
            text-transform: uppercase;
            font-size: 11px;
            padding: 12px;
            text-align: left;
            border-bottom: 2px solid #e2e8f0;
        }
        .items-table td {
            padding: 15px 12px;
            border-bottom: 1px solid #f1f5f9;
            font-size: 12px;
        }
        .total-section {
            margin-top: 30px;
            width: 100%;
        }
        .total-table {
            width: 300px;
            float: right;
        }
        .total-row td {
            padding: 8px 0;
            font-size: 13px;
        }
        .grand-total {
            font-size: 18px;
            font-weight: 900;
            color: #2563eb;
            border-top: 2px solid #e2e8f0;
            padding-top: 10px !important;
        }
        .footer {
            margin-top: 80px;
            text-align: center;
            font-size: 11px;
            color: #94a3b8;
            border-top: 1px solid #f1f5f9;
            padding-top: 20px;
        }
    </style>
</head>
<body>
    <div class="invoice-box">
        <table class="header-table">
            <tr>
                <td class="logo">Loka<span style="color: #1e293b;">Furniture</span></td>
                <td class="invoice-title">INVOICE</td>
            </tr>
        </table>

        <table class="info-table">
            <tr>
                <td class="info-td">
                    <div class="label">Diterbitkan Untuk:</div>
                    <div class="content" style="font-size: 16px; color: #2563eb;"><?php echo e($order->customer->name ?? 'Pelanggan'); ?></div>
                    <div class="content" style="font-weight: normal; margin-top: 5px; color: #64748b;">
                        <?php echo e($order->shipping_address); ?>

                    </div>
                </td>
                <td class="info-td" style="text-align: right;">
                    <div class="label">Nomor Order:</div>
                    <div class="content" style="margin-bottom: 8px;">#<?php echo e($order->order_number); ?></div>
                    
                    <div class="label">Tanggal Transaksi:</div>
                    <div class="content" style="margin-bottom: 8px;">
                        <?php echo e($order->created_at->timezone('Asia/Jakarta')->format('d M Y, H:i')); ?>

                    </div>

                    <div class="label">Metode Pembayaran:</div>
                    <div class="content" style="color: #1e293b; text-transform: uppercase;">
                        <?php echo e(str_replace('_', ' ', $order->payment_method ?? 'Transfer Bank')); ?>

                    </div>
                </td>
            </tr>
        </table>

        <table class="items-table">
            <thead>
                <tr>
                    <th>Deskripsi Produk</th>
                    <th style="text-align: center;">Qty</th>
                    <th style="text-align: right;">Harga Satuan</th>
                    <th style="text-align: right;">Subtotal</th>
                </tr>
            </thead>
            <tbody>
                <?php $__currentLoopData = $order->items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td>
                        <div style="font-weight: bold; text-transform: uppercase;"><?php echo e($item->product->name); ?></div>
                        <?php if($item->variant): ?>
                        <div style="font-size: 10px; color: #64748b;">Varian: <?php echo e($item->variant->color); ?></div>
                        <?php endif; ?>
                    </td>
                    <td style="text-align: center;"><?php echo e($item->quantity); ?></td>
                    <td style="text-align: right;">Rp <?php echo e(number_format($item->price, 0, ',', '.')); ?></td>
                    <td style="text-align: right; font-weight: bold;">Rp <?php echo e(number_format($item->price * $item->quantity, 0, ',', '.')); ?></td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>

        <div class="total-section">
            <table class="total-table">
                <tr class="total-row">
                    <td style="color: #64748b;">Subtotal Produk</td>
                    <td style="text-align: right; font-weight: bold;">Rp <?php echo e(number_format($order->total_price - $order->shipping_cost, 0, ',', '.')); ?></td>
                </tr>
                <tr class="total-row">
                    <td style="color: #64748b;">Ongkos Kirim</td>
                    <td style="text-align: right; font-weight: bold;">Rp <?php echo e(number_format($order->shipping_cost, 0, ',', '.')); ?></td>
                </tr>
                <tr class="total-row">
                    <td class="grand-total">TOTAL BAYAR</td>
                    <td class="grand-total" style="text-align: right;">Rp <?php echo e(number_format($order->total_price, 0, ',', '.')); ?></td>
                </tr>
            </table>
            <div style="clear: both;"></div>
        </div>

        <div style="margin-top: 20px;">
            <div class="label">Status Pembayaran:</div>
            <div class="status-badge"><?php echo e($order->status == 'unpaid' ? 'Menunggu Pembayaran' : 'Lunas'); ?></div>
        </div>

        <div class="footer">
            <p>Invoice ini sah dan diproses oleh komputer.<br>Silakan simpan invoice ini sebagai bukti pembelian yang sah.</p>
            <strong>Terima Kasih Telah Memilih LokaFurniture!</strong>
        </div>
    </div>
</body>
</html><?php /**PATH C:\laragon\www\LokaPustaka\resources\views/orders/invoice.blade.php ENDPATH**/ ?>