
532 F.3d 1304 (2008)
In re: James F. WALKER, Debtor.
Mary Alice Gwynn, Plaintiff-Appellant Cross-Appellee,
v.
James F. Walker, Defendant-Appellee Cross-Appellant.
No. 07-14049 Non-Argument Calendar.
United States Court of Appeals, Eleventh Circuit.
July 7, 2008.
*1307 Mary Alice Gwynn, Saylor & Gwynn, Delray Beach, FL, pro se.
Gary J. Rotella, Jay Lewis Farrow, Gary J. Rotella & Associates, P.A., Ft. Lauderdale, FL, for Walker.
Before DUBINA, BLACK and PRYOR, Circuit Judges.
PER CURIAM:
Mary Alice Gwynn, counsel for a creditor in a bankruptcy proceeding, appeals pro se an award of sanctions against her, a denial of her motion for fees under Bankruptcy Rule 9011, and a denial of her motion for recusal. James F. Walker cross-appeals a separate order that vacated an award of sanctions against Gwynn. We affirm.

I. BACKGROUND
Most of the issues on appeal involve two motions for sanctions. Gary Rotella, counsel for Walker, filed both motions in response to motions filed by Gwynn that alleged misconduct by Rotella. In each instance, Rotella was not found to have engaged in misconduct.
Rotella filed the first motion after Gwynn filed a motion to disqualify Rotella as counsel for Walker. Rotella responded to the motion and moved to shorten the notice period for filing a motion for sanctions under Rule 9011. Rotella notified Gwynn that he would seek sanctions under Rule 9011 if she did not withdraw the motion to disqualify. After a hearing, the bankruptcy court denied both the motion to disqualify and the motion to shorten the notice period. Gwynn then filed a renewed motion to disqualify Rotella from representing Walker. That same day, Rotella filed a motion for sanctions against Gwynn under Rule 9011. Ten days later, the bankruptcy court denied the renewed motion to disqualify and granted the motion for sanctions.
Gwynn appealed the award of sanctions to the district court. The district court vacated the award of sanctions because Gwynn had not been afforded twenty-one days to withdraw her motion. Gwynn then filed a motion for attorney's fees and costs as the prevailing party under Rule 9011 and Bankruptcy Local Rule 8014. The bankruptcy court granted in part and denied in part the motion and taxed costs in the amount of $1,591.58 against Rotella, his law firm, and Walker.
Rotella filed the second motion in response to another motion filed by Gwynn. Gwynn had alleged that Rotella made false representations to the court, committed fraud against the court, and planned to benefit personally at the expense of the creditors. The bankruptcy court granted Rotella's motion for sanctions and ordered Gwynn to pay Rotella $14,000.


*1308 II. STANDARDS OF REVIEW
We review the imposition of sanctions for abuse of discretion. Glatter v. Mroz (In re Mroz), 65 F.3d 1567, 1571-72 (11th Cir.1995). Under this standard, we "must affirm unless [we find] that the [lower] court has made a clear error of judgment, or has applied the wrong legal standard." Amlong & Amlong, P.A. v. Denny's Inc., 500 F.3d 1230, 1238 (11th Cir.2007). We may affirm on any legal ground supported by the record. Brown v. Johnson, 387 F.3d 1344, 1351 (11th Cir. 2004). We also review a denial of a motion for recusal for abuse of discretion. Christo v. Padgett, 223 F.3d 1324, 1333 (11th Cir.2000).

III. DISCUSSION
Our discussion is divided in four parts. First, we address Walker's argument that the district court should not have vacated the first sanction against Gwynn. Second, we address Gwynn's argument that the bankruptcy court abused its discretion in denying her request for fees and costs related to Gwynn's appeal of the first sanction and the denial of some of the expenses for which Gwynn sought reimbursement. Third, we address Gwynn's argument that the bankruptcy court abused its discretion in awarding a sanction of $14,000. Fourth, we address Gwynn's argument that the bankruptcy court erred when it denied Gwynn's motion for recusal.

