/* Canonical current renderer for work orders in Aktuelle Arbeitsplanung. */
#wartungsplan #planningWorkOrdersSection > table.table {
  width: 100% !important;
  min-width: 960px !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

/* Aktuelle Arbeitsplanung has one permanent layout. Column handles and the
   automatic-fit control belong only to tables that users configure. */
#wartungsplan .td-table-col-resizer,
#wartungsplan .td-table-autofit-button {
  display: none !important;
}

#wartungsplan #planningWorkOrdersSection .planning-card-head,
#wartungsplan #planningMaintenanceSection .planning-card-head {
  min-height: 72px !important;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
}

#wartungsplan #planningWorkOrdersSection .planning-section-filters,
#wartungsplan #planningMaintenanceSection .planning-section-filters {
  margin-left: auto !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
}

@media (min-width: 901px) {
  #wartungsplan #planningWorkOrdersSection .planning-section-filters {
    grid-template-columns: repeat(3, 150px) !important;
    width: 466px !important;
    min-width: 466px !important;
  }

  #wartungsplan #planningWorkOrdersSection .planning-section-filters > select {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
  }
}

#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(1),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(1) { width: 35% !important; }
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(2),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(2) { width: 12% !important; }
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(3),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(3) { width: 9% !important; }
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(4),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(4) { width: 9% !important; }
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(5),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(5) { width: 14% !important; }
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(6),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(6) { width: 11% !important; text-align: center !important; }
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(7),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(7) { width: 10% !important; text-align: right !important; }

#wartungsplan #planningWorkOrdersSection > table.table td:not(:last-child) {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#wartungsplan #planningWorkOrdersSection .td-planning-planned-cell.is-open {
  color: #64748b !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* An unscheduled date is neutral text, also while the row is hovered. */
#wartungsplan #planningWorkOrdersSection .td-planning-planned-cell.is-open:hover,
#wartungsplan #planningWorkOrdersSection tbody tr:hover > .td-planning-planned-cell.is-open {
  color: #64748b !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
}

#wartungsplan #planningWorkOrdersSection .td-planning-created-cell,
#wartungsplan #planningWorkOrdersSection .td-planning-planned-cell {
  color: #40566a !important;
  font-weight: 400 !important;
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums !important;
}

#wartungsplan #planningWorkOrdersSection th:nth-child(5),
#wartungsplan #planningWorkOrdersSection .td-planning-planned-cell {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* One fixed layout for current work orders: no manual column resizing. */
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(1),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(1) { width: 32% !important; }
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(2),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(2) { width: 7% !important; }
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(3),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(3) { width: 7% !important; }
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(4),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(4) { width: 8% !important; }
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(5),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(5) { width: 8% !important; }
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(6),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(6) { width: 18% !important; text-align: center !important; }
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(7),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(7) { width: 10% !important; text-align: center !important; }
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(8),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(8) { width: 10% !important; text-align: right !important; }

/* Compact metadata columns leave the readable employee name more room. */
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(2),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(2),
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(3),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(3),
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(4),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(4) {
  padding-left: 5px !important;
  padding-right: 5px !important;
}

#wartungsplan #planningWorkOrdersSection > table.table th,
#wartungsplan #planningWorkOrdersSection > table.table td {
  white-space: nowrap !important;
  text-align: center !important;
  vertical-align: middle !important;
}

/* Auftrag is the readable exception; Aktion stays pinned to the right edge. */
#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(1),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(1) {
  text-align: left !important;
}

#wartungsplan #planningWorkOrdersSection > table.table th:nth-child(8),
#wartungsplan #planningWorkOrdersSection > table.table td:nth-child(8) {
  text-align: center !important;
}

#wartungsplan #planningWorkOrderRows td > br {
  display: none !important;
}

#wartungsplan #planningWorkOrderRows td > br + * {
  margin-left: 6px;
}

#wartungsplan #planningWorkOrdersSection .td-planning-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 74px !important;
  min-width: 74px !important;
  max-width: 74px !important;
  box-sizing: border-box !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 8px !important;
  line-height: 1 !important;
}

#wartungsplan #planningWorkOrdersSection .td-planning-status-badge.is-paused,
#wartungsplan #planningWorkOrdersSection .td-planning-status-badge.is-assigned.is-paused {
  color: #8f3340 !important;
  background: #fbecee !important;
  border-color: #e8b8c0 !important;
  box-shadow: none !important;
}

#wartungsplan #planningWorkOrdersSection .td-planning-status-badge.is-open {
  color: #8a5c19 !important;
  background: #fff7e7 !important;
  border-color: #ecd49c !important;
}

