/* ─── Timeline horizontale — style Gantt, largeur pleine page ─────────── */

.tl-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 20px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  margin-top: var(--header-h);
}
.tl-toolbar label { font-size: 13px; color: var(--text-2); }
.tl-toolbar #tl-service { width: 240px; }

.tl-gran-nav { display: inline-flex; gap: 4px; }
.tl-gran-btn { padding: 5px 12px; font-size: 13px; }
.tl-gran-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.tl-nav { display: inline-flex; align-items: center; gap: 6px; }
.tl-range-label { font-size: 14px; font-weight: 600; margin-left: 10px; min-width: 220px; display: inline-block; }

.tl-hint { font-size: 11px; color: var(--text-3); margin-left: auto; font-style: italic; }

.tl-body { padding: 16px 20px; }

.tl-wrap {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface);
  overflow: hidden;                       /* pas de scroll horizontal */
  max-height: calc(100vh - var(--header-h) - 130px);
  position: relative;
}

/* Deux colonnes : employés fixes à gauche, viewport à droite */
.tl-container { display: flex; min-height: 0; }

.tl-left {
  width: 180px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  z-index: 2;
}

.tl-right-viewport {
  flex: 1; min-width: 0;
  position: relative;
  overflow: hidden;
  touch-action: pan-y;                    /* permet scroll vertical, drag horizontal capturé par JS */
  cursor: grab;
}
.tl-right-viewport.dragging { cursor: grabbing; user-select: none; }

.tl-right-inner {
  will-change: transform;
  transition: transform 0.25s cubic-bezier(.2,.7,.3,1);
}
.tl-right-inner.no-transition { transition: none; }

/* En-tête temporel */
.tl-head-emp {
  height: 44px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-3); font-weight: 600;
}
.tl-head-track {
  position: relative;
  height: 44px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.tl-head-tick {
  position: absolute; top: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-2);
  border-left: 1px solid var(--border);
  pointer-events: none;
}
.tl-head-tick-major { font-weight: 700; color: var(--text-1); font-size: 12px; }
.tl-head-tick-sub   { font-size: 10px; color: var(--text-3); }
.tl-head-tick.weekend { background: #eceff1; }
.tl-head-tick.ferie   { background: #ffe0b2; }

/* Cellule employé */
.tl-emp-cell {
  border-bottom: 1px solid var(--border);
  padding: 6px 10px;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; height: 44px; box-sizing: border-box;
}
.tl-emp-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tl-emp-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Piste par employé */
.tl-track {
  position: relative;
  height: 44px;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}
.tl-col-line {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: var(--border); pointer-events: none;
}

/* Blocs événement */
.tl-evt {
  position: absolute; top: 5px; height: 34px;
  border-radius: 4px; padding: 2px 6px;
  font-size: 11px; line-height: 14px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.15);
  color: #fff; user-select: none; box-sizing: border-box;
}
.tl-evt-repos {
  background: #fff !important;
  color: #333;
  background-image: repeating-linear-gradient(45deg,
    rgba(0,0,0,0.06) 0, rgba(0,0,0,0.06) 4px,
    transparent 4px, transparent 8px) !important;
  border: 1px dashed var(--border) !important;
}
.tl-evt-title { font-weight: 600; }
.tl-evt:hover { z-index: 5; box-shadow: 0 3px 8px rgba(0,0,0,0.3); }

/* Ligne verticale "maintenant" */
.tl-now {
  position: absolute; top: 44px; bottom: 0; width: 2px;
  background: #e53935; z-index: 1; pointer-events: none;
}

.tl-empty {
  padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 14px;
}
