/* Les thèmes Elunis exposent la marque et les tokens ERP utilisés par tous les modules.
   Les couleurs d'état gardent leur sens quelle que soit la couleur de la marque. */
:is([data-theme="elunis_light"], [data-theme="elunis_azure"], [data-theme="elunis_lagoon"], [data-theme="elunis_dawn"], [data-theme="elunis_orchid"], [data-theme="elunis_plum_mid"], [data-theme="elunis_emerald_mid"]) {
  color-scheme:light;
  --success:#11734E;
  --success-soft:#E2F5EB;
  --warn:#805200;
  --warn-soft:#FFF3D8;
  --warn-line:#BD821B;
  --danger:#B42318;
  --danger-soft:#FFF0EE;
  --info:#0B6176;
  --info-soft:#E1F4F8;
  --purple:#7144A2;
  --purple-soft:#F2EAF9;
}

:is([data-theme="elunis_night"], [data-theme="elunis_plum"], [data-theme="elunis_emerald"], [data-theme="elunis_gold"], [data-theme="elunis_slate"], [data-theme="elunis_lunar_core"], [data-theme="elunis_moonlight"], [data-theme="elunis_orbital_night"], [data-theme="elunis_celestial"], [data-theme="elunis_beyond_blue"]) {
  --success:#65D9A6;
  --success-soft:#173A31;
  --warn:#F5CC76;
  --warn-soft:#40331D;
  --warn-line:#C39540;
  --danger:#FF9494;
  --danger-soft:#42252D;
  --info:#7AD2F5;
  --info-soft:#1A3547;
  --purple:#D4B3F7;
  --purple-soft:#342944;
  --shadow:0 14px 32px rgba(0,0,0,.28);
}

[data-theme="elunis_light"] {
  color-scheme:light;
  --elunis-primary:#0B2E5B;
  --elunis-secondary:#126E82;
  --elunis-accent:#11BFE3;
  --bg:#F7FAFC;
  --surface:#FFFFFF;
  --surface-alt:#F1F5F9;
  --sidebar-bg:#F1F5F9;
  --ink:#0F172A;
  --muted:#64748B;
  --blue:#0B2E5B;
  --blue-hover:#126E82;
  --blue-soft:#E7F4F7;
  --line:#E2E8F0;
  --input-border:#A9B8CA;
  --button-ink:#FFFFFF;
  --shadow:0 10px 28px rgba(11,46,91,.08);
}

/* ElunisID1.png : bleu lunaire et cyan. */
[data-theme="elunis_azure"] {
  --elunis-primary:#0B2E5B;
  --elunis-secondary:#007E9D;
  --elunis-accent:#11BFE3;
  --bg:#F2F8FD;
  --surface:#FFFFFF;
  --surface-alt:#EAF3FA;
  --sidebar-bg:#E8F2FA;
  --ink:#10273E;
  --muted:#5D7085;
  --blue:#0C4D83;
  --blue-hover:#0A3B66;
  --blue-soft:#DDF1F9;
  --line:#D5E4EE;
  --input-border:#9EB7C8;
  --button-ink:#FFFFFF;
  --shadow:0 10px 28px rgba(12,77,131,.09);
}

/* Elunisv1.png : turquoise profond et aqua. */
[data-theme="elunis_lagoon"] {
  --elunis-primary:#073C4A;
  --elunis-secondary:#087B7C;
  --elunis-accent:#31C5C1;
  --bg:#F1F9F8;
  --surface:#FFFFFF;
  --surface-alt:#E8F4F2;
  --sidebar-bg:#E7F3F0;
  --ink:#173434;
  --muted:#577274;
  --blue:#08605D;
  --blue-hover:#064E4B;
  --blue-soft:#DCF1EB;
  --line:#D4E5E0;
  --input-border:#9DBDB5;
  --button-ink:#FFFFFF;
  --shadow:0 10px 28px rgba(8,96,93,.09);
}