#wartungsplan #planningWorkOrdersSection .td-planning-status-badge.is-assigned {
  color: #215f41 !important;
  background: #e2f3e9 !important;
  border-color: #acd4bb !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72) !important;
}

.td-status-assigned {
  color: #215f41 !important;
  background: #e2f3e9 !important;
  border-color: #acd4bb !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box;
  line-height: 1.15 !important;
  vertical-align: middle;
}

.td-status-assigned,
.td-status-open {
  min-width: 92px;
  min-height: 32px;
  padding: 0 10px !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box;
  line-height: 1.15 !important;
  vertical-align: middle;
  white-space: nowrap;
}

.td-status-open,
.td-planning-status-badge.is-open {
  color: #8b3e48 !important;
  background: #fbeff1 !important;
  border: 1px solid #e9bcc3 !important;
}

#wartungsplan #planningWorkOrdersSection tbody td,
#wartungsplan #planningMaintenanceSection tbody td {
  vertical-align: middle !important;
}

/* Keep every data row visually continuous across all fixed columns. */
#wartungsplan #planningWorkOrdersSection > table.table tbody tr > td {
  display: table-cell !important;
  border-bottom: 1px solid #e4eaf0 !important;
  border-bottom-style: solid !important;
  box-sizing: border-box !important;
}

/* Action controls always occupy the same footprint below the Aktion header. */
#wartungsplan #planningWorkOrdersSection .td-planning-action-cell .btn,
#wartungsplan #planningWorkOrdersSection .td-planning-action-cell button,
#wartungsplan #planningWorkOrdersSection .td-planning-action-cell input[type="button"],
#wartungsplan #planningWorkOrdersSection .td-planning-action-cell input[type="submit"] {
  width: 88px !important;
  min-width: 88px !important;
  justify-content: center !important;
}

/* Keep assignment neutral until a worker has actually been assigned. */
#wartungsplan #planningWorkOrdersSection .td-planning-action-cell .td-action-assign {
  color: #46535f !important;
  background: #eef1f4 !important;
  border-color: #d2d9e0 !important;
  border-radius: 11px !important;
  font-weight: 650 !important;
  box-shadow: 0 2px 7px rgba(15, 23, 42, .08), inset 0 1px 0 rgba(255, 255, 255, .72) !important;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease !important;
}

#wartungsplan #planningWorkOrdersSection .td-planning-action-cell .td-action-assign:hover,
#wartungsplan #planningWorkOrdersSection .td-planning-action-cell .td-action-assign:focus-visible {
  color: #34414c !important;
  background: #e2e7eb !important;
  border-color: #bbc5ce !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, .11), 0 0 0 3px rgba(100, 116, 139, .12) !important;
}

#wartungsplan #planningWorkOrdersSection .td-planning-action-cell [aria-label="Arbeitsauftrag abarbeiten"],
#wartungsplan #planningWorkOrdersSection .td-planning-action-cell .td-action-in-work {
  color: #ffffff !important;
  background: linear-gradient(180deg, #4f8b6c 0%, #397357 100%) !important;
  border-color: #397357 !important;
  border-radius: 11px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 10px rgba(42, 103, 75, .20), inset 0 1px 0 rgba(255, 255, 255, .18) !important;
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease !important;
}

#wartungsplan #planningWorkOrdersSection .td-planning-action-cell [aria-label="Arbeitsauftrag abarbeiten"]:hover,
#wartungsplan #planningWorkOrdersSection .td-planning-action-cell [aria-label="Arbeitsauftrag abarbeiten"]:focus-visible,
#wartungsplan #planningWorkOrdersSection .td-planning-action-cell .td-action-in-work:hover,
#wartungsplan #planningWorkOrdersSection .td-planning-action-cell .td-action-in-work:focus-visible {
  color: #ffffff !important;
  background: linear-gradient(180deg, #478062 0%, #31694e 100%) !important;
  border-color: #31694e !important;
  box-shadow: 0 6px 14px rgba(42, 103, 75, .24), 0 0 0 3px rgba(72, 128, 96, .16) !important;
}

#wartungsplan #planningWorkOrdersSection tbody td:nth-last-child(2),
#wartungsplan #planningMaintenanceSection tbody td:nth-last-child(2) {
  text-align: center;
}

#wartungsplan #planningMaintenanceSection > table.table {
  width: 100% !important;
  min-width: 880px !important;
  table-layout: fixed !important;
}

