INCOME TAXES (Components of Deferred Tax Assets and Liabilities) (Details) - USD ($)
$ in Thousands
12 Months Ended
Dec. 31, 2016
Dec. 31, 2015
Dec. 31, 2014
Deferred tax assets:      
Net operating loss carryforwards $ 71,049 $ 38,405  
Research and development credits 3,712 3,421  
Accruals and other 1,541 144  
Depreciation and amortization 261 94  
Deferred tax assets before valuation allowance 76,563 42,064  
Valuation allowance (76,563) (42,064)  
Deferred tax liabilities:      
Net deferred tax assets 0 0  
Valuation allowance      
Increase to gross deferred tax asset and valuation allowance resulting from adoption of ASU 2016-09 406    
Deferred tax asset valuation allowance increase (34,499) (10,539)  
Net operating loss carryforwards      
Operating Loss Carryforwards 1,539 1,064 $ 0
U.S. federal      
Deferred tax assets:      
Research and development credits 3,367 3,110 2,868
Net operating loss carryforwards      
Available net operating loss carryforwards as of the end of the year 190,926 104,888 78,276
State      
Deferred tax assets:      
Research and development credits 522 469 226
Net operating loss carryforwards      
Available net operating loss carryforwards as of the end of the year $ 145,902 $ 59,875 $ 34,184