/* ============================================================================
   LE JOURNAL ET L ESPACE COACH, AU STYLE DE L ESPACE MEMBRE (« noir et or »)
   ============================================================================
   Demande de Nadir du 14/10 : « le fond sera noir avec ce petit éclairage doré,
   tu uniformises avec un peu d or et de noir ; tu ne touches à rien à l
   intérieur des cards, ni aux graphiques ». Et du 15/10 : « l espace coach,
   tu me le mets comme le journal ».

   ⚠️ CE FICHIER EST UNE PEAU, PAS UNE REFONTE. Il est charge EN DERNIER, apres
   aube.css, et ne change que : le fond, la barre laterale, la COQUILLE des
   cartes (fond, bordure, arrondi, ombre), les boutons, les fenetres, les
   listes deroulantes, les titres de section et le pied de page. Il ne pose
   aucune regle sur ce qui vit DANS une carte : graphiques, tableaux,
   calendrier, chiffres, barres. ⛔ #formationApp porte deja cette palette et
   n est pas concerne.

   ⚠️ La palette est celle de assets/formation.css, recopiee ici en variables
   du journal : le journal et l espace coach lisent `--surface`, `--text`,
   `--accent`, `--aube-*` partout, et c est par elles que la peau prend sans
   toucher aux regles. Les couleurs bleu nuit ecrites EN DUR dans aube.css
   (rgba(10,15,24,.55) et consorts) sont des voiles translucides : posees sur
   un fond noir, elles rendent un noir a peine bleute (#0a0d15 contre #0a0a0d),
   invisible a l oeil. Seules les surfaces OPAQUES (fenetres, listes, toasts)
   sont reprises ici.

   ⚠️ LA GARDE `body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"])`
   sur les regles de palette, de fenetres et de pied de page : elles ne
   prennent que quand le journal ou l espace coach est a l ecran. Les
   selecteurs qui commencent par #mainApp ou #coachApp n en ont pas besoin.
   (Le 14/10 la garde ne couvrait que le journal ; l espace coach gardait
   l ancien habillage, ce n etait pas ce que Nadir voulait.)

   ⛔ `!important` partout ou aube.css en met : a specificite egale, c est la
   position qui tranche, et ce fichier vient apres ; mais aube.css pose
   `!important` sur ses fonds, donc les notres doivent le porter aussi.
   ========================================================================== */

