/*
 * director.css — Dashboard Directeur
 * Styles spécifiques aux pages de l'espace Directeur/Adjoint.
 * Chargé APRÈS shared-app-base.css qu'il complète et surcharge.
 * Fichiers : /director/director-dashboard.html, /director/director-profile.html
 *
 * Contient : layout directeur, topbar, cartes stats (connexions, messages,
 * signalements), config établissement, réservations, vélos, ateliers,
 * infos pratiques, abonnement.
 */

.director-body {
  background:
    radial-gradient(circle at 8% 10%, oklch(0.95 0.04 230) 0%, transparent 34%),
    radial-gradient(circle at 86% 0%, oklch(0.96 0.04 170) 0%, transparent 36%),
    linear-gradient(180deg, oklch(0.985 0.01 230) 0%, oklch(0.96 0.012 234) 100%);
}

.director-topbar {
  box-shadow: 0 10px 30px oklch(0.29 0.03 240 / 0.22);
}

.director-topbar-content {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.director-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.82;
}

.director-title {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.1;
}

.director-topbar-left {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.director-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.director-icon-btn {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}


.director-page {
  display: grid;
  gap: 0.9rem;
  padding-top: 0.9rem;
}

/* ── Zones ──────────────────────────────────────────────────────────────── */
.director-zone {
  display: contents; /* transparent to grid — children participent directement */
}

.director-zone-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.5rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid oklch(0.88 0.03 245);
}

.director-zone-header--first {
  margin-top: 0;
}

.director-zone-header::after {
  content: '';
  flex: 1;
}

.director-zone-icon {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.director-zone-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: oklch(0.38 0.08 245);
  white-space: nowrap;
}

.director-hero {
  background: linear-gradient(140deg, oklch(0.995 0.006 240), oklch(0.97 0.018 229));
}

.director-hero-grid {
  display: grid;
  gap: 0.8rem;
}

.director-hero h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.director-hero p {
  margin: 0;
  color: var(--muted);
}

.director-quick-actions {
  display: grid;
  gap: 0.55rem;
}

.director-inline-inputs {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.director-form-grid {
  display: grid;
  gap: 0.55rem;
}

.director-fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem;
  margin: 0.4rem 0 0.1rem;
  background: oklch(0.985 0.01 235);
}

.director-day-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.director-curve-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem;
  background: oklch(0.99 0.006 236);
}

.director-curve-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.director-curve-svg {
  width: 100%;
  height: 180px;
  display: block;
}

.director-toast {
  position: fixed;
  left: 50%;
  z-index: 110;
  transform: translateX(-50%) translateY(14px);
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--toast-bg, oklch(0.38 0.10 245));
  color: white;
  padding: 0.62rem 0.8rem;
  border-radius: 999px;
  font-size: 0.86rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.director-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Infos pratiques — grille de cartes 3×4 pleine largeur ──────────────── */
#infoMediaList {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (max-width: 900px) {
  #infoMediaList {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 560px) {
  #infoMediaList {
    grid-template-columns: repeat(2, 1fr);
  }
}

.director-info-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px oklch(0.29 0.03 240 / 0.08);
  transition: box-shadow 0.15s, opacity 0.15s;
  user-select: none;
}

.director-info-card--draggable {
  cursor: default;
}

.info-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  border-top: 1px solid var(--line, #e2e8f0);
  color: var(--muted, #94a3b8);
  cursor: grab;
  touch-action: none;
  user-select: none;
  font-size: 1.1rem;
  letter-spacing: 3px;
  transition: background 0.12s, color 0.12s;
}

.info-drag-handle:hover {
  background: oklch(0.97 0.01 240);
  color: oklch(0.46 0.05 245);
}

.info-drag-handle:active {
  cursor: grabbing;
  background: oklch(0.94 0.015 245);
}

.director-info-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.director-info-card__body {
  padding: 0.45rem 0.55rem 0.5rem;
}

.director-info-card__title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.35rem;
}

.director-info-card__actions {
  display: flex;
  gap: 0.3rem;
}

.director-info-card__actions .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

/* Case vide — bouton "+" */
.director-info-card--empty {
  border: 1.5px dashed oklch(0.80 0.03 240);
  background: oklch(0.98 0.006 240);
}

.director-info-card__add-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  gap: 0.3rem;
  cursor: pointer;
  color: oklch(0.60 0.05 240);
  font-size: 0.78rem;
  transition: background 0.15s, color 0.15s;
}

.director-info-card__add-btn:hover {
  background: oklch(0.95 0.025 245);
  color: oklch(0.45 0.18 245);
}

.director-info-card__plus {
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 300;
}

