/* ============================================================
   "BOURSE À L'AUBE" — couche direction artistique (dual-theme, additif).
   Chargé après tokens-aube.css, EN DERNIER dans <head>. Supersède polish.css.
   Cibles : sélecteurs réels recensés par route (.trader-card, .metric-value-*,
   .section-header, .trader-btn*, #netPnlValue). Structure V2 intacte.
   ============================================================ */

/* ---- 1. Fond multi-couches — base gradient (dual-theme) ---- */
html { background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(212,175,55,0.18) 0%, transparent 60%),
                   linear-gradient(180deg, #fbf6ec 0%, #f2ead7 100%); min-height: 100vh; }
html:has(body.dark-mode) {
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(212,175,55,0.10) 0%, transparent 55%),
              radial-gradient(ellipse at 50% 100%, #001a4d 0%, #000B25 55%, #00050f 100%);
}
body { background: transparent !important; }

/* ===== DIRECTION "fidélité mockups" : fond = IMAGE STATIQUE (pas de couches live).
   On masque les overlays live (bougies/ticker/particules) qui parasitaient l'image. ===== */
#candles-bg, #aube-ticker, #aube-particles { display: none !important; }

/* Zone de contenu transparente pour laisser voir l'image de fond posée sur #mainApp */
#mainApp .main-content, body.dark-mode #mainApp .main-content { background: transparent !important; }

/* ----- DASHBOARD (et routes authentifiées) : image executive en fond fixed + overlay navy 0.45 ----- */
#mainApp {
  background: linear-gradient(rgba(0,11,37,0.45), rgba(0,11,37,0.45)),
              url('/assets/executive-bg.png') center center / cover fixed no-repeat !important;
}
body:not(.dark-mode) #mainApp {                         /* light : overlay crème "aube claire" */
  background: linear-gradient(rgba(255,250,240,0.55), rgba(255,250,240,0.55)),
              url('/assets/executive-bg.png') center center / cover fixed no-repeat !important;
}

/* ----- LOGIN : même image en fond fixed + overlay navy léger 0.30 (l'ambiance respire) ----- */
#authScreen, .auth-container {
  background: linear-gradient(rgba(0,11,37,0.30), rgba(0,11,37,0.30)),
              url('/assets/executive-bg.png') center center / cover fixed no-repeat !important;
}

/* ----- SIDEBAR (élève) : translucide + blur, l'image transparaît, séparateur doré fin ----- */
/* Sidebar : alpha alignée EXACTEMENT sur le calendrier (.trader-card p-6) = rgba(10,15,24,0.55) + blur(4px).
   Enfants directs transparentisés (sécurité). Renfort texte en dark pour rester lisible. */
#mainAppSidebar > * { background: transparent !important; }
#mainAppSidebar, #mainApp .sidebar {
  background: rgba(10, 15, 24, 0.55) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  backdrop-filter: blur(4px) !important;
  border-right: 1px solid rgba(201, 162, 75, 0.15) !important;
}
body:not(.dark-mode) #mainAppSidebar > * { background: transparent !important; }
body:not(.dark-mode) #mainAppSidebar,
body:not(.dark-mode) #mainApp .sidebar {
  background: rgba(255, 250, 240, 0.75) !important;
}
/* Garde-fou lisibilité texte sidebar (dark) : léger text-shadow + gris remontés à 0.85 */
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 { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
body.dark-mode #mainAppSidebar .text-gray-300,
body.dark-mode #mainAppSidebar .text-gray-400 { color: rgba(255, 255, 255, 0.85) !important; }
/* Card login : resserrée pour ne JAMAIS chevaucher le bandeau bas + cadre doré (§3) + fade-in */
#authScreen .auth-card {
  animation: aubeCardEnter 480ms var(--aube-ease) both;
  min-height: auto !important;
  padding: 1.25rem 2rem !important;
  max-width: 460px !important;
  max-height: calc(100vh - 140px) !important;
  overflow-y: auto !important;
}
/* Compactage interne → contenu ~450px : les 3 boutons visibles SANS scroll (≤900px) */
#authScreen .auth-card .logo img { width: 100px !important; height: auto !important; margin: 0 auto 0.75rem !important; display: block !important; }
#authScreen .auth-card .logo { margin-bottom: 4px !important; }
#authScreen .auth-card h2 { margin: 0.5rem 0 !important; }
#authScreen .auth-card .form-group { margin-bottom: 10px !important; }
#authScreen .auth-card label { font-size: 0.72rem !important; margin-bottom: 0.25rem !important; display: block; }
#authScreen .auth-card .form-group input { padding: 0.65rem 1rem 0.65rem 42px !important; }
#authScreen .auth-card .trader-btn,
#authScreen .auth-card .trader-btn-secondary { padding: 0.65rem 1rem !important; margin: 0 0 8px !important; }
/* Centrage VERTICAL de la card login + réserve bandeau bas (card compacte ~450px → pas de chevauchement) */
#authScreen, .auth-container { align-items: center !important; justify-content: center !important; padding: 2rem 24px 180px !important; }
#authScreen .auth-card { margin: 0 !important; }
@keyframes aubeCardEnter { from { opacity: 0; transform: scale(0.97) translateY(8px); } to { opacity: 1; transform: none; } }
/* Textes Login lisibles — battent les inline (h2 color:#000B25, subtitle div color:#666) via !important */
#authScreen .auth-card h2 {
  color: #ffffff !important; font-weight: 700 !important; letter-spacing: -0.01em;
  text-shadow: 0 2px 8px rgba(201, 162, 75, 0.25);
}
#authScreen .auth-card .logo + div,
#authScreen .auth-card div[style*="666"] {
  color: rgba(201, 162, 75, 0.75) !important; font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase; font-size: 0.85rem;
}
#authScreen .auth-card label { color: rgba(255, 255, 255, 0.7) !important; font-weight: 500; }
#authScreen .auth-card, #authScreen .auth-card p { color: var(--color-champagne) !important; }
/* Light : navy lisible sur crème */
body:not(.dark-mode) #authScreen .auth-card h2 { color: #0d1116 !important; text-shadow: none; }
body:not(.dark-mode) #authScreen .auth-card .logo + div,
body:not(.dark-mode) #authScreen .auth-card div[style*="666"] { color: rgba(123, 96, 24, 0.85) !important; }
body:not(.dark-mode) #authScreen .auth-card label { color: rgba(13, 17, 22, 0.75) !important; }

/* Bouton "Se connecter" : or solide, texte navy */
#authScreen .auth-card .trader-btn {
  background: var(--aube-btn-gold) !important; color: #0a1020 !important; border: none !important; font-weight: 600;
}
#authScreen .auth-card .trader-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
/* "Créer un compte" / "Connexion Coach" : ghost dark, cadre doré fin, texte doré */
#authScreen .auth-card .trader-btn-secondary {
  background: rgba(10,15,28,0.5) !important; color: var(--color-gold) !important;
  border: 1px solid var(--aube-frame) !important;
}
#authScreen .auth-card .trader-btn-secondary:hover { border-color: var(--aube-frame-hover) !important; filter: brightness(1.08); }

/* Inputs login : fond navy translucide, icône gauche (Lucide doré), focus doré glow */
#authScreen .auth-card .form-group input,
#authScreen .auth-card .form-group select {
  background-color: rgba(10,15,28,0.6) !important; color: var(--color-champagne) !important;
  border: 1px solid var(--aube-frame) !important;
  background-repeat: no-repeat; background-position: 12px center; background-size: 18px; padding-left: 42px !important;
}
#authScreen .auth-card .form-group input[type="email"], #authScreen .auth-card .form-group input[type="text"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a24b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}
#authScreen .auth-card .form-group input[type="password"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a24b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}
#authScreen .auth-card .form-group input:focus {
  border-color: var(--aube-frame-hover) !important;
  box-shadow: 0 0 0 3px rgba(212,175,55,0.18), 0 0 14px rgba(212,175,55,0.28) !important;
  outline: none;
}
/* Toggle œil show/hide — fixé à droite, centré sur l'INPUT (wrapper .aube-pw-wrap injecté par aube.js) */
.aube-pw-wrap { position: relative; }
.aube-pw-wrap input { padding-right: 42px !important; }
.aube-eye {
  position: absolute !important; right: 12px !important; top: 50% !important;
  transform: translateY(-50%) !important;   /* !important → bat le button:hover{translateY(-1px)} global */
  background: none; border: none; cursor: pointer; color: var(--color-gold);
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; opacity: 0.85;
  transition: opacity 150ms ease, color 150ms ease !important;  /* pas de transition sur transform */
  z-index: 5;
}
.aube-eye:hover { transform: translateY(-50%) !important; opacity: 1; color: rgba(212, 175, 55, 0.95) !important; }
/* Trust badges — BANDEAU fixe plein largeur en bas de page (injecté par aube.js, hors card) */
.aube-trust {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4;
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px;
  padding: 1.5rem 2rem;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}
.aube-trust > div { text-align: center; }
.aube-trust .aube-trust-ic { color: var(--color-gold); display: inline-flex; margin-bottom: 8px; }
.aube-trust .aube-trust-ic svg { width: 32px; height: 32px; }
.aube-trust .aube-trust-t { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-gold); }
.aube-trust .aube-trust-d { font-size: 11px; line-height: 1.45; color: rgba(255,255,255,0.6); margin-top: 4px; max-width: 240px; margin-left: auto; margin-right: auto; }
/* Light : bandeau crème, texte navy */
body:not(.dark-mode) .aube-trust { background: linear-gradient(to top, rgba(245,240,230,0.85) 0%, rgba(245,240,230,0.4) 100%); }
body:not(.dark-mode) .aube-trust .aube-trust-d { color: rgba(26,18,8,0.7); }
/* Mobile : stack 1 colonne */
@media (max-width: 640px) { .aube-trust { grid-template-columns: 1fr; gap: 12px; text-align: center; } }

