:root {
  --bottle-green:   #07261f;
  --aztec:          #0c1d18;
  --gossamer:       #0fa07b;
  --gossamer-hover: #0d8a6a;
  --gossamer-light: #1ac99a;
  --gossamer-dark:  #0a7a5e;
  --orange:         #e87a2a;

  --bg:        #f5f5f7;
  --text:      #1d1d1f;
  --text-mut:  #86868b;
  --text-soft: #515154;
  --border:    #e5e5ea;
  --soft:      #f5f5f7;
  --shadow:    0 4px 20px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

a { color: var(--gossamer-dark); text-decoration: none; }
a:hover { color: var(--gossamer); text-decoration: underline; }

/* ── Topbar ──────────────────────────────────────────────── */

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 24px;
  font-size: 16px;
  font-weight: 700;
  color: var(--bottle-green);
}
.brand:hover { color: var(--bottle-green); text-decoration: none; }
.brand .brand-dot { color: var(--gossamer); }
.brand .brand-logo {
  height: 32px; width: auto; max-width: 160px;
  object-fit: contain; display: block;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.topbar-nav .nav-item { position: relative; }

.topbar-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mut);
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
  text-decoration: none;
}
.topbar-nav .nav-link:hover {
  background: var(--soft);
  color: var(--text);
  text-decoration: none;
}
.topbar-nav .nav-link.show,
.topbar-nav .nav-link.active {
  background: var(--soft);
  color: var(--bottle-green);
}

/* Bootstrap dropdown override */
.dropdown-menu {
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08) !important;
  padding: 6px !important;
  min-width: 240px;
  margin-top: 4px !important;
  font-family: inherit;
}

.dropdown-item {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 10px !important;
  font-size: 13px;
  color: var(--text);
  border-radius: 6px;
  line-height: 1.3;
  font-family: inherit;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--soft);
  color: var(--text);
}
.dropdown-item img,
.dropdown-item .nav-link-icon {
  margin-right: 8px;
  flex-shrink: 0;
}
.dropdown-item .nav-link-icon { color: var(--gossamer); }
.dropdown-item-name { font-weight: 600; flex: 1; }
.dropdown-item-desc {
  font-size: 11px;
  color: var(--text-mut);
  font-weight: 400;
  width: 100%;
  padding-left: 24px;
  margin-top: 2px;
}

/* Sous-menus imbriqués (Bootstrap 5 ne les supporte pas nativement) */
.dropdown-submenu { position: relative; }
.dropdown-submenu > .dropdown-menu {
  display: none;
  position: absolute;
  top: -7px;
  left: 100%;
  margin-left: 2px;
}
.dropdown-submenu:hover > .dropdown-menu,
.dropdown-submenu.show > .dropdown-menu { display: block; }
.dropdown-submenu-toggle { position: relative; padding-right: 24px !important; }
.dropdown-submenu-toggle::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 4px solid currentColor;
}

/* ── User badge ──────────────────────────────────────────── */

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.user-badge .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.user-badge .user-name {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
}
.user-badge .btn-logout {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-mut);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.15s;
}
.user-badge .btn-logout:hover {
  background: var(--soft);
  color: var(--text);
}
.btn-edit-menu {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-mut);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
  margin-right: 8px;
}
.btn-edit-menu:hover {
  background: var(--soft);
  color: var(--gossamer-dark);
  border-color: var(--gossamer-dark);
}

/* ── Content ─────────────────────────────────────────────── */

.content {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 24px;
}
.content.content-fluid {
  max-width: none;
  margin: 0;
  padding: 0;
}
.content.content-fluid.home-page {
  padding: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--bottle-green);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-mut);
  margin: 0 0 20px;
}

/* ── Employee card ───────────────────────────────────────── */

.employee-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: #fff;
  border-radius: 12px;
  padding: 20px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.employee-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gossamer-light) 0%, var(--gossamer-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15,160,123,0.25);
}
.employee-avatar img { width: 100%; height: 100%; object-fit: cover; }

.employee-info { flex: 1; min-width: 0; }
.employee-info h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.employee-info .meta {
  font-size: 13px;
  color: var(--text-mut);
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 2px;
}
.employee-info .meta span + span::before { content: " · "; }

.emp-details-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-soft);
}
.emp-details-row a { color: var(--gossamer-dark); }
.emp-details-row a:hover { text-decoration: underline; }
.emp-details-row i { color: var(--gossamer); }

.emp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.emp-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 12px;
  background: rgba(15,160,123,0.10);
  color: var(--gossamer-dark);
}

