/* CSS */

:root {
  --appback: #2a2a2a;
  --appfontfam: "Aptos Narrow", sans-serif; 
  --estback: hsl(0, 0%, 100%);
  --grbord: collapse;
  --grback: transparent;
  --sbtnfacecol: rgba(55, 206, 50, 0.10);
  --btnfacecol: rgba(171, 194, 197, 0.10);
  --butgrad: linear-gradient(145deg, #e5e7eb, rgb(224, 228, 235));
  --tbargrad: linear-gradient(145deg, #f0f0f0, #e0e0e0);
  --tbmar: 8px;
  --thc: #dfdfdf;
  --thh: 40px;
  --tinfback: rgba(205, 205, 243, 0.736);
  --tinfbord: collapse;
  --tinfotxt: 14px;
  --tinfowidmin: 110px;
  --shadow: 2px 2px 4px 2px rgba(0, 0, 0, 0.23);
  --rowselectedcolor: hsla(234, 20%, 30%, 0.846);
  --rowselectedcolorHead: hsla(108, 20%, 30%, 0.846);

  --bqtabback: #fcfcf2;
  --bqsngedge: 0.5px solid #32a1ce;
  --bqdbledge: 3px double #32a1ce;
  --bq1: 40px;
  --bq2: 180px;
  --bq3: 40px;
  --bq4: 30px;
  --bq5: 90px;
  --bq6: 40px;
  --bq7: 40px;
  --bq8: 40px;
  --bq9: 40px;
  --bq10: 40px;
  --bq11: 40px;
  --bq12: 70px;
  --bq13: 70px;
  --bq14: 85px;
  --hfs: 16px;
  --cfs: 14px;
  --sfs: 12px;

  --pntabback: #e1eafc;
  --pnsngedge: 0.5px solid #3f4649;
  --pndbledge: 3px double #3f4649;
  --pn1: 40px;
  --pn2: 15px;
  --pn3: 150px;
  --pn4: 40px;
  --pn5: 40px;
  --pnlfs: 20px;
  --pnhfs: 16px;
  --pncfs: 14px;
  --pnsfs: 12px;

  --gatabback: #e1fce5;
  --gasngedge: 0.5px solid #3ace32;
  --gadbledge: 3px double #3ace32;
  --ga1: 40px;
  --ga2: 15px;
  --ga3: 180px;
  --ga4: 40px;
  --ga5: 30px;
  --ga6: 65px;
  --ga7: 20px;
  --ga8: 20px;
  --ga9: 20px;
  --ga10: 20px;
  --ga11: 20px;
  --ga12: 20px;
  --galfs: 20px;
  --gahfs: 16px;
  --gacfs: 14px;
  --gaifs: 12px;
  --gasfs: 10px;

  --retabback: #fcfce1;
  --resngedge: 0.5px solid #bece32;
  --redbledge: 3px double #bece32;
  --re1: 40px;
  --re2: 15px;
  --re3: 15px;
  --re4: 180px;
  --re5: 30px;
  --re6: 30px;
  --re7: 30px;
  --re8: 30px;
  --re9: 30px;
  --re10: 30px;
  --relfs: 20px;
  --rehfs: 16px;
  --recfs: 14px;
  --resfs: 12px;

  --fcl0:  #000000;
  --fcl1:  #000000;
  --fcl2:  #000000;
  --fcl3:  #000000;
  --fcl4:  #000000;
  --fcl5:  #000000;
  --fcl6:  #000000;
  --fcl7:  #000000;
  --fcl8:  #000000;
  --headcol: #fcfcf2;

}

/* Clone modal specifics */
#clone-billitem-modal .modal-content {
  width: 1800px;
  max-width: calc(100% - 60px);
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-auto-rows: min-content;
  gap: 12px;
  align-items: start;
}

/* Make the clone modal container wider (requested fixed width) */
#clone-billitem-modal .modal-container {
  max-width: 1800px;
  width: 1800px;
}

/* controls and filters span both columns at the top */
#clone-billitem-modal .modal-content .clone-controls,
#clone-billitem-modal .modal-content .clone-filters {
  grid-column: 1 / -1;
}

.clone-controls { display:flex; gap:12px; align-items:center; margin-bottom:8px; }
.clone-controls label { display:flex; gap:8px; align-items:center; font-size:12px; font-weight:600; }
.clone-controls input[type="search"] { 
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #d6dbe0;
  background: #aff4cf;
  color: #222;
  border-radius: 10px;
  box-shadow: 3px 3px 5px rgba(90, 90, 90, 0.5) inset, -3px -3px 5px rgba(255, 255, 255, 0.5) inset;
  font-family: var(--appfontfam);
}
.clone-controls input[type="search"]:focus {
  outline: 2px solid rgb(10, 79, 16);
  outline-offset: 0;
}
.clone-controls select {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #d6dbe0;
  background: #aff4cf;
  color: #222;
  border-radius: 10px;
  box-shadow: 3px 3px 5px rgba(90, 90, 90, 0.5) inset, -3px -3px 5px rgba(255, 255, 255, 0.5) inset;
  font-family: var(--appfontfam);
}
.clone-controls select:focus {
  outline: 2px solid rgb(10, 79, 16);
  outline-offset: 0;
}
.clone-list { max-height:520px; overflow:auto; border-radius:6px; }
#clone-billitems-table { width:100%; border-collapse:collapse; }
#clone-billitems-table thead th { text-align:left; padding:8px; background:var(--thc); position:sticky; top:0; z-index:2; }
#clone-billitems-table tbody td { padding:8px; border-bottom:1px solid rgba(0,0,0,0.05); }
#clone-billitems-table tbody tr:hover { background: rgba(0,0,0,0.03); cursor:pointer; }

/* Left groups panel styling inside modal */
#clone-billitem-modal .modal-content .clone-left {
  padding: 0; /* inner box handles padding */
}

#clone-billitem-modal .modal-content .clone-left > div {
  max-height: 520px;
  overflow: auto;
}

/* Clone Pricing Note modal - same layout as clone bill item modal */
#clone-pricingnote-modal .modal-content {
  width: 1800px;
  max-width: calc(100% - 60px);
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-auto-rows: min-content;
  gap: 12px;
  align-items: start;
}

#clone-pricingnote-modal .modal-container {
  max-width: 1800px;
  width: 1800px;
}

#clone-pricingnote-modal .modal-content .clone-controls,
#clone-pricingnote-modal .modal-content .clone-filters {
  grid-column: 1 / -1;
}

#clone-pricingnote-modal .modal-content .clone-left {
  padding: 0;
}

#clone-pricingnote-modal .modal-content .clone-left > div {
  max-height: 520px;
  overflow: auto;
}

#clone-pricingnotes-table { 
  width:100%; 
  border-collapse:collapse; 
}

#clone-pricingnotes-table thead th { 
  text-align:left; 
  padding:8px; 
  background:var(--thc); 
  position:sticky; 
  top:0; 
  z-index:2; 
}

#clone-pricingnotes-table tbody td { 
  padding:8px; 
  border-bottom:1px solid rgba(0,0,0,0.05); 
}

#clone-pricingnotes-table tbody tr:hover { 
  background: rgba(0,0,0,0.03); 
  cursor:pointer; 
}

/* Clone Gang modal - same layout as clone pricing note modal */
#clone-gang-modal .modal-content {
  width: 1800px;
  max-width: calc(100% - 60px);
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-auto-rows: min-content;
  gap: 12px;
  align-items: start;
}

#clone-gang-modal .modal-container {
  max-width: 1800px;
  width: 1800px;
}

#clone-gang-modal .modal-content .clone-controls,
#clone-gang-modal .modal-content .clone-filters {
  grid-column: 1 / -1;
}

#clone-gang-modal .modal-content .clone-left {
  padding: 0;
}

#clone-gang-modal .modal-content .clone-left > div {
  max-height: 520px;
  overflow: auto;
}

#clone-gangs-table { 
  width:100%; 
  border-collapse:collapse; 
}

#clone-gangs-table thead th { 
  text-align:left; 
  padding:8px; 
  background:var(--thc); 
  position:sticky; 
  top:0; 
  z-index:2; 
}

#clone-gangs-table tbody td { 
  padding:8px; 
  border-bottom:1px solid rgba(0,0,0,0.05); 
}

#clone-gangs-table tbody tr:hover { 
  background: rgba(0,0,0,0.03); 
  cursor:pointer; 
}

.estappbody {
  background-color: var(--appback);
}

.btn-icon-img {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  display: inline-block;
  object-fit: contain;
  opacity: 0.5;
}

.btn-icon-small-img {
  width: 10px;
  height: 10px;
  margin-right: 4px;
  display: inline-block;
  object-fit: contain;
  opacity: 0.5;
}

.estimating-master {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(32, 0.35fr);
  gap: 1px;
  border-radius: 14px;
  background-color: var(--estback);
  /* Give the grid a definite height so fr rows distribute space properly */
  height: 100vh;
  width: 100%;
  max-width: 100%;
}

.info-title-container {
  grid-row: 1 / 2;
  grid-column: 6 / 9;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: center;
  background: var(--grback);
  border: var(--grbord);
  border-radius: 14px;
  padding: 6px;
  gap: 6px;
  border-radius: 14px;
  overflow: hidden;
}

#project-labour {
  min-width: 95px;
  flex: 1 1 95px;
  max-width: 150px;
  height: 40px;
  text-align: center;
  align-self: center;
  vertical-align: center;
  background: var(--tinfback);
  border: var(--tinfbord);
  border-radius: 14px;
  padding: 4px 1px 1px 1px;
  font-family: var(--appfontfam);
  font-size: var(--tinfotxt);
  font-weight: bold;
}

#project-plant {
  min-width: 95px;
  flex: 1 1 95px;
  max-width: 150px;
  height: 40px;
  text-align: center;
  align-self: center;
  vertical-align: center;
  background: var(--tinfback);
  border: var(--tinfbord);
  border-radius: 14px;
  padding: 4px 1px 1px 1px;
  font-family: var(--appfontfam);
  font-size: var(--tinfotxt);
  font-weight: bold;
}

#project-material {
  min-width: 95px;
  flex: 1 1 95px;
  max-width: 150px;
  height: 40px;
  text-align: center;
  align-self: center;
  vertical-align: center;
  background: var(--tinfback);
  border: var(--tinfbord);
  border-radius: 14px;
  padding: 4px 1px 1px 1px;
  font-family: var(--appfontfam);
  font-size: var(--tinfotxt);
  font-weight: bold;
}

#project-subcontract {
  min-width: 95px;
  flex: 1 1 95px;
  max-width: 150px;
  height: 40px;
  text-align: center;
  align-self: center;
  vertical-align: center;
  background: var(--tinfback);
  border: var(--tinfbord);
  border-radius: 14px;
  padding: 4px 1px 1px 1px;
  font-family: var(--appfontfam);
  font-size: var(--tinfotxt);
  font-weight: bold;
}

#project-quoted {
  min-width: 95px;
  flex: 1 1 95px;
  max-width: 150px;
  height: 40px;
  text-align: center;
  align-self: center;
  vertical-align: center;
  background: var(--tinfback);
  border: var(--tinfbord);
  border-radius: 14px;
  padding: 4px 1px 1px 1px;
  font-family: var(--appfontfam);
  font-size: var(--tinfotxt);
  font-weight: bold;
}

#project-provisional {
  min-width: 95px;
  flex: 1 1 95px;
  max-width: 150px;
  height: 40px;
  text-align: center;
  align-self: center;
  vertical-align: center;
  background: var(--tinfback);
  border: var(--tinfbord);
  border-radius: 14px;
  padding: 4px 1px 1px 1px;
  font-family: var(--appfontfam);
  font-size: var(--tinfotxt);
  font-weight: bold;
}

#project-spot {
  min-width: 95px;
  flex: 1 1 95px;
  max-width: 150px;
  height: 40px;
  text-align: center;
  align-self: center;
  vertical-align: center;
  background: var(--tinfback);
  border: var(--tinfbord);
  border-radius: 14px;
  padding: 4px 1px 1px 1px;
  font-family: var(--appfontfam);
  font-size: var(--tinfotxt);
  font-weight: bold;
}

#project-grand {
  min-width: 95px;
  flex: 1 1 95px;
  max-width: 150px;
  height: 40px;
  text-align: center;
  align-self: center;
  vertical-align: center;
  background: var(--tinfback);
  border: var(--tinfbord);
  border-radius: 14px;
  padding: 4px 1px 1px 1px;
  font-family: var(--appfontfam);
  font-size: var(--tinfotxt);
  font-weight: bold;
}

.logo {
  grid-row: 1 / 2;
  grid-column: 1 / 1;
  display: flex;
  flex-direction: row;
  justify-content: left;
  background: var(--grback);
  border: var(--grbord);
  border-radius: 14px;
  padding: 10px;
}

.header-title {
  grid-row: 1 / 2;
  grid-column: 2 / 6;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--grback);
  border: var(--grbord);
  border-radius: 14px;
  padding: 8px 12px;
  font-family: var(--appfontfam);
  /* font-size: 24px; */
  font-weight: bold;
}

.header-title-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.header-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-title #btn-boq-close,
.header-title #btn-recalc-all,
.header-title #btn-documents-constants {
  white-space: nowrap;
  flex: 0 0 auto;
}

.bq-filters {
  grid-row: 2 / 3;
  grid-column: 1 / 6;
  display: flex;
  flex-direction: row;
  justify-content: left;
  background: var(--grback);
  border: var(--grbord);
  border-radius: 14px;
  padding: 10px;
}

.gen-tool-container {
  grid-row: 2 / 3;
  grid-column: 6 / 9;
  margin: var(--tbmar);
  display: grid;
  display: inline-flex;
  flex-direction: row;
  place-content: space-around;
  background: var(--grback);
  border: var(--grbord);
  border-radius: 14px;
  padding: 10px;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(2, 0.35fr);
  gap: 1px;
  border-radius: 14px;
}

.boq-toolbar {
  grid-row: 3 / 4;
  grid-column: 1 / 6;
  margin: var(--tbmar);
  display: grid;
  display: inline-flex;
  flex-direction: row;
  place-content: space-around;
  background: var(--tbargrad);
  border: var(--grbord);
  border-radius: 14px;
  padding: 10px;
}