/* ---- 2. Typographie 3 étages ---- */
/* Titres nobles → Fraunces italic */
.section-header, .section-header h1, .section-header h2, .section-header h3 {
  font-family: 'Fraunces', Georgia, serif; font-style: italic; letter-spacing: -0.01em;
}
/* Chiffres → JetBrains Mono tabular + tracking serré */
#mainApp .metric-value-large, #mainApp .metric-value-medium, #netPnlValue, .metric-main .metric-value-large, .cell-pnl {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
  letter-spacing: -0.02em;
}

/* ---- 3. Cards "photo encadrée" — cadre doré fin + fond navy semi-transparent (fidélité mockups).
   Uniforme : .trader-card (toutes routes, dont Mes Qualités/Défauts) + .metric-item (8 KPIs head) + .auth-card.
   PAS de glass-forge multi-couches : trait fin + fond translucide, esprit cadre photo. ---- */
#mainApp .trader-card, body.dark-mode #mainApp .trader-card,
#mainApp .metric-item, body.dark-mode #mainApp .metric-item,
#authScreen .auth-card {
  background: rgba(10, 15, 24, 0.55) !important;
  border: 1px solid var(--aube-frame) !important;
  border-radius: var(--aube-frame-radius) !important;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
  transition: transform 200ms var(--aube-ease), filter 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
#mainApp .trader-card:hover, body.dark-mode #mainApp .trader-card:hover,
#mainApp .metric-item:hover, body.dark-mode #mainApp .metric-item:hover {
  transform: translateY(-1px);                  /* lift -1px */
  filter: brightness(1.08);                     /* +8% */
  border-color: var(--aube-frame-hover) !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42), 0 0 22px -8px rgba(212, 175, 55, 0.4) !important;
}
/* Light "aube claire" : cards crème + cadre doré + texte navy (pas un dark inversé brutal) */
body:not(.dark-mode) #mainApp .trader-card,
body:not(.dark-mode) #mainApp .metric-item {
  background: rgba(255, 250, 240, 0.75) !important; color: #1a1208 !important;
}
/* Sparklines KPI (injectées par aube.js) : mini-courbe sous le chiffre */
.metric-item .aube-spark { display: block; width: 100%; height: 34px; margin-top: 10px; }

/* ===== FIX 1 — wrapper head metrics (.traderzella-banner) quasi-transparent :
   laisse voir l'image de fond ENTRE et AUTOUR des 8 cards KPI (qui gardent leur fond 0.55).
   On ne touche QUE le background/box-shadow/bordure — padding/grille/spacing inchangés. ===== */
body.dark-mode #mainApp .traderzella-banner {
  background: rgba(0, 11, 37, 0.15) !important; border-color: transparent !important; box-shadow: none !important;
}
body:not(.dark-mode) #mainApp .traderzella-banner {
  background: rgba(255, 250, 240, 0.18) !important; box-shadow: none !important; border: none !important;
}

/* ---- 4. P&L hero — halo doré + respiration ambiante ---- */
body.dark-mode #netPnlValue {
  text-shadow: 0 0 60px rgba(212,175,55,0.5), 0 0 20px rgba(212,175,55,0.25);
}
#netPnlValue {
  display: inline-block;
  animation: aubeBreathe 4s ease-in-out infinite;
  transform-origin: center;
}
@keyframes aubeBreathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.005); } }

/* ---- 5. Horloge de Paris (injectée par aube.js) ---- */
.aube-clock {
  font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 12px; letter-spacing: 0.04em; color: var(--aube-text-secondary);
  opacity: 0.85; display: inline-flex; align-items: center; gap: 6px;
}
.aube-clock::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-emerald-glow); box-shadow: 0 0 6px var(--color-emerald-glow);
  animation: aubeFlicker 2s ease-in-out infinite; }

/* ---- Vie ambiante : flicker (réutilisé pour le feu du streak si présent) ---- */
@keyframes aubeFlicker { 0%,100% { opacity: 0.9; } 45% { opacity: 1; } 70% { opacity: 0.85; } }
.streak-flame, [data-streak-flame] { animation: aubeFlicker 2.2s ease-in-out infinite; }

/* ---- 6. Indicateur nav doré (barre injectée par aube.js) ---- */
.aube-nav-indicator {
  position: absolute; left: 0; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--color-aurum), var(--color-bronze));
  box-shadow: 0 0 12px rgba(212,175,55,0.6);
  transition: transform 380ms var(--aube-ease), height 380ms var(--aube-ease);
  pointer-events: none; z-index: 2;
}

/* ---- 6b. Transitions de section + arrivée des cards en séquence ---- */
#mainApp .section:not(.hidden) { animation: aubeSectionIn 240ms var(--aube-ease); }
@keyframes aubeSectionIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
#mainApp .section:not(.hidden) .trader-card { animation: aubeCardIn 420ms var(--aube-ease) both; }
@keyframes aubeCardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
#mainApp .section:not(.hidden) .trader-card:nth-child(1) { animation-delay: 0ms; }
#mainApp .section:not(.hidden) .trader-card:nth-child(2) { animation-delay: 50ms; }
#mainApp .section:not(.hidden) .trader-card:nth-child(3) { animation-delay: 100ms; }
#mainApp .section:not(.hidden) .trader-card:nth-child(4) { animation-delay: 150ms; }
#mainApp .section:not(.hidden) .trader-card:nth-child(n+5) { animation-delay: 200ms; }

/* ---- 7. Micro-interactions boutons (.trader-btn*) ---- */
.trader-btn, .trader-btn-secondary, .trader-btn-blue, .trader-btn-gold, button, .btn {
  transition: transform 200ms var(--aube-ease), filter 200ms ease;
}
.trader-btn:hover, .trader-btn-secondary:hover, .trader-btn-blue:hover, .trader-btn-gold:hover,
button:hover, .btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.trader-btn:active, button:active, .btn:active { transform: translateY(0); filter: brightness(0.95); }

/* ---- 8. Micro-célébrations (primitives — déclenchées par aube.js, cf debrief) ---- */
.aube-celebrate-top::after {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999;
  background: linear-gradient(90deg, transparent, var(--color-aurum), transparent);
  animation: aubeTopPulse 400ms var(--aube-ease) forwards; pointer-events: none;
}
@keyframes aubeTopPulse { 0% { opacity: 0; box-shadow: 0 0 0 rgba(212,175,55,0); }
  50% { opacity: 1; box-shadow: 0 6px 24px rgba(212,175,55,0.5); } 100% { opacity: 0; } }

/* ---- 9. Garde-fous globaux ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
[data-animations="off"] #candles-bg, [data-animations="off"] #aube-ticker, [data-animations="off"] #aube-particles { display: none !important; }
[data-animations="off"] *, [data-animations="off"] *::before, [data-animations="off"] *::after {
  animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important;
}

/* ============================================================
   BUNDLE 1 — micro-fixes polish (audit-polish-v2-eleve.md)
   Modales glass + hover calendrier/tables + boutons palette + coin tableau
   + Mon Pourquoi cadre or + focus généralisé. Dual-theme.
   ============================================================ */

/* ---- Fix A (1.1) — Modales : élément FOCAL, opacité haute (0.92) + blur 20 pour ISOLER du contenu derrière ---- */
body.dark-mode .modal-content,
body.dark-mode #importCSVModal .modal-content,
body.dark-mode [class*="view-modal"],
body.dark-mode [id*="Modal"] .modal-content {
  background: rgba(10, 15, 24, calc(0.92 * var(--surface-opacity-factor, 1))) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
  backdrop-filter: blur(20px) saturate(140%) !important;
  border: 1px solid rgba(201, 162, 75, 0.35) !important;
  color: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 32px -8px rgba(201, 162, 75, 0.18) !important;
}
body:not(.dark-mode) .modal-content,
body:not(.dark-mode) #importCSVModal .modal-content,
body:not(.dark-mode) [class*="view-modal"],
body:not(.dark-mode) [id*="Modal"] .modal-content {
  background: rgba(255, 250, 240, 0.95) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
  backdrop-filter: blur(20px) saturate(140%) !important;
  border: 1px solid rgba(201, 162, 75, 0.5) !important;
  color: rgba(15, 23, 42, 0.95) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15), 0 0 32px -8px rgba(201, 162, 75, 0.25) !important;
}
/* ---- Fix B — lisibilité texte dans les modales (corps + accents) ---- */
body.dark-mode .modal-content p, body.dark-mode .modal-content li,
body.dark-mode .modal-content small, body.dark-mode .modal-content span:not(.trader-btn):not([class*="badge"]) {
  color: rgba(255, 255, 255, 0.75) !important;
}
body:not(.dark-mode) .modal-content p, body:not(.dark-mode) .modal-content li,
body:not(.dark-mode) .modal-content small, body:not(.dark-mode) .modal-content span:not(.trader-btn):not([class*="badge"]) {
  color: rgba(15, 23, 42, 0.78) !important;
}
/* Titres/labels des modales lisibles sur le glass */
body.dark-mode .modal-content h1, body.dark-mode .modal-content h2, body.dark-mode .modal-content h3,
body.dark-mode .modal-content label, body.dark-mode .modal-content .view-modal-label { color: var(--color-champagne) !important; }
/* Boutons primaires de modale → or solide texte navy ; secondaires → ghost doré */
.modal-content .trader-btn { background: var(--aube-btn-gold) !important; color: #0d1116 !important; border: none !important; }
.modal-content .trader-btn-secondary { background: rgba(10,15,28,0.5) !important; color: var(--color-gold) !important; border: 1px solid var(--aube-frame) !important; }

/* ---- Fix 2 — Hover cases calendrier : tint doré translucide (préserve contraste, jamais blanc-sur-blanc) ---- */
#mainApp #calendarGrid > div:hover {
  background: rgba(212, 175, 55, 0.12) !important;
  border-radius: 8px;
}

