/* Adjustable table columns in Aktuelle Arbeitsplanung and Arbeitshistorie. */
#wartungsplan table.td-resizable-columns,
#historie table.td-resizable-columns,
#ersatzteillager table.td-resizable-columns {
  width: 100% !important;
  table-layout: fixed !important;
}

#planningWorkOrdersSection,
#planningMaintenanceSection {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

#planningWorkOrdersSection table.td-resizable-columns th,
#planningWorkOrdersSection table.td-resizable-columns td,
#planningMaintenanceSection table.td-resizable-columns th,
#planningMaintenanceSection table.td-resizable-columns td {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

#planningWorkOrdersSection table.td-resizable-columns .td-column-action,
#planningMaintenanceSection table.td-resizable-columns .td-column-action,
#planningWorkOrdersSection table.td-resizable-columns .td-column-assignment,
#planningMaintenanceSection table.td-resizable-columns .td-column-assignment {
  text-align: center !important;
}

#planningWorkOrdersSection table.td-resizable-columns td.td-column-action,
#planningMaintenanceSection table.td-resizable-columns td.td-column-action {
  overflow: visible !important;
  text-overflow: clip !important;
}

.td-table-autofit-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #b9cddd;
  border-radius: 12px;
  background: #f7fafc;
  color: #294b61;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.td-table-autofit-button:hover,
.td-table-autofit-button:focus-visible {
  border-color: #7ca9c3;
  background: #edf6fb;
  box-shadow: 0 0 0 3px rgba(67, 132, 170, .12);
  outline: none;
}

.td-table-autofit-button.is-active {
  border-color: #82afc8;
  background: #e7f3f8;
  color: #173f57;
}

.td-planning-order-compact {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  width: 100%;
  white-space: nowrap;
}

.td-planning-type-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.td-planning-type-dot.is-sto {
  background: #d94b55;
  box-shadow: 0 0 0 3px rgba(217, 75, 85, .11);
}

.td-planning-type-dot.is-rep {
  background: #e87922;
}

.td-planning-type-dot.is-kon {
  background: #94a3b8;
}

.td-planning-type-dot.is-tic {
  background: #3b82f6;
}

.td-planning-order-number {
  flex: 0 0 auto;
  color: #24485f;
  font-family: "IBM Plex Mono", monospace;
  font-size: .92em;
  font-weight: 600;
}

.td-planning-order-separator {
  flex: 0 0 auto;
  color: #9aabb8;
}

.td-planning-order-asset {
  flex: 0 0 auto;
  color: #50697b;
  font-weight: 600;
}

.td-planning-order-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #243746;
}

#wartungsplan table.td-resizable-columns thead th.td-resizable-heading,
#historie table.td-resizable-columns thead th.td-resizable-heading,
#ersatzteillager table.td-resizable-columns thead th.td-resizable-heading {
  position: relative !important;
  overflow: visible !important;
  padding-right: 13px !important;
}

#ersatzteillager #etlStockTable {
  width: 100% !important;
  min-width: 100% !important;
  table-layout: fixed !important;
}

@media (max-width: 900px) {
  #ersatzteillager #etlStockTable {
    min-width: 960px !important;
  }
}

#ersatzteillager #etlStockTable th,
#ersatzteillager #etlStockTable td {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

#ersatzteillager #etlStockTable .empty-note {
  width: auto !important;
  max-width: none !important;
  text-overflow: clip !important;
}

/* Keep large stock lists inside the visible page instead of placing the
   horizontal scrollbar after hundreds of rows. */
#ersatzteillager :has(> #etlStockTable) {
  max-height: calc(100vh - 280px);
  max-height: calc(100dvh - 280px);
  min-height: 260px;
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#ersatzteillager #etlStockTable thead th,
#ersatzteillager #etlStockTable thead th.td-resizable-heading {
  position: sticky !important;
  top: 0;
  z-index: 21;
  background: #f5f1e8 !important;
}

.td-table-col-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  bottom: 0;
  z-index: 20;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
}

.td-table-col-resizer::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 4px;
  width: 2px;
  border-radius: 2px;
  background: rgba(70, 99, 119, .72);
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.td-table-col-resizer:hover::before,
.td-table-col-resizer:focus-visible::before,
html.td-table-column-resizing .td-table-col-resizer::before {
  background: #39789c;
  box-shadow: 0 0 0 2px rgba(57, 120, 156, .16);
}

.td-table-col-resizer:focus-visible {
  outline: none;
}

html.td-table-column-resizing,
html.td-table-column-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

@media (max-width: 700px) {
  .td-table-col-resizer {
    right: -6px;
    width: 12px;
  }
}
