/* Même typo que le site public (Website/static/css/style.css) - identité
   de marque commune plutôt que la police générique utilisée ici avant.
   Barlow Condensed pour les titres, IBM Plex Sans pour le corps. */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;600&display=swap');

/* ─── Reset global ───────────────────────────────────────────── */
html, body {
    margin: 0;
    padding: 0;
    background-color: #0d1117;
    /* Léger dégradé radial : profondeur sans changer la couleur de fond de
       base (toujours #0d1117 aux bords/en dessous du contenu). */
    background-image: radial-gradient(ellipse 120% 60% at 50% -10%, rgba(255, 91, 71, 0.05), transparent 60%);
    background-attachment: fixed;
}

h1, h2, h3 {
    font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* ─── Polish interactif générique — boutons, liens, champs ──────
   S'applique aux éléments natifs directement : couvre tous les boutons de
   l'appli sans avoir à toucher chaque style inline en Python. */
button, a, select,
.dash-dropdown-trigger, .DateInput_input {
    transition: filter var(--transition-fast, 0.15s) ease,
                transform var(--transition-fast, 0.15s) ease,
                border-color var(--transition-fast, 0.15s) ease,
                box-shadow var(--transition-fast, 0.15s) ease;
}

button:not(:disabled):hover, .dash-dropdown-trigger:hover {
    filter: brightness(1.08);
}
button:not(:disabled):active {
    transform: scale(0.98);
    filter: brightness(0.95);
}

button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid #58a6ff;
    outline-offset: 2px;
}

/* Scrollbar thémée (Chrome/Edge/Safari) cohérente avec le fond sombre */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: #30363d;
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
    background-color: #484f58;
    background-clip: content-box;
}