A. The District Court Did Not Err when It Vacated the First Sanction Against Gwynn.
A party who moves for sanctions under Bankruptcy Rule 9011 must follow a two-step process. See Fed. R. Bankr.P. 9011(c)(1)(A). The party first must serve the motion on the opposing party and then, at least twenty-one days later, file the motion with the court. Id. This process provides a "safe harbor" in which the offending party can avoid sanctions by withdrawing or correcting the challenged document or position after receiving notice of the alleged violation.
Although this Circuit has never addressed whether a motion for sanctions under Rule 9011 may be filed after a court has ruled on the offending motion, the Second, Fourth, and Sixth Circuits have concluded that a motion under Federal Rule of Civil Procedure 11, which is "substantially identical" to Rule 9011, Mroz, 65 F.3d at 1572, cannot be filed "[i]f the court disposes of the offending contention before the twenty-one day `safe harbor' period expires." Ridder v. City of Springfield, 109 F.3d 288, 295 (6th Cir.1997); see also Brickwood Contractors, Inc. v. Datanet Eng'g, Inc., 369 F.3d 385, 389-90 (4th Cir. 2004) (en banc); In re Pennie & Edmonds LLP, 323 F.3d 86, 89 & nn.1-2 (2d Cir. 2003). As the Sixth Circuit explained, "any other interpretation would defeat the rule's explicit requirements." Ridder, 109 F.3d at 295. Under that interpretation of Rule 9011, Walker's argument on cross-appeal fails.
There is no doubt that Rotella's motion for sanctions was filed after the offending motion had been denied. Gwynn filed the offending motion to disqualify Rotella on April 21, 2004. Rotella gave notice that he would seek sanctions on April 24, 2004, but the bankruptcy court denied the motion to disqualify on April 28, 2004. On May 18, 2004, Gwynn filed a renewed motion to disqualify Rotella's law firm, and that same day Rotella filed a motion for sanctions under Rule 9011. Rotella's motion related to the first motion to disqualify filed by Gwynn. Although Rotella's motion for sanctions was filed more than twenty-one days after he gave notice that he would seek sanctions, the bankruptcy court had already denied Gwynn's first motion to disqualify.
*1309 We agree with the Second, Fourth, and Sixth Circuits that the service and filing of a motion for sanctions "must occur prior to final judgment or judicial rejection of the offending" motion. Id. at 297. Any argument to the contrary renders the safe harbor provision a mere formality. The provision cannot have any effect if the court has already denied the motion; it is too late for the offending party to withdraw the challenged contention. See id. The district court did not err when it vacated the award of sanctions.

B. The Bankruptcy Court Did Not Abuse Its Discretion in Its Denial of Fees, Costs, and Expenses for Gwynn.
Gwynn argues that the bankruptcy court abused its discretion when it did not award her attorney's fees and costs relating to her appeal of the award of sanctions. Gwynn also argues that the bankruptcy court abused its discretion when it did not award all of her reasonable expenses under Bankruptcy Rule 8014. We disagree.
Rotella's motion for sanctions and Gwynn's corresponding expenses could have been avoided if Gwynn had not filed her frivolous motion to disqualify Rotella in the first instance. One of the purposes of sanctions under Rule 9011 is to deter baseless filings, and courts should reduce an award of sanctions based on "the extent to which the nonviolating party's expenses could have been avoided, or mitigated." Baker v. Alderman, 158 F.3d 516, 528 (11th Cir.1998). Because Gwynn's initial frivolous filing prompted the dispute, the bankruptcy court did not abuse its discretion when it denied attorney's fees and costs under Rule 9011(c)(1)(a).
The bankruptcy court also did not abuse its discretion in its award of reasonable expenses under Rule 8014. The denial of fees for a consulting attorney and expert witness, expediting costs, and certain transcript costs was within the discretion of the court under Rule 8014. The bankruptcy court provided detailed reasons for excluding certain expenses, and Gwynn does not provide any legal support for a contrary decision.

C. The Bankruptcy Court Did Not Abuse Its Discretion when It Imposed a Sanction of $14,000 Against Gwynn.
Gwynn argues that the bankruptcy court abused its discretion in the imposition of sanctions in the amount of $14,000. The bankruptcy court found that sanctions were appropriate under two statutes, 28 U.S.C. §§ 105, 1927, and its inherent authority to manage its affairs. We need not decide whether the bankruptcy court had the authority to impose sanctions under either section 1927 or section 105 because the court did not abuse its discretion when it awarded sanctions under its inherent powers.
Federal courts, including bankruptcy courts, have the inherent power to impose sanctions on parties and lawyers. Byrne v. Nezhat, 261 F.3d 1075, 1121 (11th Cir.2001); see also Mroz, 65 F.3d at 1572. To impose sanctions under these inherent powers, the court first must find bad faith. Mroz, 65 F.3d at 1575. "A finding of bad faith is warranted where an attorney knowingly or recklessly raises a frivolous argument, or argues a meritorious claim for the purpose of harassing an opponent. A party also demonstrates bad faith by delaying or disrupting the litigation or hampering enforcement of a court order." Byrne, 261 F.3d at 1121 (citations omitted). Sanctions are "especially appropriate where counsel takes frivolous legal positions supported by scandalous accusations." Amlong & Amlong, P.A., 500 F.3d at 1238. The court must afford the sanctioned party due process both in determining that the requisite bad faith exists and in assessing fees. Chambers v. NASCO, *1310 Inc., 501 U.S. 32, 49, 111 S.Ct. 2123, 2135, 115 L.Ed.2d 27 (1991).
Gwynn does not contend that she did not receive due process in the imposition of sanctions; she instead argues that the filing of the motion did not amount to bad faith. She also contends that a single motion cannot demonstrate bad faith, but requires multiple instances of misconduct. We disagree.
The bankruptcy court did not abuse its discretion when it imposed a sanction for Gwynn's filing of a motion in bad faith. Gwynn's motion alleged that Rotella had made false representations to the court, committed fraud against the court, and planned to benefit personally at the expense of the creditors. Gwynn's accusations required multiple hearings and led to a counter-motion for sanctions. The seriousness of the allegations combined with the lack of any evidentiary support or minimal investigation support a finding of bad faith.
Gwynn also argues that the record does not support the amount of the sanction. Gwynn argues that the court should not have considered the expenses incurred after she withdrew her motion, and she contends that the estimates made by the court were arbitrary. We disagree.
The court had an ample evidentiary basis for determining the amount of sanctions. Rotella submitted a detailed log of time spent in response to the motion, and the court examined the log, noted entries that were unnecessary or unwarranted, and found the hourly rate to be reasonable. The court also found that Rotella's response to the motion was disproportionate and estimated the amount of time required for a proportional response.
The court did not clearly err when it included Rotella's time spent after Gwynn withdrew her motion for sanctions. See Finova Capital Corp. v. Larson Pharmacy, Inc. (In re Optical Tech., Inc.), 425 F.3d 1294, 1300 (11th Cir.2005). It was reasonable for Rotella to file the motion for sanctions because Gwynn's motion contained serious and unfounded allegations of misconduct. The court, in response, had to investigate the foundations of Gwynn's motion.
The estimate by the court as to the time necessary to prepare for and attend the hearing on Gwynn's motion, prepare Rotella's own motion, and prepare for and attend the hearing for Rotella's motion was not arbitrary. Based on Rotella's time entries, the experience of the bankruptcy court with fee applications, and its knowledge of Rotella's experience as an attorney, it was not clearly erroneous for the court to determine that forty hours was a reasonable amount of time to respond to the motion for sanctions. The court exercised restraint in its determination of the appropriate amount when it considered Rotella's disproportionate response and considered only a reasonable amount of time to respond to the unfounded motion. The bankruptcy court did not abuse its discretion when it awarded $14,000 in sanctions against Gwynn under its inherent powers.

