/* Shared table system. Page-specific styles should only extend these classes. */
.data-page {
  width: calc(100% + 48px);
  max-width: none;
  margin-right: -24px;
  margin-left: -24px;
  box-sizing: border-box;
}

.data-table-wrap,
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 14px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f0f3f8;
  font-weight: 600;
  white-space: nowrap;
}

.data-table {
  min-width: 720px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:not(.deleted-record-row):hover {
  background: #f8fafc;
}

.data-table .table-actions {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.table-edit-link {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel);
}

.table-edit-link:hover {
  border-color: var(--accent);
  background: #f8fafc;
}

.table-edit-link img {
  width: 14px;
  height: 14px;
}

.data-table .table-empty {
  padding: 24px 12px;
  color: var(--muted);
  text-align: center;
}

.data-table--compact {
  min-width: 520px;
}

.data-table--wide {
  min-width: 1100px;
}

@media (max-width: 1100px) {
  .data-page {
    width: calc(100% + 32px);
    margin-right: -16px;
    margin-left: -16px;
  }
}

@media (max-width: 768px) {
  .data-table {
    font-size: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
  }
}
