<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
    body { font-family: sans-serif; font-size: 12px; color:#333; }
    h1 { font-size: 18px; margin:0; } h3 { font-size:13px; border-bottom:1px solid #ccc; padding-bottom:4px; margin:14px 0 6px; }
    table { width:100%; border-collapse:collapse; margin-top:6px; }
    th,td { border:1px solid #ddd; padding:5px; text-align:left; }
    .meta td { border:none; padding:2px 8px 2px 0; }
    .right { text-align:right; }
</style>
</head>
<body>
    <h1>{{ __('vrc::lang.job_card') }} — {{ $ro->number }}</h1>
    <table class="meta">
        <tr><td><strong>{{ __('vrc::lang.customer') }}:</strong> {{ optional($customer)->name ?? '—' }}</td>
            <td><strong>{{ __('vrc::lang.status') }}:</strong> {{ __('vrc::lang.ro_status_'.$ro->status) }}</td></tr>
        <tr><td><strong>{{ __('vrc::lang.vehicle') }}:</strong> {{ optional($ro->vehicle)->label }}</td>
            <td><strong>{{ __('vrc::lang.odometer') }}:</strong> {{ $ro->odometer_in ?? '—' }}</td></tr>
    </table>

    @if($ro->customer_concerns)<h3>{{ __('vrc::lang.customer_concerns') }}</h3><p>{{ $ro->customer_concerns }}</p>@endif

    <h3>{{ __('vrc::lang.services') }}</h3>
    <table><thead><tr><th>{{ __('vrc::lang.service') }}</th><th>HSN/SAC</th><th>{{ __('vrc::lang.qty') }}</th><th>{{ __('vrc::lang.price') }}</th><th>{{ __('vrc::lang.line_total') }}</th></tr></thead>
        <tbody>@forelse($ro->services as $s)<tr><td>{{ $s->description }}</td><td>{{ $s->hsn_sac ?: '—' }}</td><td>{{ $s->qty }}</td><td>{{ $s->unit_price }}</td><td>{{ $s->line_total }}</td></tr>@empty<tr><td colspan="5">—</td></tr>@endforelse</tbody>
    </table>

    <h3>{{ __('vrc::lang.parts') }}</h3>
    <table><thead><tr><th>{{ __('vrc::lang.part') }}</th><th>{{ __('vrc::lang.qty') }}</th><th>{{ __('vrc::lang.price') }}</th><th>{{ __('vrc::lang.line_total') }}</th></tr></thead>
        <tbody>@forelse($ro->parts as $p)<tr><td>{{ $p->description }}</td><td>{{ $p->qty }}</td><td>{{ $p->unit_price }}</td><td>{{ $p->line_total }}</td></tr>@empty<tr><td colspan="4">—</td></tr>@endforelse</tbody>
    </table>

    <table style="width:40%; margin-left:60%; margin-top:10px;">
        <tr><td>{{ __('vrc::lang.subtotal') }}</td><td class="right">{{ $ro->subtotal }}</td></tr>
        <tr><td>{{ __('vrc::lang.tax') }}</td><td class="right">{{ $ro->tax_total }}</td></tr>
        <tr><td><strong>{{ __('vrc::lang.grand_total') }}</strong></td><td class="right"><strong>{{ $ro->grand_total }}</strong></td></tr>
    </table>

    <br><br>
    <table class="meta"><tr><td>{{ __('vrc::lang.customer') }}: ____________________</td><td>{{ __('vrc::lang.technician') }}: ____________________</td></tr></table>
</body>
</html>
