/* ========================================
   Entity index tables and lists
   (split from main.css, PLAN-165 D9)
   ======================================== */

/* Entity Index Tables (Bits, Tags, Groups, Cards)
   ---------------------------------------- */
.entity-table-wrap {
  overflow-x: auto;
}

/* A white card with a thin border, a bold header row and row dividers, as
   docs.bitmark.cloud (PLAN-274 D7a). Borders are separate so the card can
   round its corners. */
.entity-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  font-size: var(--text-sm);
}

.entity-table th,
.entity-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
}

.entity-table tbody tr:last-child > * {
  border-bottom: none;
}

.entity-table thead th {
  position: sticky;
  top: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-weight: 700;
  white-space: nowrap;
}

.entity-table thead th:first-child {
  border-top-left-radius: var(--radius-md);
}

.entity-table thead th:last-child {
  border-top-right-radius: var(--radius-md);
}

.entity-table .sort-button {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.entity-table .sort-button:hover {
  color: var(--color-link);
}

.entity-table th[aria-sort='ascending'] .sort-button::after {
  content: ' \25b4';
}

.entity-table th[aria-sort='descending'] .sort-button::after {
  content: ' \25be';
}

.entity-table .cell-name {
  font-family: var(--font-mono);
  white-space: nowrap;
}

.entity-table .cell-description {
  color: var(--color-text-muted);
  max-width: 28rem;
}

.entity-table tbody tr:hover {
  background-color: var(--color-bg-subtle);
}

/* Deprecation marker (index rows) */
.deprecated-badge {
  display: inline-block;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  background-color: var(--color-warning);
  color: #000000;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  white-space: nowrap;
}

/* Entity Index List (Bits, Tags, Groups, Cards)
   ---------------------------------------- */
.entity-index {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.entity-index li {
  padding: var(--space-4);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.entity-index li:hover {
  border-color: var(--color-link);
  box-shadow: var(--shadow-sm);
}

.entity-index a {
  font-weight: 600;
  font-size: var(--text-lg);
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
}

.entity-index .description {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin: 0;
  line-height: var(--line-height-relaxed);
}
