<?php
$page_title = 'M&A Integration Layer';
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-handshake" style="color:#f59e0b; margin-right:10px;"></i>M&amp;A Integration Layer</h2>
        <p style="color:#64748b; font-size:0.95rem; margin-top:5px;">Acquisition onboarding, system consolidation, brand migration, and ERP merge.</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 #f59e0b;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">ACQUISITIONS</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">3</div>
        <div style="color:#f59e0b; font-size:0.8rem; margin-top:5px;"><i class="fas fa-building"></i> In Integration</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;">COMPLETED</div>
        <div style="font-size:1.6rem; font-weight:700; color:#10b981;">5</div>
        <div style="color:#10b981; font-size:0.8rem; margin-top:5px;"><i class="fas fa-check-circle"></i> Fully Merged</div>
    </div>
    <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;">SYSTEMS MIGRATED</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">12</div>
        <div style="color:#3b82f6; font-size:0.8rem; margin-top:5px;"><i class="fas fa-server"></i> ERP + CRM</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;">BRANDS MERGED</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">4</div>
        <div style="color:#8b5cf6; font-size:0.8rem; margin-top:5px;"><i class="fas fa-palette"></i> Under Balimeen</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-tasks" style="color:#f59e0b; margin-right:8px;"></i>Active Integrations</h3>
        <?php
        $integrations = [
            ['SteelForge Pvt Ltd', 'System consolidation', 72, '#10b981', 'Phase 3 of 4'],
            ['MetalPro Industries', 'Brand migration', 45, '#3b82f6', 'Phase 2 of 4'],
            ['Apex Steel Trading', 'ERP merge', 28, '#f59e0b', 'Phase 1 of 4'],
        ];
        foreach ($integrations as $i): ?>
        <div style="border:1px solid #e2e8f0; border-radius:8px; padding:15px; margin-bottom:10px;">
            <div style="display:flex; justify-content:space-between; margin-bottom:8px;">
                <div>
                    <div style="font-weight:600; font-size:0.9rem;"><?= $i[0] ?></div>
                    <div style="font-size:0.75rem; color:#94a3b8;"><?= $i[1] ?> · <?= $i[4] ?></div>
                </div>
                <span style="background:<?= $i[3] ?>15; color:<?= $i[3] ?>; padding:3px 8px; border-radius:6px; font-size:0.7rem; font-weight:bold;"><?= $i[2] ?>%</span>
            </div>
            <div style="background:#e2e8f0; height:6px; border-radius:3px; overflow:hidden;">
                <div style="width:<?= $i[2] ?>%; height:100%; background:<?= $i[3] ?>; border-radius:3px;"></div>
            </div>
        </div>
        <?php endforeach; ?>
    </div>
    <div style="background:linear-gradient(135deg,#f59e0b,#d97706); color:#fff; padding:25px; border-radius:12px;">
        <h3 style="margin:0 0 15px; font-size:1.2rem;"><i class="fas fa-tools"></i> ERP Merge Toolkit</h3>
        <div style="display:flex; justify-content:space-between; font-size:0.85rem; margin-bottom:10px;">
            <span>Data Migration</span><span style="font-weight:bold;">2.4M records</span>
        </div>
        <div style="display:flex; justify-content:space-between; font-size:0.85rem; margin-bottom:10px;">
            <span>User Accounts Merged</span><span style="font-weight:bold;">840</span>
        </div>
        <div style="display:flex; justify-content:space-between; font-size:0.85rem; margin-bottom:10px;">
            <span>COA Harmonization</span><span style="font-weight:bold;">92% done</span>
        </div>
        <div style="display:flex; justify-content:space-between; font-size:0.85rem;">
            <span>Brand Unified</span><span style="font-weight:bold;">4 of 8</span>
        </div>
    </div>
</div>
<?php require_once __DIR__ . '/footer.php'; ?>
