/* ==========================================================================
   MY STATS VIEW — assets/css/views/my_stats.css
   ========================================================================== */

.my-stats-view {
    width: 100%;
    padding: 60px 32px 60px;
    color: var(--text-primary);
    min-height: 100vh;
    box-sizing: border-box;
}

/* ── Coordinator picker ─────────────────────────────────────── */
.mst-picker-view {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 60px 24px 60px;
}
.mst-picker-header {
    text-align: center;
    margin-bottom: 2rem;
}
.mst-picker-header i {
    font-size: 2.5rem;
    color: var(--primary);
    display: block;
    margin-bottom: 0.5rem;
}
.mst-picker-header h2 { margin: 0 0 0.35rem; font-size: 1.4rem; }
.mst-picker-header p  { margin: 0; color: var(--text-secondary); font-size: 0.9rem; }
.mst-picker-loading, .mst-picker-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: var(--text-secondary);
    padding: 3rem;
    font-size: 0.9rem;
}
.mst-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}
.mst-picker-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all var(--trans-fast);
    position: relative;
    text-align: center;
}
.mst-picker-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.mst-picker-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--border-color);
    margin-bottom: 0.2rem;
}
.mst-picker-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mst-picker-avatar i   { font-size: 1.4rem; color: var(--text-secondary); }
.mst-picker-name { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); line-height: 1.2; }
.mst-picker-hub  { font-size: 0.75rem; color: var(--text-secondary); }
.mst-picker-arrow {
    position: absolute;
    top: 0.7rem; right: 0.8rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity var(--trans-fast);
}
.mst-picker-card:hover .mst-picker-arrow { opacity: 1; }

/* ── Swap modal ─────────────────────────────────────────────── */
.mst-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.mst-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg, 0 20px 60px rgba(0,0,0,0.3));
}
.mst-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.95rem;
}
.mst-modal-header i { margin-right: 0.4rem; color: var(--primary); }
.mst-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
    border-radius: var(--radius-sm);
    transition: color var(--trans-fast);
}
.mst-modal-close:hover { color: var(--text-primary); }
.mst-modal-body {
    overflow-y: auto;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.mst-modal-member {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.8rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all var(--trans-fast);
    width: 100%;
    text-align: left;
}
.mst-modal-member:hover { background: var(--bg-secondary); }
.mst-modal-member.active {
    background: var(--bg-secondary);
    border-color: var(--primary);
}
.mst-modal-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.mst-modal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mst-modal-avatar i   { font-size: 1rem; color: var(--text-secondary); }
.mst-modal-member-info { flex: 1; min-width: 0; }
.mst-modal-member-name { font-weight: 600; font-size: 0.88rem; color: var(--text-primary); }
.mst-modal-member-hub  { font-size: 0.75rem; color: var(--text-secondary); }
.mst-modal-check { color: var(--primary); font-size: 1.1rem; flex-shrink: 0; }

/* ── Swap button (in profile card) ─────────────────────────── */
.mst-profile-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.mst-swap-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.2rem 0.35rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    transition: all var(--trans-fast);
    flex-shrink: 0;
}
.mst-swap-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── No access ──────────────────────────────────────────────── */
.mst-no-access {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 1rem;
    color: var(--text-secondary);
    text-align: center;
}
.mst-no-access i  { font-size: 3rem; opacity: 0.35; }
.mst-no-access h2 { margin: 0; color: var(--text-primary); }
.mst-no-access p  { margin: 0; }

/* ── 3-column layout ────────────────────────────────────────── */
.mst-layout {
    display: grid;
    grid-template-columns: 220px 1fr 250px;
    gap: 1.5rem;
    align-items: start;
}

/* ── Shared aside styles ────────────────────────────────────── */
.mst-aside {
    position: sticky;
    top: 72px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mst-aside-block {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.mst-aside-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.mst-aside-label i { font-size: 0.85rem; }

/* ── Left aside — profile card ──────────────────────────────── */
.mst-profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}
.mst-profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 0.25rem;
    border: 3px solid var(--bg-secondary);
}
.mst-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mst-profile-avatar i   { color: #fff; font-size: 1.5rem; }
.mst-profile-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.2;
}
.mst-profile-role  { margin-top: 0.1rem; }
.mst-role-badge {
    font-size: 0.68rem;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--border-color);
}
.mst-profile-period {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: 0.15rem;
}