/* ---- Fix 3 — Hover lignes de tableau : plus de gris clair + texte blanc ---- */
body.dark-mode #importCSVModal tbody tr:hover,
body.dark-mode #csvPreviewTable tbody tr:hover,
body.dark-mode #tradesTableBody tr:hover,
#mainApp #tradesTableBody tr:hover {
  background: rgba(212, 175, 55, 0.08) !important;
}

/* ---- Fix 4 — Boutons hors palette → or premium texte navy ---- */
button[onclick="validateChecklist()"] {
  background: var(--aube-btn-gold) !important; color: #0d1116 !important; border: none !important;
}
button[onclick="validateChecklist()"]:hover { filter: brightness(1.08); }
/* Boutons "Mon Pourquoi" (or) : texte navy au lieu de blanc pour lisibilité */
#mainApp #motivation button[onclick="openEditMotivationModal()"] { color: #0d1116 !important; }

/* ---- Fix 5 — Coin du tableau Journal des Trades clippé par l'arrondi ---- */
#mainApp #tradelog .trader-card > .overflow-x-auto {
  border-radius: 12px;
  overflow: hidden;
}

/* ---- Fix 7 — "Mon Pourquoi" : cadre or fin + glass (cohérence cross-routes) ---- */
#mainApp #motivation .max-w-5xl {
  background: rgba(10, 15, 24, 0.55);
  border: 1px solid var(--aube-frame);
  border-radius: var(--aube-frame-radius);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  padding: 28px;
}
body:not(.dark-mode) #mainApp #motivation .max-w-5xl { background: rgba(255, 250, 240, 0.75); color: #1a1208; }

/* ---- Fix 8 — Focus doré généralisé (le login garde son focus plus spécifique) ---- */
input:focus, textarea:focus, select:focus,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: rgba(201, 162, 75, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.18) !important;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

/* ============================================================
   BUNDLE 1.1 — Fix C (boutons harmonisés) + Fix D (Replays)
   ============================================================ */

/* ---- Fix C — Boutons secondaires (Annuler/Fermer/Retour = .trader-btn-secondary) → ghost dark/or ---- */
body.dark-mode .trader-btn-secondary {
  background: rgba(0, 11, 37, 0.4) !important;
  color: rgba(201, 162, 75, 0.95) !important;
  border: 1px solid rgba(201, 162, 75, 0.5) !important;
  font-weight: 500;
}
body:not(.dark-mode) .trader-btn-secondary {
  background: rgba(255, 250, 240, 0.6) !important;
  color: rgba(123, 96, 24, 0.95) !important;
  border: 1px solid rgba(123, 96, 24, 0.5) !important;
  font-weight: 500;
}
.trader-btn-secondary:hover { filter: brightness(1.08); }
/* "Réinitialiser" (checklist) = STRICTEMENT identique à "Valider la checklist" (or solide, texte navy) */
button[onclick="resetChecklist()"] {
  background: var(--aube-btn-gold) !important; color: #0d1116 !important; border: none !important; font-weight: 600;
}
button[onclick="resetChecklist()"]:hover { filter: brightness(1.08); }

/* ---- Fix D — Replays : titre en typo UI standard (Inter bold, plus de Fraunces italic isolée) ---- */
#replays .section-header,
#replays .section-header h1,
#replays .section-header h2,
#replays .section-header h3 {
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
  font-style: normal !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
}
/* Hover cases calendrier Replays : tint doré translucide (même fix que #calendarGrid) */
#mainApp #replayCalendarGrid > div:hover {
  background: rgba(212, 175, 55, 0.12) !important;
  border-radius: 8px;
}

/* ============================================================
   BUNDLE 1.2 — lisibilité contenu des modales
   ============================================================ */

/* ---- Fix 1 — Titres de modales : or premium bien visible (override text-gray-800) ---- */
body.dark-mode .modal-content h1, body.dark-mode .modal-content h2, body.dark-mode .modal-content h3 {
  color: rgba(212, 175, 55, 0.95) !important; font-weight: 700 !important; letter-spacing: -0.01em !important;
}
body:not(.dark-mode) .modal-content h1, body:not(.dark-mode) .modal-content h2, body:not(.dark-mode) .modal-content h3 {
  color: rgba(123, 96, 24, 0.95) !important; font-weight: 700 !important; letter-spacing: -0.01em !important;
}

/* ---- Fix 2/3 — Dropdown sélection comptes (#csvAccountList bg-white) : panel glass + items alignés + hover lisible ---- */
body.dark-mode #csvAccountList { background: rgba(10, 15, 24, 0.97) !important; border-color: rgba(201, 162, 75, 0.3) !important; }
body.dark-mode #csvAccountList .bg-gray-50 { background: rgba(255, 255, 255, 0.04) !important; }
body.dark-mode #csvAccountList label { color: rgba(255, 255, 255, 0.92) !important; }
/* Alignement checkbox + nom (Fix 3) */
#csvAccountList label,
label:has(.csv-account-checkbox), label:has(.trade-account-checkbox) {
  display: flex !important; align-items: center !important; gap: 10px !important; padding: 8px 12px !important;
}
#csvAccountList label input[type="checkbox"],
label:has(.csv-account-checkbox) input[type="checkbox"],
label:has(.trade-account-checkbox) input[type="checkbox"] { flex-shrink: 0; width: 16px; height: 16px; margin: 0 !important; }
/* Hover tint doré (Fix 2) — fini le blanc-sur-blanc */
body.dark-mode #csvAccountList label:hover,
body.dark-mode label:has(.csv-account-checkbox):hover,
body.dark-mode label:has(.trade-account-checkbox):hover { background: rgba(212, 175, 55, 0.12) !important; color: rgba(255, 255, 255, 0.95) !important; }
body:not(.dark-mode) #csvAccountList label:hover,
body:not(.dark-mode) label:has(.csv-account-checkbox):hover,
body:not(.dark-mode) label:has(.trade-account-checkbox):hover { background: rgba(212, 175, 55, 0.15) !important; color: rgba(15, 23, 42, 0.95) !important; }
/* "Tout cocher" violet → or */
#csvAccountList .text-purple-600 { color: var(--color-gold) !important; }

/* ---- Fix 4 — Modale Note Quotidienne : sections accordéon (fond blanc inline → glass dark, texte lisible) ---- */
body.dark-mode .modal-content .accordion-category { border-color: rgba(201, 162, 75, 0.2) !important; }
body.dark-mode .modal-content .accordion-header { background: rgba(10, 15, 24, 0.5) !important; color: rgba(255, 255, 255, 0.92) !important; }
body.dark-mode .modal-content .accordion-content { background: rgba(10, 15, 24, 0.6) !important; color: rgba(255, 255, 255, 0.9) !important; }
body:not(.dark-mode) .modal-content .accordion-content { background: rgba(255, 250, 240, 0.65) !important; color: rgba(15, 23, 42, 0.85) !important; }
/* (les badges verts/rouges sémantiques des sections gardent leur couleur inline) */

/* ---- Fix 5 — Case "Pas de trade aujourd'hui" : encadré harmonisé (cadre or fin + glass) ---- */
body.dark-mode #addNoteModal label:has(#noTradeToday) {
  background: rgba(10, 15, 24, 0.5) !important;
  border: 1px solid rgba(201, 162, 75, 0.25) !important;
  border-radius: 8px !important;
}
body:not(.dark-mode) #addNoteModal label:has(#noTradeToday) {
  background: rgba(255, 250, 240, 0.6) !important;
  border: 1px solid rgba(123, 96, 24, 0.3) !important;
  border-radius: 8px !important;
}

/* ============================================================
   BUNDLE 1.3 — visibilité & cohérence contenu modales / toasts
   ============================================================ */

/* ---- Fix 1 — Dropdown comptes : trigger en glass + chevron doré visible ---- */
body.dark-mode #csvAccountDropdown { background: rgba(10, 15, 24, 0.6) !important; border-color: rgba(201, 162, 75, 0.3) !important; color: rgba(255, 255, 255, 0.92) !important; }
body.dark-mode #csvAccountDropdown i, body.dark-mode #csvAccountDropdown .fa-chevron-down { color: rgba(212, 175, 55, 0.85) !important; }
body:not(.dark-mode) #csvAccountDropdown i, body:not(.dark-mode) #csvAccountDropdown .fa-chevron-down { color: rgba(123, 96, 24, 0.85) !important; }

/* ---- Fix 2 — Labels + sous-textes des modales lisibles (Frais par trade, "Si votre CSV…", etc.) ---- */
body.dark-mode .modal-content label { color: rgba(255, 255, 255, 0.92) !important; font-weight: 500; }
body.dark-mode .modal-content [class*="text-gray-"] { color: rgba(255, 255, 255, 0.65) !important; }
body:not(.dark-mode) .modal-content [class*="text-gray-"] { color: rgba(15, 23, 42, 0.6) !important; }

/* ---- Fix 3 — Case "Pas de trade aujourd'hui" : checkbox + icône + texte sur 1 ligne, alignés à gauche ---- */
#addNoteModal label:has(#noTradeToday) {
  display: flex !important; flex-direction: row !important; align-items: center !important;
  justify-content: flex-start !important; gap: 10px !important; text-align: left !important;
}
#addNoteModal label:has(#noTradeToday) > * { display: inline-flex !important; align-items: center !important; }
#addNoteModal label:has(#noTradeToday) input[type="checkbox"] { margin: 0 !important; flex-shrink: 0; }

/* ---- Fix 4 — Badges compteurs (0) Points Positifs / Erreurs : pill discret premium ---- */
#positivePointsCount, [id^="badge-positive-"] {
  background: rgba(16, 185, 129, 0.18) !important; color: rgba(52, 211, 153, 0.95) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  font-size: 0.75rem !important; font-weight: 600 !important; padding: 2px 10px !important; border-radius: 999px !important;
}
#errorsCount, [id^="badge-error-"] {
  background: rgba(239, 68, 68, 0.15) !important; color: rgba(248, 113, 113, 0.95) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  font-size: 0.75rem !important; font-weight: 600 !important; padding: 2px 10px !important; border-radius: 999px !important;
}