.pnote-toolbar {
  grid-row: 3 / 4;
  grid-column: 6 / 9;
  margin: var(--tbmar);
  display: grid;
  display: inline-flex;
  flex-direction: row;
  place-content: space-around;
  background: var(--tbargrad);
  border: var(--grbord);
  border-radius: 14px;
  padding: 10px;

}

.boq-table {
  grid-row: 4 / 32;
  grid-column: 1 / 6;
  display: flex;
  flex-direction: row;
  justify-content: left;
  background: var(--bqtabback);
  border: var(--grbord);
  border-radius: 14px;
  margin: var(--tbmar);
  /* Allow the scroll child to shrink within this flex item */
  min-height: 0;
  overflow: hidden;
}

.pnote-table {
  grid-row: 4 / 18;
  grid-column: 6 / 9;
  display: flex;
  flex-direction: row;
  justify-content: left;
  background: var(--pntabback);
  border: var(--grbord);
  border-radius: 14px;
  margin: var(--tbmar);
  /* Allow the scroll child to shrink within this flex item */
  min-height: 0;
  overflow: hidden;
}

.gang-toolbar {
  grid-row: 18 / 19;
  grid-column: 6 / 9;
  margin: var(--tbmar);
  display: grid;
  display: inline-flex;
  flex-direction: row;
  place-content: space-around;
  background: var(--tbargrad);
  border: var(--grbord);
  border-radius: 14px;
  padding: 10px;
}

.gang-table {
  grid-row: 19 / 24;
  grid-column: 6 / 9;
  display: flex;
  flex-direction: row;
  justify-content: left;
  background: var(--gatabback);
  border: var(--grbord);
  border-radius: 14px;
  margin: var(--tbmar);
  /* Allow the scroll child to shrink within this flex item */
  min-height: 0;
  overflow: hidden;
}

.resource-toolbar {
  grid-row: 24 / 25;
  grid-column: 6 / 9;
  margin: var(--tbmar);
  display: grid;
  display: inline-flex;
  flex-direction: row;
  place-content: space-around;
  background: var(--tbargrad);
  border: var(--grbord);
  border-radius: 14px;
  padding: 10px;

}

.resource-groups-table-container {
  grid-row: 25 / 32;
  grid-column: 6 / 9;
  display: flex;
  flex-direction: row;
  justify-content: left;
  background: var(--retabback);
  border: var(--grbord);
  border-radius: 14px;
  margin: var(--tbmar);
  /* Allow the scroll child to shrink within this flex item */
  min-height: 0;
  overflow: hidden;
}

#estapp-logo {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  outline: none;
}

#project-text-display {
  font-size: 24px;
  background: transparent;
  position: relative;
}

#project-title-display {
  font-size: 20px;
  font-weight: 700;
  color: #061b6f;
}

.boq-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  /* enable vertical scrolling when content grows */
  width: 100%;
  -webkit-overflow-scrolling: touch;
  border-radius: 4px;
  /* Fill available space inside .boq-table and allow scrolling */
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.boq-scroll table {
  width: 100%;
  table-layout: fixed;
}

.boq-scroll thead th {
  position: sticky;
  top: 0;
  background: var(--thc);
  height: var(--thh);
  min-height: var(--thh);
  font-family: var(--appfontfam);
}

#billofquantities-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bqtabback);
  font-family: var(--appfontfam);
}

/* #billofquantities-table tr {
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
} */

#billofquantities-table tr.selected {
  background: var(--rowselectedcolor);
  color: #fdfdfd;
}

#billofquantities-table tr.selected-heading {
  background: var(--rowselectedcolorHead);
  color: #fdfdfd;
}


#billofquantities-table th.col-bill_ref {
  font-size: var(--hfs);
  width: var(--bq1);
  min-width: var(--bq1);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#billofquantities-table td.cell-bill_ref {
  font-size: var(--sfs);
  width: var(--bq1);
  min-width: var(--bq1);
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 700;
  border-right: var(--bqdbledge);
}

#billofquantities-table th.col-bill_description {
  font-size: var(--hfs);
  width: var(--bq2);
  min-width: var(--bq2);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#billofquantities-table td.cell-bill_description {
  font-size: var(--cfs);
  width: var(--bq2);
  min-width: var(--bq2);
  max-width: var(--bq2);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 400;
  border-right: var(--bqsngedge);

}

#billofquantities-table td.cell-bill_subheadingL0 {
  font-size: var(--cfs);
  width: var(--bq2);
  min-width: var(--bq2);
  max-width: var(--bq2);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 600;
  text-decoration: underline;
  border-right: var(--bqsngedge);
  color:var(--fcl0);

}

#billofquantities-table td.cell-bill_subheadingL1 {
  font-size: var(--cfs);
  width: var(--bq2);
  min-width: var(--bq2);
  max-width: var(--bq2);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 600;
  border-right: var(--bqsngedge);
  text-decoration: underline;
  color:var(--fcl1);

}

#billofquantities-table td.cell-bill_subheadingL2 {
  font-size: var(--cfs);
  width: var(--bq2);
  min-width: var(--bq2);
  max-width: var(--bq2);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 600;
  text-decoration: underline;
  border-right: var(--bqsngedge);
  text-decoration: underline;
  color:var(--fcl2);

}

#billofquantities-table td.cell-bill_subheadingL3 {
  font-size: var(--cfs);
  width: var(--bq2);
  min-width: var(--bq2);
  max-width: var(--bq2);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 600;
  border-right: var(--bqsngedge);
  text-decoration: underline;
  color:var(--fcl3)
}
#billofquantities-table td.cell-bill_subheadingL4 {
  font-size: var(--cfs);
  width: var(--bq2);
  min-width: var(--bq2);
  max-width: var(--bq2);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 600;
  text-decoration: underline;
  border-right: var(--bqsngedge);
  text-decoration: underline;
  color:var(--fcl4)
}

#billofquantities-table td.cell-bill_subheadingL5 {
  font-size: var(--cfs);
  width: var(--bq2);
  min-width: var(--bq2);
  max-width: var(--bq2);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 600;
  border-right: var(--bqsngedge);
  text-decoration: underline;
  color:var(--fcl5)

}
#billofquantities-table td.cell-bill_subheadingL6 {
  font-size: var(--cfs);
  width: var(--bq2);
  min-width: var(--bq2);
  max-width: var(--bq2);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 600;
  text-decoration: underline;
  border-right: var(--bqsngedge);
  text-decoration: underline;
  color:var(--fcl6)
}

#billofquantities-table td.cell-bill_subheadingL7 {
  font-size: var(--cfs);
  width: var(--bq2);
  min-width: var(--bq2);
  max-width: var(--bq2);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 600;
  border-right: var(--bqsngedge);
  text-decoration: underline;
  color:var(--fcl7)

}

#billofquantities-table th.col-bill_quantity {
  font-size: var(--hfs);
  width: var(--bq3);
  min-width: var(--bq3);
  text-align: right;
  font-weight: 600;
  justify-content: start;


}

#billofquantities-table td.cell-bill_quantity {
  font-size: var(--cfs);
  width: var(--bq3);
  min-width: var(--bq3);
  max-width: var(--bq3);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 400;
  border-right: var(--bqsngedge);
}

#billofquantities-table th.col-bill_unit {
  font-size: var(--hfs);
  width: var(--bq4);
  min-width: var(--bq4);
  text-align: left;
  font-weight: 600;
  justify-content: start;

}

#billofquantities-table td.cell-bill_unit {
  font-size: var(--cfs);
  width: var(--bq4);
  min-width: var(--bq4);
  max-width: var(--bq4);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(--bqsngedge);
}

#billofquantities-table th.col-bill_keytrade {
  font-size: var(--hfs);
  width: var(--bq5);
  min-width: var(--bq5);
  text-align: center;
  font-weight: 600;
  justify-content: start;
}

#billofquantities-table td.cell-bill_keytrade {
  font-size: var(--cfs);

  width: var(--bq5);
  min-width: var(--bq5);
  max-width: var(--bq5);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 500;
  border-right: var(--bqsngedge);

}

#billofquantities-table th[class^="col-bill_net_"] {
  font-size: var(--hfs);
  width: var(--bq6);
  min-width: var(--bq6);
  text-align: right;
  font-weight: 600;
  justify-content: start;
}

#billofquantities-table td[class^="cell-bill_net_"] {
  font-size: var(--cfs);
  width: var(--bq6);
  min-width: var(--bq6);
  max-width: var(--bq6);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  border-right: var(--bqsngedge);
}

#billofquantities-table th.col-bill_chosen_rate_method {
  font-size: var(--hfs);
  width: var(--bq12);
  min-width: var(--bq12);
  text-align: center;
  font-weight: 600;
  justify-content: start;
}

#billofquantities-table td.cell-bill_chosen_rate_method {
  font-size: var(--cfs);

  width: var(--bq12);
  min-width: var(--bq12);
  max-width: var(--bq12);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 500;
  border-right: var(--bqsngedge);

}

#billofquantities-table th.col-bill_net_used_rate {
  font-size: var(--hfs);
  width: var(--bq13);
  min-width: var(--bq13);
  text-align: center;
  font-weight: 600;
  justify-content: start;
}

#billofquantities-table td.cell-bill_net_used_rate {
  font-size: var(--cfs);
  width: var(--bq13);
  min-width: var(--bq13);
  max-width: var(--bq13);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  border-right: var(--bqsngedge);
}

#billofquantities-table th.col-bill_net_grandtotal {
  font-size: var(--hfs);
  width: var(--bq14);
  min-width: var(--bq14);
  text-align: center;
  font-weight: 600;
  justify-content: start;
}

#billofquantities-table td.cell-bill_net_grandtotal {
  font-size: var(--cfs);
  width: var(--bq14);
  min-width: var(--bq14);
  max-width: var(--bq14);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* --- End BoQ table ----------------------------------------------- */

/* --- Pricing Notes Table -------------------------------- */

.pn-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  /* enable vertical scrolling when content grows */
  width: 100%;
  -webkit-overflow-scrolling: touch;
  border-radius: 4px;
  /* Fill available space inside .boq-table and allow scrolling */
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.pn-scroll table {
  width: 100%;
  table-layout: fixed;
}

.pn-scroll thead th {
  position: sticky;
  top: 0;
  background: var(--thc);
  height: var(--thh);
  min-height: var(--thh);
  font-family: var(--appfontfam);
}

#pricingnotes-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--pntabback);
  font-family: var(--appfontfam);
}

/* #pricingnotes-table tr:hover {
  background: #c7dcb5;
} */

#pricingnotes-table tr.selected {
  background: var(--rowselectedcolor);
  color: #fdfdfd;
}

/* Make selected rows a bit darker on hover in the colored left-side tables */
/* #pricingnotes-table tr.selected:hover {
  background: #5e9fc5;
  transition: background-color 120ms ease;
} */

#pricingnotes-table th.col-pnote_gang_id {
  font-size: var(--pnhfs);
  width: var(--pn1);
  min-width: var(--pn1);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#pricingnotes-table td.cell-pnote_gang_id {
  font-size: var(--pnsfs);
  width: var(--pn1);
  min-width: var(--pn1);
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 700;
  border-right: var(--pndbledge);
}

#pricingnotes-table th.col-pnote_slot {
  font-size: var(--pnhfs);
  width: var(--pn2);
  min-width: var(--pn2);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#pricingnotes-table td.cell-pnote_slot {
  font-size: var(--pncfs);
  width: var(--pn2);
  min-width: var(--pn2);
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 700;
  border-right: var(--pnsngedge);
}

#pricingnotes-table th.col-pnote_description {
  font-size: var(--pnlfs);
  width: var(--pn3);
  min-width: var(--pn3);
  text-align: left;
  font-weight: 600;
  color: #061b6f;
  justify-content: start;
}

#pricingnotes-table td.cell-pnote_description {
  font-size: var(--pncfs);
  width: var(--pn3);
  min-width: var(--pn3);
  max-width: var(--pn3);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 400;
  border-right: var(--pnsngedge);
}

#pricingnotes-table th.col-pnote_multiplier_quantity {
  font-size: var(--pnhfs);
  width: var(--pn4);
  min-width: var(--pn4);
  text-align: right;
  font-weight: 600;
  justify-content: start;

}

#pricingnotes-table td.cell-pnote_multiplier_quantity {
  font-size: var(--pncfs);
  width: var(--pn4);
  min-width: var(--pn4);
  max-width: var(--pn4);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 400;
  border-right: var(--pnsngedge);
}

#pricingnotes-table th.col-gang_unit {
  font-size: var(--pnhfs);
  width: var(--pn5);
  min-width: var(--pn5);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#pricingnotes-table td.cell-gang_unit {
  font-size: var(--pncfs);
  width: var(--pn5);
  min-width: var(--pn5);
  max-width: var(--pn5);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(--pnsngedge);
}

#pricingnotes-table th[class^="col-pnote_final"] {
  font-size: var(--pnhfs);
  width: var(--pn5);
  min-width: var(--pn5);
  text-align: right;
  font-weight: 600;
  justify-content: start;
}

#pricingnotes-table td[class^="cell-pnote_final"] {
  font-size: var(--pncfs);
  width: var(--pn5);
  min-width: var(--pn5);
  max-width: var(--pn5);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  border-right: var(--pnsngedge);
}

#pricingnotes-table th.col-pnote_unit {
  font-size: var(--pnhfs);
  width: var(--pn5);
  min-width: var(--pn5);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#pricingnotes-table td.cell-pnote_unit {
  font-size: var(--pncfs);
  width: var(--pn5);
  min-width: var(--pn5);
  max-width: var(--pn5);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(--pnsngedge);
}

/* --- end of Pricing Notes Table -------------------------------- */

/* --- Gangs Table -------------------------------- */

.ga-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  /* enable vertical scrolling when content grows */
  width: 100%;
  -webkit-overflow-scrolling: touch;
  border-radius: 4px;
  /* Fill available space inside .boq-table and allow scrolling */
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.ga-scroll table {
  width: 100%;
  table-layout: fixed;
}

.ga-scroll thead th {
  position: sticky;
  top: 0;
  background: var(--thc);
  height: var(--thh);
  min-height: var(--thh);
  font-family: var(--appfontfam);
}

#gangs-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--gatabback);
  font-family: var(--appfontfam);
}

/* #gangs-table tr:hover {
  background: #c7dcb5;
} */

#gangs-table tr.selected {
  background: var(--rowselectedcolor);
  color: #fdfdfd;
}

