<!-- Right Column -->
<div class="col-12 col-lg-4 d-flex flex-column gap-4">
    <!-- Recent Transactions -->
    <div class="card shadow-sm border rounded-4 overflow-hidden">
        <div class="card-body p-0">

            
            <div class="d-flex justify-content-between align-items-center px-4 py-3 border-bottom">
                <h6 class="fw-bold mb-0">Recent Transactions</h6>
                <a href="<?php echo e(route('user.transaction.index')); ?>"
                    class="small text-primary text-decoration-none d-inline-flex align-items-center gap-1">
                    View All <i class="bi bi-arrow-right"></i>
                </a>
            </div>

            
            <ul class="list-group list-group-flush">
                <?php $__empty_1 = true; $__currentLoopData = $transactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $transaction): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <li class="list-group-item px-3 px-md-4 py-3">

                        <div class="d-flex align-items-start gap-3">

                            
                            <?php if($transaction->isDirectionCredit()): ?>
                                <div class="txn-icon txn-icon--credit flex-shrink-0">
                                    <i class="bi bi-arrow-down"></i>
                                </div>
                            <?php else: ?>
                                <div class="txn-icon txn-icon--debit flex-shrink-0">
                                    <i class="bi bi-arrow-up"></i>
                                </div>
                            <?php endif; ?>

                            
                            <div class="flex-grow-1 txn-min-w">

                                
                                <div class="d-flex justify-content-between align-items-start gap-2 flex-wrap">

                                    
                                    <p class="mb-0 fw-semibold txn-label text-truncate">
                                        <?php echo e($transaction->type->label()); ?>

                                    </p>

                                    
                                    <?php if($transaction->isDirectionCredit()): ?>
                                        <span class="fw-bold text-success txn-amount text-nowrap ms-auto">
                                            +<?php echo e(currency($user->currency)); ?><?php echo e(formatAmount($transaction->amount)); ?>

                                        </span>
                                    <?php else: ?>
                                        <span class="fw-bold text-danger txn-amount text-nowrap ms-auto">
                                            -<?php echo e(currency($user->currency)); ?><?php echo e(formatAmount($transaction->amount)); ?>

                                        </span>
                                    <?php endif; ?>

                                </div>

                                
                                <div class="d-flex justify-content-between align-items-center flex-wrap gap-1 mt-1">

                                    
                                    <div class="txn-min-w">
                                        <small class="text-muted d-block text-truncate txn-ref">
                                            Ref: <?php echo e($transaction->reference_id); ?>

                                        </small>
                                        <small class="text-muted txn-date">
                                            <?php echo e(date('M d, Y • h:i A', strtotime($transaction->transaction_at))); ?>

                                        </small>
                                    </div>

                                    
                                    <div class="flex-shrink-0">
                                        <?php if($transaction->isCompleted()): ?>
                                            <span
                                                class="badge bg-success-subtle text-success rounded-pill txn-badge">Completed</span>
                                        <?php elseif($transaction->isPending()): ?>
                                            <span
                                                class="badge bg-warning-subtle text-warning rounded-pill txn-badge">Pending</span>
                                        <?php elseif($transaction->isCancelled()): ?>
                                            <span
                                                class="badge bg-secondary-subtle text-secondary rounded-pill txn-badge">Cancelled</span>
                                        <?php else: ?>
                                            <span
                                                class="badge bg-danger-subtle text-danger rounded-pill txn-badge">Failed</span>
                                        <?php endif; ?>
                                    </div>

                                </div>
                            </div>

                        </div>
                    </li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <li class="list-group-item text-center text-muted py-5">
                        <i class="bi bi-inbox fs-3 d-block mb-2 opacity-25"></i>
                        No transactions yet
                    </li>
                <?php endif; ?>
            </ul>

        </div>
    </div>

    <style>
        .txn-icon {
            width: 38px;
            height: 38px;
            min-width: 38px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: .95rem;
            margin-top: 2px;
        }

        .txn-icon--credit {
            background: rgba(25, 135, 84, .12);
            color: #198754;
        }

        .txn-icon--debit {
            background: rgba(220, 53, 69, .12);
            color: #dc3545;
        }

        .txn-min-w {
            min-width: 0;
        }

        .txn-label {
            font-size: .88rem;
            max-width: 55%;
        }

        .txn-amount {
            font-size: .88rem;
            word-break: keep-all;
            letter-spacing: -.01em;
        }

        .txn-ref {
            font-size: .75rem;
            max-width: 220px;
        }

        .txn-date {
            font-size: .72rem;
        }

        .txn-badge {
            font-size: .65rem;
            white-space: nowrap;
        }

        /* On very small screens, shrink amount font slightly */
        @media (max-width: 380px) {
            .txn-amount {
                font-size: .78rem;
            }

            .txn-label {
                font-size: .80rem;
                max-width: 45%;
            }
        }
    </style>

</div>
<?php /**PATH C:\xampp\htdocs\projects\online-banking-v7.4-millray\resources\views/dashboard/user/partials/dashboard/recent_transaction.blade.php ENDPATH**/ ?>