D. The Bankruptcy Court Did Not Abuse Its Discretion when It Denied Gwynn's Motion for Recusal.
A judge shall recuse himself if he is personally biased or prejudiced against a party or in favor of an adverse party, or whenever the judge's "impartiality might reasonably be questioned." 28 U.S.C. §§ 144, 455(a). The standard is "whether an objective, fully informed lay observer would entertain significant doubt about the judge's impartiality." Christo, 223 F.3d at 1333. "The general rule is that bias sufficient to disqualify a judge must stem from extrajudicial sources." *1311 Thomas v. Tenneco Packaging Co., 293 F.3d 1306, 1329 (11th Cir.2002). "The exception to this rule is `when a judge's remarks in a judicial context demonstrate such pervasive bias and prejudice that it constitutes bias against a party.' Mere `friction between the court and counsel,' however, is not enough to demonstrate `pervasive bias.'" Id. (citation omitted) (quoting Hamm v. Bd. of Regents, 708 F.2d 647, 651 (11th Cir.1983)).
Gwynn contends that she established pervasive bias throughout the court proceeding by the bankruptcy judge, but the grounds cited by Gwynn do not include any extrajudicial sources. Gwynn relies on seven orders, all prepared by Rotella, as evidence of bias, and Gwynn contends that she was not able to respond in time to those orders. Gwynn also relies on adverse rulings and her referral to the Florida Bar by the bankruptcy judge.
Although we have "repeatedly condemned the ghostwriting of judicial orders by litigants," In re Colony Square Co., 819 F.2d 272, 274, 277 (11th Cir.1987), "such orders will be vacated only if a party can demonstrate that the process by which the judge arrived at them was fundamentally unfair," id. at 276. Whether the opposing party had "ample opportunity to present its arguments," whether the ruling was "correct as a matter of law," and the frequency of the use of orders prepared by a party are relevant factors to consider. See id. at 276-77; Chudasama v. Mazda Motor Corp., 123 F.3d 1353, 1373 n. 46, 1374 (11th Cir. 1997).
In the light of the extensive history of this litigation, the seven isolated orders, prepared by Rotella, in a bankruptcy proceeding involving almost 2,000 filings do not evince pervasive bias and prejudice. Gwynn had ample opportunity to be heard. She filed responses, motions to strike, notices of hearings, and motions for reconsideration. Although one order was incorrect as a matter of law, it was reversed by the district court, and the bankruptcy judge admitted his mistaken reliance on a prepared order. None of the other orders was incorrect as a matter of law.
Adverse rulings are grounds for appeal but rarely are grounds for recusal, see Liteky v. United States, 510 U.S. 540, 554, 114 S.Ct. 1147, 1157, 127 L.Ed.2d 474 (1994), and referral to a state bar disciplinary board for investigation is not considered a sanction or disciplinary measure, see United States v. McCorkle, 321 F.3d 1292, 1298 (11th Cir.2003). Because a fully informed and objective observer would not entertain significant doubt about the bankruptcy judge's impartiality in the proceedings, see Christo, 223 F.3d at 1333, we conclude that the bankruptcy judge did not abuse his discretion in denying the motion for recusal.

IV. CONCLUSION
The district court did not err when it vacated the first sanction against Gwynn, and the bankruptcy court did not abuse its discretion in its denial of Gwynn's motion for fees, costs, and expenses, its sanction of $14,000 against Gwynn, and its denial of Gwynn's motion for recusal.
AFFIRMED.