/* Make selected rows a bit darker on hover in the colored left-side tables */
/* #gangs-table tr.selected:hover {
  background: #5e9fc5;
  transition: background-color 120ms ease;
} */

#gangs-table th.col-gang-resgrpid {
  font-size: var(--gahfs);
  width: var(--ga1);
  min-width: var(--ga1);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#gangs-table td.cell-gang-resgrpid {
  font-size: var(--gasfs);
  width: var(--ga1);
  min-width: var(--ga1);
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 700;
  border-right: var(gadbledge);
}

#gangs-table th.col-gang-gangslot {
  font-size: var(--gahfs);
  width: var(--ga2);
  min-width: var(--ga2);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#gangs-table td.cell-gang-gangslot {
  font-size: var(--gacfs) !important;
  width: var(--ga2);
  min-width: var(--ga2);
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 700;
  border-right: var(gadbledge);
}

#gangs-table th.col-gang-resgrpdesc {
  font-size: var(--galfs);
  width: var(--ga3);
  min-width: var(--ga3);
  text-align: left;
  font-weight: 600;
  color: #061b6f;
  justify-content: start;
}

#gangs-table td.cell-gang-resgrpdesc {
  font-size: var(--gacfs) !important;
  width: var(--ga3);
  min-width: var(--ga3);
  max-width: var(--ga3);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 400;
  border-right: var(gasngedge);
}

#gangs-table th.col-gang-gangmultiplier {
  font-size: var(--gahfs);
  width: var(--ga4);
  min-width: var(--ga4);
  text-align: right;
  font-weight: 600;
  justify-content: start;

}

#gangs-table td.cell-gang-gangmultiplier {
  font-size: var(--gacfs) !important;
  width: var(--ga4);
  min-width: var(--ga4);
  max-width: var(--ga4);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 400;
  border-right: var(gasngedge);
}

#gangs-table th.col-gang-gangunit {
  font-size: var(--gahfs);
  width: var(--ga5);
  min-width: var(--ga5);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#gangs-table td.cell-gang-gangunit {
  font-size: var(--gacfs) !important;
  width: var(--ga5);
  min-width: var(--ga5);
  max-width: var(--ga5);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(gasngedge);
}

#gangs-table th.col-gang-gangoutput {
  font-size: var(--gahfs);
  width: var(--ga6);
  min-width: var(--ga6);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#gangs-table td.cell-gang-gangoutput {
  font-size: var(--gaifs);
  width: var(--ga6);
  min-width: var(--ga6);
  max-width: var(--ga6);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(gasngedge);
}


#gangs-table th.col-gang_workingTimeMultiplier {
  font-size: var(--gahfs);
  width: var(--ga7);
  min-width: var(--ga7);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#gangs-table td.cell-gang_workingTimeMultiplier {
  font-size: var(--gacfs) !important;
  width: var(--ga7);
  min-width: var(--ga7);
  max-width: var(--ga7);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(gasngedge);
}

#gangs-table th.col-gang_workingTimeProportion {
  font-size: var(--gahfs);
  width: var(--ga8);
  min-width: var(--ga8);
  text-align: left;
  font-weight: 600;
  justify-content: start;
  cursor: help;
}

#gangs-table td.cell-gang_workingTimeProportion {
  font-size: var(--gacfs) !important;
  width: var(--ga8);
  min-width: var(--ga8);
  max-width: var(--ga8);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(gasngedge);
}

#gangs-table th.col-gang_siteRestrictionFactor {
  font-size: var(--gahfs);
  width: var(--ga9);
  min-width: var(--ga9);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#gangs-table td.cell-gang_siteRestrictionFactor {
  font-size: var(--gacfs) !important;
  width: var(--ga9);
  min-width: var(--ga9);
  max-width: var(--ga9);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(gasngedge);
}

#gangs-table th.col-gang_projectScaleFactor {
  font-size: var(--gahfs);
  width: var(--ga10);
  min-width: var(--ga10);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#gangs-table td.cell-gang_projectScaleFactor {
  font-size: var(--gacfs) !important;
  width: var(--ga10);
  min-width: var(--ga10);
  max-width: var(--ga10);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(gasngedge);
}

#gangs-table th.col-gang_projectSubcontractFactor {
  font-size: var(--gahfs);
  width: var(--ga11);
  min-width: var(--ga11);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#gangs-table td.cell-gang_projectSubcontractFactor {
  font-size: var(--gacfs) !important;
  width: var(--ga11);
  min-width: var(--ga11);
  max-width: var(--ga11);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(gasngedge);
}

/* #gangs-table th.col-gang-gangfinlab {
  font-size: var(--gahfs);
  width: var(--ga7);
  min-width: var(--ga7);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#gangs-table td.cell-gang-gangfinlab {
  font-size: var(--gacfs) !important;
  width: var(--ga7);
  min-width: var(--ga7);
  max-width: var(--ga7);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(gasngedge);
}

#gangs-table th.col-gang-gangfinpla {
  font-size: var(--gahfs);
  width: var(--ga8);
  min-width: var(--ga8);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#gangs-table td.cell-gang-gangfinpla {
  font-size: var(--gacfs) !important;
  width: var(--ga8);
  min-width: var(--ga8);
  max-width: var(--ga8);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(gasngedge);
}

#gangs-table th.col-gang-gangfinmat {
  font-size: var(--gahfs);
  width: var(--ga9);
  min-width: var(--ga9);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#gangs-table td.cell-gang-gangfinmat {
  font-size: var(--gacfs) !important;
  width: var(--ga9);
  min-width: var(--ga9);
  max-width: var(--ga9);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(gasngedge);
}

#gangs-table th.col-gang-gangfinsub {
  font-size: var(--gahfs);
  width: var(--ga10);
  min-width: var(--ga10);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#gangs-table td.cell-gang-gangfinsub {
  font-size: var(--gacfs) !important;
  width: var(--ga10);
  min-width: var(--ga10);
  max-width: var(--ga10);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(gasngedge);
}

#gangs-table th.col-gang-gangfinprov {
  font-size: var(--gahfs);
  width: var(--ga11);
  min-width: var(--ga11);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#gangs-table td.cell-gang-gangfinprov {
  font-size: var(--gacfs) !important;
  width: var(--ga11);
  min-width: var(--ga11);
  max-width: var(--ga11);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(gasngedge);
} */


#gangs-table th.col-gang_fin_unit {
  font-size: var(--gahfs);
  width: var(--ga12);
  min-width: var(--ga12);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#gangs-table td.cell-gang_fin_unit {
  font-size: var(--gacfs) !important;
  width: var(--ga12);
  min-width: var(--ga12);
  max-width: var(--ga12);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;

}

/* --- end of Gangs Table -------------------------------- */

/* WBS filter select styling (controls in the BOQ filters bar) */
#boq-filters {
  flex: 1 1 auto;
  align-items: center;
  flex-wrap: wrap;
  border: 0.5rem solid transparent;
  border-radius: 1rem;
  align-items: center;
  place-content: center;
  gap: 0.2rem;
  box-shadow: var(--shadow);
  outline: none;
  font-family: var(--appfontfam);
}

#boq-filters select {
  flex: 1 1 auto;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #d6dbe0;
  background: #aff4cf;
  color: #222;
  min-width: 120px;
  box-sizing: border-box;
  gap: 0.1rem;
  outline: none;
  border-radius: 10px;
  box-shadow: 3px 3px 5px rgba(90, 90, 90, 0.5) inset, -3px -3px 5px rgba(255, 255, 255, 0.5) inset;
}

#boq-filters select:focus {
  outline: 2px solid rgb(10, 79, 16);
  outline-offset: 0;
}

.wbs-label {
  font-size: 12px;
  font-weight: 600;
  align-items: baseline;
}

/* --- Resource Slots Table -------------------------------- */

.re-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  /* enable vertical scrolling when content grows */
  width: 100%;
  -webkit-overflow-scrolling: touch;
  border-radius: 4px;
  /* Fill available space inside .boq-table and allow scrolling */
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.re-scroll table {
  width: 100%;
  table-layout: fixed;
}

.re-scroll thead th {
  position: sticky;
  top: 0;
  background: var(--thc);
  height: var(--thh);
  min-height: var(--thh);
  font-family: var(--appfontfam);
}

#resource-groups-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--retabback);
  font-family: var(--appfontfam);
}

/* #resource-groups-table tr:hover {
  background: #c7dcb5;
} */

#resource-groups-table tr.selected {
  background: var(--rowselectedcolor);
  color: #fdfdfd;
}

/* Make selected rows a bit darker on hover in the colored left-side tables */
/* #resource-groups-table tr.selected:hover {
  background: #5e9fc5;
  transition: background-color 120ms ease;
} */



#resource-groups-table th.col-group_res_id {
  font-size: var(--resfs);
  width: var(--re1);
  min-width: var(--re1);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#resource-groups-table td.cell-group_res_id {
  font-size: var(--resfs);
  width: var(--re2);
  min-width: var(--re2);
  max-width: var(--re2);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 600;
  border-right: var(--redbledge);
}

#resource-groups-table th.col-group_res_slot {
  font-size: var(--recfs);
  width: var(--re2);
  min-width: var(--re2);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#resource-groups-table td.cell-group_res_slot {
  font-size: var(--recfs);
  width: var(--re2);
  min-width: var(--re2);
  max-width: var(--re2);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 600;
  border-right: var(--resngedge);
}

/* #resource-groups-table th.col.group_res_type {
  font-size: var(--rehfs);
  width: var(--re3);
  min-width: var(--re3);
  max-width: var(--re3);
  text-align: left;
  font-weight: 600;
  justify-content: start;
}

#resource-groups-table td.cell.group_res_type {
  font-size: var(--recfs);
  width: var(--re3);
  min-width: var(--re3);
  max-width: var(--re3);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 400;
  border-right: var(--resngedge);
} */

#resource-groups-table th.col-group_res_description {
  font-size: var(--relfs);
  width: var(--re4);
  min-width: var(--re4);
  text-align: left;
  font-weight: 600;
  color: #061b6f;
  justify-content: start;

}

#resource-groups-table td.cell-group_res_description {
  font-size: var(--recfs);
  width: var(--re4);
  min-width: var(--re4);
  max-width: var(--re4);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  justify-content: start;
  font-weight: 400;
  border-right: var(--resngedge);
}

#resource-groups-table th.col-group_res_quantity {
  font-size: var(--rehfs);
  width: var(--re5);
  min-width: var(--re5);
  text-align: right;
  font-weight: 600;
  justify-content: start;
}

#resource-groups-table td.cell-group_res_quantity {
  font-size: var(--recfs);
  width: var(--re5);
  min-width: var(--re5);
  max-width: var(--re5);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(--resngedge);
}



#resource-groups-table th.col-group_res_finLabRate {
  font-size: var(--rehfs);
  width: var(--re6);
  min-width: var(--re6);
  text-align: right;
  font-weight: 600;
  justify-content: start;
}

#resource-groups-table td.cell-group_res_finLabRate {
  font-size: var(--recfs);
  width: var(--re6);
  min-width: var(--re6);
  max-width: var(--re6);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(--resngedge);
}

#resource-groups-table th.col-group_res_finTotPlantRate {
  font-size: var(--rehfs);
  width: var(--re7);
  min-width: var(--re7);
  text-align: right;
  font-weight: 600;
  justify-content: start;
}

#resource-groups-table td.cell-group_res_finTotPlantRate {
  font-size: var(--recfs);
  width: var(--re7);
  min-width: var(--re7);
  max-width: var(--re7);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(--resngedge);
}

#resource-groups-table th.col-group_res_finMatRate {
  font-size: var(--rehfs);
  width: var(--re8);
  min-width: var(--re8);
  text-align: right;
  font-weight: 600;
  justify-content: start;
}

#resource-groups-table td.cell-group_res_finMatRate {
  font-size: var(--recfs);
  width: var(--re8);
  min-width: var(--re8);
  max-width: var(--re8);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(--resngedge);
}

#resource-groups-table th.col-group_res_finSelfRate {
  font-size: var(--rehfs);
  width: var(--re9);
  min-width: var(--re9);
  text-align: right;
  font-weight: 600;
  justify-content: start;
}

#resource-groups-table td.cell-group_res_finSelfRate {
  font-size: var(--recfs);
  width: var(--re9);
  min-width: var(--re9);
  max-width: var(--re9);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(--resngedge);
}

#resource-groups-table th.col-group_res_finUnit {
  font-size: var(--rehfs);
  width: var(--re10);
  min-width: var(--re10);
  text-align: right;
  font-weight: 600;
  justify-content: start;
}

#resource-groups-table td.cell-group_res_finUnit {
  font-size: var(--recfs);
  width: var(--re10);
  min-width: var(--re10);
  max-width: var(--re10);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: bottom;
  justify-content: start;
  font-weight: 700;
  border-right: var(--resngedge);
}

/* --- end of Resource Slots Table -------------------------------- */


/* BUTTONS -----------------------------------------------------------------*/

#btn-boq-close,
#btn-recalc-all {
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0.5rem solid transparent;
  border-radius: 1rem;
  color: hsl(0 0% 10%);
  background: var(--sbtnfacecol);
  place-content: center;
  gap: 0.2rem;
  box-shadow: var(--shadow);
  outline: none;
  transition: all 0.1s;

  &:hover,
  &:focus-visible {
    color: hsl(115, 81%, 28%);
    scale: 1.1;
  }

  &:active {
    box-shadow:
      var(--shadow),
      inset .5rem .5rem 1rem hsl(0 0% 50% / .5),
      inset -.5rem -.5rem 1rem hsl(0 0% 100% / .75);
    color: hsl(115, 81%, 28%);
  }

  &:disabled {
    opacity: 0.5;
    cursor: default;
  }
}


/* .modal-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--appfontfam);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
} */


/* .modal-btn-secondary {
  background: linear-gradient(145deg, #e5e7eb, #d1d5db);
  color: #374151;
  box-shadow:
    4px 4px 8px rgba(0, 0, 0, 0.15),
    -2px -2px 4px rgba(255, 255, 255, 0.8);
}

.modal-btn-secondary:hover {
  background: linear-gradient(145deg, #d1d5db, #9ca3af);
  transform: translateY(-1px);
  box-shadow:
    6px 6px 12px rgba(0, 0, 0, 0.2),
    -3px -3px 6px rgba(255, 255, 255, 0.9);
}

.modal-btn-secondary:active {
  transform: translateY(0);
  box-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.15),
    inset 2px 2px 4px rgba(0, 0, 0, 0.05);
} */