/* Elunisv11.png : bleu, vert et or. */
[data-theme="elunis_dawn"] {
  --elunis-primary:#17395E;
  --elunis-secondary:#0B6658;
  --elunis-accent:#D4A53A;
  --bg:#FAFAF4;
  --surface:#FFFFFF;
  --surface-alt:#F5F4E9;
  --sidebar-bg:#F3F3E8;
  --ink:#1B302D;
  --muted:#596D68;
  --blue:#0B5F57;
  --blue-hover:#084942;
  --blue-soft:#E0F0EA;
  --line:#E2E3D7;
  --input-border:#A7BAB1;
  --button-ink:#FFFFFF;
  --shadow:0 10px 28px rgba(23,57,94,.09);
}

/* Elunisv12.png : prune, vert et or. */
[data-theme="elunis_orchid"] {
  --elunis-primary:#4A245A;
  --elunis-secondary:#0B5F57;
  --elunis-accent:#D5A63E;
  --bg:#FCF8FC;
  --surface:#FFFFFF;
  --surface-alt:#F4EDF5;
  --sidebar-bg:#F4EDF4;
  --ink:#32273C;
  --muted:#70677A;
  --blue:#6B3775;
  --blue-hover:#522A61;
  --blue-soft:#F1E6F4;
  --line:#E7DBE9;
  --input-border:#BBA9C1;
  --button-ink:#FFFFFF;
  --shadow:0 10px 28px rgba(74,36,90,.09);
}

[data-theme="elunis_plum_mid"] {
  color-scheme:light;
  --elunis-primary:#60466C;
  --elunis-secondary:#7B5B87;
  --elunis-accent:#DCC2E2;
  --bg:#9D94A1;
  --surface:#BDB3C0;
  --surface-alt:#AEA2B2;
  --sidebar-bg:#AFA3B3;
  --ink:#2D2431;
  --muted:#352A3A;
  --blue:#56325F;
  --blue-hover:#42264A;
  --blue-soft:#DFD1E4;
  --line:#817587;
  --input-border:#5D4F63;
  --button-ink:#FFFFFF;
  --shadow:0 10px 24px rgba(45,36,49,.12);
}

[data-theme="elunis_emerald_mid"] {
  color-scheme:light;
  --elunis-primary:#285D45;
  --elunis-secondary:#42765A;
  --elunis-accent:#C8E2D0;
  --bg:#93A899;
  --surface:#B8CABD;
  --surface-alt:#A7BDAA;
  --sidebar-bg:#A6BBAA;
  --ink:#213228;
  --muted:#263A2C;
  --blue:#20583D;
  --blue-hover:#17452E;
  --blue-soft:#D2E5D6;
  --line:#738D78;
  --input-border:#526B56;
  --button-ink:#FFFFFF;
  --shadow:0 10px 24px rgba(33,50,40,.12);
}

[data-theme="elunis_night"] {
  color-scheme:dark;
  --elunis-primary:#0F3C73;
  --elunis-secondary:#087F8C;
  --elunis-accent:#19C8E8;
  --bg:#050B18;
  --surface:#0B1628;
  --surface-alt:#102039;
  --sidebar-bg:#0B1628;
  --ink:#F4F7FB;
  --muted:#91A4BC;
  --blue:#11BFE3;
  --blue-hover:#29D5F2;
  --blue-soft:#103149;
  --line:#29435F;
  --input-border:#59728C;
  --button-ink:#061426;
}

