/*
 * Correctif theme clair FleetControl BF.
 *
 * L'app (bundle Vite compile, assets/index-Dw-usuav.css) definit un vrai
 * systeme de theme via variables --fv-* et une couche de remap
 * [data-theme=light] qui reecrit les classes Tailwind "sombre-par-defaut"
 * (text-slate-300, bg-slate-900, etc.) vers ces variables. Cette couche de
 * remap est incomplete :
 *   - toute la famille "zinc" (bg-zinc-900/950, text-zinc-200..600,
 *     border-zinc-600/700/800) n'est pas couverte -> reste figee en gris/
 *     noir fonce du theme sombre meme en mode clair (texte illisible sur
 *     fond blanc, ou fond noir qui ne bascule jamais en blanc).
 *   - les variantes SOLIDES bg-slate-900 et bg-slate-700 (sans /opacite)
 *     ne sont pas couvertes, seules leurs variantes /40../80 le sont.
 *
 * Ce fichier est charge APRES le bundle principal (voir index.html) donc
 * l'emporte sur la cascade a specificite egale ; on reprend exactement les
 * memes selecteurs (meme prefixe [data-theme=light] .fv-app :not(...)) pour
 * garantir une specificite au moins egale, + !important pour battre les
 * !important du bundle.
 *
 * Objectif explicite : theme clair plus lisible et plus homogene, textes
 * ramenes vers un noir/gris tres fonce plutot que les gris moyens d'origine
 * (qui manquaient de contraste sur fond blanc).
 */

/* ---- 1) Palette texte plus contrastee (quasi noir partout) --------------- */
html[data-theme=light] {
  --fv-text: #000000 !important;
  --fv-text-secondary: #111827 !important; /* gray-900, quasi noir */
  --fv-text-muted: #1f2937 !important;     /* gray-800, fonce mais distinct */
}

/* ---- 2) Familles de couleurs manquantes dans le remap d'origine ---------- */

/* Fonds "zinc" fonces jamais remappes -> traites comme les cartes (bg-slate-900) */
html[data-theme=light] .fv-app .bg-zinc-900,
html[data-theme=light] .fv-app .bg-zinc-950,
html[data-theme=light] .fv-app .bg-slate-900 {
  background-color: var(--fv-bg-card) !important;
}

/* Variante solide bg-slate-700 (sans opacite), oubliee a cote de bg-slate-700/50 */
html[data-theme=light] .fv-app .bg-slate-700 {
  background-color: var(--fv-bg-hover) !important;
}

/* Bordures "zinc" jamais remappees */
html[data-theme=light] .fv-app .border-zinc-600,
html[data-theme=light] .fv-app .border-zinc-700,
html[data-theme=light] .fv-app .border-zinc-800,
html[data-theme=light] .fv-app .divide-slate-800\/60 {
  border-color: var(--fv-border) !important;
}

/* Textes "zinc" clairs (penses pour fond sombre) jamais remappes vers du texte lisible */
html[data-theme=light] .fv-app :not(.fv-sidebar, .fv-sidebar *, .fv-topbar, .fv-topbar *).text-zinc-200,
html[data-theme=light] .fv-app :not(.fv-sidebar, .fv-sidebar *, .fv-topbar, .fv-topbar *).text-zinc-300 {
  color: var(--fv-text-secondary) !important;
}
html[data-theme=light] .fv-app :not(.fv-sidebar, .fv-sidebar *, .fv-topbar, .fv-topbar *).text-zinc-400,
html[data-theme=light] .fv-app :not(.fv-sidebar, .fv-sidebar *, .fv-topbar, .fv-topbar *).text-zinc-500 {
  color: var(--fv-text-muted) !important;
}

/* ---- 3) Filet de securite : tout texte encore trop clair sur fond blanc --- */
/* Si un composant utilise une classe grise/blanche non repertoriee ci-dessus,
   ce filet generique force au minimum un texte sombre lisible partout dans
   le contenu principal (hors sidebar/topbar qui restent en fond sombre). */
html[data-theme=light] .fv-app :not(.fv-sidebar, .fv-sidebar *, .fv-topbar, .fv-topbar *)[class*="text-white"],
html[data-theme=light] .fv-app :not(.fv-sidebar, .fv-sidebar *, .fv-topbar, .fv-topbar *)[class*="text-slate-1"],
html[data-theme=light] .fv-app :not(.fv-sidebar, .fv-sidebar *, .fv-topbar, .fv-topbar *)[class*="text-slate-2"],
html[data-theme=light] .fv-app :not(.fv-sidebar, .fv-sidebar *, .fv-topbar, .fv-topbar *)[class*="text-slate-3"],
html[data-theme=light] .fv-app :not(.fv-sidebar, .fv-sidebar *, .fv-topbar, .fv-topbar *)[class*="text-zinc-2"],
html[data-theme=light] .fv-app :not(.fv-sidebar, .fv-sidebar *, .fv-topbar, .fv-topbar *)[class*="text-zinc-3"] {
  color: var(--fv-text-secondary) !important;
}
