@php
    use Morilog\Jalali\Jalalian;
@endphp
<div style="font-size:.875rem;">
    <div style="margin-bottom:10px; color:#475569;">
        زمان: {{ \App\Support\NumberToWords::digits(Jalalian::fromCarbon($record->created_at)->format('Y/m/d H:i')) }}
        @if($record->description) — {{ $record->description }} @endif
    </div>

    @if(empty($changes))
        <div style="color:#94a3b8;">جزئیات تغییری ثبت نشده است.</div>
    @else
        <table style="width:100%; border-collapse:collapse;">
            <thead>
                <tr style="background:#f1f5f9; text-align:right;">
                    <th style="padding:6px 10px; border:1px solid #e5e7eb;">فیلد</th>
                    <th style="padding:6px 10px; border:1px solid #e5e7eb;">مقدار قبلی</th>
                    <th style="padding:6px 10px; border:1px solid #e5e7eb;">مقدار جدید</th>
                </tr>
            </thead>
            <tbody>
                @foreach($changes as $row)
                    <tr>
                        <td style="padding:6px 10px; border:1px solid #e5e7eb; font-weight:600;">{{ $row['field'] }}</td>
                        <td style="padding:6px 10px; border:1px solid #e5e7eb; color:#b91c1c;">{{ $row['old'] }}</td>
                        <td style="padding:6px 10px; border:1px solid #e5e7eb; color:#15803d;">{{ $row['new'] }}</td>
                    </tr>
                @endforeach
            </tbody>
        </table>
    @endif
</div>
