/* Stats page — searchable, sortable member stats + script-version overview.
   Reuses the design tokens from style.css. Column-0 indentation, like
   members.css. */

.stats-wrap {
max-width: 1180px;
margin: 0 auto;
padding: 32px 28px 64px;
display: flex;
flex-direction: column;
gap: 28px;
}

.stats-masthead {
display: flex;
flex-direction: column;
gap: 8px;
}
.stats-masthead h1 { margin: 0; font-size: 28px; }
.stats-lede {
margin: 0;
font-size: 13.5px;
line-height: 1.55;
color: var(--text-secondary);
max-width: 78ch;
}

.stats-panel {
background: var(--surface);
border: 1px solid var(--border-soft);
border-radius: 10px;
box-shadow: var(--shadow);
padding: 18px 20px 20px;
display: flex;
flex-direction: column;
gap: 14px;
}
.stats-panel h2 { font-size: 18px; }

.stats-toolbar {
display: flex;
align-items: center;
gap: 12px;
flex-wrap: wrap;
}
#statsSearch {
font-size: 14px;
padding: 8px 12px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--surface);
color: var(--text-primary);
width: min(440px, 100%);
}
.stats-count {
font-size: 12px;
color: var(--text-muted);
white-space: nowrap;
}

.stats-table-scroll { overflow-x: auto; }

table.stats-table {
width: 100%;
border-collapse: collapse;
font-size: 13.5px;
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.stats-table th {
text-align: left;
font-size: 11.5px;
font-weight: 700;
letter-spacing: 0.045em;
text-transform: uppercase;
color: var(--text-muted);
padding: 8px 10px;
border-bottom: 1px solid var(--border);
white-space: nowrap;
cursor: pointer;
user-select: none;
}
.stats-table th:hover { color: var(--text-primary); }
.stats-table th.sorted { color: var(--accent-ink); }
.stats-table th.sorted.asc { color: var(--accent-ink); }
.stats-table td {
padding: 7px 10px;
border-bottom: 1px solid var(--border-soft);
white-space: nowrap;
}
.stats-table tbody tr:hover { background: var(--surface-alt); }
/* Stat cells left-aligned to match the left-aligned headers, so a number
   sits directly under its label. Right-aligned numbers in narrow columns
   (e.g. the aura level column next to its long header) read as detached
   from the label — hard to tell which number belongs to which stat. */
.stats-table td.num-cell {
text-align: left;
font-variant-numeric: tabular-nums;
}
.stats-table td.dim { color: var(--text-muted); }
/* Aura "(eff.)" cells: the skill-scaled strength from the wiki formula. */
.aura-eff { font-weight: 600; }
.stats-table td.name-cell a {
color: var(--accent-ink);
font-weight: 600;
text-decoration: none;
}
.stats-table td.name-cell a:hover { text-decoration: underline; }

/* Script Version cell coloring — mirrors the Members page's version stats. */
.stats-ver { font-weight: 600; }
.stats-ver-latest { color: var(--good); }
.stats-ver-outdated { color: var(--accent-ink); }
.stats-ver-none { color: var(--text-muted); font-style: italic; font-weight: 400; }

.stats-empty {
margin: 0;
font-size: 13.5px;
color: var(--text-muted);
}

/* ------------------------------------------------- script-version panel */
.version-summary {
margin: 0;
font-size: 13.5px;
color: var(--text-secondary);
}

.version-groups {
display: flex;
flex-direction: column;
gap: 10px;
}
.version-group {
padding: 10px 12px;
border: 1px solid var(--border-soft);
border-radius: 8px;
background: var(--surface-alt);
display: flex;
flex-direction: column;
gap: 6px;
}
.version-group-head {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
}
.version-group-ver { font-weight: 700; font-size: 14px; }
.version-group-count { font-size: 12.5px; color: var(--text-secondary); }
.version-group-names {
font-size: 12.5px;
color: var(--text-muted);
line-height: 1.65;
}
.version-badge {
font-size: 10.5px;
font-weight: 700;
letter-spacing: 0.05em;
text-transform: uppercase;
padding: 2px 8px;
border-radius: 999px;
line-height: 1.5;
}
.version-badge-latest { color: var(--good); background: var(--good-bg); }
.version-badge-outdated { color: var(--accent-ink); background: var(--accent-wash); }
.version-badge-none { color: var(--text-muted); background: var(--surface-sunken); }
