<!DOCTYPE html>
<html>
<head>
    <title>{{ $return->return_number }} - Print</title>
    <style>
        body { font-family: Arial, sans-serif; font-size: 12px; margin: 20px; }
        .header { text-align: center; margin-bottom: 20px; border-bottom: 2px solid #333; padding-bottom: 10px; }
        .items-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
        .items-table th, .items-table td { border: 1px solid #ddd; padding: 6px 8px; }
        .items-table th { background-color: #f5f5f5; }
        .footer { margin-top: 60px; display: flex; justify-content: space-between; }
        .signature { width: 30%; text-align: center; border-top: 1px solid #333; padding-top: 5px; }
    </style>
</head>
<body onload="window.print()">
    <div class="header"><h2>Asset Return</h2><p>{{ $return->return_number }}</p></div>
    <table style="width:100%;margin-bottom:15px;">
        <tr><td><strong>Project:</strong> {{ $return->project ? $return->project->project_name : '-' }}</td><td><strong>Return Date:</strong> {{ $return->return_date ? $return->return_date->format('M d, Y') : '-' }}</td></tr>
        <tr><td><strong>Returned By:</strong> {{ $return->returnedBy ? $return->returnedBy->name : '-' }}</td><td><strong>Status:</strong> {{ ucfirst($return->status) }}</td></tr>
    </table>
    <table class="items-table">
        <thead><tr><th>#</th><th>Asset Code</th><th>Asset Name</th><th>Condition</th><th>Notes</th></tr></thead>
        <tbody>
            @foreach($return->items as $i => $item)
            <tr>
                <td>{{ $i+1 }}</td>
                <td>{{ $item->fixedAsset ? $item->fixedAsset->asset_code : '-' }}</td>
                <td>{{ $item->fixedAsset ? $item->fixedAsset->asset_name : '-' }}</td>
                <td>{{ ucfirst($item->condition_on_return ?? '-') }}</td>
                <td>{{ $item->condition_notes ?? '-' }}</td>
            </tr>
            @endforeach
        </tbody>
    </table>
    <div class="footer" style="display:flex;justify-content:space-between;"><div class="signature">Returned By</div><div class="signature">Inspected By</div><div class="signature">Warehouse Manager</div></div>
</body>
</html>
