/* Caplengo — Instrument de bord : pont entre l'ancien balisage (classes Tailwind claires, souvent fabriquees
   par les scripts) et la refonte (static/css/ib.css). Chaque page refaite utilise directement les classes de ib.css ;
   ce fichier garantit qu'aucun reste clair (fond blanc, texte marine, coins arrondis) ne survive nulle part. */

/* Page entiere : fond grille, police d'affichage, coins droits */
body.ib{min-height:100vh;color-scheme:dark}
/* Coins droits : seulement les anciennes classes « rounded » de Tailwind et les controles du navigateur,
   pour que les arrondis voulus par les maquettes (radars, pastilles, avatars, telephone) restent */
body.ib [class*="rounded"]:not(.rad):not(.dot){border-radius:0 !important}
body.ib button,body.ib input,body.ib select,body.ib textarea{border-radius:0}

/* Fonds clairs -> panneaux sombres */
body.ib .bg-white,body.ib .bg-cream,body.ib .bg-gray-50,body.ib .bg-slate-50,body.ib .bg-zinc-50,body.ib .bg-stone-50,
body.ib .bg-gray-100,body.ib .bg-slate-100,body.ib .bg-zinc-100,body.ib .bg-white\/80,body.ib .bg-white\/90,body.ib .bg-white\/70,body.ib .bg-white\/60{background-color:var(--pn2) !important}
body.ib .bg-slate-200,body.ib .bg-gray-200,body.ib .bg-zinc-200{background-color:#12272D !important}
body.ib .bg-navy,body.ib .bg-navy-700,body.ib .bg-caplengo-navy{background-color:#06131A !important}
body.ib .bg-caplengo-teal,body.ib .bg-teal,body.ib .bg-teal-500,body.ib .bg-teal-600{background-color:var(--ac) !important;color:#071014 !important}
body.ib .bg-caplengo-teal *,body.ib .bg-teal *{color:#071014}
body.ib [class*="bg-teal\/"],body.ib [class*="bg-caplengo-teal\/"]{background-color:rgba(44,242,201,.1) !important}
body.ib [class*="bg-rose-50"],body.ib [class*="bg-red-50"],body.ib .bg-red-100{background-color:rgba(255,123,123,.1) !important}
body.ib [class*="bg-amber-50"],body.ib [class*="bg-yellow-50"],body.ib [class*="bg-orange-50"],body.ib .bg-amber-100{background-color:rgba(255,181,71,.1) !important}
body.ib [class*="bg-emerald-50"],body.ib [class*="bg-green-50"],body.ib .bg-green-100,body.ib .bg-emerald-100{background-color:rgba(52,211,153,.1) !important}
body.ib [class*="bg-violet-50"],body.ib [class*="bg-purple-50"],body.ib .bg-violet-100{background-color:rgba(180,155,255,.1) !important}
body.ib [class*="bg-blue-50"],body.ib [class*="bg-sky-50"],body.ib .bg-blue-100{background-color:rgba(141,184,255,.1) !important}

/* Textes */
body.ib .text-caplengo-navy,body.ib .text-navy,body.ib .text-gray-900,body.ib .text-slate-900,body.ib .text-zinc-900,
body.ib .text-gray-800,body.ib .text-slate-800,body.ib .text-zinc-800,body.ib .text-black{color:var(--hi) !important}
body.ib .text-gray-700,body.ib .text-slate-700,body.ib .text-zinc-700,body.ib .text-gray-600,body.ib .text-slate-600,body.ib .text-zinc-600{color:var(--tx) !important}
body.ib .text-gray-500,body.ib .text-slate-500,body.ib .text-zinc-500{color:var(--mu) !important}
body.ib .text-gray-400,body.ib .text-slate-400,body.ib .text-zinc-400,body.ib .text-gray-300,body.ib .text-slate-300{color:var(--di) !important}
body.ib .text-caplengo-teal,body.ib .text-teal,body.ib .text-teal-600,body.ib .text-teal-500{color:var(--ac) !important}
body.ib [class*="text-rose-"],body.ib [class*="text-red-"]{color:var(--da) !important}
body.ib [class*="text-amber-"],body.ib [class*="text-yellow-"],body.ib [class*="text-orange-"]{color:var(--am) !important}
body.ib [class*="text-emerald-"],body.ib [class*="text-green-"]{color:var(--ev) !important}
body.ib [class*="text-violet-"],body.ib [class*="text-purple-"]{color:var(--cm) !important}
body.ib [class*="text-blue-"],body.ib [class*="text-sky-"]{color:var(--pro) !important}
body.ib .text-white{color:var(--hi)}

/* Bordures */
body.ib [class*="border-slate-"],body.ib [class*="border-gray-"],body.ib [class*="border-zinc-"],body.ib .border-white\/10,body.ib .border-white\/5{border-color:var(--ln) !important}
body.ib .border-teal,body.ib [class*="border-caplengo-teal"],body.ib [class*="border-teal-"]{border-color:var(--ac) !important}

/* Ombres : remplacees par le filet de la refonte */
body.ib [class*="shadow-premium"],body.ib .shadow-sm,body.ib .shadow,body.ib .shadow-md,body.ib .shadow-lg,body.ib .shadow-xl,body.ib .shadow-float{box-shadow:none !important}

/* Survols clairs */
body.ib [class*="hover:bg-slate-"]:hover,body.ib [class*="hover:bg-gray-"]:hover,body.ib [class*="hover:bg-white"]:hover,body.ib [class*="hover:bg-zinc-"]:hover{background-color:rgba(44,242,201,.08) !important}

/* Champs de formulaire laisses sans classe de la refonte */
body.ib input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]):not(.inp),body.ib select:not(.inp),body.ib textarea:not(.inp){background-color:#06131A;color:var(--hi);border-color:var(--ln);font-family:var(--disp)}
body.ib input::placeholder,body.ib textarea::placeholder{color:#4F7A75}
body.ib input[type=checkbox],body.ib input[type=radio]{accent-color:var(--ac)}
body.ib option{background:#091619;color:var(--hi)}
::selection{background:rgba(44,242,201,.3)}

/* Fenetres : .modal-overlay / .modal-content = gabarit .ov / .mdl */
.modal-overlay{position:fixed;inset:0;background:rgba(3,8,10,.72);backdrop-filter:blur(3px);z-index:50;display:flex;align-items:flex-start;justify-content:center;padding:48px 16px;overflow-y:auto}
.modal-content{width:100%;max-width:560px;max-height:none;overflow:visible;border:1px solid var(--ac);background:#091619;color:var(--tx);box-shadow:0 0 0 1px rgba(44,242,201,.15),0 30px 80px rgba(0,0,0,.6),0 0 40px rgba(44,242,201,.1);animation:ibpop .45s cubic-bezier(.2,1.2,.4,1) both}

/* Barres de defilement discretes */
body.ib ::-webkit-scrollbar{width:10px;height:10px}
body.ib ::-webkit-scrollbar-track{background:#06131A}
body.ib ::-webkit-scrollbar-thumb{background:var(--ln2)}
body.ib ::-webkit-scrollbar-thumb:hover{background:var(--acd)}

/* Liens : turquoise des maquettes (a{color:var(--ac)} de ib.css). Tailwind par CDN injecte son « a{color:inherit} »
   apres nos feuilles et l'emporte ; ce selecteur est un peu plus precis que « a » mais moins qu'une classe,
   pour que les liens habilles (.btn, .seg, .dd, .chip...) gardent leur propre couleur */
html body a{color:var(--ac)}
html body a:hover{color:var(--hi)}
