/**
 * Base data table styles.
 * Shared by display-only tables and Simple-DataTables controls.
 */

.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
}

.data-table,
.sdt-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 15px;
}

.data-table thead,
.sdt-table thead {
  background:
    linear-gradient(
      180deg,
      rgba(84, 100, 138, 0.98) 0%,
      rgba(44, 56, 84, 0.98) 100%
    ),
    radial-gradient(
      140% 140% at 10% 0%,
      rgba(148, 163, 184, 0.28) 0%,
      rgba(15, 23, 42, 0) 55%
    );
  color: var(--heading-color);
  box-shadow:
    inset 0 1px 0 rgba(148, 163, 184, 0.22),
    inset 0 -1px 0 rgba(148, 163, 184, 0.32);
}

.data-table thead th,
.sdt-table thead th {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(226, 232, 240, 0.85);
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
  white-space: nowrap;
  position: relative;
  user-select: none;
}

.dt-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-table thead th:first-child,
.sdt-table thead th:first-child {
  padding-left: 20px;
}

.data-table thead th:last-child,
.sdt-table thead th:last-child {
  padding-right: 20px;
}

body.theme-light .data-table thead,
body.theme-light .sdt-table thead {
  background:
    linear-gradient(
      180deg,
      rgba(190, 214, 245, 1) 0%,
      rgba(164, 192, 232, 1) 100%
    ),
    radial-gradient(
      140% 140% at 10% 0%,
      rgba(99, 102, 241, 0.28) 0%,
      rgba(255, 255, 255, 0) 55%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(30, 41, 59, 0.65),
    0 1px 0 rgba(71, 85, 105, 0.35);
}

body.theme-light .data-table thead th,
body.theme-light .sdt-table thead th {
  color: #1f2937;
}

.data-table tbody td,
.sdt-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  color: var(--text-color);
}

.data-table tbody tr:nth-child(even),
.sdt-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover td,
.sdt-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.05);
}

body.theme-light .data-table tbody tr:nth-child(even),
body.theme-light .sdt-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.03);
}

body.theme-light .data-table tbody tr:hover td,
body.theme-light .sdt-table tbody tr:hover td {
  background: rgba(0, 0, 0, 0.04);
}

.data-table-align-left thead th,
.data-table-align-left tbody td {
  text-align: left;
}

.data-table-align-center thead th,
.data-table-align-center tbody td {
  text-align: center;
}

.data-table-align-right thead th,
.data-table-align-right tbody td {
  text-align: right;
}

.data-table-cell-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-color);
}

.data-table-cell-muted {
  font-size: 14px;
  color: var(--muted-text);
}

.data-table-cell-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.data-table-cell-image {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.data-table-cell-image img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  flex-shrink: 0;
}

.data-table-empty td,
.data-table-loading td {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted-text);
  font-size: 15px;
}

.data-table-empty td .data-table-empty-icon,
.data-table-loading td .data-table-loading-icon {
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.data-table-section {
  margin-bottom: 24px;
}

.data-table-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--heading-color);
  margin: 0 0 16px 0;
}

.data-table-section-title .fa,
.data-table-section-title .fas {
  color: var(--primary-blue);
  font-size: 20px;
}

.sdt-wrapper .dt-layout-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin: 0.75em 0;
  padding: 0 20px;
  gap: 12px;
}

.sdt-wrapper .dt-layout-cell {
  display: flex;
  align-items: center;
}

.sdt-wrapper .dt-layout-start {
  justify-content: flex-start;
}

.sdt-wrapper .dt-layout-end {
  justify-content: flex-end;
  margin-left: auto;
}

.dt-info {
  margin: 0;
  color: var(--muted-text);
  font-size: 14px;
}

.dt-paging nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dt-paging-button {
  padding: 4px 8px;
  margin: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.2;
  border-radius: 4px;
}

.dt-paging-button:hover {
  border-color: var(--primary-blue);
  background: rgba(59, 130, 246, 0.12);
  color: var(--heading-color);
}

.dt-paging-button.current {
  border-color: var(--primary-blue);
  background: rgba(59, 130, 246, 0.12);
  color: var(--heading-color);
  font-weight: 600;
}

.dt-paging-button.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: var(--muted-text);
}

table.sdt-table thead .dt-order-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 4px 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.2;
  border-radius: 4px;
  height: 22px;
}

table.sdt-table thead .dt-order-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

table.sdt-table thead .dt-order-toggle.is-asc,
table.sdt-table thead .dt-order-toggle.is-desc {
  border-color: rgba(99, 102, 241, 0.75);
  background: rgba(99, 102, 241, 0.2);
  color: var(--heading-color);
}

@media (max-width: 767px) {
  .data-table-mobile-cards.data-table-wrap {
    overflow-x: auto;
    min-width: 0;
  }

  .data-table-mobile-cards .data-table,
  .data-table-mobile-cards .sdt-table {
    min-width: 720px;
  }

  .sdt-wrapper .dt-layout-row {
    display: block;
    padding: 0 12px;
  }

  .sdt-wrapper .dt-layout-cell {
    display: block;
    text-align: center;
    margin: 0.5em 0;
  }

  .dt-paging nav {
    justify-content: center;
    flex-wrap: wrap;
  }
}