/* ── 1. La palette, remplacee par celle de l espace membre ───────────────── */
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) {
  --bg: #0a0a0d;
  --bg-gradient:
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(232, 184, 75, .14), transparent 62%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(232, 184, 75, .10), transparent 60%),
    radial-gradient(ellipse 120% 90% at 50% 50%, #101014, #0a0a0d 70%);
  --surface: #111318; --surface-2: #161a20; --surface-3: #1b2028; --surface-elevated: #14171d;
  --text: #f7f6f3; --text-strong: #ffffff; --text-muted: #bdbcb6; --text-soft: #9c9b94; --text-disabled: #6f6e68;
  --border: #1e2128; --border-strong: #2a2e37; --border-accent: rgba(232, 184, 75, .35);
  --primary: #120e07; --primary-2: #1b2028;
  --accent: #e8b84b; --accent-hover: #f3d585; --accent-bright: #f3d585; --accent-soft: rgba(232, 184, 75, .12);
  --sidebar-bg: rgba(10, 10, 13, .72);
  --sidebar-border: #1e2128;
  --sidebar-text: #bdbcb6; --sidebar-text-muted: #9c9b94;
  --sidebar-text-hover: #f7f6f3; --sidebar-text-active: #f7f6f3;
  --sidebar-hover: rgba(232, 184, 75, .08); --sidebar-divider: #1e2128;
  --shadow-glow-gold: 0 8px 30px -8px rgba(232, 184, 75, .5);
  --ring: 0 0 0 3px rgba(232, 184, 75, .25);
  /* aube.css */
  --color-gold: #e8b84b; --color-aurum: #e8b84b; --color-champagne: #f7f6f3; --color-bronze: #b98a2e; --color-navy: #0a0a0d;
  --aube-frame: rgba(232, 184, 75, .22); --aube-frame-hover: rgba(232, 184, 75, .55); --aube-frame-radius: 18px;
  --aube-btn-gold: linear-gradient(180deg, #f3d585, #e8b84b);
  --aube-base: var(--bg-gradient);
  --aube-glass: rgba(17, 19, 24, .88); --aube-glass-border: #1e2128;
  --aube-text-primary: #f7f6f3; --aube-text-secondary: #bdbcb6;
  --aube-card-shadow: 0 20px 60px -40px rgba(0, 0, 0, .7);
}
/* Le theme clair suit le theme clair de l espace membre. */
body:not(.dark-mode):has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) {
  --bg: #f6f2ea;
  --bg-gradient:
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(232, 184, 75, .22), transparent 62%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(232, 184, 75, .14), transparent 60%),
    radial-gradient(ellipse 120% 90% at 50% 50%, #faf7f1, #f3eee4 70%);
  --surface: #ffffff; --surface-2: #f1ece1; --surface-3: #e7e0d1; --surface-elevated: #ffffff;
  --text: #17140f; --text-strong: #0d0b07; --text-muted: #4e483d; --text-soft: #6e685b; --text-disabled: #a39d8f;
  --border: #e2dbcc; --border-strong: #d2c9b5; --border-accent: rgba(185, 138, 46, .40);
  --primary: #17140f; --primary-2: #2a2519;
  --accent: #b98a2e; --accent-hover: #d3a73c; --accent-bright: #d3a73c; --accent-soft: rgba(185, 138, 46, .10);
  --sidebar-bg: rgba(250, 247, 241, .78); --sidebar-border: #e2dbcc;
  --sidebar-text: #17140f; --sidebar-text-muted: #6e685b;
  --sidebar-text-hover: #b98a2e; --sidebar-text-active: #b98a2e;
  --sidebar-hover: rgba(185, 138, 46, .10); --sidebar-divider: #e2dbcc;
  --shadow-glow-gold: 0 8px 30px -8px rgba(185, 138, 46, .35);
  --color-gold: #b98a2e; --color-aurum: #b98a2e; --color-champagne: #17140f; --color-bronze: #8f6a1f; --color-navy: #17140f;
  --aube-frame: rgba(185, 138, 46, .30); --aube-frame-hover: rgba(185, 138, 46, .60); --aube-frame-radius: 18px;
  --aube-btn-gold: linear-gradient(180deg, #e9c25a, #c9962f);
  --aube-base: var(--bg-gradient);
  --aube-glass: rgba(255, 255, 255, .86); --aube-glass-border: #e2dbcc;
  --aube-text-primary: #17140f; --aube-text-secondary: #4e483d;
  --aube-card-shadow: 0 18px 40px -30px rgba(185, 138, 46, .35);
}

/* ── 2. Le fond : noir, halo dore en haut et en bas, plus de photographie ──── */
html:has(body.dark-mode :is(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"])) { background: #0a0a0d; }
html:has(body:not(.dark-mode) :is(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"])) { background: #f6f2ea; }
#mainApp, body.dark-mode #mainApp, #coachApp, body.dark-mode #coachApp {
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(232, 184, 75, .14), transparent 62%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(232, 184, 75, .10), transparent 60%),
    radial-gradient(ellipse 120% 90% at 50% 50%, #101014, #0a0a0d 70%) !important;
  background-attachment: fixed !important;
  color: var(--text);
}
body:not(.dark-mode) #mainApp, body:not(.dark-mode) #coachApp {
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(232, 184, 75, .22), transparent 62%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(232, 184, 75, .14), transparent 60%),
    radial-gradient(ellipse 120% 90% at 50% 50%, #faf7f1, #f3eee4 70%) !important;
  background-attachment: fixed !important;
}

/* ── 3. La barre laterale : la barre du haut de l espace membre, a la verticale */
#mainAppSidebar, #mainApp .sidebar, body.dark-mode #mainAppSidebar,
#coachAppSidebar, #coachApp .sidebar, body.dark-mode #coachAppSidebar {
  background: rgba(10, 10, 13, .72) !important;
  -webkit-backdrop-filter: blur(14px) !important; backdrop-filter: blur(14px) !important;
  border-right: 1px solid #1e2128 !important;
}
body:not(.dark-mode) #mainAppSidebar, body:not(.dark-mode) #mainApp .sidebar,
body:not(.dark-mode) #coachAppSidebar, body:not(.dark-mode) #coachApp .sidebar {
  background: rgba(250, 247, 241, .78) !important;
  border-right-color: #e2dbcc !important;
}
#mainAppSidebar .border-gray-700, #coachAppSidebar .border-gray-700 { border-color: var(--sidebar-divider) !important; }
#mainAppSidebar .sidebar-item, #coachAppSidebar .sidebar-item { border-left-width: 2px; }
#mainAppSidebar .sidebar-item.active, #coachAppSidebar .sidebar-item.coach-active {
  background: linear-gradient(90deg, rgba(232, 184, 75, .14), rgba(232, 184, 75, .02));
  border-left-color: #e8b84b;
}
body.dark-mode #mainAppSidebar .sidebar-item, body.dark-mode #mainAppSidebar h3, body.dark-mode #mainAppSidebar #userInfo,
body.dark-mode #mainAppSidebar a, body.dark-mode #mainAppSidebar span,
body.dark-mode #coachAppSidebar .sidebar-item, body.dark-mode #coachAppSidebar h3, body.dark-mode #coachAppSidebar #coachUserInfo,
body.dark-mode #coachAppSidebar a, body.dark-mode #coachAppSidebar span { text-shadow: none; }
#mainAppSidebar .marque, #coachAppSidebar .marque { --marque-couleur: #e8b84b; background-color: #e8b84b; }
body:not(.dark-mode) #mainAppSidebar .marque, body:not(.dark-mode) #coachAppSidebar .marque { --marque-couleur: #b98a2e; background-color: #b98a2e; }
/* Les deux parties de la barre coach (15/10) : « Trading » et « Back office ». */
#coachAppSidebar .sidebar-group-title { font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: #e8b84b; padding: 10px 22px 6px; opacity: .9; }
body:not(.dark-mode) #coachAppSidebar .sidebar-group-title { color: #b98a2e; }
/* L entree « Formation » : la porte vers l autre espace, en or. */
#mainAppSidebar .formation-acces, #coachAppSidebar .formation-acces { color: #e8b84b; font-weight: 600; }
body:not(.dark-mode) #mainAppSidebar .formation-acces, body:not(.dark-mode) #coachAppSidebar .formation-acces { color: #b98a2e; }
/* Le bouton « Formation » en pastille arrondie, plus visible (Manu, 22/10).
   ⚠️ `display: flex` ici ne rouvre PAS l entrée d un élève sans droit : la règle
   `[data-droit][hidden] { display: none !important }` (formation.css) l emporte. */
