/* Thèmes de l'application (choix depuis le Workbench, mémorisé par
   navigateur dans localStorage). Le thème « clair » est l'apparence
   d'origine : AUCUNE règle ici ne s'applique sans data-theme. Les deux
   autres thèmes surchargent les utilitaires Tailwind réellement utilisés
   par les gabarits (panneaux blancs, textes slate, bordures, entrées). */

/* ═════════ Thème SOMBRE ═════════ */
html[data-theme="sombre"] body { background: #0e1526; color: #d7dfee; }

html[data-theme="sombre"] .bg-white { background: #182238 !important; }
html[data-theme="sombre"] .bg-white\/60 { background: #16203466 !important; }
html[data-theme="sombre"] .bg-slate-50,
html[data-theme="sombre"] .bg-slate-100 { background: #121a2c !important; }
html[data-theme="sombre"] [class*="hover:bg-slate-50"]:hover,
html[data-theme="sombre"] [class*="hover:bg-white"]:hover {
  background: #1f2c49 !important; }

html[data-theme="sombre"] [class*="text-[#1A2744]"] { color: #e9effc !important; }
html[data-theme="sombre"] .text-slate-900 { color: #e2e9f6 !important; }
html[data-theme="sombre"] .text-slate-700,
html[data-theme="sombre"] .text-slate-600 { color: #aebcd6 !important; }
html[data-theme="sombre"] .text-slate-500 { color: #8fa0bd !important; }
html[data-theme="sombre"] .text-slate-400,
html[data-theme="sombre"] .text-slate-300 { color: #6e7f9c !important; }
html[data-theme="sombre"] [class*="text-[#1565C0]"] { color: #6ba7ec !important; }

html[data-theme="sombre"] .border,
html[data-theme="sombre"] .border-b,
html[data-theme="sombre"] .border-t,
html[data-theme="sombre"] .border-l,
html[data-theme="sombre"] .border-slate-100,
html[data-theme="sombre"] .border-slate-200,
html[data-theme="sombre"] .border-slate-300 { border-color: #2a3854 !important; }
html[data-theme="sombre"] .divide-y > :not([hidden]) ~ :not([hidden]) {
  border-color: #263349 !important; }

html[data-theme="sombre"] input,
html[data-theme="sombre"] select,
html[data-theme="sombre"] textarea {
  background: #101a2e; color: #dce4f2; border-color: #33425f !important; }
html[data-theme="sombre"] input::placeholder,
html[data-theme="sombre"] textarea::placeholder { color: #5d6f8d; }

html[data-theme="sombre"] .shadow,
html[data-theme="sombre"] .shadow-md,
html[data-theme="sombre"] .shadow-xl {
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5) !important; }
html[data-theme="sombre"] .bg-green-50 { background: #10321c !important; }
html[data-theme="sombre"] .bg-red-50 { background: #3a1420 !important; }
html[data-theme="sombre"] .bg-amber-50 { background: #3a2c10 !important; }
html[data-theme="sombre"] .bg-\[\#EAF1FF\],
html[data-theme="sombre"] [class*="bg-[#EAF1FF]"] {
  background: #16233c !important; }
html[data-theme="sombre"] [class*="bg-[#F6EEFB]"] {
  background: #241a30 !important; }

/* ═════════ Thème BAOBAB (bleus du logo) ═════════ */
html[data-theme="baobab"] body { background: #e8f0f8; color: #142c42; }

html[data-theme="baobab"] header {
  background: linear-gradient(90deg, #0d3a5c, #14537f, #2e7cb5) !important; }

html[data-theme="baobab"] .bg-white { background: #f7fafd !important; }
html[data-theme="baobab"] .bg-white\/60 { background: #f7fafd99 !important; }
html[data-theme="baobab"] .bg-slate-50,
html[data-theme="baobab"] .bg-slate-100 { background: #ddeaf5 !important; }
html[data-theme="baobab"] [class*="hover:bg-slate-50"]:hover,
html[data-theme="baobab"] [class*="hover:bg-white"]:hover {
  background: #e4eef7 !important; }

html[data-theme="baobab"] [class*="text-[#1A2744]"] { color: #113a5d !important; }
html[data-theme="baobab"] .text-slate-900 { color: #13293f !important; }
html[data-theme="baobab"] .text-slate-700,
html[data-theme="baobab"] .text-slate-600 { color: #2d4f6e !important; }
html[data-theme="baobab"] .text-slate-500 { color: #41678a !important; }
html[data-theme="baobab"] .text-slate-400,
html[data-theme="baobab"] .text-slate-300 { color: #6d93b4 !important; }
html[data-theme="baobab"] [class*="text-[#1565C0]"] { color: #1d6ca8 !important; }

html[data-theme="baobab"] [class*="bg-[#1565C0]"] {
  background: #2e7cb5 !important; }
html[data-theme="baobab"] [class*="hover:bg-[#0F4C9A]"]:hover {
  background: #1d6ca8 !important; }
html[data-theme="baobab"] [class*="bg-[#1A2744]"] {
  background: #14537f !important; }

html[data-theme="baobab"] .border,
html[data-theme="baobab"] .border-b,
html[data-theme="baobab"] .border-t,
html[data-theme="baobab"] .border-l,
html[data-theme="baobab"] .border-slate-100,
html[data-theme="baobab"] .border-slate-200,
html[data-theme="baobab"] .border-slate-300 { border-color: #aecbe3 !important; }
html[data-theme="baobab"] .divide-y > :not([hidden]) ~ :not([hidden]) {
  border-color: #bcd4e8 !important; }

html[data-theme="baobab"] input,
html[data-theme="baobab"] select,
html[data-theme="baobab"] textarea {
  background: #ffffff; color: #142c42; border-color: #8fb8d8 !important; }
html[data-theme="baobab"] input::placeholder,
html[data-theme="baobab"] textarea::placeholder { color: #7fa3c2; }

html[data-theme="baobab"] .shadow,
html[data-theme="baobab"] .shadow-md,
html[data-theme="baobab"] .shadow-xl {
  box-shadow: 0 4px 14px rgba(20, 83, 127, .18) !important; }
html[data-theme="baobab"] [class*="bg-[#EAF1FF]"] {
  background: #d8e8f6 !important; }
html[data-theme="baobab"] ::selection { background: #4a94c8; color: #fff; }

/* ═════════ Thème CONTRASTE (clair, gris renforcés) ═════════ */
html[data-theme="contraste"] body { background: #eceef1; color: #0f172a; }

html[data-theme="contraste"] .bg-slate-50,
html[data-theme="contraste"] .bg-slate-100 { background: #dde1e7 !important; }
html[data-theme="contraste"] [class*="hover:bg-slate-50"]:hover,
html[data-theme="contraste"] [class*="hover:bg-white"]:hover {
  background: #e6e9ed !important; }

html[data-theme="contraste"] .text-slate-900 { color: #0b1220 !important; }
html[data-theme="contraste"] .text-slate-700 { color: #1e293b !important; }
html[data-theme="contraste"] .text-slate-600 { color: #26334a !important; }
html[data-theme="contraste"] .text-slate-500 { color: #334155 !important; }
html[data-theme="contraste"] .text-slate-400 { color: #475569 !important; }
html[data-theme="contraste"] .text-slate-300 { color: #64748b !important; }

html[data-theme="contraste"] .border,
html[data-theme="contraste"] .border-b,
html[data-theme="contraste"] .border-t,
html[data-theme="contraste"] .border-l,
html[data-theme="contraste"] .border-slate-100,
html[data-theme="contraste"] .border-slate-200,
html[data-theme="contraste"] .border-slate-300 {
  border-color: #8b97a8 !important; }
html[data-theme="contraste"] .divide-y > :not([hidden]) ~ :not([hidden]) {
  border-color: #9aa5b5 !important; }

html[data-theme="contraste"] input,
html[data-theme="contraste"] select,
html[data-theme="contraste"] textarea {
  background: #ffffff; color: #0f172a; border-color: #64748b !important; }
html[data-theme="contraste"] input::placeholder,
html[data-theme="contraste"] textarea::placeholder { color: #55617a; }

html[data-theme="contraste"] .shadow,
html[data-theme="contraste"] .shadow-md,
html[data-theme="contraste"] .shadow-xl {
  box-shadow: 0 3px 10px rgba(15, 23, 42, .28) !important; }
html[data-theme="contraste"] .bg-white {
  outline: 1px solid #c3cbd6; }

/* ═════════ Thèmes PERSONNALISÉS (Administration → Réglages) ═════════
   Les valeurs par thème (variables --th-*) sont servies par
   /reglages/themes-perso.css ; ici les règles génériques qui les
   appliquent, pour tout data-theme commençant par « custom- ». */
html[data-theme^="custom-"] body {
  background: var(--th-fond); color: var(--th-texte);
  font-family: var(--th-police, inherit); }
html[data-theme^="custom-"] header {
  background: linear-gradient(90deg, var(--th-header1),
                              var(--th-header2)) !important; }

html[data-theme^="custom-"] .bg-white {
  background: var(--th-panneau) !important; }
html[data-theme^="custom-"] .bg-white\/60 {
  background: color-mix(in srgb, var(--th-panneau) 60%,
                        transparent) !important; }
html[data-theme^="custom-"] .bg-slate-50,
html[data-theme^="custom-"] .bg-slate-100 {
  background: color-mix(in srgb, var(--th-fond) 65%,
                        var(--th-panneau)) !important; }
html[data-theme^="custom-"] [class*="hover:bg-slate-50"]:hover,
html[data-theme^="custom-"] [class*="hover:bg-white"]:hover {
  background: color-mix(in srgb, var(--th-panneau) 88%,
                        var(--th-accent)) !important; }

html[data-theme^="custom-"] [class*="text-[#1A2744]"] {
  color: var(--th-texte) !important; }
html[data-theme^="custom-"] .text-slate-900 {
  color: var(--th-texte) !important; }
html[data-theme^="custom-"] .text-slate-700,
html[data-theme^="custom-"] .text-slate-600 {
  color: var(--th-texte2) !important; }
html[data-theme^="custom-"] .text-slate-500 {
  color: color-mix(in srgb, var(--th-texte2) 82%,
                   transparent) !important; }
html[data-theme^="custom-"] .text-slate-400,
html[data-theme^="custom-"] .text-slate-300 {
  color: color-mix(in srgb, var(--th-texte2) 62%,
                   transparent) !important; }
html[data-theme^="custom-"] [class*="text-[#1565C0]"] {
  color: var(--th-accent) !important; }

html[data-theme^="custom-"] [class*="bg-[#1565C0]"] {
  background: var(--th-accent) !important; }
html[data-theme^="custom-"] [class*="hover:bg-[#0F4C9A]"]:hover {
  background: color-mix(in srgb, var(--th-accent) 80%,
                        black) !important; }
html[data-theme^="custom-"] [class*="bg-[#1A2744]"] {
  background: color-mix(in srgb, var(--th-accent) 55%,
                        black) !important; }

html[data-theme^="custom-"] .border,
html[data-theme^="custom-"] .border-b,
html[data-theme^="custom-"] .border-t,
html[data-theme^="custom-"] .border-l,
html[data-theme^="custom-"] .border-slate-100,
html[data-theme^="custom-"] .border-slate-200,
html[data-theme^="custom-"] .border-slate-300 {
  border-color: var(--th-bordure) !important; }
html[data-theme^="custom-"] .divide-y > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--th-bordure) !important; }

html[data-theme^="custom-"] input,
html[data-theme^="custom-"] select,
html[data-theme^="custom-"] textarea {
  background: var(--th-panneau); color: var(--th-texte);
  border-color: var(--th-bordure) !important;
  font-family: inherit; }
html[data-theme^="custom-"] input::placeholder,
html[data-theme^="custom-"] textarea::placeholder {
  color: color-mix(in srgb, var(--th-texte2) 55%, transparent); }

html[data-theme^="custom-"] .shadow,
html[data-theme^="custom-"] .shadow-md,
html[data-theme^="custom-"] .shadow-xl {
  box-shadow: 0 4px 14px
    color-mix(in srgb, var(--th-texte) 18%, transparent) !important; }
html[data-theme^="custom-"] ::selection {
  background: var(--th-accent); color: #fff; }

/* ═════════ Thème MATRIX ═════════ */
html[data-theme="matrix"] body {
  background: #030503; color: #00d94a;
  font-family: Consolas, "Courier New", monospace; }

html[data-theme="matrix"] header {
  background: linear-gradient(90deg, #010401, #04180a, #010401) !important; }

html[data-theme="matrix"] .bg-white { background: #06110a !important; }
html[data-theme="matrix"] .bg-white\/60 { background: #06110a99 !important; }
html[data-theme="matrix"] .bg-slate-50,
html[data-theme="matrix"] .bg-slate-100 { background: #04140b !important; }
html[data-theme="matrix"] [class*="hover:bg-slate-50"]:hover,
html[data-theme="matrix"] [class*="hover:bg-white"]:hover {
  background: #0a2413 !important; }

html[data-theme="matrix"] [class*="text-[#1A2744]"] {
  color: #52ff8f !important; text-shadow: 0 0 8px rgba(0, 255, 65, .45); }
html[data-theme="matrix"] .text-slate-900 { color: #2bff70 !important; }
html[data-theme="matrix"] .text-slate-700,
html[data-theme="matrix"] .text-slate-600 { color: #0fce54 !important; }
html[data-theme="matrix"] .text-slate-500 { color: #0aa844 !important; }
html[data-theme="matrix"] .text-slate-400,
html[data-theme="matrix"] .text-slate-300 { color: #0c7e37 !important; }
html[data-theme="matrix"] [class*="text-[#1565C0]"] {
  color: #7dffab !important; }
html[data-theme="matrix"] .text-white { text-shadow: none; }

html[data-theme="matrix"] .border,
html[data-theme="matrix"] .border-b,
html[data-theme="matrix"] .border-t,
html[data-theme="matrix"] .border-l,
html[data-theme="matrix"] .border-slate-100,
html[data-theme="matrix"] .border-slate-200,
html[data-theme="matrix"] .border-slate-300 { border-color: #0f3d1c !important; }
html[data-theme="matrix"] .divide-y > :not([hidden]) ~ :not([hidden]) {
  border-color: #0f3d1c !important; }

html[data-theme="matrix"] input,
html[data-theme="matrix"] select,
html[data-theme="matrix"] textarea {
  background: #04170a; color: #22ff66; border-color: #14532d !important;
  font-family: inherit; }
html[data-theme="matrix"] input::placeholder,
html[data-theme="matrix"] textarea::placeholder { color: #0a7a35; }

html[data-theme="matrix"] .shadow,
html[data-theme="matrix"] .shadow-md,
html[data-theme="matrix"] .shadow-xl {
  box-shadow: 0 0 14px rgba(0, 255, 65, .12) !important; }
html[data-theme="matrix"] [class*="bg-[#2E7D32]"],
html[data-theme="matrix"] [class*="bg-[#1A2744]"],
html[data-theme="matrix"] [class*="bg-[#1565C0]"] {
  background: #063d1c !important; color: #4dff88 !important;
  border: 1px solid #0f7a38 !important; }
html[data-theme="matrix"] .bg-green-50 { background: #05240f !important; }
html[data-theme="matrix"] .bg-red-50 { background: #240505 !important; }
html[data-theme="matrix"] .bg-amber-50 { background: #1f1a04 !important; }
html[data-theme="matrix"] [class*="bg-[#EAF1FF]"] {
  background: #05240f !important; }
html[data-theme="matrix"] [class*="bg-[#F6EEFB]"] {
  background: #05240f !important; }
html[data-theme="matrix"] ::selection { background: #00ff41; color: #000; }

/* ═════════ Thème MATRIXBAOBAB (Matrix, le vert remplacé par du bleu) ═════ */
html[data-theme="matrixbaobab"] body {
  background: #030405; color: #00a6d9;
  font-family: Consolas, "Courier New", monospace; }

html[data-theme="matrixbaobab"] header {
  background: linear-gradient(90deg, #010204, #04101f, #010204) !important; }

html[data-theme="matrixbaobab"] .bg-white { background: #060b13 !important; }
html[data-theme="matrixbaobab"] .bg-white\/60 { background: #060b1399 !important; }
html[data-theme="matrixbaobab"] .bg-slate-50,
html[data-theme="matrixbaobab"] .bg-slate-100 { background: #040d17 !important; }
html[data-theme="matrixbaobab"] [class*="hover:bg-slate-50"]:hover,
html[data-theme="matrixbaobab"] [class*="hover:bg-white"]:hover {
  background: #0a1726 !important; }

html[data-theme="matrixbaobab"] [class*="text-[#1A2744]"] {
  color: #52c8ff !important; text-shadow: 0 0 8px rgba(0, 170, 255, .45); }
html[data-theme="matrixbaobab"] .text-slate-900 { color: #2bb8ff !important; }
html[data-theme="matrixbaobab"] .text-slate-700,
html[data-theme="matrixbaobab"] .text-slate-600 { color: #0f9cce !important; }
html[data-theme="matrixbaobab"] .text-slate-500 { color: #0a84a8 !important; }
html[data-theme="matrixbaobab"] .text-slate-400,
html[data-theme="matrixbaobab"] .text-slate-300 { color: #0c5e7e !important; }
html[data-theme="matrixbaobab"] [class*="text-[#1565C0]"] {
  color: #7dd6ff !important; }
html[data-theme="matrixbaobab"] .text-white { text-shadow: none; }

html[data-theme="matrixbaobab"] .border,
html[data-theme="matrixbaobab"] .border-b,
html[data-theme="matrixbaobab"] .border-t,
html[data-theme="matrixbaobab"] .border-l,
html[data-theme="matrixbaobab"] .border-slate-100,
html[data-theme="matrixbaobab"] .border-slate-200,
html[data-theme="matrixbaobab"] .border-slate-300 {
  border-color: #0f2a3d !important; }
html[data-theme="matrixbaobab"] .divide-y > :not([hidden]) ~ :not([hidden]) {
  border-color: #0f2a3d !important; }

html[data-theme="matrixbaobab"] input,
html[data-theme="matrixbaobab"] select,
html[data-theme="matrixbaobab"] textarea {
  background: #04111a; color: #22c8ff; border-color: #144053 !important;
  font-family: inherit; }
html[data-theme="matrixbaobab"] input::placeholder,
html[data-theme="matrixbaobab"] textarea::placeholder { color: #0a5c7a; }

html[data-theme="matrixbaobab"] .shadow,
html[data-theme="matrixbaobab"] .shadow-md,
html[data-theme="matrixbaobab"] .shadow-xl {
  box-shadow: 0 0 14px rgba(0, 170, 255, .12) !important; }
html[data-theme="matrixbaobab"] [class*="bg-[#2E7D32]"],
html[data-theme="matrixbaobab"] [class*="bg-[#1A2744]"],
html[data-theme="matrixbaobab"] [class*="bg-[#1565C0]"] {
  background: #062a3d !important; color: #4dc8ff !important;
  border: 1px solid #0f5c7a !important; }
html[data-theme="matrixbaobab"] .bg-green-50 { background: #051824 !important; }
html[data-theme="matrixbaobab"] .bg-red-50 { background: #240505 !important; }
html[data-theme="matrixbaobab"] .bg-amber-50 { background: #1f1a04 !important; }
html[data-theme="matrixbaobab"] [class*="bg-[#EAF1FF]"] {
  background: #051824 !important; }
html[data-theme="matrixbaobab"] [class*="bg-[#F6EEFB]"] {
  background: #051824 !important; }
html[data-theme="matrixbaobab"] ::selection { background: #00b4ff; color: #000; }