/* Formulaire inline dans une tuile vide ou en édition */
.director-info-card__inline-form {
  padding: 0.6rem 0.55rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.director-info-card__inline-form input[type="text"] {
  width: 100%;
  font-size: 0.8rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.director-info-card__inline-form input[type="text"]:focus {
  outline: 2px solid oklch(0.55 0.20 245);
  border-color: transparent;
}

.director-info-card__inline-file {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.director-info-card__inline-file span {
  font-size: 0.72rem;
  color: oklch(0.50 0.02 240);
}

.director-info-card__inline-file input[type="file"] {
  font-size: 0.74rem;
  width: 100%;
}

.director-info-card__inline-actions {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.1rem;
}

.director-info-card__inline-actions .btn {
  flex: 1;
  padding: 0.25rem 0.4rem;
  font-size: 0.76rem;
}

.director-info-card__inline-form .error {
  font-size: 0.72rem;
  margin: 0;
  min-height: 0;
}

/* État édition d'une tuile pleine */
.director-info-card--editing img {
  display: none;
}

.director-info-card--editing .director-info-card__body {
  display: none;
}

/* États drag-and-drop */
.director-info-card.dragging {
  opacity: 0.3;
  pointer-events: none;
}

.director-info-card.drag-over {
  outline: 2px solid oklch(0.52 0.22 245);
  background: oklch(0.97 0.02 245);
}

.director-plan-preview {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: oklch(0.99 0.008 236);
  padding: 0.45rem;
}

.director-plan-preview img {
  width: 100%;
  max-width: 460px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
}

.director-subtitle {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
}

.director-issue-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.director-issue-services label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  color: var(--text);
}

.director-issue-mappings {
  display: grid;
  gap: 0.45rem;
}

.director-issue-row {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 220px);
  gap: 0.55rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.45rem;
  background: #fff;
}

.director-issue-row label {
  font-size: 0.86rem;
  color: var(--text);
}

.director-issue-ticket {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.55rem;
  margin-bottom: 0.5rem;
}

.director-issue-ticket:last-child {
  margin-bottom: 0;
}

.director-issue-ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.director-issue-ticket textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem;
  resize: none;
  height: 62px;
  overflow-y: auto;
  margin-top: 0.25rem;
}

.director-issue-ticket-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.director-issue-ticket-controls .btn {
  width: auto;
  min-width: 0;
}

@media (min-width: 820px) {
  .director-page {
    grid-template-columns: 1.1fr 1fr;
    gap: 1rem;
  }

  .director-hero {
    grid-column: 1 / -1;
  }

  .director-hero-grid {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .director-quick-actions {
    min-width: 240px;
  }

  .director-day-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .director-issue-services {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* --- Accès Chat : statistiques de connexion --- */

.dir-connection-stats {
  margin-top: 0.5rem;
}

.dir-cs-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.dir-cs-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.dir-cs-period-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.dir-cs-btn {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(0.985 0.008 236);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  line-height: 1.3;
  white-space: nowrap;
}

.dir-cs-btn:hover {
  background: oklch(0.96 0.015 234);
  border-color: oklch(0.76 0.04 240);
}

.dir-cs-btn.active {
  background: oklch(0.58 0.14 245);
  border-color: oklch(0.58 0.14 245);
  color: #fff;
}

.dir-cs-total {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
  color: var(--text);
}

.dir-cs-rows {
  display: grid;
  gap: 0.65rem;
}

.dir-cs-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
}

.dir-cs-row-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.dir-cs-bar-wrap {
  height: 10px;
  border-radius: 999px;
  background: oklch(0.92 0.012 236);
  overflow: hidden;
}

.dir-cs-bar {
  height: 100%;
  border-radius: 999px;
  background: oklch(0.58 0.14 245);
  transition: width 0.35s ease;
  min-width: 2px;
}

.dir-cs-bar--b {
  background: oklch(0.54 0.11 155);
}

.dir-cs-bar--c {
  background: oklch(0.62 0.09 50);
}

.dir-cs-pct {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dir-cs-row-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.dir-cs-row-meta--nowrap {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Top messages (plus liké / plus commenté) */
.dir-top-msg {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  line-height: 1.25;
}
.dir-top-msg-label {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.dir-top-msg-text {
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Graphe horaire (barres 2h) ──────────────────────────────────────────── */

/* Les cartes Messages et Connexions sont en flex-column pour pousser le graphe en bas */
#section-summary,
#section-connexions {
  display: flex;
  flex-direction: column;
}

#section-summary #summary,
#section-connexions #dir-cs-stats-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dir-hourly-chart {
  margin-top: 1rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
}

.dir-hourly-svg {
  display: block;
  width: 100%;
  height: 70px;
  overflow: visible;
}

@media (min-width: 560px) {
  .dir-cs-row {
    grid-template-columns: 200px 1fr 44px;
    align-items: center;
    gap: 0.45rem;
  }

  .dir-cs-row-meta {
    grid-column: 2 / -1;
    margin-top: 0;
  }
  .dir-cs-row-meta--nowrap {
    grid-column: 1 / -1;
  }
}

/* Summary tiles — grille 4 colonnes égales, hauteur uniforme */
#summary .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  align-items: stretch;
}
#summary .stats-grid .stat-tile {
  min-width: 0;
}
/* Couleur accent : tuile Écrivains (dernière) en orange */
#summary .stat-tile:last-child { border-top-color: oklch(0.65 0.14 55); }
#summary .stat-tile:last-child .stat-value { color: oklch(0.42 0.12 55); }

.dir-writer-record {
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: var(--muted);
}

/* === Typographie uniforme — h2 des 3 cartes Mon établissement === */

/* h2 cartes Mon établissement — margin-bottom identique aux cartes Vacanciers (défaut navigateur) */
#section-qr h2,
#section-services h2,
#section-accueil h2 {
  font-weight: 700;
  line-height: 1.2;
}

/* QR — p.muted directement sous h2 : supprimer sa marge-top browser pour ne pas doubler le gap */
#weeklyMeta {
  margin-top: 0;
}

/* WIFI — formulaire plus aéré sans changer la structure */
#welcomeConfigForm.director-form-grid {
  gap: 0.85rem;
}

/* Bouton désactivé — validation formulaire */
.director-page .btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

/* Inputs désactivés — champs conditionnels */
.director-page input:disabled {
  opacity: 0.4;
  background: oklch(0.94 0.01 245);
}

/* Paragraphes résultat vides — n'occupent pas d'espace */
#transportResult:empty,
#welcomeConfigResult:empty {
  display: none;
}

