﻿/* ══════════════════════════════════════════
   DASHBOARD — GLOBAL STYLES
   Theme-aware via body[data-theme]
══════════════════════════════════════════ */

.dash-container {
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: hidden;
}

/* ── MAIN TABS ── */
.dash-main-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(var(--ink-rgb), 0.08);
}

.dash-main-tab {
    padding: 10px 22px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
    letter-spacing: 0.2px;
}

body[data-theme="neuro"] .dash-main-tab { color: var(--neuro-text-muted); }
body[data-theme="evil"] .dash-main-tab { color: var(--evil-text-muted); }
body[data-theme="twins"] .dash-main-tab { color: var(--twins-text-muted); }

body[data-theme="neuro"] .dash-main-tab.active {
    color: var(--neuro-primary);
    border-bottom-color: var(--neuro-primary);
}
body[data-theme="evil"] .dash-main-tab.active {
    color: var(--evil-primary);
    border-bottom-color: var(--evil-primary);
}
body[data-theme="twins"] .dash-main-tab.active {
    color: var(--twins-primary);
    border-bottom-color: var(--twins-primary);
}

body[data-theme="neuro"] .dash-main-tab:hover:not(.active) { color: var(--neuro-text-secondary); }
body[data-theme="evil"] .dash-main-tab:hover:not(.active) { color: var(--evil-text-secondary); }
body[data-theme="twins"] .dash-main-tab:hover:not(.active) { color: var(--twins-text-secondary); }

.dash-admin-tab-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-lock-icon {
    font-size: 11px;
    opacity: .7;
}

/* ── PAGE HEADER ── */
.dash-page-header {
    margin-bottom: 20px;
}

.dash-page-title {
    font-size: clamp(22px, 5vw, 30px);
    font-weight: 800;
    font-family: 'Roboto', sans-serif;
    letter-spacing: -1px;
    line-height: 1;
}

.dash-page-sub {
    font-size: 13px;
    font-family: 'Roboto Mono', monospace;
    margin: 4px 0 0;
    letter-spacing: 0.2px;
}

.dash-range-badge {
    display: inline-block;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 12px;
    font-family: 'Roboto Mono', monospace;
    margin-left: 6px;
}

body[data-theme="neuro"] .dash-range-badge {
    background: var(--neuro-bg-elevated);
    color: var(--neuro-primary);
}
body[data-theme="evil"] .dash-range-badge {
    background: var(--evil-bg-elevated);
    color: var(--evil-primary);
}
body[data-theme="twins"] .dash-range-badge {
    background: var(--twins-bg-elevated);
    color: var(--twins-primary);
}

/* ── TOOLBAR ── */
.dash-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.dash-tab-group {
    display: flex;
    border: 1px solid rgba(var(--ink-rgb), 0.06);
    border-radius: 12px;
    padding: 4px;
    gap: 2px;
    flex-wrap: wrap;
}

body[data-theme="neuro"] .dash-tab-group { background: var(--neuro-bg-secondary); }
body[data-theme="evil"] .dash-tab-group { background: var(--evil-bg-secondary); }
body[data-theme="twins"] .dash-tab-group { background: var(--twins-bg-secondary); }

.dash-tab-btn {
    padding: 6px 13px;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}

body[data-theme="neuro"] .dash-tab-btn { color: var(--neuro-text-muted); }
body[data-theme="evil"] .dash-tab-btn { color: var(--evil-text-muted); }
body[data-theme="twins"] .dash-tab-btn { color: var(--twins-text-muted); }

body[data-theme="neuro"] .dash-tab-btn.active {
    color: var(--neuro-primary);
    background: var(--neuro-bg-elevated);
}
body[data-theme="evil"] .dash-tab-btn.active {
    color: var(--evil-primary);
    background: var(--evil-bg-elevated);
}
body[data-theme="twins"] .dash-tab-btn.active {
    color: var(--twins-primary);
    background: var(--twins-bg-elevated);
}

