<?php
$page_title = 'Account Management';
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-id-card" style="color:#2563eb; margin-right:10px;"></i>Account Management</h2>
        <p style="color:#64748b; font-size:0.95rem; margin-top:5px;">KYC, credit accounts, wallet, multi-user access, and branch management.</p>
    </div>
</div>

<div class="grid-4" style="margin-bottom:24px;">
    <div class="card" style="margin-bottom:0; border-top:4px solid #2563eb;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">CUSTOMER ID</div>
        <div style="font-size:1.4rem; font-weight:700; color:#0f172a;">BM-100045</div>
        <div style="color:#10b981; font-size:0.8rem; margin-top:5px;"><i class="fas fa-check-circle"></i> Verified</div>
    </div>
    <div class="card" style="margin-bottom:0; border-top:4px solid #10b981;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">KYC STATUS</div>
        <div style="font-size:1.4rem; font-weight:700; color:#10b981;">Complete</div>
        <div style="color:#10b981; font-size:0.8rem; margin-top:5px;"><i class="fas fa-shield-alt"></i> GST + PAN Verified</div>
    </div>
    <div class="card" style="margin-bottom:0; border-top:4px solid #f59e0b;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">CREDIT LIMIT</div>
        <div style="font-size:1.4rem; font-weight:700; color:#0f172a;">₹5,00,000</div>
        <div style="color:#f59e0b; font-size:0.8rem; margin-top:5px;"><i class="fas fa-coins"></i> ₹3.2L Available</div>
    </div>
    <div class="card" style="margin-bottom:0; border-top:4px solid #8b5cf6;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">WALLET BALANCE</div>
        <div style="font-size:1.4rem; font-weight:700; color:#8b5cf6;">₹12,400</div>
        <div style="color:#8b5cf6; font-size:0.8rem; margin-top:5px;"><i class="fas fa-wallet"></i> Cashback + Rewards</div>
    </div>
</div>

<div class="grid-2">
    <div class="card">
        <h3 style="margin:0 0 15px; font-size:1.15rem; color:#0f172a;"><i class="fas fa-file-alt" style="color:#2563eb; margin-right:8px;"></i>KYC & Verification</h3>
        <?php
        $docs = [
            ['GST Number', '27AABCB1234F1ZP', 'Verified', true],
            ['PAN Card', 'ABCDE1234F', 'Verified', true],
            ['Trade License', 'TL-2024-MH-4521', 'Verified', true],
            ['Bank Account', 'HDFC ****4521', 'Linked', true],
        ];
        foreach ($docs as $d): ?>
        <div style="display:flex; justify-content:space-between; align-items:center; padding:12px 0; border-bottom:1px solid #f1f5f9;">
            <div>
                <div style="font-weight:600; font-size:0.9rem; color:#0f172a;"><?= $d[0] ?></div>
                <div style="font-size:0.8rem; color:#94a3b8; font-family:monospace;"><?= $d[1] ?></div>
            </div>
            <span style="background:<?= $d[3] ? '#dcfce7' : '#fef3c7' ?>; color:<?= $d[3] ? '#166534' : '#b45309' ?>; padding:3px 10px; border-radius:10px; font-size:0.7rem; font-weight:bold;"><?= $d[2] ?></span>
        </div>
        <?php endforeach; ?>
        <button style="background:#2563eb; color:#fff; border:none; padding:10px 20px; border-radius:8px; font-size:0.85rem; cursor:pointer; margin-top:15px; width:100%; font-weight:600;"><i class="fas fa-plus-circle"></i> Request Credit Limit Increase</button>
    </div>

    <div class="card">
        <h3 style="margin:0 0 15px; font-size:1.15rem; color:#0f172a;"><i class="fas fa-users" style="color:#8b5cf6; margin-right:8px;"></i>Multi-User Company Account</h3>
        <p style="font-size:0.85rem; color:#64748b; margin-bottom:15px;">Manage team members with role-based access to your company account.</p>
        <?php
        $users = [
            ['Rajesh Sharma', 'Admin', 'All Access', '#2563eb'],
            ['Priya Patel', 'Procurement', 'Orders + Quotes', '#10b981'],
            ['Amit Kumar', 'Finance', 'Invoices + Payments', '#f59e0b'],
            ['Neha Singh', 'Branch - Delhi', 'Branch Orders Only', '#8b5cf6'],
        ];
        foreach ($users as $u): ?>
        <div style="display:flex; justify-content:space-between; align-items:center; padding:10px 0; border-bottom:1px solid #f1f5f9;">
            <div style="display:flex; align-items:center; gap:10px;">
                <div style="width:35px; height:35px; border-radius:50%; background:<?= $u[3] ?>15; display:flex; align-items:center; justify-content:center; color:<?= $u[3] ?>; font-weight:bold; font-size:0.8rem;"><?= substr($u[0],0,1) ?></div>
                <div>
                    <div style="font-weight:600; font-size:0.85rem;"><?= $u[0] ?></div>
                    <div style="font-size:0.7rem; color:#94a3b8;"><?= $u[2] ?></div>
                </div>
            </div>
            <span style="background:<?= $u[3] ?>15; color:<?= $u[3] ?>; padding:3px 8px; border-radius:6px; font-size:0.7rem; font-weight:bold;"><?= $u[1] ?></span>
        </div>
        <?php endforeach; ?>
        <button style="background:#f8fafc; color:#475569; border:1px solid #e2e8f0; padding:8px 16px; border-radius:6px; font-size:0.85rem; cursor:pointer; margin-top:15px; width:100%;"><i class="fas fa-user-plus"></i> Add Team Member</button>
    </div>
</div>

<?php require_once __DIR__ . '/../includes/footer.php'; ?>