/* === QR Hebdomadaire — image redimensionnable + code discret === */

.weekly-qr-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  border: 1px solid oklch(0.88 0.03 245);
}

.weekly-qr-code {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: oklch(0.55 0.05 245);
  text-align: center;
  margin-top: 0.3rem;
  flex-shrink: 0;
}

/* === Design v2 — stat tiles border accent, section accents (reconstruit) === */

.director-page .stat-tile {
  border-top: 3px solid oklch(0.60 0.12 245);
  box-shadow: 0 2px 10px oklch(0.42 0.06 240 / 0.10), 0 1px 3px oklch(0.42 0.06 240 / 0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.director-page .card {
  border-left: 3px solid oklch(0.60 0.12 245);
}

/* Zone 1 — cartes compactes, même hauteur */
.dir-zone-1-card {
  height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.dir-zone-1-card h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Bouton graphique dans en-tête carte */
.dir-chart-open-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px solid oklch(0.88 0.01 250);
  background: oklch(0.97 0.005 250);
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
}
.dir-chart-open-btn:hover {
  background: oklch(0.55 0.18 250);
  border-color: oklch(0.55 0.18 250);
  color: white;
}

/* Tuiles signalements — même forme que stat-tile mais plus petites */
.stat-tile--sm {
  padding: 0.35rem 0.65rem;
  min-width: 60px;
}
.stat-tile--sm .stat-label {
  font-size: 0.65rem;
}
.stat-tile--sm .stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
}
.stat-tile--sm.stat-tile--warn {
  border-top-color: oklch(0.52 0.18 32);
}
.stat-tile--sm.stat-tile--warn .stat-value {
  color: oklch(0.52 0.18 32);
}

/* === Layout — max-width 1400px centré, 3 colonnes à 1400px === */

.director-body .page {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.director-topbar-content {
  max-width: 1400px;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}


@media (min-width: 1400px) {
  .director-page {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
  }
}

#issueTicketList {
  max-height: 12.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: oklch(0.75 0.04 245) transparent;
}

@media (min-width: 600px) {
  .director-full-width,
  #section-staff,
  #section-services,
  #section-infos,
  #section-courbe {
    grid-column: 1 / -1;
  }
}

/* ── Service panels — scrollables pour ne pas agrandir la card ──────────── */
.director-service-panel {
  max-height: 17rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: oklch(0.75 0.04 245) transparent;
  padding-right: 0.25rem;
}

/* === Scroll fade — uniquement pour la liste tickets Signalements === */

#issueTicketList::after {
  content: '';
  display: block;
  position: sticky;
  bottom: 0;
  height: 2.5rem;
  margin-top: -2.5rem;
  background: linear-gradient(to bottom, transparent, var(--panel, oklch(0.995 0.004 250)));
  pointer-events: none;
  z-index: 1;
}

/* Questions Réservations — police + espacement aéré jusqu'au bouton */
.director-service-question h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.director-service-question .director-yes-no {
  margin-top: 0.15rem;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

/* WIFI card — 2 inputs côte à côte pour label + code */
.director-code-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.director-code-row input {
  font-size: 0.82rem;
  padding: 0.3rem 0.5rem;
}

/* Compteur sous le titre */
.director-card-count {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: oklch(0.62 0.08 245);
  margin-top: -0.15rem;
  margin-bottom: 0.4rem;
}

/* === Alerts bar — hero masqué, alertes sous le subnav === */

.director-alerts-bar {
  padding: 0.6rem 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.director-alerts-bar:empty {
  padding: 0;
}

.director-hero {
  display: none !important;
}

.director-page {
  padding-top: 0.7rem;
}

/* === Grid fix — align-items: start (évite l'espace vide) === */

.director-page {
  align-items: start;
}

@media (min-width: 1400px) {
  /* 1 colonne */
  #section-summary,
  #section-services,
  #section-accueil {
    grid-column: span 1;
  }

  /* Hauteur uniforme — LES VACANCIERS + MON ÉTABLISSEMENT + MES INFOS (9 cartes) */
  #section-connexions,
  #section-summary,
  #issueManagementCard {
    height: auto;
    min-height: 400px;
    max-height: 720px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: oklch(0.75 0.04 245) transparent;
  }

  #section-qr,
  #section-services,
  #section-accueil,
  #section-abonnement,
  #section-stockage,
  #section-profil {
    height: 400px;
    overflow: hidden;
  }

  /* Abonnement + Profil — scrollables pour que le contenu ne déborde pas */
  #section-abonnement,
  #section-profil {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: oklch(0.75 0.04 245) transparent;
  }

  /* QR card — QR code fills remaining space, buttons anchored bottom */
  #section-qr {
    display: flex;
    flex-direction: column;
  }
  #section-qr #weeklyQr {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    overflow: hidden;
  }
  #section-qr #weeklyQr img,
  #section-qr #weeklyQr canvas {
    width: min(210px, 100%);
    height: min(210px, 100%);
    object-fit: contain;
    flex-shrink: 0;
  }
  #section-qr .weekly-qr-code {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    margin-top: 0.25rem;
    flex-shrink: 0;
  }
  #section-qr .director-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
  }
  #section-qr .director-quick-actions .btn {
    width: 100%;
  }

  /* Services card — questions panel scrolls, Enregistrer anchored bottom */
  #section-services {
    display: flex;
    flex-direction: column;
  }
  #section-services form#transportForm {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  #section-services .director-service-questions {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    max-height: none;
  }
  #section-services form#transportForm > button[type="submit"] {
    flex-shrink: 0;
    margin-top: 0.5rem;
    width: 100%;
  }

  /* Accueil card — form fills, Enregistrer anchored bottom */
  #section-accueil {
    display: flex;
    flex-direction: column;
  }
  #section-accueil form#welcomeConfigForm {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  #section-accueil .request-actions {
    margin-top: auto;
  }
  #section-accueil .request-actions .btn {
    width: 100%;
  }

  /* Connexions — aérer le contenu dans la carte */
  #section-connexions .dir-cs-total {
    font-size: 1rem;
    margin-bottom: 0;
  }
  #section-connexions .dir-cs-rows {
    gap: 1.4rem;
  }
  #section-connexions .dir-cs-row-label {
    font-size: 0.88rem;
  }
  #section-connexions .dir-cs-bar-wrap {
    height: 10px;
  }

  /* Messages — aérer le contenu dans la carte */
  #section-summary .stats-grid {
    gap: 0.75rem;
    margin-bottom: 0.5rem;
  }
  #section-summary .stat-tile--sm {
    padding: 0.55rem 0.7rem;
  }
  #section-summary .dir-writer-record {
    font-size: 0.75rem;
    margin: 0.3rem 0;
  }
  #section-summary .dir-top-msg {
    padding: 0.2rem 0;
    line-height: 1.4;
  }
  #section-summary .dir-top-msg-text {
    font-size: 0.78rem;
  }

  /* Signalements — 2 tickets max visibles, fade de transition en bas */
  #issueManagementCard {
    display: flex;
    flex-direction: column;
  }
  #issueManagementCard #issueTicketList {
    flex: none;
    max-height: 155px;
    overflow-y: auto;
    position: relative;
  }

  /* Staff — pleine largeur pour accueillir la grille 3 colonnes */
  #section-staff {
    grid-column: 1 / -1;
  }
  /* 2 colonnes */
  #section-courbe {
    grid-column: span 2;
  }
  /* Infos pratiques — pleine largeur à tous les breakpoints */
  #section-infos {
    grid-column: 1 / -1;
  }
}

