/* Shared tabular result table (User portal + Admin Jobs → Table) */

/* —— Job table header (user portal + admin) —— */
.result-header {
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #eef2f7;
  min-height: 52px;
}

.result-header.visible {
  display: flex;
}

.result-header-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.result-file-name {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  max-width: 100%;
}

.result-header-meta {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  font-size: 0.6875rem;
  color: #64748b;
  line-height: 1.35;
}

.result-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  align-self: center;
}

.result-header-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.header-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.6875rem;
  color: #64748b;
  white-space: nowrap;
  line-height: 1.35;
}

.header-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #64748b;
  flex-shrink: 0;
}

.header-stat-icon svg {
  width: 13px;
  height: 13px;
  display: block;
}

.header-stat-label {
  font-weight: 500;
}

.header-stat strong {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.result-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.result-meta-item strong {
  color: #64748b;
  font-weight: 500;
}

.result-meta-item.assigned-incomplete {
  color: #dc2626;
  font-weight: 700;
  animation: assigned-incomplete-blink 1.1s ease-in-out infinite;
}

.result-meta-item.assigned-incomplete strong {
  color: #dc2626;
  font-weight: 700;
}

@keyframes assigned-incomplete-blink {
  0%, 100% {
    opacity: 1;
    color: #dc2626;
  }
  50% {
    opacity: 0.4;
    color: #ef4444;
  }
}

.result-meta-item .meta-ip-name {
  color: #1d4ed8;
  font-weight: 600;
}

.result-header-meta .status-pill {
  padding: 1px 7px;
  font-size: 0.625rem;
}

.result-meta-unassigned {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.6875rem;
  color: #475569;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.result-meta-unassigned input {
  accent-color: #2563eb;
  width: 13px;
  height: 13px;
  margin: 0;
}

.header-reset-filters {
  padding: 3px 8px;
  font-size: 0.625rem;
}

.header-reset-filters.hidden {
  display: none;
}

.result-header-downloads {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.result-header-download-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: #64748b;
  margin-right: 2px;
  white-space: nowrap;
}

.result-header-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  cursor: pointer;
  flex-shrink: 0;
}

.result-header-download:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.result-header-download svg {
  width: 18px;
  height: 18px;
}

.result-header-csv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 42px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  background: #ecfdf5;
  color: #059669;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.result-header-csv-btn:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.result-header-csv-btn.hidden {
  display: none;
}

.result-header-csv-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* —— Search toolbar (user portal + admin table) —— */
.result-toolbar {
  flex-shrink: 0;
  display: none;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  padding: 6px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
  min-height: 32px;
}

.result-toolbar.visible {
  display: flex;
}

.result-toolbar-search {
  flex: 1 1 auto;
  min-width: 100px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  height: 28px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
}

.result-toolbar-search .search-icon {
  display: inline-flex;
  color: #94a3b8;
  flex-shrink: 0;
}

.result-toolbar-search .search-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.result-toolbar-search input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
  font-size: 0.75rem;
  background: transparent;
  color: #0f172a;
}

.result-toolbar-search input[type="search"]:focus {
  outline: none;
}

.result-toolbar-search input[type="search"]::placeholder {
  color: #94a3b8;
}

.table-row-count {
  flex-shrink: 0;
  font-size: 0.6875rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-row-count strong {
  color: #334155;
  font-weight: 700;
}

.result-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.result-icon-btn:hover:not(:disabled) {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.result-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.result-toolbar-search .result-icon-btn {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: #94a3b8;
}

.result-toolbar-search .result-icon-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: #64748b;
  border-color: transparent;
}

.result-toolbar-search .result-icon-btn svg {
  width: 12px;
  height: 12px;
}

.result-icon-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}

.result-icon-btn.primary,
#fitColumnsBtn,
#adminFitColumnsBtn {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.25);
  background: #eff6ff;
  width: 36px;
  min-width: 36px;
}

.result-icon-btn.primary:hover:not(:disabled),
#fitColumnsBtn:hover:not(:disabled),
#adminFitColumnsBtn:hover:not(:disabled) {
  background: #dbeafe;
}

.data-table-root {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  height: 100%;
}

/* —— Toolbar —— */
.data-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.data-table-toolbar .dt-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 420px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.data-table-toolbar .dt-search-wrap:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.data-table-toolbar .dt-search-wrap .search-icon {
  display: inline-flex;
  color: #94a3b8;
  flex: 0 0 auto;
}

.data-table-toolbar .dt-search-wrap .search-icon svg {
  width: 14px;
  height: 14px;
}