#mainAppSidebar .formation-acces, #coachAppSidebar .formation-acces {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 16px auto 4px; padding: 10px 20px; border-radius: 999px; width: auto; max-width: 220px;
  border: 1px solid rgba(232, 184, 75, .55); border-left-width: 1px;
  background: linear-gradient(180deg, rgba(232, 184, 75, .18), rgba(232, 184, 75, .06));
  transition: background .3s cubic-bezier(.16,1,.3,1), border-color .3s cubic-bezier(.16,1,.3,1), transform .3s cubic-bezier(.16,1,.3,1);
}
#mainAppSidebar .formation-acces:hover, #coachAppSidebar .formation-acces:hover,
#mainAppSidebar .formation-acces:focus-visible, #coachAppSidebar .formation-acces:focus-visible {
  border-color: #e8b84b; background: linear-gradient(180deg, rgba(232, 184, 75, .28), rgba(232, 184, 75, .10)); transform: translateY(-1px);
}
#mainAppSidebar .formation-acces i, #coachAppSidebar .formation-acces i { margin-right: 0; }
body:not(.dark-mode) #mainAppSidebar .formation-acces, body:not(.dark-mode) #coachAppSidebar .formation-acces {
  border-color: rgba(185, 138, 46, .55); background: linear-gradient(180deg, rgba(185, 138, 46, .14), rgba(185, 138, 46, .04));
}
/* RÉGLAGES, tout en bas du menu (Nadir, 27/10) : Personnaliser, thème, zoom.
   Le bloc n est plus dans le haut rembourré (p-6) : il porte son propre retrait,
   aligné sur celui des entrées du menu. */
