/* Summit Training — Espace membre & coach. Autonome (nav/footer via main.css). */

.resa-page { background: #0b1220; }
.esp-main { padding-top: 96px; min-height: 70vh; color: #e2e8f0; }

.esp-container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Hero */
.esp-hero { text-align: center; padding: 26px 20px 22px; }
.esp-eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #38bdf8; margin-bottom: 10px; }
.esp-title { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: clamp(28px, 5vw, 44px); line-height: 1.05; color: #fff; margin: 0 0 10px; }
.accent-gradient { background: linear-gradient(120deg, #38bdf8, #2563eb); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.esp-lead { color: #94a3b8; max-width: 560px; margin: 0 auto; font-size: 15px; }

/* Panels */
.esp-panel { background: #111a2e; border: 1px solid #1e293b; border-radius: 18px; padding: 22px; margin: 0 0 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.esp-panel-title { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 18px; color: #fff; margin: 0 0 14px; }
.esp-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }

/* Login */
.esp-login { max-width: 440px; margin: 0 auto 18px; }
.esp-field { margin: 0 0 14px; }
.esp-field label { display: block; font-size: 13px; font-weight: 600; color: #cbd5e1; margin-bottom: 6px; }
.esp-field input {
    width: 100%; box-sizing: border-box; padding: 12px 14px; font-size: 15px; color: #f8fafc;
    background: #0b1220; border: 1px solid #334155; border-radius: 11px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.esp-field input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .25); }
.esp-btn { width: 100%; margin-top: 4px; justify-content: center; }
.esp-consent { color: #64748b; font-size: 12px; margin: 12px 0 0; line-height: 1.5; }
.esp-consent a { color: #38bdf8; }

.esp-msg { display: none; }
.esp-msg.show { display: block; padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.esp-msg.err { background: rgba(239, 68, 68, .12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, .3); }

/* User bar */
.esp-userbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.esp-hello { font-size: 18px; color: #fff; }
.esp-hello b { color: #38bdf8; }
.esp-sub { font-size: 13px; color: #64748b; margin-top: 2px; }
.esp-userbar-actions { display: flex; align-items: center; gap: 10px; }
.esp-ghost { background: transparent; border: 1px solid #334155; color: #cbd5e1; padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.esp-ghost:hover { background: #1e293b; border-color: #475569; }

/* Admin — consignes (cours par écran) */
.esp-screen-group { margin: 0 0 18px; }
.esp-screen-title { font-weight: 800; color: #fff; font-size: 14px; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid #1e293b; }
.esp-course-list { display: flex; flex-wrap: wrap; gap: 8px; }
.esp-course { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1px solid #334155; background: #0b1220; color: #e2e8f0; font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; transition: border-color .15s, background .15s, opacity .15s; }
.esp-course input { width: 16px; height: 16px; accent-color: #22c55e; cursor: pointer; }
.esp-course.off { opacity: .5; border-style: dashed; }
.esp-admin-actions { margin-top: 8px; }
.esp-save { width: auto; display: inline-flex; }

/* Admin — statistiques */
.esp-kpis { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.esp-kpi { flex: 1 1 140px; background: #0b1220; border: 1px solid #1e293b; border-radius: 14px; padding: 16px; text-align: center; }
.esp-kpi-val { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 28px; color: #38bdf8; line-height: 1; }
.esp-kpi-lbl { font-size: 12px; color: #94a3b8; margin-top: 6px; font-weight: 600; }
.esp-chart-title { font-size: 13px; font-weight: 700; color: #cbd5e1; margin: 16px 0 8px; }
.esp-chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; background: #0b1220; border: 1px solid #1e293b; border-radius: 12px; padding: 8px; }
.esp-hbars { display: grid; gap: 8px; }
.esp-hbar { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; }
.esp-hbar-label { color: #e2e8f0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esp-hbar-track { background: #1e293b; border-radius: 999px; height: 12px; overflow: hidden; }
.esp-hbar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2563eb, #38bdf8); }
.esp-hbar-val { color: #94a3b8; font-weight: 700; text-align: right; }
.esp-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 4px 0 10px; font-size: 12px; color: #94a3b8; }
.esp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.esp-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.esp-legend i.line { height: 3px; border-radius: 2px; }
.esp-hbars-pct .esp-hbar { grid-template-columns: 170px 1fr 88px; }
@media (max-width: 520px) { .esp-hbars-pct .esp-hbar { grid-template-columns: 110px 1fr 76px; } }
/* Liste prospects essai */
.esp-lead-list { display: grid; gap: 6px; max-height: 360px; overflow-y: auto; }
.esp-lead { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #0b1220; border: 1px solid #1e293b; border-radius: 10px; padding: 9px 14px; font-size: 13px; }
.esp-lead-name { color: #e2e8f0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esp-lead-date { color: #38bdf8; font-weight: 700; white-space: nowrap; }
@media (max-width: 520px) { .esp-hbar { grid-template-columns: 110px 1fr 36px; } }

/* Recherche membres (coach) */
.esp-search { width: 100%; box-sizing: border-box; padding: 11px 14px; font-size: 15px; color: #f8fafc; background: #0b1220; border: 1px solid #334155; border-radius: 11px; outline: none; margin-bottom: 12px; }
.esp-search:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .2); }
.esp-member-list { display: grid; gap: 6px; margin-bottom: 12px; }
.esp-member-item { text-align: left; background: #0b1220; border: 1px solid #24324a; color: #e2e8f0; padding: 10px 14px; border-radius: 10px; font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.esp-member-item:hover { border-color: #2563eb; background: #16233c; }
.esp-member-name { font-weight: 800; color: #fff; font-size: 15px; margin: 4px 0 10px; }

/* Abonnement / carnet */
.esp-pass { background: #0b1220; border: 1px solid #1e293b; border-left: 4px solid #38bdf8; border-radius: 12px; padding: 14px 16px; margin: 0 0 10px; }
.esp-pass:last-child { margin-bottom: 0; }
.esp-pass-abonnement { border-left-color: #22c55e; }
.esp-pass-carnet { border-left-color: #38bdf8; }
.esp-pass-essai { border-left-color: #f59e0b; }
.esp-pass-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.esp-pass-badge { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: rgba(56, 189, 248, .15); color: #38bdf8; }
.esp-pass-abonnement .esp-pass-badge { background: rgba(34, 197, 94, .15); color: #4ade80; }
.esp-pass-essai .esp-pass-badge { background: rgba(245, 158, 11, .15); color: #fbbf24; }
.esp-pass-name { font-weight: 700; color: #f1f5f9; font-size: 14px; }
.esp-pass-meta { font-size: 13px; color: #94a3b8; margin-top: 8px; }
.esp-pass-bar { height: 6px; border-radius: 999px; background: #1e293b; margin-top: 10px; overflow: hidden; }
.esp-pass-bar span { display: block; height: 100%; background: linear-gradient(90deg, #2563eb, #38bdf8); border-radius: 999px; }

/* Bookings */
.esp-bookings { display: grid; gap: 10px; }
.esp-bk { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #0b1220; border: 1px solid #1e293b; border-left: 4px solid #2563eb; border-radius: 12px; padding: 12px 16px; }
.esp-bk-name { font-weight: 700; color: #f1f5f9; }
.esp-bk-when { font-size: 13px; color: #94a3b8; margin-top: 2px; }
.esp-bk-cancel { background: transparent; border: 1px solid #7f1d1d; color: #fca5a5; padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.esp-bk-cancel:hover { background: rgba(239, 68, 68, .12); }
.esp-bk-cancel:disabled { opacity: .5; cursor: default; }
.esp-empty { color: #94a3b8; font-size: 14px; text-align: center; padding: 12px; }

/* Weeknav + periods */
.esp-weeknav { display: flex; align-items: center; gap: 10px; }
.esp-weeknav button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid #334155; background: #0b1220; color: #e2e8f0; font-size: 18px; cursor: pointer; }
.esp-weeknav button:hover { background: #1e293b; }
.esp-range { font-size: 14px; font-weight: 600; color: #cbd5e1; min-width: 130px; text-align: center; }
.esp-periods { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 4px 0 16px; padding-bottom: 2px; }
.esp-period { flex: 0 0 auto; white-space: nowrap; padding: 8px 14px; border-radius: 999px; border: 1px solid #334155; background: #0b1220; color: #cbd5e1; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.esp-period:hover { border-color: #2563eb; }
.esp-period.active { background: linear-gradient(120deg, #2563eb, #38bdf8); border-color: transparent; color: #fff; }

/* Days grid */
.esp-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.esp-day { background: #0b1220; border: 1px solid #1e293b; border-radius: 14px; overflow: hidden; }
.esp-day-head { background: #16233c; padding: 10px 12px; font-weight: 700; font-size: 13px; color: #e2e8f0; text-transform: capitalize; }
.esp-day-head span { color: #64748b; font-weight: 500; }
.esp-slots { padding: 10px; display: grid; gap: 8px; }
.esp-noslot { color: #475569; text-align: center; padding: 12px 0; }
.esp-slot { text-align: left; background: #111a2e; border: 1px solid #24324a; border-radius: 11px; padding: 10px 12px; cursor: pointer; display: grid; gap: 3px; transition: border-color .15s, transform .1s, background .15s; }
.esp-slot:hover { border-color: #2563eb; background: #16233c; transform: translateY(-1px); }
.esp-slot.has-inscrits { border-color: #22c55e; border-left: 3px solid #22c55e; background: rgba(34, 197, 94, .10); }
.esp-slot.has-inscrits:hover { border-color: #22c55e; background: rgba(34, 197, 94, .16); }
.esp-slot.has-inscrits .esp-slot-left { color: #4ade80; }
.esp-slot.loading { opacity: .5; cursor: default; }
.esp-slot-time { font-weight: 800; color: #fff; font-size: 14px; }
.esp-slot-name { font-size: 12px; color: #cbd5e1; }
.esp-slot-coach { font-size: 11px; color: #a5b4fc; font-weight: 600; }
.esp-slot-left { font-size: 11px; color: #38bdf8; font-weight: 600; }
.esp-slot.full { opacity: .55; cursor: not-allowed; }
.esp-slot.full .esp-slot-left { color: #f87171; }
/* Vue un seul jour (Aujourd'hui / Demain) : la carte occupe toute la largeur, les séances s'étalent en colonnes. */
.esp-days-single { grid-template-columns: 1fr; }
.esp-days-single .esp-slots { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

/* Loading / spinner */
.esp-loading { display: flex; align-items: center; gap: 10px; color: #94a3b8; font-size: 14px; padding: 14px; }
.esp-spin { width: 16px; height: 16px; border: 2px solid #334155; border-top-color: #38bdf8; border-radius: 50%; animation: espspin .7s linear infinite; }
@keyframes espspin { to { transform: rotate(360deg); } }

/* Toast */
.esp-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #0f172a; color: #f8fafc; border: 1px solid #334155; padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); transition: opacity .2s, transform .2s; z-index: 1300; max-width: 90vw; }
.esp-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.esp-toast.ok { border-left: 4px solid #22c55e; }
.esp-toast.err { border-left: 4px solid #ef4444; }

/* ---- Coach ---- */
.esp-coach-pick { display: grid; gap: 10px; }
.esp-roster-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.esp-roster-count { font-weight: 700; color: #38bdf8; font-size: 14px; }
.esp-roster-actions { display: flex; gap: 8px; }
.esp-mini { padding: 6px 12px; border-radius: 999px; border: 1px solid #334155; background: #0b1220; color: #cbd5e1; font-size: 12px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.esp-mini:hover { border-color: #2563eb; background: #16233c; }
.esp-roster-list { display: grid; gap: 8px; }
.esp-roster { display: grid; gap: 8px; }
.esp-part { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #0b1220; border: 1px solid #1e293b; border-radius: 12px; padding: 12px 16px; transition: border-color .15s; }
.esp-part.present { border-left: 4px solid #22c55e; }
.esp-part.absent { border-left: 4px solid #334155; }
.esp-part-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.esp-part-photo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #0b1220; border: 1px solid #24324a; flex: 0 0 auto; }
.esp-part-initials { display: inline-flex; align-items: center; justify-content: center; color: #38bdf8; font-weight: 800; font-size: 14px; }
.esp-part-name { font-weight: 700; color: #f1f5f9; }
.esp-badge-essai { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(56, 189, 248, .15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, .4); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; }
.esp-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.esp-check input { width: 22px; height: 22px; accent-color: #22c55e; cursor: pointer; }
.esp-check-label { font-size: 13px; color: #94a3b8; }
/* Hors plein écran : colonne étroite (1/4) → chaque présent tient sur UNE ligne */
.esp-panel:not(.esp-fullpage) .esp-part { padding: 8px 12px; gap: 8px; }
.esp-panel:not(.esp-fullpage) .esp-part-main { gap: 8px; flex: 1 1 auto; }
.esp-panel:not(.esp-fullpage) .esp-part-photo { width: 28px; height: 28px; }
.esp-panel:not(.esp-fullpage) .esp-part-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.esp-panel:not(.esp-fullpage) .esp-check { flex: 0 0 auto; }
.esp-panel:not(.esp-fullpage) .esp-check-label { display: none; }

/* Badge « contenu renseigné » + en-tête roster (cours · date · heure · coach photo) */
.esp-slot-note { display: inline-block; margin-left: 6px; font-size: 11px; color: #4ade80; font-weight: 800; }
.esp-roster-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.esp-roster-sub { display: block; font-size: 12px; color: #64748b; font-weight: 500; margin-top: 3px; text-transform: none; letter-spacing: 0; }
.esp-coach-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #a5b4fc; margin-top: 8px; }
.esp-coach-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #0b1220; border: 1px solid #24324a; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #38bdf8; font-weight: 800; flex: 0 0 auto; }
/* Mode plein écran du bloc contenu + participants */
.esp-panel.esp-fullpage { position: fixed; inset: 0; z-index: 1000; margin: 0; border-radius: 0; overflow-y: auto; max-width: 100%; box-shadow: none; }

/* Roster coach : note (WOD) à gauche, présents à droite */
.esp-roster-cols { display: grid; grid-template-columns: 3fr minmax(220px, 1fr); gap: 18px; align-items: start; }
.esp-note-col { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 12px; }
.esp-note-head { font-size: 13px; font-weight: 700; color: #cbd5e1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.esp-note-tools { display: inline-flex; align-items: center; gap: 6px; }
.esp-note-tool { display: inline-flex; align-items: center; gap: 4px; background: #0f1a2e; border: 1px solid #24324a; border-radius: 8px; color: #cbd5e1; font-size: 13px; font-weight: 700; line-height: 1; padding: 6px 10px; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.esp-note-tool:hover { border-color: #2563eb; color: #f1f5f9; }
.esp-note-tool:active { transform: translateY(1px); }
.esp-note-mic.esp-rec { background: #7f1d1d; border-color: #ef4444; color: #fff; animation: esp-pulse 1.1s ease-in-out infinite; }
@keyframes esp-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .5); } 50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } }
/* Hauteur de la zone WOD : elle suit la taille de l'écran. Le JS (fitNote) l'ajuste
   au pixel près ; ceci est le repli avant son exécution. */
.esp-note { width: 100%; min-height: 200px; height: calc(100svh - 300px); background: #0b1220; border: 1px solid #24324a; border-radius: 12px; color: #f1f5f9; padding: 14px; font: inherit; font-size: var(--esp-note-fs, 14px); line-height: 1.55; resize: vertical; }
.esp-note:focus { outline: none; border-color: #2563eb; }
.esp-note-actions { display: flex; align-items: center; gap: 12px; }
.esp-note-actions .esp-btn { max-width: 210px; }
.esp-note-status { font-size: 13px; color: #4ade80; font-weight: 600; }
@media (max-width: 720px) { .esp-roster-cols { grid-template-columns: 1fr; } .esp-note-col { position: static; } .esp-note { height: 60svh; } }

/* Tableau blanc : le WOD en grand sur fond clair, lu depuis l'autre bout de la salle.
   Fond blanc assumé alors que l'espace coach est sombre — c'est un tableau de salle,
   projeté ou affiché sur un écran, et le texte clair sur noir y bave. */
/* Deux ambiances : le tableau clair pour une salle éclairée, le sombre pour un
   écran en soirée ou une pièce sans lumière. Tout passe par ces variables — le
   JS n'a que la classe « sombre » à poser, et le tracé se redessine aux bonnes
   encres (voir redrawBoard dans coach.js). */
.esp-board { --tb-fond: #ffffff; --tb-texte: #0f172a; --tb-doux: #64748b; --tb-bord: #e2e8f0; --tb-outil: #f1f5f9; --tb-outil-bord: #cbd5e1; --tb-inverse: #ffffff;
    position: fixed; inset: 0; z-index: 1200; background: var(--tb-fond); display: flex; flex-direction: column; }
.esp-board.sombre { --tb-fond: #0b1220; --tb-texte: #f1f5f9; --tb-doux: #94a3b8; --tb-bord: #24324a; --tb-outil: #0f1a2e; --tb-outil-bord: #24324a; --tb-inverse: #0b1220; }
.esp-board[hidden] { display: none; }
.esp-board-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 2px solid var(--tb-bord); flex-wrap: wrap; }
.esp-board-title { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 18px; color: var(--tb-texte); line-height: 1.25; }
.esp-board-title small { display: block; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 13px; color: var(--tb-doux); }
.esp-board-tools { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.esp-board-tool { background: var(--tb-outil); border: 1px solid var(--tb-outil-bord); border-radius: 8px; color: var(--tb-texte); font: inherit; font-size: 14px; font-weight: 700; line-height: 1; padding: 9px 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.esp-board-tool:hover { border-color: #2563eb; }
.esp-board-tool:active { transform: translateY(1px); }
.esp-board-close { background: var(--tb-texte); border-color: var(--tb-texte); color: var(--tb-inverse); }
/* Texte et tracé occupent la même surface : on écrit à la main par-dessus le WOD,
   comme sur le tableau de la salle. Le canevas ne prend la main qu'en mode dessin. */
.esp-board-surface { position: relative; flex: 1 1 auto; min-height: 0; }
/* La taille du texte est posée par le JS (fitBoardText) ; 32px n'est que le repli. */
.esp-board-text { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; resize: none; background: var(--tb-fond); color: var(--tb-texte); padding: 18px 24px; font: inherit; font-weight: 600; font-size: 32px; line-height: 1.3; }
.esp-board-text:focus { outline: none; }
.esp-board-draw { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; touch-action: none; }
.esp-board.esp-draw .esp-board-draw { pointer-events: auto; cursor: crosshair; }
.esp-board-pens { flex: 1 0 100%; display: flex; align-items: center; gap: 8px; padding-top: 8px; flex-wrap: wrap; }
.esp-board-pens[hidden] { display: none; }
.esp-board-pen { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--tb-outil-bord); background: currentColor; cursor: pointer; padding: 0; }
/* Les encres s'éclaircissent sur fond sombre, sinon le rouge et le bleu se noient. */
.esp-board-pen[data-encre="encre"] { color: #0f172a; }
.esp-board-pen[data-encre="rouge"] { color: #dc2626; }
.esp-board-pen[data-encre="bleu"] { color: #2563eb; }
.esp-board-pen[data-encre="vert"] { color: #16a34a; }
.esp-board.sombre .esp-board-pen[data-encre="encre"] { color: #f8fafc; }
.esp-board.sombre .esp-board-pen[data-encre="rouge"] { color: #f87171; }
.esp-board.sombre .esp-board-pen[data-encre="bleu"] { color: #60a5fa; }
.esp-board.sombre .esp-board-pen[data-encre="vert"] { color: #4ade80; }
.esp-board-pen.on { border-color: var(--tb-texte); box-shadow: 0 0 0 3px rgba(15, 23, 42, .15); }
.esp-board.sombre .esp-board-pen.on { box-shadow: 0 0 0 3px rgba(248, 250, 252, .22); }
.esp-board-tool[aria-pressed="true"] { background: var(--tb-texte); border-color: var(--tb-texte); color: var(--tb-inverse); }
.esp-board-erasers { display: inline-flex; align-items: center; gap: 6px; }
/* Séparateur visuel entre l'outil d'écriture et celui d'effacement. */
.esp-board-erasers { padding-left: 10px; border-left: 1px solid var(--tb-outil-bord); }
.esp-board-label { font-size: 13px; font-weight: 700; color: var(--tb-doux); }
.esp-board-eraser { min-width: 34px; text-align: center; }
/* Gomme active : la couleur choisie garde sa place mais cesse d'être l'outil courant. */
.esp-board-pens.gomme .esp-board-pen.on { border-color: var(--tb-outil-bord); box-shadow: none; }
@media (max-width: 720px) { .esp-board-bar { padding: 8px 12px; } .esp-board-title { font-size: 15px; } .esp-board-tool { padding: 8px 10px; font-size: 13px; } .esp-board-text { padding: 12px 14px; } .esp-board-pen { width: 26px; height: 26px; } }

/* Confirmation intégrée (remplace confirm() natif) */
.esp-confirm-ov { position: fixed; inset: 0; background: rgba(2, 6, 23, .72); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .15s ease; z-index: 1000; padding: 20px; }
.esp-confirm-ov.show { opacity: 1; visibility: visible; }
.esp-confirm { background: #111a2e; border: 1px solid #1e293b; border-radius: 16px; padding: 24px; max-width: 380px; width: 100%; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); text-align: center; }
.esp-confirm-msg { color: #f1f5f9; font-size: 16px; font-weight: 600; margin: 0 0 20px; line-height: 1.4; }
.esp-confirm-actions { display: flex; gap: 10px; }
.esp-confirm-actions > * { flex: 1; justify-content: center; text-align: center; }
.esp-confirm-yes { max-width: none; }

/* Camembert (donut) */
.esp-pie-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; background: #0b1220; border: 1px solid #1e293b; border-radius: 12px; padding: 16px; margin-bottom: 10px; }
.esp-pie-wrap svg { flex: 0 0 auto; }
.esp-pie-legend { display: grid; gap: 8px; font-size: 13px; color: #cbd5e1; min-width: 200px; flex: 1 1 200px; }
.esp-pie-leg { display: flex; align-items: center; gap: 8px; }
.esp-pie-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }
.esp-pie-leg b { color: #e2e8f0; font-weight: 700; margin-left: auto; padding-left: 12px; }

/* Carte d'appel à l'action (lien vers page prospects) */
.esp-cta-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: #0b1220; border: 1px solid #1e293b; border-radius: 12px; padding: 16px 20px; }
.esp-cta-num { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 34px; color: #38bdf8; line-height: 1; }
.esp-cta-lbl { font-size: 13px; color: #94a3b8; font-weight: 600; margin-top: 4px; }

/* Lignes prospects (page dédiée) */
.esp-lead-row { flex-wrap: wrap; }
.esp-lead-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 200px; }
.esp-lead-sub { font-size: 12px; color: #94a3b8; }
.esp-lead-btn { max-width: 240px; padding: 9px 16px; font-size: 13px; }
.esp-lead-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Modale email prospect */
.esp-mail-ov { position: fixed; inset: 0; background: rgba(2, 6, 23, .72); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .15s ease; z-index: 1000; padding: 20px; }
.esp-mail-ov.on { opacity: 1; visibility: visible; }
.esp-mail { background: #111a2e; border: 1px solid #1e293b; border-radius: 16px; padding: 22px; max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.esp-mail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.esp-mail-head h3 { margin: 0; color: #f1f5f9; font-size: 18px; }
.esp-mail-close { background: none; border: 0; color: #94a3b8; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.esp-mail-to { font-size: 13px; color: #cbd5e1; background: #0b1220; border: 1px solid #1e293b; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; word-break: break-word; }
.esp-mail textarea { width: 100%; background: #0b1220; border: 1px solid #24324a; border-radius: 10px; color: #f1f5f9; padding: 12px 14px; font: inherit; font-size: 14px; line-height: 1.5; resize: vertical; }
.esp-mail-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.esp-mail-actions .esp-btn { max-width: 200px; }

/* Charges */
.esp-charge-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.esp-charge-form .esp-field { margin: 0; }
.esp-charge-form select, .esp-charge-form input { width: 100%; background: #0b1220; border: 1px solid #24324a; border-radius: 10px; color: #f1f5f9; padding: 10px 12px; font: inherit; }
.esp-charge-add { grid-column: 1 / -1; }
.esp-charge-add .esp-btn { max-width: 200px; }
.esp-charge-list { display: grid; gap: 8px; }
.esp-charge-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #0b1220; border: 1px solid #1e293b; border-radius: 12px; padding: 12px 16px; }
.esp-charge-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 200px; }
.esp-charge-label { color: #f1f5f9; font-weight: 700; }
.esp-charge-meta { font-size: 12px; color: #94a3b8; text-transform: capitalize; }
.esp-charge-amounts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.esp-charge-est { font-size: 13px; color: #94a3b8; font-weight: 600; }
.esp-charge-real { font-size: 13px; color: #cbd5e1; display: inline-flex; align-items: center; gap: 6px; }
.esp-charge-real input { width: 92px; background: #0b1220; border: 1px solid #24324a; border-radius: 8px; color: #38bdf8; font-weight: 700; padding: 6px 8px; font: inherit; }
/* Liens réservés au staff : masqués tant que l'admin n'est pas connecté (révélés en JS). */
.esp-staff-only { display: none !important; }
.esp-charge-edit { background: none; border: 1px solid #334155; color: #38bdf8; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 14px; line-height: 1; }
.esp-charge-edit:hover { border-color: #2563eb; background: rgba(37, 99, 235, .12); }
.esp-charge-del { background: none; border: 1px solid #334155; color: #f87171; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 14px; line-height: 1; }
.esp-charge-del:hover { border-color: #ef4444; background: rgba(239, 68, 68, .12); }

/* Mobile */
@media (max-width: 640px) {
    .esp-days { grid-template-columns: 1fr; }
    .esp-slots { grid-template-columns: 1fr 1fr; }
    .esp-panel { padding: 16px; }
    .esp-userbar { flex-direction: column; align-items: flex-start; }
    .esp-charge-form { grid-template-columns: 1fr; }
    .esp-pie-wrap { justify-content: center; }
}
