/* ===========================================================================
   THE ONE CHART PALETTE — every chart colour in the product lives in this file.

   Founder, 2026-12-01: "Build a single shared chart colour palette (multi-colour,
   accessible contrast, works in light/dark) and use it in every CRM analysis chart
   AND every dashboard. The same category always gets the same colour everywhere
   (each enquiry stage and each lead source has its own fixed colour on every
   screen). One shared file; no colours hard-coded per chart."

   HOW A CHART USES IT
   - A CATEGORY (a source, a stage, a class) gets a SLOT, --chart-1 … --chart-10.
     Which slot is decided in ONE place, ChartPalette.cs, from the category's place
     in the school's own list — so "Website" is the same colour on the dashboard,
     the answering screen and the analysis. Nothing else picks a slot.
   - An OUTCOME (became a pupil, lost, still open, closed) has its own meaning
     colour, never a slot: green for won and red for lost read the same in every
     school, and a slot that happened to be red for "Walk-in" would read as a loss.
   - "Not said" / "Not recorded" is --chart-none: a quiet grey, so the gap in the
     data is visible without looking like a channel.

   ⚠️ THIS REPLACES "ONE HUE PER CHART" (2026-11-08). That rule kept every bar of
   a chart one colour so colour carried nothing; the founder asked for the opposite
   — colour that MEANS the same thing on every screen. Identity is still never
   colour ALONE: every bar keeps its name on the axis and every legend its words.

   ⚠️ CONTRAST, CHECKED BY A TEST (ChartPaletteTests): every slot and outcome is at
   least 3:1 against the card in BOTH themes, so a bar is visible as a shape and not
   only as a tint (WCAG 1.4.11). Neighbouring slots are far apart in hue, so two
   bars side by side are never mistaken for each other.

   ⚠️ DARK IS STEPPED, NOT FLIPPED. The dark values are lighter steps of the same
   hues, chosen against the dark card — inverting a light palette produces mud. The
   layout is light today; these apply the day a dark theme is switched on, under
   either data-bs-theme="dark" or the operating system's own dark preference.
   --------------------------------------------------------------------------- */
:root {
    --chart-1: #4f46e5;   /* indigo */
    --chart-2: #0d9488;   /* teal */
    --chart-3: #d97706;   /* amber */
    --chart-4: #db2777;   /* pink */
    --chart-5: #0284c7;   /* sky */
    --chart-6: #4d7c0f;   /* olive */
    --chart-7: #7c3aed;   /* violet */
    --chart-8: #c2410c;   /* rust */
    --chart-9: #0e7490;   /* cyan */
    --chart-10: #475569;  /* slate */

    --chart-pupil: #15803d;
    --chart-lost: #dc2626;
    --chart-open: #b45309;
    --chart-closed: #64748b;
    --chart-none: #7b8494;

    /* The older names, kept as aliases so a chart drawn before this file still
       takes its colour from here rather than from a value of its own. */
    --chart-indigo: var(--chart-1);
    --chart-teal: var(--chart-2);
    --chart-sky: var(--chart-5);
    --chart-violet: var(--chart-7);
}

[data-bs-theme="dark"] {
    --chart-1: #818cf8;
    --chart-2: #2dd4bf;
    --chart-3: #fbbf24;
    --chart-4: #f472b6;
    --chart-5: #38bdf8;
    --chart-6: #a3e635;
    --chart-7: #a78bfa;
    --chart-8: #fb923c;
    --chart-9: #22d3ee;
    --chart-10: #94a3b8;

    --chart-pupil: #4ade80;
    --chart-lost: #f87171;
    --chart-open: #fbbf24;
    --chart-closed: #94a3b8;
    --chart-none: #8b93a3;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-bs-theme="light"]) {
        --chart-1: #818cf8;
        --chart-2: #2dd4bf;
        --chart-3: #fbbf24;
        --chart-4: #f472b6;
        --chart-5: #38bdf8;
        --chart-6: #a3e635;
        --chart-7: #a78bfa;
        --chart-8: #fb923c;
        --chart-9: #22d3ee;
        --chart-10: #94a3b8;

        --chart-pupil: #4ade80;
        --chart-lost: #f87171;
        --chart-open: #fbbf24;
        --chart-closed: #94a3b8;
        --chart-none: #8b93a3;
    }
}
