<?php
 
$diskFree = (int) ($data['disk_free'] ?? 0);
$diskTotal = (int) ($data['disk_total'] ?? 0);
$diskPct = $diskTotal > 0 ? round($diskFree / $diskTotal * 100) : 0;
$diskUsedPct = 100 - $diskPct;
$diskColor = $diskPct < 10 ? 'red' : ($diskPct < 25 ? 'amber' : 'green');
?>
<div class="space-y-3">
    <div class="grid grid-cols-2 gap-3">
        <div class="p-2.5 rounded-lg bg-gray-50">
            <div class="text-[10px] text-gray-400 uppercase tracking-wider mb-0.5">CMS Version</div>
            <div class="text-sm font-semibold text-gray-800"><?= htmlspecialchars($data['cms_version'] ?? '1.0.0') ?></div>
        </div>
        <div class="p-2.5 rounded-lg bg-gray-50">
            <div class="text-[10px] text-gray-400 uppercase tracking-wider mb-0.5">PHP</div>
            <div class="text-sm font-semibold text-gray-800"><?= htmlspecialchars($data['php_version'] ?? '-') ?></div>
        </div>
        <div class="p-2.5 rounded-lg bg-gray-50">
            <div class="text-[10px] text-gray-400 uppercase tracking-wider mb-0.5">MySQL</div>
            <div class="text-sm font-semibold text-gray-800"><?= htmlspecialchars($data['mysql_version'] ?? '-') ?></div>
        </div>
        <div class="p-2.5 rounded-lg bg-gray-50">
            <div class="text-[10px] text-gray-400 uppercase tracking-wider mb-0.5">Database Size</div>
            <div class="text-sm font-semibold text-gray-800"><?= number_format($data['db_size_mb'] ?? 0, 1) ?> MB</div>
        </div>
    </div>

    
    <div>
        <div class="flex items-center justify-between mb-1">
            <span class="text-[10px] text-gray-400 uppercase tracking-wider">Disk Space</span>
            <span class="text-[10px] text-gray-500"><?= Format::fileSize($diskFree) ?> free of <?= Format::fileSize($diskTotal) ?></span>
        </div>
        <div class="w-full bg-gray-100 rounded-full h-2">
            <div class="bg-<?= $diskColor ?>-500 h-2 rounded-full transition-all" style="width: <?= min(100, $diskUsedPct) ?>%"></div>
        </div>
        <div class="text-right mt-0.5">
            <span class="text-[10px] text-<?= $diskColor ?>-600 font-medium"><?= $diskUsedPct ?>% used</span>
        </div>
    </div>

    <div class="p-2.5 rounded-lg bg-gray-50">
        <div class="text-[10px] text-gray-400 uppercase tracking-wider mb-0.5">Server</div>
        <div class="text-xs text-gray-600 truncate"><?= htmlspecialchars($data['server'] ?? '-') ?></div>
    </div>
</div>
