<div class="tab-pane fade show active" role="tabpanel">
    <form method="post" class="needs-validation">
        <div class="row mb-3">
            <div class="col-md-6">
                <label class="form-label">Título da Lista</label>
                <input type="text" name="title" class="form-control" value="<?= htmlspecialchars($edit_data['title'] ?? '') ?>" required>
            </div>
            <div class="col-md-6">
                <label class="form-label">URL M3U</label>
                <input type="url" name="url" class="form-control" value="<?= htmlspecialchars($edit_data['url'] ?? '') ?>" required>
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-md-6">
                <label class="form-label">Endereço MAC</label>
                <input type="text" name="mac_address" class="form-control" value="<?= htmlspecialchars($edit_data['mac_address'] ?? '') ?>">
            </div>
            <div class="col-md-6">
                <label class="form-label">Nome do Dispositivo</label>
                <input type="text" name="device_name" class="form-control" value="<?= htmlspecialchars($edit_data['device_name'] ?? '') ?>">
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-md-6">
                <label class="form-label">DNS Primário</label>
                <input type="text" name="dns_primary" class="form-control" value="<?= htmlspecialchars($edit_data['dns_primary'] ?? '8.8.8.8') ?>">
            </div>
            <div class="col-md-6">
                <label class="form-label">DNS Secundário</label>
                <input type="text" name="dns_secondary" class="form-control" value="<?= htmlspecialchars($edit_data['dns_secondary'] ?? '8.8.4.4') ?>">
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-md-6">
                <label class="form-label">Status</label>
                <select name="status" class="form-select">
                    <option value="active" <?= ($edit_data['status'] ?? '') === 'active' ? 'selected' : '' ?>>Ativa</option>
                    <option value="inactive" <?= ($edit_data['status'] ?? '') === 'inactive' ? 'selected' : '' ?>>Inativa</option>
                </select>
            </div>
            <div class="col-md-6">
                <label class="form-label">Criada em</label>
                <input type="text" class="form-control" value="<?= htmlspecialchars($edit_data['import_date'] ?? '') ?>" readonly>
            </div>
        </div>

        <div class="mb-3">
            <button type="submit" name="update_m3u" class="btn btn-success">
                <i class="fa fa-save"></i> Atualizar Lista
            </button>
            <a href="<?= PAGE_NAME ?>" class="btn btn-secondary">Cancelar</a>
            <a href="<?= PAGE_NAME ?>?delete=<?= intval($edit_id) ?>" class="btn btn-danger" onclick="return confirm('Tem certeza?')">
                <i class="fa fa-trash"></i> Deletar
            </a>
        </div>
    </form>
</div>