/* ---- Fix 5 — Modale "Définir mon Pourquoi" : labels en or visible ---- */
body.dark-mode #editMotivationModal label { color: rgba(212, 175, 55, 0.9) !important; font-weight: 600 !important; font-size: 0.95rem !important; }
body:not(.dark-mode) #editMotivationModal label { color: rgba(123, 96, 24, 0.9) !important; font-weight: 600 !important; }

/* ---- Fix 6 — Case "Afficher à chaque connexion" : glass dark + cadre or ---- */
body.dark-mode #editMotivationModal label:has(#showOnLoginInput) {
  background: rgba(10, 15, 24, 0.5) !important; border: 1px solid rgba(201, 162, 75, 0.25) !important;
  border-radius: 8px !important; padding: 12px 14px !important; display: flex !important; align-items: center !important; gap: 10px !important;
}
body:not(.dark-mode) #editMotivationModal label:has(#showOnLoginInput) {
  background: rgba(255, 250, 240, 0.6) !important; border: 1px solid rgba(123, 96, 24, 0.3) !important;
  border-radius: 8px !important; padding: 12px 14px !important; display: flex !important; align-items: center !important; gap: 10px !important;
}

/* ---- Fix 7 — Modale "Vidéos du jour" (Replays) : boutons "Regarder" bleus → or solide texte navy ---- */
#replayDayModal button[class*="bg-blue"], body.dark-mode #replayDayModal button[class*="bg-blue"] {
  background: var(--aube-btn-gold) !important; color: #0d1116 !important; border: none !important; font-weight: 600;
}

/* ---- Fix 8 — Toasts/notifications (cadre vert) → glass dark + contour or (hook .aube-toast via JS) ---- */
.aube-toast {
  background: rgba(10, 15, 24, 0.92) !important;
  border: 1px solid rgba(212, 175, 55, 0.6) !important;
  color: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px -4px rgba(212, 175, 55, 0.3) !important;
  border-radius: 10px !important;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}

/* ============================================================
   BUNDLE 1.4 — checkbox or + Annuler ghost + login (centrage/autofill/titre/labels)
   ============================================================ */

/* ---- Fix 2 — Checkboxes/radios des modales en or (accent-color) ---- */
body.dark-mode .modal-content input[type="checkbox"],
body.dark-mode .modal-content input[type="radio"],
body.dark-mode #editMotivationModal input[type="checkbox"] {
  accent-color: #d4af37 !important; width: 18px; height: 18px; cursor: pointer;
}
body:not(.dark-mode) .modal-content input[type="checkbox"],
body:not(.dark-mode) .modal-content input[type="radio"] { accent-color: #7b6018 !important; }

/* ---- Fix 3 — Boutons "Annuler"/fermer custom (text-white, hors .trader-btn-secondary) → ghost or ---- */
body.dark-mode .modal-content button[onclick*="closeModal"]:not(.trader-btn-secondary):not(.trader-btn) {
  background: rgba(0, 11, 37, 0.4) !important; color: rgba(201, 162, 75, 0.95) !important;
  border: 1px solid rgba(201, 162, 75, 0.5) !important; font-weight: 500;
}
body:not(.dark-mode) .modal-content button[onclick*="closeModal"]:not(.trader-btn-secondary):not(.trader-btn) {
  background: rgba(255, 250, 240, 0.6) !important; color: rgba(123, 96, 24, 0.95) !important;
  border: 1px solid rgba(123, 96, 24, 0.5) !important;
}
/* Bouton submit (Enregistrer) des modales → or solide texte navy */
body.dark-mode #editMotivationModal button[type="submit"] {
  background: var(--aube-btn-gold) !important; color: #0d1116 !important; border: none !important; font-weight: 600;
}

/* ---- Fix 5 — Inputs Login : fond blanc + texte navy lisible + fix autofill WebKit ---- */
#authScreen .auth-card .form-group input[type="email"],
#authScreen .auth-card .form-group input[type="password"],
#authScreen .auth-card .form-group input[type="text"] {
  background-color: rgba(255, 255, 255, 0.92) !important; color: rgba(15, 23, 42, 0.95) !important;
}
#authScreen input:-webkit-autofill,
#authScreen input:-webkit-autofill:hover,
#authScreen input:-webkit-autofill:focus,
#authScreen input:-webkit-autofill:active {
  -webkit-text-fill-color: rgba(15, 23, 42, 0.95) !important;
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.92) inset !important;
  caret-color: rgba(15, 23, 42, 0.95) !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* ---- Fix 6 — Titre "CONNEXION" : or saturé + glow + présence forte ---- */
body.dark-mode #authScreen .auth-card h2 {
  font-size: 2.25rem !important; font-weight: 700 !important; letter-spacing: 0.05em !important;
  color: rgba(212, 175, 55, 1) !important; text-transform: uppercase !important; margin: 0.5rem 0 1rem !important;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.4), 0 0 40px rgba(212, 175, 55, 0.25), 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}
body:not(.dark-mode) #authScreen .auth-card h2 {
  font-size: 2.25rem !important; font-weight: 700 !important; letter-spacing: 0.05em !important;
  color: rgba(123, 96, 24, 1) !important; text-transform: uppercase !important; margin: 0.5rem 0 1rem !important;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}
/* Léger glow doré sur "Se connecter" (cohérence avec le titre) */
#authScreen .auth-card .trader-btn { box-shadow: 0 4px 16px rgba(212, 175, 55, 0.25) !important; }

/* ---- Fix 7 — Labels "EMAIL" / "MOT DE PASSE" : or champagne CAPS, visibles ---- */
body.dark-mode #authScreen .auth-card label {
  color: rgba(212, 175, 55, 0.85) !important; font-weight: 600 !important; font-size: 0.8rem !important;
  letter-spacing: 0.08em !important; text-transform: uppercase !important; margin-bottom: 0.4rem !important; display: block !important;
}
body:not(.dark-mode) #authScreen .auth-card label {
  color: rgba(123, 96, 24, 0.95) !important; font-weight: 600 !important; text-transform: uppercase !important;
}

/* ============================================================
   BUNDLE 1.5 — hover KPI glass dense + hover boutons actions + états vides
   ============================================================ */

/* ---- Fix 1 — Hover head metric cards : reste GLASS (plus dense), plus de bleu plein #152843 ---- */
body.dark-mode #mainApp .metric-item:hover {
  background: rgba(5, 10, 20, 0.80) !important;
  -webkit-backdrop-filter: blur(6px) saturate(140%) !important;
  backdrop-filter: blur(6px) saturate(140%) !important;
  border-color: rgba(201, 162, 75, 0.55) !important;
}
body:not(.dark-mode) #mainApp .metric-item:hover {
  background: rgba(245, 235, 215, 0.85) !important;
  -webkit-backdrop-filter: blur(6px) saturate(140%) !important;
  backdrop-filter: blur(6px) saturate(140%) !important;
  border-color: rgba(123, 96, 24, 0.6) !important;
}

/* ---- Fix 2 — Boutons d'action (.action-btn : Voir/Modifier/Supprimer) : hover sans fond blanc, lift + glow ---- */
body.dark-mode #tradesTableBody .action-btn:hover,
body.dark-mode #journalEntries .action-btn:hover,
body.dark-mode #mainApp .action-btn:hover {
  background: transparent !important;
  transform: translateY(-1px) !important;
  filter: brightness(1.15) !important;
  box-shadow: none !important;
}
body.dark-mode #mainApp .action-btn:hover i,
body.dark-mode #mainApp .action-btn:hover svg {
  filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.5));
}
/* Le bouton Supprimer garde sa sémantique rouge (un peu adoucie) */
body.dark-mode #mainApp .btn-delete, body.dark-mode #mainApp .btn-delete:hover { background: rgba(239, 68, 68, 0.85) !important; }

/* ---- Fix 3 — État vide "Aucun frais enregistré" (+ autres) : glass + cadre or, texte lisible ---- */
body.dark-mode #dailyFeesTable > p,
body.dark-mode #dailyFeesTable .text-gray-500 {
  background: rgba(10, 15, 24, 0.55) !important; border: 1px solid rgba(201, 162, 75, 0.25) !important;
  border-radius: 8px !important; color: rgba(255, 255, 255, 0.7) !important; padding: 16px !important; text-align: center;
}
body:not(.dark-mode) #dailyFeesTable > p,
body:not(.dark-mode) #dailyFeesTable .text-gray-500 {
  background: rgba(255, 250, 240, 0.6) !important; border: 1px solid rgba(123, 96, 24, 0.3) !important;
  border-radius: 8px !important; color: rgba(15, 23, 42, 0.7) !important; padding: 16px !important; text-align: center;
}
/* Autres états vides (Aucun trade / Aucune note) : texte lisible (pas en box pour ne pas casser les tables) */
body.dark-mode #tradesTableBody .text-gray-500,
body.dark-mode #journalEntries .text-gray-500,
body.dark-mode #replaysList .text-gray-500 { color: rgba(255, 255, 255, 0.6) !important; }

/* ============================================================
   BUNDLE 1.6 — hover boutons actions + modales Détails + tooltips
   ============================================================ */

/* ---- Fix 1 — Boutons action Trades/Journal : les vrais sont en Tailwind hover:bg-gray-50/blue-50/red-50
   (PAS .action-btn → d'où l'échec 1.5). On reprend le pattern Compta (text-gray-700 hover:text-gray-900,
   SANS fond) : hover transparent + lift + glow doré. ---- */
#tradesTableBody button:hover, #journalEntries button:hover {
  background: transparent !important;
  transform: translateY(-1px) !important;
  box-shadow: none !important;
}
body.dark-mode #tradesTableBody button:hover i, body.dark-mode #tradesTableBody button:hover svg,
body.dark-mode #journalEntries button:hover i, body.dark-mode #journalEntries button:hover svg {
  filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.5));
}

