/* Colour palettes of Qulay dókon boşqaruvi (common\components\qd\Palette, webapp/src/palettes.ts).
   <html data-palette="..."> picks one (cookie "qd_palette", the same on the site and in the admin panel); <html class="dark">
   switches any of them to the night colours. Values are "R G B" triples so Tailwind can add opacity:
   rgb(var(--p) / 0.2). Used as is by the admin panel (common\assets\Theme) and imported by webapp/src/index.css.

   Four colours of the "clean SaaS" look plus the grey one:
   - sky (default): blue, calm and trustworthy;
   - grape: purple, creative;
   - lime: fresh green-yellow, lively;
   - peony: deep pink, warm;
   - mono: black, white and grey - strict, no colour at all.
   Every colour has its own faintly tinted neutrals, so the greys never look dirty next to it.

   --p primary · --p-dark its deep tone · --p-light its pale tint · --a accent · --ink the dark tiles (logo, buttons, panels)
   --glow the light colour on --ink · --p-night text-primary on a dark page · --n-* neutrals (light page)
   --d-* the dark page: bg, surface, surface-2, border, text, muted
   --hero-1..3 the dark panels, --hero-acc the light colour on them - the same in light and dark mode */

/* the primary colours are all dark enough for white text on them (contrast 5:1 and better) */
:root,
:root[data-palette="sky"] {
  --p: 3 105 161; --p-dark: 12 74 110; --p-light: 224 242 254; --a: 14 165 233; --ink: 8 47 73; --glow: 125 211 252; --p-night: 56 189 248;
  --hero-1: 8 47 73; --hero-2: 12 74 110; --hero-3: 3 105 161; --hero-acc: 125 211 252;
  --n-50: 248 250 252; --n-100: 241 245 249; --n-200: 226 232 240; --n-300: 203 213 225; --n-400: 148 163 184; --n-500: 100 116 139;
  --n-600: 71 85 105; --n-700: 51 65 85; --n-800: 30 41 59; --n-900: 15 23 42; --n-950: 2 6 23;
  --d-bg: 8 15 24; --d-surface: 15 27 40; --d-surface-2: 22 39 56; --d-border: 36 56 77; --d-text: 232 240 248; --d-muted: 148 168 190;
}
:root[data-palette="grape"] {
  --p: 126 34 206; --p-dark: 88 28 135; --p-light: 243 232 255; --a: 217 70 239; --ink: 36 12 58; --glow: 233 213 255; --p-night: 192 132 252;
  --hero-1: 36 12 58; --hero-2: 88 28 135; --hero-3: 126 34 206; --hero-acc: 233 213 255;
  --n-50: 250 250 252; --n-100: 244 243 248; --n-200: 228 226 236; --n-300: 208 205 222; --n-400: 156 151 177; --n-500: 110 105 132;
  --n-600: 82 78 102; --n-700: 63 59 80; --n-800: 40 37 54; --n-900: 26 24 38; --n-950: 15 13 24;
  --d-bg: 14 10 22; --d-surface: 24 18 38; --d-surface-2: 36 28 56; --d-border: 56 45 84; --d-text: 245 240 252; --d-muted: 172 160 196;
}
:root[data-palette="lime"] {
  --p: 77 124 15; --p-dark: 54 83 14; --p-light: 236 252 203; --a: 132 204 22; --ink: 26 46 5; --glow: 190 242 100; --p-night: 163 230 53;
  --hero-1: 26 46 5; --hero-2: 54 83 14; --hero-3: 77 124 15; --hero-acc: 190 242 100;
  --n-50: 249 250 247; --n-100: 242 245 238; --n-200: 226 231 218; --n-300: 205 213 193; --n-400: 152 163 137; --n-500: 107 118 94;
  --n-600: 80 90 70; --n-700: 62 70 54; --n-800: 40 46 34; --n-900: 26 31 22; --n-950: 14 18 11;
  --d-bg: 11 16 8; --d-surface: 20 28 14; --d-surface-2: 30 41 22; --d-border: 48 64 36; --d-text: 240 247 232; --d-muted: 160 176 144;
}
:root[data-palette="peony"] {
  --p: 190 24 93; --p-dark: 131 24 67; --p-light: 252 231 243; --a: 236 72 153; --ink: 80 7 36; --glow: 249 168 212; --p-night: 244 114 182;
  --hero-1: 80 7 36; --hero-2: 131 24 67; --hero-3: 190 24 93; --hero-acc: 249 168 212;
  --n-50: 252 249 250; --n-100: 247 242 244; --n-200: 236 227 231; --n-300: 220 207 213; --n-400: 172 155 163; --n-500: 126 110 118;
  --n-600: 96 82 89; --n-700: 74 62 68; --n-800: 46 38 42; --n-900: 31 25 28; --n-950: 20 15 18;
  --d-bg: 20 10 15; --d-surface: 34 19 27; --d-surface-2: 50 30 41; --d-border: 72 46 60; --d-text: 252 240 246; --d-muted: 190 160 175;
}
:root[data-palette="mono"] {
  --p: 23 23 23; --p-dark: 0 0 0; --p-light: 229 229 229; --a: 82 82 82; --ink: 10 10 10; --glow: 245 245 245; --p-night: 245 245 245;
  --hero-1: 10 10 10; --hero-2: 38 38 38; --hero-3: 64 64 64; --hero-acc: 212 212 212;
  --n-50: 250 250 250; --n-100: 245 245 245; --n-200: 229 229 229; --n-300: 212 212 212; --n-400: 163 163 163; --n-500: 115 115 115;
  --n-600: 82 82 82; --n-700: 64 64 64; --n-800: 38 38 38; --n-900: 23 23 23; --n-950: 10 10 10;
  --d-bg: 0 0 0; --d-surface: 18 18 18; --d-surface-2: 30 30 30; --d-border: 48 48 48; --d-text: 245 245 245; --d-muted: 163 163 163;
}
/* black & white at night: the "primary" fills turn white, their text black */
.dark[data-palette="mono"] { --p: 245 245 245; --p-dark: 255 255 255; --a: 163 163 163; --ink: 245 245 245; --glow: 10 10 10; }

/* the palette switch's samples: three dots of each palette, drawn in its own colours whatever the page uses */
[data-palette-sample="sky"] { --s1: #0369a1; --s2: #0ea5e9; --s3: #082f49; }
[data-palette-sample="grape"] { --s1: #7e22ce; --s2: #d946ef; --s3: #240c3a; }
[data-palette-sample="lime"] { --s1: #4d7c0f; --s2: #84cc16; --s3: #1a2e05; }
[data-palette-sample="peony"] { --s1: #be185d; --s2: #ec4899; --s3: #500724; }
[data-palette-sample="mono"] { --s1: #171717; --s2: #a3a3a3; --s3: #ffffff; }
.qd-swatch { display: inline-flex; gap: 3px; vertical-align: middle; }
.qd-swatch i { display: block; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.qd-swatch i:nth-child(1) { background: var(--s1); }
.qd-swatch i:nth-child(2) { background: var(--s2); }
.qd-swatch i:nth-child(3) { background: var(--s3); }
