/* Espace medecin. Polices locales, deja servies par visio.css ; redeclarees ici pour les pages sans cette feuille. */
@font-face {
  font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}

body.dx {
  --bg: #F4F6F5;
  --surface: #FFFFFF;
  --text-primary: #10262B;
  --text-secondary: #4A5D61;
  --text-tertiary: #4A5D61;
  --border: #DCE3E1;
  --border-strong: #C9D3D1;
  --accent: #0B5F63;
  --accent-strong: #08494C;
  --accent-soft: #E3EFEE;
  --accent-ink: #0B5F63;
  --urgent-soft: #FBEDE3;
  --urgent: #8A3E12;
  --urgent-border: #E2A783;
  --past-soft: #EEF1F0;
  --radius: 18px;
  --font: 'Atkinson Hyperlegible', system-ui, sans-serif;
  background: #F4F6F5;
  color: #10262B;
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
  font-size: 16px;
}

body.dx .mono, body.dx .password-display { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-weight: 500; }

body.dx .dx-page { max-width: 720px; margin: 0 auto; padding: 8px 16px 32px; }
body.dx .dx-title { font-size: 28px; line-height: 1.2; font-weight: 700; margin: 0; }
body.dx .dx-sub { color: #4A5D61; font-size: 16px; margin-top: 4px; }

body.dx .card { background: #fff; border: 1px solid #DCE3E1; border-radius: 18px; }
body.dx .btn { min-height: 48px; border-radius: 14px; font-size: 16px; font-family: inherit; position: relative; }
body.dx .btn-primary { min-height: 56px; background: #0B5F63; color: #fff; justify-content: center; }
body.dx .btn-secondary { background: #fff; color: #10262B; border: 1px solid #C9D3D1; }
body.dx .btn-soft { background: #E3EFEE; color: #0B5F63; border: none; }
body.dx .btn-block { width: 100%; }
body.dx .btn-white { background: #fff; color: #0B5F63; min-height: 56px; border-radius: 14px; }

/* Etat selectionne (Quand, Duree) : rempli #0B5F63, texte blanc, coche blanche a gauche (pseudo-element, pas d'image). */
body.dx .btn[aria-pressed="true"] {
  background: #0B5F63; border-color: #0B5F63; color: #fff; padding-left: 34px;
}
body.dx .btn[aria-pressed="true"]::before {
  content: ''; position: absolute; left: 13px; top: 50%; width: 7px; height: 12px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-65%) rotate(45deg);
}
body.dx .btn[aria-pressed="false"] { background: #fff; color: #10262B; border-color: #C9D3D1; }

body.dx .hero {
  background: #0B5F63; color: #fff; border-radius: 20px; padding: 20px; margin-bottom: 20px;
}
body.dx .hero .dx-kicker { font-size: 15px; opacity: .9; }
body.dx .hero .dx-title { color: #fff; font-size: 26px; }
body.dx .hero .btn-white { display: flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 700; }

body.dx .dx-section { font-size: 18px; font-weight: 700; margin: 22px 0 10px; }
body.dx .invite-card { padding: 16px; margin-bottom: 12px; }
body.dx .pair { display: flex; gap: 10px; }
body.dx .pair form, body.dx .pair .btn { flex: 1; }
body.dx .pair .btn { width: 100%; justify-content: center; }

body.dx .room-card, body.dx .session-card { display: block; padding: 16px; margin-bottom: 12px; color: inherit; text-decoration: none; }
body.dx .session-card { display: flex; gap: 14px; align-items: center; }
body.dx .date-block {
  width: 64px; flex-shrink: 0; text-align: center; background: #E3EFEE; color: #0B5F63;
  border-radius: 14px; padding: 8px 4px;
}
body.dx .date-block .dow { font-size: 13px; font-weight: 700; text-transform: uppercase; }
body.dx .date-block .dom { font-size: 26px; font-weight: 700; line-height: 1; }

body.dx .team-line { padding: 14px 16px; border-top: 1px solid #DCE3E1; }
body.dx .team-line:first-child { border-top: none; }
body.dx details.team summary { cursor: pointer; color: #0B5F63; font-weight: 700; padding: 8px 0; }
body.dx .person { padding: 8px 0; border-top: 1px solid #DCE3E1; }

body.dx .when-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body.dx .when-grid .choice, body.dx .durations .choice, body.dx .durations .btn { min-height: 56px; }
body.dx .durations { display: flex; gap: 10px; }
body.dx .durations .btn { flex: 1; justify-content: center; }

/* Etablissements a cocher : non coche = blanc, bordure #C9D3D1 ; coche = bordure 2px #0B5F63, fond #E3EFEE, case pleine. */
body.dx .choice-row {
  display: flex; gap: 10px; align-items: center; padding: 14px; border: 1px solid #C9D3D1; border-radius: 16px;
  margin-bottom: 10px; background: #fff;
}
body.dx .choice-row.mine, body.dx .choice-row[aria-pressed="true"] {
  background: #E3EFEE; border: 2px solid #0B5F63; padding: 13px;
}
body.dx .choice-row input { width: 22px; height: 22px; accent-color: #0B5F63; }
body.dx .counter { display: flex; align-items: center; gap: 16px; }
body.dx .counter button { width: 56px; height: 56px; border-radius: 14px; font-size: 28px; }
body.dx .counter output { font-size: 28px; font-weight: 700; min-width: 2ch; text-align: center; }
body.dx .warn {
  background: #FBEDE3; color: #8A3E12; border-radius: 14px; padding: 12px 14px; font-size: 15px; margin-top: 8px;
}
body.dx .sticky-bar {
  position: sticky; bottom: 88px; background: #fff; border: 1px solid #DCE3E1; border-radius: 16px;
  padding: 12px; margin-top: 16px;
}
body.dx .check-list { list-style: none; padding: 0; margin: 8px 0 16px; }
body.dx .check-list li { padding: 4px 0 4px 28px; position: relative; color: #4A5D61; }
body.dx .check-list li.ok { color: #0B5F63; }
body.dx .check-list li.ok::before { content: ''; position: absolute; left: 4px; top: 10px; width: 8px; height: 14px; border: solid #0B5F63; border-width: 0 2px 2px 0; transform: rotate(45deg); }

body.dx .topbar .dx-title, body.dx .back { color: inherit; }
body.dx a.back { display: inline-flex; align-items: center; min-height: 48px; color: #0B5F63; font-weight: 700; }

/* Recapitulatif detaille (version PC), une ligne par information avec icone. */
body.dx .dx-recap-line { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 15px; }
body.dx .dx-recap-line svg { flex-shrink: 0; color: #0B5F63; }
body.dx .dx-recap-note { font-size: 13px; color: #4A5D61; margin: 10px 0 16px; }

/* Legende du calendrier. */
body.dx .dx-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; color: #4A5D61; }
body.dx .dx-legend-item { display: flex; align-items: center; gap: 7px; }
body.dx .dx-legend-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
body.dx .dx-legend-dot.confirmed { background: #0B5F63; }
body.dx .dx-legend-dot.pending { background: #FBEDE3; border: 1px solid #E2A783; }
body.dx .dx-legend-dot.past { background: #EEF1F0; border: 1px solid #C9D3D1; }

/* Carte d'aide (mois sans session). */
body.dx .dx-empty-help {
  border: 1px dashed #C9D3D1; border-radius: 16px; padding: 16px; margin-top: 14px; color: #4A5D61; font-size: 15px;
}

/* Petit menu de choix de room (bouton Programmer, details/summary, sans script en ligne). */
body.dx .dx-room-picker { position: relative; display: inline-block; }
body.dx .dx-room-picker summary { list-style: none; cursor: pointer; }
body.dx .dx-room-picker summary::-webkit-details-marker { display: none; }
body.dx .dx-room-picker-menu {
  position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid #DCE3E1;
  border-radius: 14px; padding: 8px; min-width: 240px; box-shadow: 0 8px 24px rgba(16, 38, 43, .14); z-index: 30;
}
body.dx .dx-room-picker-menu a {
  display: block; padding: 10px 12px; border-radius: 10px; color: #10262B; text-decoration: none; font-weight: 600;
}
body.dx .dx-room-picker-menu a:hover { background: #E3EFEE; }

/* Bandeau PC : session en cours ou qui commence dans 15 min. */
body.dx .dx-pc-banner {
  background: #0B5F63; color: #fff; border-radius: 20px; padding: 18px 22px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
body.dx .dx-pc-banner .dx-title { color: #fff; font-size: 22px; }
body.dx .dx-pc-banner .dx-kicker { font-size: 14px; opacity: .9; }

/* Utilitaires d'affichage selon la largeur (le HTML reste identique, seul le CSS change). */
body.dx .dx-pc-only { display: none; }
body.dx .dx-mobile-only { display: block; }

@media (max-width: 900px) {
  body.dx .bottom-nav { height: 76px; padding-bottom: env(safe-area-inset-bottom); }
  /* Espace reserve en bas = hauteur de la barre (76px) + 24px, pour que rien ne reste cache en defilant. */
  body.dx .app-shell { padding-bottom: 100px; }
  body.dx .sticky-bar { bottom: 100px; }
}
@media (min-width: 901px) {
  body.dx .main-col { display: flex; flex-direction: column; align-items: center; }
  body.dx .main-col > * { width: 100%; max-width: 720px; }
  body.dx .sidebar { width: 220px; }
}

/* Version PC (>= 1024px) : colonne large, deux colonnes, elements specifiques. */
@media (min-width: 1024px) {
  body.dx .main-col > .dx-wide { max-width: 1200px; }
  body.dx .dx-page.dx-wide { max-width: 1200px; }
  body.dx .dx-pc-only { display: block; }
  body.dx .dx-mobile-only { display: none; }

  body.dx .dx-home-header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px;
  }

  body.dx .dx-home-grid, body.dx .dx-room-grid, body.dx .dx-session-grid, body.dx .dx-form-grid {
    display: grid; grid-template-columns: 65fr 35fr; gap: 24px; align-items: start;
  }
  body.dx .dx-room-grid { grid-template-areas: "sessions schedule" "sessions team"; }
  body.dx .dx-room-sessions { grid-area: sessions; }
  body.dx .dx-room-schedule { grid-area: schedule; }
  body.dx .dx-room-team { grid-area: team; }

  body.dx .dx-session-grid { grid-template-areas: "main actions" "team invite"; }
  body.dx .dx-session-main { grid-area: main; }
  body.dx .dx-session-actions { grid-area: actions; }
  body.dx .dx-session-team { grid-area: team; }
  body.dx .dx-session-invite { grid-area: invite; }

  body.dx .dx-form-main { min-width: 0; }
  body.dx .dx-form-card {
    background: #fff; border: 1px solid #DCE3E1; border-radius: 18px; padding: 20px 24px; margin-bottom: 20px;
  }
  body.dx .dx-form-card .dx-section:first-child { margin-top: 0; }
  body.dx .dx-when-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
  body.dx .dx-when-row > #when-fields { display: flex; gap: 16px; flex: 1 1 260px; margin-top: 0; }
  body.dx .dx-when-row > #when-fields > .field { flex: 1; }
  body.dx .dx-when-row > .durations { flex: 0 0 auto; }
  body.dx .choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  body.dx .choice-grid .choice-row { margin-bottom: 0; }
  body.dx .sticky-bar { position: sticky; top: 24px; bottom: auto; margin-top: 0; }

  body.dx .dx-legend { margin-top: 14px; }
}

/* =============================================================
   Mon reseau : onglets, cartes etablissement, groupes medecins,
   barre de selection fixe en bas, pastilles de recap.
   ============================================================= */

body.dx .dx-help { color: #4A5D61; font-size: 15px; margin: 10px 0 14px; }
body.dx .dx-kicker { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }

/* Bandeaux (en attente + en cours) */
body.dx .dx-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px;
  border-radius: 16px; margin: 14px 0 0;
}
body.dx .dx-banner-warn { background: #FBEDE3; color: #8A3E12; border: 1px solid #E2A783; }
body.dx .dx-banner-warn .dx-sub { color: #8A3E12; opacity: .9; }
body.dx .dx-banner-live { background: #0B5F63; color: #fff; }
body.dx .dx-banner-live .dx-sub { color: #DCE3E1; }
body.dx .dx-banner-title { font-size: 18px; font-weight: 700; }
body.dx .dx-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Switch de room (plusieurs rooms accessibles) */
body.dx .dx-room-switcher { margin-top: 14px; }
body.dx .dx-room-switcher-grid { display: flex; flex-wrap: wrap; gap: 10px; }
body.dx .field-label { display: block; font-weight: 700; margin-bottom: 6px; color: #10262B; }

/* Onglets « Par etablissement » / « Reunion specialiste » */
body.dx .dx-tabs {
  display: flex; gap: 10px; margin: 20px 0 10px;
}
body.dx .dx-tab {
  width: 100%; min-height: 48px; border: 1px solid #C9D3D1; background: #fff; color: #10262B;
  border-radius: 14px; font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
body.dx .dx-tab-active { background: #0B5F63; color: #fff; border-color: #0B5F63; }

/* Grille (3 colonnes sur PC, 2 sur tablette, 1 sur mobile) */
body.dx .dx-grid-3 { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 10px; }
body.dx .dx-grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 10px; }
@media (min-width: 640px) {
  body.dx .dx-grid-3 { grid-template-columns: 1fr 1fr; }
  body.dx .dx-grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  body.dx .dx-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* Carte etablissement (cliquable visuellement : bordure, ombre legere, chevron, hover) */
body.dx .dx-estab-card {
  display: flex; gap: 12px; padding: 16px; background: #fff; border: 1px solid #C9D3D1;
  border-radius: 18px; box-shadow: 0 1px 3px rgba(16, 38, 43, .05); cursor: pointer; align-items: flex-start;
  transition: box-shadow .15s ease, border-color .15s ease, transform .05s ease;
}
body.dx .dx-estab-card:hover { box-shadow: 0 4px 14px rgba(16, 38, 43, .10); border-color: #0B5F63; }
body.dx .dx-estab-card.is-selected { background: #E3EFEE; border: 2px solid #0B5F63; padding: 15px; }
body.dx .dx-estab-check { flex-shrink: 0; margin: 0; padding: 0; }
body.dx .dx-estab-checkbox {
  width: 28px; height: 28px; border: 2px solid #0B5F63; border-radius: 8px; background: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
body.dx .dx-estab-card.is-selected .dx-estab-checkbox,
body.dx .dx-doctor-row.is-selected .dx-estab-checkbox { background: #0B5F63; }
body.dx .dx-estab-body { flex: 1; min-width: 0; }
body.dx .dx-estab-name { font-size: 17px; font-weight: 700; color: #10262B; }
body.dx .dx-link { color: #0B5F63; font-weight: 700; display: inline-block; margin-top: 8px; text-decoration: none; }
body.dx .dx-link:hover { text-decoration: underline; }
body.dx .dx-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
body.dx .dx-chip {
  background: #E3EFEE; color: #0B5F63; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600;
}

/* Groupe par etablissement (onglet Specialiste) */
body.dx .dx-group { margin-top: 22px; }
body.dx .dx-group-title { font-size: 17px; font-weight: 700; margin: 0 0 10px; color: #10262B; }

/* Ligne medecin (cochable) */
body.dx .dx-doctor-row {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: #fff;
  border: 1px solid #C9D3D1; border-radius: 14px; cursor: pointer;
  transition: box-shadow .15s ease, border-color .15s ease;
}
body.dx .dx-doctor-row:hover { box-shadow: 0 2px 8px rgba(16, 38, 43, .08); border-color: #0B5F63; }
body.dx .dx-doctor-row.is-selected { background: #E3EFEE; border: 2px solid #0B5F63; padding: 11px 13px; }
body.dx .dx-doctor-name { font-size: 16px; font-weight: 700; color: #10262B; }

/* Pastilles de recap (programmation) */
body.dx .dx-pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
body.dx .dx-pill {
  background: #E3EFEE; color: #10262B; border: 1px solid #0B5F63; border-radius: 999px;
  padding: 6px 12px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px;
}

/* Paire d'actions (deux boutons cote a cote) */
body.dx .dx-pair { display: flex; gap: 10px; flex-wrap: wrap; }
body.dx .dx-pair form, body.dx .dx-pair .btn { flex: 1; min-width: 160px; }
body.dx .dx-pair .btn { width: 100%; justify-content: center; }

/* Barre de selection flottante en bas (reste visible meme en defilant) */
body.dx .dx-select-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: #0B5F63; color: #fff; box-shadow: 0 -6px 20px rgba(16, 38, 43, .18);
  padding-bottom: env(safe-area-inset-bottom);
}
body.dx .dx-select-bar-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 16px; display: flex;
  gap: 12px; align-items: center; flex-wrap: wrap;
}
body.dx .dx-select-bar-text { flex: 1; min-width: 220px; }
body.dx .dx-select-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
body.dx .dx-btn-on-dark { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .5); }
body.dx .dx-btn-on-dark:hover { background: rgba(255, 255, 255, .1); }
@media (max-width: 900px) {
  /* La barre doit flotter au-dessus de la bottom-nav sur mobile. */
  body.dx .dx-select-bar { bottom: 76px; }
}

/* Garde de la place en bas de page pour que la barre ne recouvre pas le contenu. */
body.dx .dx-page { padding-bottom: 120px; }
@media (max-width: 900px) {
  body.dx .dx-page { padding-bottom: 200px; }
}

/* Pastille de notification (menu + bottom-nav) */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #8A3E12; color: #fff; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  margin-left: 8px; line-height: 1;
}
.nav-badge-bottom {
  position: absolute; top: 2px; right: calc(50% - 20px); margin-left: 0;
}


body.dx details > summary.btn { display: flex; align-items: center; justify-content: center; }
body.dx details > summary.btn::-webkit-details-marker { display: none; }