#mainAppSidebar .sidebar-reglages { margin-top: 18px; padding: 16px 20px 24px; border-top: 1px solid var(--sidebar-divider); text-align: center; }
#mainAppSidebar .sidebar-reglages-titre { font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: #e8b84b; opacity: .9; margin-bottom: 10px; }
body:not(.dark-mode) #mainAppSidebar .sidebar-reglages-titre { color: #b98a2e; }
#mainAppSidebar .sidebar-perso { width: 100%; justify-content: center; margin-top: 0; font-size: 12px; }
#mainAppSidebar .sidebar-reglages .sidebar-theme-toggle { margin-top: 10px !important; padding: 6px 0 !important; }
#mainAppSidebar .sidebar-vacation-toggle { margin-top: 10px !important; }
/* « Partager mes performances » dans le haut du menu : le bloc a déjà son propre
   rembourrage (p-6), les 20 px de l enveloppe en plus rendaient le bouton trop étroit
   pour son texte, qui ne se coupe pas (`nowrap` des boutons) et débordait du cadre.
   ⚠️ `!important` : le rembourrage est écrit en style en ligne dans index.html. */
#mainAppSidebar .share-dropdown-wrapper { padding: 0 !important; margin-top: 12px !important; }
#mainAppSidebar #shareDropdownToggle { white-space: normal; padding: 10px 12px !important; line-height: 1.25; }

/* ── 4. La coquille des cartes : fond, bordure, arrondi, ombre. RIEN DEDANS ── */
#mainApp .trader-card, body.dark-mode #mainApp .trader-card, #mainApp .metric-item, body.dark-mode #mainApp .metric-item,
#coachApp .trader-card, body.dark-mode #coachApp .trader-card, #coachApp .metric-item, body.dark-mode #coachApp .metric-item {
  background: rgba(17, 19, 24, .88) !important;
  border: 1px solid #1e2128 !important;
  border-radius: 18px !important;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px -40px rgba(0, 0, 0, .7) !important;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
body:not(.dark-mode) #mainApp .trader-card, body:not(.dark-mode) #mainApp .metric-item,
body:not(.dark-mode) #coachApp .trader-card, body:not(.dark-mode) #coachApp .metric-item {
  background: rgba(255, 255, 255, .86) !important;
  border-color: #e2dbcc !important;
  color: #17140f !important;
  box-shadow: 0 18px 40px -30px rgba(185, 138, 46, .35) !important;
}
/* ⛔ Pas de `filter: brightness` au survol : il eclaircirait les graphiques
   DANS la carte. Le lisere dore s allume, la carte se souleve, c est tout. */
#mainApp .trader-card:hover, body.dark-mode #mainApp .trader-card:hover, #mainApp .metric-item:hover, body.dark-mode #mainApp .metric-item:hover,
#coachApp .trader-card:hover, body.dark-mode #coachApp .trader-card:hover, #coachApp .metric-item:hover, body.dark-mode #coachApp .metric-item:hover {
  transform: translateY(-2px);
  filter: none;
  border-color: rgba(232, 184, 75, .35) !important;
  box-shadow: 0 0 0 1px rgba(232, 184, 75, .08), 0 20px 60px -30px rgba(232, 184, 75, .5) !important;
}
body:not(.dark-mode) #mainApp .trader-card:hover, body:not(.dark-mode) #mainApp .metric-item:hover,
body:not(.dark-mode) #coachApp .trader-card:hover, body:not(.dark-mode) #coachApp .metric-item:hover {
  border-color: #b98a2e !important;
  box-shadow: 0 0 0 1px rgba(185, 138, 46, .10), 0 18px 40px -24px rgba(185, 138, 46, .35) !important;
}
/* Le bandeau des indicateurs : un cadre invisible, les cartes respirent. */
#mainApp .traderzella-banner, body.dark-mode #mainApp .traderzella-banner, body:not(.dark-mode) #mainApp .traderzella-banner,
#coachApp .traderzella-banner, body.dark-mode #coachApp .traderzella-banner, body:not(.dark-mode) #coachApp .traderzella-banner {
  background: transparent !important; border: none !important; box-shadow: none !important;
}