/* ─── Grille principale ──────────────────────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 42%;
  height: calc(100vh - 115px);
  overflow: hidden;
}

/* Col gauche : graphiques */
.col-graphs {
  padding: 12px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Col droite : carte + splits */
.col-right {
  display: flex;
  flex-direction: column;
  border-left: 1px solid #30363d;
  overflow: hidden;
}

/* Section carte (hauteur réduite) */
.map-section {
  height: 42%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #30363d;
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px 6px;
  border-bottom: 1px solid #30363d;
  flex-shrink: 0;
}

.map-iframe {
  flex: 1;
  border: none;
  width: 100%;
  min-height: 0;
}

/* Section splits (prend le reste) */
.splits-section {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  background-color: #161b22;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.splits-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

/* Hauteur du graphe principal */
.graph-main {
  height: calc(100vh - 210px);
  min-height: 350px;
  touch-action: none;
}

/* ─── Toolbar responsive ─────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 12px;
  padding: 10px 20px;
  align-items: flex-end;
  flex-wrap: wrap;
  background-color: #161b22;
  border-bottom: 1px solid #30363d;
}

.toolbar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ─── Tablette paysage (768px – 1023px) ─────────────────────── */
@media (max-width: 1023px) {
  .main-grid {
    grid-template-columns: 55% 1fr;
    height: calc(100vh - 130px);
  }

  .map-section {
    height: 38%;
  }

  .graph-main {
    height: calc(100vh - 230px);
    min-height: 300px;
  }
}

/* ─── Tablette portrait + smartphone (< 768px) ──────────────── */
@media (max-width: 767px) {
  .main-grid {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .col-graphs {
    padding: 8px 10px;
  }

  .col-right {
    border-left: none;
    border-top: 1px solid #30363d;
    height: auto;
    overflow: visible;
  }

  .map-section {
    height: 240px;
    flex-shrink: 0;
  }

  .splits-section {
    max-height: 300px;
    overflow-y: auto;
  }

  .graph-main {
    height: 52vw;
    min-height: 260px;
  }

  .toolbar {
    padding: 8px 10px;
    gap: 8px;
  }
}

/* ─── Petit smartphone (< 480px) ────────────────────────────── */
@media (max-width: 479px) {
  .map-section {
    height: 200px;
  }

  .graph-main {
    height: 60vw;
    min-height: 220px;
  }
}

/* ── Classes communes responsive (pages internes) ────────────────────────── */

/* Header de page générique */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 24px;
    min-height: 52px;
}
.page-header-title {
    flex: 1;
    text-align: center;
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Conteneur centré avec padding */
.page-content-wrap {
    padding: 20px;
}

/* Tableau scrollable horizontalement sur mobile */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
    .page-header         { padding: 8px 14px; }
    .page-header-back    { display: none !important; }   /* géré par mobile-back-btn */
    .page-header-title   { font-size: 15px !important; }
    .page-content-wrap   { padding: 12px 10px; }

    /* Colonnes secondaires cachées dans le tableau setup */
    .setup-col-hide { display: none; }
}

/* ── Mon Programme — responsive ──────────────────────────────────────────── */

.training-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 20px;
    min-height: 52px;
}

/* Grille semaine : 7 colonnes sur desktop */
.training-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

/* Tablette paysage ≤ 900px → 4 colonnes, jours vides cachés */
@media (max-width: 900px) {
    .training-header { padding: 8px 16px; }
    .training-content { padding: 14px 14px !important; }
    .training-week-grid { grid-template-columns: repeat(4, 1fr); }
    .training-day-empty { display: none; }
}

/* Tablette portrait ≤ 640px → 2 colonnes, passé masqué */
@media (max-width: 640px) {
    .training-week-grid { grid-template-columns: repeat(2, 1fr); }
    .training-btn-label { display: none; }   /* icône seule sur les boutons */
    .training-day-past  { display: none; }   /* jours passés masqués sur mobile */
    .training-week-past { display: none; }   /* semaines entièrement passées masquées */
}

/* Mobile ≤ 440px → 1 colonne, blocs plus grands (touch-friendly) */
@media (max-width: 440px) {
    .training-header { padding: 6px 10px; gap: 6px; }
    .training-content { padding: 10px 10px !important; }
    .training-week-grid { grid-template-columns: 1fr; }
    .training-day-card { padding: 12px 14px !important; }
    .training-header-title { font-size: 14px !important; }
}

/* Modals → bottom sheet sur mobile ≤ 640px */
@media (max-width: 640px) {
    .training-modal-overlay {
        align-items: flex-end !important;
    }
    .training-modal-box {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh !important;
        border-radius: 20px 20px 0 0 !important;
        padding: 24px 16px 32px !important;
        box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
    }
}

/* ── Burger menu — mobile only ────────────────────────────────────────────── */

/* Barre mobile fixe : cachée sur desktop, visible sur mobile */
.mobile-top-bar { display: none; }

@media (max-width: 768px) {
    /* Pas de version responsive dédiée pour l'instant (demande du
       2026-07-29) - on masque juste la colonne latérale desktop pour ne
       pas doubler la nav avec la barre ☰/burger déjà en place ci-dessous. */
    .home-sidebar { display: none; }

    .mobile-top-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0; left: 0; right: 0;
        height: 52px;
        z-index: 1100;
        background: #161b22;
        border-bottom: 1px solid #30363d;
        box-shadow: 0 2px 10px rgba(0,0,0,0.35);
        padding: 0 8px;
    }
    /* Les pages poussent leur contenu sous la barre */
    body { padding-top: 52px; }

    /* Éléments desktop uniquement, à masquer sur mobile */
    .mobile-hide     { display: none !important; }
}

/* Boutons "← Retour/Menu" de chaque page : redondants depuis que la
   colonne de navigation globale est présente sur toutes les pages
   (demande du 2026-07-29) - masqués partout, plus seulement sur mobile. */
.mobile-back-btn, .page-header-back { display: none !important; }

/* ☰ toujours ancré à gauche (positionnement absolu, indépendant de tout
   ordre flex/DOM) - cf. demande du 2026-07-07. */
.mobile-burger-btn {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

/* ── Bulle de conversation — bas-droite sur PC (déplacée du bas-gauche le
   2026-07-29 : la colonne de navigation globale occupe désormais cette
   zone, cf. .home-sidebar). Uniquement sur mobile : ancrée en haut-droite,
   à droite du logo, dans la barre ☰ fixe (cf. demande du 2026-07-07). ──── */
.chat-fab-container {
    position: fixed;
    bottom: 24px; right: 24px;
}
.chat-panel-pos {
    position: fixed;
    bottom: 86px; right: 24px; /* au-dessus du bouton (24 + 52 + 10) */
}
@media (max-width: 768px) {
    /* Tout en haut à droite, dans la barre ☰ (52px) : de gauche à droite,
       ☰ - logo - bulle. Bouton réduit pour tenir dans la barre. */
    .chat-fab-container { bottom: auto; top: 9px; left: auto; right: 8px; }
    .chat-panel-pos      { bottom: auto; top: 58px; left: auto; right: 8px; }
    .chat-fab-btn  { width: 34px !important; height: 34px !important; }
    .chat-fab-icon { font-size: 16px !important; }
}

/* Overlay plein écran */
#burger-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;      /* flex quand visible, none quand fermé */
    align-items: stretch;
}

