/* ========================================================================
   MAQUETTE COMMERCIALE — AGENDA SEMAINE (PIXEL-PERFECT)
   ------------------------------------------------------------------------
   Affichage statique reproduisant la grille semaine de l'application,
   sans logique métier, sans sidebar, sans API.
   Sources de référence (copiées et adaptées) :
     • Front/styles.css            → topbar / navigation
     • Front/grille-semaine/...    → grille semaine
     • Front/etiquette-interaction → styles d'étiquette + couleurs
   ======================================================================== */

/* ───────────────────────── RESET / BASE ───────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: Arial, sans-serif;
  background: #f7f8fa;
  color: #4d4d4d;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.maquette-body { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }


/* ════════════════════════════════════════════════════════════════════════
   1. TOPBAR — valeurs exactes de Front/styles.css
   ════════════════════════════════════════════════════════════════════════ */

/* Adaptée sans sidebar : left:0 au lieu de left:5rem */
.header-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  z-index: 1000;
  background: #ffffff;
  border-bottom: 1px solid #ebebeb;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.header-container .header,
.header {
  position: static;
  height: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  flex: 1;
  display: flex;
  align-items: center;
}

.topbar-nav {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 1.25rem;
  min-width: 0;
  overflow: hidden;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
  min-width: 0;
}

.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
  min-width: 0;
}

.topbar-right { flex: 1; }

/* Breadcrumb */
.topbar-app-name {
  font-size: 1.1rem;
  font-weight: 500;
  color: #b0b7c3;
  cursor: default;
  letter-spacing: -0.01em;
  user-select: none;
}

.topbar-sep {
  color: #d1d5db;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}

.topbar-page-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.02em;
}

/* Boutons flèches */
.nav-arrow-group {
  display: flex;
  align-items: center;
  gap: 1px;
}

