<?php
/**
 * Enfhess Marketplace - Premium Admin Hub Visualization Engine
 * Path: admin/report-chart.php
 */
?>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
    <div class="glass-card p-6 rounded-2xl border border-slate-800 bg-slate-950/40">
        <h3 class="text-xs font-bold text-slate-500 uppercase mb-6">// Performance Breakdown</h3>
        <canvas id="mainChart" height="200"></canvas>
    </div>
    <div class="glass-card p-6 rounded-2xl border border-slate-800 bg-slate-950/40">
        <h3 class="text-xs font-bold text-slate-500 uppercase mb-6">// Liquidity Withdrawal Status</h3>
        <canvas id="withdrawChart" height="200"></canvas>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
    new Chart(document.getElementById('mainChart'), {
        type: 'bar',
        data: {
            labels: ['Sold', 'Revenue', 'Profit'],
            datasets: [{ 
                label: 'Metrics', 
                data: [<?=$stats['total_sold']?>, <?=$stats['total_revenue']?>, <?=$stats['total_profit']?>], 
                backgroundColor: ['#60a5fa', '#34d399', '#a855f7'] 
            }]
        }
    });
    
    new Chart(document.getElementById('withdrawChart'), {
        type: 'doughnut',
        data: { 
            labels: <?=json_encode(array_keys($withdrawQuery))?>, 
            datasets: [{ 
                data: <?=json_encode(array_values($withdrawQuery))?>, 
                backgroundColor: ['#fbbf24', '#22c55e', '#f43f5e'] 
            }] 
        }
    });
</script>