<?php
$page_title = 'Hyper Automation';
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-robot" style="color:#6366f1; margin-right:10px;"></i>Hyper Automation</h2>
        <p style="color:#64748b; font-size:0.95rem; margin-top:5px;">RPA bots, auto reconciliation, reporting, ticket routing, and procurement triggers.</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 #6366f1;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">ACTIVE BOTS</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">18</div>
        <div style="color:#6366f1; font-size:0.8rem; margin-top:5px;"><i class="fas fa-robot"></i> Running 24/7</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;">HOURS SAVED/MONTH</div>
        <div style="font-size:1.6rem; font-weight:700; color:#10b981;">2,400</div>
        <div style="color:#10b981; font-size:0.8rem; margin-top:5px;"><i class="fas fa-clock"></i> ₹48L Value</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;">TASKS AUTOMATED</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">12,480</div>
        <div style="color:#f59e0b; font-size:0.8rem; margin-top:5px;"><i class="fas fa-cog"></i> This Month</div>
    </div>
    <div style="background:#fff; padding:20px; border-radius:12px; border:1px solid #e2e8f0; border-top:4px solid #ef4444;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">BOT ERRORS</div>
        <div style="font-size:1.6rem; font-weight:700; color:#ef4444;">3</div>
        <div style="color:#ef4444; font-size:0.8rem; margin-top:5px;"><i class="fas fa-bug"></i> Auto-retry Active</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-cogs" style="color:#6366f1; margin-right:8px;"></i>RPA Bot Fleet</h3>
        <?php
        $bots = [
            ['Bank Reconciliation Bot', 'Matches 4,200 entries/day', '#10b981', 'Running'],
            ['Invoice Processing Bot', 'Extracts & books 240/day', '#3b82f6', 'Running'],
            ['Auto Report Generator', '18 reports daily at 8 AM', '#f59e0b', 'Running'],
            ['Ticket Routing Bot', 'Routes 120 tickets/day', '#8b5cf6', 'Running'],
            ['Procurement Trigger Bot', 'Auto-PO when stock < min', '#ec4899', 'Running'],
            ['GST Filing Bot', 'Monthly return prep', '#06b6d4', 'Scheduled'],
        ];
        foreach ($bots as $b): ?>
        <div style="border:1px solid #e2e8f0; border-radius:8px; padding:12px 15px; margin-bottom:8px; display:flex; justify-content:space-between; align-items:center;">
            <div>
                <div style="font-weight:600; font-size:0.9rem;"><?= $b[0] ?></div>
                <div style="font-size:0.75rem; color:#94a3b8;"><?= $b[1] ?></div>
            </div>
            <span style="background:<?= $b[2] ?>15; color:<?= $b[2] ?>; padding:3px 8px; border-radius:6px; font-size:0.7rem; font-weight:bold;"><?= $b[3] ?></span>
        </div>
        <?php endforeach; ?>
    </div>
    <div style="background:linear-gradient(135deg,#6366f1,#4f46e5); color:#fff; padding:25px; border-radius:12px;">
        <h3 style="margin:0 0 15px; font-size:1.2rem;"><i class="fas fa-chart-pie"></i> Automation ROI</h3>
        <div style="font-size:2.5rem; font-weight:700; margin-bottom:10px;">12.4x</div>
        <p style="margin:0 0 15px; font-size:0.85rem; opacity:0.85;">Return on automation investment this year.</p>
        <div style="display:flex; justify-content:space-between; font-size:0.85rem; margin-bottom:8px;">
            <span>Investment</span><span style="font-weight:bold;">₹38L</span>
        </div>
        <div style="display:flex; justify-content:space-between; font-size:0.85rem; margin-bottom:8px;">
            <span>Savings Generated</span><span style="font-weight:bold;">₹4.7 Cr</span>
        </div>
        <div style="display:flex; justify-content:space-between; font-size:0.85rem;">
            <span>Error Reduction</span><span style="font-weight:bold;">94%</span>
        </div>
    </div>
</div>
<?php require_once __DIR__ . '/footer.php'; ?>