/* Backdrop semi-transparent (cliquable pour fermer) */
.burger-backdrop {
    flex: 1;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

/* Drawer depuis la gauche - la liste de nav (.burger-nav) est la SEULE zone
   scrollable (overflow-y:auto + min-height:0 ci-dessous) : le header et le
   pied (bouton Déconnexion) restent toujours ancrés/visibles, même quand la
   liste de nav dépasse la hauteur de l'écran (rôle pilote, 10 items) - avant
   ce fix, tout le drawer scrollait comme un bloc et le bouton Déconnexion
   pouvait se retrouver partiellement/totalement hors écran sur petit mobile
   sans que rien n'indique qu'il fallait scroller pour l'atteindre (retour
   utilisateur : "le bouton déconnexion ne fonctionne pas parfois"). */
.burger-drawer {
    width: 280px;
    max-width: 85vw;
    background: #161b22;
    border-right: 1px solid #30363d;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: burgerSlideIn 0.22s ease-out;
    font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
    box-shadow: 6px 0 24px rgba(0,0,0,0.4);
}

@keyframes burgerSlideIn {
    from { transform: translateX(-100%); opacity: 0.6; }
    to   { transform: translateX(0);    opacity: 1;   }
}

/* En-tête du drawer */
.burger-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #30363d;
    flex-shrink: 0;
}

/* Zone nav - min-height:0 est nécessaire pour qu'un enfant flex avec
   overflow:auto se mette réellement à scroller au lieu de pousser son
   parent (comportement par défaut sinon : min-height:auto = pas de scroll). */
.burger-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
}

/* Item de nav */
.burger-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    transition: background 0.15s, padding-left 0.15s;
}

.burger-nav-item:hover {
    background: rgba(88, 166, 255, 0.08);
    padding-left: 22px;
}