#btn-keytrade-manager,
#btn-cbs-manager,
#btn-dims-manager,
#btn-output-factors,
#btn-rereference-boq,
#btn-trade-rate-methods,
#btn-quotations,
#btn-project-summary,
#btn-trade-summary,
#export-bq-to-excel,
#btn-edit-pricingnote,
#btn-add-billitem,
#btn-add-billitem-from-master,
#btn-edit-billitem,
#btn-delete-billitem,
#btn-open-master-pn,
#btn-delete-pricingnote,
#btn-pricing-adjustments,
#btn-add-pricingnote,
#btn-create-resource-group,
#btn-edit-resource-group,
#btn-delete-resource-group,
#btn-show-resource-usage,
#btn-edit-project-resources,
#btn-edit-resources,
#resource_usage,
#btn-wbs-manager,
#btn-add-gang,
#btn-edit-gang,
#btn-delete-gang,
#btn-clone-gang {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--appfontfam);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
  background: var(--butgrad);
  color: #374151;
  box-shadow:
    4px 4px 8px rgba(0, 0, 0, 0.15),
    -2px -2px 4px rgba(255, 255, 255, 0.8);
}

#btn-keytrade-manager:hover,
#btn-cbs-manager:hover,
#btn-dims-manager:hover,
#btn-output-factors:hover,
#btn-rereference-boq:hover,
#btn-trade-rate-methods:hover,
#btn-quotations:hover,
#btn-project-summary:hover,
#btn-trade-summary:hover,
#export-bq-to-excel:hover,
#btn-edit-pricingnote:hover,
#btn-add-billitem:hover,
#btn-add-billitem-from-master:hover,
#btn-edit-billitem:hover,
#btn-delete-billitem:hover,
#btn-open-master-pn:hover,
#btn-delete-pricingnote:hover,
#btn-pricing-adjustments:hover,
#btn-add-pricingnote:hover,
#btn-create-resource-group:hover,
#btn-edit-resource-group:hover,
#btn-delete-resource-group:hover,
#btn-show-resource-usage:hover,
#btn-edit-project-resources:hover,
#btn-edit-resources:hover,
#resource_usage:hover,
#btn-wbs-manager:hover,
#btn-add-gang:hover,
#btn-edit-gang:hover,
#btn-delete-gang:hover,
#btn-clone-gang:hover {
  background: linear-gradient(145deg, #d1d5db, #9ca3af);
  transform: translateY(-1px);
  box-shadow:
    6px 6px 12px rgba(0, 0, 0, 0.2),
    -3px -3px 6px rgba(255, 255, 255, 0.9);
}

#btn-keytrade-manager:active,
#btn-cbs-manager:active,
#btn-dims-manager:active,
#btn-output-factors:active,
#btn-rereference-boq:active,
#btn-trade-rate-methods:active,
#btn-quotations:active,
#btn-project-summary:active,
#btn-trade-summary:active,
#export-bq-to-excel:active,
#btn-edit-pricingnote:active,
#btn-add-billitem:active,
#btn-add-billitem-from-master:active,
#btn-edit-billitem:active,
#btn-delete-billitem:active,
#btn-open-master-pn:active,
#btn-delete-pricingnote:active,
#btn-pricing-adjustments:active,
#btn-add-pricingnote:active,
#btn-create-resource-group:active,
#btn-edit-resource-group:active,
#btn-delete-resource-group:active,
#btn-show-resource-usage:active,
#btn-edit-project-resources:active,
#btn-edit-resources:active,
#resource_usage:active,
#btn-wbs-manager:active,
#btn-add-gang:active,
#btn-edit-gang:active,
#btn-delete-gang:active,
#btn-clone-gang:active {
  transform: translateY(0);
  box-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.15),
    inset 2px 2px 4px rgba(0, 0, 0, 0.05);
}

#btn-keytrade-manager:disabled,
#btn-cbs-manager:disabled,
#btn-dims-manager:disabled,
#btn-output-factors:disabled,
#btn-rereference-boq:disabled,
#btn-trade-rate-methods:disabled,
#btn-quotations:disabled,
#btn-project-summary:disabled,
#btn-trade-summary:disabled,
#export-bq-to-excel:disabled,
#btn-edit-pricingnote:disabled,
#btn-add-billitem:disabled,
#btn-add-billitem-from-master:disabled,
#btn-edit-billitem:disabled,
#btn-delete-billitem:disabled,
#btn-open-master-pn:disabled,
#btn-delete-pricingnote:disabled,
#btn-pricing-adjustments:disabled,
#btn-add-pricingnote:disabled,
#btn-create-resource-group:disabled,
#btn-edit-resource-group:disabled,
#btn-delete-resource-group:disabled,
#btn-show-resource-usage:disabled,
#btn-edit-project-resources:disabled,
#btn-edit-resources:disabled,
#resource_usage:disabled,
#btn-wbs-manager:disabled,
#btn-add-gang:disabled,
#btn-edit-gang:disabled,
#btn-delete-gang:disabled,
#btn-clone-gang:disabled {
  opacity: 0.5;
  cursor: default;
}

#boq-prev-page,
#boq-next-page,
#wbs-filters-reset {
  padding: 4px 4px;
  font-size: 12px;
  line-height: 1;
  border-radius: 6px;
  min-width: 38px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  margin-right: 2px;
}

#boq-prev-page:disabled {
  opacity: 0.5;
  cursor: default;
}

#boq-next-page:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Inline pagination info placed to the right of Next when controls are inline */
.boq-page-info {
  display: inline-block;
  align-items: center;
  margin-left: 4px;
  margin-right: 4px;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  font-family: var(--appfontfam);
}

/* SELECTION TOAST TOGGLE -----------------------------------------------------------------*/
#__estapp_selection_header {
  font-family: var(--appfontfam);
  /* visibility: hidden; */
  font-size: 8px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: hsla(0, 6%, 63%, 0.75);
  color: #f9f8f8;
  padding: 6px 10px;
  z-index: 9999;
  display: flex;
  gap: 12px;
  align-items: center;
}


.wbs-select {
  appearance: none;
  /* remove native arrow */
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 6px 72px 6px 8px;
  /* increased space for CSS caret on right */
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background-color: #f3f4f6;
  /* light surface */
  box-shadow: inset 6px 6px 12px rgba(0, 0, 0, 0.06), inset -6px -6px 12px rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.2;
  background-image: none;
  /* disable SVG background; use label ::after for caret */
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px 14px;
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
  overflow: hidden;
  /* ensure selected text truncates if too long */
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hide native dropdown arrow for some engines (IE/Edge) */
.wbs-select::-ms-expand {
  display: none;
}

/* Container label for the select so we can draw a caret with ::after reliably */
.wbs-label {
  position: relative;
  display: inline-flex;
  align-items: left;
  min-width: 0;
}

.wbs-label::after {
  content: '';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid #666;
  pointer-events: none;
}

.wbs-select:focus {
  outline: none;
  border-color: rgba(0, 120, 215, 0.6);
  box-shadow: inset 6px 6px 12px rgba(0, 0, 0, 0.06), inset -6px -6px 12px rgba(255, 255, 255, 0.7), 0 0 0 3px rgba(0, 120, 215, 0.06);
}


label>.wbs-select {
  vertical-align: middle;
}


/* Prominent Centered Toast start --------------------------------------*/
#toast-root {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 14000;
  pointer-events: none;
  display: grid;
  gap: 12px;
}

#toast-root .toast {
  display: inline-block;
  text-align: center;
  min-width: 280px;
  max-width: min(80vw, 640px);
  padding: 16px 22px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #ffffff;
  background: #46bb4c;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: none;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
}

#toast-root .toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#toast-root .toast.error {
  background: #b00020;
}

/* Prominent Centered Toast End --------------------------------------*/

/* Modal Styles - Bill Item Edit Modal ----------------------------------*/
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 15000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-container {
  background: var(--estback);
  border-radius: 20px;
  box-shadow:
    20px 20px 40px rgba(0, 0, 0, 0.3),
    -20px -20px 40px rgba(255, 255, 255, 0.1),
    inset 2px 2px 4px rgba(255, 255, 255, 0.2),
    inset -2px -2px 4px rgba(0, 0, 0, 0.1);
  max-width: 900px;
  max-height: 90vh;
  width: 90%;
  display: flex;
  flex-direction: column;
  font-family: var(--appfontfam);
  overflow: hidden;
  transform: scale(0.9);
  animation: modalScaleIn 0.3s ease-out forwards;
}

@keyframes modalScaleIn {
  to {
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
  border-radius: 20px 20px 0 0;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #333;
  font-family: var(--appfontfam);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #333;
  transform: scale(1.1);
}

.modal-content {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
  background: var(--estback);
}

.modal-form {
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: start;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  font-family: var(--appfontfam);
  margin-bottom: 4px;
}

.form-input,
.form-textarea,
.form-select {
  padding: 12px 15px;
  border: none;
  border-radius: 12px;
  background: var(--estback);
  box-shadow:
    inset 4px 4px 8px rgba(0, 0, 0, 0.1),
    inset -4px -4px 8px rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-family: var(--appfontfam);
  color: #333;
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  box-shadow:
    inset 6px 6px 12px rgba(0, 0, 0, 0.15),
    inset -6px -6px 12px rgba(255, 255, 255, 0.9),
    0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
  font-family: var(--appfontfam);
}

.form-input.readonly,
.form-input[readonly] {
  background: #e0e0e0;
  color: #666;
  cursor: not-allowed;
  box-shadow:
    inset 2px 2px 4px rgba(0, 0, 0, 0.08),
    inset -2px -2px 4px rgba(255, 255, 255, 0.3);
}

.form-select:disabled {
  background: #f5f5f5;
  color: #666;
  cursor: not-allowed;
  box-shadow:
    inset 2px 2px 4px rgba(0, 0, 0, 0.05),
    inset -2px -2px 4px rgba(255, 255, 255, 0.5);
  opacity: 0.7;
}

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  padding: 20px 25px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
  border-radius: 0 0 20px 20px;
}

.modal-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--appfontfam);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.modal-btn-primary {
  background: linear-gradient(145deg, #4ade80, #22c55e);
  color: white;
  box-shadow:
    4px 4px 8px rgba(0, 0, 0, 0.2),
    -2px -2px 4px rgba(255, 255, 255, 0.1);
}

.modal-btn-primary:hover {
  background: linear-gradient(145deg, #22c55e, #16a34a);
  transform: translateY(-1px);
  box-shadow:
    6px 6px 12px rgba(0, 0, 0, 0.25),
    -3px -3px 6px rgba(255, 255, 255, 0.15);
}

.modal-btn-primary:active {
  transform: translateY(0);
  box-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.2),
    inset 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-btn-secondary {
  background: linear-gradient(145deg, #e5e7eb, #d1d5db);
  color: #374151;
  box-shadow:
    4px 4px 8px rgba(0, 0, 0, 0.15),
    -2px -2px 4px rgba(255, 255, 255, 0.8);
}

.modal-btn-secondary:hover {
  background: linear-gradient(145deg, #d1d5db, #9ca3af);
  transform: translateY(-1px);
  box-shadow:
    6px 6px 12px rgba(0, 0, 0, 0.2),
    -3px -3px 6px rgba(255, 255, 255, 0.9);
}

.modal-btn-secondary:active {
  transform: translateY(0);
  box-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.15),
    inset 2px 2px 4px rgba(0, 0, 0, 0.05);
}

/* Responsive adjustments for modal */
@media (max-width: 768px) {
  .modal-container {
    width: 95%;
    max-height: 95vh;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .modal-header,
  .modal-content,
  .modal-footer {
    padding: 15px 20px;
  }
}

/* Modal End --------------------------------------*/

/* Bill Item Modal Styles - Two Column Layout */
#billitem-edit-modal .modal-container,
#billitem-add-modal .modal-container {
  max-width: 1400px;
  width: 95%;
  max-height: 90vh;
}

#billitem-edit-modal .modal-content,
#billitem-add-modal .modal-content {
  max-height: calc(90vh - 150px);
  overflow-y: auto;
}

#billitem-edit-modal .form-grid,
#billitem-add-modal .form-grid {
  grid-template-columns: 1fr 1fr;
  gap: 20px 30px;
}

/* Responsive: single column on smaller screens */
@media (max-width: 1024px) {
  #billitem-edit-modal .form-grid,
  #billitem-add-modal .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Pricing Note Modal Styles - Two Column Layout */
#pricingnote-edit-modal .modal-container,
#pricingnote-add-modal .modal-container {
  max-width: 1400px;
  width: 95%;
  max-height: 90vh;
}

#pricingnote-edit-modal .modal-content,
#pricingnote-add-modal .modal-content {
  max-height: calc(90vh - 150px);
  overflow-y: auto;
}

#pricingnote-edit-modal .form-grid,
#pricingnote-add-modal .form-grid {
  grid-template-columns: 1fr 1fr;
  gap: 20px 30px;
}

/* Responsive: single column on smaller screens */
@media (max-width: 1024px) {
  #pricingnote-edit-modal .form-grid,
  #pricingnote-add-modal .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Gang Modal Styles - Two Column Layout */
#gang-edit-modal .modal-container,
#gang-add-modal .modal-container {
  max-width: 1400px;
  width: 95%;
  max-height: 90vh;
}

#gang-edit-modal .modal-content,
#gang-add-modal .modal-content {
  max-height: calc(90vh - 150px);
  overflow-y: auto;
}

#gang-edit-modal .form-grid,
#gang-add-modal .form-grid {
  grid-template-columns: 1fr 1fr;
  gap: 20px 30px;
}

/* Responsive: single column on smaller screens */
@media (max-width: 1024px) {
  #gang-edit-modal .form-grid,
  #gang-add-modal .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Resource Group Modal Styles */
#resourcegroup-create-modal .modal-container,
#resourcegroup-edit-modal .modal-container {
  max-width: 1200px;
  width: 95%;
}

#resourcegroup-create-modal .form-grid,
#resourcegroup-edit-modal .form-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.resgroup-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 10px;
}

.resgroup-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resgroup-column label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 5px;
}

.resgroup-list-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 5px;
  background: #fafafa;
  border-radius: 4px;
}