#connectionStats .stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

#connectionStats .stat-value {
  font-size: 1.35rem;
}

/* Sections masquées si service non configuré */
.director-section-hidden {
  display: none !important;
}

/* Masquer aussi le wrapper role-card-block quand la section est cachée */
.role-card-block:has(.director-section-hidden) {
  display: none !important;
}

/* === Compteurs signalements — grille 4 colonnes égales === */

.director-issue-counters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  align-items: stretch;
  margin-bottom: 0.85rem;
}


/* === Tickets accordéon === */

.dir-ticket {
  border: 1px solid var(--card-border, var(--line));
  border-radius: var(--radius-md, 10px);
  background: var(--card-bg, #fff);
  overflow: hidden;
  margin-bottom: 0.35rem;
  transition: box-shadow 0.18s;
}

.dir-ticket:last-child { margin-bottom: 0; }

.dir-ticket[data-active] {
  border-color: var(--sidebar-bg);
  box-shadow: 0 0 0 2px oklch(0.38 0.10 245 / 0.18);
}

.dir-ticket-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  flex-wrap: nowrap;
  min-height: 2.5rem;
}

/* Réponse désormais dans #issueReplyCard (card externe — col 2 du grid) */

/* Mobile: wrap autorisé pour les tickets étroits */
@media (max-width: 820px) {
  .dir-ticket-row { flex-wrap: wrap; }
  #issueReplyCard { grid-column: 1 / -1; }
}

.dir-ticket-status {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.dir-ticket-status--open     { background: oklch(0.95 0.06 50);  color: oklch(0.42 0.14 50); }
.dir-ticket-status--progress { background: oklch(0.93 0.06 245); color: oklch(0.38 0.14 245); }
.dir-ticket-status--resolved { background: oklch(0.93 0.08 145); color: oklch(0.35 0.12 145); }
.dir-ticket-status--closed   { background: oklch(0.93 0.01 240); color: oklch(0.46 0.02 240); }

.dir-ticket-cat {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.dir-ticket-loc {
  font-size: 0.8rem;
  color: oklch(0.48 0.05 246);
  font-weight: 500;
  flex-shrink: 0;
}

.dir-ticket-desc {
  font-size: 0.82rem;
  color: var(--muted);
  flex: 1 1 120px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-ticket-date {
  font-size: 0.75rem;
  color: var(--muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.dir-ticket-toggle {
  flex-shrink: 0;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  width: auto;
  min-width: 0;
  margin-left: auto;
  transition: background 0.2s, color 0.2s;
}

/* Ticket actif : bouton Fermer en bleu */
.dir-ticket[data-active] .dir-ticket-toggle {
  background: var(--sidebar-bg);
  color: white;
  border-color: var(--sidebar-bg);
}

/* .dir-ticket-body-inner removed — replaced by .dir-ticket-panel-body */

.dir-ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.81rem;
  color: var(--muted);
}

.dir-ticket-description {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
}

.dir-ticket-autoreply {
  margin: 0;
  font-size: 0.81rem;
  color: var(--muted);
  padding: 0.38rem 0.55rem;
  background: oklch(0.97 0.01 240);
  border-radius: 7px;
  border-left: 3px solid oklch(0.72 0.06 240);
}

.dir-ticket-reply-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.dir-ticket-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.42rem;
  resize: vertical;
  min-height: 56px;
  font-size: 0.88rem;
  box-sizing: border-box;
  font-family: inherit;
}

.dir-ticket-controls {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.dir-ticket-controls select {
  flex: 1 1 110px;
  min-width: 0;
}

.dir-ticket-controls .btn {
  flex-shrink: 0;
  width: auto;
  min-width: 0;
}

/* ── Hidden checkbox toggles (used by JS, must be invisible) ─────────────── */
.director-hidden-toggle {
  display: none !important;
}

/* ── Yes/No radio groups — fix label split from global main.css ──────────── */
.director-yes-no {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 0.35rem 0;
}

.director-yes-no label {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  width: auto !important;
  justify-content: flex-start !important;
  color: var(--text);
}

.director-yes-no label input[type="radio"] {
  margin: 0;
  cursor: pointer;
  accent-color: var(--brand, #2563eb);
}

/* ── Staff list — action buttons side by side ────────────────────────────── */
#staffList .request-actions {
  display: flex !important;
  flex-direction: row !important;
  gap: 0.4rem;
}

#staffList .request-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  width: auto !important;
}

/* ── Infos pratiques form — action buttons inline ────────────────────────── */
#infoMediaForm .request-actions {
  display: flex !important;
  flex-direction: row !important;
  gap: 0.4rem;
  flex-wrap: wrap;
}

#infoMediaForm .request-actions .btn,
#section-infos > .card > .request-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
}

/* ── Accueil 1er scan — toggle Wi-Fi inline ──────────────────────────────── */
.director-wifi-toggle {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}

.director-wifi-toggle input[type="checkbox"] {
  margin: 0;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: var(--brand, #2563eb);
  cursor: pointer;
}

#welcomeWifiCode:disabled {
  background: oklch(0.95 0.005 240);
  color: oklch(0.55 0.02 240);
  cursor: not-allowed;
}

/* ─── Section Staff — Grille cartes ─── */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.staff-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 140px;
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 2px 10px oklch(0.29 0.03 240 / 0.08);
}