/* ── 5. Les boutons : les pilules de l espace membre ──────────────────────── */
#mainApp .trader-btn, #mainApp .trader-btn-secondary, #mainApp .trader-btn-gold, #mainApp .trader-btn-blue, #mainApp .share-btn,
#coachApp .trader-btn, #coachApp .trader-btn-secondary, #coachApp .trader-btn-gold, #coachApp .trader-btn-blue, #coachApp .share-btn,
body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .modal-content :is(.trader-btn, .trader-btn-secondary, .trader-btn-gold, .trader-btn-blue) {
  border-radius: 40px !important;
}
#mainApp .trader-btn, #mainApp .trader-btn-gold, #coachApp .trader-btn, #coachApp .trader-btn-gold,
body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .modal-content :is(.trader-btn, .trader-btn-gold),
#mainApp button[onclick="validateChecklist()"], #mainApp button[onclick="resetChecklist()"] {
  background: linear-gradient(180deg, #f3d585, #e8b84b) !important;
  color: #120e07 !important; border: 1px solid transparent !important;
  box-shadow: 0 8px 30px -8px rgba(232, 184, 75, .5) !important;
}
#mainApp .trader-btn:hover, #mainApp .trader-btn-gold:hover, #coachApp .trader-btn:hover, #coachApp .trader-btn-gold:hover,
body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .modal-content :is(.trader-btn, .trader-btn-gold):hover {
  background: linear-gradient(180deg, #f6dd96, #ecbf58) !important;
  color: #120e07 !important; filter: none; transform: translateY(-1px);
  box-shadow: 0 12px 36px -8px rgba(232, 184, 75, .5) !important;
}
#mainApp .trader-btn-secondary, #mainApp .trader-btn-blue, #mainApp .share-btn,
#coachApp .trader-btn-secondary, #coachApp .trader-btn-blue, #coachApp .share-btn,
body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .modal-content :is(.trader-btn-secondary, .trader-btn-blue),
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .modal-content .trader-btn-secondary {
  background: rgba(255, 255, 255, .03) !important;
  color: var(--text) !important; border: 1px solid var(--border) !important;
  box-shadow: none !important;
}
#mainApp .trader-btn-secondary:hover, #mainApp .trader-btn-blue:hover, #mainApp .share-btn:hover,
#coachApp .trader-btn-secondary:hover, #coachApp .trader-btn-blue:hover, #coachApp .share-btn:hover,
body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .modal-content :is(.trader-btn-secondary, .trader-btn-blue):hover {
  background: rgba(232, 184, 75, .08) !important;
  color: var(--text) !important; border-color: rgba(232, 184, 75, .35) !important;
  filter: none; transform: translateY(-1px); box-shadow: none !important;
}
body:not(.dark-mode) :is(#mainApp, #coachApp) :is(.trader-btn-secondary, .trader-btn-blue, .share-btn),
body:not(.dark-mode):has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .modal-content :is(.trader-btn-secondary, .trader-btn-blue) {
  background: rgba(255, 255, 255, .7) !important;
}
body:not(.dark-mode) :is(#mainApp, #coachApp) :is(.trader-btn, .trader-btn-gold),
body:not(.dark-mode):has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .modal-content :is(.trader-btn, .trader-btn-gold) {
  background: linear-gradient(180deg, #e9c25a, #c9962f) !important; color: #17140f !important;
}
/* Les petits boutons « ghost » des fenetres (Annuler / Fermer), repris d aube.css */
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .aube-detail-modal button,
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) #replayDayModal button[onclick*="closeReplayDayModal"]:not([class*="bg-blue"]),
body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .dash-btn-ghost {
  background: rgba(255, 255, 255, .03) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important; border-radius: 40px !important;
}
body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .dash-btn-gold,
body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .csd-coach-view,
body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) #myProfile .profile-btn-gold {
  background: linear-gradient(180deg, #f3d585, #e8b84b) !important; color: #120e07 !important; border-radius: 40px !important;
}
/* Le bandeau de la coach view (#80) : bouton de sortie en pilule or. */
body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .coach-view-banner .cvb-exit {
  background: linear-gradient(180deg, #f3d585, #e8b84b); color: #120e07; border: 1px solid transparent; border-radius: 40px;
}
body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .coach-view-banner .cvb-exit:hover { background: linear-gradient(180deg, #f6dd96, #ecbf58); }

/* ── 6. Les titres de section : la typographie de l espace membre ──────────── */
#mainApp .section-header, #mainApp .section-header h1, #mainApp .section-header h2, #mainApp .section-header h3,
#coachApp .section-header, #coachApp .section-header h1, #coachApp .section-header h2, #coachApp .section-header h3 {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
  font-style: normal; letter-spacing: -.02em;
}
#mainApp .section-header h1, #mainApp .section-header h2, #coachApp .section-header h1, #coachApp .section-header h2 { font-weight: 800; color: var(--text); }
#mainApp .section-header p, #coachApp .section-header p,
#mainApp .section-header .text-gray-600, #mainApp .section-header .text-gray-500,
#coachApp .section-header .text-gray-600, #coachApp .section-header .text-gray-500 { color: var(--text-muted) !important; }

/* ── 7. Le gros chiffre : halo dore de l espace membre ───────────────────── */
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) #netPnlValue { text-shadow: 0 0 60px rgba(232, 184, 75, .45), 0 0 20px rgba(232, 184, 75, .2); }

/* ── 8. Les fenetres, listes deroulantes, toasts : surfaces opaques reprises ── */
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) :is(.modal-content, [class*="view-modal"], .aube-detail-modal, #replayDayModal > div),
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) #importCSVModal .modal-content,
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) [id*="Modal"] .modal-content,
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) :is(#alertDetailModal, #coachStudentDetailModal) {
  background: rgba(14, 15, 19, .96) !important;
  border: 1px solid rgba(232, 184, 75, .22) !important;
  border-radius: 22px !important;
  box-shadow: 0 30px 80px -30px rgba(232, 184, 75, .35), 0 20px 60px rgba(0, 0, 0, .6) !important;
}
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) :is(.view-modal-section, .modal-content .accordion-header, .modal-content .accordion-content) { background: #161a20 !important; border-color: #1e2128 !important; }
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .modal-content .accordion-header { border-radius: 12px; }
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) :is(#csvAccountList, #tradeAccountList, .share-dropdown-menu, .coach-cal-settings, .dash-cat-card, .aube-toast) {
  background: rgba(14, 15, 19, .97) !important;
  border: 1px solid rgba(232, 184, 75, .22) !important;
  border-radius: 16px !important;
}
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) :is(.modal-content h2, .modal-content h3, [class*="view-modal"] h2) { color: var(--text) !important; }
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .modal-content label { color: var(--text-muted) !important; }
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) :is(.modal-content input, .modal-content select, .modal-content textarea, #myProfile .profile-input, .coach-search-input) {
  background: #161a20 !important; color: var(--text) !important; border: 1px solid #1e2128 !important; border-radius: 12px !important;
}
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) :is(.modal-content input, .modal-content select, .modal-content textarea, .coach-search-input):focus {
  border-color: rgba(232, 184, 75, .35) !important; box-shadow: 0 0 0 3px rgba(232, 184, 75, .15) !important;
}
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) :is(.modal-content input, .modal-content textarea)::placeholder { color: #6f6e68 !important; }
/* Les cases a cocher et boutons radio, en or de l espace membre. */
:is(#mainApp, #coachApp) :is(input[type="checkbox"], input[type="radio"]),
body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .modal-content :is(input[type="checkbox"], input[type="radio"]) { accent-color: #e8b84b; }

/* ── 9. Le pied de page, le meme que l espace membre ─────────────────────── */
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .app-footer { background: #0a0a0d; border-top: 1px solid #1e2128; color: #9c9b94; }
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .app-footer::before { display: none; }
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .app-footer-links a { color: #bdbcb6; }
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .app-footer-links a:hover { color: #e8b84b; }
body.dark-mode:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .app-footer-copyright { color: #6f6e68; }
body:not(.dark-mode):has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .app-footer { background: #f6f2ea; border-top: 1px solid #e2dbcc; color: #6e685b; }
body:not(.dark-mode):has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .app-footer-links a { color: #4e483d; }
body:not(.dark-mode):has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .app-footer-links a:hover { color: #b98a2e; }

/* ── 10. Le focus, l horloge, l indicateur de navigation ─────────────────── */
:is(#mainApp, #coachApp) :focus-visible { outline: 2px solid #e8b84b; outline-offset: 3px; }
body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .aube-clock { color: #9c9b94; }
body:has(#mainApp[style*="display: flex"], #coachApp[style*="display: flex"]) .aube-nav-indicator { background: linear-gradient(180deg, #f3d585, #e8b84b); box-shadow: 0 0 12px rgba(232, 184, 75, .5); }
#coachAppSidebar a.sidebar-item { text-decoration: none; }