.resgroup-list-container table {
  width: 100%;
  font-size: 0.9em;
  border-collapse: collapse;
}

.resgroup-list-container th {
  background: #e0e0e0;
  padding: 6px;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
}

.resgroup-list-container td {
  padding: 4px 6px;
  border-bottom: 1px solid #eee;
}

.resgroup-list-container tbody tr {
  cursor: pointer;
}

.resgroup-list-container tbody tr:hover {
  background: #e3f2fd;
}

.resgroup-list-container tbody tr.resource-selected {
  background: #bbdefb;
  border-left: 3px solid #2196F3;
}

.resgroup-list-container tbody tr.resource-selected:hover {
  background: #90caf9;
}

/* Clone Modal Inline Style Replacements */
.clone-filters {
  margin: 8px 0;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.clone-filters label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
}

.clone-filters select,
.clone-filters .wbs-select {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #d6dbe0;
  background: #aff4cf;
  color: #222;
  min-width: 120px;
  border-radius: 10px;
  box-shadow: 3px 3px 5px rgba(90, 90, 90, 0.5) inset, -3px -3px 5px rgba(255, 255, 255, 0.5) inset;
  font-family: var(--appfontfam);
}

.clone-filters select:focus,
.clone-filters .wbs-select:focus {
  outline: 2px solid rgb(10, 79, 16);
  outline-offset: 0;
}

.clone-filter-box {
  padding: 8px;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fff;
}

.clone-filter-box h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
}

.clone-filter-summary {
  font-size: 13px;
  color: #333;
}

/* Utility classes to avoid CSP violations */
.text-right {
  text-align: right;
}

.cursor-pointer {
  cursor: pointer;
}

.input-width-60 {
  width: 60px;
}

/* Project Summary Modal Styles */
#project-summary-modal .modal-container,
#trade-summary-modal .modal-container {
  width: min(96vw, 1580px);
  max-width: 1580px;
}

#resource-usage-modal .modal-container {
  width: min(97vw, 1680px);
  max-width: 1680px;
}

.summary-section {
  margin-bottom: 30px;
}

.summary-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e7eb;
}

.summary-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--butgrad);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 
    4px 4px 8px rgba(0, 0, 0, 0.15),
    -2px -2px 4px rgba(255, 255, 255, 0.8);
  table-layout: fixed;
}