/* ── Period selector ────────────────────────────────────────── */
.mst-select {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.88rem;
    cursor: pointer;
    outline: none;
    width: 100%;
}
.mst-select:focus { border-color: var(--primary); }
.mst-select-full { width: 100%; }

/* Quick-select row */
.mst-period-quick {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
}
.mst-pquick {
    padding: 0.3rem 0.15rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
    text-align: center;
    white-space: nowrap;
}
.mst-pquick:hover { background: var(--bg-secondary); color: var(--text-primary); }
.mst-pquick.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* 3-column month grid */
.mst-month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
}
.mst-month-btn {
    padding: 0.28rem 0.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.73rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--trans-fast);
    text-align: center;
    line-height: 1;
}
.mst-month-btn:hover:not(:disabled) { background: var(--bg-secondary); color: var(--text-primary); }
.mst-month-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
}
.mst-month-btn.unavailable,
.mst-month-btn:disabled {
    opacity: 0.28;
    cursor: not-allowed;
}

/* ── Main content ───────────────────────────────────────────── */
.mst-main {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
    padding-top: 0.65rem;
}

/* ── Loader / Empty ─────────────────────────────────────────── */
.mst-loader, .mst-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
    color: var(--text-secondary);
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
}
.mst-loader i      { font-size: 2rem; color: var(--primary); }
.mst-empty-state i { font-size: 3rem; opacity: 0.3; }
.mst-empty-state h3 { margin: 0; color: var(--text-primary); }
.mst-empty-state p  { margin: 0; font-size: 0.9rem; }

