/* Native auto layout shares available width according to column content. */
.system-table-scroll { overflow-x: auto; max-width: 100%; min-width: 0; }
table[data-system-table] { display: table !important; width: 100% !important; min-width: 100% !important; table-layout: auto !important; border-collapse: separate; border-spacing: 0; }
table[data-system-table] col { width: auto !important; min-width: 0 !important; }
table[data-system-table] :is(th,td) { box-sizing: border-box; width: auto !important; min-width: 0 !important; max-width: none !important; height: auto !important; min-height: 44px; padding: 12px 16px !important; vertical-align: middle !important; }
table[data-system-table] [data-table-type="text"] { text-align: left !important; white-space: normal !important; overflow-wrap: anywhere; min-width: 140px !important; max-width: 360px !important; }
table[data-system-table] [data-table-type="number"] { text-align: right !important; white-space: nowrap !important; min-width: max-content !important; }
table[data-system-table] :is([data-table-type="tag"],[data-table-type="date"],[data-table-type="selection"]) { text-align: center !important; white-space: nowrap !important; }
table[data-system-table] [data-table-type="tag"] { min-width: 100px !important; }
table[data-system-table] [data-table-type="date"] { min-width: 130px !important; }
table[data-system-table] th > :is(button,span) { text-align: inherit; }
table[data-system-table] th > button { justify-content: inherit; }
table[data-system-table] [data-table-tools] { position: sticky !important; right: 0; z-index: 2; width: 1px !important; min-width: var(--table-tools-column-width,48px) !important; max-width: none !important; padding-inline: 6px !important; text-align: center !important; white-space: nowrap; background: var(--panel,#fff); }
table[data-system-table] th[data-table-tools] { z-index: 3; background: var(--panel,#fff); }
table[data-system-table] td[colspan] { max-width: none; }

table[data-system-table] thead { display: table-header-group !important; }
table[data-system-table] tbody { display: table-row-group !important; }
table[data-system-table] tfoot { display: table-footer-group !important; }
table[data-system-table] tr { display: table-row !important; }
table[data-system-table] :is(th,td) { display: table-cell !important; }
table[data-system-table] th[data-table-type="number"] > button { justify-content: flex-end; }
table[data-system-table] th:is([data-table-type="date"],[data-table-type="tag"]) > button { justify-content: center; }
table[data-system-table] th[data-table-type="text"] > button { justify-content: flex-start; }

table[data-system-table] [data-table-type="selection"] { min-width: 48px !important; width: 1px !important; padding-inline: 6px !important; }

/* Stacked status/date wrappers must follow the cell alignment too. */
table[data-system-table] :is([data-table-type="tag"],[data-table-type="date"]) > div { text-align: center; align-items: center !important; justify-content: center !important; }

/* The task list and bonus tables use grid markup rather than native tables. */
.my-task-table :is(.my-task-table-columns,.my-task-row) {
  grid-template-columns: minmax(320px,1.5fr) minmax(140px,.7fr) minmax(160px,.8fr) minmax(220px,1fr) minmax(140px,.6fr);
  height: auto; align-items: center;
}
.my-task-table .my-task-table-columns { align-items: stretch; }
.my-task-table .my-task-table-columns > span { align-items: center; justify-content: flex-start; }
.my-task-table :is(.my-task-table-columns,.my-task-row) > :is(:nth-child(2),:nth-child(5)) { text-align: center; justify-content: center; }
.my-task-table .my-task-row > :is(:nth-child(1),:nth-child(3),:nth-child(4)) { text-align: left; justify-content: flex-start; }
.my-task-table :is(.my-task-name,.my-task-project,.my-task-project > span,.my-task-note) { height: auto; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.project-data-grid > div { height: auto; align-items: center; }
.project-data-grid > div > :is(:nth-child(1),:nth-child(2)) { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.project-data-grid > div > :nth-child(3), .project-data-grid > div > :nth-child(3) input { text-align: right; }
.project-data-grid > div > :nth-child(4) { text-align: center; }

/* Empty states keep their own alignment, independent of column data types. */
#appShell table[data-system-empty-table] tbody td.empty-cell[data-table-empty-cell],
:root table[data-system-empty-table] tbody td.empty-cell[data-table-empty-cell] {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  position: static !important;
  left: auto !important;
  right: auto !important;
  justify-self: stretch !important;
  align-self: stretch !important;
  justify-content: center !important;
  height: 120px !important;
  padding: 12px 16px !important;
  text-align: center !important;
  vertical-align: middle !important;
}
table[data-system-empty-table] .system-table-empty-message {
  display: block;
  position: sticky;
  left: 16px;
  width: max(0px, calc(var(--table-empty-view-width, 100%) - 32px));
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
.my-task-table .my-task-empty:not([hidden]),
.project-data-grid > :is(.empty-cell,.empty-note):not([hidden]) {
  grid-template-columns: 1fr !important;
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  min-height: 120px;
  box-sizing: border-box;
  padding: 24px 16px;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Preserve intentional hidden columns/rows when native table display is restored. */
table[data-system-table] :is(thead,tbody,tfoot,tr,th,td)[hidden] { display: none !important; }

/* Cancellation is a neutral terminal state, independent of its old color class. */
.status-pill.is-cancelled, .tag.is-cancelled, .stage-pill.is-cancelled { background: #eef0f3 !important; color: #626975 !important; }