.summary-table thead {
  background: linear-gradient(145deg, #e5e7eb, #d1d5db);
}

.summary-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #374151;
  border-bottom: 2px solid #9ca3af;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

.summary-table th:first-child,
.summary-table td:first-child {
  width: 30%;
  white-space: normal;
}

.summary-table th:not(:first-child):not(:last-child),
.summary-table td:not(:first-child):not(:last-child) {
  width: 8.75%;
}

.summary-table th:last-child,
.summary-table td:last-child {
  width: 8.75%;
  font-weight: bold;
}

.summary-table th:not(:last-child) {
  border-right: 1px solid #d1d5db;
}

.summary-table td {
  padding: 10px 16px;
  font-size: 13px;
  color: #1f2937;
  border-bottom: 1px solid #e5e7eb;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

.summary-table td:not(:last-child) {
  border-right: 1px solid #e5e7eb;
}

.summary-table tbody tr:hover {
  background: linear-gradient(145deg, #f3f4f6, #e5e7eb);
}

.summary-table tbody tr:last-child td {
  border-bottom: none;
}

.summary-table .text-right {
  text-align: right;
}

.summary-table .col-description {
  width: 25%;
  white-space: normal;
}

.summary-table .col-value {
  width: 10.71%;
}

.summary-table .col-total {
  width: 10.71%;
  font-weight: bold;
}

.summary-table .total-row {
  font-weight: 600;
  background: linear-gradient(145deg, #dbeafe, #bfdbfe);
  border-top: 2px solid #3b82f6;
}

.summary-table .grand-total-row {
  font-weight: 700;
  font-size: 14px;
  background: linear-gradient(145deg, #dbeafe, #93c5fd);
  border-top: 3px solid #2563eb;
}

/* Resource Usage Table Cell Styles */
.summary-table .resource-id-cell {
  width: 10% !important;
}

.summary-table .resource-description-cell {
  width: 38% !important;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.summary-table .resource-unit-cell {
  width: 8% !important;
}

.summary-table .resource-qty-cell {
  width: 14% !important;
}

.summary-table .resource-rate-cell {
  width: 12% !important;
}

.summary-table .resource-value-cell {
  width: 18% !important;
}

.summary-table .resource-subcontract-factor-cell {
  width: 13% !important;
}

.summary-table .resource-total-with-factor-cell {
  width: 13% !important;
}

.summary-table.self-table .resource-id-cell { width: 10% !important; }
.summary-table.self-table .resource-description-cell { width: 38% !important; }
.summary-table.self-table .resource-unit-cell { width: 8% !important; }
.summary-table.self-table .resource-qty-cell { width: 14% !important; }
.summary-table.self-table .resource-rate-cell { width: 12% !important; }
.summary-table.self-table .resource-value-cell { width: 18% !important; }

.summary-table.subcontract-table .resource-id-cell { width: 8% !important; }
.summary-table.subcontract-table .resource-description-cell { width: 26% !important; }
.summary-table.subcontract-table .resource-unit-cell { width: 6% !important; }
.summary-table.subcontract-table .resource-qty-cell { width: 12% !important; }
.summary-table.subcontract-table .resource-rate-cell { width: 10% !important; }
.summary-table.subcontract-table .resource-value-cell { width: 12% !important; }
.summary-table.subcontract-table .resource-subcontract-factor-cell { width: 13% !important; }
.summary-table.subcontract-table .resource-total-with-factor-cell { width: 13% !important; }

.summary-table .resource-empty-cell {
  text-align: center;
  color: #6b7280;
}

.wbs-level-table {
  margin-bottom: 25px;
}

.wbs-level-table h4 {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 10px;
}

/* ========================================
   MODAL STYLES
   ======================================== */

/* Modal Overlay - full screen backdrop */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-in-out;
}

.modal-overlay[aria-hidden="false"] {
  display: flex;
}

/* Modal Container - the actual modal box */
.modal-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease-out;
  overflow: hidden;
}

/* Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 2px solid #e5e7eb;
  background: linear-gradient(145deg, #f9fafb, #f3f4f6);
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  font-family: var(--appfontfam);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background-color: #fee2e2;
  color: #dc2626;
}

/* Modal Content */
.modal-content {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  font-family: var(--appfontfam);
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: #f3f4f6;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background: linear-gradient(145deg, #f9fafb, #ffffff);
}

/* Modal Buttons */
.modal-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--appfontfam);
  box-shadow: var(--shadow);
}

.modal-btn-primary {
  background: linear-gradient(145deg, #3b82f6, #2563eb);
  color: white;
}

.modal-btn-primary:hover {
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.modal-btn-primary:active {
  transform: translateY(0);
}

.modal-btn-secondary {
  background: linear-gradient(145deg, #e5e7eb, #d1d5db);
  color: #374151;
}

.modal-btn-secondary:hover {
  background: linear-gradient(145deg, #d1d5db, #9ca3af);
  transform: translateY(-1px);
}

.modal-btn-secondary:active {
  transform: translateY(0);
}

.modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-btn:disabled:hover {
  transform: none;
}

/* Form elements inside modals */
.modal-content .form-group {
  margin-bottom: 16px;
}

.modal-content .form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  align-items: baseline;
}

.modal-content .form-control,
.modal-content .form-select,
.modal-content .form-input {
  width: 100%;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #d6dbe0;
  background: #aff4cf;
  color: #222;
  border-radius: 10px;
  box-shadow: 3px 3px 5px rgba(90, 90, 90, 0.5) inset, -3px -3px 5px rgba(255, 255, 255, 0.5) inset;
  transition: all 0.2s ease;
  font-family: var(--appfontfam);
  box-sizing: border-box;
}

.modal-content .form-control:focus,
.modal-content .form-select:focus,
.modal-content .form-input:focus {
  outline: 2px solid rgb(10, 79, 16);
  outline-offset: 0;
}

.modal-content .form-control:disabled,
.modal-content .form-select:disabled,
.modal-content .form-input:disabled,
.modal-content .form-input[readonly],
.modal-content .form-input.readonly {
  background-color: #e0e0e0;
  color: #666;
  cursor: not-allowed;
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.08), inset -2px -2px 4px rgba(255, 255, 255, 0.3);
}

.modal-content textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Radio button groups in modals */
.modal-content .radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.modal-content .radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
}

.modal-content input[type="radio"] {
  cursor: pointer;
}

/* Checkbox groups in modals */
.modal-content .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
}

.modal-content input[type="checkbox"] {
  cursor: pointer;
}

/* Table inside modals */
.modal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.modal-content table th,
.modal-content table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
}

.modal-content table th {
  background: linear-gradient(145deg, #f3f4f6, #e5e7eb);
  font-weight: 600;
  color: #374151;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-content table tbody tr:hover {
  background: #f9fafb;
  cursor: pointer;
}

.modal-content table tbody tr.selected {
  background: var(--rowselectedcolor);
  color: white;
}

/* Help text in modals */
.modal-content .help-text {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  font-style: italic;
}

/* Alert messages in modals */
.modal-content .alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

.modal-content .alert-info {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1e40af;
}

.modal-content .alert-warning {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.modal-content .alert-error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.modal-content .alert-success {
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive modal sizes */
@media (max-width: 768px) {
  .modal-container {
    width: 95%;
    max-height: 95vh;
  }
  
  .modal-header {
    padding: 16px 20px;
  }
  
  .modal-title {
    font-size: 18px;
  }
  
  .modal-content {
    padding: 20px;
  }
  
  .modal-footer {
    padding: 12px 20px;
    flex-wrap: wrap;
  }
  
  .modal-btn {
    flex: 1;
    min-width: 100px;
  }
}

/* Large modals (for summaries, reports, etc.) */
.modal-container.modal-large {
  max-width: 1200px;
}

.modal-container.modal-medium {
  max-width: 800px;
}

.modal-container.modal-small {
  max-width: 400px;
}

/* Additional utility classes for modal content */
.summary-section {
  margin-top: 30px;
}

.summary-section:first-child {
  margin-top: 0;
}

/* Adjustments table columns */
.col-primary-group {
  width: 60%;
  text-align: left;
}

.col-gang-count {
  width: 20%;
  text-align: center;
}

.col-subcontract-factor {
  width: 20%;
  text-align: center;
}

/* Resource group modal styles */
.resgroup-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.button-group {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.button-group .modal-btn {
  flex: 1;
}

/* Form grid layouts */
.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid-3col {
  grid-template-columns: repeat(3, 1fr);
}

.form-group-full {
  grid-column: span 3;
}

@media (max-width: 768px) {
  .form-grid-3col {
    grid-template-columns: 1fr;
  }
  
  .form-group-full {
    grid-column: span 1;
  }
  
  .filter-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   QUOTATIONS MODAL STYLES
   ======================================== */

/* Quotations table container */
#quotations-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

/* Table header styling */
#quotations-table thead {
  position: sticky;
  top: 0;
  background: #f5f5f5;
  z-index: 10;
}

/* Table footer styling */
#quotations-table tfoot {
  position: sticky;
  bottom: 0;
  background: #e8f4f8;
  z-index: 10;
}

/* Color scheme for rate method groups */
.qm-color-fixed { background: #f5f5f5; }
.qm-color-self { background: #e3f2fd; }
.qm-color-self-light { background: #f9fcff; }
.qm-color-self-selected { background: #bbdefb; }
.qm-color-subcontract { background: #fff3e0; }
.qm-color-subcontract-light { background: #fffaf5; }
.qm-color-subcontract-selected { background: #ffe0b2; }
.qm-color-costplan { background: #f3e5f5; }
.qm-color-costplan-light { background: #faf5fb; }
.qm-color-costplan-selected { background: #e1bee7; }
.qm-color-quoted { background: #e8f5e9; }
.qm-color-quoted-light { background: #f9fdf9; }
.qm-color-quoted-selected { background: #c8e6c9; }
.qm-color-supplier { background: #fff8e8; }
.qm-color-supplier-light { background: #fffef8; }
.qm-color-supplier-selected { background: #c8e6c9; }

/* Header row 1 - Top level group headers */
.qm-header-group {
  padding: 8px;
  text-align: center;
  border-bottom: 1px solid #ddd;
  font-weight: bold;
}

.qm-header-group-right-border {
  border-right: 2px solid #999;
}

/* Header row 2 - Sub-column headers */
.qm-header-subcol {
  padding: 8px;
  border-bottom: 2px solid #333;
  min-width: 90px;
}

.qm-header-subcol-right {
  text-align: right;
}

.qm-header-subcol-center {
  text-align: center;
}

.qm-header-subcol-left {
  text-align: left;
}

.qm-header-subcol-total {
  min-width: 100px;
}

/* Sticky column styles */
.qm-sticky-left-0 {
  position: sticky;
  left: 0;
  z-index: 12;
  min-width: 100px;
}

.qm-sticky-left-100 {
  position: sticky;
  left: 100px;
  z-index: 12;
  min-width: 200px;
}

.qm-sticky-bg-header {
  background: #f5f5f5;
}

.qm-sticky-bg-data {
  background: white;
}

.qm-sticky-bg-total {
  background: #e8f4f8;
}

/* Data cells */
.qm-cell {
  padding: 6px 8px;
}

.qm-cell-right {
  text-align: right;
}

.qm-cell-center {
  text-align: center;
}

.qm-cell-description {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Totals row */
.qm-total-cell {
  padding: 8px;
  font-weight: bold;
}

.qm-total-border-top {
  border-top: 3px double #333;
}

/* Current method dropdown */
.qm-method-select {
  width: 100%;
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
}

/* Supplier rate input */
.qm-supplier-rate-input {
  width: 100%;
  padding: 4px;
  text-align: right;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 11px;
}

/* Supplier select all button */
.qm-select-all-btn {
  padding: 2px 8px;
  font-size: 10px;
  cursor: pointer;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 3px;
  transition: background 0.2s;
}

.qm-select-all-btn:hover {
  background: #45a049;
}

/* Supplier header container */
.qm-supplier-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.qm-supplier-name {
  font-weight: bold;
}

/* Table row styling */
#quotations-table tbody tr {
  border-bottom: 1px solid #eee;
}

#quotations-table tbody tr:hover {
  background-color: #f9f9f9;
}

/* Group separators */
.qm-group-border-right {
  border-right: 2px solid #999;
}

/* Quotations modal container */
#quotations-modal .modal-container {
  max-width: 98%;
  max-height: 95vh;
}

#quotations-modal .modal-content {
  padding: 15px;
}

/* Filter controls */
.qm-filter-controls {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.qm-filter-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.qm-filter-group label {
  margin: 0;
}

#quotations-trade-filter {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 200px;
}

.qm-btn-add-supplier {
  margin-left: auto;
}

/* Table wrapper */
.qm-table-wrapper {
  overflow: auto;
  max-height: calc(95vh - 250px);
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Summary box */
#quotations-summary {
  margin-top: 15px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 4px;
  font-size: 13px;
}

/* ============================================
   WBS Manager Modal Styles
   ============================================ */

#wbs-manager-modal .modal-container {
  width: 95vw !important;
  max-width: 95vw !important;
}

/* ============================================
   CBS Manager Modal Styles
   ============================================ */

#cbs-manager-modal .modal-container {
  width: 90vw !important;
  max-width: 90vw !important;
}

.cbs-manager-container {
  width: 100%;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
}

.cbs-selection-section {
  background: #f5f5f5;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.cbs-selection-section h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
}

.cbs-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 15px;
}

.cbs-field label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.cbs-field select {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background: white;
  max-width: 520px;
  min-width: 300px;
}

.cbs-field input[type="search"] {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background: white;
  max-width: 520px;
  min-width: 300px;
}

.cbs-overwrite-field {
  margin-bottom: 15px;
}

.cbs-overwrite-field label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.cbs-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

#cbs-summary-modal .modal-container {
  width: 94vw !important;
  max-width: 94vw !important;
}

.cbs-summary-container {
  width: 100%;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
}

.cbs-summary-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

#cbs-summary-count {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: #666;
}

.cbs-summary-table-wrapper {
  flex: 1;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-height: 420px;
  max-height: 65vh;
}

.cbs-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cbs-summary-table thead {
  position: sticky;
  top: 0;
  background: #f5f5f5;
  z-index: 10;
}

.cbs-summary-table th {
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
  white-space: nowrap;
}

.cbs-summary-table td {
  padding: 8px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.cbs-summary-table td.cbs-summary-right {
  text-align: right;
}

.cbs-summary-input {
  width: 150px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
}

#dims-modal .modal-container {
  width: 96vw !important;
  max-width: 96vw !important;
  height: 96vh !important;
  max-height: 96vh !important;
}

.dims-container {
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

#dims-modal .modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dims-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dims-current-item,
.dims-current-unit,
.dims-current-rounding,
.dims-current-desc,
.dims-current-total {
  background: #f5f5f5;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 10px;
  font-size: 13px;
}

.dims-unit-input {
  margin-left: 8px;
  width: 140px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  background: white;
}

.dims-rounding-input {
  margin-left: 8px;
  width: 90px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  background: white;
}

.dims-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.dims-constants-panel {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dims-constants-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.dims-constants-header h3 {
  margin: 0;
  font-size: 15px;
}

.dims-constants-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dims-constants-filter-label {
  font-size: 12px;
  color: #374151;
}

.dims-constants-group-filter {
  min-width: 140px;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
}

.dims-constants-table-wrapper {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  max-height: none;
  background: white;
}

.dims-slots-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dims-constants-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.dims-constants-table thead {
  position: sticky;
  top: 0;
  background: #f5f5f5;
  z-index: 5;
}

.dims-constants-table th,
.dims-constants-table td {
  border-bottom: 1px solid #eee;
  padding: 6px;
  white-space: nowrap;
}

.dims-constants-input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
}

.dims-constants-final {
  text-align: right;
  font-weight: 600;
}

.dims-constants-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

#dims-row-count {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: #666;
}

.dims-table-wrapper {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  max-height: none;
}

.dims-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.dims-table thead {
  position: sticky;
  top: 0;
  background: #f5f5f5;
  z-index: 10;
}

.dims-table th {
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
  white-space: nowrap;
}

.dims-table td {
  padding: 6px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.dims-table th:nth-child(1),
.dims-table td:nth-child(1) {
  width: 70px;
}

.dims-table th:nth-child(4),
.dims-table td:nth-child(4),
.dims-table th:nth-child(5),
.dims-table td:nth-child(5),
.dims-table th:nth-child(6),
.dims-table td:nth-child(6) {
  width: 80px;
}

.dims-table th:nth-child(2),
.dims-table td:nth-child(2),
.dims-table th:nth-child(3),
.dims-table td:nth-child(3) {
  width: 110px;
}

.dims-table th:nth-child(7),
.dims-table td:nth-child(7),
.dims-table th:nth-child(8),
.dims-table td:nth-child(8),
.dims-table th:nth-child(9),
.dims-table td:nth-child(9) {
  width: 220px;
}

.dims-table th:nth-child(10),
.dims-table td:nth-child(10) {
  width: 95px;
}

.dims-table th:nth-child(11),
.dims-table td:nth-child(11) {
  width: 260px;
}

.dims-table th:nth-child(12),
.dims-table td:nth-child(12) {
  width: 420px;
}

.dims-table th:nth-child(13),
.dims-table td:nth-child(13) {
  width: 70px;
}

.dims-input,
.dims-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  background: white;
}

.dims-textarea {
  min-height: 30px;
  resize: vertical;
}

.dims-total-cell {
  text-align: right;
  font-weight: 600;
}

#dims-pdf-modal .modal-container {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
}

.estappbody {
  --dims-bg: radial-gradient(circle at 12% 8%, #1b283f 0%, #101725 45%, #09101b 100%);
  --dims-panel: rgba(15, 23, 42, 0.88);
  --dims-panel-soft: rgba(30, 41, 59, 0.88);
  --dims-border: rgba(148, 163, 184, 0.35);
  --dims-text: #e5ecf8;
  --dims-muted: #9fb0cc;
  --dims-input: rgba(15, 23, 42, 0.9);
  --dims-input-border: rgba(148, 163, 184, 0.45);
  --dims-header: linear-gradient(125deg, rgba(37, 99, 235, 0.24), rgba(2, 132, 199, 0.18));
  --dims-action: linear-gradient(135deg, #22c55e, #16a34a);
  --dims-secondary: linear-gradient(135deg, #334155, #1e293b);
  --dims-accent: linear-gradient(135deg, #3b82f6, #1d4ed8);
  --dims-shadow: 0 14px 38px rgba(5, 10, 20, 0.5);
}

.estappbody[data-theme="light"] {
  --dims-bg: radial-gradient(circle at 5% 5%, #f0f7ff 0%, #eef4ff 40%, #e9eef8 100%);
  --dims-panel: rgba(255, 255, 255, 0.94);
  --dims-panel-soft: rgba(247, 250, 255, 0.96);
  --dims-border: rgba(148, 163, 184, 0.45);
  --dims-text: #0f172a;
  --dims-muted: #334155;
  --dims-input: rgba(255, 255, 255, 0.95);
  --dims-input-border: rgba(148, 163, 184, 0.55);
  --dims-header: linear-gradient(125deg, rgba(147, 197, 253, 0.45), rgba(191, 219, 254, 0.34));
  --dims-action: linear-gradient(135deg, #16a34a, #15803d);
  --dims-secondary: linear-gradient(135deg, #cbd5e1, #94a3b8);
  --dims-accent: linear-gradient(135deg, #2563eb, #1e40af);
  --dims-shadow: 0 14px 38px rgba(30, 41, 59, 0.16);
}

.dims-pdf-container {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--dims-text);
  background: var(--dims-bg);
  animation: dims-enter 220ms ease-out;
}

@keyframes dims-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dims-pdf-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 6px;
}

.dims-pdf-toolbar-group {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--dims-border);
  background: var(--dims-panel);
  backdrop-filter: blur(8px);
}

.dims-pdf-group-title {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dims-muted);
  font-weight: 700;
}

.dims-pdf-field-row {
  display: grid;
  gap: 4px;
}

.dims-pdf-spot-finish-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.dims-pdf-finish-icon-btn {
  width: 100%;
  min-height: 31px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.dims-pdf-scale-actions-primary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  grid-column: 1 / -1;
}

.dims-pdf-scale-actions-secondary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  grid-column: 1 / -1;
}

.dims-scale-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.dims-pdf-button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.dims-pdf-button-grid-single {
  grid-template-columns: 1fr;
}

.dims-pdf-scale-grid {
  display: grid;
  gap: 6px;
}

.dims-pdf-scale-top-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.dims-pdf-scale-cell {
  display: grid;
  gap: 4px;
}

.dims-pdf-inline-label {
  font-size: 11px;
  color: var(--dims-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dims-pdf-select,
.dims-pdf-scale-input,
.dims-pdf-scale-unit,
.dims-pdf-scale-copy {
  padding: 7px 8px;
  border: 1px solid var(--dims-input-border);
  border-radius: 8px;
  background: var(--dims-input);
  font-size: 12px;
  color: var(--dims-text);
}

.dims-pdf-style-input {
  width: 72px;
  padding: 6px 6px;
  border: 1px solid var(--dims-input-border);
  border-radius: 8px;
  background: var(--dims-input);
  font-size: 12px;
  color: var(--dims-text);
}

.dims-pdf-style-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--dims-input-border);
  border-radius: 10px;
  background: var(--dims-panel-soft);
}

.dims-pdf-style-title {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  color: var(--dims-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 0;
}

.dims-pdf-scale-input {
  width: 100%;
}

.dims-pdf-scale-ratio {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--dims-input-border);
  border-radius: 8px;
  background: var(--dims-panel-soft);
  font-size: 12px;
  color: var(--dims-text);
  font-weight: 600;
  box-sizing: border-box;
}

.dims-pdf-scale-unit {
  width: 100%;
}

.dims-pdf-scale-copy {
  width: 100%;
}

#dims-pdf-modal .modal-header {
  background: var(--dims-panel);
  border-bottom: 1px solid var(--dims-border);
  gap: 10px;
  align-items: flex-start;
}

#dims-pdf-modal .modal-header h2 {
  margin: 0;
  letter-spacing: 0.02em;
  color: var(--dims-text);
}

.dims-pdf-header-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dims-pdf-corners-readout {
  font-size: 11px;
  line-height: 1.25;
  color: var(--dims-muted);
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 640px;
}

#dims-pdf-modal .modal-btn,
#dims-pdf-modal .modal-btn-sm,
#dims-dimsheet-modal .modal-btn,
#dims-dimsheet-modal .modal-btn-sm {
  border-radius: 9px;
  border: 1px solid var(--dims-input-border);
  background: var(--dims-secondary);
  color: var(--dims-text);
  box-shadow: 0 5px 15px rgba(2, 6, 23, 0.2);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

#dims-pdf-modal .modal-btn:hover,
#dims-pdf-modal .modal-btn-sm:hover,
#dims-dimsheet-modal .modal-btn:hover,
#dims-dimsheet-modal .modal-btn-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.28);
  filter: brightness(1.06);
}

#dims-pdf-modal .modal-btn:active,
#dims-pdf-modal .modal-btn-sm:active,
#dims-dimsheet-modal .modal-btn:active,
#dims-dimsheet-modal .modal-btn-sm:active {
  transform: translateY(0);
}

#dims-dimsheet-modal .modal-btn-primary {
  background: var(--dims-action);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(21, 128, 61, 0.35);
}

#dims-dimsheet-modal .modal-btn-primary:hover {
  background: var(--dims-action);
  box-shadow: 0 8px 20px rgba(21, 128, 61, 0.42);
}

#dims-dimsheet-modal .dim-bill-lookup-btn,
#dims-dimsheet-modal .dim-add-slot-btn {
  border: 1px solid var(--dims-input-border);
  background: var(--dims-secondary);
  color: var(--dims-text);
  box-shadow: 0 5px 15px rgba(2, 6, 23, 0.2);
}

#dims-dimsheet-modal .dim-bill-lookup-btn:hover,
#dims-dimsheet-modal .dim-add-slot-btn:hover {
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.28);
  filter: brightness(1.06);
}

.dims-theme-toggle {
  min-width: 115px;
}

.dims-side-tools {
  display: grid;
  gap: 6px;
  padding: 6px;
  background: var(--dims-header);
  border-bottom: 1px solid var(--dims-border);
  flex: 0 0 auto;
}

.dims-pdf-toolbar-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--dims-border);
  background: var(--dims-panel);
}

.dims-pdf-total {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--dims-text);
}

.dims-pdf-draw-state {
  font-size: 11px;
  color: var(--dims-text);
  background: var(--dims-panel-soft);
  border: 1px solid var(--dims-border);
  border-radius: 999px;
  padding: 3px 9px;
}

.dims-pdf-shortcuts {
  font-size: 11px;
  color: var(--dims-muted);
}

.dims-pdf-spot-readout {
  font-size: 11px;
  color: var(--dims-text);
  background: var(--dims-panel-soft);
  border: 1px solid var(--dims-border);
  border-radius: 999px;
  padding: 3px 9px;
}

#dims-pdf-toggle-draw.is-nav-mode {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: var(--dims-text);
}

#dims-pdf-pan-mode.is-active {
  background: rgba(56, 189, 248, 0.24);
  border-color: rgba(56, 189, 248, 0.56);
  color: var(--dims-text);
}

.dims-pdf-file-label {
  color: var(--dims-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 520px;
}

.dims-pdf-main {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  gap: 10px;
}

.takeoff-status-banner {
  display: none;
}

.dims-pdf-doc-panel {
  flex: 0 0 340px;
  width: 340px;
  min-width: 320px;
  max-width: 380px;
  border: 1px solid var(--dims-border);
  border-radius: 12px;
  background: var(--dims-panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Keep left-side tool buttons fully visible; avoid partial clipped second column. */
.dims-pdf-doc-panel .dims-pdf-button-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.dims-pdf-doc-panel .modal-btn,
.dims-pdf-doc-panel .modal-btn-sm {
  width: auto;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  white-space: nowrap;
  line-height: 1.1;
  padding-left: 10px;
  padding-right: 10px;
}

/* Ensure long selected document names stay inside the panel instead of spilling out. */
.dims-pdf-doc-panel .dims-pdf-field-row,
.dims-pdf-doc-panel .dims-pdf-field-row > * {
  min-width: 0;
}

.dims-pdf-doc-panel #dims-pdf-document {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.dims-pdf-doc-panel #dims-pdf-document option {
  white-space: normal;
}

.dims-pdf-doc-title {
  padding: 8px 10px;
  border-bottom: 1px solid var(--dims-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--dims-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.dims-pdf-doc-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--dims-border);
}

.dims-doc-visibility-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 10px;
}

.dims-visibility-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 62px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1;
  flex: 0 0 auto;
}