.nav-arrow-btn {
  background: none;
  border: none;
  color: #c0c7d4;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}

.nav-arrow-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.nav-arrow-btn:active { background: #e9eaec; }

.nav-arrow-btn svg { width: 14px; height: 14px; }

.nav-arrow-divider {
  width: 1px;
  height: 18px;
  background: #e5e7eb;
  margin: 0 6px;
  flex-shrink: 0;
}

/* Affichage central des dates — DIV horizontal */
.nav-date-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 260px;
  flex-shrink: 1;
  min-width: 160px;
  padding: 5px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
}

.nav-date-display:hover { background: #f3f4f6; }
.nav-date-display:active { background: #e9eaec; }

.nav-range {
  font-weight: 600;
  color: #111827;
  font-size: 1.2rem;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-year {
  font-size: 1rem;
  font-weight: 400;
  color: #9ca3af;
}

.nav-week-num {
  background: #f3f4f6;
  color: #6b7280;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

/* Badge "Actuel" — vert (ecfdf5 / 059669) */
.badge-current {
  background: #ecfdf5;
  color: #059669;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Bouton Aujourd'hui */
.btn-today {
  background: none;
  border: 1px solid #e5e7eb;
  color: #374151;
  padding: 0 10px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  font-weight: 500;
  font-size: 1rem;
  font-family: Arial, sans-serif;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  margin-left: 6px;
}

.btn-today:hover {
  background: #f9fafb;
  border-color: #c8cdd6;
  color: #111827;
}

.btn-today:active { background: #f0f1f3; }

.btn-today:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Sélecteur de semaines */
.topbar-weeks-divider {
  width: 1px;
  height: 18px;
  background: #e5e7eb;
  margin: 0 8px;
  flex-shrink: 0;
}

.topbar-weeks-selector {
  display: flex;
  align-items: center;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 2px;
  gap: 1px;
  flex-shrink: 0;
}

.topbar-weeks-btn {
  background: none;
  border: none;
  color: #6b7280;
  padding: 0 9px;
  height: 22px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: Arial, sans-serif;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  letter-spacing: -0.01em;
  line-height: 1;
}

.topbar-weeks-btn:hover:not(.active) {
  background: rgba(0,0,0,0.06);
  color: #374151;
}

.topbar-weeks-btn.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10), 0 1px 1px rgba(0,0,0,0.06);
}


/* ════════════════════════════════════════════════════════════════════════
   2. GRILLE SEMAINE — valeurs exactes de grille-semaine.css
   ════════════════════════════════════════════════════════════════════════ */

/* Zone de contenu principale — padding-top = hauteur header fixe */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 52px;
}

.grille-semaine-grid {
  --gs-col-resource: 200px;
  --gs-accent:       #12938e;
  --gs-accent-hover: #0f7a75;
  --gs-accent-light: rgba(18, 147, 142, 0.08);
  --gs-surface:      #F7F7F5;
  --gs-border:       #E9E9E7;
  --gs-border-mid:   #D4D3D0;
  --gs-text-1:       #37352F;
  --gs-text-2:       #706B61;
  --gs-text-3:       #A09E9A;
  --gs-weekend-bg:   #FBF9F7;
  --gs-offhour-bg:   #F3F2F1;
  --gs-today-bg:     rgba(18, 147, 142, 0.04);
  --gs-row-hover:    rgba(55, 53, 47, 0.03);
  --gs-week-sep:     #9E9B96;
  --gs-transition:   150ms ease;

  background: #ffffff;
  height: calc(100vh - 52px); /* 52px = hauteur header fixé */
  font-size: clamp(0.6rem, 1.5vw, 1rem);
  display: flex;
  flex-direction: column;
  max-width: 100vw;
  overflow-y: hidden;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

/* ─── En-tête jours — position sticky + pseudo-element pour la cellule ressource ─── */
.grille-semaine-grid-header {
  display: grid;
  grid-template-columns: var(--gs-col-resource) repeat(3, 1fr);
  background: var(--gs-surface);
  border-bottom: 1px solid var(--gs-border-mid);
  font-size: clamp(0.6rem, 1.5vw, 1rem);
  flex-shrink: 0;
  position: sticky;
  width: 100%;
  box-sizing: border-box;
  top: 0;
  z-index: 100;
}

/* Espace vide réservé pour la cellule ressource (overlap avec .grille-semaine-resource-header absolu) */
.grille-semaine-grid-header::before {
  content: '';
  display: block;
  width: var(--gs-col-resource);
  height: 100%;
}

/* Cellule ressource : position absolue, s'étend sur header + ligne des heures */
.grille-semaine-resource-header {
  padding: 0.875rem 0.75rem;
  text-align: center;
  border-right: 1px solid var(--gs-border-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--gs-surface);
  position: absolute;
  top: 0;
  left: 0;
  width: var(--gs-col-resource);
  height: calc(100% + 22px); /* s'étend jusqu'à couvrir la ligne des heures */
  z-index: 10;
  transition: background var(--gs-transition);
  cursor: pointer;
}

.grille-semaine-resource-header:hover { background: #EDEDEB; }

.grille-semaine-resource-title {
  font-weight: 600;
  color: var(--gs-text-1);
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.grille-semaine-filter-icon {
  color: var(--gs-text-3);
  display: flex;
  align-items: center;
  transition: color var(--gs-transition);
}

.grille-semaine-resource-header:hover .grille-semaine-filter-icon { color: var(--gs-accent); }

.grille-semaine-day-col {
  padding: 0.875rem 0.5rem;
  text-align: center;
  border-right: 1px solid var(--gs-week-sep);
  border-bottom: 1px solid var(--gs-border-mid);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: var(--gs-surface);
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 9;
  margin: 0;
  transition: background var(--gs-transition);
}

.grille-semaine-day-col:last-child { border-right: none; }

.grille-semaine-day-name {
  font-weight: 600;
  color: var(--gs-text-1);
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.grille-semaine-day-date {
  font-size: clamp(0.9rem, 1.7vw, 1.1rem);
  color: var(--gs-text-2);
  font-weight: 400;
  line-height: 1.2;
}

/* Jour courant (en-tête) */
.grille-semaine-day-col.grille-semaine-current-day {
  background: var(--gs-today-bg);
  position: relative;
}

.grille-semaine-day-col.grille-semaine-current-day::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--gs-accent);
  border-radius: 2px 2px 0 0;
}

.grille-semaine-day-col.grille-semaine-current-day .grille-semaine-day-name {
  color: var(--gs-accent);
}

.grille-semaine-day-col.grille-semaine-current-day::after {
  content: "Aujourd'hui";
  position: absolute;
  top: 3px;
  right: 4px;
  background: var(--gs-accent);
  color: #ffffff;
  font-size: 0.52rem;
  padding: 2px 5px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.92;
  z-index: 10;
  line-height: 1.4;
  max-width: calc(100% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Zébrure mardi / jeudi — classé après current-day pour que current-day ait priorité */
.grille-semaine-day-col[data-day="tuesday"],
.grille-semaine-day-col[data-day="thursday"] {
  background: #F2F2F0;
}
.grille-semaine-day-col.grille-semaine-current-day {
  background: var(--gs-today-bg) !important;
}

/* ─── Ligne des heures ─── */
.grille-semaine-hours-row {
  display: grid;
  grid-template-columns: var(--gs-col-resource) repeat(3, 1fr);
  background: var(--gs-surface);
  border-bottom: 1px solid var(--gs-border);
  color: var(--gs-text-3);
  min-height: 20px;
  font-size: clamp(0.4rem, 0.8vw, 0.75rem);
  box-sizing: border-box;
  flex-shrink: 0;
}

.grille-semaine-hours-placeholder {
  border-right: 1px solid var(--gs-border);
  background: transparent;
}

.grille-semaine-day-hours {
  display: grid;
  grid-template-columns: repeat(10, 1fr); /* 10 tranches horaires 8h-17h */
  border-right: 1px solid var(--gs-border);
}

.grille-semaine-hour-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.1rem;
  border-right: 1px solid var(--gs-border);
  background: transparent;
  color: var(--gs-text-3);
  font-size: clamp(0.82rem, 1.45vw, 0.95rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--gs-transition);
}

.grille-semaine-hour-cell:last-child { border-right: 1px solid var(--gs-border-mid); }

/* ─── Contenu (lignes préparateurs) ─── */
.grille-semaine-grid-content {
  background: #ffffff;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.grille-semaine-grid-content::-webkit-scrollbar { width: 6px; }
.grille-semaine-grid-content::-webkit-scrollbar-track { background: transparent; }
.grille-semaine-grid-content::-webkit-scrollbar-thumb {
  background: var(--gs-border-mid);
  border-radius: 3px;
}

.grille-semaine-prep-row {
  display: grid;
  grid-template-columns: var(--gs-col-resource) repeat(3, 1fr);
  border-bottom: 1px solid var(--gs-border);
  min-height: 48px;
  max-width: 100%;
  position: relative;
  overflow-x: hidden;
  box-sizing: border-box;
  transition: background var(--gs-transition);
}

.grille-semaine-prep-row:last-child { border-bottom: none; }

.grille-semaine-prep-row:hover { background: var(--gs-row-hover); }

.grille-semaine-prep-name-cell {
  padding: 0.75rem 0.875rem;
  border-right: 1px solid var(--gs-border-mid);
  background: var(--gs-surface);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: sticky;
  left: 0;
  z-index: 5;
  box-shadow: 1px 0 0 var(--gs-border-mid);
  transition: background var(--gs-transition);
}

.grille-semaine-prep-row:hover .grille-semaine-prep-name-cell { background: #EFEFED; }

.grille-semaine-prep-name {
  font-weight: 600;
  color: var(--gs-text-1);
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* ─── Cellules jour ─── */
.grille-semaine-day-cell {
  padding: 0.375rem;
  border-right: 1px solid var(--gs-week-sep);
  background: #ffffff;
  position: relative;
  overflow: hidden;
  transition: background var(--gs-transition);
}

.grille-semaine-day-cell:last-child { border-right: none; }

.grille-semaine-day-cell[data-day="tuesday"],
.grille-semaine-day-cell[data-day="thursday"] {
  background: #F2F2F0;
}

.grille-semaine-day-cell.grille-semaine-current-day { background: var(--gs-today-bg); }
.grille-semaine-day-cell.grille-semaine-current-day:hover { background: rgba(18, 147, 142, 0.07); }

.grille-semaine-day-cell.grille-semaine-current-day::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 2px;
  height: 100%;
  background: var(--gs-accent);
  opacity: 0.4;
}

/* ─── Zones de disponibilité ─── */
.grille-semaine-avail-zones {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  z-index: 1;
}

.grille-semaine-avail-zone {
  border-right: 1px solid rgba(0, 0, 0, 0.04);
  transition: background var(--gs-transition);
}

.grille-semaine-avail-zone:last-child { border-right: none; }

.grille-semaine-avail-zone.grille-semaine-working {
  background: rgba(255, 255, 255, 0.97);
}

.grille-semaine-avail-zone.grille-semaine-not-working {
  background: var(--gs-offhour-bg);
}

.grille-semaine-avail-zone:hover {
  background: var(--gs-accent-light) !important;
  box-shadow: inset 2px 0 0 var(--gs-accent);
}

/* ─── Conteneur des étiquettes ─── */
.grille-semaine-tasks {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 30;
  pointer-events: none;
}


/* ════════════════════════════════════════════════════════════════════════
   3. ÉTIQUETTES (issu de style-etiquette.css + color-manager.js)
   ════════════════════════════════════════════════════════════════════════ */

/* ─── Overlay multi-jours ─── */
.planif-row-overlay {
  position: absolute;
  top: 0;
  left: var(--gs-col-resource);
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 34;
}
.planif-row-overlay .planning-tag {
  pointer-events: auto;
}

/* top / height / left / width / z-index : inline styles posés par JS */
.planning-tag {
  position: absolute;
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.15s ease, opacity 0.15s ease;
  user-select: none;
  overflow: hidden;
}

.planning-tag:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 40;
}

.tag-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100%;
  justify-content: center;
  color: inherit;
}

.tag-description {
  font-size: 1.1rem;
  text-align: left;
  line-height: 1.3;
  margin-top: 0;
  color: inherit;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  max-width: 100%;
  width: 100%;
  flex: 1;
  padding: 0;
  overflow: hidden;
  display: block;
  vertical-align: top;
}

/* ─── Couleurs par type d'activité — couleurs exactes de color-manager.js ─── */
/* Utiliser background-color (pas background) pour que background-image s'applique par-dessus */

/* Activité — bleu */
.planning-tag[data-type="activite"] {
  background-color: #eff6ff;
  border: 1px solid #2563eb;
  border-left: 1px solid #2563eb;
  color: #1e40af;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Absence — gris + hachures diagonales */
.planning-tag[data-type="absence"] {
  background-color: #f3f4f6;
  border: 1px solid #6b7280;
  border-left: 1px solid #6b7280;
  color: #374151;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(0, 0, 0, 0.04) 10px,
    rgba(0, 0, 0, 0.04) 20px
  );
}

/* Formation — vert + hachures */
.planning-tag[data-type="formation"] {
  background-color: #ecfdf5;
  border: 1px solid #059669;
  border-left: 1px solid #059669;
  color: #065f46;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(0, 0, 0, 0.04) 10px,
    rgba(0, 0, 0, 0.04) 20px
  );
}

/* Réunion — orange */
.planning-tag[data-type="reunion"] {
  background-color: #fff7ed;
  border: 1px solid #ea580c;
  border-left: 1px solid #ea580c;
  color: #9a3412;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ─── Poignées de redimensionnement (opacity 0 par défaut, visibles au hover) ─── */
.resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18px;
  cursor: ew-resize;
  z-index: 40;
  background: transparent;
  opacity: 0;
  transition: all 0.2s ease;
  border-radius: 2px;
}

.resize-handle-left  { left: -9px; }
.resize-handle-right { right: -9px; }

.planning-tag:hover .resize-handle { opacity: 0.7; }
.resize-handle:hover { opacity: 1 !important; }


/* ════════════════════════════════════════════════════════════════════════
   5. VUE ÉQUIPE — agenda-team-v2.css
   ════════════════════════════════════════════════════════════════════════ */

/* ── Visibilité toggle ── */
body[data-view-mode="team"] .grille-semaine-grid { display: none !important; }
body[data-view-mode="team"] .agenda-team-grid    { display: flex; }
body:not([data-view-mode="team"]) .agenda-team-grid { display: none; }

/* ── Conteneur principal ── */
.agenda-team-grid {
  --at-col-resource: 200px;
  --at-surface:      #F7F7F5;
  --at-border:       #E9E9E7;
  --at-border-mid:   #D4D3D0;
  --at-text-1:       #37352F;
  --at-text-2:       #706B61;
  --at-text-3:       #A09E9A;
  --at-today-bg:     rgba(18, 147, 142, 0.04);
  --at-shadow-sm:    0 1px 3px rgba(15,15,15,0.06), 0 1px 2px rgba(15,15,15,0.04);
  --at-transition:   150ms ease;
  --at-week-sep:     #9E9B96;
  /* tokens --gs-* pour les classes .grille-semaine-* réutilisées */
  --gs-col-resource: 200px;
  --gs-accent:       #12938e;
  --gs-surface:      #F7F7F5;
  --gs-border:       #E9E9E7;
  --gs-border-mid:   #D4D3D0;
  --gs-text-1:       #37352F;
  --gs-text-2:       #706B61;
  --gs-text-3:       #A09E9A;
  --gs-today-bg:     rgba(18, 147, 142, 0.04);
  --gs-week-sep:     #9E9B96;
  background: #ffffff;
  height: calc(100vh - 52px);
  font-size: clamp(0.6rem, 1.5vw, 1rem);
  display: flex;
  flex-direction: column;
  max-width: 100vw;
  overflow-y: hidden;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

/* ── En-tête jours ── */
.agenda-team-header {
  display: grid;
  background: var(--gs-surface);
  border-bottom: 1px solid var(--gs-border-mid);
  font-size: clamp(0.6rem, 1.5vw, 1rem);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  box-sizing: border-box;
}

/* Spacer ::before : réserve la cellule ressource (resource-header est position:absolute) */
.agenda-team-header::before {
  content: '';
  display: block;
  width: var(--at-col-resource);
  height: 100%;
}

/* Trait entre jours dans la vue équipe */
.agenda-team-grid .grille-semaine-day-col {
  border-right-color: var(--at-week-sep);
}

/* ── En-tête heures (mode 1 semaine) ── */
.agenda-team-hours-row {
  display: grid;
  background: var(--gs-surface);
  border-bottom: 1px solid var(--gs-border);
  color: var(--gs-text-3);
  min-height: 20px;
  font-size: clamp(0.4rem, 0.8vw, 0.75rem);
  box-sizing: border-box;
  flex-shrink: 0;
}

/* ── Corps ── */
.agenda-team-body {
  display: grid;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
  align-items: stretch;
  position: relative;
  min-height: 40px;
}
.agenda-team-body::-webkit-scrollbar       { width: 6px; }
.agenda-team-body::-webkit-scrollbar-track { background: transparent; }
.agenda-team-body::-webkit-scrollbar-thumb { background: var(--at-border-mid); border-radius: 3px; }

/* ── Overlay badges (positionné sur la zone des colonnes jours) ── */
.agenda-team-overlay {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--at-col-resource);
  right: 0;
  pointer-events: none;
  z-index: 2;
}
.agenda-team-overlay .agenda-team-badge { pointer-events: auto; }

/* ── Colonnes jour ── */
.agenda-team-day-column {
  border-right: 1px solid var(--at-week-sep);
  min-height: 40px;
  position: relative;
  padding: 0;
  box-sizing: border-box;
}
.agenda-team-day-column:last-of-type       { border-right: none; }
.agenda-team-day-column.at-current-day    { background: var(--at-today-bg); }

/* ── Grille horaire de fond ── */
.at-hour-grid {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(var(--at-hours, 10), 1fr);
  z-index: 1;
  pointer-events: none;
}
.at-hour-grid-cell {
  border-right: 1px solid rgba(0,0,0,0.04);
  background: rgba(255,255,255,0.97);
}
.at-hour-grid-cell:last-child { border-right: none; }
.agenda-team-day-column.at-current-day .at-hour-grid-cell { background: transparent; }

/* ── Badges équipe ── */
.agenda-team-badge {
  position: absolute;
  border-radius: 4px;
  padding: 4px 8px 4px 11px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--at-shadow-sm);
  transition: box-shadow var(--at-transition), transform var(--at-transition);
  user-select: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1px;
  box-sizing: border-box;
}
.agenda-team-badge:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-1px);
  z-index: 10;
}
/* Barre latérale de type */
.agenda-team-badge::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 4px 0 0 4px;
  background: currentColor;
  opacity: 0.4;
}

/* Ligne 1 : titre */
.at-badge-row1 {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
  flex: 1;
}
.at-badge-title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  color: inherit;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

/* Ligne 2 : participants (mode compteur) */
.at-badge-row2 {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}
.at-badge-preps {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
}
.at-prep-counter {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 5px;
  background: rgba(255,255,255,0.35);
  border-radius: 3px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  color: inherit;
  flex-shrink: 0;
  line-height: 1;
}
.at-prep-counter svg       { flex-shrink: 0; opacity: 0.75; }
.at-prep-count             { font-variant-numeric: tabular-nums; }
.at-prep-counter--mat      { background: rgba(255,255,255,0.25); opacity: 0.85; }

/* Ligne 2 : participants (mode étendu) */
.at-badge-row2--expanded {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
  padding-top: 1px;
}
.at-prep-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  align-items: center;
}
.at-prep-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  background: rgba(255,255,255,0.35);
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  color: inherit;
  max-width: 120px;
  overflow: hidden;
  line-height: 1.3;
}
.at-prep-badge svg         { flex-shrink: 0; opacity: 0.8; }
.at-prep-badge-text        { overflow: hidden; white-space: nowrap; }
.at-prep-badge--mat        { background: rgba(255,255,255,0.25); opacity: 0.85; }

