.estimate-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.estimate-grid .full{grid-column:1/-1}.check-row{display:flex;flex-wrap:wrap;gap:18px}.copy-field{display:flex;gap:8px}.copy-field input{min-width:260px}.gateway-ready{color:var(--green);font-weight:800}.gateway-missing{color:#b42318;font-weight:800}.workspace-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap}.workspace-actions{display:flex;gap:8px;flex-wrap:wrap}.workspace-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.workspace-grid .wide{grid-column:1/-1}.workspace-stat{display:grid;gap:4px;padding:14px;border:1px solid var(--line);border-radius:12px;background:#fff}.workspace-stat strong{font-size:1.2rem}.inventory-photo{display:inline-flex;align-items:center;gap:6px}.permission-panel{margin-top:18px}.permission-table th:first-child,.permission-table td:first-child{position:sticky;left:0;background:#fff;z-index:1}.permission-table input{width:18px;height:18px}.permission-name{text-transform:capitalize;white-space:nowrap}.portal-action{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.compact-form{display:grid;gap:10px}.compact-form .form-row{align-items:end}.document-actions{display:flex;gap:6px;flex-wrap:wrap}.photo-picker{max-width:180px}@media(max-width:850px){.estimate-grid{grid-template-columns:1fr 1fr}.workspace-grid{grid-template-columns:1fr}.workspace-grid .wide{grid-column:auto}}@media(max-width:620px){.estimate-grid{grid-template-columns:1fr}.estimate-grid .full{grid-column:auto}.copy-field{display:grid}.copy-field input{min-width:0}}
.integration-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;grid-column:1/-1}.integration-grid .panel{min-width:0}.invoice-lines{display:grid;gap:10px}.invoice-line{display:grid;grid-template-columns:minmax(220px,2fr) minmax(90px,.55fr) minmax(120px,.75fr) auto;gap:10px;align-items:end;padding:12px;border:1px solid var(--line);border-radius:12px;background:#f8fafc}.form-actions,.inline-buttons{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.permission-table th{min-width:105px;white-space:normal}.permission-table th:first-child{min-width:160px}@media(max-width:1000px){.integration-grid{grid-template-columns:1fr}.invoice-line{grid-template-columns:1fr 1fr}.invoice-line label:first-child{grid-column:1/-1}}@media(max-width:620px){.invoice-line{grid-template-columns:1fr}.invoice-line label:first-child{grid-column:auto}}

/* The estimate detail view belongs across the entire workspace, not in one
   half of the module grid. Keep its own editing cards responsive. */
#estimateWorkspace{grid-column:1/-1;min-width:0;display:grid;gap:16px}
#estimateWorkspace .workspace-grid{min-width:0}
#estimateWorkspace .workspace-grid>*,#estimateWorkspace .panel{min-width:0}
#estimateWorkspace .table-wrap{max-width:100%}
#estimateWorkspace .customer-documents-panel .table-wrap{overflow:visible}
#estimateWorkspace .customer-document-table{width:100%;min-width:0;table-layout:fixed}
#estimateWorkspace .customer-document-table th,#estimateWorkspace .customer-document-table td{white-space:normal;overflow-wrap:anywhere}
#estimateWorkspace .customer-document-table th:nth-child(1){width:30%}
#estimateWorkspace .customer-document-table th:nth-child(2){width:13%}
#estimateWorkspace .customer-document-table th:nth-child(3){width:9%}
#estimateWorkspace .customer-document-table th:nth-child(4){width:14%}
#estimateWorkspace .customer-document-table th:nth-child(5){width:16%}
#estimateWorkspace .customer-document-table th:nth-child(6){width:18%}
#estimateWorkspace #agreementForm button,#estimateForm>button{justify-self:start}
@media(max-width:980px){#estimateWorkspace{grid-column:auto}}
@media(max-width:620px){
  #estimateWorkspace .customer-document-table,#estimateWorkspace .customer-document-table tbody{display:block;width:100%}
  #estimateWorkspace .customer-document-table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
  #estimateWorkspace .customer-document-table tr{display:block;margin:0 0 12px;border:1px solid var(--line);border-radius:10px;background:#fff}
  #estimateWorkspace .customer-document-table td{display:grid;grid-template-columns:minmax(112px,35%) minmax(0,1fr);gap:8px;padding:9px 10px;white-space:normal;overflow-wrap:anywhere}
  #estimateWorkspace .customer-document-table td::before{content:attr(data-label);font-weight:750;color:var(--muted)}
  #estimateWorkspace .customer-document-table .check{justify-self:start}
  #estimateWorkspace .customer-document-table .document-actions{align-items:flex-start}
}
