/*
 * Dark theme for pages styled with Tailwind's palette classes (bg-white, text-slate-900,
 * border-slate-200, bg-red-50 text-red-800, ...). Tailwind v4 resolves every palette colour
 * through a CSS variable, so under .dark each scale is remapped once here instead of adding a
 * dark: variant to every element: light surfaces become dark, dark text becomes light, and mid
 * greys move one step lighter to stay readable.
 *
 * Slate and gray (surfaces, borders, text) use their own ladder below so depth reads the same way
 * as in the light theme. The colour scales use Tailwind's own defaults
 * (node_modules/tailwindcss/theme.css) with this mapping: 50->950, 100->900, 200->800, 300->700,
 * 400->500, 500->400, 600->300, 700->300, 800->200, 900->100, 950->50. When a new colour scale is
 * used in the pages, add it here the same way.
 * shadcn-vue components use the semantic variables in app.css instead.
 */
.dark {
    color-scheme: dark;

    /*
     * Neutral surfaces, lightest last: page (--background in app.css) < sidebar < card (white) <
     * inner fills and hovers (slate-50, slate-100) < borders (slate-200, slate-300). In the light
     * theme a slate-50 panel inside a white card is a step lighter than the page; it stays a step
     * raised here instead of becoming a dark hole. A slight cool tint, kept low.
     */
    --color-white: oklch(0.215 0.012 260);

    /* slate: surfaces and borders, then text from muted to strongest */
    --color-slate-50: oklch(0.245 0.013 260);
    --color-slate-100: oklch(0.275 0.014 260);
    --color-slate-200: oklch(0.31 0.014 260);
    --color-slate-300: oklch(0.38 0.015 260);
    --color-slate-400: oklch(0.56 0.016 260);
    --color-slate-500: oklch(0.69 0.016 260);
    --color-slate-600: oklch(0.79 0.012 260);
    --color-slate-700: oklch(0.86 0.009 260);
    --color-slate-800: oklch(0.92 0.006 260);
    --color-slate-900: oklch(0.965 0.004 260);
    --color-slate-950: oklch(0.985 0.002 260);
    /* gray: the same ladder, untinted */
    --color-gray-50: oklch(0.245 0.004 260);
    --color-gray-100: oklch(0.275 0.004 260);
    --color-gray-200: oklch(0.31 0.004 260);
    --color-gray-300: oklch(0.38 0.005 260);
    --color-gray-400: oklch(0.56 0.006 260);
    --color-gray-500: oklch(0.69 0.006 260);
    --color-gray-600: oklch(0.79 0.005 260);
    --color-gray-700: oklch(0.86 0.004 260);
    --color-gray-800: oklch(0.92 0.003 260);
    --color-gray-900: oklch(0.965 0.002 260);
    --color-gray-950: oklch(0.985 0.001 260);
    /* blue */
    --color-blue-50: oklch(28.2% 0.091 267.935);
    --color-blue-100: oklch(37.9% 0.146 265.522);
    --color-blue-200: oklch(42.4% 0.199 265.638);
    --color-blue-300: oklch(48.8% 0.243 264.376);
    --color-blue-400: oklch(62.3% 0.214 259.815);
    --color-blue-500: oklch(70.7% 0.165 254.624);
    --color-blue-600: oklch(80.9% 0.105 251.813);
    --color-blue-700: oklch(80.9% 0.105 251.813);
    --color-blue-800: oklch(88.2% 0.059 254.128);
    --color-blue-900: oklch(93.2% 0.032 255.585);
    --color-blue-950: oklch(97% 0.014 254.604);
    /* red */
    --color-red-50: oklch(25.8% 0.092 26.042);
    --color-red-100: oklch(39.6% 0.141 25.723);
    --color-red-200: oklch(44.4% 0.177 26.899);
    --color-red-300: oklch(50.5% 0.213 27.518);
    --color-red-400: oklch(63.7% 0.237 25.331);
    --color-red-500: oklch(70.4% 0.191 22.216);
    --color-red-600: oklch(80.8% 0.114 19.571);
    --color-red-700: oklch(80.8% 0.114 19.571);
    --color-red-800: oklch(88.5% 0.062 18.334);
    --color-red-900: oklch(93.6% 0.032 17.717);
    --color-red-950: oklch(97.1% 0.013 17.38);
    /* amber */
    --color-amber-50: oklch(27.9% 0.077 45.635);
    --color-amber-100: oklch(41.4% 0.112 45.904);
    --color-amber-200: oklch(47.3% 0.137 46.201);
    --color-amber-300: oklch(55.5% 0.163 48.998);
    --color-amber-400: oklch(76.9% 0.188 70.08);
    --color-amber-500: oklch(82.8% 0.189 84.429);
    --color-amber-600: oklch(87.9% 0.169 91.605);
    --color-amber-700: oklch(87.9% 0.169 91.605);
    --color-amber-800: oklch(92.4% 0.12 95.746);
    --color-amber-900: oklch(96.2% 0.059 95.617);
    --color-amber-950: oklch(98.7% 0.022 95.277);
    /* emerald */
    --color-emerald-50: oklch(26.2% 0.051 172.552);
    --color-emerald-100: oklch(37.8% 0.077 168.94);
    --color-emerald-200: oklch(43.2% 0.095 166.913);
    --color-emerald-300: oklch(50.8% 0.118 165.612);
    --color-emerald-400: oklch(69.6% 0.17 162.48);
    --color-emerald-500: oklch(76.5% 0.177 163.223);
    --color-emerald-600: oklch(84.5% 0.143 164.978);
    --color-emerald-700: oklch(84.5% 0.143 164.978);
    --color-emerald-800: oklch(90.5% 0.093 164.15);
    --color-emerald-900: oklch(95% 0.052 163.051);
    --color-emerald-950: oklch(97.9% 0.021 166.113);
    /* sky */
    --color-sky-50: oklch(29.3% 0.066 243.157);
    --color-sky-100: oklch(39.1% 0.09 240.876);
    --color-sky-200: oklch(44.3% 0.11 240.79);
    --color-sky-300: oklch(50% 0.134 242.749);
    --color-sky-400: oklch(68.5% 0.169 237.323);
    --color-sky-500: oklch(74.6% 0.16 232.661);
    --color-sky-600: oklch(82.8% 0.111 230.318);
    --color-sky-700: oklch(82.8% 0.111 230.318);
    --color-sky-800: oklch(90.1% 0.058 230.902);
    --color-sky-900: oklch(95.1% 0.026 236.824);
    --color-sky-950: oklch(97.7% 0.013 236.62);
    /* orange */
    --color-orange-50: oklch(26.6% 0.079 36.259);
    --color-orange-100: oklch(40.8% 0.123 38.172);
    --color-orange-200: oklch(47% 0.157 37.304);
    --color-orange-300: oklch(55.3% 0.195 38.402);
    --color-orange-400: oklch(70.5% 0.213 47.604);
    --color-orange-500: oklch(75% 0.183 55.934);
    --color-orange-600: oklch(83.7% 0.128 66.29);
    --color-orange-700: oklch(83.7% 0.128 66.29);
    --color-orange-800: oklch(90.1% 0.076 70.697);
    --color-orange-900: oklch(95.4% 0.038 75.164);
    --color-orange-950: oklch(98% 0.016 73.684);
}

