<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Import Transit Report</title>
    <style>
        body {
            font-family: 'Segoe UI', Arial, sans-serif;
            background-color: #f9fafb;
            color: #333;
            margin: 0;
            padding: 0;
        }
        h2 {
            color: #215c98;
            text-align: center;
            margin-bottom: 20px;
        }
        table {
            border-collapse: collapse;
            width: 100%;
            font-size: 14px;
            white-space: nowrap !important;
        }
        th, td {
            border: 1px solid #020813da;
            padding: 8px 10px;
            text-align: center;
            white-space: nowrap !important;
            text-overflow: ellipsis;
        }
        .td-left {
            text-align: left !important;
        }
        th {
            background-color: #215c98;
            color: #fff;
            white-space: nowrap !important;
        }
        tr:nth-child(even) {
            background-color: #f3f4f6;
        }

        .footer {
            text-align: center;
            font-size: 13px;
            color: #6b7280;
            margin-top: 30px;
        }
    </style>
</head>
<body>
    <div style="text-align: center; font-weight: bold;">
        {{ $company }}
    </div>
    <br>
    <p>{!! $greeting !!}</p>
    <div class="container">
        @if(empty($tableData))
            <p style="text-align:center;">No invoice in transit data available.</p>
        @else
            <table>
                <thead>
                    <tr>
                        <th>No</th>
                        <th>CRI RFQ Number</th>
                        <th>Mail Received Date</th>
                        <th>Pricol Ref Number</th>
                        <th>Requestor</th>
                        <th>Shipper</th>
                        <th>Shipper Location</th>
                        <th>Shipper Invoice</th>
                        <th>Shipper Invoice Date</th>
                        <th>Custom Agent Name</th>
                        <th>ETA Date</th>
                        <th>Status</th>
                        <th>Delivery Location</th>
                        <th>ETD Date</th>
                        <th>Mode</th>
                        <th>Inco Terms</th>
                        <th>Port Of Loading</th>
                        <th>Port Of Discharge</th>
                        <th>Delivery City</th>
                        <th>Packages</th>
                        <th>Type of package</th>
                        <th>Gross Weight</th>
                        <th>Volume</th>
                        <th>Bill Number</th>
                        <th>Bill Received Date</th>
                        <th>Vessel Number</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach ($tableData as $row)
                    <tr>
                        <td>{{ $loop->iteration }}</td>
                        <td>{{ $row['cri_rfq_number'] }}</td>
                        <td>{{ $row['mail_received_date'] }}</td>
                        <td>{{ $row['pricol_ref_number'] }}</td>
                        <td>{{ $row['requester'] }}</td>
                        <td>{{ $row['shipper'] }}</td>
                        <td>{{ $row['shipper_location'] }}</td>
                        <td>{{ $row['shipper_invoice'] }}</td>
                        <td>{{ $row['shipper_invoice_date'] }}</td>
                        <td>{{ $row['customs_agent_name'] }}</td>
                        <td>{{ $row['eta_date'] }}</td>
                        <td>{{ $row['status'] }}</td>
                        <td>{{ $row['delivery_location'] }}</td>
                        <td>{{ $row['etd_date'] }}</td>
                        <td>{{ $row['mode'] }}</td>
                        <td>{{ $row['inco_terms'] }}</td>
                        <td>{{ $row['port_of_loading'] }}</td>
                        <td>{{ $row['port_of_discharge'] }}</td>
                        <td>{{ $row['delivery_city'] }}</td>
                        <td>{{ $row['packages'] }}</td>
                        <td>{{ $row['type_of_package'] }}</td>
                        <td>{{ $row['gross_weight'] }}</td>
                        <td>{{ $row['volume'] }}</td>
                        <td>{{ $row['bill_number'] }}</td>
                        <td>{{ $row['bill_received_date'] }}</td>
                        <td>{{ $row['vessel_number'] }}</td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        @endif
        <p>{!! $wishes !!}</p>
    </div>
</body>
</html>
