/*
  MFP Design System — Tables
  Production CSS for data tables component.
  Import tokens.css before this file.
*/

/* ======================================================================
   TABLE
   ====================================================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font: var(--type-body-base);
  background: var(--color-white);
}

/* ======================================================================
   HEADER ROW
   ====================================================================== */
.data-table thead tr {
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.08);
}

.data-table th {
  height: 72px;
  padding: 0 24px;
  font-weight: 700;
  color: var(--color-darkest-grey);
  text-align: left;
  border-bottom: 1px solid var(--color-light-grey);
  white-space: nowrap;
  vertical-align: middle;
}

.data-table th.is-sortable {
  cursor: pointer;
  user-select: none;
}

.data-table th.is-sortable:hover {
  background: var(--color-blue-25);
}

/* ======================================================================
   SORT ICON
   ====================================================================== */
.table-sort-icon {
  font-size: 20px;
  vertical-align: middle;
  margin-left: 8px;
  color: var(--color-darkest-grey);
  font-variation-settings: 'FILL' 0;
}


/* ======================================================================
   BODY ROWS
   ====================================================================== */
.data-table td {
  padding: 12px 24px;
  color: var(--color-darkest-grey);
  border-bottom: 1px solid var(--color-light-grey);
  vertical-align: middle;
}

.data-table tbody tr:hover td {
  background: var(--color-blue-25);
}

.data-table tbody tr.is-hover td {
  background: var(--color-blue-25);
}

/* ======================================================================
   STICKY LAST COLUMN
   ====================================================================== */
.data-table-scroll {
  overflow-x: auto;
}

.data-table--sticky-last th:last-child,
.data-table--sticky-last td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--color-white);
}

.data-table--sticky-last thead tr {
  z-index: 3;
}

.data-table--sticky-last th:last-child {
  z-index: 4;
}

.data-table-scroll.is-overflowing .data-table--sticky-last th:last-child::before,
.data-table-scroll.is-overflowing .data-table--sticky-last td:last-child::before {
  content: '';
  position: absolute;
  top: 0;
  left: -16px;
  width: 16px;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.08));
  pointer-events: none;
}

.data-table--sticky-last tbody tr:hover td:last-child,
.data-table--sticky-last tbody tr.is-hover td:last-child {
  background: var(--color-blue-25);
}

/* ======================================================================
   SLIM
   ====================================================================== */
.data-table--sm {
  font: var(--type-body-small);
}

.data-table--sm th {
  height: 36px;
  padding: 0 16px;
  font: var(--type-body-small);
  font-weight: 700;
}

.data-table--sm td {
  padding: 8px 16px;
  font: var(--type-body-small);
}
