Loans and allowance for loan losses - Information on PPP loans (Details)
3 Months Ended 6 Months Ended 12 Months Ended
Jun. 30, 2021
USD ($)
Jun. 30, 2020
USD ($)
Jun. 30, 2021
USD ($)
loan
Jun. 30, 2020
USD ($)
Dec. 31, 2020
USD ($)
loan
Accounts, Notes, Loans and Financing Receivable [Line Items]          
Loan amount $ 545,657,000   $ 545,657,000   $ 554,985,000
SBA fee earned 6,715,000 $ 5,945,000 $ 13,494,000 $ 11,314,000  
PPP Loans          
Accounts, Notes, Loans and Financing Receivable [Line Items]          
Number of loans granted | loan     987    
Loan amount 97,617,000   $ 97,617,000   $ 136,674,000
PPP loan $350,000          
Accounts, Notes, Loans and Financing Receivable [Line Items]          
Number of loans granted | loan     934    
Loan amount 62,279,000   $ 62,279,000    
PPP loan $350,000 - $2 million          
Accounts, Notes, Loans and Financing Receivable [Line Items]          
Number of loans granted | loan     53    
Loan amount 35,338,000   $ 35,338,000    
Round 1 | PPP Loans          
Accounts, Notes, Loans and Financing Receivable [Line Items]          
Number of loans granted | loan     240   1,235
Loan amount 24,709,000   $ 24,709,000   $ 136,674,000
Round 1 | PPP loan $350,000          
Accounts, Notes, Loans and Financing Receivable [Line Items]          
Number of loans granted | loan     228   1,172
Loan amount 17,535,000   $ 17,535,000   $ 72,526,000
Round 1 | PPP loan $350,000 - $2 million          
Accounts, Notes, Loans and Financing Receivable [Line Items]          
Number of loans granted | loan     12   57
Loan amount 7,174,000   $ 7,174,000   $ 41,046,000
Round 1 | PPP loan > $2 million          
Accounts, Notes, Loans and Financing Receivable [Line Items]          
Number of loans granted | loan         6
Loan amount         $ 23,102,000
Round 2 | PPP Loans          
Accounts, Notes, Loans and Financing Receivable [Line Items]          
Number of loans granted | loan     747    
Loan amount 72,908,000   $ 72,908,000    
Round 2 | PPP loan $350,000          
Accounts, Notes, Loans and Financing Receivable [Line Items]          
Number of loans granted | loan     706    
Loan amount 44,744,000   $ 44,744,000    
Round 2 | PPP loan $350,000 - $2 million          
Accounts, Notes, Loans and Financing Receivable [Line Items]          
Number of loans granted | loan     41    
Loan amount $ 28,164,000   $ 28,164,000