Summary of Significant Accounting Policies | Summary of Significant Accounting Policies Basis of presentation The accompanying consolidated financial statements have been prepared by management in conformity with U.S. generally accepted accounting principles (“U.S. GAAP”). Principles of consolidation The consolidated financial statements include all accounts of BMC and its wholly-owned subsidiaries. All material intercompany accounts and transactions have been eliminated in consolidation. Use of estimates The preparation of financial statements in conformity with U.S. GAAP requires management to make estimates and assumptions that affect the reported amounts of assets and liabilities and disclosure of contingent assets and liabilities at the date of the financial statements and the reported amounts of revenues and expenses during the reporting period. The Company evaluates these estimates and judgments on an ongoing basis and bases its estimates on historical experience, current conditions and various other assumptions that are believed to be reasonable under the circumstances. The results of these estimates form the basis for making judgments about the carrying values of assets and liabilities as well as identifying and assessing the accounting treatment with respect to commitments and contingencies. The significant estimates which could change by a material amount in the near term include revenue recognition for construction services, accounts receivable reserves, estimated losses on uncompleted contracts and changes in contract estimates, inventory reserves, supplier rebates, goodwill impairment, impairment of property and equipment, insurance reserves, warranties and share-based compensation. Actual results may differ materially from these estimates under different assumptions or conditions. Business and credit concentrations The Company maintains cash at financial institutions in excess of federally insured limits. Accounts receivable potentially expose the Company to concentrations of credit risk. Mitigating this credit risk is collateral underlying certain accounts receivable (perfected liens or lien rights) as well as the Company’s analysis of a customer’s credit history prior to extending credit. Concentrations of credit risk with respect to accounts receivable are limited due to the Company’s large number of customers and their dispersion across various regions of the United States. At December 31, 2019 and 2018 , no customer represented more than 10% of accounts receivable. For the years ended December 31, 2019 , 2018 and 2017 , no customer accounted for more than 10% of revenue. The Company’s future results could be adversely affected by a number of factors including competitive pressure on sales and pricing, weather conditions, consumer spending and debt levels, interest rates, existing residential home sales and new home construction, lumber prices and product mix. Cash and cash equivalents Cash equivalents are highly liquid investments that are readily convertible to known amounts of cash and have a maturity of three months or less from the time of purchase. As of December 31, 2019 and 2018 , the Company had cash equivalents of $4.4 million and $146.1 million , respectively. Cash equivalents are valued at amortized cost, which approximates fair value due to the short-term maturity of these instruments, and was classified as a Level 1 or Level 2 measurement in accordance with Financial Accounting Standards Board (“FASB”) Accounting Standards Codification (“ASC”) 820, Fair Value Measurements and Disclosures (“ASC 820”). Book overdrafts occur when purchases on corporate purchasing cards and checks written exceed available bank balances at a specific bank, despite there being cash at the Company’s other financial institutions. For accounting purposes, the Company reclassifies these book overdrafts to accounts payable on the consolidated balance sheets. Book overdrafts included in accounts payable were $2.5 million and $0.1 million at December 31, 2019 and 2018 , respectively. Fair value of financial instruments ASC 820 clarifies the definition of fair value, prescribes methods for measuring fair value, and establishes a fair value hierarchy to classify the inputs used in measuring fair value as follows: Level 1 Inputs are unadjusted quoted prices in active markets for identical assets or liabilities available at the measurement date. Level 2 Inputs are unadjusted quoted prices for similar assets and liabilities in active markets, quoted prices for identical or similar assets and liabilities in markets that are not active, inputs other than quoted prices that are observable, and inputs derived from or corroborated by observable market data. Level 3 Inputs are unobservable inputs which reflect the reporting entity ’ s own assumptions on what assumptions the market participants would use in pricing the asset or liability based on the best available information. If a financial instrument uses inputs that fall in different levels of the hierarchy, the instrument is categorized based upon the lowest level of input that is significant to the fair value calculation. Accounts receivable Accounts receivable result from the extending of credit to trade customers for the purchase of goods and services. The terms generally provide for payment within 30 days of being invoiced. On occasion, when necessary to compete in certain circumstances, the Company will sell product under extended payment terms. Accounts receivable are stated at estimated net realizable value. The allowance for doubtful accounts is based on an assessment of individual past due accounts, historical write-off experience, accounts receivable aging, customer disputes and the business environment. Account balances are charged off when the potential for recovery is considered remote. The Company grants trade discounts on a percentage basis. The Company records an allowance against accounts receivable for the amount of discounts it estimates will be taken by customers. The discounts are recorded as a reduction to revenue when products are sold. Consideration received from suppliers The Company enters into agreements with many of its suppliers providing for inventory purchase rebates (“supplier rebates”) upon achievement of specified volume purchasing levels. Supplier rebates are accrued as part of cost of goods sold based on progress towards earning the supplier rebates, taking into consideration cumulative purchases of inventory to date and projected purchases through the end of the year. The Company estimates the rebates applicable to inventory on-hand at each period end based on the estimated percentage of supplier rebates to be earned. The Company also receives consideration from suppliers to promote their products (“marketing and advertising allowances”), which are accrued as a reduction to cost of goods sold or selling, general and administrative expenses, depending on the nature of the allowance. Total rebates and marketing and advertising allowances receivable at December 31, 2019 and 2018 were $20.8 million and $18.0 million , respectively, included in prepaid expenses and other current assets. Revenue recognition A performance obligation is a promise in a contract to transfer a distinct good or service to the customer, and is the unit of account in ASC 606, Revenue from Contracts with Customers (“ASC 606”). The Company’s building products contracts typically contain a promise to supply multiple distinct products and thus, they generally contain multiple performance obligations under ASC 606. Depending on the nature of the promises within the Company’s construction services contracts and whether they are distinct under ASC 606, there may be a single performance obligation or multiple performance obligations. For contracts with multiple performance obligations, the contract’s transaction price is allocated to each distinct performance obligation based on the standalone selling price of each distinct good or service, which is generally determined based on the prices charged to customers. The Company recognizes revenue for its building products contracts when control of the promised goods (the performance obligations) is transferred to the Company’s customers. This generally occurs at a point in time when the products are delivered and the customer obtains physical possession, legal title and the risks and rewards of ownership. However, for certain product offerings, products are customized to customer specifications and the customer benefits from the Company’s performance over time as deliveries are made. As such, the Company has determined that an output method based on units delivered best depicts the transfer of control to the customer. The Company generally recognizes revenue for its construction services contracts over time using cost based input methods. Periodic estimates of progress towards completion are made based on either a comparison of labor costs incurred to date with total estimated contract labor costs or total costs incurred to date with total estimated contract costs. Incurred costs represent work performed, which correspond and best depict transfer of control to the customer. Contract revenues and contract costs to be recognized are dependent on the accuracy of estimates, including quantities of materials, labor productivity and other cost estimates. Historically, the Company has made reasonable estimates of the extent of progress towards completion and contract completion costs. Due to uncertainties inherent in the estimation process, it is possible that actual completion costs may vary from estimates. Revenue recognized for performance obligations satisfied over time for the year ended December 31, 2019 represented approximately 30% of total revenues. Estimated losses on uncompleted contracts and changes in contract estimates reflect the Company’s best estimate of probable losses of unbilled receivables, and are recognized in the period such revisions are known and can be reasonably estimated. These estimates are recognized in cost of sales. Estimated losses on uncompleted contracts and changes in contract estimates are established by assessing estimated costs to complete, change orders and claims for uncompleted contracts. Assumptions for estimated costs to complete include material prices, labor costs, labor productivity and contract claims. Such estimates are inherently uncertain and it is possible that actual completion costs may vary from these estimates. All sales recognized are net of allowances for discounts and estimated returns, based on historical experience. Taxes assessed by governmental authorities that are directly imposed on the Company’s revenue-producing transactions are excluded from sales. The Company accounts for shipping and handling costs associated with its contracts as a fulfillment cost and expenses these as incurred within selling, general and administrative expenses. Contract balances The timing of revenue recognition, invoicing and cash collection affects receivables, contract assets and contract liabilities on the Company’s consolidated balance sheets. For building products contracts that contain performance obligations satisfied at a point in time, the Company recognizes revenue upon satisfaction of the performance obligation and then bills the customer, resulting in a receivable. For building products contracts that contain performance obligations satisfied over time, the Company recognizes revenue as the performance obligation is satisfied, but prior to billing, resulting in an unbilled receivable, as the Company has an unconditional right to payment. For the Company’s construction services contracts, amounts are generally billed as work progresses in accordance with agreed-upon contractual terms. Revenue is also recognized over time as the performance obligations are satisfied, which can result in contract assets and liabilities, on a contract-by-contract basis, due to timing differences between billing and revenue recognition. Contract assets include unbilled amounts when the revenue recognized exceeds the amount billed to the customer. Conversely, contract liabilities include amounts that have been billed to the customer in excess of the revenue recognized. At times, the Company will have a right to payment from previous performance that is conditional on something other than passage of time, such as retainage, which creates a contract asset. Conversely, the Company may receive advances from customers prior to the Company’s performance, which creates a contract liability. Contract assets are reclassified to a receivable when the right to consideration becomes unconditional. The Company’s terms generally provide for payment within 30 days of being invoiced. On occasion, when necessary to compete in certain circumstances, the Company will offer extended payment terms, which do not exceed one year. Shipping and handling costs The Company includes shipping and handling costs in selling, general and administrative expenses and depreciation expense on the consolidated statements of operations. Shipping and handling costs included in selling, general and administrative expenses were $200.8 million , $189.6 million and $172.2 million for the years ended December 31, 2019 , 2018 and 2017 , respectively. Shipping and handling costs included in depreciation expense were $25.2 million , $22.9 million and $24.8 million for the years ended December 31, 2019 , 2018 and 2017 , respectively. Property and equipment Property and equipment are stated at cost. Expenditures for renewals and betterments, which extend the useful lives of assets, are capitalized while maintenance and repairs are charged to expense as incurred. Property and equipment obtained through acquisition are stated at estimated fair market value as of the acquisition date, and are depreciated over their estimated remaining useful lives, which may differ from the Company’s stated policies for certain assets. Gains and losses related to the sale of property and equipment are recorded as selling, general and administrative expenses. Property and equipment are depreciated using the straight-line method and are generally depreciated over the following estimated service lives: Buildings and improvements 3–30 years Leasehold improvements Lesser of life of the asset or remaining lease term, and not to exceed 15 years Furniture, fixtures and equipment 2–10 years Vehicles 4–10 years Property and equipment that is expected to be sold within the next twelve months, is actively marketed in its current condition for a price that is reasonable in comparison to its estimated fair value and meets other relevant held-for-sale criteria are classified as assets held for sale. Assets held for sale are measured at the lower of carrying amount or fair value less costs to sell and are no longer depreciated. An impairment for assets held for sale is recognized if the carrying amount is not recoverable. Assets held for sale were not presented separately and were classified as other long-term assets in the consolidated balance sheets and were $1.3 million at December 31, 2018 . There were no assets held for sale at December 31, 2019. Goodwill and other intangible assets At least annually, or more frequently as changes in circumstances indicate, the Company tests goodwill for impairment. To the extent that the carrying value of the net assets of any of the reporting units having goodwill is greater than their estimated fair value, the Company may be required to record impairment charges. The Company’s five operating segments, which have been determined to be the Company’s reporting units, are the Mid-Atlantic, Southeast, Texas, Intermountain and Western divisions. The chief operating decision maker (“CODM”) reviews aggregate information to allocate resources and assess performance. Based on the CODM’s review, as well as the similar economic characteristics, nature of products, distribution methods and customers of the divisions, the Company has aggregated its operating segments into one reportable segment. The Company is required to make certain assumptions and estimates regarding the fair value of the reporting units containing goodwill when assessing for impairment. Changes in the fact patterns underlying such assumptions and estimates could ultimately result in the recognition of additional impairment losses. The Company completes its annual impairment assessment during the third quarter of each year. The Company did not recognize any impairment for the years ended December 31, 2019 , 2018 and 2017 . As of the date of the most recent annual test, the fair value of our reporting units substantially exceeded their carrying value. The Company may consider qualitative factors as part of its annual impairment assessment to determine whether it is more likely than not that a reporting unit’s carrying value exceeds its fair value. If the Company’s qualitative assessment indicates that goodwill impairment is more likely than not, the Company performs the two-step impairment test. Alternatively, the Company may bypass the qualitative test and initiate goodwill impairment testing with the first step of the two-step goodwill impairment test. During the first step of the goodwill impairment test, the fair value of the reporting unit is compared to its carrying value, including goodwill. The Company may derive a reporting unit’s fair value through a combination of the market approach (a guideline transaction method) and the income approach. The income approach uses a reporting unit’s projection of estimated future cash flows that is discounted at a market derived weighted average cost of capital. The projection uses management’s best estimates of economic and market conditions over the projected period including growth rates in sales, costs, estimates of future expected changes in operating margins and cash expenditures. If the fair value of a reporting unit exceeds its carrying value, then the Company concludes no goodwill impairment has occurred. If the carrying value of the reporting unit exceeds its fair value, the Company performs the second step of the goodwill impairment test to measure possible goodwill impairment loss. During the second step, the implied fair value of the reporting unit’s goodwill is compared to the carrying value of its goodwill. If the carrying value of the reporting unit’s goodwill exceeds the implied fair value of the goodwill, the Company would recognize an impairment loss in an amount equal to the excess, not to exceed the carrying value of the reporting unit’s goodwill. Acquired intangible assets other than goodwill are amortized over their weighted average amortization period unless they are determined to be indefinite. Acquired intangible assets are carried at cost, less accumulated amortization. For intangible assets purchased in a business combination, the estimated fair values of the assets received are used to establish the carrying value. The fair value of acquired intangible assets is determined using common valuation techniques, and the Company employs assumptions developed using the perspective of a market participant. Impairment of long-lived assets Long-lived assets, such as property, equipment and purchased intangible assets subject to amortization, are reviewed for impairment whenever facts and circumstances indicate that the carrying amount of an asset may not be recoverable. For impairment testing of long-lived assets, the Company identifies asset groups at the lowest level for which identifiable cash flows are largely independent of the cash flows of other groups of assets and liabilities. Recoverability of assets to be held and used is measured by a comparison of the carrying amount of an asset to estimated undiscounted future cash flows expected to be generated by the assets. If the carrying amount of an asset exceeds its estimated future cash flows, an impairment charge is recognized by the amount by which the carrying amount of the asset exceeds the estimated fair value of the asset. Treasury stock During November 2018, the Company’s board of directors authorized a $75.0 million share repurchase program, which was to expire on November 20, 2019. During October 2019, the Company's board of directors authorized extending this share repurchase program for one year, such that it will expire on November 20, 2020. Repurchases may be made at management’s discretion from time to time on the open market, subject to applicable laws, or through privately negotiated transactions. The repurchase program may be suspended or discontinued at any time. During the years ended December 31, 2019 and 2018, utilizing cash from operations, the Company repurchased 1.0 million shares at a weighted average price of $17.11 per share for a total cost of $16.4 million and 0.2 million shares at a weighted average price of $15.91 per share for a total cost of $2.9 million , respectively. These repurchased shares are available for future issuance and are reflected as treasury stock, at cost, on the consolidated balance sheets as of December 31, 2019 and 2018 . As of December 31, 2019 , the Company had approximately $55.7 million of capacity remaining under the current share repurchase authorization. Employees have the option to surrender shares to the Company to satisfy their tax withholding obligations in connection with the vesting of certain awards. These surrendered shares are reflected as treasury stock, at cost, on the consolidated balance sheet as of December 31, 2019 and 2018 . Merger and integration costs Merger and integration costs related to the ongoing integration of Building Materials Holding Corporation (“BMHC”) and Stock Building Supply Holdings, Inc. (“SBS”), as a result of the 2015 merger transaction, consist primarily of severance, rebranding, system integration costs and professional fees. Income taxes The Company accounts for income taxes in accordance with ASC 740, Income Taxes (“ASC 740”), which requires an asset and liability approach for measuring deferred taxes based on temporary differences between the financial statement and tax basis of assets and liabilities existing at each balance sheet date using enacted tax rates for years in which taxes are expected to be paid or recovered. The Company evaluates its deferred tax assets on a quarterly basis to determine whether a valuation allowance is required. In accordance with ASC 740, the Company assesses whether a valuation allowance should be established based on its determination of whether it is more likely than not that some portion or all of the deferred tax assets will not be realized. The ultimate realization of deferred tax assets depends primarily on: (i) the Company’s ability to carry back net operating losses to tax years where it has previously paid income taxes based on applicable federal law; (ii) the timing of the reversal of deferred tax liabilities and (iii) the Company’s ability to generate future taxable income during the periods in which the related deferred tax assets are deductible. The assessment of a valuation allowance includes giving appropriate consideration to all positive and negative evidence related to the realization of the deferred tax asset. This assessment considers, among other things, the nature, frequency and severity of current and cumulative losses, forecasts of future profitability, the duration of statutory carryforward periods, the Company’s experience with operating loss and tax credit carryforwards not expiring unused and tax planning alternatives. Significant judgment is required in determining the future tax consequences of events that have been recognized in the Company’s consolidated financial statements and/or tax returns. Actual outcomes of these future tax consequences could differ materially from the outcomes that the Company currently anticipates. ASC 740 defines the methodology for recognizing the benefits of uncertain tax return positions as well as guidance regarding the measurement of the resulting tax benefits. These provisions require an enterprise to recognize the financial statement effects of a tax position when it is more likely than not, which is defined as a likelihood of more than 50%, based on technical merits, that the position will be sustained upon examination. The evaluation of whether a tax position meets the more likely than not recognition threshold requires a substantial degree of judgment by management based on the individual facts and circumstances. Actual results could differ from estimates. The Company had no material uncertain tax positions as of December 31, 2019 . The Company’s policy is to recognize interest and penalties related to income tax liabilities and unrecognized tax benefits in income tax expense. Casualty and health insurance The Company carries insurance for general liability, auto liability and workers’ compensation exposures subject to deductibles or self-insured retentions it believes to be reasonable under the circumstances, and the Company self-insures for employee and eligible dependent health care claims, with insurance purchased from independent carriers to cover individual claims in excess of the self-insured limits. The expected liability for unpaid claims, including incurred but not reported losses, is reflected on the consolidated balance sheets as a liability with current and long-term components. The amount recoverable from insurance providers is reflected on the consolidated balance sheets in prepaid expenses and other current assets. Provisions for losses are developed from actuarial valuations that rely upon the Company’s past claims experience, which considers both the frequency and settlement of claims. The casualty and health insurance liabilities are recorded at their undiscounted value. In January 2015, the Company entered into a retroactive reinsurance contract to transfer the risk of loss of certain insurance reserves for workers’ compensation claims incurred from 2006 to 2011 to a reinsurer. Pursuant to the reinsurance contract, the reinsurer is obligated to pay an aggregate maximum of $17.5 million for these claims with any excess borne by the Company. The Company maintains the insurance reserves related to these claims as a liability on its consolidated balance sheet with an offsetting reinsurance receivable, which includes current and long-term components. As of December 31, 2019 and 2018 , the carrying value of the insurance reserves related to these claims and the offsetting reinsurance receivable was $2.5 million and $3.7 million , respectively. Changes in these claims are recorded as an increase or decrease in the insurance reserves and corresponding increase or decrease in the reinsurance receivable. Additionally, the Company monitors the financial condition of the reinsurer to minimize its exposure to significant losses from reinsurer insolvency. Retirement savings program The Company sponsors a defined contribution retirement savings plan. The Company has recorded expense of $11.2 million , $5.9 million and $5.2 million related to employer contributions for the years ended December 31, 2019 , 2018 and 2017 , respectively. These expenses are recorded to either selling, general and administrative expenses or cost of sales on the consolidated statements of operations, depending on the classification of the employee. Lease arrangements The Company has operating and finance leases primarily for its facilities, office space, land, fleet vehicles and equipment. Many of the Company’s leases are noncancellable and typically have an initial lease term of five to ten years, and most provide options at the Company’s election to renew for specified periods of time. The Company’s leases generally provide for fixed annual rentals. Certain of the Company’s leases include provisions for escalating rent, as an example, based on changes in the consumer price index. Variable lease payments based on an index or rate are initially measured using the index or rate in effect at lease commencement. Most of the Company’s leases require it to pay taxes, insurance and maintenance expenses associated with the properties. The Company’s lease agreements do not contain any material residual value guarantees or material restrictive covenants. The Company determines if an arrangement contains a lease at inception. The Company has lease agreements with lease and non-lease components, which for all such leases are generally accounted for separately. The Company has elected the short-term lease exception under ASC 842, Leases, for all leases and as such, leases with an initial term of 12 months or less are not recorded on the consolidated balance sheets. The Company recognizes lease expense for short-term leases on a straight-line basis over the lease term. Operating lease right-of-use ("ROU") assets and operating lease liabilities are recognized based on the present value of the future minimum lease payments over the lease term at commencement date. As the Company’s leases generally do not provide an implicit rate, the Company uses its incremental borrowing rate based on the information available at the commencement date in determining the present value of future payments. The operating lease ROU asset also includes any lease payments made and excludes lease incentives and any initial direct costs incurred. The Company’s lease terms include options to extend or terminate the lease when it is reasonably certain that the Company will exercise that option. Lease expense for minimum lease payments is recognized on a straight-line basis over the lease term. Advertising and promotion Costs associated with advertising and promoting products and services are expensed in the period incurred. Cooperative advertising allowances that are reimbursement of specific, incremental and identifiable costs incurred to promote vendors’ products are recorded as an offset against advertising expenses in selling, general and administrative expenses. If those conditions are not met, the cooperative advertising allowances are recorded as a reduction in inventory and a subsequent reduction in cost of goods sold when the related product is sold. For the years ended December 31, 2019 , 2018 and 2017 , the Company recorded $6.0 million , $4.9 million and $5.8 million , respectively, of advertising and promotion expenses, net of cooperative advertising allowances, in selling, general and administrative expenses. Stock-based compensation In accordance with the requirements of ASC 718, Compensation—Stock Compensation (“ASC 718”), the Company measures and recognizes compensation expense for all share-based payment awards made to employees using a fair value based pricing model. The compensation expense is recognized over the requisite service period, using graded vesting. The Company accounts for forfeitures as they occur. Debt issuance costs Costs incurred in connection with the Company’s revolving line of credit and senior secured notes are capitalized and amortized over the term of the applicable agreement. Total debt issuance costs, net of accumulated amortization, were $5.9 million and $6.4 million as of December 31, 2019 and 2018 , respectively. Debt issuance costs related to the Company’s revolving line of credit and senior secured notes are included in other long-term assets and long-term debt, respectively, on the consolidated balance sheets. Amortization of debt issuance costs for the years ended December 31, 2019 , 2018 and 2017 was $1.4 million , $1.7 million and $1.7 million , respectively, and is included in interest expense on the consolidated statements of operations. Derivatives During the years ended December 31, 2019, 2018 and 2017, the Company entered into immaterial lumber future contracts to offset existing or expected risks associated with fluctuations in commodity prices. The Company does not enter into derivative instruments for speculative or trading purposes. The Company recognizes all derivative instruments as assets or liabilities in the Company’s balance sheets at fair value. Changes in the fair value of derivative instruments that are not designated as hedges or that do not meet the hedge accounting criteria are reported in earnings. The Company elected not to designate any new derivative instruments as hedges for the years ended December 31, 2019 , 2018 or 2017 , and therefore, all changes in the fair market value of the derivative instruments have been reported in cost of sales on the consolidated statements of operations. Warranty expense The Company has warranty obligations with respect to most manufactured products. As of December 31, 2019 and 2018 |