.burger-nav-icon  { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.burger-nav-label { font-size: 14px; font-weight: 500; color: #e6edf3; }

/* Pied */
.burger-drawer-footer {
    padding: 14px 16px;
    border-top: 1px solid #30363d;
    flex-shrink: 0;
}

/* ── Menu responsive ──────────────────────────────────────────────────────── */
.menu-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 24px; flex-wrap: wrap;
    background: linear-gradient(180deg, #191f28, #161b22);
    border-bottom: 1px solid #30363d;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.menu-header-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.menu-header-title { margin: 0; font-size: 19px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e6edf3; }
.menu-header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.menu-header-user  { font-size: 12px; color: #8b949e; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

.menu-section      { padding: 14px 24px 0; }
.menu-title-block  { padding: 20px 24px 0; }
.menu-title-block h2 { font-size: 17px; font-weight: 600; margin: 0 0 4px; color: #e6edf3; }
.menu-title-sub    { font-size: 12px; color: #8b949e; }

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 14px;
    padding: 16px 24px 48px;
}

.menu-card { border-radius: 12px; }
.menu-card-inner {
    display: flex; flex-direction: column;
    padding: 20px 18px; height: 100%; box-sizing: border-box;
}
.menu-card-icon  { font-size: 30px; margin-bottom: 12px; line-height: 1; }
.menu-card-label { font-weight: 700; font-size: 14px; margin-bottom: 6px; color: #e6edf3; }
.menu-card-desc  { font-size: 11px; color: #8b949e; line-height: 1.45; flex: 1; }
.menu-card-soon  { font-size: 10px; color: #f78166; margin-top: 10px; font-weight: 600; }
.menu-card:hover { border-color: #58a6ff !important; }

/* ── Tablette <= 700px : 2 colonnes */
@media (max-width: 700px) {
    .menu-header       { padding: 10px 16px; }
    .menu-header-user  { max-width: 120px; }
    .menu-section      { padding: 12px 14px 0; }
    .menu-title-block  { padding: 16px 14px 0; }
    .menu-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px 14px 40px;
    }
    .menu-card-inner { padding: 16px 14px; }
    .menu-card-icon  { font-size: 26px; margin-bottom: 10px; }
    .menu-card-label { font-size: 13px; }
}

/* ── Mobile <= 440px : liste verticale, icone + texte cote a cote */
@media (max-width: 440px) {
    .menu-header-title { font-size: 16px; }
    .menu-header-user  { display: none; }
    .menu-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px 12px 36px;
    }
    .menu-card-inner {
        flex-direction: row; align-items: center;
        gap: 14px; padding: 14px;
    }
    .menu-card-icon  { font-size: 28px; margin-bottom: 0; flex-shrink: 0; }
    .menu-card-desc  { display: none; }
    .menu-card-label { font-size: 14px; margin-bottom: 0; }
    .menu-section     { padding: 10px 12px 0; }
    .menu-title-block { padding: 14px 12px 0; }
}

/* ── Accueil (menu.py) — nouveau look : avatar utilisateur, carte coach,
   bouton héro circulaire pour "Démarrer une session" (pilote/both), grille
   de tuiles compactes pour les autres actions (les 3 rôles). ───────────── */

.menu-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: #1c2128; border: 2px solid #ff5b47;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #e6edf3;
    flex-shrink: 0; text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.home-coach-card {
    display: flex; align-items: center; gap: 12px;
    background: linear-gradient(135deg, rgba(255,91,71,0.10), rgba(255,91,71,0.02));
    border: 1px solid rgba(255,91,71,0.30);
    border-radius: 14px; padding: 14px 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.home-coach-avatar {
    width: 52px; height: 52px; border-radius: 50%;
    background: #21262d; border: 2px solid #ff5b47;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: #ff5b47;
    flex-shrink: 0; text-transform: uppercase;
}
.home-coach-info    { flex: 1; min-width: 0; }
.home-coach-eyebrow {
    font-size: 10px; font-weight: 700; color: #8b949e;
    text-transform: uppercase; letter-spacing: 0.6px;
}
.home-coach-name  { font-size: 15px; font-weight: 700; color: #e6edf3; margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-coach-email { font-size: 11px; color: #8b949e; margin-top: 1px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-coach-msg {
    width: 36px; height: 36px; border-radius: 50%;
    background: #21262d; border: 1px solid #30363d;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; text-decoration: none; flex-shrink: 0;
    padding: 0; cursor: pointer; box-sizing: border-box;
    font-family: inherit; transition: border-color 0.15s, transform 0.1s;
}
.home-coach-msg:hover { border-color: #ff5b47; transform: scale(1.06); }

/* ── Vue d'ensemble équipe (accueil coach/both) ──────────────────────────── */
.team-pilot-list {
    display: flex; flex-direction: column; gap: 6px;
}
.team-pilot-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    background: #161b22; border: 1px solid #30363d; border-radius: 10px;
    text-decoration: none; color: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: border-color 0.15s, transform 0.15s;
}
.team-pilot-row:hover { border-color: #ff5b47; transform: translateY(-1px); }
.team-pilot-row--active { border-left: 3px solid #7ee787; }
.team-pilot-row--off { opacity: 0.38; cursor: not-allowed; }
.team-pilot-row--off:hover { border-color: #30363d; transform: none; }
.team-pilot-info { flex: 1; min-width: 0; }
.team-pilot-name {
    font-size: 13px; font-weight: 700; color: #e6edf3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.team-pilot-sub {
    font-size: 11px; color: #8b949e;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.team-pilot-activity {
    font-size: 11px; color: #8b949e; font-weight: 600; flex-shrink: 0;
    white-space: nowrap;
}

/* ── Structure "dashboard" : colonne latérale fixe + contenu principal ──────
   Remplace l'ancien header pleine largeur + grille de tuiles (retour
   utilisateur du 2026-07-29 : "à gauche les liens, à droite le contenu"),
   puis rendue globale sur toutes les pages (même jour : "il faut que le
   menu de gauche soit sur toutes les pages") - colonne en position fixe
   posée une fois dans app.layout (cf. app.py:global_sidebar_layout()),
   #page-content décalé d'autant via .has-global-sidebar (classe posée par
   populate_global_sidebar(), menu.py, à chaque navigation si connecté).
   Pas de contrainte responsive pour cette itération (demande explicite) -
   la colonne est simplement masquée sous 768px, cf. plus bas. */
.home-main {
    font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
    color: #e6edf3;
}

#page-content.has-global-sidebar {
    min-height: 100vh;
}

@media (min-width: 769px) {
    #page-content.has-global-sidebar { margin-left: 260px; }
}

.home-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    z-index: 500;
    background: linear-gradient(180deg, #171c24, #12161d);
    border-right: 1px solid #30363d;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 16px rgba(0,0,0,0.3);
    /* Élément global (hors #page-content) : ne bénéficie d'aucune police
       héritée d'une page (ex. .home-main), doit la fixer explicitement
       (retour utilisateur du 2026-07-29 : "le menu n'est pas dans la
       bonne typo" - sinon tombait sur la police système par défaut). */
    font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
}

.home-sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 20px; border-bottom: 1px solid #30363d;
}
.home-sidebar-brand-title {
    font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
    font-weight: 700; font-size: 17px; letter-spacing: 0.4px; color: #e6edf3;
}

.home-sidebar-nav {
    flex: 1; overflow-y: auto;
    padding: 12px 10px; display: flex; flex-direction: column; gap: 2px;
}
.home-sidebar-sep {
    border: none; border-top: 1px solid #30363d;
    margin: 8px 4px;
}

.home-sidebar-section-title {
    font-size: 10px; font-weight: 700; color: #8b949e;
    text-transform: uppercase; letter-spacing: 0.6px;
    padding: 14px 10px 6px;
}
.home-sidebar-section-title:first-child { padding-top: 4px; }

.home-sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px;
    color: #e6edf3; text-decoration: none;
    font-size: 14px; font-weight: 600;
    transition: background 0.15s, color 0.15s, padding-left 0.15s;
}
.home-sidebar-link:hover { background: rgba(255,91,71,0.10); padding-left: 16px; }
.home-sidebar-link--off  { opacity: 0.38; cursor: not-allowed; }
.home-sidebar-link--off:hover { background: none; padding-left: 12px; }
.home-sidebar-icon  { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.home-sidebar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.home-sidebar-footer {
    padding: 14px 16px; border-top: 1px solid #30363d;
    display: flex; align-items: center; gap: 10px;
}
.home-sidebar-profile { flex: 1; min-width: 0; }
.home-sidebar-username {
    font-size: 12px; font-weight: 600; color: #e6edf3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.home-main {
    flex: 1; min-width: 0;
}
.home-main-header { padding: 26px 32px 4px; }
.home-main-header h2 { margin: 0 0 4px; font-size: 22px; }

/* Bandeau KPI (dernière session / entraînement du jour / prochaine course
   côté pilote, taille d'équipe / à valider côté coach) - remplace le
   bouton héro circulaire, jugé trop "app mobile" pour un dashboard web
   (retour utilisateur du 2026-07-29). */
.home-stats-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px; padding: 18px 20px 4px;
}
.home-stat-card {
    display: flex; flex-direction: column; gap: 6px;
    background: linear-gradient(160deg, #171c24, #12161d);
    border: 1px solid #30363d; border-top: 3px solid #ff5b47;
    border-radius: 14px; padding: 16px 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    text-decoration: none; color: inherit;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.home-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
    border-color: #ff5b47;
}
.home-stat-icon    { font-size: 14px; }
.home-stat-eyebrow {
    font-size: 10px; font-weight: 700; color: #8b949e;
    text-transform: uppercase; letter-spacing: 0.6px;
}
.home-stat-value {
    font-size: 21px; font-weight: 800; color: #e6edf3;
    font-family: 'IBM Plex Mono', monospace;
}
.home-stat-sub {
    font-size: 11px; color: #8b949e;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 440px) {
    .home-stats-row { grid-template-columns: 1fr 1fr; padding: 14px 16px 4px; gap: 10px; }
    .home-stat-card { padding: 12px 14px; }
    .home-stat-value { font-size: 18px; }
}

/* ── Coach : programmes d'entraînement — responsive ──────────────────────── */

.coach-training-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 16px;
    align-items: start;
}

.coach-pilot-sidebar {
    position: sticky;
    top: 20px;
}

/* ── Calendrier coach — layout desktop ──────────────────────────── */
.cal-header-row {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}
.cal-week-section {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}
.cal-week-section.cal-week-current {
    background-color: rgba(255,91,71,0.05);
    border-radius: 6px;
}
.cal-week-label {
    width: 80px;
    flex-shrink: 0;
    padding-top: 4px;
}
.cal-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    flex: 1;
}
.cal-day-wrapper {
    /* transparent on desktop — just a container */
}
.cal-cell-content {
    min-height: 46px;
    padding: 3px;
}
.cal-mobile-day-label {
    display: none;
}

/* ── Calendrier coach — breakpoint mobile ───────────────────────── */
@media (max-width: 640px) {
    .cal-header-row { display: none; }

    .cal-week-section {
        flex-direction: column;
        margin-bottom: 10px;
        border-radius: 10px;
        border: 1px solid #30363d;
        overflow: hidden;
    }
    .cal-week-section.cal-week-current {
        border-color: #ff5b47;
        background-color: transparent;
    }
    .cal-week-label {
        width: auto;
        padding: 8px 12px;
        background-color: #161b22;
        border-bottom: 1px solid #30363d;
    }
    .cal-days-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .cal-day-wrapper {
        display: flex;
        align-items: stretch;
        border-bottom: 1px solid #30363d;
    }
    .cal-day-wrapper:last-child {
        border-bottom: none;
    }
    .cal-mobile-day-label {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 52px;
        flex-shrink: 0;
        padding: 6px 4px;
        border-right: 1px solid #30363d;
    }
    .cal-cell-content {
        flex: 1;
        min-height: 52px !important;
        padding: 6px 8px !important;
    }
    .cal-cell-content button {
        min-height: 36px;
        font-size: 12px !important;
    }
}

@media (max-width: 900px) {
    .coach-training-grid {
        grid-template-columns: 1fr;
        padding: 14px;
        gap: 12px;
    }
    .coach-pilot-sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .coach-training-grid { padding: 10px; }
}

/* ── Mes pistes (my_tracks.py / settings.py:_tab_tracks) ────────────────── */
.track-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.track-detail-left {
    display: flex;
    flex-direction: column;
    max-height: none;
}
.track-detail-right {
    position: relative;
    height: 58vh;
    min-height: 420px;
}

/* ─── DatePicker (react-dates, ex. Date de naissance dans Paramètres) ────
   Thème sombre cohérent avec le reste de l'appli - dcc.DatePickerSingle/
   DatePickerRange rendent en clair par défaut, ces overrides s'appliquent
   partout où le composant est utilisé (pas seulement le champ naissance),
   même sélecteurs CSS génériques de react-dates dans toute l'appli. */
.SingleDatePicker, .DateRangePicker {
    width: 100%;
    display: block;
}
.SingleDatePickerInput, .DateRangePickerInput {
    background-color: transparent !important;
    border: none !important;
    display: flex !important;
    width: 100%;
}
.DateInput {
    background-color: transparent !important;
    width: 100% !important;
}
.DateInput_input {
    background-color: #0d1117 !important;
    color: #e6edf3 !important;
    border: 1px solid #30363d !important;
    border-radius: 10px !important;
    font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    padding: 12px 14px !important;
    min-height: 48px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    line-height: 1.3 !important;
}
.DateInput_input__focused {
    border-color: #58a6ff !important;
    background-color: #0d1117 !important;
}
.DateInput_input::placeholder {
    color: #8b949e !important;
}
.SingleDatePickerInput_calendarIcon {
    filter: invert(0.7);
    margin: 0 8px !important;
}
.SingleDatePickerInput_clearDate {
    background-color: transparent !important;
}
.SingleDatePickerInput_clearDate svg {
    fill: #8b949e !important;
}
.DateInput_fangShape { fill: #161b22 !important; }
.DateInput_fangStroke { stroke: #30363d !important; fill: transparent !important; }
.DayPicker, .DayPicker_transitionContainer, .CalendarMonth, .CalendarMonthGrid,
.DayPicker__withBorder {
    background-color: #161b22 !important;
    border-color: #30363d !important;
}
.CalendarMonth_caption { color: #e6edf3 !important; }
.DayPicker_weekHeader { color: #8b949e !important; }
.CalendarDay__default {
    background-color: #161b22 !important;
    border: 1px solid #30363d !important;
    color: #e6edf3 !important;
}
.CalendarDay__default:hover {
    background-color: #21262d !important;
    color: #e6edf3 !important;
}
.CalendarDay__blocked_out_of_range, .CalendarDay__blocked_out_of_range:hover {
    background-color: #0d1117 !important;
    color: #484f58 !important;
}
.CalendarDay__selected, .CalendarDay__selected:hover,
.CalendarDay__selected_span, .CalendarDay__hovered_span {
    background-color: #58a6ff !important;
    border-color: #58a6ff !important;
    color: #04141f !important;
}
.DayPickerNavigation_button__default {
    border: 1px solid #30363d !important;
    background-color: #0d1117 !important;
}
.DayPickerNavigation_svg__horizontal { fill: #e6edf3 !important; }
.CalendarMonth_table { border-collapse: separate !important; }

/* Le popup se recadre pour ne pas déborder d'un écran étroit (mobile). */
@media (max-width: 480px) {
    .DayPicker_transitionContainer, .DayPicker {
        width: 100% !important;
        max-width: 92vw !important;
    }
    .CalendarMonth, .CalendarMonthGrid {
        width: 100% !important;
    }
}

/* ─── Dash 4.x design-system tokens — thème sombre ─────────────────────────
   Dash 4 utilise des CSS variables pour Dropdown, DatePicker, etc.
   On écrase les valeurs par défaut (fond blanc) par les tokens du thème. */
:root {
    /* Dash 4 utilise deux casses : Strong (dropdown) et strong (checklist/radio) */
    --Dash-Fill-Inverse-Strong: #0d1117;
    --Dash-Fill-Inverse-strong: #0d1117;
    --Dash-Text-Strong:         #e6edf3;
    --Dash-Text-Weak:           #8b949e;
    --Dash-Text-Disabled:       #8b949e;
    --Dash-Text-Primary:        #e6edf3;
    --Dash-Stroke-Strong:       #30363d;
    --Dash-Stroke-Weak:         #21262d;
    --Dash-Fill-Disabled:       #30363d;
    --Dash-Fill-Interactive-Strong: #58a6ff;
    --Dash-Fill-Interactive-Weak:   #1a2f4a;
    --Dash-Fill-Primary-Hover:  rgba(88, 166, 255, 0.12);
    --Dash-Fill-Primary-Active: rgba(88, 166, 255, 0.22);
    --Dash-Shading-Strong:      rgba(0, 0, 0, 0.65);
    --Dash-Shading-Weak:        rgba(0, 0, 0, 0.35);
    --Dash-Spacing:             4px;
}

/* Dropdown — trigger (contrôle) */
.dash-dropdown {
    border: 1px solid #30363d !important;
    border-radius: 10px !important;
    min-height: 48px !important;
    font-size: 16px !important;
}
.dash-dropdown-trigger {
    min-height: 48px !important;
    padding: 0 14px !important;
    font-size: 16px !important;
}
/* Dropdown — menu déroulant */
.dash-dropdown-content {
    background: #161b22 !important;
    border: 1px solid #30363d !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6) !important;
    z-index: 999 !important;
}
/* Dropdown — options */
.dash-dropdown-option {
    font-size: 15px !important;
    padding: 12px 14px !important;
    cursor: pointer !important;
}
.dash-dropdown-option:hover {
    background: #21262d !important;
}
/* Dropdown — recherche */
.dash-dropdown-search-container {
    background: #0d1117 !important;
    border-color: #30363d !important;
}
.dash-dropdown-search {
    font-size: 15px !important;
    color: #e6edf3 !important;
}

/* DatePicker — champ de saisie */
.dash-datepicker-input-wrapper {
    background: #0d1117 !important;
    border: 1px solid #30363d !important;
    border-radius: 10px !important;
    min-height: 48px !important;
    padding: 0 14px !important;
    font-size: 16px !important;
}
.dash-datepicker-input {
    font-size: 16px !important;
    height: 46px !important;
    color: #e6edf3 !important;
    background: transparent !important;
}
/* Checklist / RadioItems — options (texte et case) */
.dash-options-list-option {
    font-size: 15px !important;
    padding: 6px 0 !important;
    color: #e6edf3 !important;
}
.dash-options-list-option-checkbox {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    margin-right: 8px !important;
}

/* DatePicker — calendrier popup */
.dash-datepicker-content {
    background: #161b22 !important;
    border: 1px solid #30363d !important;
    border-radius: 10px !important;
}
.dash-datepicker-controls {
    background: #161b22 !important;
    color: #e6edf3 !important;
}

/* Placeholder visible sur la page de login */
#login-username::placeholder,
#login-password::placeholder,
#register-email::placeholder,
#register-password::placeholder,
#register-password2::placeholder {
    color: #8b949e;
    opacity: 1;
}

/* Dash impose height:100% sur .dash-input-element ce qui annule le padding.
   On fixe une hauteur explicite pour les champs de login/inscription. */
#login-username .dash-input-element,
#login-password .dash-input-element,
#register-email .dash-input-element,
#register-password .dash-input-element,
#register-password2 .dash-input-element {
    height: 60px;
    padding: 0 14px;
}

/* ── Dropdown onglets dashboard bis (dbis-tabs) ──────────────────────────── */
/* Dash v2 utilise react-select v1 : selectors .Select-* */
.dbis-tabs-dropdown {
    margin: 8px 0 4px;
}

.dbis-tabs-dropdown .Select-control {
    background-color: #161b22 !important;
    border: 1px solid #30363d !important;
    border-radius: 8px !important;
    color: #e6edf3 !important;
    min-height: 42px !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

.dbis-tabs-dropdown .Select-control:hover {
    border-color: #ff5b47 !important;
}

.dbis-tabs-dropdown .Select-value,
.dbis-tabs-dropdown .Select-value-label {
    color: #e6edf3 !important;
    line-height: 42px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.dbis-tabs-dropdown .Select-placeholder {
    color: #8b949e !important;
    line-height: 42px !important;
}

.dbis-tabs-dropdown .Select-arrow-zone .Select-arrow {
    border-top-color: #8b949e !important;
}

.dbis-tabs-dropdown.is-open .Select-control {
    border-color: #ff5b47 !important;
    border-bottom-color: #30363d !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.dbis-tabs-dropdown .Select-menu-outer {
    background-color: #161b22 !important;
    border: 1px solid #ff5b47 !important;
    border-top: none !important;
    border-bottom-left-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
    z-index: 999 !important;
}

.dbis-tabs-dropdown .Select-option {
    background-color: #161b22 !important;
    color: #e6edf3 !important;
    font-size: 14px !important;
    padding: 10px 14px !important;
    cursor: pointer !important;
}

.dbis-tabs-dropdown .Select-option.is-focused {
    background-color: #21262d !important;
    color: #ffffff !important;
}

.dbis-tabs-dropdown .Select-option.is-selected {
    background-color: #7e0000 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.dbis-tabs-dropdown .Select-option.is-selected.is-focused {
    background-color: #9e1010 !important;
}

/* session_times.py (page "Temps au tour" pilote) - liste des tours à gauche,
   détail du tour sélectionné (splits) à droite. Repasse en 1 colonne sous
   700px pour rester utilisable sur mobile. */
.st-two-col {
    display: grid;
    grid-template-columns: minmax(240px, 380px) 1fr;
    gap: 16px;
    align-items: start;
}

@media (max-width: 700px) {
    .st-two-col {
        grid-template-columns: 1fr;
    }
}

/* ─── Cette semaine (details/summary collapsible) ──────────────── */
details > summary {
    list-style: none;
    user-select: none;
}
details > summary::-webkit-details-marker {
    display: none;
}
details > summary::marker {
    display: none;
}

/* ─── Modal coach training — actions mobile ─────────────────────── */
@media (max-width: 640px) {
    .coach-block-actions {
        flex-direction: column !important;
    }
    .coach-block-actions > * {
        width: 100% !important;
    }
    .coach-block-actions button {
        width: 100% !important;
        min-height: 48px !important;
    }
    .coach-block-actions > div {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }
}

