@php
    $accountLabel = !empty($foramin) ? 'Customer account' : 'Your account';
    $holder = trim(implode(' ', array_filter([
        $user->name ?? '',
        $user->middlename ?? '',
        $user->lastname ?? '',
    ])));
    if ($holder === '') {
        $holder = $user->name ?? '—';
    }
    $acctNum = $user->usernumber ?? $user->accountnumber ?? null;
    $acctType = $user->Accountype ?? $user->accounttype ?? null;
@endphp
<div class="transaction-details" style="margin: 24px 0; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);">
    <div class="transaction-details-header" style="background: linear-gradient(90deg, #1e1b4b 0%, #312e81 100%); color: #fff; padding: 12px 16px; font-weight: 600; font-size: 15px;">
        {{ $accountLabel }}
    </div>
    <div class="transaction-details-body" style="padding: 16px; background: #fafafa;">
        <div class="transaction-details-row" style="display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eef2f7;">
            <span class="transaction-details-label" style="color: #64748b; font-weight: 500;">Account holder</span>
            <span class="transaction-details-value" style="font-weight: 600; color: #0f172a; text-align: right; max-width: 58%;">{{ $holder }}</span>
        </div>
        @if($acctNum)
        <div class="transaction-details-row" style="display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eef2f7;">
            <span class="transaction-details-label" style="color: #64748b; font-weight: 500;">Account number</span>
            <span class="transaction-details-value" style="font-weight: 600; color: #0f172a; text-align: right; font-family: ui-monospace, monospace;">{{ $acctNum }}</span>
        </div>
        @endif
        <div class="transaction-details-row" style="display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eef2f7;">
            <span class="transaction-details-label" style="color: #64748b; font-weight: 500;">Email</span>
            <span class="transaction-details-value" style="font-weight: 600; color: #0f172a; text-align: right; max-width: 58%; word-break: break-all;">{{ $user->email ?? '—' }}</span>
        </div>
        @if($acctType)
        <div class="transaction-details-row" style="display: flex; justify-content: space-between; padding: 8px 0;">
            <span class="transaction-details-label" style="color: #64748b; font-weight: 500;">Account type</span>
            <span class="transaction-details-value" style="font-weight: 600; color: #0f172a; text-align: right;">{{ $acctType }}</span>
        </div>
        @endif
    </div>
</div>