/* ---- Fix 2 — Modales "Détails Compte/Payout" (classes .view-modal-* — échappaient à .modal-content) :
   glass dark + barres latérales UNIFORMÉMENT dorées (au lieu de multicolores). ---- */
body.dark-mode .view-modal-content {
  background: rgba(10, 15, 24, 0.92) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important; backdrop-filter: blur(20px) saturate(140%) !important;
  border: 1px solid rgba(201, 162, 75, 0.35) !important; color: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 32px -8px rgba(201, 162, 75, 0.18) !important;
}
body.dark-mode .view-modal-section {
  background: rgba(10, 15, 24, 0.55) !important;
  border: 1px solid rgba(201, 162, 75, 0.2) !important;
  border-left: 3px solid rgba(201, 162, 75, 0.6) !important;   /* barre dorée uniforme (cohérence) */
  border-radius: 6px !important; color: rgba(255, 255, 255, 0.95) !important;
}
body.dark-mode .view-modal-label { color: rgba(212, 175, 55, 0.85) !important; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75rem; }
body.dark-mode .view-modal-value { color: rgba(255, 255, 255, 0.95) !important; font-weight: 600; }
/* Light : crème + barre or */
body:not(.dark-mode) .view-modal-content { background: rgba(255, 250, 240, 0.95) !important; border: 1px solid rgba(201, 162, 75, 0.5) !important; color: rgba(15, 23, 42, 0.95) !important; }
body:not(.dark-mode) .view-modal-section { background: rgba(255, 250, 240, 0.7) !important; border: 1px solid rgba(123, 96, 24, 0.25) !important; border-left: 3px solid rgba(123, 96, 24, 0.6) !important; }
body:not(.dark-mode) .view-modal-label { color: rgba(123, 96, 24, 0.95) !important; }

/* ---- Fix 3 — Tooltips info : casse normale (uppercase hérité) + glass dark cohérent, lisible ---- */
body.dark-mode .tooltip, body.dark-mode [role="tooltip"], body.dark-mode [class*="tooltip"], body.dark-mode .info-tooltip {
  background: rgba(5, 10, 20, 0.96) !important;
  -webkit-backdrop-filter: blur(8px) saturate(140%) !important; backdrop-filter: blur(8px) saturate(140%) !important;
  border: 1px solid rgba(201, 162, 75, 0.45) !important; color: rgba(255, 255, 255, 0.95) !important;
  border-radius: 8px !important; padding: 10px 14px !important; font-size: 0.85rem !important; line-height: 1.5 !important;
  font-weight: 400 !important; text-transform: none !important; letter-spacing: normal !important; max-width: 280px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}
body.dark-mode .tooltip *, body.dark-mode [role="tooltip"] *, body.dark-mode [class*="tooltip"] * { text-transform: none !important; }
body:not(.dark-mode) .tooltip, body:not(.dark-mode) [role="tooltip"], body:not(.dark-mode) [class*="tooltip"] {
  background: rgba(255, 250, 240, 0.96) !important; border: 1px solid rgba(123, 96, 24, 0.5) !important;
  color: rgba(15, 23, 42, 0.95) !important; text-transform: none !important;
}

/* ============================================================
   BUNDLE 1.7 — modales Détails Payout/Compte Acheté (générées en JS INLINE, sans classe →
   hook .aube-detail-modal ajouté en JS). Override des styles inline via [style*=…] + !important.
   ============================================================ */

/* DARK — carte interne (inline background:white) → glass dark */
body.dark-mode .aube-detail-modal > div {
  background: rgba(10, 15, 24, calc(0.92 * var(--surface-opacity-factor, 1))) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important; backdrop-filter: blur(20px) saturate(140%) !important;
  border: 1px solid rgba(201, 162, 75, 0.35) !important; color: rgba(255, 255, 255, 0.95) !important;
  border-radius: 12px !important; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 32px -8px rgba(201, 162, 75, 0.18) !important;
}
/* Sections de champ (inline background:#f9fafb + border-left coloré) → glass + barre dorée uniforme */
body.dark-mode .aube-detail-modal [style*="border-left"] {
  background: rgba(20, 25, 40, 0.6) !important;
  border: 1px solid rgba(201, 162, 75, 0.18) !important;
  border-left: 3px solid rgba(201, 162, 75, 0.6) !important;
}
/* Labels (inline color:#6b7280) → or CAPS ; titre + valeurs (inline color:#1f2937) → clair */
body.dark-mode .aube-detail-modal [style*="6b7280"] { color: rgba(212, 175, 55, 0.95) !important; }
body.dark-mode .aube-detail-modal [style*="1f2937"] { color: rgba(255, 255, 255, 0.95) !important; }
/* Bouton Fermer → ghost or */
body.dark-mode .aube-detail-modal button {
  background: rgba(0, 11, 37, 0.4) !important; color: rgba(201, 162, 75, 0.95) !important;
  border: 1px solid rgba(201, 162, 75, 0.5) !important; font-weight: 500;
}

/* LIGHT — crème + barres dorées (on GARDE le texte inline foncé, lisible sur crème) */
body:not(.dark-mode) .aube-detail-modal > div {
  background: rgba(255, 250, 240, 0.96) !important; border: 1px solid rgba(201, 162, 75, 0.5) !important;
  border-radius: 12px !important;
}
body:not(.dark-mode) .aube-detail-modal [style*="border-left"] {
  background: rgba(255, 250, 240, 0.7) !important; border-left: 3px solid rgba(123, 96, 24, 0.6) !important;
}
body:not(.dark-mode) .aube-detail-modal [style*="6b7280"] { color: rgba(123, 96, 24, 0.95) !important; }

/* ============================================================
   HOTFIX — Calendrier Dashboard : couleurs sémantiques selon P&L
   Le JS pose déjà .bg-green-100 (gain) / .bg-red-200 (perte) sur chaque case.
   On les retape en rgba vert/rouge léger, identiques aux "Trades récents"
   (rgba(16,185,129,0.12) / rgba(239,68,68,0.12) + border 0.25). Option A : pas de JS.
   Cascade : hover doré Bundle 1.3 (#mainApp #calendarGrid > div:hover, 2 IDs) reste prioritaire
   → vert/rouge au repos, doré au survol. Les pills $ passent en vivid #10b981/#ef4444
   en dark (sinon text-green-800/red-900 illisible sur fond rgba 0.12).
   ============================================================ */
body.dark-mode #calendarGrid > div.bg-green-100 {
  background-color: rgba(16, 185, 129, 0.25) !important;
  border: 1px solid rgba(16, 185, 129, 0.55) !important;
}
body.dark-mode #calendarGrid > div.bg-red-200 {
  background-color: rgba(239, 68, 68, 0.25) !important;
  border: 1px solid rgba(239, 68, 68, 0.55) !important;
}
body.dark-mode #calendarGrid > div.bg-green-100 .font-bold.text-xl { color: #10b981 !important; }
body.dark-mode #calendarGrid > div.bg-red-200   .font-bold.text-xl { color: #ef4444 !important; }

body:not(.dark-mode) #calendarGrid > div.bg-green-100 {
  background-color: rgba(16, 185, 129, 0.20) !important;
  border: 1px solid rgba(16, 185, 129, 0.50) !important;
}
body:not(.dark-mode) #calendarGrid > div.bg-red-200 {
  background-color: rgba(239, 68, 68, 0.20) !important;
  border: 1px solid rgba(239, 68, 68, 0.50) !important;
}
body:not(.dark-mode) #calendarGrid > div.bg-green-100 .font-bold.text-xl { color: #047857 !important; }
body:not(.dark-mode) #calendarGrid > div.bg-red-200   .font-bold.text-xl { color: #b91c1c !important; }

/* ============================================================
   HOTFIX — Popover "Affichage du calendrier" (#calendarSettings)
   Bug : .bg-white sur le popover + hover:bg-gray-50 sur chaque <label>
   → fond quasi-blanc au survol, texte blanc invisible en dark mode.
   Fix : glass dark/or sur le container + tint doré subtil au hover (langage Bundle 1.3).
   Spécificité (0,1,3,2) >> Tailwind utility (0,0,2,0), aucun risque de régression.
   ============================================================ */
body.dark-mode #calendarSettings {
  background: rgba(10, 15, 24, 0.92) !important;
  -webkit-backdrop-filter: blur(12px) saturate(140%) !important;
  backdrop-filter: blur(12px) saturate(140%) !important;
  border: 1px solid var(--aube-frame) !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important;
  color: var(--color-champagne) !important;
}
body.dark-mode #calendarSettings h4 { color: var(--color-gold) !important; }
body.dark-mode #calendarSettings label,
body.dark-mode #calendarSettings span { color: rgba(244, 228, 193, 0.95) !important; }
body.dark-mode #calendarSettings label:hover,
body.dark-mode #calendarSettings label:hover * {
  background: rgba(212, 175, 55, 0.12) !important;
  color: rgba(244, 228, 193, 0.98) !important;
}
body.dark-mode #calendarSettings input[type="checkbox"] { accent-color: var(--color-gold) !important; }

body:not(.dark-mode) #calendarSettings {
  background: rgba(255, 250, 240, 0.96) !important;
  border: 1px solid rgba(123, 96, 24, 0.45) !important;
  border-radius: 10px !important;
  color: #1a1208 !important;
}
body:not(.dark-mode) #calendarSettings label:hover,
body:not(.dark-mode) #calendarSettings label:hover * {
  background: rgba(212, 175, 55, 0.18) !important;
  color: #1a1208 !important;
}
body:not(.dark-mode) #calendarSettings input[type="checkbox"] { accent-color: #b08418 !important; }

/* ============================================================
   HOTFIX — Trio : Type Long/Short + #tradeAccountList container
   ============================================================ */

/* --- 1. Journal des Trades — Type en BLANC uniforme (pas de double-codage avec le P&L) ---
   Type cell = #tradesTableBody td:nth-child(5) > span (col 5 du thead : Date|Heure|Compte|Symbole|TYPE|...)
   La couleur green/red est sur le <span> uniquement → Points (col 9) et P&L (col 10) restent intacts
   (leur green/red est posé sur le <td>, pas sur un span). */
