<?php if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } $eRunning = ($engineStatus['running'] ?? false); $eUptime = isset($engineStatus['uptime']) ? htmlspecialchars($engineStatus['uptime']) : '&#x2014;'; $eBl = (int)($engineStatus['blacklist_count'] ?? 0); $eDdos = ($engineStatus['ddos_active'] ?? false); $eDns = htmlspecialchars($engineStatus['dns_mode'] ?? 'normal'); $eWd = (int)($engineStatus['watchdog_files'] ?? 0); $dotClass = $eRunning ? 'ok' : 'danger'; ?> <div class="glass" style="margin-bottom: 24px;">     <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;">         <div style="display: flex; align-items: center; gap: 12px;">             <div style="color: var(--accent-light);"><?= UI::renderIcon('settings') ?></div>             <h2 style="font-size: 16px; font-weight: 900; margin: 0; color: #fff;">Engine Control</h2>             <span class="badge badge-<?= $dotClass ?>" style="margin-left: 8px;">                 <?= $eRunning ? 'ONLINE' : 'OFFLINE' ?>             </span>         </div>         <div style="display: flex; gap: 8px;">             <button class="btn btn-sm" data-nc="engine-cmd" data-cmd="engine_health"><?= UI::renderIcon('intel', 'btn-icon') ?> Health Check</button>             <button class="btn btn-sm" data-nc="engine-cmd" data-cmd="engine_logs"><?= UI::renderIcon('logs', 'btn-icon') ?> View Logs</button>             <button class="btn btn-sm" data-nc="engine-cmd" data-cmd="engine_config"><?= UI::renderIcon('layout', 'btn-icon') ?> View Config</button>             <button class="btn btn-sm" style="color: var(--danger); border-color: rgba(255,0,127,0.3);" data-nc="engine-cmd" data-cmd="engine_restart"><?= UI::renderIcon('power', 'btn-icon') ?> Restart Engine</button>         </div>     </div>          <div style="display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;">         <div class="kpi-card" style="padding: 16px;">             <div class="kpi-label">UPTIME</div>             <div class="kpi-value" style="font-size: 20px;"><?= $eUptime ?></div>         </div>         <div class="kpi-card" style="padding: 16px;">             <div class="kpi-label">BLACKLIST</div>             <div class="kpi-value" style="font-size: 20px;"><?= $eBl ?></div>         </div>         <div class="kpi-card" style="padding: 16px;">             <div class="kpi-label">DDOS</div>             <div class="kpi-value" style="font-size: 20px; color: <?= $eDdos ? 'var(--danger)' : 'var(--text-bright)' ?>;"><?= $eDdos ? 'ACTIVE' : 'OFF' ?></div>         </div>         <div class="kpi-card" style="padding: 16px;">             <div class="kpi-label">DNS MODE</div>             <div class="kpi-value" style="font-size: 20px;"><?= strtoupper($eDns) ?></div>         </div>         <div class="kpi-card" style="padding: 16px;">             <div class="kpi-label">WATCHDOG FILES</div>             <div class="kpi-value" style="font-size: 20px;"><?= $eWd ?></div>         </div>     </div> </div>