<div class="container mt-4">
    <div class="card shadow-sm">
        <div class="card-header bg-warning text-dark">
            <h4 class="mb-0">✏️ Edit Lead</h4>
        </div>
        <div class="card-body">
            <?php if (!empty($error)): ?>
                <div class="alert alert-danger"><?= htmlspecialchars($error) ?></div>
            <?php endif; ?>

            <form method="post" action="">
                <div class="mb-3">
                    <label class="form-label">Name</label>
                    <input type="text" name="name" value="<?= htmlspecialchars($lead['name']) ?>" class="form-control" required>
                </div>

                <div class="mb-3">
                    <label class="form-label">Email</label>
                    <input type="email" name="email" value="<?= htmlspecialchars($lead['email']) ?>" class="form-control" required>
                </div>

                <div class="mb-3">
                    <label class="form-label">Phone</label>
                    <input type="text" name="phone" value="<?= htmlspecialchars($lead['phone']) ?>" class="form-control">
                </div>

                <div class="mb-3">
                    <label class="form-label">Source</label>
                    <input type="text" name="source" value="<?= htmlspecialchars($lead['source']) ?>" class="form-control">
                </div>

                <button type="submit" class="btn btn-primary">Update Lead</button>
                <a href="<?= BASE_URL ?>/lead" class="btn btn-secondary">Cancel</a>
            </form>
        </div>
    </div>
</div>