body.dark-mode #tradesTableBody td:nth-child(5) span {
  color: rgba(255, 255, 255, 0.92) !important;
  font-weight: 600 !important;
}
body:not(.dark-mode) #tradesTableBody td:nth-child(5) span {
  color: rgba(15, 23, 42, 0.92) !important;
  font-weight: 600 !important;
}

/* --- 2. #tradeAccountList — compléter le pendant manquant du fix Bundle 1.2 (#csvAccountList) ---
   Le hover via label:has(.trade-account-checkbox) existait (L446) mais le container .bg-white
   n'avait jamais reçu d'override dark mode → panel quasi-blanc à l'ouverture du dropdown.
   Même langage que #csvAccountList (Bundle 1.2 L433-452). */
body.dark-mode #tradeAccountList {
  background: rgba(10, 15, 24, 0.97) !important;
  border-color: rgba(201, 162, 75, 0.3) !important;
}
body.dark-mode #tradeAccountList .bg-gray-50 { background: rgba(255, 255, 255, 0.04) !important; }
body.dark-mode #tradeAccountList label { color: rgba(255, 255, 255, 0.92) !important; }
body.dark-mode #tradeAccountList label:hover {
  background: rgba(212, 175, 55, 0.12) !important;
  color: rgba(255, 255, 255, 0.95) !important;
}
body:not(.dark-mode) #tradeAccountList {
  background: rgba(255, 250, 240, 0.96) !important;
  border-color: rgba(123, 96, 24, 0.4) !important;
}
body:not(.dark-mode) #tradeAccountList label:hover {
  background: rgba(212, 175, 55, 0.15) !important;
  color: rgba(15, 23, 42, 0.95) !important;
}
/* "Tout cocher" violet → or (cohérence csvAccountList) */
#tradeAccountList .text-purple-600 { color: var(--color-gold) !important; }

/* ============================================================
   HOTFIX TRIO — modal Détails Trade compact + Replay Fermer + tooltip z/casse
   ============================================================ */

/* --- 1. #viewTradeModal — densité visuelle allégée (style "Note du...") ---
   Même markup que #viewJournalModal (.view-modal-section + label + value), mais 13 sections
   au lieu de 3-5 → la barre or 3px gauche par section sature visuellement.
   On scope un override JUSTE sur #viewTradeModal pour casser cette barre + adoucir le cadre.
   Détails Payout/Compte gardent leur version L677 inchangée (peu de sections, barre OK). */
body.dark-mode #viewTradeModal .view-modal-section {
  background: rgba(10, 15, 24, 0.40) !important;
  border: 1px solid rgba(201, 162, 75, 0.14) !important;
  border-left: 1px solid rgba(201, 162, 75, 0.14) !important; /* annule la barre 3px */
  border-radius: 8px !important;
  padding: 10px 14px !important;
  margin-bottom: 8px !important;
}
body:not(.dark-mode) #viewTradeModal .view-modal-section {
  background: rgba(255, 250, 240, 0.55) !important;
  border: 1px solid rgba(123, 96, 24, 0.18) !important;
  border-left: 1px solid rgba(123, 96, 24, 0.18) !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  margin-bottom: 8px !important;
}
/* Pill Long/Short → blanc uniforme (cohérence colonne TYPE du tableau, FIX1 commit précédent) */
body.dark-mode #viewTradeModal .bg-green-100,
body.dark-mode #viewTradeModal .bg-red-100 {
  background: transparent !important;
  color: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(201, 162, 75, 0.25) !important;
}
body.dark-mode #viewTradeModal .text-green-800,
body.dark-mode #viewTradeModal .text-red-800 { color: rgba(255, 255, 255, 0.92) !important; }
body:not(.dark-mode) #viewTradeModal .bg-green-100,
body:not(.dark-mode) #viewTradeModal .bg-red-100 {
  background: transparent !important;
  color: rgba(15, 23, 42, 0.92) !important;
  border: 1px solid rgba(123, 96, 24, 0.3) !important;
}
body:not(.dark-mode) #viewTradeModal .text-green-800,
body:not(.dark-mode) #viewTradeModal .text-red-800 { color: rgba(15, 23, 42, 0.92) !important; }
/* Bouton × (.view-modal-close) en or champagne (au lieu du gris #aaa par défaut) */
body.dark-mode .view-modal-close { color: rgba(212, 175, 55, 0.75) !important; }
body.dark-mode .view-modal-close:hover { color: rgba(244, 228, 193, 1) !important; }
body:not(.dark-mode) .view-modal-close { color: rgba(123, 96, 24, 0.75) !important; }
body:not(.dark-mode) .view-modal-close:hover { color: rgba(123, 96, 24, 1) !important; }

/* --- 2. #replayDayModal — container glass dark + bouton Fermer ghost or ---
   Modale 100% Tailwind inline (bg-white, border-gray-300, hover:bg-gray-50) jamais traitée
   en dark sauf les boutons bg-blue "Regarder" (Bundle 1.7 L522). Pendant manquant. */
body.dark-mode #replayDayModal > div.bg-white,
body.dark-mode #replayEditModal > div.bg-white,
body.dark-mode #replayBrowseModal > div.bg-white {
  background: rgba(10, 15, 24, calc(0.92 * var(--surface-opacity-factor, 1))) !important;
  border: 1px solid rgba(201, 162, 75, 0.35) !important;
  color: rgba(255, 255, 255, 0.95) !important;
}
body.dark-mode #replayDayModal h2 { color: rgba(244, 228, 193, 0.95) !important; }
body.dark-mode #replayDayModal button.text-gray-400 { color: rgba(212, 175, 55, 0.75) !important; }
body.dark-mode #replayDayModal button.text-gray-400:hover { color: rgba(244, 228, 193, 1) !important; }
/* Bouton "Fermer" footer (ghost or, cohérent .trader-btn-secondary Bundle 1.1) */
body.dark-mode #replayDayModal button[onclick*="closeReplayDayModal"]:not([class*="bg-blue"]) {
  background: rgba(0, 11, 37, 0.4) !important;
  color: rgba(201, 162, 75, 0.95) !important;
  border: 1px solid rgba(201, 162, 75, 0.5) !important;
  font-weight: 500 !important;
}
body.dark-mode #replayDayModal button[onclick*="closeReplayDayModal"]:not([class*="bg-blue"]):hover {
  background: rgba(0, 11, 37, 0.55) !important;
  filter: brightness(1.08);
}
body:not(.dark-mode) #replayDayModal button[onclick*="closeReplayDayModal"]:not([class*="bg-blue"]) {
  background: rgba(255, 250, 240, 0.6) !important;
  color: rgba(123, 96, 24, 0.95) !important;
  border: 1px solid rgba(123, 96, 24, 0.5) !important;
}

/* --- 3. Tooltip ⓘ — z-index hors stacking context + casse normale (dual-theme) ---
   .metric-item:hover applique transform → crée un stacking context → .tooltip z-index:1000
   devient local et peut être couvert par cards adjacentes. z-index: 9999 + isolation auto.
   Bundle 1.6 L699 ne couvrait que dark-mode → on étend en light aussi (defensive). */
.tooltip,
[role="tooltip"],
[class*="tooltip"]:not(.calendar-day-with-tooltip) {
  z-index: 9999 !important;
}
.tooltip, .tooltip *,
[role="tooltip"], [role="tooltip"] *,
.info-icon .tooltip, .info-icon .tooltip * {
  text-transform: none !important;
  letter-spacing: normal !important;
  font-variant: normal !important;
}

/* ============================================================
   Dashboard personnalisable (#27) — mode édition & catalogue
   Langage "Bourse à l'Aube" : cadre or pointillé, handles dorés, boutons ghost/gold.
   ============================================================ */