#wartungsplan #planningMaintenanceSection > table.table th:nth-child(1),
#wartungsplan #planningMaintenanceSection > table.table td:nth-child(1) { width: 12% !important; }
#wartungsplan #planningMaintenanceSection > table.table th:nth-child(2),
#wartungsplan #planningMaintenanceSection > table.table td:nth-child(2) { width: 22% !important; }
#wartungsplan #planningMaintenanceSection > table.table th:nth-child(3),
#wartungsplan #planningMaintenanceSection > table.table td:nth-child(3) { width: 12% !important; }
#wartungsplan #planningMaintenanceSection > table.table th:nth-child(4),
#wartungsplan #planningMaintenanceSection > table.table td:nth-child(4) { width: 18% !important; text-align: center !important; }
#wartungsplan #planningMaintenanceSection > table.table th:nth-child(5),
#wartungsplan #planningMaintenanceSection > table.table td:nth-child(5) { width: 11% !important; text-align: center !important; }
#wartungsplan #planningMaintenanceSection > table.table th:nth-child(6),
#wartungsplan #planningMaintenanceSection > table.table td:nth-child(6) { width: 14% !important; text-align: center !important; }
#wartungsplan #planningMaintenanceSection > table.table th:nth-child(7),
#wartungsplan #planningMaintenanceSection > table.table td:nth-child(7) { width: 11% !important; text-align: right !important; }

#wartungsplan #planningMaintenanceSection .td-planning-planned-cell {
  text-align: center !important;
  font-variant-numeric: tabular-nums;
}

#wartungsplan #planningMaintenanceSection .td-planning-worker-cell {
  text-align: center !important;
}

#wartungsplan #planningMaintenanceSection > table.table th,
#wartungsplan #planningMaintenanceSection > table.table td {
  white-space: nowrap !important;
  vertical-align: middle !important;
}

button.td-action-assign,
input[type="button"].td-action-assign,
input[type="submit"].td-action-assign {
  color: #46535f !important;
  background: #eef1f4 !important;
  border-color: #d2d9e0 !important;
  border-radius: 11px !important;
  font-weight: 650 !important;
  box-shadow: 0 2px 7px rgba(15, 23, 42, .08), inset 0 1px 0 rgba(255, 255, 255, .72) !important;
}

button.td-action-assign:hover,
button.td-action-assign:focus-visible,
input[type="button"].td-action-assign:hover,
input[type="button"].td-action-assign:focus-visible,
input[type="submit"].td-action-assign:hover,
input[type="submit"].td-action-assign:focus-visible {
  color: #34414c !important;
  background: #e2e7eb !important;
  border-color: #bbc5ce !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, .11), 0 0 0 3px rgba(100, 116, 139, .12) !important;
}

@media (max-width: 1100px) {
  #wartungsplan #planningWorkOrdersSection .planning-card-head,
  #wartungsplan #planningMaintenanceSection .planning-card-head {
    min-height: auto !important;
    flex-wrap: wrap !important;
  }

  #wartungsplan #planningWorkOrdersSection .planning-section-filters,
  #wartungsplan #planningMaintenanceSection .planning-section-filters {
    flex-wrap: wrap !important;
  }
}

/* Aktuelle Arbeitsplanung: separate Fach column in Wartungen only */
#wartungsplan #planningMaintenanceSection th:nth-child(1),
#wartungsplan #planningMaintenanceSection td:nth-child(1) { width: 10% !important; }
#wartungsplan #planningMaintenanceSection th:nth-child(2),
#wartungsplan #planningMaintenanceSection td:nth-child(2) { width: 19% !important; }
#wartungsplan #planningMaintenanceSection th:nth-child(3),
#wartungsplan #planningMaintenanceSection td:nth-child(3) { width: 10% !important; text-align: center !important; }
#wartungsplan #planningMaintenanceSection th:nth-child(4),
#wartungsplan #planningMaintenanceSection td:nth-child(4) { width: 11% !important; }
#wartungsplan #planningMaintenanceSection th:nth-child(5),
#wartungsplan #planningMaintenanceSection td:nth-child(5) { width: 16% !important; text-align: center !important; }
#wartungsplan #planningMaintenanceSection th:nth-child(6),
#wartungsplan #planningMaintenanceSection td:nth-child(6) { width: 10% !important; text-align: center !important; }
#wartungsplan #planningMaintenanceSection th:nth-child(7),
#wartungsplan #planningMaintenanceSection td:nth-child(7) { width: 13% !important; text-align: center !important; }
#wartungsplan #planningMaintenanceSection th:nth-child(8),
#wartungsplan #planningMaintenanceSection td:nth-child(8) { width: 11% !important; text-align: right !important; }
#wartungsplan #planningMaintenanceSection .td-planning-fach-cell { text-align: center !important; }