.dims-eye-icon {
  position: relative;
  font-size: 11px;
  line-height: 1;
}

.dims-eye-icon-closed::after {
  content: "";
  position: absolute;
  left: -1px;
  top: 5px;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  transform: rotate(-25deg);
  border-radius: 1px;
}

.takeoff-status-banner {
  display: none !important;
}

.dims-pdf-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.dims-theme-toggle {
  min-width: 115px;
}

.dims-mini-draw {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 4px 6px;
  border: 1px solid var(--dims-border);
  border-radius: 8px;
  background: var(--dims-panel-soft);
  min-width: 0;
}

.dims-mini-pair {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.dims-mini-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--dims-muted);
  white-space: nowrap;
}

.dims-mini-input {
  width: auto;
  min-width: 0;
  padding: 3px 4px;
  border: 1px solid var(--dims-input-border);
  border-radius: 6px;
  background: var(--dims-input);
  color: var(--dims-text);
  font-size: 11px;
}

.dims-mini-input-line {
  width: 44px;
}

.dims-mini-input-dot {
  width: 36px;
}

.dims-mini-input-cross {
  width: 36px;
}

.dims-mini-reset {
  padding: 4px 6px;
  font-size: 11px;
  min-width: 54px;
}

.dims-pdf-save-exit-btn {
  min-width: 130px;
  padding: 8px 14px;
  font-size: 13px;
  background: var(--dims-action);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(21, 128, 61, 0.35);
}

.dims-pdf-save-exit-btn:hover {
  background: var(--dims-action);
  box-shadow: 0 8px 20px rgba(21, 128, 61, 0.42);
}

.dims-pdf-new-constant-btn {
  min-width: 120px;
  padding: 7px 12px;
  font-size: 12px;
  background: var(--dims-accent);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(30, 64, 175, 0.35);
}

.dims-pdf-new-constant-btn:hover {
  background: var(--dims-accent);
  box-shadow: 0 8px 20px rgba(30, 64, 175, 0.42);
}

.dims-pdf-doc-constants {
  flex: 1;
  min-height: 120px;
  overflow: auto;
}

.dims-pdf-doc-constant-item {
  border-bottom: 1px solid var(--dims-border);
  padding: 8px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.dims-pdf-doc-constant-item:hover {
  background: var(--dims-panel-soft);
}

.dims-pdf-doc-constant-item.is-active {
  background: rgba(56, 189, 248, 0.2);
  box-shadow: inset 3px 0 0 #38bdf8;
}

.dims-pdf-doc-constant-item.is-active .dims-pdf-doc-constant-label-btn {
  color: #0f172a;
  font-weight: 700;
}

.dims-pdf-doc-constant-item .dims-pdf-doc-constant-label-btn {
  display: block;
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
  transition: color 0.15s ease;
}

.dims-pdf-doc-constant-top {
  display: block;
}

.dims-pdf-doc-constant-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dims-pdf-doc-constant-active {
  background: rgba(56, 189, 248, 0.2);
}

.dims-pdf-doc-active-pill {
  font-size: 10px;
  font-weight: 700;
  color: #e0f2fe;
  background: rgba(2, 132, 199, 0.6);
  border-radius: 999px;
  padding: 1px 6px;
}

.dims-pdf-doc-constant-ref {
  font-size: 12px;
  font-weight: 700;
  color: var(--dims-text);
}

.dims-pdf-doc-constant-name {
  font-size: 11px;
  color: var(--dims-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dims-pdf-doc-constant-group {
  font-size: 11px;
  color: var(--dims-muted);
}

.dims-pdf-doc-constant-scale {
  font-size: 11px;
  color: var(--dims-text);
}

.dims-pdf-doc-constant-total {
  font-size: 11px;
  font-weight: 700;
  color: var(--dims-text);
}

.dims-pdf-doc-constant-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dims-pdf-doc-constant-visibility.is-hidden {
  display: none;
}

.dims-pdf-doc-constant-actions label {
  font-size: 11px;
  color: var(--dims-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dims-pdf-doc-constant-color {
  width: 28px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--dims-input-border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.dims-pdf-doc-constant-color-chip {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.25);
  display: inline-block;
}

.dims-pdf-doc-constant-open {
  margin-left: auto;
}

.dims-pdf-doc-empty {
  padding: 10px;
  font-size: 12px;
  color: var(--dims-muted);
}

.dims-pdf-frame-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--dims-border);
  border-radius: 12px;
  overflow: hidden;
  background: #f1f5f9;
}

.dims-pdf-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform-origin: 0 0;
  will-change: transform;
}

.dims-pdf-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  pointer-events: none;
  transform-origin: 0 0;
}

.dims-pdf-render-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: #fff;
  transform-origin: 0 0;
}

.dims-pdf-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.dims-pdf-canvas.is-cursor-crosshair {
  cursor: crosshair;
}

.dims-pdf-canvas.is-cursor-move {
  cursor: move;
}

.dims-pdf-canvas.is-cursor-resize {
  cursor: nwse-resize;
}

.dims-pdf-entities-panel {
  flex: 0 0 270px;
  width: 270px;
  min-width: 240px;
  max-width: 320px;
  border: 1px solid var(--dims-border);
  border-radius: 12px;
  background: var(--dims-panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.dims-pdf-entities-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--dims-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--dims-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dims-pdf-entity-list {
  flex: 1;
  min-height: 120px;
  max-height: 40vh;
  overflow: auto;
  border-bottom: 1px solid var(--dims-border);
}

.dims-pdf-entity-prefix-row {
  padding: 8px 10px;
  border-bottom: 1px solid var(--dims-border);
  display: grid;
  gap: 5px;
}

.dims-pdf-entity-prefix-input {
  min-width: 0;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--dims-input-border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  background: var(--dims-input);
  color: var(--dims-text);
}

.dims-pdf-entity-prefix-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dims-pdf-entity-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--dims-border);
  background: transparent;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dims-pdf-entity-item-main {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  cursor: pointer;
}

.dims-pdf-entity-rename-btn {
  border: 1px solid var(--dims-border);
  background: var(--dims-panel-soft);
  color: var(--dims-muted);
  border-radius: 8px;
  width: 24px;
  height: 24px;
  line-height: 1;
  cursor: pointer;
}

.dims-pdf-entity-rename-btn:hover {
  color: var(--dims-text);
}

.dims-pdf-entity-item:hover {
  background: var(--dims-panel-soft);
}

.dims-pdf-entity-item.is-selected {
  background: rgba(56, 189, 248, 0.2);
}

.dims-pdf-entity-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--dims-text);
  white-space: nowrap;
}

.dims-pdf-entity-meta {
  font-size: 11px;
  color: var(--dims-muted);
  white-space: nowrap;
}

.dims-pdf-entity-editor {
  padding: 8px 10px;
  display: grid;
  gap: 8px;
}

.dims-pdf-entity-empty {
  font-size: 12px;
  color: var(--dims-muted);
}

.dims-pdf-entity-field {
  display: grid;
  gap: 3px;
}

.dims-pdf-entity-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--dims-muted);
}

.dims-pdf-entity-field input,
.dims-pdf-entity-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--dims-input-border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  background: var(--dims-input);
  color: var(--dims-text);
}

.dims-pdf-entity-field textarea {
  min-height: 72px;
  resize: vertical;
}

.dims-pdf-entity-actions {
  padding: 8px 10px;
  border-top: 1px solid var(--dims-border);
  display: flex;
  justify-content: flex-end;
}

.dims-doc-picker-container {
  width: 95vw;
  max-width: 95vw;
  height: 92vh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.dims-doc-picker-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dims-doc-picker-meta {
  margin-top: 8px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: #1e293b;
  background: #eef2ff;
  border-radius: 8px;
  padding: 8px 10px;
}

.dims-doc-picker-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.dims-doc-picker-group-filter {
  min-width: 180px;
  max-width: 280px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  color: #0f172a;
  background: #fff;
}

.dims-doc-picker-body {
  margin-top: 8px;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 42% 58%;
  gap: 10px;
}

.dims-doc-picker-left,
.dims-doc-picker-right {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #dbe1ea;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dims-doc-picker-list-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

#dims-doc-picker-table {
  width: 100%;
  border-collapse: collapse;
}

#dims-doc-picker-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #dbe4f8;
  color: #0f172a;
  font-size: 12px;
}

#dims-doc-picker-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 8px;
  font-size: 12px;
  color: #0f172a;
}

#dims-doc-picker-table tr {
  cursor: pointer;
}

#dims-doc-picker-table tr.is-selected {
  background: #e0f2fe;
}

.dims-doc-picker-preview-title {
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.dims-doc-picker-preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-wrap: wrap;
}

.dims-doc-picker-preview-mode-label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.dims-doc-picker-preview-mode-select {
  min-width: 170px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  color: #0f172a;
  background: #fff;
}

.dims-doc-picker-preview-help {
  font-size: 12px;
  color: #475569;
}

.dims-doc-picker-preview-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  cursor: grab;
}

.dims-doc-picker-preview-viewport.is-dragging {
  cursor: grabbing;
}

.dims-doc-picker-preview-viewport.is-native-pdf {
  overflow: hidden;
  cursor: default;
}

.dims-doc-picker-preview-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  min-width: 100%;
  min-height: 100%;
  will-change: transform;
}

.dims-doc-picker-preview-stage.is-native-pdf {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  transform: none !important;
}

.dims-doc-picker-preview-stage iframe {
  border: 0;
  width: 1800px;
  height: 1300px;
  background: white;
  pointer-events: none;
}

.dims-doc-picker-preview-stage.is-native-pdf iframe {
  width: 100%;
  height: 100%;
  min-height: 0;
  pointer-events: auto;
  display: block;
}

.dims-doc-picker-preview-stage img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  margin: 0 auto;
}

.dims-doc-picker-preview-text {
  padding: 10px;
  margin: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.45;
}

.dims-doc-picker-preview-empty {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  padding: 20px;
}

.dims-doc-picker-preview-table-wrap {
  padding: 10px;
}

.dims-doc-picker-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #fff;
}

.dims-doc-picker-preview-table th,
.dims-doc-picker-preview-table td {
  border: 1px solid #dbe1ea;
  padding: 4px 6px;
  text-align: left;
}

@media (max-width: 980px) {
  .dims-pdf-button-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dims-side-tools {
    max-height: 260px;
  }

  .dims-pdf-toolbar-status {
    align-items: flex-start;
  }

  .dims-pdf-total {
    margin-left: 0;
  }

  .dims-pdf-file-label {
    max-width: 100%;
  }

  .dims-pdf-style-group {
    grid-template-columns: 1fr;
  }

  .dims-pdf-main {
    flex-direction: column;
  }

  .dims-pdf-doc-panel {
    flex: 0 1 auto;
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .dims-pdf-entities-panel {
    flex: 0 1 auto;
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .dims-pdf-entity-list {
    max-height: 28vh;
  }

  .dims-doc-picker-body {
    grid-template-columns: 1fr;
  }

  .dims-pdf-header-actions {
    flex-wrap: wrap;
  }

  .dims-pdf-corners-readout {
    max-width: 100%;
  }

  .dims-mini-draw {
    flex-wrap: wrap;
  }
}

.cbs-display-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.cbs-display {
  background: white;
  padding: 12px;
  border-radius: 4px;
  border-left: 4px solid #0f766e;
  font-size: 14px;
}

.cbs-display strong {
  color: #333;
  margin-right: 8px;
}

.cbs-display span {
  color: #666;
}

.cbs-billitems-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.cbs-billitems-section h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 600;
}

.cbs-table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 4px;
}

#cbs-selected-count {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: #666;
}

.cbs-table-wrapper {
  flex: 1;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-height: 400px;
  max-height: 600px;
}

.cbs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cbs-table thead {
  position: sticky;
  top: 0;
  background: #f5f5f5;
  z-index: 10;
}

.cbs-table th {
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
  white-space: nowrap;
}

.cbs-table td {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.cbs-selectable-row {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}

.cbs-selectable-row:hover {
  background: #f9f9f9;
}

.cbs-selectable-row.selected {
  background: #d7f3ef !important;
  border-left: 3px solid #0f766e;
}

.cbs-selectable-row.selected:hover {
  background: #c2ebe4 !important;
}

/* ============================================
   Key Trade Manager Modal Styles
   ============================================ */

#keytrade-manager-modal .modal-container {
  width: 90vw !important;
  max-width: 90vw !important;
}

.keytrade-manager-container {
  width: 100%;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
}

.keytrade-selection-section {
  background: #f5f5f5;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.keytrade-selection-section h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
}

.keytrade-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 15px;
}

.keytrade-field label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.keytrade-field select,
.keytrade-field input[type="text"] {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background: white;
  max-width: 400px;
  min-width: 300px;
}

.keytrade-field input[type="text"]:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.keytrade-display {
  background: white;
  padding: 12px;
  border-radius: 4px;
  border-left: 4px solid #007bff;
  font-size: 14px;
}

.keytrade-display strong {
  color: #333;
  margin-right: 8px;
}

.keytrade-display span {
  color: #666;
}

.keytrade-billitems-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.keytrade-billitems-section h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 600;
}

.keytrade-table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 4px;
}

#keytrade-selected-count {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: #666;
}

.keytrade-table-wrapper {
  flex: 1;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-height: 400px;
  max-height: 600px;
}

.keytrade-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.keytrade-table thead {
  position: sticky;
  top: 0;
  background: #f5f5f5;
  z-index: 10;
}

.keytrade-table th {
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
  white-space: nowrap;
}

