<!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($invoice->id); ?></title>
    <style>
        body {
            font-family: Arial, sans-serif;
            padding: 20px;
            max-width: 800px;
            margin: 0 auto;
        }
        .header {
            text-align: center;
            margin-bottom: 30px;
        }
        .info {
            margin-bottom: 20px;
        }
        .info table {
            width: 100%;
        }
        .items {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }
        .items th, .items td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: left;
        }
        .items th {
            background-color: #f5f5f5;
        }
        .total {
            text-align: right;
            font-size: 1.2em;
            font-weight: bold;
        }
        .print-btn {
            margin-bottom: 20px;
        }
        @media print {
            .print-btn {
                display: none;
            }
        }
    </style>
</head>
<body>
    <div class="print-btn">
        <button onclick="window.print()">Print</button>
        <button onclick="window.close()">Close</button>
    </div>
     <div class="invoice-box" style="max-width: 800px; margin: 0 auto; padding: 20px; border: 1px solid #eee; box-shadow: 0 0 10px rgba(0,0,0,0.15); font-size: 14px; line-height: 1.5; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background: #fff; margin-bottom: 30px; page-break-after: always;">

            <!-- Header -->
            <div style="text-align: center; margin-bottom: 30px;">
                <h1 style="margin: 0; font-size: 32px; font-weight: bold;">STARUP MIND</h1>
                <p style="margin: 5px 0 0; font-size: 16px;">Your Trusted Technology Partner</p>
            </div>

    <div class="header">
        <h1>INVOICE</h1>
        <p>Invoice #<?php echo e($invoice->id); ?></p>
    </div>

    <div class="info">
        <table>
            <tr>
                <td>
                    <strong>Customer:</strong> <?php echo e($invoice->customer->name ?? '-'); ?><br>
                    <?php if($invoice->customer->email): ?>
                        <?php echo e($invoice->customer->email); ?><br>
                    <?php endif; ?>
                    <?php if($invoice->customer->phone): ?>
                        <?php echo e($invoice->customer->phone); ?>

                    <?php endif; ?>
                </td>
                <td style="text-align: right;">
                    <strong>Invoice Date:</strong> <?php echo e($invoice->date->format('M d, Y')); ?><br>
                    <?php if($invoice->due_date): ?>
                        <strong>Due Date:</strong> <?php echo e($invoice->due_date->format('M d, Y')); ?><br>
                    <?php endif; ?>
                    <strong>Status:</strong> <?php echo e(ucfirst($invoice->status)); ?>

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

    <table class="items">
        <thead>
            <tr>
                 <th><?php echo e($invoice->items->first()?->service_id ? 'Service' : 'Product'); ?></th>
                <th>Quantity</th>
                <th>Unit Price</th>
                <th>Subtotal</th>
            </tr>
        </thead>
        <tbody>
            <?php $__empty_1 = true; $__currentLoopData = $invoice->items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td><?php echo e($item->service?->name ?? $item->product?->name ?? '-'); ?></td>
                    <td><?php echo e($item->quantity); ?></td>
                    <td><?php echo e(number_format($item->unit_price, 2)); ?></td>
                   <td><?php echo e(number_format($item->total, 2)); ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="4" style="text-align: center;">No items found.</td>
                </tr>
            <?php endif; ?>
        </tbody>
    </table>

    <div class="total">
        <p>Total: <?php echo e(number_format($invoice->total, 2)); ?></p>
    </div>

    <?php if($invoice->notes): ?>
        <div style="margin-top: 30px;">
            <strong>Notes:</strong>
            <p><?php echo e($invoice->notes); ?></p>
        </div>
    <?php endif; ?>
</body>
</html>
<?php /**PATH C:\Users\startup sabbir\Desktop\jannat\sarvice-accounts\accounting-system\resources\views/invoices/print.blade.php ENDPATH**/ ?>