/* Hachures absence/formation */
.agenda-team-badge[data-type="absence"],
.agenda-team-badge[data-type="formation"] {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(0,0,0,0.04) 10px,
    rgba(0,0,0,0.04) 20px
  ) !important;
}

/* ── Colonne ressource (filtres type) ── */
.agenda-team-resource-col {
  padding: 8px;
  border-right: 1px solid var(--at-border-mid);
  background: var(--at-surface);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  left: 0;
  z-index: 5;
  box-shadow: 1px 0 0 var(--at-border-mid);
}
.at-filter-type-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--at-border);
  border-radius: 4px;
  background: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--at-text-2);
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}
.at-filter-type-btn .at-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--at-filter-color);
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 150ms ease;
}
.at-filter-type-btn:hover          { border-color: var(--at-filter-color); }
.at-filter-type-btn.active {
  background: var(--at-filter-bg);
  border-color: var(--at-filter-color);
  color: var(--at-filter-color);
  font-weight: 600;
}
.at-filter-type-btn.active .at-filter-dot { opacity: 1; }


/* ════════════════════════════════════════════════════════════════════════
   4. RESPONSIVE — dégradation progressive (identique à styles.css)
   ════════════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .header-container { height: 48px; }
  .topbar-left { display: none; }
  .topbar-right { display: none; }
  .nav-date-display { padding: 4px 8px; }
  .nav-range { font-size: 0.8rem; }
  .badge-current { display: none; }
  .nav-year { display: none; }
  .content { padding-top: 48px; }
  .grille-semaine-grid { height: calc(100vh - 48px); }
}

@media (max-width: 780px) {
  .topbar-weeks-divider,
  .topbar-weeks-selector { display: none; }
}

@media (max-width: 650px) {
  .header-container { height: 44px; }
  .topbar-nav { padding: 0 0.5rem; }
  .nav-date-display { width: auto; min-width: 120px; gap: 4px; }
  .nav-meta { display: none; }
  .btn-today { display: none; }
  .nav-arrow-divider { margin: 0 3px; }
  .content { padding-top: 44px; }
  .grille-semaine-grid { height: calc(100vh - 44px); }
}