/* Flip card (cartes membres) */
.staff-card-flip {
  background: transparent;
  border: none;
  padding: 0;
  overflow: visible;
  perspective: 900px;
}
.staff-card-inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.staff-card-flip.is-flipped .staff-card-inner {
  transform: rotateY(180deg);
}
.staff-card-face {
  grid-area: 1 / 1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 140px;
  box-shadow: 0 2px 10px oklch(0.29 0.03 240 / 0.08);
  box-sizing: border-box;
}
.staff-card-back {
  transform: rotateY(180deg);
  gap: 0.4rem;
}

/* Carte ghost (bouton +) */
.staff-card--ghost {
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-style: dashed;
  color: var(--muted, #94a3b8);
  font-size: 0.85rem;
  gap: 0.25rem;
  transition: border-color 0.15s, color 0.15s;
}
.staff-card--ghost:hover {
  border-color: var(--primary, #6366f1);
  color: var(--primary, #6366f1);
}
.staff-card--ghost .staff-ghost-plus {
  font-size: 2rem;
  line-height: 1;
  font-weight: 300;
}

/* Carte formulaire */
.staff-card--form {
  gap: 0.4rem;
}
.staff-card--form input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.4rem;
  background: var(--surface, #fff);
  color: inherit;
}
.staff-card--form input:focus {
  outline: 2px solid var(--primary, #6366f1);
  outline-offset: -1px;
}

/* Chips de rôles */
.staff-roles-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: auto;
}
.staff-role-chip {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface-muted, #f8fafc);
  color: var(--muted, #94a3b8);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.staff-role-chip.active {
  background: #dcfce7;
  border-color: #16a34a;
  color: #15803d;
  font-weight: 600;
}

/* Actions carte membre */
.staff-card-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.staff-card-sub {
  font-size: 0.75rem;
  color: var(--muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.staff-card-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.25rem;
}
.staff-card-actions button {
  flex: 1;
  padding: 0.3rem;
  font-size: 0.75rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #fff);
  cursor: pointer;
  transition: background 0.12s;
}
.staff-card-actions button:hover { background: var(--surface-muted, #f8fafc); }
.staff-card-actions .btn-danger { color: #dc2626; border-color: #fca5a5; }
.staff-card-actions .btn-danger:hover { background: #fee2e2; }

/* Formulaire — boutons */
.staff-form-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.25rem;
}
.staff-form-actions .btn-create {
  flex: 1;
  padding: 0.4rem;
  font-size: 0.8rem;
  border-radius: 0.4rem;
  background: var(--primary, #6366f1);
  color: #fff;
  border: none;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.12s;
}
.staff-form-actions .btn-create:not(:disabled) { opacity: 1; }
.staff-form-actions .btn-cancel {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border, #e2e8f0);
  background: transparent;
  cursor: pointer;
}

/* Compteur limite */
.staff-limit-counter {
  font-size: 0.75rem;
  color: var(--muted, #94a3b8);
  margin-bottom: 0.25rem;
}
.staff-limit-counter.at-limit { color: #dc2626; }

/* Responsive */
@media (max-width: 700px) {
  .staff-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 460px) {
  .staff-grid { grid-template-columns: 1fr; }
}

/* ── Mobile iPhone fix — débordement horizontal ──────────────────────────
   Supprimable d'un bloc si rollback nécessaire.
   Ne touche que les écrans ≤ 480px.
   ────────────────────────────────────────────────────────────────────── */
.director-page .card {
  min-width: 0; /* empêche les items CSS Grid de dépasser le viewport */
}

@media (max-width: 480px) {
  .director-page {
    gap: 0.6rem;
  }

  .director-issue-counters {
    grid-template-columns: repeat(2, 1fr);
  }

  #summary .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .dir-cs-row-meta--nowrap {
    white-space: normal;
  }

  .director-topbar-content {
    gap: 0.4rem;
  }

  .dir-inv-num {
    display: none;
  }
}

/* ── Table factures ──────────────────────────────────────────────────── */
.dir-invoices-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
  margin-top: 10px;
}
.dir-invoices-table th {
  text-align: left;
  padding: 4px 6px;
  border-bottom: 1px solid var(--line, #e5e7eb);
}
.dir-invoices-table td {
  padding: 4px 6px;
}

/* ── Role visibility badges ──────────────────────────── */
.role-badges-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 11px;
  color: oklch(0.55 0.02 240);
  padding: 8px 0;
  margin-bottom: 4px;
}
.role-badges-legend .legend-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.role-badges-legend .legend-dot--green  { background: oklch(0.55 0.18 145); }
.role-badges-legend .legend-dot--orange { background: oklch(0.62 0.18 55); }
.role-badges-legend .legend-dot--grey   { background: oklch(0.72 0.02 240); }

/* ── Wrapper carte + badges (item de grille, flex-colonne) ─────────────── */
.role-card-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* Propager grid-column aux wrappers — miroir exact des règles des sections */
@media (min-width: 600px) {
  .role-card-block:has(#section-staff),
  .role-card-block:has(#section-services),
  .role-card-block:has(#section-infos),
  .role-card-block:has(#section-courbe),
  .role-card-block:has(.director-full-width),
  .role-card-block:has(#issueManagementCard) {
    grid-column: 1 / -1;
  }
}
/* Overrides à 1400px : mirror de la règle span 1 / span 2 des sections */
@media (min-width: 1400px) {
  .role-card-block:has(#section-summary),
  .role-card-block:has(#issueManagementCard),
  .role-card-block:has(#section-services),
  .role-card-block:has(#section-accueil) {
    grid-column: span 1;
  }
  .role-card-block:has(#section-courbe) {
    grid-column: span 2;
  }
}

.role-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.rb {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}
.rb .dot {
  width: 5px; height: 5px; border-radius: 50%;
}
/* vert = accès complet */
.rb.rg { background: oklch(0.92 0.08 145); color: oklch(0.40 0.14 145); }
.rb.rg .dot { background: oklch(0.55 0.18 145); }
/* orange = lecture seule */
.rb.ro { background: oklch(0.93 0.10 65); color: oklch(0.42 0.14 55); }
.rb.ro .dot { background: oklch(0.62 0.18 55); }
/* gris = masqué */
.rb.rd { background: oklch(0.93 0.01 240); color: oklch(0.58 0.02 240); }
.rb.rd .dot { background: oklch(0.72 0.02 240); }


/* ── Modale graphiques ── */
.dir-chart-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dir-chart-modal[hidden] { display: none; }

.dir-chart-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop-bg);
  backdrop-filter: blur(2px);
}
.dir-chart-modal-box {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
.dir-chart-modal-header {
  position: sticky;
  top: 0;
  background: var(--modal-header-bg);
  border-bottom: 1px solid var(--modal-header-border);
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 1;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.dir-chart-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--card-h2-color);
}
.dir-chart-modal-period-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--modal-badge-bg);
  color: var(--modal-badge-text);
}
.dir-chart-modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--modal-close-bg);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.dir-chart-modal-close:hover { background: var(--modal-close-hover); }
.dir-chart-modal-body { padding: 14px 16px 20px; }
.dir-chart-modal-section { margin-bottom: 18px; }
.dir-chart-modal-section:last-child { margin-bottom: 0; }
.dir-chart-modal-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--modal-label-color);
  margin-bottom: 6px;
}
.dir-chart-modal-section canvas {
  width: 100% !important;
  height: 90px !important;
}

/* Mobile — bottom sheet */
@media (max-width: 600px) {
  .dir-chart-modal {
    align-items: flex-end;
    padding: 0;
  }
  .dir-chart-modal-box {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
  }
}

/* ── Menu vacanciers card ─────────────────────────────────── */

.menu-vis-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.menu-vis-item + .menu-vis-item {
  border-top: 1px solid var(--line, oklch(0.92 0.005 250));
}

.menu-vis-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.menu-vis-status.muted {
  font-size: 0.82rem;
  opacity: 0.6;
}

.menu-vis-status.locked {
  font-size: 0.82rem;
  color: oklch(0.55 0.12 25);
  font-weight: 600;
}

.menu-vis-status.disabled {
  font-size: 0.82rem;
  color: oklch(0.55 0.08 60);
  max-width: 60%;
  text-align: right;
}

.menu-vis-toggle {
  flex-direction: column;
  align-items: stretch;
}

.menu-vis-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-vis-services {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.menu-vis-tag {
  font-size: 0.78rem;
  background: oklch(0.95 0.02 152);
  color: oklch(0.35 0.08 152);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}

.menu-vis-count {
  font-size: 0.78rem;
  opacity: 0.6;
  margin-top: 0.2rem;
}

.menu-vis-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.menu-vis-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.menu-vis-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: oklch(0.82 0.02 250);
  border-radius: 24px;
  transition: background 0.2s;
}

.menu-vis-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.menu-vis-switch input:checked + .menu-vis-slider {
  background: oklch(0.55 0.15 152);
}

.menu-vis-switch input:checked + .menu-vis-slider::before {
  transform: translateX(20px);
}

.menu-vis-separator {
  height: 1px;
  background: var(--line, oklch(0.92 0.005 250));
  margin: 0.5rem 0;
}

.menu-vis-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.menu-vis-preview-label {
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.7;
}

.menu-vis-preview-bar {
  display: flex;
  gap: 0.3rem;
}

.menu-vis-preview-icon {
  font-size: 0.75rem;
  font-weight: 700;
  background: oklch(0.94 0.01 250);
  color: oklch(0.4 0.02 250);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

/* ============================================================
   REDESIGN PRO/SaaS — THÈME BLEU AÉRÉ — 2026-03-25
   Palette bleu acier moyen : lisible, pas trop sombre.
   Toutes les règles de cette section surchargent les règles
   précédentes. Ne pas modifier les règles existantes au-dessus.
   ============================================================ */

/* Variables CSS partagées */
:root {
  --topbar-h: 56px;
  --kpi-bar-h: 80px;
  --sidebar-w: 220px;
  --sidebar-bg: oklch(0.38 0.10 245);          /* bleu acier — lisible */
  --sidebar-active-bg: oklch(0.48 0.12 245);   /* bleu actif */
  --sidebar-hover-bg: oklch(0.43 0.11 245);    /* bleu hover */
  --sidebar-text-muted: oklch(0.90 0.04 230);  /* blanc bleuté — 7:1+ sur bg */
  --sidebar-accent: oklch(0.80 0.14 195);      /* ciel vif — accent distinct */
  --content-bg: oklch(0.97 0.008 235);         /* blanc bleuté très léger */
  --card-bg: white;
  --card-border: oklch(0.90 0.015 230);        /* bordure bleu pâle */
  --dark-border: oklch(0.50 0.09 245);         /* bord sur fond bleu */
  /* Couleurs UI hardcodées → variables */
  --topbar-icon-text: oklch(0.92 0.04 230);
  --topbar-icon-border: oklch(0.55 0.10 245);
  --sidebar-footer-text: oklch(0.72 0.05 230);
  --card-shadow: oklch(0.55 0.06 240 / 0.10);
  /* Couleurs sémantiques KPI */
  --kpi-connexions-color: oklch(0.50 0.16 155);  /* vert émeraude — 3:1+ grand texte */
  --kpi-messages-color: oklch(0.48 0.16 240);    /* bleu vif — 3:1+ grand texte */
  --kpi-signalements-color: oklch(0.55 0.16 50); /* orange — 3:1+ grand texte */
  --kpi-label-color: oklch(0.42 0.06 235);       /* bleu moyen — 4.8:1 petit texte */
  --kpi-value-default: oklch(0.30 0.08 240);     /* bleu foncé — 11:1 */
  --card-h2-color: oklch(0.32 0.08 235);         /* bleu foncé lisible */
  --zone-label-color: oklch(0.34 0.09 235);      /* bleu foncé */
  /* Système ombres & rayons */
  --shadow-sm: 0 2px 10px oklch(0.40 0.06 240 / 0.08);
  --shadow-md: 0 10px 30px oklch(0.30 0.06 240 / 0.18);
  --shadow-lg: 0 20px 60px oklch(0.20 0.05 245 / 0.22);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  /* Modales & toasts */
  --backdrop-bg: oklch(0.20 0.06 245 / 0.55);
  --modal-header-bg: oklch(0.97 0.008 235);
  --modal-header-border: oklch(0.88 0.02 235);
  --modal-badge-bg: oklch(0.88 0.06 230);
  --modal-badge-text: oklch(0.28 0.10 245);
  --modal-close-bg: oklch(0.92 0.015 235);
  --modal-close-hover: oklch(0.85 0.025 235);
  --modal-label-color: oklch(0.50 0.05 235);
  --toast-bg: var(--sidebar-bg);
}

/* Topbar sombre */
.director-topbar {
  position: sticky;
  top: 0;
  background: var(--sidebar-bg) !important;
  color: white !important;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  box-shadow: none !important;
  border-bottom: 1px solid var(--dark-border);
  margin-left: var(--sidebar-w);
  z-index: 100;
}

/* Supprime le centrage et max-width sur le contenu topbar */
.director-topbar-content {
  max-width: none !important;
  margin: 0 !important;
  padding-left: 2rem;
  padding-right: 2rem;
  height: 100%;
}

/* Texte topbar en blanc */
.director-topbar .director-kicker,
.director-topbar .director-title,
.director-topbar .director-icon-btn {
  color: white !important;
}

.director-topbar .director-icon-btn {
  color: var(--topbar-icon-text) !important;
  border-color: var(--topbar-icon-border) !important;
}

.director-topbar .director-icon-btn:hover {
  background: var(--sidebar-active-bg) !important;
  color: white !important;
}

/* ── Sidebar ──────────────────────────────────────────────── */

.dir-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  /* INTERDIT : transform — briserait le stacking context des modals */
}

.dir-sidebar-logo {
  padding: 1.1rem 1.25rem 0.9rem;
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.dir-sidebar-logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.01em;
}

.dir-sidebar-logo-sub {
  font-size: 0.65rem;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
}

.dir-sidebar-nav {
  padding: 1rem 0;                            /* +0.25rem haut/bas */
  flex: 1;
}

.dir-sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1.25rem;                    /* +0.1rem vertical */
  color: var(--sidebar-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.dir-sidebar-nav-item:hover {
  background: var(--sidebar-hover-bg);
  color: white;
}

.dir-sidebar-nav-item.active {
  background: var(--sidebar-active-bg);
  color: white;
  font-weight: 700;
  border-left-color: var(--sidebar-accent);
}

.dir-sidebar-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.dir-sidebar-nav-item.active .dir-sidebar-nav-icon,
.dir-sidebar-nav-item:hover .dir-sidebar-nav-icon {
  opacity: 1;
}

.dir-sidebar-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--dark-border);
  font-size: 0.7rem;
  color: var(--sidebar-footer-text);
}

/* ── Layout main ──────────────────────────────────────────── */

/* Décalage sidebar — override du centrage auto existant */
.director-body .page {
  max-width: none !important;
  margin-left: var(--sidebar-w) !important;
  margin-right: 0 !important;
  padding-left: 2rem;
  padding-right: 2rem;
  background: var(--content-bg) !important;
}

/* Supprime le layout existant — les zones gèrent leur propre grille */
.director-page {
  display: block !important;
}

/* scroll-padding-top : compense topbar + KPI bar pour les ancres */
html {
  scroll-padding-top: calc(var(--topbar-h, 56px) + var(--kpi-bar-h, 80px) + 1rem);
}

/* Zones : grille 2 colonnes — display:grid crée une boîte (scroll-spy OK) */
.director-zone {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

/* Zones : scroll-margin + respirations */
[data-zone] {
  scroll-margin-top: calc(var(--topbar-h, 56px) + var(--kpi-bar-h, 80px) + 1rem);
  padding-top: 2rem;
  padding-bottom: 1rem;
}

/* Header de zone : toujours pleine largeur */
.director-zone-header {
  grid-column: 1 / -1;
}

/* Cards full-width : contenu trop riche ou trop large pour 2 col */
/* Zone 1 */
/* issueManagementCard : col 1 (liste compacte) — réponse dans card externe col 2 */
#issueManagementCard          { grid-column: auto; height: auto; min-height: 0; overflow-y: auto; max-height: 70vh; }
#issueReplyCard               { grid-column: auto; height: auto; min-height: 0; display: flex; flex-direction: column; gap: 0.5rem; }
#issueReplyCard[hidden]       { display: none; }

/* Card réponse signalement */
.issue-reply-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
}
.issue-reply-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--card-h2-color);
  flex: 1;
}
.issue-reply-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--modal-close-bg);
  color: var(--card-h2-color);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.issue-reply-close:hover { background: var(--modal-close-hover); }

#issueReplyContent {
  display: grid;
  gap: 0.45rem;
}
/* Zone 2 */
#section-livret               { grid-column: 1 / -1; }   /* form riche + photo */
#section-services             { grid-column: 1 / -1; }   /* reservations complexe */
#section-infos                { grid-column: 1 / -1; }   /* infos pratiques */
/* Zone 3 */
#section-staff                { grid-column: 1 / -1; }   /* staff grid */
/* Zone 4 */
#section-profil               { grid-column: 1 / -1; }   /* profil form */

/* Responsive : 1 colonne sous 820px (sidebar déjà cachée à 768px) */
@media (max-width: 820px) {
  .director-zone {
    grid-template-columns: 1fr !important;
  }
}


/* ── KPI Bar ──────────────────────────────────────────────── */

.dir-kpi-bar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 90;
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0 -2rem;
  padding: 0 2rem;
  min-height: var(--kpi-bar-h);
  /* PAS de overflow:hidden — neutralise position:sticky */
}

.dir-kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;                                /* +0.05rem */
  padding: 1rem 2rem 1rem 0;                  /* A1: symétrie verticale */
  min-width: 155px;
  border-right: 1px solid var(--card-border);
}

.dir-kpi-card:last-child {
  border-right: none;
  padding-right: 0;
}

.dir-kpi-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--kpi-value-default);
}

