.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);
}

.import-preview-table .import-row-excluded td {
  background: color-mix(in srgb, var(--bs-secondary) 8%, transparent);
  color: var(--app-muted);
}

.import-preview-table .import-row-excluded input:not([type="checkbox"]),
.import-preview-table .import-row-excluded select {
  opacity: 0.6;
}

.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;
}

.asset-filter-reset {
  align-self: end;
}

.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;
}

.asset-status-actions {
  width: 100%;
}

.asset-status-actions .asset-status-rename-button {
  flex: 0 0 auto;
  margin-left: auto;
}

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;
}

/* Bootstrap paints --bs-table-bg plus striping/hover overlays on every cell,
   which hid the row colors below (zebra, hover tint, chat urgency rows). */
.table > tbody {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: transparent;
  --bs-table-hover-bg: transparent;
}

tbody tr:nth-child(even) {
  background: var(--app-surface-soft);
}

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

.asset-reminder-highlight-blue,
.reminder-color-label-blue {
  --asset-reminder-accent: #2563eb;
  --asset-reminder-bg: #e8f1ff;
  --asset-reminder-hover-bg: #dceaff;
}

.asset-reminder-highlight-yellow,
.reminder-color-label-yellow {
  --asset-reminder-accent: #9a6c00;
  --asset-reminder-bg: #fff7c7;
  --asset-reminder-hover-bg: #ffefaa;
}

.asset-reminder-highlight-orange,
.reminder-color-label-orange {
  --asset-reminder-accent: #c75b00;
  --asset-reminder-bg: #fff0df;
  --asset-reminder-hover-bg: #ffe4c4;
}

.asset-reminder-highlight-red,
.reminder-color-label-red {
  --asset-reminder-accent: #bd342d;
  --asset-reminder-bg: #fde8e7;
  --asset-reminder-hover-bg: #fbd9d7;
}

.asset-reminder-highlight-green,
.reminder-color-label-green {
  --asset-reminder-accent: #237a42;
  --asset-reminder-bg: #e6f5ea;
  --asset-reminder-hover-bg: #d6eedc;
}

.asset-reminder-highlight-purple,
.reminder-color-label-purple {
  --asset-reminder-accent: #7136a8;
  --asset-reminder-bg: #f1e8fb;
  --asset-reminder-hover-bg: #e8d9f8;
}

tbody tr.asset-reminder-highlight > td {
  background-color: var(--asset-reminder-bg) !important;
  box-shadow: none;
}

tbody tr.asset-reminder-highlight:hover > td {
  background-color: var(--asset-reminder-hover-bg) !important;
}

tbody tr.asset-reminder-highlight > td:first-child {
  border-left: 0.35rem solid var(--asset-reminder-accent);
}

.asset-reminder-marker {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--asset-reminder-accent);
  border-radius: 999px;
  color: var(--asset-reminder-accent);
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 700;
  gap: 0.2rem;
  margin-right: 0.4rem;
  padding: 0.16rem 0.38rem;
  vertical-align: middle;
}

.reminder-color-label {
  background: var(--asset-reminder-bg);
  border: 1px solid var(--asset-reminder-accent);
  border-radius: 999px;
  color: var(--asset-reminder-accent);
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  vertical-align: middle;
}

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,
tr.persisted-row-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;
}

.asset-history-value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 24rem;
}
