/* Shared table surface. This widget is loaded once from the global theme assets. */
.kp-data-table__wrap,
.kp-data-table__wrap.admin-table-wrap,
.admin-view .kp-data-table__wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.kp-data-table {
  width: 100%;
  min-width: 0 !important;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--kp-color-text, inherit);
  font-size: 13px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.kp-data-table th,
.kp-data-table td,
.kp-data-table.admin-table th,
.kp-data-table.admin-table td {
  box-sizing: border-box;
  padding: 10px 12px;
  border-bottom: 1px solid var(--kp-color-border, #e3e8ef);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.kp-data-table th,
.kp-data-table.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--kp-color-surface-muted, #f2f5f9);
  color: var(--kp-color-text-muted, #667085);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.kp-data-table tbody tr:last-child td { border-bottom: 0; }
.kp-data-table tbody tr { transition: background 120ms ease; }
.kp-data-table tbody tr:hover { background: color-mix(in srgb, var(--kp-accent, #179d72) 4%, transparent); }
.kp-data-table td > :first-child { max-width: 100%; }
.kp-data-table td code,
.kp-data-table td pre,
.kp-data-table td .mono { overflow-wrap: anywhere; white-space: pre-wrap; }
.kp-data-table td input,
.kp-data-table td select,
.kp-data-table td textarea { max-width: 100%; }
.kp-data-table__align-center { text-align: center !important; }
.kp-data-table__align-right { text-align: right !important; }
.kp-data-table__empty,
.kp-data-table__empty-cell { padding: 18px; color: var(--kp-color-text-muted, #667085); text-align: center !important; }
.kp-data-table__caption { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.admin-view[data-admin-view-panel="antiabuse"] .kp-data-table__wrap { overflow-x: auto; }

.kp-data-table[data-kp-layout="scroll"] {
  width: max-content;
  min-width: 100% !important;
  max-width: none;
}

.kp-data-table[data-kp-layout="cards"] {
  display: block;
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.kp-data-table[data-kp-layout="cards"] > thead {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.kp-data-table[data-kp-layout="cards"] > tbody {
  display: grid;
  gap: 8px;
}

.kp-data-table[data-kp-layout="cards"] > tbody > tr {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--kp-color-border, #e3e8ef);
  border-radius: 10px;
  background: var(--kp-color-surface, #fff);
}

.kp-data-table[data-kp-layout="cards"] > tbody > tr:hover { background: var(--kp-color-surface, #fff); }
.kp-data-table[data-kp-layout="cards"] > tbody > tr > td,
.kp-data-table[data-kp-layout="cards"] > tbody > tr > td.admin-table-cell {
  display: grid;
  grid-template-columns: minmax(5.5rem, 34%) minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border-bottom: 1px solid var(--kp-color-border, #e3e8ef);
  font-size: 13px;
}

.kp-data-table[data-kp-layout="cards"] > tbody > tr > td::before {
  content: attr(data-kp-label);
  color: var(--kp-color-text-muted, #667085);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .025em;
  line-height: 1.4;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.kp-data-table[data-kp-layout="cards"] > tbody > tr > td[colspan] { grid-column: 1 / -1; }
.kp-data-table[data-kp-layout="cards"] > tbody > tr > td[colspan]::before { display: none; }
.kp-data-table[data-kp-layout="cards"] > tbody > tr > td[data-kp-label=""] { grid-template-columns: minmax(0, 1fr); }
.kp-data-table[data-kp-layout="cards"] > tbody > tr > td[data-kp-label=""]::before { display: none; }
.kp-data-table[data-kp-layout="cards"] > tbody > tr > td:last-child { border-bottom: 0; }
.kp-data-table[data-kp-layout="cards"] > tbody > tr > td > * { min-width: 0; }

@media (max-width: 420px) {
  .kp-data-table th,
  .kp-data-table td,
  .kp-data-table.admin-table th,
  .kp-data-table.admin-table td { padding: 8px 9px; }
  .kp-data-table[data-kp-layout="cards"] > tbody > tr > td { grid-template-columns: minmax(4.5rem, 31%) minmax(0, 1fr); gap: 6px; }
}