[data-theme="elunis_plum"] {
  color-scheme:dark;
  --elunis-primary:#6D4778;
  --elunis-secondary:#9B78A8;
  --elunis-accent:#D6ADDE;
  --bg:#211923;
  --surface:#2E2432;
  --surface-alt:#392E3E;
  --sidebar-bg:#291F2C;
  --ink:#F5EEF5;
  --muted:#C5B8C9;
  --blue:#C19ACB;
  --blue-hover:#D1B0DA;
  --blue-soft:#45374B;
  --line:#5B4B61;
  --input-border:#86748B;
  --button-ink:#261D2A;
  --success:#A9D0B6;
  --success-soft:#34483D;
  --warn:#DEC69A;
  --warn-soft:#4A3D31;
  --danger:#E7AAA9;
  --danger-soft:#4B353D;
  --info:#ACC7D7;
  --info-soft:#344451;
  --purple:#D1B2D8;
  --purple-soft:#45384D;
  --shadow:0 10px 24px rgba(0,0,0,.18);
}

[data-theme="elunis_emerald"] {
  color-scheme:dark;
  --elunis-primary:#32634C;
  --elunis-secondary:#5F9A79;
  --elunis-accent:#8FCFB0;
  --bg:#17241F;
  --surface:#22352D;
  --surface-alt:#2C4137;
  --sidebar-bg:#1E3027;
  --ink:#F1F7F3;
  --muted:#B8C9BF;
  --blue:#8FCFB0;
  --blue-hover:#A9DEC0;
  --blue-soft:#314E3D;
  --line:#4C6857;
  --input-border:#758C7B;
  --button-ink:#1D3024;
  --success:#A6D5B7;
  --success-soft:#2F493A;
  --warn:#E3C995;
  --warn-soft:#473E2B;
  --danger:#E9ABA6;
  --danger-soft:#4A3937;
  --info:#A6CCD0;
  --info-soft:#31494B;
  --purple:#D0B8DB;
  --purple-soft:#413C4A;
  --shadow:0 10px 24px rgba(0,0,0,.18);
}

[data-theme="elunis_gold"] {
  color-scheme:dark;
  --elunis-primary:#9A7023;
  --elunis-secondary:#D4A53A;
  --elunis-accent:#F5D77A;
  --bg:#10131A;
  --surface:#191D27;
  --surface-alt:#272A31;
  --sidebar-bg:#151923;
  --ink:#FFF9EC;
  --muted:#B7B1A4;
  --blue:#F5D77A;
  --blue-hover:#FFE5A0;
  --blue-soft:#44391F;
  --line:#484438;
  --input-border:#867D67;
  --button-ink:#211B10;
}

[data-theme="elunis_slate"] {
  color-scheme:dark;
  --elunis-primary:#334155;
  --elunis-secondary:#64748B;
  --elunis-accent:#38BDF8;
  --bg:#111827;
  --surface:#1F2937;
  --surface-alt:#273449;
  --sidebar-bg:#1B2635;
  --ink:#F8FAFC;
  --muted:#CBD5E1;
  --blue:#38BDF8;
  --blue-hover:#7DD3FC;
  --blue-soft:#1B4158;
  --line:#435269;
  --input-border:#718299;
  --button-ink:#112233;
}

/* Palettes sombres d’Elunis CORE. Les états métier gardent leurs couleurs dédiées. */
[data-theme="elunis_lunar_core"] {
  color-scheme:dark;
  --elunis-primary:#096EDE;
  --elunis-secondary:#7FAADF;
  --elunis-accent:#33B6FB;
  --bg:#000410;
  --sidebar-bg:#000D26;
  --surface:#011233;
  --surface-alt:#021A45;
  --surface-hover:#021A45;
  --ink:#F6F9FD;
  --muted:#A8B8CC;
  --blue:#096EDE;
  --blue-hover:#0E8EF4;
  --blue-soft:#021A45;
  --line:#0E3471;
  --input-border:color-mix(in srgb, var(--line) 65%, var(--elunis-secondary));
  --button-ink:#F6F9FD;
  --elunis-ice:#BBDCFB;
}