.data-table-toolbar .dt-search-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 0;
  font: inherit;
  font-size: 0.8125rem;
  outline: none;
  color: #0f172a;
}

.data-table-toolbar .dt-row-count {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f1f5f9;
}

.data-table-toolbar .dt-row-count strong {
  color: #0f172a;
  font-weight: 700;
}

.data-table-toolbar .dt-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.data-table-toolbar .dt-icon-btn svg {
  width: 15px;
  height: 15px;
}

.data-table-toolbar .dt-icon-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #2563eb;
}

.data-table-toolbar .dt-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.data-table-toolbar .dt-icon-btn.primary {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.25);
  background: #eff6ff;
}

/* —— Filter bar (single line) —— */
.data-table-filter-bar {
  flex: 0 0 auto;
  padding: 6px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.data-table-filter-bar.dt-single-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 36px;
  scrollbar-width: thin;
}

.data-table-filter-bar.hidden {
  display: none;
}

.dt-stat-inline {
  font-size: 0.6875rem;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
}

.dt-stat-inline strong {
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.dt-stat-visible {
  font-size: 0.6875rem;
  color: #1d4ed8;
  white-space: nowrap;
}

.dt-stat-visible.hidden {
  display: none;
}

.dt-stat-visible strong {
  font-weight: 700;
}

.dt-vdivider {
  width: 1px;
  height: 20px;
  background: #cbd5e1;
  flex-shrink: 0;
  margin: 0 2px;
}

.dt-filter-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}

.dt-input {
  width: 56px;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font: inherit;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  background: #fff;
  color: #0f172a;
  outline: none;
  flex-shrink: 0;
}

.dt-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.dt-input.dt-page-single {
  width: 48px;
}

.dt-filter-dash {
  font-size: 0.75rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.dt-btn {
  padding: 4px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.dt-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.dt-btn.hidden {
  display: none;
}

.dt-btn-icon {
  padding: 4px 8px;
  min-width: 28px;
}

.dt-toggle-compact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.dt-toggle-compact input {
  accent-color: #2563eb;
  width: 13px;
  height: 13px;
  margin: 0;
}

/* Legacy filter groups (unused but safe) */
.dt-filter-group { display: flex; align-items: center; gap: 6px; }
.dt-filter-group.hidden { display: none; }

/* —— Scroll area —— */
.table-area {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.data-table-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
  background: #fff;
  padding: 0;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  transition: opacity 0.2s ease;
}

.data-table-scroll.is-loading {
  opacity: 0.45;
  pointer-events: none;
}

.data-table-scroll.table-ready {
  animation: dtTableContentIn 0.22s ease;
}

@keyframes dtTableContentIn {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

.table-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(1px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 6;
}

.table-loading-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.table-loading-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: dtTableSpin 0.7s linear infinite;
}

@keyframes dtTableSpin {
  to { transform: rotate(360deg); }
}

/* —— Pagination —— */
.data-table-pagination {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.data-table-pagination.hidden {
  display: none;
}

.data-table-pagination.dt-pagination-single .dt-page-nav {
  opacity: 0.55;
}

.dt-page-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 0.75rem;
  color: #64748b;
}

.dt-page-range {
  font-weight: 600;
  color: #334155;
}

.dt-page-of {
  color: #64748b;
}

.dt-page-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.dt-page-size-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.dt-page-size {
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  font-size: 0.75rem;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.dt-page-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.data-table-pagination .dt-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.data-table-pagination .dt-icon-btn svg {
  width: 14px;
  height: 14px;
}

.data-table-pagination .dt-icon-btn:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
}

.data-table-pagination .dt-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dt-page-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #64748b;
  padding: 0 6px;
  white-space: nowrap;
}

.dt-page-indicator strong {
  color: #0f172a;
  font-weight: 700;
}

.dt-page-input {
  width: 52px;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: #fff;
  color: #0f172a;
  outline: none;
}

.dt-page-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* —— Table grid (Inter — clean data-table typography) —— */
table.data-out {
  --dt-font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-family: var(--dt-font);
  font-size: 14px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.006em;
  color: #334155;
}

table.data-out th,
table.data-out td {
  padding: 11px 14px;
  border: 1px solid #e8edf3;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.55;
  vertical-align: middle;
  font-family: inherit;
}

table.data-out td.narrative-col,
table.data-out th.narrative-col,
table.data-out td.wrap-col,
table.data-out th.wrap-col {
  min-width: 0;
  max-width: none;
  line-height: 1.55;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
  padding-top: 10px;
  padding-bottom: 10px;
  hyphens: auto;
}

table.data-out th:last-child,
table.data-out td:last-child {
  border-right: 1px solid #e8edf3;
}

table.data-out tbody td {
  overflow: hidden;
}

table.data-out td.num-col {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

table.data-out td.cell-warn::before {
  content: '⚠ ';
  color: #d97706;
  font-size: 0.75rem;
}

table.data-out .cell-empty {
  color: #cbd5e1;
}

table.data-out td.page-col {
  text-align: center;
  vertical-align: middle;
}

table.data-out .page-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 3px 7px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  white-space: nowrap;
}

table.data-out tr.page-start td {
  border-top: 2px solid #c7d2fe;
}

table.data-out tr.page-start:first-child td {
  border-top-width: 1px;
  border-top-color: #eef2f7;
}

table.data-out tr.page-start td.page-col .page-badge {
  background: #4338ca;
  color: #fff;
  border-color: #3730a3;
  box-shadow: 0 1px 2px rgba(67, 56, 202, 0.25);
}

/* Sticky header — label (full width) | filter + sort (spread) */
table.data-out thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f4f7fb;
  background-clip: padding-box;
  color: #1e3a5f;
  border-color: #e2e8f0;
  user-select: none;
  overflow: hidden;
  padding: 0;
  vertical-align: middle;
  height: auto;
  min-height: 56px;
}