/* ── KPI Hero Grid ──────────────────────────────────────────── */
.mst-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
@media (max-width: 1100px) { .mst-kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.mst-kpi-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1rem 0.9rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--trans-fast), box-shadow var(--trans-fast), border-color var(--trans-fast);
}
.mst-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.mst-kpi-card.selected {
    border-color: var(--kpi-color, var(--primary));
    box-shadow: 0 0 0 3px rgba(var(--kpi-rgb, 59,130,246), 0.15);
}
/* Per-color selected states */
.mst-kpi-card.kpi-green.selected  { --kpi-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.18);  border-color: #22c55e; }
.mst-kpi-card.kpi-blue.selected   { --kpi-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.18); border-color: #3b82f6; }
.mst-kpi-card.kpi-purple.selected { --kpi-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167,139,250,0.18);border-color: #a78bfa; }
.mst-kpi-card.kpi-amber.selected  { --kpi-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.18); border-color: #f59e0b; }
.mst-kpi-card.kpi-rose.selected   { --kpi-color: #f43f5e; box-shadow: 0 0 0 3px rgba(244,63,94,0.18);  border-color: #f43f5e; }
.mst-kpi-card.kpi-cyan.selected   { --kpi-color: #06b6d4; box-shadow: 0 0 0 3px rgba(6,182,212,0.18);  border-color: #06b6d4; }

.mst-kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.kpi-green::before  { background: #22c55e; }
.kpi-blue::before   { background: #3b82f6; }
.kpi-purple::before { background: #a78bfa; }
.kpi-amber::before  { background: #f59e0b; }
.kpi-rose::before   { background: #f43f5e; }
.kpi-cyan::before   { background: #06b6d4; }

.mst-kpi-icon { font-size: 1rem; margin-bottom: 0.2rem; }
.kpi-green  .mst-kpi-icon { color: #22c55e; }
.kpi-blue   .mst-kpi-icon { color: #3b82f6; }
.kpi-purple .mst-kpi-icon { color: #a78bfa; }
.kpi-amber  .mst-kpi-icon { color: #f59e0b; }
.kpi-rose   .mst-kpi-icon { color: #f43f5e; }
.kpi-cyan   .mst-kpi-icon { color: #06b6d4; }

.mst-kpi-val {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}
.mst-kpi-name {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mst-kpi-trend {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 0.3rem;
}
.mst-kpi-chart-hint {
    position: absolute;
    bottom: 0.65rem;
    right: 0.75rem;
    font-size: 0.8rem;
    opacity: 0;
    color: var(--text-secondary);
    transition: opacity var(--trans-fast);
}
.mst-kpi-card:hover .mst-kpi-chart-hint,
.mst-kpi-card.selected .mst-kpi-chart-hint { opacity: 0.5; }

/* Masked satcli state */
.mst-kpi-masked {
    opacity: 0.55;
    filter: grayscale(0.6);
}
.mst-kpi-val-hidden {
    font-size: 1.5rem;
    color: var(--text-secondary);
}
.mst-kpi-hidden-hint {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* Chart masked overlay */
.mst-chart-masked-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    pointer-events: none;
}
.mst-chart-masked-overlay i { font-size: 1.6rem; }

.trend-up     { color: #22c55e; }
.trend-down   { color: #ef4444; }
.trend-neutral{ color: var(--text-secondary); }

/* ── Chart card ─────────────────────────────────────────────── */
.mst-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}
.mst-chart-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}
.mst-chart-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    flex: 1;
}
.mst-chart-title-group i { font-size: 1.1rem; }
.mst-chart-subtitle {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.88rem;
}
.mst-chart-loading { margin-left: auto; color: var(--text-secondary); }
.mst-chart-body {
    padding: 1.25rem;
    height: 320px;
    position: relative;
}
.mst-chart-body canvas { width: 100% !important; height: 100% !important; }

/* ── Detail card ─────────────────────────────────────────────── */
.mst-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}
.mst-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}
.mst-detail-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}
.mst-detail-title i { color: var(--primary); }
.mst-detail-days {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
}

.mst-section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
.mst-stab {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--trans-fast);
}
.mst-stab:hover  { background: var(--bg-secondary); color: var(--text-primary); }
.mst-stab.active { background: var(--primary); color: #fff; }
.mst-stab i      { font-size: 0.85rem; }

.mst-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 0.65rem;
    padding: 1rem;
}
.mst-metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.8rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.mst-metric-card {
    container-type: inline-size;
}
.mst-metric-name {
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    /* Scale down to fit the card — base 0.7rem, shrinks to 0.52rem minimum */
    font-size: clamp(0.52rem, 4cqi, 0.7rem);
}
.mst-metric-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
}
.mst-metric-trend {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ── Sales card ─────────────────────────────────────────────── */
.mst-sales-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}
.mst-sales-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.95rem;
}
.mst-sales-header > i:first-child { color: var(--primary); }
.mst-sales-loader { margin-left: auto; color: var(--text-secondary); }
.mst-sales-body   { padding: 1.25rem; }
.mst-sales-empty  {
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
}
.mst-sales-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}
.mst-sales-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.65rem;
}
.mst-sales-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}
.mst-sale-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 62px;
}
.mst-sale-badge {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #fff;
}
.dot-f5g   { background: #3b82f6; }
.dot-sf    { background: #8b5cf6; }
.dot-mig   { background: #f59e0b; }
.dot-max   { background: #06b6d4; }
.dot-total { background: var(--primary); }
.mst-sale-val  { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.mst-sale-name { font-size: 0.68rem; color: var(--text-secondary); font-weight: 500; }
.mst-sale-total-item .mst-sale-val { color: var(--primary); }

.mst-progress-block  { margin-bottom: 1rem; }
.mst-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.mst-progress-label { font-size: 0.8rem; color: var(--text-secondary); }
.mst-progress-pct   { font-weight: 700; color: var(--primary); font-size: 0.88rem; }
.mst-progress-bar {
    height: 7px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    overflow: hidden;
}
.mst-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary), #06b6d4);
    transition: width 0.6s ease;
}
.mst-progress-hint { font-size: 0.72rem; color: var(--text-secondary); margin: 0.35rem 0 0; }

.mst-primes-list { display: flex; flex-direction: column; gap: 0.4rem; }
.mst-prime-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.7rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.mst-prime-row strong { color: var(--text-primary); font-weight: 700; }
.mst-prime-total {
    border: 1px solid var(--primary);
    background: transparent;
}
.mst-prime-total strong { color: var(--primary); font-size: 0.95rem; }

/* ── Right aside ────────────────────────────────────────────── */
.mst-hub-metric { display: flex; flex-direction: column; gap: 0.6rem; }
.mst-hub-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mst-hub-metric-name { font-size: 0.82rem; color: var(--text-secondary); }
.mst-hub-metric-val  { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }

.mst-hub-compare {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

/* Each bar row */
.mst-hub-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.mst-hub-row-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    width: 24px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.mst-hub-row-lbl.me-lbl { color: var(--primary); }

.mst-hub-row-track {
    flex: 1;
    height: 8px;
    display: flex;
    border-radius: var(--radius-full);
    overflow: hidden;
}
.mst-hub-row-fill {
    height: 100%;
    transition: width 0.5s ease;
    flex-shrink: 0;
}
.mst-hub-row-gap {
    flex: 1;
    height: 100%;
}

.hub-fill { background: #94a3b8; }
.hub-gap  { background: rgba(148,163,184,0.2); }
.me-fill  { background: var(--primary); }
.me-gap   { background: rgba(var(--primary-rgb, 34,197,94), 0.15); }

.mst-hub-delay-header { margin-top: 0.85rem; }

.mst-hub-row-val {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

/* ── Trend cards (right aside) ──────────────────────────────── */
.mst-trend-cards { display: flex; flex-direction: column; gap: 0.3rem; }

.mst-trend-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all var(--trans-fast);
}
.mst-trend-card:hover { border-color: var(--primary); }
.mst-trend-card.active {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb, 59,130,246), 0.12);
}

.mst-trend-card-month {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-primary);
    min-width: 28px;
}

.mst-trend-card-kpis {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-end;
}

.mst-trend-kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 36px;
}
.mst-trend-kpi-val {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.mst-trend-kpi-lbl {
    font-size: 0.62rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Gains estimés ──────────────────────────────────────────── */
.mst-gains-list { display: flex; flex-direction: column; gap: 0.35rem; }
.mst-gains-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.mst-gains-row strong { color: var(--text-primary); font-weight: 700; }
.mst-gains-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding: 0.45rem 0.6rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--primary);
    margin-top: 0.2rem;
}
.mst-gains-total strong { color: var(--primary); font-weight: 800; }

/* ── Aside actes commerciaux ────────────────────────────────── */
.mst-aside-sales-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.3rem;
    text-align: center;
}
.mst-aside-sale {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}
.mst-aside-sale span {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 800;
    color: #fff;
}
.mst-aside-sale strong {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.mst-aside-sale-total { color: var(--primary) !important; }
.mst-aside-progress { display: flex; flex-direction: column; gap: 0.3rem; }
.mst-aside-progress-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.mst-aside-progress-top strong { color: var(--primary); }
.mst-aside-progress-label { font-size: 0.7rem; color: var(--text-secondary); text-align: right; }
.mst-sales-empty-sm {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1280px) {
    .mst-layout { grid-template-columns: 200px 1fr 220px; }
}
@media (max-width: 1024px) {
    .mst-layout { grid-template-columns: 1fr; }
    .mst-aside  { position: static; }
    .mst-aside-left  { order: -1; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
    .mst-aside-right { order: 10; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
    .mst-profile-card { grid-column: 1 / -1; flex-direction: row; text-align: left; gap: 1rem; }
    .mst-kpi-grid { grid-template-columns: repeat(3, 1fr); }
    .mst-sales-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .my-stats-view { padding: 60px 16px 40px; }
    .mst-aside-left, .mst-aside-right { grid-template-columns: 1fr; }
    .mst-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Dark theme ──────────────────────────────────────────────── */
[data-theme="dark"] .mst-kpi-card,
[data-theme="dark"] .mst-chart-card,
[data-theme="dark"] .mst-detail-card,
[data-theme="dark"] .mst-sales-card,
[data-theme="dark"] .mst-aside-block,
[data-theme="dark"] .mst-profile-card {
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
[data-theme="dark"] .mst-metric-card,
[data-theme="dark"] .mst-trend-row.trend-row-active { background: rgba(255,255,255,0.05); }

/* ── Neon theme ──────────────────────────────────────────────── */
[data-theme="neon"] .mst-kpi-card { border-color: rgba(6,182,212,0.2); }
[data-theme="neon"] .mst-kpi-card.selected { box-shadow: 0 0 20px rgba(6,182,212,0.3); }
[data-theme="neon"] .mst-pquick.active,
[data-theme="neon"] .mst-month-btn.selected {
    background: #fcee09;
    border-color: #fcee09;
    color: #000;
}
[data-theme="neon"] .mst-stab.active {
    background: #fcee09;
    border-color: #fcee09;
    color: #000;
}
[data-theme="neon"] .mst-progress-fill {
    background: linear-gradient(90deg, #fcee09, #06b6d4);
    box-shadow: 0 0 8px rgba(252,238,9,0.35);
}

/* ── Spin utility ────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin 0.8s linear infinite; }
