/* ── Drothven tables.css ────────────────────────────────
   Sortable stat tables, responsive, sticky header,
   orange sort-indicator, alternating rows.
   ─────────────────────────────────────────────────────── */

.stat-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
}

.stat-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
    font-size: 0.875rem;
}

/* ── Header ────────────────────────────────────────────── */
.stat-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.stat-table th {
    background: var(--c-surface);
    color: var(--c-text);
    font-weight: 600;
    font-size: 0.8125rem;
    padding: var(--s-12) var(--s-16);
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid var(--c-border);
    user-select: none;
}

.stat-table th[data-sort] {
    cursor: pointer;
    transition: color var(--dur) var(--ease);
}

.stat-table th[data-sort]:hover {
    color: var(--c-accent);
}

/* ── Sort indicator ────────────────────────────────────── */
.stat-table th[aria-sort]::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: var(--s-8);
    vertical-align: middle;
}

.stat-table th[aria-sort="ascending"]::after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid var(--c-accent);
}

.stat-table th[aria-sort="descending"]::after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--c-accent);
}

/* ── Body ──────────────────────────────────────────────── */
.stat-table td {
    padding: var(--s-12) var(--s-16);
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text);
    white-space: nowrap;
}

/* Alternating rows */
.stat-table tbody tr:nth-child(even) {
    background: var(--c-surface);
}

.stat-table tbody tr:hover {
    background: var(--c-surface-2);
}

/* ── Numeric cells ─────────────────────────────────────── */
.stat-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── Form dots in table ────────────────────────────────── */
.stat-table .form-dots {
    justify-content: flex-start;
}
