/* PPM Application — Custom styles (Tailwind extended) */

/* ── Reduced motion (QW8) ──
   Disables all transitions and animations for users who prefer reduced motion
   (vestibular disorders, photosensitivity). Must be the very first rule. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* Bordeaux palette */
.bg-bordeaux-900 { background-color: #4c0519; }
.bg-bordeaux-800 { background-color: #881337; }
.bg-bordeaux-700 { background-color: #9f1239; }
.bg-bordeaux-400 { background-color: #fb7185; }
.text-bordeaux   { color: #881337; }
.border-bordeaux      { border-color: #fbd5e1; }
.border-bordeaux-800  { border-color: #881337; }
.focus\:ring-bordeaux-400:focus { --tw-ring-color: #fb7185; }
.hover\:bg-bordeaux-700:hover   { background-color: #9f1239; }
.hover\:bg-bordeaux:hover       { background-color: #881337; }
.active\:bg-bordeaux-900:active { background-color: #4c0519; }

/* Top nav links (horizontal) */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.775rem;
  font-weight: 500;
  color: #fecdd3;
  transition: background-color 0.15s, color 0.15s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { background-color: rgba(255,255,255,0.1); color: #fff; }
.nav-link.active { background-color: rgba(255,255,255,0.18); color: #fff; font-weight: 600; }
.nav-link i { opacity: 0.75; font-size: 0.75rem; }
.nav-link.active i, .nav-link:hover i { opacity: 1; }

/* RAG badges */
.rag-green  { background-color: #dcfce7; color: #15803d; }
.rag-orange { background-color: #ffedd5; color: #c2410c; }
.rag-red    { background-color: #fee2e2; color: #b91c1c; }
.rag-grey   { background-color: #f1f5f9; color: #64748b; }
.rag-dot-green  { background-color: #22c55e; }
.rag-dot-orange { background-color: #f97316; }
.rag-dot-red    { background-color: #ef4444; }
.rag-dot-grey   { background-color: #94a3b8; }

/* KPI cards */
.kpi-card {
  background: white;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,.07);
  border: 1px solid #f1f5f9;
}

/* Table styles */
.ppm-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.ppm-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  background: #f8fafc;
  white-space: nowrap;
}
.ppm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.ppm-table tbody tr:hover { background-color: #fafbfc; }
.ppm-table tbody tr:last-child td { border-bottom: none; }

/* Form inputs */
.ppm-input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  padding: 8px 12px;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: white;
}
.ppm-input:focus {
  outline: 2px solid #881337;
  outline-offset: 1px;
  border-color: #fb7185;
  box-shadow: 0 0 0 3px rgba(251,113,133,0.15);
}
.ppm-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

/* Progress bar */
.progress-bar { height: 6px; border-radius: 3px; background: #e2e8f0; overflow: hidden; }
/* STR-1 : La largeur est définie via la variable CSS --pct (ex: style="--pct:65%") — évite unsafe-inline */
.progress-fill { height: 100%; border-radius: 3px; background: #881337; transition: width 0.3s; width: var(--pct, 0%); }

/* Capacity bar */
.cap-ok   { background: #22c55e; }
.cap-warn { background: #f97316; }
.cap-over { background: #ef4444; }

/* Gantt cells */
.gantt-cell { min-width: 40px; border-right: 1px solid #e2e8f0; }
/* STR-1 : La couleur de fond est définie via data-phase-color, appliqué par applyDynamicStyles() */
.gantt-phase {
  border-radius: 3px;
  height: 100%;
  min-height: 20px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--phase-color, #881337);
}
.gantt-phase-lbl {
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
  user-select: none;
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
}
/* Phase en mode lecture seule */
.gantt-phase-ro { pointer-events: none; }
/* Phase occupant toute la hauteur d'une cellule multi-phases */
.gantt-phase-flex { flex: 1; }

/* ── Capacity table ── */
.cap-sticky    { position: sticky; left: 0; z-index: 10; background: #fff; }
.cap-th        { font-size: 0.68rem; font-weight: 700; color: #94a3b8; text-align: center;
                 padding: 6px 4px; border-bottom: 2px solid #e2e8f0; white-space: nowrap;
                 min-width: 72px; }
.cap-th-name   { text-align: left; min-width: 260px; width: 260px; padding: 6px 12px;
                 border-right: 1px solid #e2e8f0; background: #f8fafc; }
.cap-th-cur    { background: #fff8f8; color: #881337; }
.cap-team-row  { background: #f1f5f9; }
.cap-team-name { padding: 5px 12px; font-size: 0.72rem; font-weight: 700; color: #475569;
                 border-right: 1px solid #e2e8f0; width: 260px; }
.cap-team-total { text-align: center; padding: 4px 2px; font-size: 0.72rem; font-weight: 700;
                  border-bottom: 1px solid #e2e8f0; }
.cap-tot-ok    { background: #dcfce7; color: #15803d; }
.cap-tot-warn  { background: #ffedd5; color: #c2410c; }
.cap-tot-over  { background: #fee2e2; color: #b91c1c; }
.cap-tot-empty { color: #cbd5e1; }
.cap-prof-row  { border-bottom: 1px solid #f1f5f9; }
.cap-prof-row:hover .cap-sticky { background: #f8fafc; }
.cap-prof-name { padding: 4px 8px 4px 12px; border-right: 1px solid #e2e8f0;
                 width: 260px; display: flex; align-items: center; gap: 5px; }
.cap-expand-btn { background: none; border: none; cursor: pointer; font-size: 0.6rem;
                  color: #94a3b8; padding: 0 2px; flex-shrink: 0;
                  transition: color 0.15s; }
.cap-expand-btn:hover { color: #881337; }
.cap-prof-label { font-size: 0.75rem; font-weight: 600; color: #1e293b; flex: 1; min-width: 0;
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-prof-default { font-size: 0.65rem; color: #94a3b8; white-space: nowrap; flex-shrink: 0; }
.cap-cell      { padding: 3px 4px; border-bottom: 1px solid #f1f5f9;
                 border-right: 1px solid #f8fafc; min-width: 72px; }
.cap-cell-over { background: #fff1f2; }
.cap-cell-warn { background: #fff7ed; }
.cap-cur       { background: #fff8f8 !important; }
.cap-cell-inner { display: flex; align-items: center; justify-content: center;
                  gap: 2px; font-size: 0.72rem; }
.cap-planned   { font-weight: 700; line-height: 1; min-width: 18px; text-align: right; }
.cap-avail-sep { color: #cbd5e1; font-size: 0.65rem; }
.cap-avail-input { width: 28px; border: none; border-bottom: 1px dashed #e2e8f0;
                   background: transparent; font-size: 0.7rem; color: #64748b;
                   text-align: center; padding: 0;
                   transition: border-color 0.15s; }
.cap-avail-input:focus { border-bottom-color: #881337; color: #1e293b;
                         outline: 2px solid #881337; outline-offset: 2px; }
.cap-bar-wrap  { height: 3px; background: #f1f5f9; border-radius: 99px;
                 margin: 2px 2px 0; overflow: hidden; }
.cap-bar       { height: 100%; border-radius: 99px; transition: width 0.3s; }
.cap-bar-ok    { background: #86efac; }
.cap-bar-warn  { background: #fdba74; }
.cap-bar-over  { background: #fca5a5; }
.cap-proj-row  { background: #fafafa; }
.cap-proj-row:hover .cap-sticky { background: #f5f3ff; }
.cap-proj-name { padding: 3px 8px 3px 28px; border-right: 1px solid #e2e8f0;
                 width: 200px; display: flex; align-items: center; gap: 4px; }
.cap-proj-rag  { font-size: 0.85rem; flex-shrink: 0; }
.cap-proj-label { font-size: 0.7rem; color: #475569; overflow: hidden;
                  text-overflow: ellipsis; white-space: nowrap; }
.cap-proj-cell { text-align: center; padding: 3px 4px; border-bottom: 1px solid #f1f5f9; }
.cap-proj-days { font-size: 0.68rem; color: #7c3aed; font-weight: 600; }
.cap-pct       { font-size: 0.7rem; font-weight: 700; }
.cap-pct-main  { font-size: 0.78rem; font-weight: 700; display: block; text-align: center; line-height: 1.2; }
.cap-3info  { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 3px; }
.cap-3-pl   { font-size: 0.7rem; font-weight: 700; color: #334155; min-width: 16px; text-align: right; }
.cap-3-sep  { font-size: 0.6rem; color: #cbd5e1; }
.cap-3-avail { font-size: 0.7rem; color: #64748b; min-width: 16px; text-align: center; }
.cap-3-override { font-weight: 700; color: #881337; }
.cap-3-pct  { font-size: 0.68rem; font-weight: 700; min-width: 26px; text-align: left; }
.cap-3-over { color: #b91c1c; }
.cap-3-warn { color: #c2410c; }
.cap-3-ok   { color: #64748b; }
.cap-team-nums { display: flex; align-items: center; justify-content: center; gap: 2px;
                 font-size: 0.65rem; color: #64748b; font-weight: 500; margin-bottom: 1px; }

/* ── Kanban board ── */
.kb-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  align-items: flex-start;
  padding-bottom: 8px;
}
.kb-col {
  flex: 0 0 230px;
  min-width: 0;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}
.kb-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
}
.kb-col-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kb-col-count {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0,0,0,0.08);
  border-radius: 99px;
  padding: 1px 7px;
  flex-shrink: 0;
}
.kb-col-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
}
.kb-empty {
  color: #cbd5e1;
  font-size: 0.75rem;
  text-align: center;
  padding: 12px 0;
}
.kb-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}
.kb-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.kb-card-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.kb-chip {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 99px;
  white-space: nowrap;
}
.kb-card-stats {
  display: flex;
  align-items: center;
  gap: 5px;
  border-top: 1px solid #f1f5f9;
  padding-top: 5px;
  margin-top: 1px;
}
.kb-stat-pct {
  font-size: 0.85rem;
  font-weight: 800;
  color: #8b1a2e;
  line-height: 1;
}
.kb-stat-days {
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  line-height: 1;
}
.kb-stat-unit {
  font-size: 0.6rem;
  font-weight: 600;
  margin-left: 1px;
}
.kb-stat-sep {
  color: #cbd5e1;
  font-size: 0.75rem;
}
.kb-stat-rag {
  font-size: 1rem;
  line-height: 1;
  margin-left: auto;
}

/* Go Live Kanban board */
.gl-kb-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: start;
}
.gl-kb-col {
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  min-width: 0;
}
/* GO LIVE — quarter state variants (replaces inline style= for CSP compliance) */
.gl-col-cur    { border-top: 3px solid #9b1c2e; }
.gl-col-past   { border-top: 3px solid #cbd5e1; }
.gl-col-future { border-top: 3px solid #86efac; }
.gl-kb-col-header {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}
.gl-hdr-cur    { background: #fff1f2; }
.gl-hdr-past   { background: #f8fafc; }
.gl-hdr-future { background: #f0fdf4; }
.gl-hdr-inner  { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.gl-q-title    { font-size: 12px; font-weight: 700; }
.gl-q-title-cur    { color: #9b1c2e; }
.gl-q-title-past   { color: #94a3b8; }
.gl-q-title-future { color: #15803d; }
.gl-q-count-cur    { color: #9b1c2e; }
.gl-q-count-past   { color: #94a3b8; }
.gl-q-count-future { color: #15803d; }
.gl-badge-sm   { font-size: 9px; }
.gl-month-icon { font-size: 9px; }
.gl-month-icon-cur    { color: #9b1c2e; }
.gl-month-icon-past   { color: #cbd5e1; }
.gl-month-icon-future { color: #22c55e; }
.gl-month-name { font-size: 11px; font-weight: 700; }
.gl-month-name-cur    { color: #9b1c2e; }
.gl-month-name-past   { color: #94a3b8; }
.gl-month-name-future { color: #374151; }
.gl-status-label { font-size: 0.65rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-kb-col-body {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}
.gl-month-group {
  margin-bottom: 12px;
}
.gl-month-group:last-child {
  margin-bottom: 0;
}
.gl-month-hdr {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0 6px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 6px;
}
.gl-m-count {
  font-size: 10px;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 99px;
}
.gl-q-count {
  font-size: 10px;
  background: rgba(0,0,0,0.07);
  padding: 1px 7px;
  border-radius: 99px;
  font-weight: 600;
}
.gl-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
}
.gl-badge-cur  { background: #9b1c2e; color: white; }
.gl-badge-past { background: #e2e8f0; color: #94a3b8; }
.gl-year-btn {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: white;
  cursor: pointer;
  transition: background 0.1s;
}
.gl-year-btn:hover { background: #f8fafc; }
.kb-card-status {
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  margin-bottom: 3px;
  line-height: 1.3;
}

/* Modal animation */
#projectModal:not(.hidden) { animation: fadeIn 0.15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Toast */
.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideUp 0.2s ease;
  max-width: 320px;
}
.toast-success { background: #15803d; }
.toast-error   { background: #b91c1c; }

/* ── RGAA A-01 : contraste ─────────────────────────────────────────
   text-slate-400 (#94a3b8) sur fond blanc → ratio 3,0:1 (WCAG AA: 4,5:1 requis).
   Override vers slate-500 (#64748b) : ratio 4,6:1 — conforme pour texte normal.
   Chargé après tailwind.css → même spécificité, règle postérieure l'emporte.
──────────────────────────────────────────────────────────────────── */
.text-slate-400 { color: #64748b; }

/* Modal projet — max-height via classe (CSP : pas de style inline en HTML) */
.modal-project-body { max-height: calc(100vh - 3rem); }
.toast-info    { background: #1e40af; }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Chips / badges */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Action buttons in admin tables */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-action-edit           { background: #f1f5f9; color: #475569; }
.btn-action-edit:hover     { background: #881337; color: #fff; }
.btn-action-del            { background: #fee2e2; color: #b91c1c; }
.btn-action-del:hover      { background: #ef4444; color: #fff; }
.btn-action-warn           { background: #ffedd5; color: #c2410c; }
.btn-action-warn:hover     { background: #f97316; color: #fff; }
.btn-action-ok             { background: #dcfce7; color: #15803d; }
.btn-action-ok:hover       { background: #22c55e; color: #fff; }
.btn-emoji {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 5px;
  border-radius: 5px;
  line-height: 1;
  transition: background 0.15s;
}
.btn-emoji:hover { background: rgba(0,0,0,0.08); }

/* RAG filter chips (planning page) */
.rag-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1.5px solid #e2e8f0;
  background: white;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.rag-chip:hover     { border-color: #94a3b8; background: #f8fafc; }
.rag-chip.active-rag { border-color: #881337; background: #fff1f2; color: #881337; }

/* Portfolio filter controls — style unifié (input, select, button) */
.pf-ctrl {
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  color: #475569;
  background: white;
  white-space: nowrap;
  line-height: 1.5;
  transition: border-color 0.15s, background 0.15s;
}
.pf-ctrl:focus {
  outline: 2px solid #881337;
  outline-offset: 1px;
  border-color: #fb7185;
  box-shadow: 0 0 0 3px rgba(251,113,133,0.12);
}
button.pf-ctrl { cursor: pointer; }
button.pf-ctrl:hover { border-color: #94a3b8; background: #f8fafc; }
.pf-ctrl.active-rag { border-color: #881337; background: #fff1f2; color: #881337; font-weight: 600; }

/* Section card */
.section-card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,.07);
  border: 1px solid #f1f5f9;
  padding: 1.5rem;
}
.section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 1rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Focus visible (QW7) ──
   Provides a visible keyboard focus ring on all interactive elements.
   nav-link gets a lighter ring to contrast with the dark topNav. */
:focus-visible {
  outline: 3px solid #881337;
  outline-offset: 2px;
  border-radius: 2px;
}
.nav-link:focus-visible,
.nav-dropdown-menu a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.kb-card:focus-visible {
  outline: 3px solid #881337;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(136,19,55,0.15);
}

/* ── Administration dropdown ── */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #4c0519;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  min-width: 175px;
  z-index: 200;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.nav-dropdown-menu.open { display: flex; flex-direction: column; gap: 1px; }
.nav-dropdown-item { display: flex; border-radius: 6px; padding: 7px 12px; }
.nav-dropdown-chevron { font-size: 0.6rem; opacity: 0.7; transition: transform 0.15s; margin-left: 2px; }
.nav-dropdown.open > button .nav-dropdown-chevron { transform: rotate(180deg); }

/* Responsive: hide nav labels on small screens */
@media (max-width: 900px) {
  .nav-link span { display: none; }
  .nav-link { padding: 6px 8px; }
  /* Keep labels inside open dropdown always visible */
  .nav-dropdown-item span { display: inline; }
  .nav-dropdown-item { padding: 7px 12px; }
}

/* ── Accessibility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  overflow: visible;
  background: #881337;
  color: white;
  padding: 8px 16px;
  z-index: 9999;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  outline: 3px solid white;
  outline-offset: 2px;
}

/* ── Permissions matrix (PagePermissions) ── */
.perm-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.perm-th {
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  min-width: 90px;
}
.perm-th-label { text-align: left; min-width: 240px; }
.perm-th-admin { background: #f0fdf4; color: #15803d; }
.perm-th-badge {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 99px;
  margin-top: 3px;
}
.perm-role-label { font-size: 0.75rem; font-weight: 700; color: #1e293b; }
.perm-cat-row { background: #f8fafc; }
.perm-cat-label {
  padding: 7px 14px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  border-top: 1px solid #e2e8f0;
}
.perm-row { border-bottom: 1px solid #f1f5f9; }
.perm-row:hover { background: #f8fafc; }
.perm-label-cell { padding: 8px 14px; }
.perm-label { font-size: 0.8rem; color: #1e293b; display: block; }
.perm-id { font-size: 0.62rem; color: #94a3b8; font-family: monospace; margin-top: 1px; display: block; }
.perm-cell {
  text-align: center;
  padding: 6px 8px;
  border-left: 1px solid #f1f5f9;
  vertical-align: middle;
}
.perm-cell-admin { background: #f0fdf4; }
.perm-cell-disabled { background: #f8fafc; }
.perm-na { color: #cbd5e1; font-size: 0.8rem; }

/* ══════════════════════════════════════════════════════════════════
   Help panel — aide en ligne contextuelle
══════════════════════════════════════════════════════════════════ */
#helpPanel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 92vw;
  z-index: 150;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
#helpPanel.open {
  transform: translateX(0);
  pointer-events: auto;
}
.help-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  overflow: hidden;
}
.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfc;
  flex-shrink: 0;
}
.help-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}
.help-close {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.help-close:hover { background: #fee2e2; color: #b91c1c; }
.help-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  font-size: 0.8rem;
  color: #475569;
  scroll-behavior: smooth;
}
.help-intro {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
/* TOC */
.help-toc {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.help-toc-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 6px;
}
.help-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.help-toc-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #881337;
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.1s;
}
.help-toc-link:hover { background: #fff1f2; text-decoration: underline; }
/* Sections */
.help-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f8fafc;
}
.help-section:last-child { border-bottom: none; margin-bottom: 0; }
.help-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
}
.help-section-text {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.65;
}
.help-section-text code {
  background: #f1f5f9;
  color: #881337;
  font-family: monospace;
  font-size: 0.73rem;
  padding: 1px 5px;
  border-radius: 4px;
}
.help-section-text strong { color: #1e293b; }
/* Glossary */
.help-glossary {
  margin-top: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.help-glossary-toggle {
  cursor: pointer;
  padding: 8px 12px;
  font-size: 0.73rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.help-glossary-toggle:hover { background: #f1f5f9; }
.help-glossary-list { padding: 10px 12px; margin: 0; }
.help-glossary-term {
  font-size: 0.73rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 8px;
}
.help-glossary-term:first-child { margin-top: 0; }
.help-glossary-def {
  font-size: 0.73rem;
  color: #475569;
  line-height: 1.5;
  margin-left: 0;
  margin-bottom: 0;
}
/* Keyboard shortcuts table */
.help-kbd-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}
.help-kbd-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.help-kbd {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-family: monospace;
  color: #1e293b;
  white-space: nowrap;
}
.help-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.73rem;
  color: #881337;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* Footer */
.help-footer {
  padding: 10px 16px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.help-footer-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.68rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  padding: 0;
}
.help-footer-link:hover { color: #881337; text-decoration: underline; }
/* Help button in topnav */
#helpBtn {
  color: #fecdd3;
  transition: background-color 0.15s, color 0.15s;
}
#helpBtn:hover { background-color: rgba(255,255,255,0.1); color: #fff; }
#helpBtn.help-active { background-color: rgba(255,255,255,0.18); color: #fff; }
.perm-chk-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}
.perm-chk-wrap:hover { background: rgba(136,19,55,0.06); }
.perm-chk {
  width: 16px;
  height: 16px;
  accent-color: #881337;
  cursor: pointer;
}
.perm-save-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

/* ── Project detail modal max-height wrapper ── */
.modal-panel-detail {
  max-height: 92vh;
}

/* ── Planning — Phase popover (replaces inline style= on #plPhasePopover) ── */
.phase-popover {
  position: fixed;
  z-index: 9999;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  border: 1px solid #e2e8f0;
  padding: 16px;
  width: 320px;
}
.phase-popover-close {
  font-size: 18px;
  line-height: 1;
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
}
.phase-popover-close:hover { color: #475569; }
.phase-popover-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.phase-popover-row {
  display: flex;
  gap: 8px;
}
.phase-popover-col {
  flex: 1;
  min-width: 0;
}
.phase-popover-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 3px;
}
.phase-popover-select {
  font-size: 12px;
  width: 100%;
}
.phase-popover-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.phase-popover-save {
  flex: 1;
  font-size: 12px;
  padding: 4px 0;
}
.phase-popover-del {
  font-size: 12px;
  padding: 4px 10px;
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.phase-popover-del:hover { background: #fca5a5; }

/* ── Gantt cells — min-width and today highlight (replaces inline style= min-width) ── */
.gantt-th-cell {
  min-width: 40px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 0;
  text-align: center;
}
.gantt-th-today { background: #fff1f2; color: #881337; }
.gantt-th-normal { color: #475569; }
.gantt-th-year { font-weight: 400; font-size: 8px; }
.gantt-td-cell { min-width: 44px; }
.gantt-td-today { background: rgba(254,241,242,0.5); }
.gantt-td-sticky { min-width: 160px; }
.gantt-td-ms-sticky { min-width: 160px; }
.gantt-col-sep { border-collapse: separate; }

/* ── Planning — capacity bar (dynamic fill) — uses data-* via applyDynamicStyles ── */
.phase-bar-inline {
  font-size: 10px;
  font-weight: 600;
  border-radius: 999px;
  padding: 1px 6px;
  height: 18px;
  cursor: pointer;
  max-width: 130px;
  outline: none;
  appearance: none;
  border: none;
  /* background/color set via data-chip-bg / data-chip-color */
}
.gantt-pct-input {
  width: 30px;
  font-size: 10px;
  text-align: right;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0 2px;
  height: 16px;
  color: #64748b;
}
.gantt-pct-unit {
  font-size: 10px;
  color: #94a3b8;
}

/* ── projectDetail — milestone diamond span ── */
.milestone-diamond {
  font-size: 13px;
  font-weight: bold;
  line-height: 1;
}

/* ── projectDetail — bar chart fill (dynamic height via data-bar-h) ── */
[data-bar-h] {
  height: var(--bar-h, 4px);
}

/* ── Gantt table layout — replaces inline style= (CSP compliance) ── */
.gantt-table { border-collapse: separate; table-layout: auto; width: 100%; }
.gantt-tr    { height: 28px; }

/* Sticky column geometry (left/width — sticky class comes from Tailwind) */
.gantt-col-name     { left: 0;     width: 275px; min-width: 275px; max-width: 275px; padding: 0 6px;  vertical-align: middle; }
.gantt-col-rag      { left: 275px; width: 36px;  min-width: 36px;  max-width: 36px;  padding: 0;      vertical-align: middle; font-size: 16px; text-align: center; }
.gantt-col-status   { left: 311px; width: 120px; min-width: 120px; max-width: 120px; padding: 0 4px;  vertical-align: middle; }
.gantt-col-progress { left: 431px; width: 105px; min-width: 105px; max-width: 105px; padding: 0 4px;  vertical-align: middle; }

/* TH-specific font styling */
th.gantt-col-name, th.gantt-col-rag, th.gantt-col-status, th.gantt-col-progress {
  font-size: 10px; font-weight: 700; color: #475569;
}
th.gantt-col-name, th.gantt-col-status, th.gantt-col-progress { text-align: left; }

/* Project name link (small font in gantt row) */
.gantt-proj-name    { font-size: 11px; }

/* Multi-phase bar wrapper */
.gantt-phase-multi  { display: flex; flex-direction: column; height: 100%; }

/* Milestone marker badge */
.gantt-ms-marker    { position: absolute; top: 0; right: 1px; font-size: 9px; line-height: 1; font-weight: 700; z-index: 1; }
.gantt-ms-late      { color: #ef4444; }
.gantt-ms-warn      { color: #f97316; }

/* Today column highlight */
.gantt-cell-today   { background: #fff8f8; }

/* Progress bar area in gantt rows */
.gantt-progress-wrap { display: flex; align-items: center; gap: 3px; }
.gantt-progress-lbl  { font-size: 10px; color: #64748b; min-width: 24px; text-align: right; }
.pl-progress-bar     { flex: 1; cursor: pointer; }

/* Status select in gantt rows (dynamic bg/color via data-chip-bg/data-chip-color) */
.pl-status-sel { appearance: none; -webkit-appearance: none; border: none; outline: none; cursor: pointer; width: 100%; }

/* ── GoLive tab layout ── */
.gl-year-wrap   { padding: 12px 16px 8px; }
.gl-year-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.gl-year-label  { font-size: 14px; font-weight: 700; color: #1e293b; }
.gl-year-count  { margin-left: 4px; font-size: 12px; color: #94a3b8; }

/* ── Capacity — CSP-safe replacements ── */
/* Table layout (was border-collapse:separate inline) */
.cap-table { border-collapse: separate; border-spacing: 0; }
.cascade-sel { width: 160px; max-width: 160px; }
/* Legend X badge (replaces inline style= on <span>) */
.cap-legend-x {
  font-weight: 700;
  border: 1px solid #881337;
  padding: 0 4px;
  border-radius: 3px;
  color: #881337;
}
/* Override availability input (replaces inline border-color + font-weight) */
.avail-input-override {
  border-color: #881337 !important;
  font-weight: 600;
}

