/* ============================================================
 * Chart.js + chart container styling — keep canvases looking
 * native to the Linear design system. Loaded by pages that
 * include Chart.js (dashboards, reports). Pairs with
 * static/js/pages/dashboard-charts.js which sets Chart.defaults
 * once at runtime.
 * ============================================================ */

/* Sparkline slots — no padding, no decoration. */
.linear-spark {
    width: 100%;
    height: 28px;
}
.linear-spark canvas { width: 100% !important; height: 100% !important; }

/* Standard chart container — gives the chart breathing room and
   keeps height consistent regardless of the data set. */
.linear-chart-wrap {
    position: relative;
    width: 100%;
    padding: 4px 2px 0;
}
.linear-chart-wrap--sm { height: 160px; }
.linear-chart-wrap--md { height: 220px; }
.linear-chart-wrap--lg { height: 320px; }

/* Chart legend strip — used above NCR trend / Pareto.
   Mirrors the dist-row aesthetic for consistency. */
.linear-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 6px 14px;
    border-bottom: 1px solid var(--divider, var(--border));
    font-size: 11.5px;
    color: var(--fg-subtle);
}
.linear-chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.linear-chart-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Chart range tabs (NCR trend 6m / 12m / YTD) — small ghost
   buttons with an active state. */
.linear-chart-range {
    display: inline-flex;
    gap: 4px;
}
.linear-chart-range button {
    height: 24px;
    padding: 0 9px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-family: var(--font-sans);
    font-size: 11.5px;
    color: var(--fg-muted);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.linear-chart-range button:hover {
    background: var(--surface-hover);
    color: var(--fg);
}
.linear-chart-range button.active {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}
