.stats-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.back-link{
    color: var(--color-muted);
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover{
    color: var(--color-text);
}

.stats-title{
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.header-links{
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.all{
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Sur la page principale, .panels-row separe historique (2fr) et stats (1fr).
   Ici les deux graphiques cote a cote doivent avoir la meme taille. */
.panels-row{
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-grid-totals{
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-grid-totals .stat-value{
    font-size: 28px;
}

.chart-section{
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.chart-container{
    width: 100%;
    overflow-x: auto;
}

.chart-container svg{
    display: block;
    width: 100%;
    height: auto;
    font-family: inherit;
}

.chart-empty{
    color: var(--color-muted);
    font-size: 13px;
    padding: var(--space-md) 0;
}

/* Barres horizontales (jeux / streamers les plus vus) */
.bar-row-hit{
    fill: transparent;
    cursor: pointer;
}

.bar-row-hit:hover ~ .bar-fill,
.bar-row-hit:focus ~ .bar-fill{
    opacity: .8;
}

.bar-fill{
    fill: var(--color-twitch);
    transition: opacity .1s ease;
}

.bar-label{
    fill: var(--color-text);
    font-size: 10px;
    dominant-baseline: middle;
}

.bar-value{
    fill: var(--color-muted);
    font-size: 10px;
    dominant-baseline: middle;
}

/* Courbe (streams par jour) */
.line-path{
    fill: none;
    stroke: var(--color-twitch);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.line-gridline{
    stroke: var(--color-panel-border);
    stroke-width: 1;
}

.line-axis-label{
    fill: var(--color-muted);
    font-size: 13px;
}

.line-marker{
    fill: var(--color-twitch);
    stroke: var(--color-panel-bg);
    stroke-width: 2;
}

.line-crosshair{
    stroke: var(--color-muted);
    stroke-width: 1;
    stroke-dasharray: 2 2;
    pointer-events: none;
    opacity: 0;
}

.line-hit{
    fill: transparent;
    cursor: crosshair;
}

/* Tooltip commun aux deux types de graphiques */
.chart-tooltip{
    position: absolute;
    pointer-events: none;
    background-color: var(--color-panel-bg);
    border: 1px solid var(--color-panel-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 6px 10px;
    font-size: 12px;
    color: var(--color-text);
    opacity: 0;
    transition: opacity .1s ease;
    white-space: nowrap;
    z-index: 10;
}

.chart-tooltip.visible{
    opacity: 1;
}

.chart-tooltip .tooltip-value{
    font-weight: 700;
}

.chart-wrapper{
    position: relative;
}

@media (max-width: 900px){
    .stat-grid-totals{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
