/* Assembly workspace — reuses foreman table/modal patterns */

.asm-root .asm-btn-complete {
  white-space: normal;
  max-width: 220px;
  line-height: 1.25;
  text-align: center;
}

.asm-action-cell {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: stretch;
}

.asm-action-cell .asm-btn-complete,
.asm-action-cell .asm-btn-release {
  flex: 1;
  max-width: none;
  white-space: normal;
  line-height: 1.25;
  text-align: center;
}

.asm-root .asm-btn-release {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}

.asm-root .asm-btn-release:hover {
  background: #a93226;
  border-color: #a93226;
}

.adm-th-assembly,
.adm-cell-assembly {
  width: 72px;
  text-align: center;
}

.adm-assembly-chk {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.asmp-price-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface, #fff);
}

.asmp-price-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.asmp-price-input {
  width: 100px;
}

.asmp-price-unit {
  font-size: 13px;
  color: var(--muted);
  margin-left: -6px;
}

.asmp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.asmp-filter-select {
  min-width: 180px;
  max-width: 220px;
}

.asmp-date {
  width: 140px;
}

.asmp-total-bar {
  padding: 10px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(1, 105, 111, 0.05);
}

.asmp-total-label {
  color: var(--muted);
  margin-right: 8px;
}

.asmp-th-paid,
.asmp-cell-paid {
  width: 72px;
  text-align: center;
}

/* Constrain to viewport width so fm-table-wrap scrolls internally (same as .fm-root) */
.asm-root {
  width: 100%;
  box-sizing: border-box;
}

.asm-root > .ms-list > .fm-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 10px;
  background: var(--card-bg, #fff);
  /* Hide native scrollbar — StickyThead footer provides the visible one */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.asm-root > .ms-list > .fm-table-wrap::-webkit-scrollbar {
  display: none;
  height: 0;
}

/* No frozen columns in assembly.
   foreman.css hardcodes sticky left: 130px/270px for columns 1-2 based on
   foreman-specific widths. Assembly columns are narrower, so those stickies
   create artificial gaps between cells and misalign the cloned pin header.
   Disable sticky on BOTH the body cells (so StickyThead detects stickyIndices=[]
   and skips compensating transforms) AND the pin-table cells. */
#assembly-view .fm-table td,
#assembly-payout-view .fm-table td {
  position: static !important;
  left: auto !important;
  z-index: auto !important;
  box-shadow: none !important;
}
#assembly-view .fm-thead-pin-table th,
#assembly-payout-view .fm-thead-pin-table th {
  position: static !important;
  left: auto !important;
  box-shadow: none !important;
}

.content-area.content-area--foreman #assembly-view.view-section.active,
.content-area.content-area--foreman #assembly-payout-view.view-section.active {
  position: relative;
  display: flex !important;
  flex-direction: column;
  overflow: visible;
  min-height: auto;
  flex: none;
}
