<div class="container-fluid mb-4">
    <div class="row g-4">

        {{-- ── Welcome / Greeting (replaces Total Volume) ── --}}
        <div class="col-12 col-md-6 col-lg-3">
            <div class="card shadow-sm border rounded-3 h-100">
                <div class="card-body d-flex flex-column justify-content-between">
                    <div class="d-flex justify-content-between align-items-center mb-3">
                        <div class="d-flex align-items-center justify-content-center bg-info rounded p-2"
                            style="width:40px;height:40px;">
                            <span id="greeting-emoji" style="font-size:1.1rem;line-height:1;">☀️</span>
                        </div>
                        <span class="text-muted small fw-medium" id="greeting-period">Good Morning</span>
                    </div>
                    <div>
                        <h3 class="h5 fw-bold mb-1 text-truncate">
                            Hello, {{ $user->name }}!
                        </h3>
                        <p class="text-muted small mb-0" id="greeting-sub">Have a wonderful day.</p>
                    </div>
                </div>
            </div>
        </div>

        {{-- ── Available ── --}}
        <div class="col-12 col-md-6 col-lg-3">
            <div class="card shadow-sm border rounded-3 h-100">
                <div class="card-body">
                    <div class="d-flex justify-content-between align-items-center mb-3">
                        <div class="d-flex align-items-center justify-content-center bg-primary rounded p-2"
                            style="width:40px;height:40px;">
                            <i class="fa-solid fa-credit-card text-white"></i>
                        </div>
                        <span class="text-muted small fw-medium">Available</span>
                    </div>
                    <h3 class="h5 fw-bold mb-1">{{ currency($user->currency) }}{{ formatAmount($user->account_limit) }}
                    </h3>
                    <p class="text-muted small mb-0">Account Limit</p>
                </div>
            </div>
        </div>

        {{-- ── Monthly Deposits ── --}}
        <div class="col-12 col-md-6 col-lg-3">
            <div class="card shadow-sm border rounded-3 h-100">
                <div class="card-body">
                    <div class="d-flex justify-content-between align-items-center mb-3">
                        <div class="d-flex align-items-center justify-content-center bg-success rounded p-2"
                            style="width:40px;height:40px;">
                            <i class="fa-solid fa-arrow-down text-white"></i>
                        </div>
                        <span class="text-muted small fw-medium">This Month</span>
                    </div>
                    <h3 class="h5 fw-bold mb-1">{{ currency($user->currency) }}{{ formatAmount($monthlyDeposits) }}</h3>
                    <p class="text-muted small mb-0">Monthly Deposits</p>
                </div>
            </div>
        </div>

        {{-- ── Monthly Expenses ── --}}
        <div class="col-12 col-md-6 col-lg-3">
            <div class="card shadow-sm border rounded-3 h-100">
                <div class="card-body">
                    <div class="d-flex justify-content-between align-items-center mb-3">
                        <div class="d-flex align-items-center justify-content-center bg-danger rounded p-2"
                            style="width:40px;height:40px;">
                            <i class="fa-solid fa-arrow-up text-white"></i>
                        </div>
                        <span class="text-muted small fw-medium">This Month</span>
                    </div>
                    <h3 class="h5 fw-bold mb-1">{{ currency($user->currency) }}{{ formatAmount($monthlyExpenses) }}</h3>
                    <p class="text-muted small mb-0">Monthly Expenses</p>
                </div>
            </div>
        </div>

    </div>
</div>

<script>
    (function() {
        const hour = new Date().getHours();
        let emoji, period, sub;

        if (hour >= 5 && hour < 12) {
            emoji = '🌤️';
            period = 'Good Morning';
            sub = 'Have a wonderful day ahead.';
        } else if (hour >= 12 && hour < 17) {
            emoji = '☀️';
            period = 'Good Afternoon';
            sub = 'Hope your day is going well.';
        } else if (hour >= 17 && hour < 21) {
            emoji = '🌇';
            period = 'Good Evening';
            sub = 'Hope you had a great day.';
        } else {
            emoji = '🌙';
            period = 'Good Night';
            sub = 'Rest well and stay safe.';
        }

        document.getElementById('greeting-emoji').textContent = emoji;
        document.getElementById('greeting-period').textContent = period;
        document.getElementById('greeting-sub').textContent = sub;
    })();
</script>