/* Soldes congés panel */
.emp-conges-panel {
  flex-shrink: 0;
  min-width: 200px;
  max-width: 260px;
  background: #f5f5f7;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12px;
}
.emp-conges-panel .cp-title {
  font-size: 11px;
  font-weight: 600;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.emp-conges-soldes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.emp-solde-pill {
  text-align: center;
  background: #fff;
  border-radius: 7px;
  padding: 5px 10px;
  min-width: 70px;
}
.emp-solde-pill .sp-val {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
}
.emp-solde-pill .sp-val.neg { color: #d93025; }
.emp-solde-pill .sp-name {
  font-size: 10px;
  color: #86868b;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}
.emp-conges-upcoming {
  border-top: 1px solid #e5e5ea;
  padding-top: 7px;
  max-height: 200px;
  overflow-y: auto;
}
.emp-conges-upcoming:empty { display: none; }
.emp-conges-upcoming .cup-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  font-size: 11px;
  color: #515154;
}
.emp-conges-upcoming .cup-row .cup-days {
  font-weight: 600;
  color: #714B67;
  white-space: nowrap;
}
.cup-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  font-size: 11px;
  color: #515154;
}
.cup-row .cup-days {
  font-weight: 600;
  color: #714B67;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .employee-card { flex-direction: column; }
  .emp-conges-panel { max-width: 100%; width: 100%; }
}

/* ── Grid + Tiles ────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.tile {
  grid-column: span 6;
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 120px;
}
.tile.span-4  { grid-column: span 4; }
.tile.span-12, .tile.wide { grid-column: span 12; }
.tile.flush { padding: 18px 0; }
.tile.flush > header { padding: 0 20px; }
.tile.flush > .body { padding: 0; }

.tile .def {
  font-size: 11px;
  color: var(--text-mut);
  margin: -4px 0 12px;
  line-height: 1.4;
}

.big-number {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.big-sub {
  font-size: 11px;
  color: var(--text-mut);
  margin-top: 4px;
}
.kpi-row {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.kpi {
  text-align: center;
}
.kpi .big-number { font-size: 28px; }

/* KPIs compacts + layout fill pour tiles avec longue liste */
.kpi-row-compact {
  display: flex; gap: 14px; justify-content: center;
  padding: 2px 0 8px;
  flex-shrink: 0; flex-wrap: wrap;
}
.kpi-row-compact .kpi-val { font-size: 18px; font-weight: 700; line-height: 1.1; }
.kpi-row-compact .kpi-lbl { font-size: 10px; color: var(--text-mut); margin-top: 1px; }
/* Tile haute avec liste scrollable (Tâches, Tickets). Nom dédié pour
   éviter le conflit avec `.tile-list` utilisée pour les listes UL Drive/Gmail. */
.tile.tile-tall { min-height: 640px; max-height: 920px; }
.tile.tile-tall > .body {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
}
.tile-tall-scroll {
  flex: 1; overflow-y: auto; min-height: 0;
  padding-bottom: 4px;
}
.tile.tile-tall .kpi-row-compact { margin-top: 2px; }
.tile.tile-tall .stage-filters { margin-bottom: 8px; }

/* Marqueur "semaine en cours" (timesheets, planning) */
.ts-current-tag {
  display: inline-block; font-size: 9px; font-weight: 700;
  padding: 1px 6px; margin-left: 6px; border-radius: 8px;
  background: #714B67; color: #fff;
  letter-spacing: 0.02em; text-transform: uppercase;
  vertical-align: middle;
}
.ts-block.ts-block-current {
  border-left: 3px solid #714B67;
  padding-left: 8px;
}
.ts-empty-week {
  font-size: 11px; color: var(--text-mut, #888);
  text-align: center; padding: 12px 0;
}
.plan-row-current {
  background: rgba(113, 75, 103, 0.04);
  border-left: 2px solid #714B67;
  padding-left: 6px;
}

/* Marqueur "semaine passée" (widget Planning du dashboard collaborateur) */
.ts-past-tag {
  display: inline-block; font-size: 9px; font-weight: 700;
  padding: 1px 6px; margin-left: 6px; border-radius: 8px;
  background: #f5f5f7; color: #86868b;
  letter-spacing: 0.02em; text-transform: uppercase;
  vertical-align: middle;
}
.plan-row-past { opacity: 0.92; }
.plan-row-past .plan-chevron { color: #c7c7cc; }

/* Badge "Xh TS" sur les lignes projet du widget Planning */
.ts-proj-badge {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
  background: #e3f2fd; color: #1565c0;
  white-space: nowrap;
}
.ts-proj-badge.is-over     { background: #ffebee; color: #b71c1c; }
.ts-proj-badge.is-off-plan { background: #fbe9e7; color: #bf360c; }

/* Gantt — semaine passée légèrement grisée */
.ip-gantt td.ip-gantt-past { background-image: linear-gradient(rgba(0,0,0,0.02), rgba(0,0,0,0.02)); }
.ip-gantt th.ip-gantt-past { color: #c7c7cc; }

/* ── Grille planning compacte (widget Planning fiche collab) ──
   Réplique de la grille /planning filtrée employé. Lignes = projets,
   colonnes = semaines, cellules = slots planifiés + TS + hors-planning. */
.collab-pg-outer { width: 100%; overflow-x: auto; }
.collab-pg-grid {
  display: grid;
  grid-template-columns: 180px repeat(var(--weeks, 8), minmax(110px, 1fr));
  font-size: 11px;
}
.collab-pg-header {
  background: #fafafa; padding: 6px 8px;
  font-weight: 700; color: #714B67;
  border-bottom: 2px solid #e5e5ea;
  text-align: center; position: relative;
}
.collab-pg-header.collab-pg-name-col { text-align: left; }
.collab-pg-header.is-current { background: #e6f7f1; }
.collab-pg-header.is-past    { background: #f5f5f7; color: #86868b; }
.collab-pg-week-sub { font-size: 9px; font-weight: 500; color: #86868b; margin-top: 2px; }

.collab-pg-name {
  padding: 6px 8px; background: #fff;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; min-width: 0;
}
.collab-pg-name .collab-pg-proj-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.collab-pg-proj-total {
  font-size: 10px; font-weight: 700;
  color: #714B67; background: #f0eaf4;
  border-radius: 10px; padding: 1px 7px; white-space: nowrap;
}
.collab-pg-total-lbl { font-weight: 700; color: #1d1d1f; background: #fafafa; }

.collab-pg-cell {
  border-bottom: 1px solid #f0f0f0;
  border-left: 1px solid #f5f5f7;
  padding: 4px;
  display: flex; flex-direction: column; gap: 3px;
  min-height: 40px;
}
.collab-pg-cell.is-current { background: rgba(15,160,123,0.04); }
.collab-pg-cell.is-past    { background: rgba(0,0,0,0.015); }

.collab-pg-cell.collab-pg-total-cell {
  background: #fafafa;
  padding: 4px 6px;
  justify-content: flex-start;
}
.collab-pg-total-cell .gauge-bar {
  flex: 0 0 16px;  /* override .gauge-bar { flex: 1 } qui ferait s'étirer la jauge */
  height: 16px; background: var(--border); border-radius: 4px;
  overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.collab-pg-total-cell .gauge-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  transition: width 0.2s;
}
.collab-pg-total-cell .gauge-label {
  /* Réinitialise left/top/transform de la règle générique .gauge-label qui
     décalerait le texte de 50% droite/bas en position:relative. */
  position: relative; left: auto; top: auto; transform: none;
  z-index: 1;
  font-size: 10px; font-weight: 700; color: var(--text);
  text-shadow: 0 0 2px rgba(255,255,255,0.7), 0 0 2px rgba(255,255,255,0.7);
  line-height: 1; white-space: nowrap;
}
.collab-pg-total-cell.gauge-low  .gauge-fill { background: #4CAF50; }
.collab-pg-total-cell.gauge-mid  .gauge-fill { background: #FFB300; }
.collab-pg-total-cell.gauge-full .gauge-fill { background: #66BB6A; }
.collab-pg-total-cell.gauge-over .gauge-fill { background: #EF5350; }
.collab-pg-total-cell.gauge-over .gauge-label { color: #fff; text-shadow: 0 0 3px rgba(0,0,0,0.5), 0 0 3px rgba(0,0,0,0.5); }
.collab-pg-total-cell.gauge-off  .gauge-bar  { background: var(--soft); }
.collab-pg-total-cell.gauge-off  .gauge-fill { display: none; }
.collab-pg-total-cell.gauge-off  .gauge-label { color: #c7c7cc; font-style: italic; text-shadow: none; }

.collab-pg-ts-total {
  font-size: 10px; font-weight: 700; color: #1565c0;
  text-align: center; margin-top: 2px;
}

/* Tuile « Tâches ouvertes par filtre » — dashboard département.
   Tableau : lignes = collaborateurs, colonnes = filtres + total. Même style
   que .dept-ts-table mais avec grid-template-columns dynamique (set inline). */
.dept-tasks-table { width: 100%; }
.dept-tasks-header {
  display: grid;
  gap: 8px; padding: 0 4px 6px;
  font-size: 11px; font-weight: 600; color: #86868b;
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid #e5e5ea; margin-bottom: 4px;
  align-items: end;
}
.dept-tasks-header .dft-col-name {
  text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dept-tasks-header .dft-col-name.is-error { color: #bf360c; }
.dept-tasks-row {
  display: grid;
  gap: 8px; padding: 6px 4px;
  font-size: 13px; align-items: center;
  border-bottom: 1px solid #f5f5f7;
}
.dept-tasks-row:last-child { border-bottom: none; }
.dept-tasks-row:hover { background: #f5f5f7; }
.dept-tasks-totals {
  border-top: 1px solid #e5e5ea;
  background: #fafafa;
  font-weight: 600;
}
.dept-tasks-totals:hover { background: #fafafa; }
.dft-cell {
  text-align: center;
  display: flex; align-items: baseline; justify-content: center; gap: 5px;
  min-width: 0;
}
.dft-cell b {
  font-weight: 700; color: #714B67;
}
.dft-cell .dft-rem {
  font-size: 10px; color: #86868b; font-weight: 500;
}
.dft-cell.is-zero { color: #c7c7cc; }
.dft-cell.dft-total b { color: #1d1d1f; }
/* Colonnes planifié S+0/S+1/S+2 */
.dept-tasks-header .dft-col-week {
  display: flex; flex-direction: column; align-items: center;
  line-height: 1.2;
}
.dept-tasks-header .dft-col-week small {
  font-size: 9px; font-weight: 500;
  color: #c7c7cc; text-transform: none;
  letter-spacing: 0;
  margin-top: 2px;
}
.dft-cell.dft-plan b { color: #1565c0; font-weight: 700; }
.dft-cell.dft-plan.is-current {
  background: rgba(15, 160, 123, 0.06);
  border-radius: 4px;
}

/* Mini jauge TS/planifié sur la colonne S+0 (semaine en cours) */
.dft-plan-gauge {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 2px !important;
  padding: 2px 4px;
  background: rgba(15, 160, 123, 0.05);
  border-radius: 4px;
}
.dft-pg-bar {
  flex: 0 0 6px;
  height: 6px;
  background: #e5e5ea;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  display: block;
}
.dft-pg-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  display: block;
  transition: width 0.2s;
}
.dft-pg-label {
  font-size: 10px; font-weight: 700;
  text-align: center; line-height: 1;
  color: #1d1d1f; white-space: nowrap;
}
.dft-plan-gauge.is-low      .dft-pg-fill { background: #4CAF50; }
.dft-plan-gauge.is-mid      .dft-pg-fill { background: #FFB300; }
.dft-plan-gauge.is-full     .dft-pg-fill { background: #66BB6A; }
.dft-plan-gauge.is-over     .dft-pg-fill { background: #EF5350; }
.dft-plan-gauge.is-over     .dft-pg-label { color: #b71c1c; }
.dft-plan-gauge.is-off-plan .dft-pg-fill { background: #bf360c; }
.dft-plan-gauge.is-off-plan .dft-pg-label { color: #bf360c; font-style: italic; }
/* Surlignage des cases dont le filtre est associé au rôle de l'employé
   (via TASKS_FILTERS_CONFIG → planning_roles). */
.dft-cell.is-role-match {
  background: #f0eaf4;
  border-radius: 4px;
  outline: 1px solid rgba(113, 75, 103, 0.18);
}

/* Lignes employé dépliables + sous-tableau projets */
.dept-tasks-row.is-expandable { cursor: pointer; }
.dept-tasks-row.is-expandable:hover { background: #f5f5f7; }
.dft-chev {
  display: inline-block;
  width: 12px; font-size: 9px; color: #86868b;
  flex-shrink: 0; margin-right: 4px;
  transition: transform 0.15s;
}
.dft-chev.is-empty { visibility: hidden; }
.dept-tasks-projects { display: none; }
.dept-tasks-projects.open { display: block; background: #fafafa; }
.dept-tasks-proj-row {
  display: grid;
  gap: 8px; padding: 4px 4px 4px 24px;
  font-size: 12px; align-items: center;
  border-bottom: 1px solid #f0f0f0;
  color: #515154;
}
.dept-tasks-proj-row:last-child { border-bottom: none; }
.dft-proj-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #515154; font-weight: 500;
}

/* Projet planifié / pointé MAIS aucune tâche dans les filtres — risque
   d'effort non tracé côté tâches. */
.dept-tasks-proj-row.is-planned-no-task {
  background: #fff8e1;
}
.dept-tasks-proj-row.is-planned-no-task .dft-proj-name {
  color: #e65100; font-weight: 600;
}
.dft-cell.is-no-task {
  color: #e65100; font-weight: 700; font-size: 14px;
  background: rgba(230, 81, 0, 0.08);
  border-radius: 4px;
}
.dft-cell.is-clickable { cursor: pointer; border-radius: 4px; }
.dft-cell.is-clickable:hover { background: rgba(113, 75, 103, 0.12); }

/* Liste de tâches dans la modale dft-modal */
.dft-modal-task-list { display: flex; flex-direction: column; gap: 6px; }
.dft-task-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  background: #fff;
}
.dft-task-prio { flex-shrink: 0; font-size: 14px; line-height: 1.2; }
.dft-task-info { flex: 1; min-width: 0; }
.dft-task-name {
  font-weight: 600; color: #1d1d1f; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dft-task-meta {
  margin-top: 2px;
  font-size: 11px; color: #86868b;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.dft-task-proj { color: #714B67; font-weight: 500; }
.dft-task-dl.is-overdue { color: #b71c1c; font-weight: 600; }
.dft-task-hours {
  display: flex; gap: 8px; flex-shrink: 0;
  font-size: 11px; color: #86868b; white-space: nowrap;
  align-items: center;
}

/* Badge ⚠ sur la ligne employé : indique que ≥1 projet est planifié/pointé
   sans tâche dans les filtres associés au rôle de l'employé. Tooltip liste
   les projets concernés. */
.dft-risk-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  margin-left: 6px;
  font-size: 11px; font-weight: 700;
  color: #e65100; background: #fff3e0;
  border: 1px solid #ffe0b2;
  border-radius: 50%;
  cursor: help;
  flex-shrink: 0;
}
.dept-tasks-row.has-risk:hover { background: #fff8e1; }

/* Légende du widget — réplique les styles .legend* du .planning-toolbar
   (scopés à cette barre d'outils, donc non applicables hors de /planning). */
.collab-pg-legend {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-mut);
  margin-bottom: 10px;
}
.collab-pg-legend .legend-item {
  display: flex; align-items: center; gap: 4px;
}
.collab-pg-legend .legend-dot {
  width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
}

.collab-pg-abs {
  font-size: 9px; font-weight: 600;
  padding: 1px 4px; border-radius: 3px;
  text-align: center;
}
.collab-pg-holiday { background: #fff3e0; color: #e65100; }
.collab-pg-leave   { background: #e3f2fd; color: #1565c0; }

.collab-pg-empty {
  text-align: center; color: #c7c7cc;
  padding: 24px 12px; font-size: 12px; font-style: italic;
}

.collab-pg-footer {
  margin-top: 10px;
  padding: 8px 10px;
  background: #fafafa;
  border-radius: 6px;
  font-size: 12px;
  display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap;
}
.collab-pg-foot-ts { color: #1565c0; font-weight: 600; }

/* Marqueur "élément visible côté manager uniquement". */
.manager-only-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; font-weight: 700; line-height: 1;
  padding: 3px 7px; border-radius: 8px;
  background: #fff8e1; color: #8a6d3b;
  border: 1px solid #f0d690;
  letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}
.manager-only-badge i { font-size: 10px; }
/* Posé en haut à droite d'un bloc/sous-section. */
.manager-only-wrap { position: relative; }
.manager-only-wrap > .manager-only-badge {
  position: absolute; top: 0; right: 0;
}
/* Variante : badge en début de section (pour les sous-blocs). */
.manager-section-header {
  display: flex; align-items: center; gap: 8px;
  margin: 14px 0 8px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}
.manager-section-header h4 {
  margin: 0; font-size: 13px; font-weight: 600;
  color: var(--text-mut, #555);
}

.color-ok    { color: #2E7D32; }
.color-warn  { color: #E65100; }
.color-bad   { color: #B71C1C; }
.color-info  { color: var(--gossamer-dark); }

/* Gantt simplifié — tile dashboard perso "Projets en cours" */
.gp-gantt { font-size: 11px; width: 100%; }
.gp-row { display: flex; align-items: stretch; padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
.gp-name {
  width: 220px; padding-right: 8px; flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.gp-track {
  position: relative; flex: 1; min-height: 28px;
  background: #f7f7f9; border-radius: 3px;
}
.gp-bar {
  position: absolute; top: 3px; bottom: 3px;
  background: #714B67; border-radius: 3px; opacity: 0.8;
}
.gp-bar-r  { background: #4FC3F7; }
.gp-bar-p  { background: #FFA726; }
.gp-bar-rp { background: #714B67; }
.gp-today {
  position: absolute; top: -2px; bottom: -2px; width: 2px;
  background: #e53935; z-index: 2;
}
.gp-header {
  display: flex; padding-bottom: 8px;
  border-bottom: 1px solid #e5e5ea;
  color: #86868b;
}
.gp-header-spacer { width: 220px; flex-shrink: 0; }
.gp-header-track { position: relative; flex: 1; height: 22px; }
.gp-month-tick {
  position: absolute; top: 4px;
  font-size: 10px; font-weight: 600;
  transform: translateX(-50%); white-space: nowrap;
  background: #fff; padding: 0 3px;
}
.gp-badge {
  display: inline-block; font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 8px; color: #fff;
  background: #714B67;
}
.gp-b-r  { background: #4FC3F7; }
.gp-b-p  { background: #FFA726; }
.gp-b-rp { background: #714B67; }
.gp-legend {
  display: flex; gap: 14px; padding-top: 8px;
  font-size: 10.5px; color: #86868b;
}
.gp-legend span { display: inline-flex; align-items: center; gap: 4px; }

/* Onglets et heatmap Gantt du tile Planning (page d'accueil) */
.ind-plan-tab {
  border: none; padding: 5px 12px;
  font-size: 12px; font-weight: 500;
  border-radius: 6px; cursor: pointer;
  background: #f0f0f0; color: #515154;
}
.ind-plan-tab.active { background: #714B67; color: #fff; }
.ip-gantt { width: 100%; border-collapse: collapse; font-family: inherit; }
.ip-gantt th { border-bottom: 2px solid #e5e5ea; }
.ip-gantt td { border-bottom: 1px solid #f0f0f0; }
.ip-gantt td.ip-gantt-current {
  box-shadow: inset 1px 0 0 #714B67, inset -1px 0 0 #714B67;
}
.ip-gantt th.ip-gantt-current {
  box-shadow: inset 0 -2px 0 #714B67;
}

.alert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.alert-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}
.alert-item.ok     { background: rgba(76,175,80,0.08); color: #2E7D32; }
.alert-item.warn   { background: rgba(255,152,0,0.08); color: #E65100; }
.alert-item.danger { background: rgba(239,83,80,0.08); color: #B71C1C; }
.alert-item .icon  { font-size: 16px; flex-shrink: 0; }
.alert-item .label { flex: 1; }

.gauge-bar {
  flex: 1;
  background: #f0f0f0;
  border-radius: 6px;
  height: 24px;
  position: relative;
  overflow: hidden;
}
.gauge-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s;
}
.gauge-target {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: #1d1d1f;
  border-radius: 1px;
  transform: translateX(-1px);
  pointer-events: none;
  z-index: 1;
}
.gauge-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  font-size: 11px;
  font-weight: 600;
  color: #1d1d1f;
}

.toggle-btns {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.toggle-btn {
  border: none;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  background: #f0f0f0;
  color: var(--text-soft);
  font-family: inherit;
}
.toggle-btn.active {
  background: var(--gossamer);
  color: #fff;
}

@media (max-width: 900px) {
  .tile, .tile.wide, .tile.span-4 { grid-column: span 12; }
}

.tile > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}
.tile > header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--bottle-green);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tile > header h3 i { font-size: 16px; }
.tile-action {
  color: var(--text-mut);
  font-size: 14px;
}
.tile-action:hover { color: var(--gossamer); text-decoration: none; }

.tile > .body { flex: 1; min-height: 0; }

/* Tile list (Drive/Gmail/Cal items) */
.tile-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tile-list li {
  border-top: 1px solid #f0f0f2;
}
.tile-list li:first-child { border-top: none; }
.tile-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  font-size: 13px;
  color: var(--text);
}
.tile-list a:hover {
  background: var(--soft);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
}
.tile-list .item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.tile-list .item-meta {
  color: var(--text-mut);
  font-size: 11px;
  white-space: nowrap;
}
.tile-list .item-icon { flex-shrink: 0; }

.tile-list-stacked .item-name { white-space: normal; line-height: 1.3; }
.tile-list-stacked .item-sub {
  font-size: 11px;
  color: var(--text-mut);
  margin-top: 1px;
}

/* Service icons (kept for brand recognition) */
.icon-drive    { color: #4285F4; }
.icon-gmail    { color: #EA4335; }
.icon-calendar { color: var(--gossamer); }

.tile-empty {
  text-align: center;
  padding: 24px 12px;
  color: #c7c7cc;
  font-size: 12px;
}
.tile-empty i {
  font-size: 24px;
  opacity: 0.5;
  display: block;
  margin-bottom: 6px;
}

.tile-error {
  background: rgba(217,48,37,0.08);
  color: #b22418;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* ── Tabs ────────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  width: fit-content;
  flex-wrap: wrap;
}
.tab {
  border: none;
  background: transparent;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-mut);
  font-family: inherit;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab:hover { color: var(--text); background: var(--soft); }
.tab.active {
  background: var(--gossamer);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(15,160,123,0.25);
}
.tab-count {
  background: rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}
.tab.active .tab-count { background: rgba(255,255,255,0.25); }

/* ── Data tables ─────────────────────────────────────────── */

.data-table {
  width: 100%;
  font-size: 13px;
  margin: 0;
  border-collapse: collapse;
}
.data-table thead th {
  border-bottom: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mut);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
}
.data-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid #f5f5f7;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tfoot td {
  padding: 9px 10px;
  font-weight: 600;
  border-top: 1px solid var(--border);
  background: var(--soft);
}
.text-end { text-align: right; }
.text-mut { color: var(--text-mut); }

/* Bar (timesheets) */
.bar-bg {
  height: 8px;
  background: #f0f0f5;
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gossamer-dark), var(--gossamer-light));
}

/* ── Status pills ────────────────────────────────────────── */

.status-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 10px;
}
.status-secondary { background: #eef0f3; color: var(--text-soft); }
.status-success   { background: rgba(15,160,123,0.10); color: var(--gossamer-dark); }
.status-warning   { background: rgba(232,122,42,0.12); color: #c46010; }
.status-danger    { background: rgba(217,48,37,0.10);  color: #b22418; }
.status-info      { background: rgba(50,100,200,0.08); color: #2456b8; }
.status-primary   { background: rgba(7,38,31,0.08);    color: var(--bottle-green); }

/* ── Loading ─────────────────────────────────────────────── */

.loading {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-mut);
  font-size: 13px;
}

/* ── Login page ──────────────────────────────────────────── */

body.page-login {
  background: var(--aztec);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 14px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px rgba(4, 16, 14, 0.45);
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gossamer-light) 0%, var(--gossamer-dark) 100%);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(15, 160, 123, 0.35);
}

.login-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--bottle-green);
  margin: 0;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #fff;
  border: 1.5px solid #dadce0;
  color: #3c4043;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  border-color: #c6c6c6;
  color: #3c4043;
  text-decoration: none;
}

.login-error {
  background: rgba(217,48,37,0.08);
  color: #b22418;
  padding: 10px 14px;
  font-size: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* ── Tâches : filtres d'étapes + groupes ─────────────────── */

.stage-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.stage-filter {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-mut);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
}
.stage-filter:hover { border-color: var(--gossamer-dark); color: var(--gossamer-dark); }
.stage-filter.active { background: var(--gossamer-dark); color: #fff; border-color: var(--gossamer-dark); }
.stage-filter .sf-count {
  background: rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 0 5px;
  font-size: 10px;
  min-width: 16px;
  text-align: center;
}
.stage-filter.active .sf-count { background: rgba(255,255,255,0.25); }
.stage-group { margin-bottom: 4px; }
.stage-group:last-child { margin-bottom: 0; }
.stage-group.hidden { display: none; }
.stage-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 6px;
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.stage-header:hover { background: var(--soft); }
.stage-toggle { font-size: 11px; color: var(--text-mut); transition: transform 0.2s; }
.stage-group.collapsed .stage-toggle { transform: rotate(-90deg); }
.stage-name { font-size: 13px; font-weight: 600; color: var(--gossamer-dark); }
.stage-count { font-size: 11px; color: var(--text-mut); margin-left: auto; }
.stage-tasks { padding-left: 4px; }
.stage-group.collapsed .stage-tasks { display: none; }

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--soft);
  font-size: 12px;
}
.task-item:last-child { border-bottom: none; }
.task-prio { font-size: 14px; flex-shrink: 0; width: 18px; text-align: center; }
.task-info { flex: 1; min-width: 0; }
.task-name { font-weight: 500; color: var(--text); white-space: normal; word-break: break-word; }
.task-meta { font-size: 11px; color: var(--text-mut); margin-top: 2px; }
.task-hours { font-size: 10px; color: var(--text-mut); white-space: nowrap; flex-shrink: 0; text-align: right; line-height: 1.5; }
.task-hours div { font-weight: 500; }

/* ── Timesheets : vues semaine / mois / graphique ────────── */

.ts-views {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.ts-view-btn {
  border: none;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  background: var(--soft);
  color: var(--text-soft);
  font-family: inherit;
}
.ts-view-btn.active { background: var(--gossamer-dark); color: #fff; }
.ts-scroll { max-height: 500px; overflow-y: auto; }
.ts-block { margin-bottom: 16px; }
.ts-block-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gossamer-dark);
  padding: 6px 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2px;
}
.ts-block-title.cap { text-transform: capitalize; }
.ts-table { width: 100%; border-collapse: collapse; }
.ts-table th {
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mut);
  text-align: right;
  white-space: nowrap;
}
.ts-table th.proj { text-align: left; }
.ts-table th.total { color: var(--gossamer-dark); }
.ts-table td {
  padding: 4px 6px;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}
.ts-table td.proj {
  font-weight: 500;
  text-align: left;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ts-table td.total {
  font-weight: 700;
  color: var(--gossamer-dark);
}
.ts-table tr.proj-row { border-bottom: 1px solid var(--soft); cursor: pointer; }
.ts-table tr.total-row { border-top: 2px solid var(--gossamer-dark); background: rgba(15,160,123,0.06); }
.ts-table tr.total-row td.proj { font-weight: 700; color: var(--gossamer-dark); }
.ts-low { color: #b71c1c !important; background: #ffcdd2; border-radius: 4px; padding: 2px 6px; font-weight: 700; }
.ts-cell-low { color: #b71c1c !important; font-weight: 700; background: #ffcdd2; border-radius: 4px; }
.ts-cell-empty { color: #e0e0e0; }
.ts-detail {
  padding: 4px 0 8px 24px;
  background: #fafafa;
}
.ts-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.ts-detail-table th {
  padding: 3px 6px;
  text-align: left;
  color: var(--text-mut);
  font-weight: 600;
}
.ts-detail-table th.r { text-align: right; }
.ts-detail-table td { padding: 3px 6px; color: var(--text-soft); }
.ts-detail-table td.muted { color: var(--text-mut); }
.ts-detail-table td.r { text-align: right; font-weight: 500; color: var(--gossamer-dark); }
.ts-detail-table tr { border-bottom: 1px solid #f0f0f0; }
.ts-chevron {
  font-size: 11px;
  color: var(--text-mut);
  margin-right: 6px;
  display: inline-block;
  transition: transform 0.2s;
}
.ts-chart-row {
  padding: 4px 0 4px 8px;
  border-bottom: 1px solid var(--soft);
  font-size: 12px;
}
.ts-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.ts-chart-head .pname {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.ts-chart-head .ppct { color: var(--text-mut); font-size: 11px; margin-left: 6px; }
.ts-chart-head .phours {
  font-weight: 600;
  color: var(--gossamer-dark);
  white-space: nowrap;
  margin-left: 8px;
  min-width: 45px;
  text-align: right;
}
.ts-chart-bar {
  background: #f0f0f0;
  border-radius: 3px;
  height: 4px;
  margin-top: 3px;
  overflow: hidden;
}
.ts-chart-bar-fill {
  height: 100%;
  background: var(--gossamer-dark);
  border-radius: 3px;
}
.ts-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 4px;
}
.ts-month-header .lbl {
  font-size: 13px;
  font-weight: 600;
  color: var(--gossamer-dark);
  text-transform: capitalize;
}
.ts-month-header .tot {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* ── Planning ────────────────────────────────────────────── */

@keyframes spin { to { transform: rotate(360deg); } }

.planning-page { padding: 0; }

.planning-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 56px;
  z-index: 15;
  flex-wrap: wrap;
}
.planning-toolbar .week-nav {
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
}
.planning-toolbar .week-nav button {
  border: 1px solid var(--border); background: #fff; border-radius: 6px;
  padding: 4px 7px; font-size: 12px; cursor: pointer; font-weight: 500;
  font-family: inherit;
}
.planning-toolbar .week-nav button:hover { border-color: var(--gossamer-dark); color: var(--gossamer-dark); }
.planning-toolbar .week-nav .week-label {
  font-size: 12px; font-weight: 600; min-width: 150px; text-align: center;
}
.planning-toolbar select,
.planning-toolbar input {
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; font-family: inherit; background: #fff;
}
.planning-toolbar select:focus,
.planning-toolbar input:focus {
  outline: none; border-color: var(--gossamer-dark);
  box-shadow: 0 0 0 2px rgba(15,160,123,0.15);
}
.planning-toolbar .btn-action {
  border: none; padding: 6px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: inherit;
}
.planning-toolbar .btn-primary { background: var(--gossamer-dark); color: #fff; }
.planning-toolbar .btn-secondary { background: var(--soft); color: var(--text-soft); }
.planning-toolbar .btn-secondary:hover { background: var(--border); }
.planning-toolbar .view-toggle { display: flex; gap: 0; }
.planning-toolbar .view-toggle .btn-action:first-child { border-radius: 6px 0 0 6px; }
.planning-toolbar .view-toggle .btn-action:last-child { border-radius: 0 6px 6px 0; }
.planning-toolbar .legend {
  display: flex; gap: 12px; font-size: 11px; color: var(--text-mut);
}
.planning-toolbar .legend-item { display: flex; align-items: center; gap: 4px; }
.planning-toolbar .legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.planning-toolbar .toolbar-sep {
  width: 1px; height: 22px; background: var(--border); flex-shrink: 0;
}
.planning-toolbar .readonly-badge {
  font-size: 10px; color: var(--text-mut);
  padding: 3px 0; font-weight: 500;
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0;
}
.planning-detail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}
.planning-detail-toggle input { margin: 0; cursor: pointer; }

/* ── Multi-select dropdown (planning role filters) ── */
.ms-dropdown { position: relative; display: inline-block; }
.ms-trigger {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; font-size: 13px; color: var(--text); white-space: nowrap;
  line-height: 1.4;
}
.ms-trigger:hover { border-color: var(--gossamer-dark); }
.ms-trigger.ms-open { border-color: var(--gossamer-dark); box-shadow: 0 0 0 2px rgba(15,160,123,.15); }
.ms-chevron { font-size: 10px; transition: transform .15s; flex-shrink: 0; }
.ms-trigger.ms-open .ms-chevron { transform: rotate(180deg); }
.ms-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 200;
  min-width: 210px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15); padding: 8px;
}
.ms-search {
  width: 100%; box-sizing: border-box;
  padding: 5px 8px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 12px; background: var(--bg-main); color: var(--text-main);
}
.ms-search:focus { outline: none; border-color: var(--gossamer-dark); }
.ms-actions {
  display: flex; gap: 4px;
  padding: 4px 0;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--border);
}
.ms-action {
  flex: 1;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--text-mut);
  font-family: inherit;
}
.ms-action:hover { border-color: var(--gossamer-dark); color: var(--gossamer-dark); }
.ms-list { max-height: 200px; overflow-y: auto; }
.ms-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 4px; cursor: pointer; font-size: 13px;
  color: var(--text-main); white-space: nowrap; user-select: none;
}
.ms-item:hover { background: var(--soft); }
.ms-item input[type=checkbox] { cursor: pointer; flex-shrink: 0; }
.ms-empty { padding: 8px 6px; font-size: 12px; color: var(--text-mut); }
.ms-group {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mut);
  padding: 8px 6px 4px;
  border-bottom: 1px solid var(--border);
  margin-top: 2px;
}
.ms-group:first-child { margin-top: 0; }
.ms-group-clickable {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ms-group-clickable:hover { background: var(--soft); color: var(--text); }
.ms-group-check { font-size: 13px; color: var(--gossamer-dark); }
.ms-group-clickable:hover .ms-group-check { color: var(--gossamer); }
.ms-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--gossamer-dark); color: #fff; border-radius: 9px;
  font-size: 11px; font-weight: 700; line-height: 1;
}

.planning-wrap { padding: 16px 20px; }
.planning-outer {
  background: var(--border);
  border-radius: 10px;
  min-width: 1000px;
}
.planning-header-grid {
  display: grid;
  grid-template-columns: 140px 185px repeat(var(--weeks, 8), minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  position: sticky;
  top: 105px;
  z-index: 10;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}
.planning-grid {
  display: grid;
  grid-template-columns: 140px 185px repeat(var(--weeks, 8), minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-radius: 0 0 10px 10px;
  overflow: hidden;
}

.pg-header {
  background: #fafafa;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  text-align: center;
}
.pg-header.emp-col { text-align: left; color: var(--gossamer-dark); }
.pg-header.current-week { background: rgba(15,160,123,0.08); color: var(--gossamer-dark); }
.pg-week-sub { font-size: 10px; font-weight: 400; color: var(--text-mut); }

.pg-emp {
  background: #fff;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 2px solid var(--border);
}
.pg-emp .emp-dept { font-size: 10px; color: var(--text-mut); font-weight: 400; }

.pg-proj {
  background: #fff;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  border-left: 3px solid transparent;
}
.pg-proj.is-total { font-style: italic; color: var(--text-mut); font-weight: 600; font-size: 10px; }
.pg-proj-total {
  font-size: 10px; font-weight: 700;
  background: rgba(15,160,123,0.1); color: var(--gossamer-dark);
  padding: 1px 6px; border-radius: 8px;
  flex-shrink: 0;
}
.pg-total-simple {
  background: #fafafa;
  padding: 4px 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: var(--text);
}
.pg-proj[data-row]:hover { background: rgba(15,160,123,0.08); cursor: default; }
.pg-cell.row-hover { background: rgba(15,160,123,0.06); }
.pg-proj.row-hover { background: rgba(15,160,123,0.08); }

.pg-emp.is-last-of-emp,
.pg-proj.is-last-of-emp,
.pg-cell.is-last-of-emp,
.pg-gauge.is-last-of-emp,
.pg-total-simple.is-last-of-emp {
  border-bottom: 3px solid #a0a0a5;
}

.pg-open-section-header {
  grid-column: 1 / -1;
  background: #eef7f4;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gossamer-dark);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-top: 2px solid var(--gossamer);
  border-bottom: 1px solid #c8e6df;
}
.slot-open {
  border-style: dashed !important;
}
.pg-open-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: #ef6c00;
  border-radius: 4px;
  padding: 1px 6px;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(239, 108, 0, 0.3);
  white-space: nowrap;
}
.pg-proj.is-open-row,
.pg-cell.is-open-row {
  background: repeating-linear-gradient(
    -45deg,
    #fff7ed 0,
    #fff7ed 8px,
    #ffedd5 8px,
    #ffedd5 16px
  );
  border-top: 1px solid #fdba74;
  border-bottom: 1px solid #fdba74;
}
.pg-proj.is-open-row {
  border-left: 4px solid #ef6c00 !important;
  color: #9a3412;
}
.pg-proj.is-open-row span { font-weight: 700; }

.pg-budget-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 3px;
  margin-top: 1px;
  border-top: 1px solid #d5e8e4;
  font-size: 10px;
  color: var(--text);
  position: relative;
}
.pg-budget-inline[data-tooltip]:hover::after,
.pg-assign-tip[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  background: rgba(30,30,30,0.92);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: pre;
  z-index: 500;
  pointer-events: none;
}
.pg-assign-tip {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  font-size: 11px;
  color: var(--gossamer-dark);
  cursor: help;
  font-weight: 700;
}
.pg-budget-lbl {
  font-size: 8.5px;
  font-weight: 400;
  color: var(--text-mut);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pg-budget-gauge {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 180px;
  background: #e0ece9;
  border-radius: 3px;
  height: 12px;
  position: relative;
  overflow: hidden;
}
.pg-budget-fill {
  height: 100%;
  background: var(--gossamer);
  border-radius: 3px;
  transition: width 0.3s;
}
.pg-budget-fill.over {
  background: #EF5350;
}
.pg-budget-pct {
  position: absolute;
  right: 4px;
  font-size: 8.5px;
  font-weight: 700;
  color: var(--bottle-green);
}

.pg-grand-total {
  background: #eaf4f1 !important;
  border-top: 2px solid var(--gossamer-dark);
  font-weight: 700;
}

.pg-gauge {
  background: #fafafa;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 3px;
}
.pg-gauge .gauge-bar {
  flex: 0 0 17px;
  height: 17px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pg-gauge .gauge-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  height: auto;
  border-radius: 0;
  transition: width 0.2s;
}
.pg-gauge .gauge-label {
  position: relative;
  left: auto; top: auto;
  transform: none;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 0 2px rgba(255,255,255,0.7), 0 0 2px rgba(255,255,255,0.7);
  line-height: 1;
  white-space: nowrap;
}
.pg-gauge.gauge-low  .gauge-fill { background: #4CAF50; }
.pg-gauge.gauge-mid  .gauge-fill { background: #FFB300; }
.pg-gauge.gauge-full .gauge-fill { background: #66BB6A; }
.pg-gauge.gauge-over .gauge-fill { background: #EF5350; }
.pg-gauge.gauge-over .gauge-label { color: #fff; text-shadow: 0 0 3px rgba(0,0,0,0.5), 0 0 3px rgba(0,0,0,0.5); }
.pg-gauge.gauge-off  .gauge-bar  { background: var(--soft); }
.pg-gauge.gauge-off  .gauge-fill { display: none; }
.pg-gauge.gauge-off  .gauge-label { color: #c7c7cc; font-style: italic; text-shadow: none; }
.abs-info {
  font-size: 9px; line-height: 1.1;
  padding: 1px 4px; border-radius: 3px;
  text-align: center; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.abs-holiday { background: #fff3e0; color: #e65100; font-weight: 600; }
.abs-leave   { background: #e3f2fd; color: #1565c0; font-weight: 600; }

.pg-cell {
  background: #fff;
  padding: 2px;
  display: flex; flex-direction: column;
  gap: 2px;
  cursor: default;
  transition: background 0.1s;
}
.pg-cell.current-week { background: rgba(15,160,123,0.04); }

.slot {
  position: relative;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 10px;
  line-height: 1.2;
  cursor: pointer;
  border-left: 3px solid;
  transition: transform 0.1s;
  overflow: hidden;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.slot:hover { transform: scale(1.02); }
.slot .slot-hours { font-weight: 600; flex-shrink: 0; }
.slot .slot-task {
  font-size: 9px; opacity: 0.75;
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.slot-fc {
  display: inline-flex; gap: 2px; flex-shrink: 0; margin-left: auto;
}
.slot-fc-chip {
  display: inline-block; min-width: 14px; padding: 0 4px;
  font-size: 9px; font-weight: 700; line-height: 14px;
  text-align: center; border-radius: 7px;
  background: rgba(255, 255, 255, 0.55); color: inherit;
}
.slot-fc-chip.zero { opacity: 0.35; background: rgba(0, 0, 0, 0.08); }
.slot-fc-warn {
  flex-shrink: 0; margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; font-size: 11px; font-weight: 700;
  border-radius: 4px;
  background: #ff9800; color: #fff;
  line-height: 1; cursor: help;
}
.slot-tasks-group { margin-top: 12px; }
.slot-tasks-group h4 {
  margin: 0 0 6px 0; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.slot-tasks-group h4 .slot-tg-count {
  font-size: 10px; padding: 1px 6px; border-radius: 9px;
  background: var(--brand, #714B67); color: #fff;
}
.slot-tasks-group ul { margin: 0; padding: 0; list-style: none; }
.slot-tasks-group li {
  font-size: 11px; padding: 4px 6px;
  border-bottom: 1px solid var(--border, #e7e7e7);
  display: flex; justify-content: space-between; gap: 8px;
  align-items: center;
}
.slot-tasks-group li:last-child { border-bottom: none; }
.slot-tasks-group li .stt-project { color: var(--text-mut, #888); font-size: 10px; }
.slot-tasks-stage { margin: 6px 0 8px 0; }
.slot-tasks-stage-h {
  font-size: 11px; font-weight: 600;
  color: var(--text-mut, #777);
  padding: 4px 0 2px 0;
  border-bottom: 1px dashed var(--border, #e7e7e7);
  display: flex; align-items: center; gap: 6px;
}
.slot-tasks-stage-h .slot-tg-substage {
  font-size: 10px; padding: 0 5px; border-radius: 8px;
  background: var(--text-mut, #777); color: #fff;
}
.task-state-badge {
  display: inline-block; font-size: 9px; font-weight: 600;
  padding: 1px 6px; border-radius: 8px;
  background: #e0e0e0; color: #333; white-space: nowrap;
}
.task-state-badge.ts-progress  { background: #e3f2fd; color: #1565c0; }
.task-state-badge.ts-changes   { background: #fff4e5; color: #ad6800; }
.task-state-badge.ts-approved  { background: #e8f5e9; color: #2e7d32; }
.task-state-badge.ts-done      { background: #eeeeee; color: #555; }
.task-state-badge.ts-canceled  { background: #ffebee; color: #b71c1c; }
.task-state-badge.ts-waiting   { background: #fce4ec; color: #ad1457; }
.stt-row { display: flex; gap: 12px; align-items: flex-start !important; padding: 6px 6px !important; }
.stt-main { flex: 1 1 auto; min-width: 0; }
.stt-title { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.stt-meta { font-size: 10px; color: var(--text-mut, #888); margin-top: 1px; }
.stt-byrole { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px; }
.stt-role-time {
  font-size: 9.5px; padding: 1px 6px; border-radius: 8px;
  background: #f0f0f4; color: #444;
}
.stt-role-time.stt-role-empty { background: transparent; color: var(--text-mut, #888); font-style: italic; padding-left: 0; }
.stt-hours { display: flex; gap: 10px; flex-shrink: 0; }
.stt-h { display: flex; flex-direction: column; align-items: flex-end; font-size: 10px; min-width: 48px; }
.stt-h .stt-h-lbl { color: var(--text-mut, #888); font-size: 9px; text-transform: uppercase; letter-spacing: 0.3px; }
.stt-h .stt-h-val { font-weight: 600; font-size: 11px; }
.stt-h.stt-h-rem .stt-h-val { color: #1565c0; }
.slot-tasks-alert {
  margin-top: 10px; padding: 8px 10px;
  background: #fff4e5; color: #7a4f00; border-left: 3px solid #ff9800;
  font-size: 12px; border-radius: 3px;
}
.slot.draft {
  opacity: 0.7;
  border-style: dashed;
  border-top-width: 1px;
  border-right-width: 1px;
  border-bottom-width: 1px;
}
.slot.slot-over { border-style: solid; }
/* Hors planning : trait gauche plus épais (5px) + dashed pour signaler
   visuellement qu'aucun slot planifié ne couvre ces heures. */
.slot.slot-orphan {
  border-style: dashed;
  border-left-width: 5px;
}
.slot.preplanned { opacity: 0.85; }
.slot.preplanned::after {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent, transparent 3px,
    rgba(255,255,255,0.35) 3px, rgba(255,255,255,0.35) 5px
  );
  pointer-events: none;
}
.pg-emp-collapsible { cursor: pointer; }
.pg-emp-collapsible:hover { background: rgba(15,160,123,0.05) !important; }
.pg-emp-name { display: flex; align-items: center; justify-content: space-between; gap: 4px; width: 100%; }
.pg-chevron { font-size: 10px; color: var(--text-mut); flex-shrink: 0; }

/* Modale planning */
.planning-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 100;
  align-items: center; justify-content: center;
}
.planning-modal-overlay.open { display: flex; }
.planning-modal {
  background: #fff; border-radius: 14px; width: 480px; max-width: 95vw;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  font-family: inherit;
}
/* Variante large pour la modale projet (openProject) — laisse de la place
   pour les rôles, tags, marges et planifié passé/futur. */
.planning-modal.is-wide { width: 1100px; }
.planning-modal.is-wide .planning-modal-body { padding: 0; background: var(--soft, #f5f5f7); }
/* Modale slot avec liste de tâches : plus large pour respirer. */
.planning-modal.is-slot-tasks { width: 820px; }

/* ── Modale projet (openProject) : layout structuré en sections ── */
.pm-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 12px 20px; background: #fff;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.pm-meta-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; background: var(--soft);
  border-radius: 16px; color: var(--text-soft, #555);
}
.pm-meta-chip i { color: var(--gossamer-dark); font-size: 12px; }

.pm-kpis {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  padding: 14px 20px; background: #fff;
  border-bottom: 1px solid var(--border);
}
.pm-kpi {
  display: flex; flex-direction: column;
  padding: 10px 12px; background: var(--soft);
  border-radius: 8px;
}
.pm-kpi-v { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.1; }
.pm-kpi-l { font-size: 10.5px; color: var(--text-mut); margin-top: 4px;
  text-transform: uppercase; letter-spacing: 0.04em; }
.pm-kpi.is-over .pm-kpi-v { color: #EF5350; }
.pm-kpi-progress {
  height: 4px; margin-top: 6px; background: rgba(0,0,0,0.08);
  border-radius: 3px; overflow: hidden;
}
.pm-kpi-progress > span { display: block; height: 100%; background: #1d8b5e; }

.pm-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  padding: 14px 20px;
}
.pm-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.pm-card.is-wide { grid-column: 1 / -1; }
.pm-card-title {
  margin: 0 0 12px; font-size: 12px; font-weight: 700;
  color: var(--bottle-green, #1d8b5e);
  text-transform: uppercase; letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 8px;
}
.pm-card-title i { font-size: 14px; }

.pm-team { display: flex; flex-direction: column; gap: 4px; }
.pm-team-row {
  display: grid; grid-template-columns: 64px 1fr;
  gap: 10px; align-items: center;
  font-size: 13px; padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.pm-team-row:last-child { border-bottom: none; }
.pm-team-label {
  display: inline-block; padding: 2px 8px;
  background: var(--soft); border-radius: 6px;
  font-weight: 700; font-size: 11px;
  color: var(--gossamer-dark, #714B67);
  text-align: center; letter-spacing: 0.04em;
}
.pm-team-value {
  display: flex; flex-direction: column; line-height: 1.35;
  word-break: break-word;
}
.pm-team-value.empty { color: var(--text-mut); font-style: italic; font-size: 12px; }

.pm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-tags-empty { color: var(--text-mut); font-style: italic; font-size: 12px; }

.pm-roles-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pm-roles-col h5 {
  margin: 0 0 6px; font-size: 11px; color: var(--text-mut);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.pm-roles-list { display: flex; flex-direction: column; gap: 4px; }
.pm-roles-empty { color: var(--text-mut); font-style: italic; font-size: 12px; }

.pm-margin-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.pm-margin-tile {
  padding: 10px 12px; background: var(--soft);
  border-radius: 8px; display: flex; flex-direction: column; gap: 3px;
}
.pm-margin-tile-l {
  font-size: 10.5px; color: var(--text-mut);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.pm-margin-tile-v {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.pm-margin-tile-pill {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  color: #fff; font-weight: 600;
}

.pm-milestones { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.pm-milestone-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.pm-milestone-row .ms-icon { width: 16px; text-align: center; }
.pm-milestone-row .ms-date { margin-left: auto; color: var(--text-mut); font-size: 11.5px; }
.planning-modal-header {
  padding: 20px 24px 12px; border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between;
}
.planning-modal-header h2 { font-size: 16px; font-weight: 700; margin: 0; }
.planning-modal-close {
  border: none; background: none; font-size: 20px; cursor: pointer;
  color: var(--text-mut); padding: 4px 8px; border-radius: 6px;
}
.planning-modal-close:hover { background: var(--soft); }
.planning-modal-body { padding: 16px 24px; }
.planning-modal-footer {
  padding: 12px 24px 20px; border-top: 1px solid #f0f0f0;
  display: flex; gap: 8px; justify-content: flex-end;
}
.slot-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}
.slot-meta-block {
  display: flex; flex-direction: column;
  padding: 4px 0;
  border-bottom: 1px solid var(--border, #e7e7e7);
  min-width: 0;
}
.slot-meta-block:last-child { border-bottom: none; }
.slot-meta-block .slot-detail-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px;
  color: var(--text-mut, #888); margin-bottom: 1px;
}
.slot-meta-block .slot-detail-value {
  font-size: 13px; font-weight: 500;
  text-align: left;
  overflow: hidden; text-overflow: ellipsis;
}
.slot-meta-full { grid-column: 1 / -1; }
.slot-detail-missing { color: #c62828; font-style: italic; font-weight: 500; }
.slot-detail-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--soft); font-size: 13px;
}
.slot-detail-row:last-child { border-bottom: none; }
.slot-detail-label { color: var(--text-mut); }
.slot-detail-value { font-weight: 500; text-align: right; }

.ts-day {
  font-weight: 600; font-size: 12px; color: var(--gossamer-dark);
  padding: 8px 0 4px; border-bottom: 1px solid #f0f0f0; margin-top: 6px;
}
.ts-day:first-child { margin-top: 0; }
.ts-entry {
  display: flex; gap: 12px; padding: 6px 0;
  border-bottom: 1px solid var(--soft);
}
.ts-entry:last-child { border-bottom: none; }
.ts-entry-hours {
  font-weight: 600; color: var(--text);
  min-width: 50px; text-align: right; flex-shrink: 0;
}
.ts-entry-detail { flex: 1; font-size: 13px; min-width: 0; }
.ts-entry-task {
  color: #2e7d32; font-size: 11px; margin-top: 2px;
  background: #e8f5e9; display: inline-block;
  padding: 1px 6px; border-radius: 3px; font-weight: 500;
}
.ts-entry-ticket {
  color: #1565c0; font-size: 11px; margin-top: 2px;
  background: #e3f2fd; display: inline-block;
  padding: 1px 6px; border-radius: 3px; font-weight: 500;
}
.ts-entry-comment {
  color: var(--text-soft); font-size: 12px; margin-top: 2px; font-style: italic;
  white-space: pre-wrap; word-break: break-word;
}
.ts-totals {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding: 10px 12px;
  background: var(--soft); border-radius: 8px;
  font-size: 13px; font-weight: 600;
}
.ts-totals .ts-total-val { color: var(--gossamer-dark); font-size: 15px; }

.planning-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 80px 20px; flex-direction: column; gap: 12px;
}
.planning-spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--gossamer-dark); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.planning-empty {
  text-align: center; color: var(--text-mut); font-size: 13px;
  padding: 60px 20px;
}

/* ── Dashboard CODIR ─────────────────────────────────────── */

.codir-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 56px;
  z-index: 15;
}
.codir-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.codir-nav a {
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
}
.codir-nav a:hover { background: var(--soft); }
.codir-nav a.active {
  background: rgba(15,160,123,0.1);
  color: var(--gossamer-dark);
  font-weight: 600;
}
.codir-period {
  display: flex;
  gap: 4px;
  background: var(--soft);
  border-radius: 8px;
  padding: 3px;
}
.codir-period button {
  border: none;
  background: transparent;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-soft);
  font-family: inherit;
}
.codir-period button.active {
  background: #fff;
  color: var(--gossamer-dark);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.codir-content { padding: 24px; }

.codir-error {
  background: #fff2f2;
  color: #b71c1c;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

.codir-page .section {
  display: block;
  scroll-margin-top: 120px;
  padding-top: 8px;
}
.codir-page .section h2 {
  margin: 8px 0 16px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mut);
  font-weight: 600;
}
.codir-page .grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.codir-page .tile {
  grid-column: span 6;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  min-height: 220px;
  display: flex;
  flex-direction: column;
}
.codir-page .tile.wide { grid-column: span 12; }
.codir-page .tile.small { grid-column: span 4; }
.codir-page .tile:only-child { grid-column: span 12; }
@media (max-width: 900px) {
  .codir-page .tile,
  .codir-page .tile.small,
  .codir-page .tile.wide { grid-column: span 12; }
}
.codir-page .tile header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.codir-page .tile h3 { margin: 0; font-size: 15px; font-weight: 600; }
.codir-page .tile .owner {
  font-size: 11px;
  color: var(--text-mut);
  background: var(--soft);
  padding: 2px 8px;
  border-radius: 999px;
}
.codir-page .tile .def {
  font-size: 12px;
  color: var(--text-mut);
  margin-bottom: 12px;
  line-height: 1.4;
}
.codir-page .tile .body {
  flex: 1;
  min-height: 140px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.codir-page .tile .placeholder {
  color: #c7c7cc;
  font-size: 12px;
  text-align: center;
}
.codir-page .tile .placeholder.pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #c7c7cc;
}
.codir-page .tile .placeholder.pending svg { width: 36px; height: 36px; opacity: 0.35; }
.codir-page .tile .placeholder.pending span { font-size: 11px; font-weight: 500; letter-spacing: 0.03em; }
.codir-page .tile canvas { max-width: 100%; max-height: 300px; }
.codir-page #ind-aging .body { max-height: 420px; flex-direction: column; align-items: stretch; overflow: hidden; }
.codir-page #ind-tace .body { min-height: 280px; }
.codir-page #ind-marge-proj .body { min-height: 420px; overflow-y: auto; }
.codir-page #ind-marge-proj canvas { max-height: none !important; }
.codir-page #ind-marge-bu .body { min-height: 420px; }

.codir-page .dispo-btn {
  border: none; padding: 3px 8px; font-size: 11px; font-weight: 500;
  border-radius: 6px; cursor: pointer;
  background: var(--soft); color: var(--text-soft);
  font-family: inherit;
}
.codir-page .dispo-btn.active-dispo { background: var(--gossamer-dark); color: #fff; }


/* ── Collaborateurs (1:1) ─────────────────────────────── */

.o2o-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 56px;
  z-index: 15;
  flex-wrap: wrap;
}
.o2o-toolbar label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mut);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.o2o-toolbar select {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  min-width: 180px;
  font-family: inherit;
}
.o2o-toolbar select:focus {
  outline: none;
  border-color: var(--gossamer-dark);
  box-shadow: 0 0 0 2px rgba(15,160,123,0.15);
}
.o2o-content { padding: 24px; }


/* Barre de navigation */
/* Selectors */
/* Contenu */
/* Employee card */
.o2o-page .employee-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: #fff;
    border-radius: 12px;
    padding: 20px 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    margin-bottom: 24px;
  }
.o2o-page .employee-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #714B67 0%, #9b6d8e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
  }
.o2o-page .employee-info { flex: 1; min-width: 0; }
.o2o-page .employee-info .emp-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
  }
.o2o-page .employee-info h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
  }
.o2o-page .emp-planning-link {
    font-size: 12px;
    font-weight: 500;
    color: #714B67;
    text-decoration: none;
    border: 1px solid #714B67;
    border-radius: 6px;
    padding: 3px 10px;
    white-space: nowrap;
    flex-shrink: 0;
  }
.o2o-page .emp-planning-link:hover { background: #f9f3f7; }
.o2o-page .employee-info .meta {
    font-size: 13px;
    color: #86868b;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
  }
.o2o-page .employee-info .meta span + span::before { content: " · "; }
.o2o-page .emp-details-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 7px;
    font-size: 12px;
    color: #515154;
  }
.o2o-page .emp-details-row a { color: #714B67; text-decoration: none; }
.o2o-page .emp-details-row a:hover { text-decoration: underline; }
.o2o-page .emp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 7px;
  }
.o2o-page .emp-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    background: #f0eaf4;
    color: #714B67;
  }
.o2o-page .emp-conges-panel {
    flex-shrink: 0;
    min-width: 200px;
    max-width: 260px;
    background: #f5f5f7;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 12px;
  }
.o2o-page .emp-conges-panel .cp-title {
    font-size: 11px;
    font-weight: 600;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
  }
.o2o-page .emp-conges-soldes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.o2o-page .emp-solde-pill {
    text-align: center;
    background: #fff;
    border-radius: 7px;
    padding: 5px 10px;
    min-width: 70px;
  }
.o2o-page .emp-solde-pill .sp-val { font-size: 16px; font-weight: 700; }
.o2o-page .emp-solde-pill .sp-name { font-size: 10px; color: #86868b; margin-top: 1px; }
.o2o-page .emp-conges-upcoming { border-top: 1px solid #e5e5ea; padding-top: 7px; }
.o2o-page .emp-conges-upcoming .cup-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0;
    font-size: 11px;
    color: #515154;
  }
.o2o-page .emp-conges-upcoming .cup-row .cup-days { font-weight: 600; color: #714B67; white-space: nowrap; }
/* Department card */
.o2o-page .dept-card {
    align-items: center;
    gap: 20px;
    background: #fff;
    border-radius: 12px;
    padding: 18px 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    margin-bottom: 24px;
  }
.o2o-page .dept-card-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, #714B67 0%, #9b6d8e 100%);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
.o2o-page .dept-card-icon svg { color: #fff; }
.o2o-page .dept-card-info { flex: 1; }
.o2o-page .dept-card-info h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; color: #1d1d1f; }
.o2o-page .dept-card-info .dept-meta { font-size: 13px; color: #86868b; }
/* Department dashboard */
.o2o-page .dept-ts-table { width: 100%; }
.o2o-page .dept-ts-header {
    display: grid;
    grid-template-columns: 1.4fr 80px 70px 70px 1.4fr 1.4fr;
    gap: 8px; padding: 0 4px 6px;
    font-size: 11px; font-weight: 600; color: #86868b;
    text-transform: uppercase; letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e5ea; margin-bottom: 4px;
  }
.o2o-page .dept-ts-row {
    display: grid;
    grid-template-columns: 1.4fr 80px 70px 70px 1.4fr 1.4fr;
    gap: 8px; padding: 5px 4px;
    font-size: 13px; align-items: center;
    border-bottom: 1px solid #f5f5f7;
  }
.o2o-page .dept-ts-row:last-child { border-bottom: none; }
.o2o-page .dept-ts-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o2o-page .dept-ts-bar-cell { display: flex; align-items: center; gap: 6px; }
.o2o-page .dept-ts-bar-bg { flex: 1; height: 8px; background: #f0f0f5; border-radius: 4px; overflow: hidden; position: relative; }
.o2o-page .dept-ts-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.o2o-page .dept-leaves-list { width: 100%; }
.o2o-page .dept-leave-row {
    display: grid; grid-template-columns: 1fr 130px 1fr 40px;
    gap: 8px; padding: 5px 4px; font-size: 13px; align-items: center;
    border-bottom: 1px solid #f5f5f7;
  }
.o2o-page .dept-leave-row:last-child { border-bottom: none; }
.o2o-page .dept-leave-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o2o-page .dept-leave-dates { color: #515154; white-space: nowrap; }
.o2o-page .dept-leave-type { color: #86868b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o2o-page .dept-leave-days { font-weight: 600; color: #714B67; text-align: right; white-space: nowrap; }

/* Gantt des congés */
.o2o-page .dept-gantt {
  font-size: 11px;
  overflow-x: auto;
  overflow-y: visible;
  --gantt-cell-w: 14px;
}
.o2o-page .gantt-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 11px;
  color: #515154;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f3;
}
.o2o-page .gantt-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.o2o-page .gantt-legend-dot {
  width: 10px; height: 10px; border-radius: 3px;
}
.o2o-page .gantt-row {
  display: grid;
  grid-template-columns: 140px auto;
  gap: 6px;
  align-items: center;
  min-height: 22px;
  width: max-content;
}
.o2o-page .gantt-row + .gantt-row { border-top: 1px solid #f5f5f7; }
.o2o-page .gantt-name {
  font-size: 12px;
  font-weight: 500;
  color: #1d1d1f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 6px;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  box-shadow: 1px 0 0 #f0f0f3;
}
.o2o-page .gantt-row.gantt-header .gantt-name { background: #fff; }
.o2o-page .gantt-cells {
  display: grid;
  grid-template-columns: repeat(var(--gantt-days, 90), var(--gantt-cell-w, 14px));
  gap: 1px;
  min-width: 0;
}
.o2o-page .gantt-cell {
  height: 18px;
  background: #fff;
  border-radius: 2px;
}
.o2o-page .gantt-cell.is-weekend { background: #f5f5f7; }
.o2o-page .gantt-cell.is-holiday {
  background: #fce4ec;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 3px, rgba(0,0,0,0.06) 3px, rgba(0,0,0,0.06) 4px);
}
.o2o-page .gantt-cell.is-leave {
  border-radius: 3px;
}
.o2o-page .gantt-cell.is-today {
  outline: 1px solid #d84315;
  outline-offset: -1px;
}
.o2o-page .gantt-header .gantt-cell-hdr {
  height: 22px;
  font-size: 9px;
  font-weight: 600;
  color: #86868b;
  text-align: center;
  line-height: 22px;
  border-radius: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.o2o-page .gantt-header .gantt-cell-hdr small {
  display: block;
  font-size: 8px;
  font-weight: 400;
  text-transform: lowercase;
  line-height: 1;
  margin-top: 1px;
}
.o2o-page .gantt-header .gantt-cell-hdr.is-weekend { background: #f5f5f7; color: #c7c7cc; }
.o2o-page .gantt-header .gantt-cell-hdr.is-holiday { background: #fce4ec; color: #ad1457; }
.o2o-page .gantt-header .gantt-cell-hdr.is-today { background: #d84315; color: #fff; }
.o2o-page .gantt-header { margin-bottom: 0; }

.o2o-page .dept-ts-role-header,
.o2o-page .gantt-role-header {
  background: linear-gradient(180deg, #eef7f4 0%, #f5fbfa 100%);
  color: var(--gossamer-dark, #0fa07b);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 10px;
  margin-top: 8px;
  margin-bottom: 2px;
  border-radius: 4px;
  border-left: 3px solid var(--gossamer-dark, #0fa07b);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  position: sticky;
  left: 0;
  z-index: 3;
}
.o2o-page .dept-ts-role-header:first-child,
.o2o-page .gantt-role-header:first-child { margin-top: 0; }
.o2o-page .dept-ts-role-meta {
  font-size: 10px;
  font-weight: 600;
  color: #515154;
  text-transform: none;
  letter-spacing: 0;
}
.o2o-page .gantt-role-header { width: max-content; min-width: 100%; }
.o2o-page .gantt-header + .gantt-header { margin-bottom: 4px; }
.o2o-page .gantt-months {
  display: grid;
  grid-template-columns: repeat(var(--gantt-days, 90), var(--gantt-cell-w, 14px));
  gap: 1px;
}
.o2o-page .gantt-month {
  background: #eef7f4;
  color: var(--gossamer-dark, #0fa07b);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 3px 4px;
  border-radius: 3px;
  border-right: 2px solid #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.o2o-page #dept-conges header,
.o2o-page #dept-timesheets header { display: flex; align-items: center; gap: 12px; }
.o2o-page .ts-unit-toggle {
  display: inline-flex; margin-left: auto;
  border: 1px solid var(--border, #d1d1d6);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.o2o-page .ts-unit-toggle button {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  color: var(--text-mut, #86868b);
  transition: background 0.12s, color 0.12s;
}
.o2o-page .ts-unit-toggle button + button { border-left: 1px solid var(--border, #d1d1d6); }
.o2o-page .ts-unit-toggle button:hover { background: #f5f5f7; }
.o2o-page .ts-unit-toggle button.is-on {
  background: var(--gossamer-dark, #0fa07b);
  color: #fff;
}

.o2o-page .dept-ts-row {
  cursor: pointer;
  transition: background 0.12s;
  border-radius: 4px;
}
.o2o-page .dept-ts-row:hover { background: #f5f5f7; }

/* Modale */
.o2o-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.o2o-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.o2o-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f3;
}
.o2o-modal-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}
.o2o-modal-close {
  border: none; background: none; cursor: pointer;
  font-size: 18px; color: #86868b;
  width: 28px; height: 28px; border-radius: 50%;
}
.o2o-modal-close:hover { background: #f5f5f7; color: #1d1d1f; }
.o2o-modal-body { overflow-y: auto; padding: 12px 18px 16px; }

.ts-detail-table { font-size: 12px; }
.ts-detail-head, .ts-detail-row, .ts-detail-total {
  display: grid;
  grid-template-columns: 110px minmax(120px,1fr) minmax(160px,2fr) 80px;
  gap: 8px;
  padding: 5px 6px;
  align-items: center;
}
.ts-detail-head {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #86868b;
  border-bottom: 1px solid #e5e5ea;
  padding-bottom: 6px;
}
.ts-detail-row { border-bottom: 1px solid #f5f5f7; }
.ts-detail-row:hover { background: #fafafa; }
.ts-detail-total {
  border-top: 2px solid #1d1d1f;
  margin-top: 6px;
  padding-top: 8px;
  font-size: 13px;
}
/* Grid */
.o2o-page .grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    min-width: 0;
  }
.o2o-page .tile {
    grid-column: span 6;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    min-height: 200px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
.o2o-page .tile > .body { min-width: 0; }
.o2o-page #dept-conges > .body { overflow: hidden; }
.o2o-page .tile.wide { grid-column: span 12; }
.o2o-page .tile:only-child { grid-column: span 12; }
@media (max-width: 900px) {
.o2o-page .tile, .o2o-page .tile.wide { grid-column: span 12; }
}}
.o2o-page .tile header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
  }
.o2o-page .tile header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
  }
.o2o-page .tile .def {
    font-size: 11px;
    color: #86868b;
    margin-bottom: 12px;
    line-height: 1.4;
  }
.o2o-page .tile .body {
    flex: 1;
    min-height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }
/* Planning : un peu plus haut pour bien voir le calendrier */
.o2o-page #ind-planning .body { min-height: 320px; }
/* Projets en cours : tous les projets visibles, pas de scroll. */
.o2o-page #ind-projets .body {
    align-items: flex-start;
    justify-content: flex-start;
  }
.o2o-page .tile .placeholder {
    color: #c7c7cc;
    font-size: 12px;
    text-align: center;
  }
.o2o-page .tile .placeholder.pending {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #c7c7cc;
  }
.o2o-page .tile .placeholder.pending svg {
    width: 36px;
    height: 36px;
    opacity: 0.35;
  }
.o2o-page .tile .placeholder.pending span {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
  }
@keyframes spin { to { transform: rotate(360deg); } }
.o2o-page .tile canvas { max-width: 100%; max-height: 300px; }
.o2o-page .big-number {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
  }
.o2o-page .big-sub {
    font-size: 12px;
    color: #86868b;
    margin-top: 4px;
  }
/* Alertes */
.o2o-page .alert-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
.o2o-page .alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
  }
.o2o-page .alert-item.ok { background: rgba(76,175,80,0.08); color: #2E7D32; }
.o2o-page .alert-item.warn { background: rgba(255,152,0,0.08); color: #E65100; }
.o2o-page .alert-item.danger { background: rgba(239,83,80,0.08); color: #B71C1C; }
.o2o-page .alert-item .icon { font-size: 16px; flex-shrink: 0; }
.o2o-page .alert-item .label { flex: 1; }
/* Empty state */
.o2o-page .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
    color: #86868b;
  }
.o2o-page .empty-state svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
    margin-bottom: 16px;
  }
.o2o-page .empty-state p {
    font-size: 14px;
    margin: 0;
  }
.o2o-page #error {
    display: none;
    background: #fce4ec;
    color: #b71c1c;
    padding: 12px 20px;
    font-size: 13px;
    border-radius: 8px;
    margin-bottom: 16px;
  }
/* Tabs */
.o2o-page .tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    width: fit-content;
  }
.o2o-page .tab {
    border: none;
    background: transparent;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    color: #86868b;
    transition: all 0.2s;
  }
.o2o-page .tab:hover { color: #1d1d1f; background: #f5f5f7; }
.o2o-page .tab.active { background: #714B67; color: #fff; font-weight: 600; }
.o2o-page .tab-content { display: none; }
.o2o-page .tab-content.active { display: block; }
/* Prep planning layout */
.o2o-page .prep-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
    max-height: calc(100vh - 200px);
  }
@media (max-width: 1000px) {
.o2o-page .prep-layout { grid-template-columns: 1fr; max-height: none; }
}}
.o2o-page .prep-panel {
    min-width: 0;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
.o2o-page .prep-panel h3 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5ea;
    flex-shrink: 0;
  }
.o2o-page .prep-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }
/* Stage filters */
.o2o-page .stage-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid #e5e5ea;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
  }
.o2o-page .stage-filter {
    border: 1px solid #e5e5ea;
    background: #fff;
    color: #86868b;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
  }
.o2o-page .stage-filter:hover { border-color: #714B67; color: #714B67; }
.o2o-page .stage-filter.active { background: #714B67; color: #fff; border-color: #714B67; }
.o2o-page .stage-filter .sf-count {
    background: rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 0 5px;
    font-size: 10px;
    min-width: 16px;
    text-align: center;
  }
.o2o-page .stage-filter.active .sf-count { background: rgba(255,255,255,0.25); }
.o2o-page .stage-group.hidden { display: none; }
/* Stage group */
.o2o-page .stage-group { margin-bottom: 4px; }
.o2o-page .stage-group:last-child { margin-bottom: 0; }
.o2o-page .stage-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 6px;
    border-bottom: 2px solid #e5e5ea;
    cursor: pointer;
    user-select: none;
  }
.o2o-page .stage-header:hover { background: #fafafa; }
.o2o-page .stage-toggle { font-size: 11px; color: #86868b; transition: transform 0.2s; }
.o2o-page .stage-group.collapsed .stage-toggle { transform: rotate(-90deg); }
.o2o-page .stage-name { font-size: 13px; font-weight: 600; color: #714B67; }
.o2o-page .stage-count { font-size: 11px; color: #86868b; margin-left: auto; }
.o2o-page .stage-tasks { padding-left: 4px; }
.o2o-page .stage-group.collapsed .stage-tasks { display: none; }
/* Task item */
.o2o-page .task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f7;
    font-size: 12px;
  }
.o2o-page .task-item:last-child { border-bottom: none; }
.o2o-page .task-prio { font-size: 14px; flex-shrink: 0; width: 18px; text-align: center; }
.o2o-page .task-info { flex: 1; min-width: 0; }
.o2o-page .task-name { font-weight: 500; color: #1d1d1f; white-space: normal; word-break: break-word; }
.o2o-page .task-meta { font-size: 11px; color: #86868b; margin-top: 2px; }
.o2o-page .task-hours { font-size: 10px; color: #86868b; white-space: nowrap; flex-shrink: 0; text-align: right; line-height: 1.5; }
.o2o-page .task-hours div { font-weight: 500; }
/* Planning week block */
.o2o-page .week-block { margin-bottom: 16px; }
.o2o-page .week-block:last-child { margin-bottom: 0; }
.o2o-page .week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 2px solid #e5e5ea;
    margin-bottom: 6px;
  }
.o2o-page .week-header .wk-label { font-size: 13px; font-weight: 600; color: #714B67; }
.o2o-page .week-header .wk-fill { font-size: 11px; font-weight: 600; }
.o2o-page .week-slot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f5f5f7;
    font-size: 12px;
  }
.o2o-page .week-slot:last-child { border-bottom: none; }
.o2o-page .week-slot .slot-proj { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1d1d1f; }
.o2o-page .week-slot .slot-hours { font-weight: 500; color: #714B67; white-space: nowrap; margin-left: 8px; }
.o2o-page .week-empty { font-size: 11px; color: #c7c7cc; text-align: center; padding: 8px 0; }
.o2o-page .week-slot.slot-alert { background: #fff8e1; border-radius: 4px; padding: 5px 6px; }
.o2o-page .week-slot.slot-alert .slot-proj { color: #e65100; font-weight: 600; }
.o2o-page .task-item.task-no-slot { background: #fff8e1; border-radius: 6px; padding: 6px 8px; }
.o2o-page .task-item.task-no-slot .task-name { color: #e65100; font-weight: 600; }
.o2o-page .task-item.task-no-slot .task-no-slot-badge { display: inline !important; background: #ffe0b2; color: #bf360c; }
/* Prep planning alerts */
.o2o-page .prep-alerts {
    background: #fff3e0;
    border: 1px solid #ffe0b2;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
  }
.o2o-page .prep-alerts-title {
    font-size: 13px;
    font-weight: 700;
    color: #e65100;
    margin-bottom: 8px;
  }
.o2o-page .prep-alert-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px 0;
    border-bottom: 1px solid #ffe0b2;
    font-size: 12px;
  }
.o2o-page .prep-alert-item:last-child { border-bottom: none; }
.o2o-page .prep-alert-proj { font-weight: 600; color: #e65100; }
.o2o-page .prep-alert-detail { color: #bf360c; font-size: 11px; }
/* ── Impression PDF ── */
@page {

}}
@media print {
.o2o-page .topbar .selectors { display: none; }
.o2o-page .topbar .user-badge span:last-child { display: none; }
/* Card employé */
.o2o-page .employee-card {
      box-shadow: none;
      border: 1px solid #e5e5ea;
      padding: 12px 16px;
      margin-bottom: 12px;
    }
/* Tabs: masquer les boutons, afficher le contenu actif */
.o2o-page .tabs { display: none; }
.o2o-page .tab-content { display: block !important; page-break-before: auto; }
.o2o-page .tab-content:not(.active) { display: none !important; }
/* Grille indicateurs */
.o2o-page .grid { gap: 10px; }
.o2o-page .tile {
      box-shadow: none;
      border: 1px solid #e5e5ea;
      min-height: auto;
      page-break-inside: avoid;
      padding: 12px;
    }
.o2o-page .tile canvas { max-height: 200px !important; }
.o2o-page .tile .placeholder { display: none; }
/* Prep planning */
.o2o-page .prep-layout {
      display: block !important;
    }
.o2o-page .prep-panel {
      page-break-inside: avoid;
      margin-bottom: 16px;
      max-height: none !important;
    }
.o2o-page .prep-body {
      max-height: none !important;
      overflow: visible !important;
    }
.o2o-page .stage-filters { position: static; }
/* Scrollable areas */
.o2o-page [style*="max-height"] { max-height: none !important; overflow: visible !important; }
.o2o-page [style*="overflow-y: auto"] { overflow: visible !important; }
.o2o-page [style*="overflow-y:auto"] { overflow: visible !important; }
.o2o-page .big-number { font-size: 28px !important; }
.o2o-page .empty-state { display: none; }
}}
</style>


/* ── Print ───────────────────────────────────────────────── */

@media print {
  .topbar, .tabs { display: none; }
  body { background: #fff; min-height: auto; }
  .tile, .employee-card {
    box-shadow: none;
    border: 1px solid var(--border);
    page-break-inside: avoid;
  }
}

/* ════════════════════════════════════════════════
   Page Tâches — filtres ir.filters
   ════════════════════════════════════════════════ */
.taches-page { padding: 0; }
.taches-page #taches-content { padding: 16px 20px; }
.taches-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 8px 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  position: sticky;
  top: 56px;
  z-index: 15;
  margin-bottom: 0;
}
.taches-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--bottle-green, #1d1d1f);
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.taches-filters {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.taches-filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--soft);
  color: var(--text-soft);
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s;
  line-height: 1.2;
  font-family: inherit;
}
.taches-filter-chip:hover { background: var(--border); }
.taches-filter-chip input[type="checkbox"] {
  position: absolute; opacity: 0; pointer-events: none;
  width: 0; height: 0;
}
.taches-filter-chip:has(input:checked) {
  background: var(--gossamer-dark, #0fa07b);
  color: #fff;
}
.taches-filter-count {
  font-size: 10px;
  font-weight: 700;
  background: rgba(0,0,0,0.08);
  color: inherit;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
}
.taches-filter-chip:has(input:checked) .taches-filter-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
.taches-reload {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  width: 28px; height: 28px;
  cursor: pointer;
  color: var(--text-mut, #86868b);
  font-size: 12px;
  transition: all 0.15s;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.taches-reload:hover { color: var(--gossamer-dark, #0fa07b); border-color: var(--gossamer-dark, #0fa07b); }

.taches-groupby {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: 8px; padding-left: 12px;
  border-left: 1px solid var(--border);
}
.taches-groupby-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mut, #86868b);
  margin-right: 2px;
}
.taches-groupby-btn {
  border: 1px solid #d1d1d6;
  background: #fff;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  cursor: pointer;
  color: var(--text-mut, #86868b);
  transition: all 0.12s;
}
.taches-groupby-btn:hover { border-color: var(--gossamer-dark, #0fa07b); }
.taches-groupby-btn.is-on {
  background: var(--gossamer-dark, #0fa07b);
  border-color: var(--gossamer-dark, #0fa07b);
  color: #fff;
}
.taches-groupby-sel {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  color: var(--text, #1d1d1f);
  cursor: pointer;
}
.taches-groupby-sel:focus {
  outline: none;
  border-color: var(--gossamer-dark, #0fa07b);
  box-shadow: 0 0 0 2px rgba(15,160,123,0.15);
}
.taches-groupby-arrow {
  color: var(--text-mut, #86868b);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}

.taches-no-est {
  display: inline-flex; align-items: center; gap: 3px;
  color: #d84315 !important;
  background: rgba(216,67,21,0.08) !important;
  border: 1px solid rgba(216,67,21,0.25);
  border-radius: 8px;
  padding: 0 6px;
  line-height: 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.taches-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 20px;
}
.taches-error {
  padding: 16px 20px;
  background: #ffebee;
  border: 1px solid #ef9a9a;
  color: #b71c1c;
  border-radius: 8px;
  margin: 20px 0;
}
.taches-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-mut, #86868b);
  font-size: 13px;
}

.taches-section {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  margin-bottom: 16px;
  overflow: hidden;
}
.taches-section header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(180deg, #f9fafb 0%, #fff 100%);
  border-bottom: 1px solid #e5e5ea;
}
.taches-section header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--bottle-green, #1d1d1f);
  display: flex; align-items: center; gap: 10px;
}
.taches-section-count {
  background: var(--gossamer-dark, #0fa07b);
  color: #fff;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
}
.taches-section-err { border-left: 4px solid #ef5350; }
.taches-err-tag {
  background: #ffebee;
  color: #b71c1c;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.taches-projects { padding: 8px 0; }
.taches-project {
  padding: 4px 16px 6px;
  border-bottom: 1px solid #f5f5f7;
}
.taches-project:last-child { border-bottom: none; }
.taches-project-name {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mut, #86868b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 0 2px;
}

.taches-group { display: block; }
.taches-group + .taches-group { border-top: 1px solid #f5f5f7; }

.tg-plan {
  display: inline-flex; align-items: center; gap: 10px;
  margin-left: auto;
  padding-left: 12px;
  text-transform: none;
  letter-spacing: 0;
}
.taches-group-header { display: flex; align-items: center; gap: 8px; }
.tg-plan-total {
  background: #e8eaf6;
  color: #283593;
  border-radius: 8px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.tg-plan-total.tg-plan-empty {
  background: #ffebee;
  color: #b71c1c;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(183,28,28,0.25);
}
.tg-plan-roles {
  display: inline-flex; flex-wrap: wrap; gap: 4px 8px;
  font-size: 10px;
  color: var(--text-mut, #86868b);
  font-weight: 500;
}
.tg-plan-role {
  background: rgba(40,53,147,0.06);
  color: #283593;
  border-radius: 6px;
  padding: 0 6px;
  line-height: 16px;
  white-space: nowrap;
}
.tg-plan-role strong { font-weight: 700; }
.taches-group-header {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mut, #86868b);
}
.taches-group.depth-0 > .taches-group-header {
  font-size: 12px;
  padding: 8px 0 4px;
  color: var(--text, #1d1d1f);
}
.taches-group.depth-1 > .taches-group-header {
  font-size: 11px;
  padding: 5px 0 3px 14px;
  border-left: 2px solid #e5e5ea;
  margin-left: 4px;
}
.taches-group.depth-2 > .taches-group-header {
  font-size: 10px;
  padding: 4px 0 2px 14px;
  border-left: 2px dotted #e5e5ea;
  margin-left: 18px;
}
.taches-group.depth-1 > .taches-tasks,
.taches-group.depth-1 > .taches-subgroups { margin-left: 18px; }
.taches-group.depth-2 > .taches-tasks,
.taches-group.depth-2 > .taches-subgroups { margin-left: 32px; }
.taches-pcount {
  background: #f0f0f0;
  border-radius: 10px;
  padding: 0 7px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-mut, #86868b);
  text-transform: none;
  letter-spacing: 0;
}

.taches-tasks { display: flex; flex-direction: column; gap: 0; }

/* ── Mode tableau ───────────────────────────────────────── */
.taches-tasks.is-table { display: block; }
.taches-task.is-table-row {
  display: grid;
  /* grid-template-columns est défini en inline-style par renderTaskRow
     en fonction des colonnes visibles. */
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  min-height: 26px;
  font-size: 12px;
}
.taches-task.is-table-row .tc-effroles,
.taches-task.is-table-row .tc-future {
  align-self: stretch;
  padding-top: 1px;
}
.taches-task.is-table-row .tc {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex; align-items: center;
}
.taches-task.is-table-row .tc-prio { justify-content: center; }
.taches-task.is-table-row .tc-dot {
  justify-content: flex-start;
  gap: 6px;
}
.taches-state-name {
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.taches-task.is-table-row .tc-tags {
  flex-wrap: wrap;
  gap: 3px;
  align-items: flex-start;
  align-content: flex-start;
  padding-top: 4px;
}
.tc-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  background: #eef2ff;
  color: #3949ab;
  white-space: nowrap;
}
.taches-task.is-table-row .tc-name {
  font-weight: 500;
  flex-direction: column;
  align-items: stretch;
  white-space: normal;
  overflow: visible;
}
.taches-task.is-table-row .tc-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.taches-task.is-table-row .tc-name-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 2px;
}
.taches-task.is-table-row .tc-name-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 0 6px;
  line-height: 14px;
  border-radius: 6px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.taches-task.is-table-row .tc-name-tag.tag-milestone {
  background: #fff3e0;
  color: #e65100;
}
.taches-task.is-table-row .tc-name-tag.tag-assignees {
  background: #e3f2fd;
  color: #1565c0;
}
.taches-task.is-table-row .tc-project { color: #4527a0; font-weight: 600; }
.taches-task.is-table-row .tc-est,
.taches-task.is-table-row .tc-eff,
.taches-task.is-table-row .tc-rem,
.taches-task.is-table-row .tc-future {
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}
.taches-task.is-table-row .tc-effroles {
  align-items: stretch;
  flex-direction: column;
  overflow: visible;
  white-space: normal;
  font-variant-numeric: tabular-nums;
}
.taches-task.is-table-row .tc-cell-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
}
.taches-task.is-table-row .tc-cell-stack > .tc-num {
  align-self: flex-end;
  background: var(--soft, #f5f5f7);
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.04);
}
.taches-task.is-table-row .tc-cell-stack.over > .tc-num,
.taches-task.is-table-row .tc-cell-stack > .tc-num.over {
  background: #ffebee; color: #b71c1c;
}
.taches-task.is-table-row .tc-cell-stack > .tc-num.tc-future {
  background: #e8eaf6; color: #283593;
}
.taches-task.is-table-row .tc-roles,
.dp-c-roles .tc-roles, .dp-c-sheet-roles .tc-roles,
.gantt-tcell .tc-roles {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 0;
  margin-top: 0;
  border-top: 1px dashed rgba(0,0,0,0.10);
  padding-top: 2px;
}
.taches-task.is-table-row .tc-role-line,
.dp-c-roles .tc-role-line, .dp-c-sheet-roles .tc-role-line,
.gantt-tcell .tc-role-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-mut, #86868b);
  line-height: 16px;
  padding: 1px 4px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.taches-task.is-table-row .tc-role-line:last-child,
.dp-c-roles .tc-role-line:last-child,
.dp-c-sheet-roles .tc-role-line:last-child,
.gantt-tcell .tc-role-line:last-child {
  border-bottom: none;
}
.taches-task.is-table-row .tc-role-block,
.dp-c-roles .tc-role-block,
.dp-c-sheet-roles .tc-role-block,
.gantt-tcell .tc-role-block {
  display: flex; flex-direction: column;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding-bottom: 1px;
}
.taches-task.is-table-row .tc-role-block:last-child,
.dp-c-roles .tc-role-block:last-child,
.dp-c-sheet-roles .tc-role-block:last-child,
.gantt-tcell .tc-role-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.taches-task.is-table-row .tc-role-block .tc-role-line,
.dp-c-roles .tc-role-block .tc-role-line,
.dp-c-sheet-roles .tc-role-block .tc-role-line,
.gantt-tcell .tc-role-block .tc-role-line {
  border-bottom: none;
  font-weight: 700;
  color: var(--text, #1d1d1f);
}
.taches-task.is-table-row .tc-role-header,
.dp-c-roles .tc-role-header, .dp-c-sheet-roles .tc-role-header,
.gantt-tcell .tc-role-header {
  font-size: 9px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mut, #86868b) !important;
  line-height: 14px !important;
  padding: 0 4px !important;
}
.taches-task.is-table-row .tc-emps,
.dp-c-roles .tc-emps, .dp-c-sheet-roles .tc-emps,
.gantt-tcell .tc-emps {
  display: flex; flex-direction: column;
  padding-left: 10px;
  border-left: 2px solid rgba(0,0,0,0.07);
  margin-left: 4px;
}
.taches-task.is-table-row .tc-emp-line,
.dp-c-roles .tc-emp-line, .dp-c-sheet-roles .tc-emp-line,
.gantt-tcell .tc-emp-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-mut, #86868b);
  line-height: 14px;
  padding: 0 4px;
}
.taches-task.is-table-row .tc-emp-name,
.dp-c-roles .tc-emp-name, .dp-c-sheet-roles .tc-emp-name,
.gantt-tcell .tc-emp-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
  font-style: italic;
}
.taches-task.is-table-row .tc-emp-hours {
  font-weight: 600;
  color: var(--text, #1d1d1f);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.taches-task.is-table-row .tc-role-name,
.dp-c-roles .tc-role-name, .dp-c-sheet-roles .tc-role-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}
.taches-task.is-table-row .tc-role-hours {
  font-weight: 700;
  color: var(--text, #1d1d1f);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.taches-task.is-table-row .tc-num {
  font-weight: 700;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--soft, #f5f5f7);
  color: var(--text, #1d1d1f);
  line-height: 16px;
}
.taches-task.is-table-row .tc-num.over {
  background: #ffebee; color: #b71c1c;
}
.taches-task.is-table-row .tc-num.warn {
  background: rgba(216,67,21,0.08); color: #d84315;
}
.taches-task.is-table-row .tc-num.is-neg {
  background: #fff3e0; color: #e65100;
}
.taches-task.is-table-row .tc-num.is-budget-alert {
  background: #b71c1c;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 0 0 2px rgba(183,28,28,0.25);
  letter-spacing: 0.02em;
}
.taches-task.is-table-row.has-budget-alert {
  background: rgba(239,83,80,0.08);
  border-left-color: #b71c1c !important;
  border-left-width: 3px;
}
.taches-task.is-table-row.has-budget-alert:hover {
  background: rgba(239,83,80,0.14);
}
.taches-task.is-table-row .tc-num.muted {
  background: transparent; color: var(--text-mut, #86868b); font-weight: 500;
}
.taches-task.is-table-row .tc-future .tc-num:not(.muted) {
  background: #e8eaf6; color: #283593;
}
.taches-task.is-table-row .tc-deadline .taches-deadline,
.taches-task.is-table-row .tc-stage,
.taches-task.is-table-row .tc-milestone,
.taches-task.is-table-row .tc-assignees {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.taches-table-head {
  background: var(--soft, #f5f5f7);
  color: var(--text-mut, #86868b);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border, #e5e5ea);
  border-top: 1px solid var(--border, #e5e5ea);
  cursor: default;
  pointer-events: none;
  min-height: 24px !important;
}
.taches-table-head:hover { background: var(--soft, #f5f5f7) !important; }
.taches-task {
  display: flex; align-items: center; gap: 10px;
  padding: 3px 10px;
  min-height: 26px;
  border-radius: 0;
  text-decoration: none;
  color: var(--text, #1d1d1f);
  transition: background 0.1s;
  border-left: 3px solid transparent;
  border-bottom: 1px solid #f0f0f3;
  font-size: 12px;
}
.taches-task:last-child { border-bottom: none; }
.taches-task:hover { background: #f5f5f7; }
.taches-task.is-late { border-left-color: #ef5350; background: #fff8f8; }
.taches-task.is-late:hover { background: #fff0f0; }

.taches-task-main {
  display: flex; align-items: center; gap: 6px;
  flex: 1; min-width: 0;
  font-weight: 500;
}
.taches-prio { width: 14px; flex-shrink: 0; font-size: 11px; text-align: center; }
.taches-state-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 1px #fff;
}
.taches-task-name {
  flex: 1; min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.taches-task-meta {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 4px;
  font-size: 10px;
  color: var(--text-mut, #86868b);
  flex-shrink: 0;
}
.taches-task-meta > span {
  background: #f5f5f7;
  border-radius: 8px;
  padding: 0 6px;
  line-height: 16px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.taches-project-tag {
  background: #ede7f6;
  color: #4527a0;
  border-radius: 8px;
  padding: 0 6px;
  line-height: 16px;
  font-size: 10px;
  font-weight: 700;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.taches-stage { background: #eef7f4 !important; color: var(--gossamer-dark, #0fa07b) !important; font-weight: 600; }
.taches-milestone { background: #fff3e0 !important; color: #e65100 !important; }
.taches-assignees { background: #e3f2fd !important; color: #1565c0 !important; }
.taches-deadline { background: #e8f5e9 !important; color: #2e7d32 !important; font-weight: 600; }
.taches-deadline.late { background: #ffebee !important; color: #b71c1c !important; font-weight: 700; }
.taches-deadline.missing {
  background: transparent !important;
  color: var(--text-mut, #b0b0b8) !important;
  font-style: italic;
  font-weight: 400;
  opacity: 0.55;
}
.taches-hours { background: #f3e5f5 !important; color: #6a1b9a !important; font-weight: 600; }

.taches-gauge {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  background: transparent !important;
  padding: 0 4px !important;
  line-height: 16px;
  min-width: 110px;
}
.taches-gauge-bar {
  position: relative;
  flex: 1;
  height: 6px;
  min-width: 40px;
  background: #ececef;
  border-radius: 3px;
  overflow: hidden;
}
.taches-gauge-fill {
  display: block;
  height: 100%;
  background: var(--gossamer-dark, #0fa07b);
  transition: width 0.2s;
}
.taches-gauge.low  .taches-gauge-fill { background: #4FC3F7; }
.taches-gauge.mid  .taches-gauge-fill { background: #FFB300; }
.taches-gauge.full .taches-gauge-fill { background: var(--gossamer-dark, #0fa07b); }
.taches-gauge.over .taches-gauge-fill { background: #ef5350; }
.taches-gauge-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text, #1d1d1f);
  white-space: nowrap;
}
.taches-gauge.over .taches-gauge-label { color: #b71c1c; }

.taches-sched {
  background: #e8eaf6 !important;
  color: #283593 !important;
  font-weight: 700;
  white-space: nowrap;
}

.taches-err-banner {
  padding: 8px 14px;
  margin-bottom: 12px;
  background: #ffebee;
  border-left: 3px solid #ef5350;
  color: #b71c1c;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.taches-userbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  background: #fff;
  padding: 6px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  position: sticky;
  top: calc(56px + 45px);
  z-index: 14;
}
.taches-userbar:empty { display: none; }

#taches-proj-search,
#taches-view-sel,
#tickets-search,
#tickets-view-sel {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
}
#taches-proj-search,
#tickets-search { width: 180px; }
#taches-proj-search:focus,
#taches-view-sel:focus,
#tickets-search:focus,
#tickets-view-sel:focus {
  outline: none;
  border-color: var(--gossamer-dark, #0fa07b);
  box-shadow: 0 0 0 2px rgba(15,160,123,0.15);
}
.taches-userbar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mut, #86868b);
  margin-right: 4px;
}
.taches-user-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: var(--soft);
  color: var(--text-soft);
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s;
  line-height: 1.2;
}
.taches-user-chip:hover { background: var(--border); }
.taches-user-chip input { display: none; }
.taches-user-chip.is-on {
  background: var(--gossamer-dark, #0fa07b);
  color: #fff;
}
.taches-user-count {
  font-size: 10px;
  background: rgba(0,0,0,0.08);
  color: inherit;
  border-radius: 8px;
  padding: 1px 5px;
  font-weight: 700;
}
.taches-user-chip.is-on .taches-user-count { background: rgba(255,255,255,0.25); color: #fff; }
.taches-user-all {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  cursor: pointer;
  color: var(--text-mut, #86868b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: inherit;
}
.taches-user-all:hover { border-color: var(--gossamer-dark, #0fa07b); color: var(--gossamer-dark, #0fa07b); }

/* ── Gantt Projets ───────────────────────────────────────── */

.planning-toolbar .legend-bar {
  display: inline-block;
  width: 18px;
  height: 8px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 4px;
}
.planning-toolbar .legend-diamond {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--orange);
  transform: rotate(45deg);
  vertical-align: middle;
  margin-right: 4px;
}
.planning-toolbar .legend-line {
  display: inline-block;
  width: 2px;
  height: 12px;
  background: #EF5350;
  vertical-align: middle;
  margin-right: 4px;
}
.planning-toolbar .legend-update {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: #2196F3;
  border: 1.5px solid #fff;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
  box-shadow: 0 0 0 1px #2196F3;
}

.gantt-wrap {
  position: relative;
  background: var(--bg);
  min-height: calc(100vh - 56px - 52px);
}

#gantt-container {
  overflow: auto;
  max-height: calc(100vh - 56px - 52px);
  position: relative;
}

.gantt-grid {
  background: #fff;
  position: relative;
}

.gantt-row {
  display: flex;
  align-items: stretch;
}
.gantt-row-header {
  position: sticky;
  top: 0;
  z-index: 12;
  height: var(--header-h);
}
.gantt-row-body {
  position: relative;
}

.gantt-corner {
  position: sticky;
  left: 0;
  z-index: 13;
  width: var(--left-w);
  flex: 0 0 var(--left-w);
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
}
.gantt-sort-btn {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  user-select: none;
  white-space: nowrap;
}
.gantt-sort-btn:hover { background: var(--soft); color: var(--text); }
.gantt-sort-btn.is-active { color: var(--gossamer-dark); background: #eef7f4; }

/* Vue tableau intégrée au layout Gantt (mêmes colonne gauche + sticky corner).
 * Le right body affiche des cellules au lieu de barres. */
.gantt-tcols-header { background: #fff; height: var(--header-h); }
.gantt-tcol-head {
  position: absolute;
  top: 0;
  height: 100%;
  padding: 0 10px;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.gantt-tcol-head.is-right { justify-content: flex-end; }
.gantt-tcol-head.is-sortable { cursor: pointer; }
.gantt-tcol-head.is-sortable:hover { background: var(--soft); color: var(--text); }
.gantt-tcol-head.is-active { color: var(--gossamer-dark); background: #eef7f4; }

.gantt-tcol-sep {
  position: absolute;
  top: 0;
  width: 0;
  border-left: 1px solid #f0f0f2;
  pointer-events: none;
}

.gantt-tcell {
  position: absolute;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--text);
  border-bottom: 1px solid #f3f3f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-tcell[style*="text-align:right"] { justify-content: flex-end; }
/* Cellule contenant des rôles au format dashboard : layout vertical,
   alignement haut, wrap autorisé, padding réduit. */
.gantt-tcell:has(.tc-roles) {
  align-items: stretch;
  white-space: normal;
  padding: 4px 6px;
  overflow: hidden;
}
.gantt-tcell .tc-roles { border-top: none; padding-top: 0; }
.ptbl-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--text-mut);
  text-decoration: none;
}
.ptbl-open:hover { background: var(--gossamer); color: #fff; text-decoration: none; }

/* Tags du projet (project.tags). Couleur de fond selon t.color (1..11) */
.ptbl-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 500;
  background: #e5e5ea;
  color: #1d1d1f;
  white-space: nowrap;
}

/* Personne du Sheet Référentiel (1 chip par rôle pourvu) */
.ptbl-sheetrole {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 500;
  background: #eef7f4;
  color: var(--gossamer-dark);
  border: 1px solid #cfe1db;
  margin-right: 2px;
  white-space: nowrap;
}

/* Petit logo "à reporter dans Odoo" : signalé quand seule la valeur sheet
   est présente dans une colonne CP/CF/CT/CP RUN du tableau projets. */
.ptbl-sheet-icon {
  color: var(--gossamer-dark, #714B67);
  font-size: 12px;
  vertical-align: -1px;
  margin-right: 2px;
  cursor: help;
}
/* Stack vertical (valeur principale au-dessus, secondaire barrée dessous)
   — utilisé dans les colonnes CP / CF / CT / CP RUN du tableau projets. */
.ptbl-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  line-height: 1.25;
  width: 100%;
}
.ptbl-stack > span { white-space: normal; word-break: break-word; }
.ptbl-strike {
  text-decoration: line-through;
  color: var(--text-mut, #86868b);
  font-size: 11px;
  font-style: italic;
}
/* Quand un stack est dans une cellule, on lui permet d'occuper la hauteur
   et d'aligner vers le haut (sinon flex:center du parent recentre). */
.gantt-tcell:has(.ptbl-stack) { align-items: flex-start; padding: 4px 10px; white-space: normal; }
/* Cellules "Planifié passé/futur" : 1 bloc `.ptbl-roleblock` par ligne pour
   garantir un rendu lisible et une hauteur prédictible (cf. projectRowHeight
   côté JS qui dimensionne la ligne selon le nb de rôles). */
.gantt-tcell:has(.ptbl-roleblock) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 2px;
  padding: 4px 6px;
  white-space: normal;
  line-height: 16px;
  overflow: hidden;
}
.gantt-tcell:has(.ptbl-roleblock) .ptbl-roleblock {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-right: 0;
  width: 100%;
}

/* Block "Rôle : Personne(s)" — utilisé dans les colonnes Rôles et Rôle Sheet */
.ptbl-roleblock {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  background: var(--soft);
  border: 1px solid #e1e1e6;
  white-space: nowrap;
  margin-right: 2px;
}
.ptbl-rolename {
  font-weight: 600;
  color: var(--text-soft);
}
.ptbl-rolepers {
  color: var(--text);
}
.ptbl-tag[data-color="1"]  { background: #ef9a9a; color: #fff; }
.ptbl-tag[data-color="2"]  { background: #ce93d8; color: #fff; }
.ptbl-tag[data-color="3"]  { background: #9fa8da; color: #fff; }
.ptbl-tag[data-color="4"]  { background: #81d4fa; color: #1d1d1f; }
.ptbl-tag[data-color="5"]  { background: #80cbc4; color: #1d1d1f; }
.ptbl-tag[data-color="6"]  { background: #a5d6a7; color: #1d1d1f; }
.ptbl-tag[data-color="7"]  { background: #fff59d; color: #1d1d1f; }
.ptbl-tag[data-color="8"]  { background: #ffcc80; color: #1d1d1f; }
.ptbl-tag[data-color="9"]  { background: #ffab91; color: #1d1d1f; }
.ptbl-tag[data-color="10"] { background: #bcaaa4; color: #fff; }
.ptbl-tag[data-color="11"] { background: #b0bec5; color: #fff; }

/* Barre de progression Avancement */
.ptbl-progress {
  position: relative;
  width: 100%;
  height: 14px;
  background: #f3f3f5;
  border-radius: 7px;
  overflow: hidden;
}
.ptbl-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 7px;
  transition: width 0.2s;
  opacity: 0.85;
}
.ptbl-progress-label {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
  color: #1d1d1f;
}

.gantt-top-header {
  position: relative;
  background: #fff;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
  overflow: hidden;
}
.gantt-bands {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 26px;
  border-bottom: 1px solid var(--border);
}
.gantt-band {
  position: absolute;
  top: 0;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: capitalize;
  border-right: 1px solid var(--border);
  background: var(--soft);
}
.gantt-cols {
  position: absolute;
  top: 26px;
  left: 0;
  right: 0;
  height: 30px;
}
.gantt-col {
  position: absolute;
  top: 0;
  height: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border-right: 1px solid var(--border);
  color: var(--text-soft);
  background: #fff;
}
.gantt-col.is-weekend { background: rgba(0,0,0,0.025); color: var(--text-mut); }
.gantt-col.is-month-start { border-left: 1px solid var(--border); }
.gantt-col.is-year-start { border-left: 2px solid var(--gossamer); }
.gantt-col .gc-label { font-weight: 600; line-height: 1.1; }
.gantt-col .gc-sub { font-size: 9px; color: var(--text-mut); line-height: 1.1; }

.gantt-left-body {
  position: sticky;
  left: 0;
  z-index: 11;
  width: var(--left-w);
  flex: 0 0 var(--left-w);
  background: #fff;
  border-right: 1px solid var(--border);
}
.gantt-left-row {
  position: absolute;
  left: 0;
  width: var(--left-w);
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-bottom: 1px solid #f3f3f5;
  cursor: pointer;
  gap: 8px;
  overflow: hidden;
}
.gantt-left-row:hover { background: var(--soft); }
.gantt-left-row .glr-color {
  width: 4px;
  height: 60%;
  border-radius: 2px;
  flex-shrink: 0;
}
.gantt-left-row .glr-indent {
  width: 14px;
  height: 1px;
  margin-left: 14px;
  border-top: 1px dashed var(--border);
  flex-shrink: 0;
}
.gantt-left-row .glr-text { min-width: 0; flex: 1; }
.gantt-left-row .glr-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-left-row .glr-name.task {
  font-weight: 500;
  font-size: 12px;
  color: var(--text-soft);
}
.gantt-left-row .glr-sub {
  font-size: 10.5px;
  color: var(--text-mut);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.gantt-left-row .glr-stage {
  background: var(--soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.gantt-left-row .glr-margin {
  width: 96px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  border-left: 1px solid #f0f0f2;
  padding-left: 6px;
  margin-left: 4px;
  min-height: 100%;
}
.glr-margin-val {
  font-weight: 600;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  min-width: 24px;
  text-align: right;
}
.glr-margin-val.is-empty {
  color: #c8c8cc;
  font-weight: 400;
}
.gantt-left-task { background: #fcfcfd; }

.gantt-body {
  position: relative;
  flex: 0 0 auto;
}

.gantt-col-bg {
  position: absolute;
  top: 0;
  pointer-events: none;
  border-right: 1px solid #f0f0f2;
}
.gantt-col-bg.is-weekend { background: rgba(0,0,0,0.02); }
.gantt-col-bg.is-month-start { border-left: 1px solid var(--border); }

.gantt-row-bg {
  position: absolute;
  left: 0;
  pointer-events: none;
  border-bottom: 1px solid #f3f3f5;
}
.gantt-row-bg.is-task { background: rgba(0,0,0,0.012); }
.gantt-row-bg.is-group { background: #eef7f4; border-top: 1px solid #d6e5e0; border-bottom: 1px solid #d6e5e0; }
.gantt-row-bg.is-group.is-group-l0 { background: #cfe9e1; }
.gantt-row-bg.is-group.is-group-l1 { background: #e1f1ec; }
.gantt-row-bg.is-group.is-group-l2 { background: #eef7f4; }

.gantt-left-row.gantt-left-group {
  cursor: pointer;
  font-weight: 600;
  border-bottom: 1px solid #d6e5e0;
}
.gantt-left-row.gantt-left-group.gantt-group-l0 { background: #cfe9e1 !important; }
.gantt-left-row.gantt-left-group.gantt-group-l1 { background: #e1f1ec !important; }
.gantt-left-row.gantt-left-group.gantt-group-l2 { background: #eef7f4 !important; }
.gantt-left-row.gantt-left-group:hover { filter: brightness(0.97); }

.gantt-today {
  position: absolute;
  top: 0;
  width: 2px;
  background: #EF5350;
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(239,83,80,0.4);
}

.gantt-bar {
  position: absolute;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  z-index: 3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: filter 0.15s;
}
.gantt-bar:hover { filter: brightness(1.08); z-index: 5; }
.gantt-bar .gb-label {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.gantt-bar .gb-progress {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 0;
  border-radius: 5px 0 0 5px;
}
.gantt-bar-task {
  font-weight: 500;
  font-size: 11px;
  opacity: 0.95;
}
.gantt-bar-task.done {
  opacity: 0.55;
  text-decoration: line-through;
}
.gantt-bar-task.canceled {
  opacity: 0.4;
  text-decoration: line-through;
}
.gantt-bar-point {
  width: 24px;
  border-radius: 50%;
  padding: 0;
  justify-content: center;
}
.gantt-bar-point .gb-label { display: none; }

.gantt-milestone {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--orange);
  transform: rotate(45deg);
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 6;
}
.gantt-milestone:hover { transform: rotate(45deg) scale(1.2); }
.gantt-milestone.reached {
  background: #4CAF50;
}

/* Jalon "MEP"/"MES" : ligne d'arrivée verticale + drapeau à damiers au-dessus
   de la ligne projet (rendue à la place du losange standard). */
.gantt-mep {
  position: absolute;
  width: 2px;
  cursor: pointer;
  z-index: 7;
  background: repeating-linear-gradient(
    to bottom,
    #222 0 5px,
    transparent 5px 9px
  );
}
.gantt-mep::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -8px;
  font-size: 14px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25));
}
.gantt-mep.is-mes::before { content: "🏁"; }
.gantt-mep.is-mep::before { content: "⚙️"; }
.gantt-mep:hover::before { transform: scale(1.25); transform-origin: bottom left; }
.gantt-mep.reached {
  background: repeating-linear-gradient(
    to bottom,
    #1d8b5e 0 5px,
    transparent 5px 9px
  );
}

/* Jalon "[Odoo Licences] N" : badge violet avec icône "plusieurs personnes"
   + nombre de licences. Centré horizontalement sur la date du jalon. */
.gantt-license {
  position: absolute;
  height: 18px;
  background: var(--gossamer-dark, #714B67);
  color: #fff;
  border-radius: 9px;
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: pointer;
  z-index: 6;
  line-height: 1;
  transform: translateX(-50%);
}
.gantt-license i { font-size: 11px; opacity: 0.9; }
.gantt-license:hover { filter: brightness(1.15); }
.gantt-license.reached { background: #1d8b5e; }

.gantt-update {
  position: absolute;
  width: 18px;
  height: 18px;
  background: #2196F3;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: pointer;
  z-index: 6;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  color: #fff;
  user-select: none;
}
.gantt-update:hover { transform: scale(1.2); }
.gantt-update.status-on_track  { background: #4CAF50; }
.gantt-update.status-at_risk   { background: #FF9800; }
.gantt-update.status-off_track { background: #EF5350; }
.gantt-update.status-on_hold   { background: #8c7c4a; }
.gantt-update.status-done      { background: #4CAF50; }

.gantt-slot {
  position: absolute;
  height: 4px;
  border-radius: 2px;
  opacity: 0.7;
  z-index: 2;
  pointer-events: none;
}

/* Projets en retard */
.gantt-left-project.is-overdue {
  background: rgba(239,83,80,0.04);
}
.gantt-left-project.is-overdue .glr-name {
  color: #c62828;
}
.glr-overdue {
  color: #EF5350;
  font-size: 13px;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}
.gantt-bar-project.is-overdue {
  box-shadow: 0 0 0 1px rgba(239,83,80,0.4);
  font-weight: 700;
}

.gantt-left-row .glr-chevron {
  width: 12px;
  font-size: 10px;
  color: var(--text-mut);
  flex-shrink: 0;
  text-align: center;
  user-select: none;
}
.gantt-left-project.is-expanded .glr-chevron { color: var(--gossamer-dark); }

.gantt-bar.gantt-bar-slot {
  font-weight: 500;
  font-size: 10.5px;
  opacity: 0.92;
}
.gantt-bar.gantt-bar-slot.draft { border-style: dashed; opacity: 0.7; }

.gantt-left-task.is-nodate {
  background: rgba(255,152,0,0.05);
}
.gantt-left-task.is-nodate .glr-name {
  color: #b26a00;
}

/* ── Dashboard projets (liste cartes) ───────────────────── */
.dp-content { padding: 16px 20px; }
.dp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.dp-card {
  display: flex;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
}
.dp-card:hover {
  box-shadow: 0 6px 22px rgba(0,0,0,0.07);
  transform: translateY(-1px);
  text-decoration: none;
}
.dp-card.is-overdue { background: rgba(239,83,80,0.03); border-color: rgba(239,83,80,0.4); }
.dp-card-color { width: 5px; flex-shrink: 0; }
.dp-card-body { flex: 1; padding: 12px 14px; min-width: 0; }
.dp-card-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.dp-card-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dp-card.is-overdue .dp-card-name { color: #c62828; }
.dp-card-overdue { color: #EF5350; font-weight: 700; }
.dp-card-stage {
  font-size: 10.5px;
  font-weight: 600;
  background: var(--soft);
  color: var(--text-soft);
  padding: 2px 7px;
  border-radius: 12px;
  flex-shrink: 0;
}
.dp-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-mut);
  margin-bottom: 6px;
}
.dp-card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.dp-card-roles { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.dp-role-tag {
  font-size: 10px;
  background: rgba(15,160,123,0.08);
  color: var(--gossamer-dark);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 500;
}
.dp-card-kpis {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #f3f3f5;
}
.dp-kpi { display: flex; flex-direction: column; }
.dp-kpi-v { font-size: 13px; font-weight: 700; color: var(--text); }
.dp-kpi-l { font-size: 10px; color: var(--text-mut); }
.dp-progress {
  position: relative;
  height: 8px;
  background: var(--soft);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.dp-progress-bar { height: 100%; border-radius: 4px; }
.dp-progress-lbl {
  position: absolute;
  top: -16px;
  right: 0;
  font-size: 10px;
  color: var(--text-mut);
  font-weight: 600;
}

/* ── Dashboard détail ──────────────────────────────────── */
.pd-header {
  background: #fff;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.pd-header-top { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.pd-back {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-soft);
}
.pd-back:hover { border-color: var(--gossamer-dark); color: var(--gossamer-dark); text-decoration: none; }
.pd-title { margin: 0; font-size: 20px; font-weight: 700; color: var(--text); }
.pd-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--text-mut);
  margin-bottom: 12px;
}
.pd-header-meta span { display: inline-flex; align-items: center; gap: 5px; }
.pd-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.pd-kpis .pd-kpi {
  background: var(--soft);
  padding: 10px 12px;
  border-radius: 8px;
  display: flex; flex-direction: column;
}
.pd-kpi.is-over .pd-kpi-v { color: #EF5350; }
.pd-kpis .pd-kpi-v { font-size: 17px; font-weight: 700; color: var(--text); }
.pd-kpis .pd-kpi-l { font-size: 10.5px; color: var(--text-mut); margin-top: 2px; }

.pd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
  padding: 16px 20px;
}
.pd-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.pd-section-wide { grid-column: 1 / -1; }
.pd-section h3 {
  margin: 0 0 12px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--bottle-green);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Kanban tâches */
.pd-kanban {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.pd-kanban-col {
  flex: 0 0 240px;
  background: var(--soft);
  border-radius: 8px;
  padding: 8px;
}
.pd-kanban-col.is-fold { opacity: 0.6; }
.pd-kanban-head {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 6px 8px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pd-kanban-count {
  background: #fff;
  border-radius: 10px;
  font-size: 11px;
  padding: 1px 7px;
  font-weight: 600;
}
.pd-kanban-body { display: flex; flex-direction: column; gap: 5px; }
.pd-task {
  background: #fff;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 3px solid transparent;
}
.pd-task.is-late { border-left-color: #EF5350; }
.pd-task-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pd-task-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.pd-task-dl { font-size: 10.5px; color: var(--text-mut); }
.pd-task-dl.late { color: #EF5350; font-weight: 600; }
.pd-task-user { font-size: 10px; color: var(--text-mut); }
.pd-task-more { font-size: 10.5px; color: var(--text-mut); text-align: center; padding: 4px; }

/* Mini-timeline planning */
.pd-mini-timeline { overflow: hidden; }
.pd-mini-axis {
  font-size: 11px;
  color: var(--text-mut);
  margin-bottom: 6px;
  padding-left: 160px;
}
.pd-mini-rows { display: flex; flex-direction: column; gap: 3px; }
.pd-mini-row { display: flex; align-items: center; gap: 8px; }
.pd-mini-emp {
  width: 160px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  justify-content: space-between;
  padding-right: 8px;
}
.pd-mini-hours { color: var(--text-mut); font-weight: 400; font-size: 11px; }
.pd-mini-bar-wrap {
  position: relative;
  flex: 1;
  height: 14px;
  background: var(--soft);
  border-radius: 4px;
}
.pd-mini-bar {
  position: absolute;
  top: 1px;
  bottom: 1px;
  background: var(--gossamer);
  border-radius: 3px;
  min-width: 2px;
}
.pd-mini-bar.draft { background: repeating-linear-gradient(45deg, var(--gossamer-light), var(--gossamer-light) 3px, transparent 3px, transparent 6px); }

/* Liste générique (jalons, tickets) */
.pd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pd-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 6px 4px;
  border-bottom: 1px solid #f5f5f7;
}
.pd-list-row:last-child { border-bottom: none; }
.pd-list-row.is-late { background: rgba(239,83,80,0.04); }
.pd-list-icon { width: 18px; text-align: center; flex-shrink: 0; }
.pd-list-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.pd-list-meta { font-size: 11px; color: var(--text-mut); flex-shrink: 0; }

/* Project updates */
.pd-updates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pd-update {
  padding: 10px 12px;
  background: var(--soft);
  border-radius: 8px;
}
.pd-update-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pd-update-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pd-update-name { flex: 1; font-weight: 600; font-size: 13px; color: var(--text); }
.pd-update-meta { font-size: 11px; color: var(--text-mut); }
.pd-update-desc { font-size: 12px; color: var(--text-soft); padding-left: 16px; }
.pd-update-desc img { max-width: 100%; }

/* Liste tâches du dashboard détail */
.pd-tasks-table { display: flex; flex-direction: column; }
.pd-tasks-head,
.pd-tasks-row {
  display: grid;
  grid-template-columns: 22px 16px minmax(220px, 1.8fr) minmax(110px, 0.7fr) minmax(140px, 1fr) 110px 120px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 12px;
  border-bottom: 1px solid #f3f3f5;
}
.pd-tasks-head {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-mut);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--soft);
  position: sticky;
  top: 0;
}
.pd-tasks-row:hover { background: var(--soft); }
.pd-tasks-row.is-late { background: rgba(239,83,80,0.04); }
.pd-tasks-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ptt-c-name { font-weight: 500; color: var(--text); }
.ptt-c-stage,
.ptt-c-user { color: var(--text-soft); }
.ptt-c-dl { color: var(--text-mut); font-size: 11.5px; }
.ptt-c-dl.late { color: #EF5350; font-weight: 600; }
.ptt-c-hrs { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.ptt-c-hrs.over { color: #EF5350; font-weight: 600; }

/* Dashboard projets — vue liste/tableau */
.dp-table {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.dp-tr {
  display: grid;
  grid-template-columns: 14px minmax(220px,1.8fr) minmax(140px,1.1fr) minmax(130px,0.9fr) minmax(110px,0.7fr) minmax(200px,1.4fr) minmax(200px,1.4fr) 80px 80px 80px minmax(140px,1fr) 60px 60px;
  align-items: start;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  border-bottom: 1px solid #f3f3f5;
  text-decoration: none;
  color: inherit;
}
.dp-tr.dp-th { align-items: center; }
.dp-tr:not(.dp-th) > span.dp-c-color,
.dp-tr:not(.dp-th) > span.dp-c-end,
.dp-tr:not(.dp-th) > span.dp-c-budget,
.dp-tr:not(.dp-th) > span.dp-c-pointed,
.dp-tr:not(.dp-th) > span.dp-c-count,
.dp-tr:not(.dp-th) > span.dp-c-progress {
  align-self: center;
}
.dp-tr:last-child { border-bottom: none; }
.dp-tr.dp-th {
  background: var(--soft);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-mut);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.dp-tr:not(.dp-th):hover { background: var(--soft); text-decoration: none; }
.dp-tr.is-overdue:not(.dp-th) { background: rgba(239,83,80,0.04); }
.dp-tr > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dp-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dp-c-name {
  font-weight: 600;
  color: var(--text);
}
.dp-tr.is-overdue .dp-c-name { color: #c62828; }
.dp-c-partner,
.dp-c-mgr { color: var(--text-soft); }
.dp-c-roles,
.dp-c-sheet-roles {
  display: flex !important;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  white-space: normal !important;
  text-overflow: clip !important;
}
.dp-c-end { color: var(--text-mut); font-variant-numeric: tabular-nums; }
.dp-c-end.late { color: #EF5350; font-weight: 600; }
.dp-c-budget,
.dp-c-pointed,
.dp-c-count { font-variant-numeric: tabular-nums; color: var(--text-soft); }
.dp-c-pointed.over { color: #EF5350; font-weight: 600; }
.dp-c-progress {
  display: flex !important;
  align-items: center;
  gap: 6px;
}
.dp-progress-inline {
  position: relative;
  flex: 1;
  height: 6px;
  background: var(--soft);
  border-radius: 3px;
  overflow: hidden;
  min-width: 50px;
}
.dp-progress-inline .dp-progress-bar { height: 100%; border-radius: 3px; }
.dp-progress-pct { font-size: 11px; color: var(--text-mut); min-width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.dp-muted { color: var(--text-mut); }

/* Badge "Travaux en cours" pour les pages WIP */
.nav-wip {
  display: inline-flex;
  align-items: center;
  font-size: 8.5px;
  font-weight: 700;
  color: #b26a00;
  background: rgba(255,152,0,0.12);
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: 4px;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* ─── Référentiel ─────────────────────────────────────────── */
.referentiel-page { background: var(--bg); }
.referentiel-toolbar { flex-wrap: wrap; }
.referentiel-wrap {
  position: relative;
  background: var(--bg);
  min-height: calc(100vh - 56px - 52px);
}
.referentiel-tablewrap {
  overflow: auto;
  max-height: calc(100vh - 56px - 52px - 20px);
  border-top: 1px solid var(--border);
}
.referentiel-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  width: max-content;
  min-width: 100%;
  background: #fff;
}
.referentiel-table th,
.referentiel-table td {
  padding: 6px 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: top;
}
.referentiel-table thead .ref-section-row th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--gossamer-dark);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
  text-align: center;
  border-bottom: 2px solid var(--gossamer);
}
.referentiel-table thead .ref-section-empty { background: #4a4a4a; }
.referentiel-table thead .ref-col-row th {
  position: sticky;
  top: 28px;
  z-index: 2;
  background: #fafafa;
  color: var(--text);
  font-weight: 600;
  font-size: 11px;
  text-align: left;
  border-bottom: 2px solid var(--gossamer-dark);
}
.referentiel-table tbody td {
  background: #fff;
}
.referentiel-table tbody tr:nth-child(even) td {
  background: #fafbfc;
}
.referentiel-table tbody tr:hover td {
  background: rgba(15,160,123,0.07);
}
.referentiel-table .ref-trunc {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
}
.referentiel-table .ref-empty {
  text-align: center;
  padding: 30px;
  color: var(--text-mut);
  font-style: italic;
  background: #fff !important;
}

.referentiel-table .ref-group-row td {
  background: #eef7f4 !important;
  cursor: pointer;
  font-size: 12px;
  user-select: none;
  border-top: 2px solid var(--gossamer);
}
.referentiel-table .ref-group-row:hover td { background: #dcefe9 !important; }
.referentiel-table .ref-group-cell { color: var(--gossamer-dark); }
.referentiel-table .ref-group-chev {
  display: inline-block; width: 12px; color: var(--gossamer-dark);
  font-weight: 700; text-align: center; margin-right: 4px;
}
.referentiel-table .ref-group-count {
  display: inline-block; margin-left: 10px;
  font-size: 10px; font-weight: 700;
  background: var(--gossamer-dark); color: #fff;
  padding: 1px 8px; border-radius: 10px;
}

/* Coloration des lignes Référentiel selon la SANTE (Alerte/Vigilance/OK) */
.referentiel-table tbody tr.ref-row-ok td      { background: #f1faf3 !important; }
.referentiel-table tbody tr.ref-row-ok:hover td { background: #dff3e2 !important; }
.referentiel-table tbody tr.ref-row-warn td     { background: #fff6e1 !important; }
.referentiel-table tbody tr.ref-row-warn:hover td { background: #ffead2 !important; }
.referentiel-table tbody tr.ref-row-danger td   { background: #fdecea !important; color: #8a1c11; }
.referentiel-table tbody tr.ref-row-danger:hover td { background: #fadcd7 !important; }

/* Niveaux de regroupement (couleur de fond dégressive du primaire au tertiaire) */
.referentiel-table .ref-group-row.ref-group-l0 td { background: #cfe9e1 !important; }
.referentiel-table .ref-group-row.ref-group-l1 td { background: #e1f1ec !important; }
.referentiel-table .ref-group-row.ref-group-l2 td { background: #eef7f4 !important; }

/* ── Page Démos Odoo ─────────────────────────────────────── */
.demos-page { padding: 16px 24px; }
.demos-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.demos-version-tabs { display: inline-flex; gap: 4px; }
.demos-version-tab {
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.demos-version-tab:hover { background: var(--soft); }
.demos-version-tab.active {
  background: var(--gossamer);
  color: #fff;
  border-color: var(--gossamer);
}
.demos-wrap { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.demos-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.demos-table thead th {
  background: var(--soft);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.demos-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.demos-table tbody tr:last-child td { border-bottom: 0; }
.demos-table tbody tr:hover { background: var(--soft); }
.demos-table tbody tr.demos-section-row,
.demos-table tbody tr.demos-section-row:hover {
  background: #eef7f4;
}
.demos-table tbody tr.demos-section-row td {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gossamer-dark);
  padding: 8px 14px;
}
.demos-table tbody tr.demos-section-row td i { margin-right: 6px; }
.demos-table tbody tr.demos-row-template td:first-child::before {
  content: "★";
  color: var(--gossamer);
  margin-right: 6px;
}
.demos-url { color: var(--gossamer-dark); text-decoration: none; }
.demos-url:hover { text-decoration: underline; }
.demos-empty, .demos-empty-row { padding: 24px; text-align: center; color: var(--text-mut); }

/* Modales */
.demos-modal {
  position: fixed; inset: 0; z-index: 1080;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
}
.demos-modal-card {
  background: #fff;
  border-radius: 12px;
  width: min(520px, 92vw);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}
.demos-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.demos-modal-close {
  background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer;
  color: var(--text-mut);
}
.demos-modal-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.demos-modal-body label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.demos-modal-body input[type=text], .demos-modal-body input[type=file], .demos-modal-body select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font: inherit;
}
.demos-fqdn {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.demos-fqdn input[type=text] {
  border: 0 !important;
  border-radius: 0 !important;
  flex: 1;
  min-width: 0;
}
.demos-fqdn input[type=text]:focus { outline: 2px solid var(--gossamer); outline-offset: -2px; }
.demos-fqdn-suffix,
.demos-fqdn-prefix {
  background: var(--soft);
  color: var(--text-mut);
  padding: 7px 10px;
  font-size: 13px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.demos-fqdn-suffix { border-left: 1px solid var(--border); }
.demos-fqdn-prefix { border-right: 1px solid var(--border); }

/* ── Page Équipe / Organigramme ──────────────────────────── */
.equipe-page { padding: 16px 24px; }
.equipe-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.equipe-wrap { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 24px; overflow: auto; }
.equipe-tree-wrap { min-width: max-content; }
.equipe-tree ul {
  padding-top: 18px;
  position: relative;
  transition: all 0.5s;
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
}
.equipe-tree li {
  list-style: none;
  text-align: center;
  position: relative;
  padding: 18px 3px 0;
}
/* Connecteur vertical depuis le parent */
.equipe-tree li::before,
.equipe-tree li::after {
  content: "";
  position: absolute;
  top: 0;
  border-top: 1.5px solid #cdd5d3;
  width: 50%;
  height: 24px;
}
.equipe-tree li::after { right: auto; left: 50%; border-left: 1.5px solid #cdd5d3; }
.equipe-tree li::before { right: 50%; border-right: 1.5px solid #cdd5d3; }
.equipe-tree li:only-child::before,
.equipe-tree li:only-child::after { display: none; }
.equipe-tree li:only-child { padding-top: 24px; }
.equipe-tree li:first-child::before,
.equipe-tree li:last-child::after { border: 0 none; }
.equipe-tree li:last-child::before {
  border-right: 1.5px solid #cdd5d3;
  border-radius: 0 5px 0 0;
}
.equipe-tree li:first-child::after { border-radius: 5px 0 0 0; }
/* Connecteur vertical descendant : la barre verticale de la racine vers le ul */
.equipe-tree > ul { padding-top: 0; }
.equipe-tree > ul > li::before,
.equipe-tree > ul > li::after { display: none; }
.equipe-tree > ul > li { padding-top: 0; }
.equipe-tree ul ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 1.5px solid #cdd5d3;
  width: 0;
  height: 18px;
}

/* Grille de feuilles : 3 cartes par ligne sous un manager dont *tous* les
 * subordonnés sont des feuilles. Pas de connecteurs horizontaux entre frères
 * (le bandeau supérieur fait office de regroupement visuel). */
.equipe-tree ul.equipe-leaves-grid {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px 10px;
  padding-top: 22px;
  position: relative;
}
.equipe-tree ul.equipe-leaves-grid > li {
  padding: 0;
}
.equipe-tree ul.equipe-leaves-grid > li::before,
.equipe-tree ul.equipe-leaves-grid > li::after {
  display: none;
}
/* Petit bandeau horizontal au-dessus de la grille pour matérialiser le regroupement */
.equipe-tree ul.equipe-leaves-grid::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 12%;
  right: 12%;
  border-top: 1.5px solid #cdd5d3;
}

.equipe-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 110px;
  max-width: 150px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s;
  text-align: center;
}
.equipe-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.equipe-avatar { width: 36px; height: 36px; margin-bottom: 4px; }
.equipe-avatar img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--soft);
}
.equipe-avatar-fallback {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gossamer);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.equipe-card-body { font-size: 11px; line-height: 1.25; width: 100%; }
.equipe-name { font-weight: 600; font-size: 12px; color: var(--text); }
.equipe-job { color: var(--text-mut); margin-top: 1px; }
.equipe-dept { color: var(--text-mut); font-size: 10px; margin-top: 1px; font-style: italic; }
.equipe-github {
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: 3px; padding: 1px 5px;
  background: #24292e; color: #fff !important;
  border-radius: 3px; font-size: 10px;
  text-decoration: none;
}
.equipe-github:hover { background: #000; text-decoration: none; }
.equipe-github i { font-size: 11px; }

/* Indicateur d'attente sur les boutons (sablier qui tourne) */
.demos-page .spin,
.spin {
  display: inline-block;
  animation: demos-spin 1.1s linear infinite;
}
@keyframes demos-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
button.is-busy { cursor: progress; opacity: 0.85; }
.demos-form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.demos-checkbox { flex-direction: row !important; align-items: center; gap: 6px; }
.demos-modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding-top: 6px; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 14px;
}

/* ===== Catalogue produit ===== */
.catalogue-toolbar { flex-wrap: wrap; align-items: center; gap: 10px; }
.catalogue-title {
  font-size: 18px; font-weight: 600; margin: 0 8px 0 0;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}
.catalogue-title i { color: var(--gossamer); }
.catalogue-check {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--text-soft); cursor: pointer; white-space: nowrap;
}
.catalogue-wrap { padding: 16px 20px; }

.cat-section { margin-bottom: 26px; }
.cat-section-title {
  font-size: 14px; font-weight: 600; color: var(--gossamer-dark);
  margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.cat-section-count {
  font-size: 11px; font-weight: 600; color: var(--text-mut);
  background: var(--soft); border-radius: 10px; padding: 1px 8px;
}
.cat-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.cat-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s, transform .15s;
}
.cat-card:hover { border-color: var(--gossamer); transform: translateY(-2px); }
.cat-card-head { display: flex; flex-direction: column; gap: 2px; }
.cat-card-name { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.3; }
.cat-card-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; color: var(--text-mut);
}
.cat-card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-badge {
  font-size: 10px; font-weight: 600; border-radius: 6px;
  padding: 2px 7px; text-transform: uppercase; letter-spacing: .02em;
}
.cat-badge-type { background: #eef7f4; color: var(--gossamer-dark); }
.cat-badge-mut { background: #f0e6dd; color: var(--orange); }
.cat-badge-role { background: #e7ecfb; color: #3a5bbf; text-transform: none; letter-spacing: 0; }
.cat-card-prices {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-top: 2px;
}
.cat-price-main { font-size: 16px; font-weight: 700; color: var(--text); }
.cat-uom { font-size: 11px; font-weight: 500; color: var(--text-mut); }
.cat-price-sub { font-size: 12px; color: var(--text-mut); }
.cat-card-margin {
  font-size: 12px; font-weight: 600; border-radius: 8px;
  padding: 6px 10px; display: flex; justify-content: space-between; align-items: center;
}
.cat-margin-pct { font-size: 13px; }
.cat-card-quotes {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  padding-top: 8px; margin-top: 2px; border-top: 1px dashed var(--border);
  font-size: 11px; color: var(--text-mut);
}
.cat-card-quotes > i { color: var(--text-mut); }
.cat-qchip {
  display: inline-block; background: #f0f1f5; color: var(--text-soft);
  border-radius: 6px; padding: 2px 7px; font-size: 11px; line-height: 1.5;
}
.cat-margin-ok  { background: #e8f6f1; color: var(--gossamer-dark); }
.cat-margin-low { background: #fbf1e6; color: var(--orange); }
.cat-margin-neg { background: #fdecec; color: #d6433b; }

/* Vue tableau : réutilise .referentiel-table, ajuste l'alignement numérique */
.cat-table th, .cat-table td { white-space: nowrap; }
.cat-trow-group td {
  background: #eef7f4; color: var(--gossamer-dark);
  font-weight: 600; font-size: 13px;
  position: sticky; left: 0;
}
.cat-trow-group .cat-section-count {
  margin-left: 8px; font-size: 11px; color: var(--text-mut);
  background: #fff; border-radius: 10px; padding: 1px 8px; font-weight: 600;
}
.cat-num { text-align: right; }
.cat-uomcell { color: var(--text-mut); font-size: 12px; }
.cat-qcell { white-space: normal; max-width: 320px; }
.cat-qcell .cat-qchip { margin: 1px 2px; }
.cat-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
td.cat-margin-ok  { color: var(--gossamer-dark); font-weight: 600; }
td.cat-margin-low { color: var(--orange); font-weight: 600; }
td.cat-margin-neg { color: #d6433b; font-weight: 600; }