table.data-out thead th:last-child {
  border-right: 1px solid #e2e8f0;
}

table.data-out thead th:first-child {
  border-top-left-radius: 0;
}

table.data-out thead th:last-child {
  border-top-right-radius: 0;
}

table.data-out th.col-header {
  position: sticky;
  top: 0;
  cursor: pointer;
}

table.data-out thead th.col-header {
  position: sticky;
}

table.data-out th .th-shell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-height: 56px;
  padding: 6px 8px 4px;
  box-sizing: border-box;
}

table.data-out th .th-label-row {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
}

table.data-out th .th-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-shrink: 0;
  padding: 0 1px;
}

table.data-out th .sort-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  color: #64748b;
  flex-shrink: 0;
  z-index: 2;
}

table.data-out th .sort-indicator svg {
  width: 14px;
  height: 14px;
  display: block;
}

table.data-out th.sorted-asc .sort-indicator,
table.data-out th.sorted-desc .sort-indicator {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.1);
}

table.data-out th .th-label {
  width: 100%;
  min-width: 0;
  text-align: center;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-transform: none;
  color: #1e3a5f;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding: 0 2px;
  box-sizing: border-box;
  pointer-events: none;
}

table.data-out th .col-filter-btn {
  position: static;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
}

table.data-out th .col-filter-btn svg {
  width: 13px;
  height: 13px;
}

table.data-out th .col-filter-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

table.data-out th .col-filter-btn.filter-active,
table.data-out th.col-header.filter-active .col-filter-btn {
  background: #3b82f6;
  color: #fff;
}

table.data-out th.col-header.filter-active .th-label,
table.data-out th.sorted-asc .th-label,
table.data-out th.sorted-desc .th-label {
  color: #1d4ed8;
}

/* Sticky meta columns (TR + Page) */
table.data-out .sticky-col {
  position: sticky;
  z-index: 2;
  background-color: inherit;
}

table.data-out thead .sticky-col {
  z-index: 4;
  background: #f4f7fb;
}

table.data-out .sticky-col-0 {
  left: 0;
  box-shadow: 2px 0 4px rgba(15, 23, 42, 0.04);
}

table.data-out .sticky-col-1 {
  left: var(--sticky-col-1-left, 40px);
  box-shadow: 2px 0 4px rgba(15, 23, 42, 0.04);
}

table.data-out tbody tr:hover .sticky-col {
  background-color: #eff6ff;
}

table.data-out tbody tr.row-warn .sticky-col {
  background-color: #fffbeb;
}

table.data-out th .col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 6;
}

table.data-out th .col-resizer:hover,
table.data-out th .col-resizer.active {
  background: rgba(37, 99, 235, 0.18);
}

body.col-resizing {
  cursor: col-resize;
  user-select: none;
}

table.data-out th.sortable:hover {
  background: #eef4fb;
}

table.data-out th.sortable:hover .th-label {
  color: #0f2744;
}

/* Column filter popup */
.dt-col-filter-popup {
  position: fixed;
  z-index: 2000;
  width: 260px;
  padding: 12px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

.dt-col-filter-popup.hidden {
  display: none;
}

.dt-cf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dt-cf-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
}

.dt-cf-close {
  border: 0;
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 6px;
}

.dt-cf-close:hover {
  color: #334155;
}

.dt-cf-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 4px;
}

.dt-cf-label.hidden {
  display: none;
}

