/**
 * Shared admin data table — consistent with Workflow Review Dashboard.
 * Use: .admin-table-wrap > table.admin-table
 */

.admin-table-wrap,
.table-scroll.admin-table-wrap,
.ir-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: auto;
  background: #fff;
  margin-top: 0;
}

/* Legacy .table-scroll without wrap styles — inherit when combined */
.table-scroll:not(.admin-table-wrap) {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: auto;
  background: #fff;
}

.admin-table,
.ir-table,
.table-scroll > table,
table.admin-table-rows,
table.links-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table thead,
.ir-table thead,
.table-scroll > table thead,
table.admin-table-rows thead,
table.links-table thead {
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-table th,
.ir-table th,
.table-scroll > table th,
table.admin-table-rows th,
table.links-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.admin-table td,
.ir-table td,
.table-scroll > table td,
table.admin-table-rows td,
table.links-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.admin-table tbody tr:hover,
.ir-table tbody tr:hover,
.table-scroll > table tbody tr:hover,
table.admin-table-rows tbody tr:hover,
table.links-table tbody tr:hover {
  background: #f8fafc;
}

.admin-table tbody tr:last-child td,
.ir-table tbody tr:last-child td,
.table-scroll > table tbody tr:last-child td,
table.admin-table-rows tbody tr:last-child td,
table.links-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table .empty-state,
.ir-table .empty-state,
.table-scroll .empty-state {
  padding: 24px 12px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

.admin-table__cell-primary,
.ir-cell-candidate {
  font-weight: 500;
  color: #0f172a;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table__cell-muted,
.ir-cell-muted,
.ir-cell-job {
  color: #64748b;
  white-space: nowrap;
}

.admin-table td.table-cell-clip {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-table .action-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

/* Pagination row below tables */
.admin-table-pagination,
.ir-pagination,
.users-pagination-bar,
.card > .pager-actions,
.card > .toolbar-row-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0 0;
  font-size: 13px;
  color: #64748b;
}

.admin-table-pagination-actions,
.ir-pagination-actions {
  display: flex;
  gap: 6px;
}

.admin-table-pagination .btn-sm,
.ir-pagination .btn-sm,
.card > .pager-actions .btn-sm,
.card > .toolbar-row-compact .btn-sm {
  min-height: var(--btn-height-sm);
  padding: 0 var(--btn-sm-pad-x);
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  border-radius: var(--btn-radius-sm);
}

.admin-page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.admin-page-size-label {
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
}

.admin-page-size-select {
  width: auto;
  min-width: 72px;
  height: 32px;
  padding: 4px 8px;
  font-size: 13px;
}

@media (max-width: 640px) {
  .admin-page-size-control {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}

/* Compact table action button (e.g. Review workflow) */
.admin-table-btn,
.ir-btn-review {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--btn-height-sm);
  height: var(--btn-height-sm);
  padding: 0 var(--btn-sm-pad-x);
  font-family: inherit;
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  line-height: 1.2;
  color: #0d9488;
  background: #fff;
  border: 1px solid #99f6e4;
  border-radius: var(--btn-radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}

.admin-table-btn:hover,
.ir-btn-review:hover {
  background: #f0fdfa;
  border-color: #0d9488;
}

/* Sortable column headers */
.admin-table-th--sortable {
  padding: 0;
}

.admin-table-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  margin: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s, background 0.12s;
}

.admin-table-sort-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.admin-table-sort-btn:focus-visible {
  outline: 2px solid rgba(13, 148, 136, 0.45);
  outline-offset: -2px;
}

.admin-table-sort-btn i {
  font-size: 11px;
  opacity: 0.55;
}

.admin-table-th--sortable .admin-table-sort-btn[aria-sort='ascending'] i,
.admin-table-th--sortable .admin-table-sort-btn[aria-sort='descending'] i {
  opacity: 1;
  color: #0d9488;
}
