<?php
$page_title = 'Enterprise Governance';
require_once __DIR__ . '/../config.php';
if (session_status() === PHP_SESSION_NONE) { session_start(); }
if (!isset($_SESSION['admin_id'])) { redirect(SITE_URL . '/admin/login.php'); }
require_once __DIR__ . '/header.php';
?>
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:24px;">
    <div>
        <h2 style="font-family:'Outfit',sans-serif; font-size:1.8rem; color:#0f172a; margin:0;"><i class="fas fa-landmark" style="color:#3b82f6; margin-right:10px;"></i>Enterprise Governance</h2>
        <p style="color:#64748b; font-size:0.95rem; margin-top:5px;">Policy engine, decision register, ethics hotline, approval governance, audit automation.</p>
    </div>
</div>
<div class="grid-4" style="margin-bottom:24px;">
    <div style="background:#fff; padding:20px; border-radius:12px; border:1px solid #e2e8f0; border-top:4px solid #3b82f6;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">ACTIVE POLICIES</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">86</div>
        <div style="color:#3b82f6; font-size:0.8rem; margin-top:5px;"><i class="fas fa-file-alt"></i> All Departments</div>
    </div>
    <div style="background:#fff; padding:20px; border-radius:12px; border:1px solid #e2e8f0; border-top:4px solid #10b981;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">DECISIONS LOGGED</div>
        <div style="font-size:1.6rem; font-weight:700; color:#10b981;">1,240</div>
        <div style="color:#10b981; font-size:0.8rem; margin-top:5px;"><i class="fas fa-gavel"></i> Full Audit Trail</div>
    </div>
    <div style="background:#fff; padding:20px; border-radius:12px; border:1px solid #e2e8f0; border-top:4px solid #f59e0b;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">ETHICS REPORTS</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">12</div>
        <div style="color:#f59e0b; font-size:0.8rem; margin-top:5px;"><i class="fas fa-phone-alt"></i> Hotline Active</div>
    </div>
    <div style="background:#fff; padding:20px; border-radius:12px; border:1px solid #e2e8f0; border-top:4px solid #8b5cf6;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">AUDITS COMPLETED</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">24</div>
        <div style="color:#8b5cf6; font-size:0.8rem; margin-top:5px;"><i class="fas fa-clipboard-check"></i> This Quarter</div>
    </div>
</div>
<div class="grid-2">
    <div style="background:#fff; padding:20px; border-radius:12px; border:1px solid #e2e8f0;">
        <h3 style="margin:0 0 15px; font-size:1.15rem; color:#0f172a;"><i class="fas fa-balance-scale" style="color:#3b82f6; margin-right:8px;"></i>Governance Framework</h3>
        <?php
        $items = [
            ['Policy Engine', '86 policies · Auto-version controlled', '#3b82f6', 'fas fa-file-alt'],
            ['Decision Register', '1,240 decisions logged with rationale', '#10b981', 'fas fa-gavel'],
            ['Ethics Hotline', '12 reports · Anonymous submissions', '#f59e0b', 'fas fa-phone-alt'],
            ['Approval Governance', '42 approval matrices active', '#8b5cf6', 'fas fa-check-double'],
            ['Audit Automation', '24 completed · 8 scheduled', '#ec4899', 'fas fa-clipboard-check'],
        ];
        foreach ($items as $i): ?>
        <div style="border:1px solid #e2e8f0; border-radius:8px; padding:12px 15px; margin-bottom:8px; display:flex; align-items:center; gap:15px;">
            <div style="width:40px; height:40px; border-radius:8px; background:<?= $i[2] ?>15; display:flex; align-items:center; justify-content:center; flex-shrink:0;">
                <i class="<?= $i[3] ?>" style="color:<?= $i[2] ?>;"></i>
            </div>
            <div>
                <div style="font-weight:600; font-size:0.9rem;"><?= $i[0] ?></div>
                <div style="font-size:0.75rem; color:#94a3b8;"><?= $i[1] ?></div>
            </div>
        </div>
        <?php endforeach; ?>
    </div>
    <div style="background:linear-gradient(135deg,#3b82f6,#2563eb); color:#fff; padding:25px; border-radius:12px;">
        <h3 style="margin:0 0 15px; font-size:1.2rem;"><i class="fas fa-shield-alt"></i> Compliance Score</h3>
        <div style="font-size:3rem; font-weight:700; margin-bottom:10px;">98%</div>
        <p style="margin:0 0 15px; font-size:0.85rem; opacity:0.85;">Overall governance and compliance health.</p>
        <div style="background:rgba(255,255,255,0.2); height:8px; border-radius:4px; overflow:hidden;">
            <div style="width:98%; height:100%; background:#fff; border-radius:4px;"></div>
        </div>
    </div>
</div>
<?php require_once __DIR__ . '/footer.php'; ?>