body[data-theme="neuro"] .dash-tab-btn:hover:not(.active) { color: var(--neuro-text-secondary); }
body[data-theme="evil"] .dash-tab-btn:hover:not(.active) { color: var(--evil-text-secondary); }
body[data-theme="twins"] .dash-tab-btn:hover:not(.active) { color: var(--twins-text-secondary); }

/* Domain tabs (admin amber) */
.dash-domain-tabs .dash-tab-btn.active { color: #F59E0B !important; }
.dash-domain-tabs .dash-tab-btn { color: #7A7A8A !important; }
.dash-domain-tabs .dash-tab-btn:hover:not(.active) { color: #B0A080 !important; }

/* Custom range */
.dash-custom-range {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.dash-custom-range label {
    font-size: 13px;
    font-family: 'Roboto Mono', monospace;
}

body[data-theme="neuro"] .dash-custom-range label { color: var(--neuro-text-muted); }
body[data-theme="evil"] .dash-custom-range label { color: var(--evil-text-muted); }
body[data-theme="twins"] .dash-custom-range label { color: var(--twins-text-muted); }

.dash-date-input {
    border: 1px solid rgba(var(--ink-rgb), 0.06);
    border-radius: 8px;
    padding: 6px 10px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    color-scheme: dark;
}

body[data-theme="neuro"] .dash-date-input { background: var(--neuro-bg-secondary); color: var(--neuro-text-primary); }
body[data-theme="evil"] .dash-date-input { background: var(--evil-bg-secondary); color: var(--evil-text-primary); }
body[data-theme="twins"] .dash-date-input { background: var(--twins-bg-secondary); color: var(--twins-text-primary); }

body[data-theme="neuro"] .dash-date-input:focus { border-color: var(--neuro-primary); }
body[data-theme="evil"] .dash-date-input:focus { border-color: var(--evil-primary); }
body[data-theme="twins"] .dash-date-input:focus { border-color: var(--twins-primary); }

.dash-apply-btn {
    padding: 6px 16px;
    border-radius: 8px;
    border: none;
    color: #000;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

body[data-theme="neuro"] .dash-apply-btn { background: var(--neuro-primary); }
body[data-theme="evil"] .dash-apply-btn { background: var(--evil-primary); }
body[data-theme="twins"] .dash-apply-btn { background: var(--twins-primary); }

.dash-apply-btn:hover { opacity: 0.8; }

/* ── STAT GRID ── */
.dash-sg {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

@media (max-width: 700px) {
    .dash-sg { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    .dash-sg { grid-template-columns: repeat(2, 1fr); }
}

.dash-sc {
    border: 1px solid rgba(var(--ink-rgb), 0.06);
    border-radius: 14px;
    padding: 16px 14px;
    position: relative;
    overflow: hidden;
    min-width: 0;
    transition: border-color 0.2s, transform 0.15s;
}

body[data-theme="neuro"] .dash-sc { background: var(--neuro-bg-secondary); }
body[data-theme="evil"] .dash-sc { background: var(--evil-bg-secondary); }
body[data-theme="twins"] .dash-sc { background: var(--twins-bg-secondary); }

.dash-sc::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    opacity: 0.8;
    border-radius: 14px 14px 0 0;
}

.dash-sc.green::before { background: #10B981 !important; }
.dash-sc.red::before { background: #EF4444 !important; }

.dash-slbl {
    font-size: 11px;
    font-family: 'Roboto Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

body[data-theme="neuro"] .dash-slbl { color: var(--neuro-text-primary); }
body[data-theme="evil"] .dash-slbl { color: var(--evil-text-primary); }
body[data-theme="twins"] .dash-slbl { color: var(--twins-text-primary); }

.dash-sval {
    font-size: clamp(20px, 3.5vw, 28px);
    font-weight: 800;
    font-family: 'Roboto', sans-serif;
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -1px;
    overflow-wrap: break-word;
    word-break: break-word;
}

body[data-theme="neuro"] .dash-sval { color: var(--neuro-text-primary); }
body[data-theme="evil"] .dash-sval { color: var(--evil-text-primary); }
body[data-theme="twins"] .dash-sval { color: var(--twins-text-primary); }

.dash-ssub { font-size: 12px; }

body[data-theme="neuro"] .dash-ssub { color: var(--neuro-text-secondary); }
body[data-theme="evil"] .dash-ssub { color: var(--evil-text-secondary); }
body[data-theme="twins"] .dash-ssub { color: var(--twins-text-secondary); }

.dash-strend { font-size: 12px; margin-top: 5px; font-weight: 600; }
.dash-strend.up { color: #4ade80; }
.dash-strend.dn { color: #f87171; }

/* ── CHART GRID ── */
.dash-cg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .dash-cg { grid-template-columns: 1fr; }
}

.dash-cc {
    border: 1px solid rgba(var(--ink-rgb), 0.06);
    border-radius: 14px;
    padding: 16px;
    min-width: 0;
    overflow: hidden;
}

body[data-theme="neuro"] .dash-cc { background: var(--neuro-bg-secondary); }
body[data-theme="evil"] .dash-cc { background: var(--evil-bg-secondary); }
body[data-theme="twins"] .dash-cc { background: var(--twins-bg-secondary); }

.dash-cc.full { grid-column: 1 / -1; }

.dash-ct {
    font-size: 15px;
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
    margin-bottom: 2px;
    letter-spacing: -0.3px;
}

body[data-theme="neuro"] .dash-ct { color: var(--neuro-text-primary); }
body[data-theme="evil"] .dash-ct { color: var(--evil-text-primary); }
body[data-theme="twins"] .dash-ct { color: var(--twins-text-primary); }

.dash-cs {
    font-size: 11px;
    font-family: 'Roboto Mono', monospace;
    margin-bottom: 14px;
}

body[data-theme="neuro"] .dash-cs { color: var(--neuro-text-muted); }
body[data-theme="evil"] .dash-cs { color: var(--evil-text-muted); }
body[data-theme="twins"] .dash-cs { color: var(--twins-text-muted); }

/* ── TOP LISTS ── */
.dash-tl { list-style: none; padding: 0; margin: 0; }

.dash-ti {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(var(--ink-rgb), 0.05);
}
.dash-ti:last-child { border-bottom: none; }

.dash-trk {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    min-width: 22px;
    font-weight: 500;
}

body[data-theme="neuro"] .dash-trk { color: var(--neuro-text-muted); }
body[data-theme="evil"] .dash-trk { color: var(--evil-text-muted); }
body[data-theme="twins"] .dash-trk { color: var(--twins-text-muted); }

.dash-trk.gold { color: #f59e0b !important; font-weight: 700; }
/* Amber only reaches 2.2:1 on a white surface, so deepen it in light mode. */
body[data-mode="light"] .dash-trk.gold { color: #9A6206 !important; }

.dash-tnm {
    flex: 1;
    font-size: 14px;
    min-width: 0;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

body[data-theme="neuro"] .dash-tnm { color: var(--neuro-text-secondary); }
body[data-theme="evil"] .dash-tnm { color: var(--evil-text-secondary); }
body[data-theme="twins"] .dash-tnm { color: var(--twins-text-secondary); }

body[data-theme="neuro"] a.dash-tnm:hover { color: var(--neuro-primary); text-decoration: underline; text-underline-offset: 3px; }
body[data-theme="evil"] a.dash-tnm:hover { color: var(--evil-primary); text-decoration: underline; text-underline-offset: 3px; }
body[data-theme="twins"] a.dash-tnm:hover { color: var(--twins-primary); text-decoration: underline; text-underline-offset: 3px; }

.dash-tbw {
    width: 60px;
    height: 3px;
    border-radius: 2px;
    flex-shrink: 0;
    background: rgba(var(--ink-rgb), 0.06);
}

.dash-tbar { height: 3px; border-radius: 2px; }

body[data-theme="neuro"] .dash-tbar { background: var(--neuro-primary); }
body[data-theme="evil"] .dash-tbar { background: var(--evil-primary); }
body[data-theme="twins"] .dash-tbar { background: var(--twins-primary); }

.dash-tcnt {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    min-width: 50px;
    text-align: right;
    font-weight: 500;
}

body[data-theme="neuro"] .dash-tcnt { color: var(--neuro-primary); }
body[data-theme="evil"] .dash-tcnt { color: var(--evil-primary); }
body[data-theme="twins"] .dash-tcnt { color: var(--twins-primary); }

.dash-load-more {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 7px 0;
    border: 1px solid rgba(var(--ink-rgb), 0.1);
    border-radius: 6px;
    background: transparent;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

body[data-theme="neuro"] .dash-load-more { color: var(--neuro-primary); }
body[data-theme="neuro"] .dash-load-more:hover { background: rgba(var(--neuro-primary-rgb), 0.08); }
body[data-theme="evil"] .dash-load-more { color: var(--evil-primary); }
body[data-theme="evil"] .dash-load-more:hover { background: rgba(var(--evil-primary-rgb), 0.08); }
body[data-theme="twins"] .dash-load-more { color: var(--twins-primary); }
body[data-theme="twins"] .dash-load-more:hover { background: rgba(var(--twins-primary-rgb), 0.08); }

/* ── COVER ARTIST CARDS ── */
.dash-cvg {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .dash-cvg { grid-template-columns: 1fr; }
}

.dash-cvc {
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

body[data-theme="neuro"] .dash-cvc { background: var(--neuro-bg-elevated); }
body[data-theme="evil"] .dash-cvc { background: var(--evil-bg-elevated); }
body[data-theme="twins"] .dash-cvc { background: var(--twins-bg-elevated); }

body[data-theme="neuro"] .dash-cvc:hover { border-color: var(--neuro-primary); }
body[data-theme="evil"] .dash-cvc:hover { border-color: var(--evil-primary); }
body[data-theme="twins"] .dash-cvc:hover { border-color: var(--twins-primary); }

.dash-cvn { font-size: 14px; font-weight: 700; margin-bottom: 10px; }

body[data-theme="neuro"] .dash-cvn { color: var(--neuro-primary); }
body[data-theme="evil"] .dash-cvn { color: var(--evil-primary); }
body[data-theme="twins"] .dash-cvn { color: var(--twins-primary); }

.dash-cvcnt {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 800;
    font-family: 'Roboto', sans-serif;
    letter-spacing: -1px;
}

body[data-theme="neuro"] .dash-cvcnt { color: var(--neuro-text-primary); }
body[data-theme="evil"] .dash-cvcnt { color: var(--evil-text-primary); }
body[data-theme="twins"] .dash-cvcnt { color: var(--twins-text-primary); }

.dash-cvlbl {
    font-size: 11px;
    font-family: 'Roboto Mono', monospace;
    margin-top: 2px;
}

body[data-theme="neuro"] .dash-cvlbl { color: var(--neuro-text-primary); }
body[data-theme="evil"] .dash-cvlbl { color: var(--evil-text-primary); }
body[data-theme="twins"] .dash-cvlbl { color: var(--twins-text-primary); }

/* ── COUNTRY LIST ── */
.dash-ctry-list { list-style: none; padding: 0; margin: 0; }

.dash-ctry-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(var(--ink-rgb), 0.05);
}
.dash-ctry-item:last-child { border-bottom: none; }

.dash-ctry-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-ctry-name { flex: 1; font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #E8EAF0; }

.dash-ctry-cnt {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px; color: #F59E0B;
    min-width: 60px; text-align: right; font-weight: 600;
}

/* bar row: [track flex-1] [pct label fixed-width] */
.dash-ctry-bar-outer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-ctry-bar-wrap {
    flex: 1;
    height: 14px;
    background: rgba(var(--ink-rgb), 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.dash-ctry-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #F59E0B 0%, #FBBF24 100%);
    transition: width 0.4s ease;
}

.dash-ctry-bar-pct {
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #C0B090;
    min-width: 42px;
    text-align: right;
    white-space: nowrap;
}

/* ── REFERRER / PATHS LIST ── */
.dash-ref-list { list-style: none; padding: 0; margin: 0; }

.dash-ref-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(var(--ink-rgb), 0.05);
}
.dash-ref-item:last-child { border-bottom: none; }

.dash-ref-rank {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px; min-width: 22px;
}

body[data-theme="neuro"] .dash-ref-rank { color: var(--neuro-text-muted); }
body[data-theme="evil"] .dash-ref-rank { color: var(--evil-text-muted); }
body[data-theme="twins"] .dash-ref-rank { color: var(--twins-text-muted); }

.dash-ref-name {
    flex: 1; font-size: 13px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: 'Roboto Mono', monospace;
    min-width: 0;
}

body[data-theme="neuro"] .dash-ref-name { color: var(--neuro-text-secondary); }
body[data-theme="evil"] .dash-ref-name { color: var(--evil-text-secondary); }
body[data-theme="twins"] .dash-ref-name { color: var(--twins-text-secondary); }

.dash-ref-bar-wrap {
    width: 60px; height: 3px;
    background: rgba(var(--ink-rgb), 0.06);
    border-radius: 2px; flex-shrink: 0;
}

.dash-ref-bar { height: 3px; border-radius: 2px; background: #F59E0B; }

.dash-ref-cnt {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px; color: #F59E0B;
    min-width: 50px; text-align: right; font-weight: 500;
}

/* ── BROWSER PILLS ── */
.dash-pill-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.dash-pill {
    display: flex; align-items: center;
    gap: 6px; border-radius: 8px; padding: 7px 12px;
}

body[data-theme="neuro"] .dash-pill { background: var(--neuro-bg-elevated); }
body[data-theme="evil"] .dash-pill { background: var(--evil-bg-elevated); }
body[data-theme="twins"] .dash-pill { background: var(--twins-bg-elevated); }

.dash-pill-icon { font-size: 15px; }

.dash-pill-name { font-size: 12px; font-weight: 500; }

body[data-theme="neuro"] .dash-pill-name { color: var(--neuro-text-secondary); }
body[data-theme="evil"] .dash-pill-name { color: var(--evil-text-secondary); }
body[data-theme="twins"] .dash-pill-name { color: var(--twins-text-secondary); }

.dash-pill-val {
    font-size: 14px; font-weight: 700;
    font-family: 'Roboto Mono', monospace;
}

body[data-theme="neuro"] .dash-pill-val { color: var(--neuro-text-primary); }
body[data-theme="evil"] .dash-pill-val { color: var(--evil-text-primary); }
body[data-theme="twins"] .dash-pill-val { color: var(--twins-text-primary); }

/* ── ADMIN BANNER ── */
.dash-admin-banner {
    display: flex; align-items: center;
    gap: 8px; border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 10px; padding: 8px 14px;
    margin-bottom: 16px; background: transparent;
}

.dash-admin-dot { width: 7px; height: 7px; border-radius: 50%; background: #F59E0B; flex-shrink: 0; }

.dash-admin-banner-text {
    font-size: 13px; color: #F59E0B;
    font-family: 'Roboto Mono', monospace;
}

/* ── PAGE SECTIONS ── */
.dash-page { display: none; }
.dash-page.active { display: block; }

/* ── SKELETON LOADING ── */
@keyframes dash-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

.dash-skel {
    border-radius: 6px;
    background-size: 800px 100%;
    animation: dash-shimmer 1.4s ease-in-out infinite;
}

body[data-theme="neuro"] .dash-skel {
    background-image: linear-gradient(90deg, var(--neuro-bg-elevated) 25%, #1e3050 50%, var(--neuro-bg-elevated) 75%);
}
body[data-theme="evil"] .dash-skel {
    background-image: linear-gradient(90deg, var(--evil-bg-elevated) 25%, #3a1030 50%, var(--evil-bg-elevated) 75%);
}
body[data-theme="twins"] .dash-skel {
    background-image: linear-gradient(90deg, var(--twins-bg-elevated) 25%, #2e1e46 50%, var(--twins-bg-elevated) 75%);
}

/* Skeleton size presets */
.dash-skel-lbl  { width: 55%; height: 10px; margin-bottom: 10px; }
.dash-skel-val  { width: 70%; height: 26px; margin-bottom: 6px; }
.dash-skel-sub  { width: 45%; height: 10px; }
.dash-skel-name { flex: 1; height: 13px; border-radius: 4px; }
.dash-skel-chart {
    position: absolute;
    inset: 0;
    border-radius: 8px;
}

/* ── COVER ARTIST DRILLDOWN OVERLAY ── */
.dash-drill-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(3px);
}

.dash-drill-modal {
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    border-radius: 18px;
    border: 1px solid rgba(var(--ink-rgb), 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body[data-theme="neuro"] .dash-drill-modal { background: var(--neuro-bg-secondary); }
body[data-theme="evil"]  .dash-drill-modal { background: var(--evil-bg-secondary); }
body[data-theme="twins"] .dash-drill-modal { background: var(--twins-bg-secondary); }

.dash-drill-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(var(--ink-rgb), 0.07);
    flex-shrink: 0;
}

.dash-drill-title {
    flex: 1;
    font-size: 17px;
    font-weight: 800;
    font-family: 'Roboto', sans-serif;
    letter-spacing: -0.4px;
}

body[data-theme="neuro"] .dash-drill-title { color: var(--neuro-primary); }
body[data-theme="evil"]  .dash-drill-title { color: var(--evil-primary); }
body[data-theme="twins"] .dash-drill-title { color: var(--twins-primary); }

.dash-drill-sub {
    font-size: 11px;
    font-family: 'Roboto Mono', monospace;
    margin-top: 2px;
}

body[data-theme="neuro"] .dash-drill-sub { color: var(--neuro-text-muted); }
body[data-theme="evil"]  .dash-drill-sub { color: var(--evil-text-muted); }
body[data-theme="twins"] .dash-drill-sub { color: var(--twins-text-muted); }

.dash-drill-close {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

body[data-theme="neuro"] .dash-drill-close { color: var(--neuro-text-muted); }
body[data-theme="neuro"] .dash-drill-close:hover { background: rgba(var(--ink-rgb), 0.07); color: var(--neuro-text-primary); }
body[data-theme="evil"]  .dash-drill-close { color: var(--evil-text-muted); }
body[data-theme="evil"]  .dash-drill-close:hover { background: rgba(var(--ink-rgb), 0.07); color: var(--evil-text-primary); }
body[data-theme="twins"] .dash-drill-close { color: var(--twins-text-muted); }
body[data-theme="twins"] .dash-drill-close:hover { background: rgba(var(--ink-rgb), 0.07); color: var(--twins-text-primary); }

.dash-drill-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
}

.dash-cvc-btn {
    cursor: pointer;
    text-align: center;
}

.dash-cvc-btn:hover .dash-cvn {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ══════════════════════════════════════════
   LEADERBOARDS TAB
   Written against the theme-agnostic --theme-* vocabulary, so no per-theme
   branching is needed the way the older dashboard blocks above do it.
══════════════════════════════════════════ */

.dash-lb-empty {
    text-align: center;
    padding: 48px 20px;
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    color: var(--theme-fg-muted);
    border: 1px dashed var(--theme-border-strong);
    border-radius: 14px;
    background: var(--theme-bg-surface);
}

/* ── Avatar (shared by every leaderboard surface) ── */
.dash-lb-avatar {
    position: relative;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
}

.dash-lb-avatar.clickable { cursor: pointer; }

.dash-lb-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.dash-lb-avatar-initial {
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

/* ── Your standing ── */
.dash-lb-standing {
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    background: var(--theme-bg-surface);
}

.dash-lb-standing-head {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.dash-lb-standing-id { min-width: 0; flex: 1; }

.dash-lb-standing-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--theme-fg-primary);
}

.dash-lb-standing-sub {
    font-size: 14px;
    font-family: 'Roboto Mono', monospace;
    color: var(--theme-fg-muted);
}

.dash-lb-coins {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dash-lb-coins.center { justify-content: center; margin-top: 10px; }

/* ── Combined coin badge (grid cards) ──
   Three balances don't fit across a grid card, so the coin art overlaps into one
   stack and the number is the combined total. Individual balances are in the
   title attribute, and the full breakdown still shows on the single-board view. */
.dash-lb-coin-total {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0 1px 34px;
    padding: 4px 10px 4px 6px;
    border-radius: 999px;
    width: fit-content;
    background: var(--theme-bg-raised);
}

.dash-lb-coin-stack {
    display: inline-flex;
    align-items: center;
}

.dash-lb-coin-stack img {
    position: relative;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--theme-bg-raised);
    box-shadow: 0 0 0 2px var(--theme-bg-raised);
}

.dash-lb-coin-stack img + img { margin-left: -8px; }

/* Inline in the value column: smaller art, ringed against the card surface so the
   row keeps the same height and rhythm as the boards without coins. */
.dash-lb-coin-stack.inline img {
    width: 18px;
    height: 18px;
    background: var(--theme-bg-surface);
    box-shadow: 0 0 0 2px var(--theme-bg-surface);
}

.dash-lb-coin-stack.inline img + img { margin-left: -7px; }

/* First coin on top, so the stack reads left-to-right like a deck fanned out. */
.dash-lb-coin-stack img:nth-child(1) { z-index: 3; }
.dash-lb-coin-stack img:nth-child(2) { z-index: 2; }
.dash-lb-coin-stack img:nth-child(3) { z-index: 1; }

.dash-lb-coin-total-val {
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--theme-fg-primary);
}

.dash-lb-coin-total-lbl {
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--theme-fg-muted);
}

.dash-lb-coin {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--theme-bg-raised);
}

.dash-lb-coin img { width: 20px; height: 20px; object-fit: contain; }

.dash-lb-coin span {
    font-family: 'Roboto Mono', monospace;
    font-size: 15px;
    font-weight: 700;
    color: var(--theme-fg-primary);
}

.dash-lb-coin.small { padding: 0; background: transparent; gap: 4px; }
.dash-lb-coin.small img { width: 16px; height: 16px; }
.dash-lb-coin.small span { font-size: 13px; font-weight: 600; color: var(--theme-fg-muted); }

.dash-lb-rank-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-lb-rank-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: var(--theme-bg-raised);
    transition: background 0.2s;
}

.dash-lb-rank-chip:hover { background: var(--theme-bg-hovered); }

.dash-lb-chip-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--theme-fg-secondary);
}

.dash-lb-chip-rank {
    font-family: 'Roboto Mono', monospace;
    font-size: 15px;
    font-weight: 700;
    color: var(--theme-primary);
}

/* ── A · Card grid ── */
.dash-lb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.dash-lb-card {
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 16px;
    background: var(--theme-bg-surface);
    transition: border-color 0.2s, transform 0.15s;
}

.dash-lb-card-btn { cursor: pointer; }

.dash-lb-card-btn:hover {
    border-color: var(--theme-primary);
    transform: translateY(-2px);
}

.dash-lb-card-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.dash-lb-card-title {
    flex: 1;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--theme-fg-primary);
}

.dash-lb-card-total,
.dash-lb-card-cta {
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    color: var(--theme-primary);
}

.dash-lb-card-sub {
    font-size: 13px;
    font-family: 'Roboto Mono', monospace;
    margin-bottom: 14px;
    color: var(--theme-fg-muted);
}

.dash-lb-mini { list-style: none; padding: 0; margin: 0; }

.dash-lb-mini-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(var(--ink-rgb), 0.05);
}

.dash-lb-mini-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 500;
    color: var(--theme-fg-secondary);
}

.dash-lb-mini-val {
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    min-width: 70px;
    text-align: right;
    color: var(--theme-primary);
}

.dash-lb-mini-val.with-coins {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.dash-lb-card-cta {
    margin-top: 10px;
    padding: 8px 0;
    text-align: center;
    border: 1px solid rgba(var(--ink-rgb), 0.1);
    border-radius: 6px;
}

.dash-lb-rank {
    font-family: 'Roboto Mono', monospace;
    font-size: 15px;
    min-width: 34px;
    font-weight: 500;
    color: var(--theme-fg-muted);
}

.dash-lb-rank.medal { font-weight: 700; color: #F59E0B; }

/* ── B · Single board ── */
.dash-lb-board-tabs {
    display: flex;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    padding: 4px;
    gap: 2px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    background: var(--theme-bg-surface);
}

.dash-lb-board-tab {
    padding: 7px 14px;
    border: none;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    background: transparent;
    color: var(--theme-fg-muted);
    transition: all 0.2s;
}

.dash-lb-board-tab:hover { color: var(--theme-fg-secondary); }

.dash-lb-board-tab.active {
    background: var(--theme-bg-hovered);
    color: var(--theme-primary);
}

.dash-lb-board {
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 20px;
    background: var(--theme-bg-surface);
}

.dash-lb-board-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--theme-fg-primary);
}

.dash-lb-board-sub {
    font-size: 13px;
    font-family: 'Roboto Mono', monospace;
    margin-bottom: 20px;
    color: var(--theme-fg-muted);
}

/* ── Podium ── */
.dash-lb-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.dash-lb-podium-card {
    flex: 0 0 auto;
    width: 190px;
    text-align: center;
    padding: 16px 14px 14px;
    border-radius: 16px;
    cursor: pointer;
    background: var(--theme-bg-raised);
    border: 1px solid var(--theme-border);
    transition: border-color 0.2s;
}

.dash-lb-podium-card.first {
    width: 226px;
    padding: 22px 16px 18px;
    border-color: rgba(var(--theme-primary-rgb), 0.45);
}

.dash-lb-podium-card:hover { border-color: var(--theme-primary); }

.dash-lb-podium-avatar {
    position: relative;
    display: inline-block;
    margin: 0 auto 10px;
}

/* The place badge sits under the avatar rather than on top of it — the rank
   frames bleed past the circle, so anything overlapping the bottom collides. */
.dash-lb-medal {
    width: 30px;
    height: 30px;
    margin: 0 auto 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto Mono', monospace;
    font-size: 16px;
    font-weight: 800;
    color: #1a1a1a;
}

.dash-lb-medal.place-1 { background: #F5C542; }
.dash-lb-medal.place-2 { background: #C9D2DE; }
.dash-lb-medal.place-3 { background: #CD8B4E; }

.dash-lb-podium-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 18px;
    font-weight: 700;
    color: var(--theme-fg-primary);
}

.dash-lb-podium-val {
    font-family: 'Roboto Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    color: var(--theme-primary);
}

.dash-lb-podium-meta {
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    margin-top: 4px;
    letter-spacing: 0.2px;
    color: var(--theme-fg-secondary);
}

.dash-lb-badge {
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    padding: 2px 7px;
    border-radius: 5px;
    color: #fff;
    background: var(--theme-accent);
}

/* ── Ranked rows ── */
.dash-lb-rows { list-style: none; padding: 0; margin: 0; }

.dash-lb-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 6px;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(var(--ink-rgb), 0.05);
}

.dash-lb-row-id { flex: 1; min-width: 0; }

.dash-lb-row-name-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-lb-row-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--theme-fg-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-lb-row-name.clickable { cursor: pointer; }

.dash-lb-row-name.clickable:hover {
    color: var(--theme-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dash-lb-row-meta {
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.2px;
    color: var(--theme-fg-muted);
}

.dash-lb-row-tail {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.dash-lb-row-val {
    font-family: 'Roboto Mono', monospace;
    font-size: 16px;
    font-weight: 600;
    min-width: 96px;
    text-align: right;
    color: var(--theme-primary);
}

@media (max-width: 1100px) {
    .dash-lb-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
    .dash-lb-grid { grid-template-columns: 1fr; }

    /* The value and coins wrap onto their own line, indented past the avatar. */
    .dash-lb-row-tail {
        flex-basis: 100%;
        margin-left: 44px;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }
}