/* Barre d'outils (bouton Personnaliser / actions édition) */
.dash-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.dash-toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-edit-tag {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-gold, #d4af37);
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(212,175,55,0.45); background: rgba(212,175,55,0.08);
}
.dash-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 10px;
  cursor: pointer; transition: filter 150ms ease, border-color 150ms ease, background 150ms ease;
}
.dash-btn-ghost {
  background: rgba(10,15,28,0.5); color: var(--color-gold, #d4af37);
  border: 1px solid rgba(212,175,55,0.45);
}
.dash-btn-ghost:hover { border-color: rgba(212,175,55,0.85); filter: brightness(1.08); }
.dash-btn-gold {
  background: var(--aube-btn-gold, linear-gradient(135deg,#e8c66a,#d4af37));
  color: #0a1020; border: none;
}
.dash-btn-gold:hover { filter: brightness(1.06); }
body:not(.dark-mode) .dash-btn-ghost { background: rgba(255,255,255,0.6); color: #7b6018; border-color: rgba(123,96,24,0.4); }

/* Blocs draggables en mode édition : cadre or pointillé + léger fond teinté */
#dashboard.dash-edit [data-block-id] {
  outline: 2px dashed rgba(212,175,55,0.6); outline-offset: 3px;
  border-radius: 12px; transition: outline-color 150ms ease;
}
#dashboard.dash-edit [data-block-id]:hover { outline-color: rgba(212,175,55,0.95); }
#dashboard.dash-edit .traderzella-banner { outline-color: transparent; } /* le conteneur KPI lui-même non souligné, ses cards le sont */
/* #33 commit 3 — même traitement d'édition pour le dashboard coach */
#coachDashboard.dash-edit [data-block-id] {
  outline: 2px dashed rgba(212,175,55,0.6); outline-offset: 3px;
  border-radius: 12px; transition: outline-color 150ms ease;
}
#coachDashboard.dash-edit [data-block-id]:hover { outline-color: rgba(212,175,55,0.95); }
#coachDashboard.dash-edit .coach-kpi-5 { outline-color: transparent; }

/* Handle de drag (✏️/grip) — haut gauche */
.dash-handle {
  position: absolute; top: 6px; left: 6px; z-index: 30;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  color: var(--color-gold, #d4af37); cursor: grab;
  background: rgba(10,15,28,0.78); border: 1px solid rgba(212,175,55,0.5); border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.dash-handle:active { cursor: grabbing; }
body:not(.dark-mode) .dash-handle { background: rgba(255,255,255,0.92); }

/* Bouton × masquer (KPI + Score) — haut droite */
.dash-remove {
  position: absolute; top: 6px; right: 6px; z-index: 30;
  width: 24px; height: 24px; line-height: 1; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: #ef4444; cursor: pointer;
  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.4); border-radius: 999px;
  transition: background 150ms ease, box-shadow 150ms ease;
}
.dash-remove:hover { background: rgba(239,68,68,0.22); box-shadow: 0 0 0 4px rgba(239,68,68,0.12); }

/* Placeholder fantôme pendant le drag */
.dash-ghost { opacity: 0.45; outline: 2px dashed rgba(212,175,55,0.9) !important; }

/* Catalogue (modale glass dark) */
.dash-cat-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0,0,0,0.55);
}
.dash-cat-overlay.hidden { display: none; }
.dash-cat-card {
  width: 100%; max-width: 420px; border-radius: 16px; padding: 22px;
  background: rgba(10,15,24,0.94); backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(212,175,55,0.4); box-shadow: 0 18px 50px rgba(0,0,0,0.5);
  color: rgba(244,228,193,0.92);
}
.dash-cat-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; color: var(--color-gold, #d4af37); }
.dash-cat-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.dash-cat-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border-radius: 9px; cursor: pointer; font-size: 14px;
  transition: background 150ms ease;
}
.dash-cat-row:hover { background: rgba(212,175,55,0.12); }
.dash-cat-row input { width: 17px; height: 17px; accent-color: var(--color-gold, #d4af37); cursor: pointer; }
.dash-cat-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
body:not(.dark-mode) .dash-cat-card { background: rgba(252,250,245,0.97); color: #0d1116; }

/* Reduced-motion : pas de transition sur les blocs draggables */
@media (prefers-reduced-motion: reduce) {
  #dashboard.dash-edit [data-block-id], #coachDashboard.dash-edit [data-block-id], .dash-btn, .dash-remove, .dash-cat-row { transition: none !important; }
}

/* ============================================================
   #53 — Curseur opacité modales (sidebar, dark mode) — thumb or
   ============================================================ */
.surface-opacity-control { display: flex; flex-direction: column; gap: 6px; }
.sidebar-control-label { display: flex; align-items: center; gap: 6px; }
.surface-opacity-slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
  background: rgba(255, 255, 255, 0.15); border-radius: 2px; outline: none;
}
.surface-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px;
  background: var(--accent, #ac862b); border-radius: 50%; cursor: pointer;
}
.surface-opacity-slider::-moz-range-thumb {
  width: 16px; height: 16px; background: var(--accent, #ac862b);
  border-radius: 50%; cursor: pointer; border: none;
}

/* ============================================================
   #53 — Facteur d'opacité des surfaces glass-dark (slider sidebar, DARK only).
   base × var(--surface-opacity-factor) → préserve l'écart cartes(0.55)/modales(0.92)
   au défaut (facteur 1). Light mode NON affecté (sélecteurs body.dark-mode uniquement).
   ============================================================ */
body.dark-mode #mainApp .trader-card,
body.dark-mode #mainApp .metric-item {
  background: rgba(10, 15, 24, calc(0.55 * var(--surface-opacity-factor, 1))) !important;
}

/* ============================================================
   #56 — Harmonisation glass-dark des intérieurs (dark only, light intact)
   ============================================================ */

/* Zone 3 — carte "Mon Pourquoi" : blanc → glass + texte clair (bordure or inline conservée) */
body.dark-mode .pourquoi-glass-card {
  background: rgba(10, 15, 24, calc(0.55 * var(--surface-opacity-factor, 1))) !important;
}
body.dark-mode .pourquoi-glass-card #motivationDisplayText,
body.dark-mode .pourquoi-glass-card .text-gray-700,
body.dark-mode .pourquoi-glass-card .text-gray-800 { color: rgba(255, 255, 255, 0.92) !important; }
body.dark-mode .pourquoi-glass-card .border-t-2 { border-color: rgba(201, 162, 75, 0.2) !important; }

/* Zones 1/5/6 (Journal trades, Comptes, Payouts) : tables internes harmonisées via les règles
   GLOBALES body.dark-mode table/thead/tbody (index.html : glass + séparateurs or + facteur d'opacité).
   Pas de règle spécifique ici → uniformité garantie (et pas d'override plus spécifique qui jurerait). */

/* ============================================================
   #61 — Garantit JetBrains Mono + chiffres tabulaires sur TOUS les metric-value
   (header KPI + cards Semaines + Mois). !important + sélecteurs ciblés pour battre
   tout résidu (reset font-feature, Tailwind, etc.). Cohérent avec .cell-pnl (calendrier).
   ============================================================ */
#mainApp .metric-value-large,
#mainApp .metric-value-medium,
.weekly-stats-banner .metric-value-medium,
.weekly-stats-banner .metric-value-large,
.monthly-stats-banner .metric-value-medium,
.monthly-stats-banner .metric-value-large {
  font-family: 'JetBrains Mono', ui-monospace, monospace !important;
  font-feature-settings: "tnum" 1 !important;
  font-variant-numeric: tabular-nums !important;
}

/* ============================================================================
   #33 COMMIT 1 — Palette "Bourse à l'Aube" appliquée au MODE COACH (#coachApp).
   Les sections coach utilisent DÉJÀ les mêmes classes que l'élève (.trader-card,
   .metric-item, .traderzella-banner, .sidebar, .main-content, .section) ; seul le
   scope #mainApp les privait du traitement. Ce bloc réplique les mêmes valeurs pour
   #coachApp. 100% additif, #mainApp (élève) strictement intact.
   ============================================================================ */

/* #33 Commit 2b-viii — Modale drill-down alertes "Points à surveiller" : garantir qu'elle
   peint AU-DESSUS de tout le contexte coach. La base .view-modal est à z-index:1000 ;
   l'overlay du customizer (.dash-cat-overlay) est à 10000 et une particule décorative
   (aube.js) à 9999. On remonte la modale à 10001 (défensif, scopé, sans effet sur les
   autres modales). Le diagnostic runtime (topElAtCenter) confirmera si c'était bien ça. */
/* 2b-x + commit 4 — modales ouvertes en contexte coach : z-index au-dessus du customizer (10000)
   + retrait du backdrop-filter (bug de compositing Chrome avec background-attachment:fixed →
   "visible seulement avec DevTools"). Voile navy plus opaque pour compenser le blur perdu. */
#alertDetailModal, #coachStudentDetailModal { z-index: 10001 !important; }
#alertDetailModal, #coachStudentDetailModal {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: rgba(0, 11, 37, 0.82) !important;
}

/* Fond executive NY à l'aube + overlay (dark / light) */
#coachApp {
  background: linear-gradient(rgba(0,11,37,0.45), rgba(0,11,37,0.45)),
              url('/assets/executive-bg.png') center center / cover fixed no-repeat !important;
}
body:not(.dark-mode) #coachApp {
  background: linear-gradient(rgba(255,250,240,0.55), rgba(255,250,240,0.55)),
              url('/assets/executive-bg.png') center center / cover fixed no-repeat !important;
}
#coachApp .main-content, body.dark-mode #coachApp .main-content { background: transparent !important; }

/* Sidebar coach : glass translucide + blur + séparateur doré (idem élève) */
#coachAppSidebar > * { background: transparent !important; }
#coachAppSidebar, #coachApp .sidebar {
  background: rgba(10, 15, 24, 0.55) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  backdrop-filter: blur(4px) !important;
  border-right: 1px solid rgba(201, 162, 75, 0.15) !important;
}
body:not(.dark-mode) #coachAppSidebar > * { background: transparent !important; }
body:not(.dark-mode) #coachAppSidebar,
body:not(.dark-mode) #coachApp .sidebar { background: rgba(255, 250, 240, 0.75) !important; }
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: 0 1px 2px rgba(0, 0, 0, 0.6); }
body.dark-mode #coachAppSidebar .text-gray-300,
body.dark-mode #coachAppSidebar .text-gray-400 { color: rgba(255, 255, 255, 0.85) !important; }

/* Typo chiffres : JetBrains Mono + tabular-nums */
#coachApp .metric-value-large, #coachApp .metric-value-medium {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
  letter-spacing: -0.02em;
}

/* Cards "photo encadrée" : cadre or fin + fond navy translucide + hover lift */
#coachApp .trader-card, body.dark-mode #coachApp .trader-card,
#coachApp .metric-item, body.dark-mode #coachApp .metric-item {
  background: rgba(10, 15, 24, calc(0.55 * var(--surface-opacity-factor, 1))) !important;
  border: 1px solid var(--aube-frame) !important;
  border-radius: var(--aube-frame-radius) !important;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
  transition: transform 200ms var(--aube-ease), filter 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
#coachApp .trader-card:hover, body.dark-mode #coachApp .trader-card:hover,
#coachApp .metric-item:hover, body.dark-mode #coachApp .metric-item:hover {
  transform: translateY(-1px); filter: brightness(1.08);
  border-color: var(--aube-frame-hover) !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42), 0 0 22px -8px rgba(212, 175, 55, 0.4) !important;
}
body:not(.dark-mode) #coachApp .trader-card,
body:not(.dark-mode) #coachApp .metric-item {
  background: rgba(255, 250, 240, 0.75) !important; color: #1a1208 !important;
}

/* Banner head metrics quasi-transparent (laisse respirer le fond) */
body.dark-mode #coachApp .traderzella-banner {
  background: rgba(0, 11, 37, 0.15) !important; border-color: transparent !important; box-shadow: none !important;
}
body:not(.dark-mode) #coachApp .traderzella-banner {
  background: rgba(255, 250, 240, 0.18) !important; box-shadow: none !important; border: none !important;
}

