.list-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.search-bar { margin: .5rem 0 1rem; }
.search-bar input[type="search"] {
  width: 100%; padding: .55rem .75rem; border: 1px solid var(--c-border);
  border-radius: var(--radius); background: var(--c-surface);
}
.data-table {
  width: 100%; border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-surface); font-size: .92rem; border-collapse: separate;
  border-spacing: 0;
}
.data-table thead th {
  text-align: left; background: #f1f5f9; padding: .6rem .8rem;
  font-weight: 600; color: #475569; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .04em; border-bottom: 1px solid var(--c-border);
  /* Stays in view as you scroll the page — see which column you're in. */
  position: sticky; top: 0; z-index: 2;
}
/* The sticky-right action column needs higher z-index so it lifts above
   the sticky-top thead in the corner intersection. */
.data-table thead th.sticky-right { z-index: 3; }
.data-table tbody td {
  padding: .55rem .8rem; border-bottom: 1px solid var(--c-border);
  vertical-align: middle; white-space: nowrap;
}
.data-table td.wrap, .data-table th.wrap { white-space: normal; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table .actions a { color: var(--c-accent); text-decoration: none; margin-right: .5rem; }
.data-table .actions a:hover { text-decoration: underline; }
.data-table .empty { text-align: center; color: var(--c-muted); padding: 2rem; }
.meta { color: var(--c-muted); font-size: .85rem; margin: .5rem 0 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pagination, .alphabet {
  display: flex; flex-wrap: wrap; gap: .15rem; margin: .75rem 0;
  align-items: center; font-size: .85rem;
}
.pagination a, .alphabet a {
  display: inline-block; padding: .25rem .55rem;
  border: 1px solid var(--c-border); border-radius: 3px;
  background: var(--c-surface); text-decoration: none; color: var(--c-text);
}
.pagination a:hover, .alphabet a:hover { border-color: var(--c-accent); color: var(--c-accent); }
.pagination a.active, .alphabet a.active {
  background: var(--c-accent); color: #fff; border-color: var(--c-accent);
}
.pagination a.disabled { color: var(--c-muted); pointer-events: none; opacity: .5; }
.pagination .meta { margin-left: 1rem; }
.alphabet { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.alphabet a { min-width: 2rem; text-align: center; padding: .25rem .35rem; }
.data-table th a { color: inherit; text-decoration: none; }
.data-table th a.sorted { color: var(--c-accent); }
.matrix-wrap, .table-scroll { overflow-x: auto; max-width: 100%; border-radius: var(--radius); }
.table-scroll .data-table { border-radius: 0; }
.data-table.matrix { min-width: 1800px; font-size: .82rem; }
.data-table.matrix th, .data-table.matrix td { padding: .3rem .5rem; white-space: nowrap; }
.data-table.matrix thead th { position: sticky; top: 0; z-index: 2; }
.data-table.matrix .sticky-col { position: sticky; left: 0; background: var(--c-surface); z-index: 1; min-width: 200px; }
.data-table.matrix thead .sticky-col { z-index: 3; background: #f1f5f9; }

.data-table .sticky-right {
  position: sticky; right: 0; background: var(--c-surface);
  box-shadow: -6px 0 8px -4px rgba(15, 23, 42, .12); z-index: 1;
  white-space: nowrap; width: 1%;
}
.data-table td.note {
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--c-muted); font-size: .85rem; cursor: help;
}
.tip-tooltip {
  position: fixed; z-index: 9999; pointer-events: none;
  background: #1f2937; color: #f9fafb;
  padding: .55rem .75rem; border-radius: 6px;
  white-space: pre-wrap; word-wrap: break-word;
  max-width: 440px; min-width: 220px;
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
  font-size: .8rem; line-height: 1.45;
  opacity: 0; transition: opacity .12s ease-out;
}
.tip-tooltip.visible { opacity: 1; }
.data-table thead th.sticky-right { background: #f1f5f9; z-index: 2; }
.data-table tbody tr:hover .sticky-right { background: #f8fafc; }
.data-table .actions { display: table-cell; }
.data-table .actions a, .data-table .actions .btn-link {
  display: inline-block; padding: .15rem .55rem; margin-right: .25rem;
  border-radius: 4px; text-decoration: none; color: var(--c-accent); font-size: .85rem;
  background: transparent; border: 0; cursor: pointer; font-family: inherit;
}
.data-table .actions button.btn-link { line-height: 1.4; }
.data-table .actions a:hover, .data-table .actions .btn-link:hover {
  background: rgba(30,64,175,.08); text-decoration: none;
}
.data-table .actions .btn-link.danger { color: var(--c-error); }
.data-table .actions .btn-link.danger:hover { background: var(--c-error-bg); }
.data-table .actions form { display: inline-block; margin-right: .25rem; }
.data-table .actions form .btn { padding: .15rem .55rem; font-size: .85rem; }