.dir-kpi-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--kpi-label-color);             /* 5:1+ sur blanc pour petit texte */
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Couleurs sémantiques KPI — via variables pour cohérence systémique */
#kpi-connexions .dir-kpi-value   { color: var(--kpi-connexions-color); }
#kpi-messages .dir-kpi-value     { color: var(--kpi-messages-color); }
#kpi-signalements .dir-kpi-value { color: var(--kpi-signalements-color); }

/* ── Cards ────────────────────────────────────────────────── */

.director-page .card {
  padding: 1.25rem !important;
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border);
  box-shadow: 0 1px 4px var(--card-shadow) !important;
}

.director-page .card h2 {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--card-h2-color);
  margin-bottom: 1rem;
}

.director-page .btn-secondary {
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
}

.director-page .btn:not(.director-icon-btn) {
  font-size: 0.88rem;
  padding: 0.5rem 0.9rem;
}

/* Zone headers : accent gauche + espace généreux */
.director-zone-header {
  margin-top: 0.5rem;                         /* A3 */
  margin-bottom: 1rem;                        /* +0.5rem */
  padding-bottom: 0.75rem;
  padding-left: 0.75rem;
  border-bottom: 1px solid var(--card-border);
  border-left: 3px solid var(--sidebar-accent); /* accent visuel */
}

.director-zone-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--zone-label-color);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Mobile ≤ 768px ───────────────────────────────────────── */

.dir-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .dir-sidebar {
    display: none;
  }

  .director-topbar {
    margin-left: 0 !important;
  }

  .director-body .page {
    margin-left: 0 !important;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .dir-kpi-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    margin: 0 -1rem;
    padding: 0 1rem;
  }

  .dir-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: var(--sidebar-bg);
    z-index: 100;
    border-top: 1px solid var(--dark-border);
  }

  .dir-bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    font-size: 0.6rem;
    font-weight: 500;
    transition: color 0.15s;
  }

  .dir-bnav-item:hover,
  .dir-bnav-item.active {
    color: white;
  }

  .dir-bnav-icon {
    width: 20px;
    height: 20px;
  }

  .director-body {
    padding-bottom: 56px;
  }
}