/* Animation d'entrée des sections + cards (idem élève) */
#coachApp .section:not(.hidden) { animation: aubeSectionIn 240ms var(--aube-ease); }
#coachApp .section:not(.hidden) .trader-card { animation: aubeCardIn 420ms var(--aube-ease) both; }

/* Hover doré sur les lignes de la table élèves */
#coachApp #coachStudentsTable tr:hover { background: rgba(212, 175, 55, 0.06) !important; }

/* #33 2b — Banner coach à 5 KPI (responsive) + engrenage filtres calendrier */
#coachApp .traderzella-banner.coach-kpi-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { #coachApp .traderzella-banner.coach-kpi-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { #coachApp .traderzella-banner.coach-kpi-5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { #coachApp .traderzella-banner.coach-kpi-5 { grid-template-columns: 1fr; } }
/* Items cliquables Points à surveiller coach (drill-down) */
#coachWarningsContainer > div.clickable { cursor: pointer; transition: background 160ms ease, border-color 160ms ease; }
#coachWarningsContainer > div.clickable:hover { background: rgba(212,175,55,0.10) !important; }
/* Calendrier coach pleine page : cellules plus grandes */
#coachApp #globalCalendarGrid > div { min-height: 70px; }
#coachApp #globalCalendarGrid .cell-pnl { font-size: 1.05rem; }
.coach-cal-settings {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 230px;
  background: rgba(10, 15, 24, 0.96); border: 1px solid var(--aube-frame, rgba(201,162,75,0.55));
  border-radius: 12px; padding: 12px 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
body:not(.dark-mode) .coach-cal-settings { background: rgba(255,250,240,0.97); }
.coach-cal-settings label { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 13px; cursor: pointer; }

/* #33 2b-iv — "X élèves" lisible dans les cellules calendrier coach (fond clair vert/rouge) */
#coachApp #globalCalendarGrid .coach-cal-students { color: #1a1208; }

/* ============================================================
   #33 commit 4 — Table élèves premium (Bourse à l'Aube)
   ============================================================ */
.coach-students-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-bottom:18px; }
.coach-search-wrap { position:relative; flex:1 1 280px; max-width:420px; }
.coach-search-ico { position:absolute; left:14px; top:50%; transform:translateY(-50%); color:rgba(212,175,55,0.6); font-size:13px; pointer-events:none; }
.coach-search-input { width:100%; padding:10px 14px 10px 38px; border-radius:10px; font-size:14px;
  background:rgba(10,15,24,0.55); border:1px solid rgba(212,175,55,0.25); color:var(--aube-text-primary,#f4e4c1); outline:none; transition:border-color .15s; }
.coach-search-input::placeholder { color:rgba(244,228,193,0.45); }
.coach-search-input:focus { border-color:rgba(212,175,55,0.7); }
.coach-status-filters { display:flex; gap:8px; flex-wrap:wrap; }
.coach-chip { display:inline-flex; align-items:center; gap:7px; padding:7px 13px; border-radius:999px; font-size:12.5px; font-weight:600; cursor:pointer;
  background:rgba(255,255,255,0.04); border:1px solid rgba(212,175,55,0.2); color:rgba(244,228,193,0.55); transition:all .15s; }
.coach-chip.is-on { background:rgba(212,175,55,0.14); border-color:rgba(212,175,55,0.55); color:var(--aube-text-primary,#f4e4c1); }
.coach-chip:hover { border-color:rgba(212,175,55,0.7); }
.coach-students-count { margin-left:auto; font-size:12.5px; color:rgba(244,228,193,0.55); font-variant-numeric:tabular-nums; }

.coach-dot { width:9px; height:9px; border-radius:50%; display:inline-block; flex:none; }
.coach-dot.green { background:#10b981; box-shadow:0 0 0 3px rgba(16,185,129,0.18); }
.coach-dot.amber { background:#f59e0b; box-shadow:0 0 0 3px rgba(245,158,11,0.18); }
.coach-dot.red   { background:#ef4444; box-shadow:0 0 0 3px rgba(239,68,68,0.18); }

.coach-students-table { border-collapse:separate; border-spacing:0; }
.coach-th { padding:11px 14px; text-align:left; font-size:11px; font-weight:700; letter-spacing:0.04em; text-transform:uppercase;
  color:rgba(212,175,55,0.8); border-bottom:1px solid rgba(212,175,55,0.2); white-space:nowrap; }
.coach-th.text-right { text-align:right; }
.coach-th.sortable { cursor:pointer; user-select:none; transition:color .15s; }
.coach-th.sortable:hover { color:var(--color-gold,#d4af37); }
.coach-th.sortable::after { content:'\2195'; opacity:0.3; margin-left:6px; font-size:10px; }
.coach-th.sort-asc::after { content:'\2191'; opacity:1; }
.coach-th.sort-desc::after { content:'\2193'; opacity:1; }
.coach-student-row { cursor:pointer; transition:background .12s; }
.coach-student-row:hover { background:rgba(212,175,55,0.07); }
.coach-td { padding:13px 14px; border-bottom:1px solid rgba(255,255,255,0.05); font-size:13.5px; color:var(--aube-text-primary,#f4e4c1); vertical-align:middle; }
.coach-td.text-right { text-align:right; }
.coach-num { font-family:'JetBrains Mono', ui-monospace, monospace; font-variant-numeric:tabular-nums; font-weight:600; }
.coach-num.pos { color:#10b981; } .coach-num.neg { color:#ef4444; } .coach-num.mid { color:#f59e0b; }

.coach-student-id { display:flex; align-items:center; gap:12px; }
.coach-avatar { width:38px; height:38px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:800; color:#0d1116; letter-spacing:0.02em;
  background:linear-gradient(135deg, hsl(var(--h,42) 55% 62%), hsl(var(--h,42) 60% 48%)); box-shadow:0 2px 8px rgba(0,0,0,0.3); }
.coach-student-meta { min-width:0; }
.coach-student-name { font-weight:600; color:var(--aube-text-primary,#f4e4c1); }
.coach-student-email { font-size:12px; color:rgba(244,228,193,0.5); }
.coach-status { display:inline-flex; align-items:center; gap:8px; font-size:13px; }
.coach-last { font-size:12.5px; color:rgba(244,228,193,0.7); }
.coach-row-btn { width:30px; height:30px; border-radius:8px; border:1px solid rgba(212,175,55,0.3); background:rgba(255,255,255,0.04);
  color:rgba(244,228,193,0.8); cursor:pointer; font-size:12px; transition:all .15s; }
.coach-row-btn:hover { border-color:rgba(212,175,55,0.7); color:var(--color-gold,#d4af37); }
.coach-row-btn.danger:hover { border-color:rgba(239,68,68,0.7); color:#ef4444; background:rgba(239,68,68,0.1); }

body:not(.dark-mode) .coach-search-input { background:rgba(255,250,240,0.8); color:#1a1208; border-color:rgba(123,96,24,0.3); }
body:not(.dark-mode) .coach-search-input::placeholder { color:rgba(123,96,24,0.5); }
body:not(.dark-mode) .coach-chip { color:rgba(123,96,24,0.6); }
body:not(.dark-mode) .coach-chip.is-on { color:#1a1208; }
body:not(.dark-mode) .coach-td, body:not(.dark-mode) .coach-student-name { color:#1a1208; }
body:not(.dark-mode) .coach-student-email, body:not(.dark-mode) .coach-last, body:not(.dark-mode) .coach-students-count { color:rgba(123,96,24,0.7); }

/* Modale détails élève */
.csd-head { display:flex; align-items:center; gap:16px; margin-bottom:18px; }
.csd-avatar { width:54px; height:54px; font-size:18px; }
.csd-name { font-size:18px; font-weight:700; color:var(--aube-text-primary,#f4e4c1); }
.csd-email { font-size:13px; color:rgba(244,228,193,0.55); margin:2px 0 4px; }
.csd-status { font-size:12.5px; display:inline-flex; align-items:center; gap:7px; color:rgba(244,228,193,0.75); }
.csd-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:18px; }
.csd-stat { background:rgba(255,255,255,0.04); border:1px solid rgba(212,175,55,0.18); border-radius:10px; padding:12px 10px; text-align:center; }
.csd-stat-lbl { font-size:10.5px; text-transform:uppercase; letter-spacing:0.03em; color:rgba(212,175,55,0.7); margin-bottom:5px; }
.csd-stat-val { font-family:'JetBrains Mono', ui-monospace, monospace; font-size:16px; font-weight:700; color:var(--aube-text-primary,#f4e4c1); }
.csd-stat-val.pos { color:#10b981; } .csd-stat-val.neg { color:#ef4444; }
.csd-soon { display:flex; flex-direction:column; gap:10px; margin-bottom:18px; }
.csd-soon-row { display:flex; align-items:center; gap:13px; padding:12px 14px; border-radius:10px;
  background:rgba(212,175,55,0.06); border:1px dashed rgba(212,175,55,0.3); }
.csd-soon-row i { font-size:17px; color:rgba(212,175,55,0.7); width:22px; text-align:center; flex:none; }
.csd-soon-row strong { display:block; font-size:13px; color:var(--aube-text-primary,#f4e4c1); }
.csd-soon-row span { font-size:11.5px; color:rgba(244,228,193,0.5); }
.csd-actions { display:flex; justify-content:space-between; gap:10px; }
.csd-revoke:hover { color:#ef4444 !important; border-color:rgba(239,68,68,0.6) !important; }
body:not(.dark-mode) .csd-name, body:not(.dark-mode) .csd-stat-val, body:not(.dark-mode) .csd-soon-row strong { color:#1a1208; }

@media (max-width: 720px) {
  .csd-stats { grid-template-columns:repeat(2,1fr); }
  .coach-students-count { margin-left:0; }
}
