.table-wrap,
.table-responsive {
  overflow-x: auto;
  border-radius: 0.5rem;
}

.import-preview-table {
  min-width: max-content;
}

.import-preview-table input {
  min-width: 10rem;
}

.import-preview-table .import-validation-cell {
  min-width: 20rem;
  white-space: normal;
}

.import-preview-table .import-validation-cell ul {
  margin: 0;
  padding-left: 1.1rem;
}

.import-preview-table .import-row-error td {
  background: color-mix(in srgb, var(--color-delete) 8%, transparent);
}

.table-toolbar {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.table-toolbar-actions {
  margin-left: auto;
  align-self: center;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.table-pagination {
  display: flex;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--app-border);
}

.table-pagination[hidden] {
  display: none;
}

.table-pagination-summary {
  margin-right: auto;
  color: var(--app-text-soft);
  white-space: nowrap;
}

.table-pagination-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.table-pagination-page-size {
  min-width: 9rem;
}

.table-pagination-page-size label {
  margin-bottom: 0.2rem;
  white-space: nowrap;
}

.table-pagination-page-size select {
  width: auto;
  min-width: 5.5rem;
}

.table-pagination-page {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  min-height: 2.7rem;
  text-align: center;
  white-space: nowrap;
}

.row-emphasis td {
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
  background: #fff;
}

thead th {
  border-bottom: 1px solid var(--app-border-strong);
  background: #edf2fb;
  color: var(--app-text);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.72rem 0.65rem;
  text-transform: none;
  letter-spacing: 0;
}

thead th a {
  color: inherit;
  text-decoration: none;
}

thead th a:hover {
  color: var(--bs-primary);
  text-decoration: underline;
}

thead th.sort-asc a::after,
thead th.sort-desc a::after {
  margin-left: 0.3em;
  font-size: 0.75em;
  opacity: 0.8;
}

thead th.sort-asc a::after {
  content: "▲";
}

thead th.sort-desc a::after {
  content: "▼";
}

.table-action-header,
.table-action-cell {
  text-align: left;
}

.table-row-actions {
  justify-content: flex-start;
}

tbody td {
  border-bottom: 1px solid #dde4f0;
  color: var(--app-text-soft);
  font-size: 0.94rem;
  padding: 0.72rem 0.65rem;
  vertical-align: top;
}

.reminder-table tbody td {
  vertical-align: middle;
}

tbody tr:nth-child(even) {
  background: #f8fbff;
}

tbody tr:hover {
  background: rgba(var(--bs-primary-rgb), 0.06);
}

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

tr.click-row {
  cursor: pointer;
}

.document-category-name-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.document-category-name-content {
  flex: 1 1 auto;
  min-width: 0;
}

.document-category-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 1.8rem;
  width: 1.8rem;
  min-height: 2rem;
  border: 1px solid var(--app-border-strong);
  border-radius: 0.35rem;
  background: var(--app-surface);
  color: var(--app-muted);
  cursor: grab;
  font-weight: 700;
  letter-spacing: -0.35rem;
  padding-right: 0.35rem;
  user-select: none;
}

.document-category-drag-handle:hover,
.document-category-drag-handle:focus-visible {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.18);
}

.document-category-drag-handle:active {
  cursor: grabbing;
}

tr.document-category-is-dragging {
  opacity: 0.5;
}

.document-category-reorder-status {
  min-height: 1.4rem;
  margin: 0.55rem 0 0;
  color: var(--app-muted);
  font-size: 0.88rem;
}

.document-category-reorder-status.is-error {
  color: var(--color-delete);
  font-weight: 600;
}