.keytrade-table td {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.keytrade-selectable-row {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}

.keytrade-selectable-row:hover {
  background: #f9f9f9;
}

.keytrade-selectable-row.selected {
  background: #cfe2ff !important;
  border-left: 3px solid #007bff;
}

.keytrade-selectable-row.selected:hover {
  background: #b6d4fe !important;
}

.wbs-manager-container {
  width: 100%;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
}

.wbs-filters-section {
  background: #f5f5f5;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.wbs-filters-section h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
}

.wbs-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.wbs-filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wbs-filter-field label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.wbs-filter-field select {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}

.wbs-filter-field select:disabled {
  background: #f0f0f0;
  cursor: not-allowed;
}

.wbs-selection-display {
  background: white;
  padding: 12px;
  border-radius: 4px;
  border-left: 4px solid #4CAF50;
  font-size: 14px;
}

.wbs-selection-display strong {
  color: #333;
  margin-right: 8px;
}

.wbs-selection-display span {
  color: #666;
  font-family: monospace;
}

.wbs-billitems-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wbs-billitems-section h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 600;
}

.wbs-table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 4px;
}

.modal-btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #ccc;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-btn-sm:hover {
  background: #f0f0f0;
  border-color: #999;
}

#wbs-selected-count {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: #666;
}

.wbs-table-wrapper {
  flex: 1;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-height: 400px;
  max-height: 600px;
}

.wbs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.wbs-table thead {
  position: sticky;
  top: 0;
  background: #f5f5f5;
  z-index: 10;
}

.wbs-table th {
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
  white-space: nowrap;
}

.wbs-table td {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.wbs-selectable-row {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}

.wbs-selectable-row:hover {
  background: #f9f9f9;
}

.wbs-selectable-row.selected {
  background: #d4edda !important;
  border-left: 3px solid #28a745;
}

.wbs-selectable-row.selected:hover {
  background: #c3e6cb !important;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid #ddd;
}

.dims-table td:nth-child(7) .dims-input,
.dims-table td:nth-child(8) .dims-input,
.dims-table td:nth-child(9) .dims-input {
  min-width: 190px;
}

.dims-table td:nth-child(12) .dims-textarea {
  min-width: 360px;
}

.dims-table td:nth-child(13) {
  padding-left: 4px;
  padding-right: 4px;
  white-space: nowrap;
}

#btn-documents-constants {
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0.5rem solid transparent;
  border-radius: 1rem;
  color: hsl(0 0% 10%);
  background: rgba(59, 130, 246, 0.16);
  place-content: center;
  gap: 0.2rem;
  box-shadow: var(--shadow);
  outline: none;
  transition: all 0.1s;

  &:hover,
  &:focus-visible {
    color: hsl(217, 91%, 35%);
    scale: 1.1;
  }

  &:active {
    box-shadow:
      var(--shadow),
      inset .5rem .5rem 1rem hsl(0 0% 50% / .5),
      inset -.5rem -.5rem 1rem hsl(0 0% 100% / .75);
    color: hsl(217, 91%, 35%);
  }

  &:disabled {
    opacity: 0.5;
    cursor: default;
  }
}

/* ============================================
   Dim Sheet Screen
   ============================================ */

.dim-sheet-page {
  width: 95vw;
  max-width: 95vw;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#dims-dimsheet-modal {
  z-index: 20001;
}

.dims-dimsheet-container {
  width: 96vw;
  max-width: 96vw;
  height: 94vh;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
}

.dims-dimsheet-content {
  padding: 0;
  flex: 1;
  min-height: 0;
}

.dims-dimsheet-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.dim-sheet-header {
  display: flex;
  align-items: baseline;
  gap: 26px;
  padding: 8px 6px;
  color: #f7f8fb;
  font-family: var(--appfontfam);
}

.dim-sheet-header h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0.01em;
  font-weight: 500;
}

.dim-project-name {
  font-size: 15px;
  font-weight: 600;
  color: #d8e8ff;
}

.dim-sheet-example-tag {
  font-size: 22px;
  color: #d7b9f3;
  font-weight: 500;
}

.dim-sheet-frame {
  background: #f1f4f9;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(34, 102, 164, 0.2);
  padding: 8px;
  min-height: calc(100vh - 96px);
}

.dim-sheet-scroll {
  width: 100%;
  height: calc(100vh - 122px);
  overflow: auto;
  border: 1px solid #225f98;
  background: #f8fafc;
}

#dim-sheet-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: var(--appfontfam);
  font-size: 13px;
  color: #111827;
}

#dim-sheet-table thead th {
  border: 1px solid #2d84c2;
}

#dim-sheet-table tbody td {
  border: 1px solid #4b9fda;
}

#dim-sheet-table thead tr:last-child th {
  background: #404245;
  color: #f4f6fb;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  height: 26px;
  padding: 3px 4px;
}

#dim-sheet-table thead .dim-sheet-top-note-row th {
  background: transparent;
  color: #f4f6fb;
  border: none;
  height: 22px;
  padding: 0 4px;
}

#dim-sheet-table .dim-sheet-top-note {
  color: #4a4a4a;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
}

#dim-sheet-table tbody td {
  background: #f8fafc;
  min-height: 26px;
  height: 26px;
  padding: 2px 4px;
  vertical-align: top;
}

#dim-sheet-table tbody tr.dim-sheet-major-row td {
  background: #f4f7fb;
  height: 42px;
  padding-top: 5px;
}

#dim-sheet-table td.cell-ref {
  text-align: center;
  font-weight: 700;
  border-right: 2px solid #2d84c2;
}

#dim-sheet-table td.cell-item-id {
  text-align: center;
  font-weight: 700;
  border-right: 2px solid #2d84c2;
}

/* Keep key-column borders and carry-down shading consistent on extra dim-slot rows. */
#dim-sheet-table tbody td.dim-muted-cell {
  background: #f4f7fb;
}

#dim-sheet-table tbody td:nth-child(1),
#dim-sheet-table tbody td:nth-child(2) {
  border-right: 2px solid #2d84c2;
}

#dim-sheet-table td.cell-desc {
  font-weight: 650;
  line-height: 1.15;
}

#dim-sheet-table td.cell-unit,
#dim-sheet-table td.cell-note {
  font-weight: 600;
}

#dim-sheet-table td.cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#dim-sheet-table td.cell-count {
  text-align: center;
}

#dim-sheet-table tbody tr.dim-sheet-filler td {
  height: 20px;
  padding: 0;
}

#dim-sheet-table .col-item-id {
  width: 3.75%;
}

#dim-sheet-table .col-ref {
  width: 3.75%;
}

#dim-sheet-table .col-desc {
  width: 17.5%;
}

#dim-sheet-table .col-final {
  width: 4%;
}

#dim-sheet-table .col-unit {
  width: 3%;
}

#dim-sheet-table .col-count {
  width: 8.25%;
}

#dim-sheet-table .col-multiply {
  width: 8.25%;
}

#dim-sheet-table .col-xyz {
  width: 6%;
}

#dim-sheet-table .col-method {
  width: 16.5%;
}

#dim-sheet-table .col-subtotal {
  width: 5%;
}

#dim-sheet-table .col-subunit {
  width: 2.25%;
}

#dim-sheet-table .col-notes {
  width: 21.25%;
}

@media (max-width: 1200px) {
  .dim-sheet-page {
    width: 95vw;
    max-width: 95vw;
    margin: 0 auto;
  }

  .dim-sheet-header h1 {
    font-size: 24px;
  }

  .dim-sheet-example-tag {
    font-size: 18px;
  }

  .dim-sheet-frame {
    min-height: calc(100vh - 86px);
    padding: 6px;
  }

  .dim-sheet-scroll {
    height: calc(100vh - 102px);
  }

  #dim-sheet-table {
    min-width: 1200px;
  }
}

/* Interactive Dim Sheet additions */
.dim-sheet-page-v2 .dim-sheet-header {
  padding-bottom: 0;
}

.dim-sheet-wbs-toolbar {
  background: linear-gradient(180deg, #f2f5fb, #e8eef8);
  border: 1px solid rgba(32, 94, 148, 0.3);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--appfontfam);
}

.dim-wbs-toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dim-current-wbs {
  flex: 1;
  min-height: 32px;
  display: flex;
  align-items: center;
  border: 1px solid #93acd0;
  border-radius: 8px;
  background: #f9fbff;
  color: #0f2855;
  padding: 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.dim-wbs-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dim-wbs-tab {
  border: 1px solid #7ea0ce;
  background: #f8fbff;
  color: #0f2855;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.dim-wbs-tab.is-active {
  background: #2f6eb2;
  color: #f8fbff;
  border-color: #2f6eb2;
}

.dim-source-bank {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.dim-source-bank-title {
  color: #1d3f73;
  font-size: 13px;
  font-weight: 700;
  padding-top: 4px;
}

.dim-source-bank-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dim-source-chip {
  border: 1px solid #9eb8da;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  background: #f9fcff;
  color: #1f416e;
  font-weight: 600;
}

.dim-formula-note {
  margin: 0;
  color: #1e3a63;
  font-size: 13px;
}

.dim-sheet-page-v2 #dim-sheet-table tbody td {
  vertical-align: top;
}

.dim-sheet-input {
  width: 100%;
  min-height: 28px;
  border: 1px solid #97b8d9;
  border-radius: 6px;
  background: #ffffff;
  color: #0f1b31;
  padding: 4px 6px;
  font-size: 12px;
  font-family: var(--appfontfam);
  box-sizing: border-box;
}

.dim-sheet-input:focus {
  outline: 2px solid rgba(39, 109, 184, 0.3);
  border-color: #2f6eb2;
}

.dim-sheet-input-small {
  min-height: 26px;
}

.dim-sheet-math-entry {
  min-height: 28px;
  line-height: 1.25;
  overflow: hidden;
  resize: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dim-sheet-math-entry[readonly] {
  background: #eef4fb;
  color: #274770;
  font-weight: 700;
}

.dim-math-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.dim-math-method-row {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 4px;
}

.dim-math-mode,
.dim-math-group-select {
  min-height: 24px;
  padding-top: 2px;
  padding-bottom: 2px;
}

.dim-calc-mini {
  margin-top: 2px;
  text-align: right;
  color: #244778;
  font-size: 11px;
  font-weight: 600;
}
.dim-math-mode {
  width: 56px;
}

.dim-xyz-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
}

.dim-method-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
}

.dim-axis-control {
  border: 1px solid #c4d4e8;
  border-radius: 6px;
  padding: 4px;
  background: #f7fbff;
  min-height: 38px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.dim-axis-line {
  display: grid;
  grid-template-columns: 16px 1fr 90px;
  align-items: center;
  gap: 4px;
}

.dim-axis-line-value {
  grid-template-columns: 16px 1fr;
}

.dim-axis-line-method {
  grid-template-columns: 44px 1fr;
}

.dim-axis-line strong {
  color: #264065;
  font-size: 12px;
}

.dim-axis-group-select {
  min-height: 24px;
  padding-top: 2px;
  padding-bottom: 2px;
}

.dim-axis-value[readonly] {
  background: #eef4fb;
  color: #274770;
  font-weight: 700;
}

.dim-axis-mode {
  min-height: 24px;
  padding-top: 2px;
  padding-bottom: 2px;
}

.dim-subtotal {
  font-weight: 700;
}

.dim-note-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
}

.dim-note-axis-row {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 4px;
  border: 1px solid #c4d4e8;
  border-radius: 6px;
  padding: 4px;
  background: #f7fbff;
  min-height: 38px;
  box-sizing: border-box;
}

.dim-note-axis-row strong {
  color: #264065;
  font-size: 12px;
}

.dim-axis-note {
  min-height: 24px;
}

.dim-slot-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.dim-bill-desc-wrap {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
  gap: 4px;
  align-items: start;
  height: 100%;
}

.dim-bill-desc-input {
  min-height: 54px;
  resize: none;
  line-height: 1.25;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: hidden;
}

.dim-bill-lookup-btn {
  align-self: end;
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  line-height: 1;
  font-size: 14px;
}

.dim-bill-lib-container {
  width: 95vw;
  max-width: 95vw;
}

.dim-bill-lib-meta {
  margin-bottom: 8px;
  color: #1f3657;
}

.dim-bill-lib-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.dim-bill-lib-filter {
  display: grid;
  gap: 4px;
}

.dim-bill-lib-filter span {
  font-size: 12px;
  font-weight: 600;
  color: #23456f;
}

.dim-bill-lib-results-wrap {
  border: 1px solid #b8cce1;
  border-radius: 8px;
  max-height: 46vh;
  overflow: auto;
}

.dim-bill-lib-results {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.dim-bill-lib-results th,
.dim-bill-lib-results td {
  border: 1px solid #d5e2ef;
  padding: 4px 6px;
  text-align: left;
  vertical-align: top;
}

.dim-bill-lib-results th {
  position: sticky;
  top: 0;
  background: #3f566f;
  color: #f7fbff;
  z-index: 1;
}

.dim-axis-note[readonly] {
  background: #eef4fb;
  color: #274770;
  font-weight: 700;
}

.dim-muted-cell {
  background: #f7f9fc;
}

.dim-slot-add-row td {
  background: #f0f4fa;
  border-top: 0;
  padding: 4px;
}

.dim-add-slot-btn {
  min-height: 28px;
  font-weight: 700;
  border-color: var(--dims-input-border);
  background: var(--dims-secondary);
}

.dim-add-slot-btn:hover {
  background: var(--dims-secondary);
}

.takeoff-toast-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.takeoff-toast-item {
  background: rgba(17, 24, 39, 0.95);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font: 12px/1.4 var(--appfontfam);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  opacity: 1;
  transition: opacity 160ms ease;
}

.takeoff-toast-item.is-error {
  background: rgba(153, 27, 27, 0.95);
}

.takeoff-toast-item.is-closing {
  opacity: 0;
}

.takeoff-inline-prompt-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  z-index: 9999;
}

.takeoff-inline-prompt-box {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
}

.takeoff-inline-prompt-box-known-length {
  width: 320px;
}

.takeoff-inline-prompt-box-text {
  width: 340px;
}

.takeoff-inline-prompt-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.takeoff-inline-prompt-message {
  margin-bottom: 6px;
}

.takeoff-inline-prompt-input {
  width: 100%;
}

.takeoff-inline-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.takeoff-visually-hidden-file-input {
  display: none;
}

@media (max-width: 1200px) {
  .dim-sheet-wbs-toolbar {
    padding: 8px;
  }

  .dim-wbs-toolbar-row {
    flex-wrap: wrap;
  }

  .dim-current-wbs {
    min-width: 260px;
  }

  .dim-xyz-grid {
    grid-template-columns: 1fr;
  }
}