/* Native staff tables share one visual owner: Staff::Ui::TableComponent.
   Domain styles may size columns and arrange their content; table skins live here. */
.staff-ui .staff-table {
  --staff-table-row-height: var(--sl-row, 44px);
  --staff-table-cell-padding: 4px 10px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-family: "TT Norms Pro", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  color: var(--sl-ink);
  text-align: left;
  background: #fff;
}
.staff-ui .staff-table--budgeted,
.staff-ui .staff-table--fixed { table-layout: fixed; }
.staff-ui .sl-table { min-width: 970px; }
.staff-ui .staff-table > thead > tr > :is(th, td) {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-block: 1px solid var(--sl-border);
  background: #fafafa;
  color: var(--sl-muted);
  font: 500 12px/18px "TT Norms Pro", sans-serif;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  vertical-align: middle;
}
.staff-ui .staff-table > :is(tbody, tfoot) > tr > :is(td, th) {
  height: var(--staff-table-row-height);
  padding: var(--staff-table-cell-padding);
  border: 0;
  border-bottom: 1px solid #efeff1;
  background: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  vertical-align: middle;
}
.staff-ui :where(.staff-table) th { text-align: inherit; }
/* A row heading is an identity in the body, never a second sticky column header. */
.staff-ui .staff-table > tbody > tr > th { font-weight: 500; }
.staff-ui .staff-table > tbody > tr:last-child > :is(td, th) { border-bottom: 0; }
.staff-ui .staff-table > tbody > tr:is(:hover, :focus-within) > :is(td, th) { background: #f8f8f9; }
.staff-ui .staff-table > tbody > tr.is-selected > :is(td, th) { background: #fff5f4; }
.staff-ui .staff-table > tfoot > tr > :is(td, th) {
  position: sticky;
  bottom: 0;
  z-index: 2;
  border-top: 1px solid var(--sl-border);
  background: #fafafa;
  font-weight: 700;
}
.staff-ui .staff-table :is(.staff-number, .staff-cell-number, [data-kind="money"], [data-kind="number"]) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.staff-ui .staff-table.sl-report-table > :is(thead, tbody, tfoot) > tr > :is(th, td):not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.staff-ui .staff-table .sl-select-cell { width: 38px; text-align: center; padding: 0 8px; }
.staff-ui .staff-table .sl-row-action { width: 35px; padding: 0; }
.staff-ui .staff-table--book { --staff-table-row-height: 64px; --staff-table-cell-padding: 8px 10px; }
.staff-ui .staff-table--editable { --staff-table-cell-padding: 8px 10px; }
.staff-ui .staff-table--editable > tbody > tr > :is(td, th) { vertical-align: top; }
.staff-ui [data-density="comfortable"] .staff-table { --staff-table-row-height: 56px; }
.staff-ui [data-density="comfortable"] .staff-table > tbody > tr > :is(td, th) { font-size: 14px; }
.staff-ui .staff-table:has(.sl-identity-text small) { --staff-table-row-height: 56px; }
.staff-ui .staff-data-scroll {
  position: relative;
  overflow: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  contain: inline-size;
  background: #fff;
  border-bottom: 1px solid var(--sl-border);
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
@media (max-width: 699px), (pointer: coarse) {
  .staff-ui .staff-table { --staff-table-row-height: 56px; }
  .staff-ui .staff-table--book { --staff-table-row-height: 64px; }
  .staff-ui .staff-table .sl-select-cell { width: 44px; padding: 0; }
  .staff-ui .staff-table .sl-row-action { width: 44px; }
  .staff-ui .staff-table:has(.sl-incident-title) { --staff-table-row-height: 64px; }
}

/* Explicit cell/state roles shared by existing table adapters. */
.staff-ui .staff-table .staff-cell-date { font-size: 12px; }
.staff-ui .staff-table .staff-gift-position { color: var(--sl-muted); }
.staff-ui .staff-table .staff-library-check { padding: 0 8px; }
.staff-ui .staff-table .staff-sheet-open { padding-inline: 4px; }
.staff-ui .staff-table .staff-sheet-identity { box-shadow: 1px 0 0 var(--sl-border); }
.staff-ui .staff-table > tbody > tr.has-selection-conflict > :is(td, th) { background: #fff8f5; }
.staff-ui .staff-table--editable .has-errors > .staff-sheet-identity { box-shadow: inset 3px 0 var(--sl-red), 1px 0 0 var(--sl-border); }
@media (max-width: 699px) {
  .staff-ui .staff-table .staff-library-check { padding-inline: 0; }
}

/* Warehouse order rows retain their labels when stacked on narrow screens. */
.staff-ui .staff-warehouse-order-table .staff-warehouse-order-identity { padding-block: 14px; }
@media (max-width: 767px) {
  .staff-ui .staff-warehouse-order-table,
  .staff-ui .staff-warehouse-order-table > tbody { display: block; }
  .staff-ui .staff-warehouse-order-table > colgroup { display: none; }
  .staff-ui .staff-warehouse-order-table > thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .staff-ui .staff-warehouse-order-table > tbody > tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px 0; border-top: 1px solid var(--sl-border); }
  .staff-ui .staff-warehouse-order-table[data-shipped="true"] > tbody > tr { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .staff-ui .staff-warehouse-order-table > tbody > tr > td { height: auto; padding: 0; border: 0; min-width: 0; text-align: left; }
  .staff-ui .staff-warehouse-order-table .staff-warehouse-order-identity,
  .staff-ui .staff-warehouse-order-table .staff-warehouse-order-place { grid-column: 1 / -1; }
  .staff-ui .staff-warehouse-order-table .staff-warehouse-order-identity > strong { font-size: 14px; }
  .staff-ui .staff-warehouse-order-table td[data-label]::before { content: attr(data-label); display: block; color: var(--sl-muted); font-size: 11px; line-height: 16px; margin-bottom: 4px; }
  .staff-ui .staff-warehouse-order-table td.staff-warehouse-order-place::before { display: inline; content: "Место: "; font-size: 13px; }
  .staff-ui .staff-warehouse-order-table > tbody > tr > td.staff-warehouse-order-identity { padding-block: 0; }
}

/* Optional value captions retain numeric alignment and shared row density. */
.staff-ui .staff-table .sl-cell-text small { display: block; font-size: 11px; line-height: 16px; font-weight: 400; color: var(--sl-muted); }
.staff-ui .staff-table:has(.sl-cell-text small) { --staff-table-row-height: 56px; }