[data-theme="elunis_moonlight"] {
  color-scheme:dark;
  --elunis-primary:#4A9FFF;
  --elunis-secondary:#A9D6FF;
  --elunis-accent:#6DD5FA;
  --bg:#030712;
  --sidebar-bg:#081426;
  --surface:#10233A;
  --surface-alt:#173A5E;
  --surface-hover:#173A5E;
  --ink:#F7FAFF;
  --muted:#B7C4D6;
  --blue:#4A9FFF;
  --blue-hover:#6DD5FA;
  --blue-soft:#173A5E;
  --line:#29435F;
  --input-border:color-mix(in srgb, var(--line) 65%, var(--elunis-secondary));
  --button-ink:#030712;
}

[data-theme="elunis_orbital_night"] {
  color-scheme:dark;
  --elunis-primary:#1677FF;
  --elunis-secondary:#4A8CFF;
  --elunis-accent:#19C2FF;
  --bg:#02050D;
  --sidebar-bg:#050D1E;
  --surface:#09172F;
  --surface-alt:#102A50;
  --surface-hover:#102A50;
  --ink:#F5F8FF;
  --muted:#9AAFC7;
  --blue:#1677FF;
  --blue-hover:#19C2FF;
  --blue-soft:#102A50;
  --line:#183A66;
  --input-border:color-mix(in srgb, var(--line) 65%, var(--elunis-secondary));
  --button-ink:#02050D;
}

[data-theme="elunis_celestial"] {
  color-scheme:dark;
  --elunis-primary:#3B82F6;
  --elunis-secondary:#89A9C7;
  --elunis-accent:#55C7F3;
  --bg:#06070B;
  --sidebar-bg:#0D1118;
  --surface:#161D29;
  --surface-alt:#202C3D;
  --surface-hover:#202C3D;
  --ink:#F8FAFC;
  --muted:#B8C1CC;
  --blue:#3B82F6;
  --blue-hover:#55C7F3;
  --blue-soft:#202C3D;
  --line:#334155;
  --input-border:color-mix(in srgb, var(--line) 65%, var(--elunis-secondary));
  --button-ink:#06070B;
}

[data-theme="elunis_beyond_blue"] {
  color-scheme:dark;
  --elunis-primary:#2563EB;
  --elunis-secondary:#38BDF8;
  --elunis-accent:#22D3EE;
  --bg:#020617;
  --sidebar-bg:#07102B;
  --surface:#0A1B3D;
  --surface-alt:#0E2D5C;
  --surface-hover:#0E2D5C;
  --ink:#F8FAFC;
  --muted:#A8BDD6;
  --blue:#2563EB;
  --blue-hover:#22D3EE;
  --blue-soft:#0E2D5C;
  --line:#1D4E89;
  --input-border:color-mix(in srgb, var(--line) 65%, var(--elunis-secondary));
  --button-ink:#F8FAFC;
}

html[data-theme^="elunis_"] .brand-logo {
  box-shadow:0 0 0 1px var(--line);
}
html[data-theme^="elunis_"] .brand-logo-transparent {
  box-shadow:none;
  border-radius:0;
  filter:none;
}
html:is([data-theme="elunis_night"], [data-theme="elunis_plum"], [data-theme="elunis_emerald"], [data-theme="elunis_gold"], [data-theme="elunis_slate"], [data-theme="elunis_lunar_core"], [data-theme="elunis_moonlight"], [data-theme="elunis_orbital_night"], [data-theme="elunis_celestial"], [data-theme="elunis_beyond_blue"]) .brand-logo-light {
  display:none;
}
html:is([data-theme="elunis_night"], [data-theme="elunis_plum"], [data-theme="elunis_emerald"], [data-theme="elunis_gold"], [data-theme="elunis_slate"], [data-theme="elunis_lunar_core"], [data-theme="elunis_moonlight"], [data-theme="elunis_orbital_night"], [data-theme="elunis_celestial"], [data-theme="elunis_beyond_blue"]) .brand-logo-dark {
  display:block;
}

:is([data-theme="elunis_azure"], [data-theme="elunis_lagoon"], [data-theme="elunis_dawn"], [data-theme="elunis_orchid"]) header {
  border-bottom:2px solid var(--elunis-accent);
}