/*
 * Solid buttons and badges (a fill colour with text-white) keep a saturated fill with light text in
 * the dark theme, instead of following the remapped scale (which would turn them pastel with dark
 * text). Values are Tailwind's originals, one or two steps lighter than in the light theme so the
 * fill stands out against dark surfaces. Hover rules restate the hover colour, which the base rule
 * would otherwise override.
 */
.dark .text-white:is(.bg-blue-800, .bg-emerald-700, .bg-red-700, .bg-amber-600, .bg-sky-700, .bg-slate-900) {
    color: oklch(98.4% 0.003 247.858);
}
.dark .text-white.bg-blue-800 {
    background-color: oklch(54.6% 0.245 262.881);
}
.dark .text-white.bg-blue-800.hover\:bg-blue-900:hover {
    background-color: oklch(48.8% 0.243 264.376);
}
.dark .text-white.bg-emerald-700 {
    background-color: oklch(59.6% 0.145 163.225);
}
.dark .text-white.bg-emerald-700.hover\:bg-emerald-800:hover {
    background-color: oklch(50.8% 0.118 165.612);
}
.dark .text-white.bg-red-700 {
    background-color: oklch(57.7% 0.245 27.325);
}
.dark .text-white.bg-red-700.hover\:bg-red-800:hover {
    background-color: oklch(50.5% 0.213 27.518);
}
.dark .text-white.bg-amber-600 {
    background-color: oklch(55.5% 0.163 48.998);
}
.dark .text-white.bg-amber-600.hover\:bg-amber-700:hover {
    background-color: oklch(47.3% 0.137 46.201);
}
.dark .text-white.bg-sky-700 {
    background-color: oklch(58.8% 0.158 241.966);
}
.dark .text-white.bg-sky-700.hover\:bg-sky-800:hover {
    background-color: oklch(50% 0.134 242.749);
}
.dark .text-white.bg-slate-900 {
    background-color: oklch(0.38 0.015 260);
}