.dt-col-filter-popup .dt-cf-mode,
.dt-col-filter-popup .dt-cf-query {
  width: 100%;
  margin-bottom: 10px;
  padding: 7px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  font-size: 0.8125rem;
  box-sizing: border-box;
}

.dt-col-filter-popup .dt-cf-query.hidden {
  display: none;
}

.dt-cf-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Row styling */
table.data-out tbody tr td {
  background: #fff;
  transition: background 0.12s ease;
}

table.data-out tbody tr.row-even td {
  background: #fafbfc;
}

table.data-out tbody tr:hover td {
  background: #f3f7fc;
}

table.data-out tbody tr:hover td:first-child {
  box-shadow: none;
}

table.data-out tr.row-warn td {
  background: #fffbeb !important;
}

table.data-out tr.row-warn:hover td:first-child {
  box-shadow: none;
}

table.data-out td.tr-col {
  font-variant-numeric: tabular-nums;
  color: inherit;
  font-size: inherit;
  font-weight: 400;
  text-align: center;
  padding-left: 10px;
  padding-right: 10px;
}

table.data-out td.compact-col:not(.num-col):not(.tr-col) {
  text-align: center;
}

table.data-out td.compact-col {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  overflow: hidden;
}

table.data-out td.date-col,
table.data-out th.date-col {
  font-variant-numeric: tabular-nums;
  text-align: left;
  padding-left: 12px;
  padding-right: 12px;
}

table.data-out td.wrap-col {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-align: left;
}

/* Header labels must wrap — never inherit cell nowrap */
table.data-out th.compact-col {
  white-space: normal;
  overflow-wrap: break-word;
}

table.data-out td.id-col,
table.data-out th.id-col {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: #334155;
}

table.data-out td.sparse-col,
table.data-out th.sparse-col {
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
  color: inherit;
}

table.data-out td.num-col {
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: inherit;
  font-weight: 400;
  font-size: inherit;
  letter-spacing: -0.01em;
  padding-left: 10px;
  padding-right: 14px;
}

table.data-out th.num-col {
  text-align: center;
}

table.data-out .no-rows td {
  text-align: center;
  color: #64748b;
  padding: 3rem 1rem;
  font-style: italic;
  background: #fafbfc !important;
  box-shadow: none !important;
}

.data-table-empty {
  padding: 40px;
  text-align: center;
  color: #64748b;
}

@media (max-width: 768px) {
  .data-table-filter-bar {
    padding: 8px;
  }

  .dt-filter-page {
    width: 100%;
  }

  .dt-input {
    width: 64px;
  }

  .data-table-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .dt-page-controls {
    justify-content: space-between;
  }
}

/* Stable, product-grade interaction layer */
.data-table-root,
.data-table-root * {
  box-sizing: border-box;
}

.data-table-toolbar {
  min-height: 52px;
  padding: 8px 12px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #dbe3ec;
}

.data-table-toolbar .dt-search-wrap {
  min-height: 36px;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.data-table-toolbar .dt-search-wrap input::placeholder {
  color: #94a3b8;
}

.data-table-toolbar .dt-icon-btn {
  min-height: 36px;
  min-width: 36px;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.data-table-filter-bar {
  min-height: 38px;
  padding: 7px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.data-table-scroll {
  scrollbar-color: #cbd5e1 transparent;
  scrollbar-width: thin;
}

.data-table-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.data-table-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border: 3px solid #fff;
  border-radius: 999px;
}

.data-table-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

table.data-out thead th {
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.06);
}

table.data-out th .sort-indicator,
table.data-out th .col-filter-btn {
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

table.data-out th .sort-indicator:hover,
table.data-out th .col-filter-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

table.data-out th.sorted-asc .sort-indicator,
table.data-out th.sorted-desc .sort-indicator {
  box-shadow: none;
}

table.data-out tbody tr {
  transition: transform 0.12s ease;
}

table.data-out tbody tr:hover {
  position: relative;
  z-index: 1;
}

table.data-out tbody tr.row-warn td {
  border-color: #fde68a;
}

.data-table-pagination {
  min-height: 52px;
  padding: 9px 12px;
  background: #fff;
}

.data-table-pagination .dt-icon-btn,
.data-table-pagination .dt-page-size,
.data-table-pagination .dt-page-input {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

@media (max-width: 600px) {
  .data-table-toolbar {
    gap: 6px;
  }

  .data-table-toolbar .dt-search-wrap {
    flex-basis: 100%;
    max-width: none;
  }

  table.data-out th .th-shell {
    padding: 5px 6px 3px;
    min-height: 52px;
  }

  table.data-out th .th-label {
    font-size: 11px;
  }
}
