/* ============================================================
   GESTIVA · Module Projets & Affaires — projects.css
   Harmonisation avec le Design System Gestiva (global.css)
   ============================================================ */

/* ── Bouton Actualiser dans la barre de filtre ── */
.ui-filter-refresh {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  color: var(--text-muted, #64748b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.ui-filter-refresh:hover {
  background: var(--bg-hover, #f8fafc);
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.ui-filter-refresh:active {
  transform: scale(0.95);
}

.ui-filter-refresh:hover i {
  transition: transform 0.3s ease;
  transform: rotate(90deg);
}

/* ── Barre de progression projet ── */
.prj-progress-container {
  min-width: 130px;
}

.prj-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.prj-progress-bar {
  height: 6px;
  border-radius: 9999px;
  background: var(--bg-hover, #f1f5f9);
  overflow: hidden;
  border: 1px solid var(--border-color, #e2e8f0);
}

.prj-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.35s ease;
}

/* ── Badges statuts projets & tâches ── */
.prj-badge-draft {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.prj-badge-in_progress {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.prj-badge-on_hold {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.prj-badge-completed {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.prj-badge-cancelled {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ── Priorités ── */
.prj-priority-low {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.prj-priority-medium {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
}

.prj-priority-high {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.prj-priority-urgent {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ═════════════════════════════════════════════════════════════════
   DIAGRAMME DE GANTT INTERACTIF GESTIVA
   ═════════════════════════════════════════════════════════════════ */
.gantt-wrapper-card {
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.gantt-layout {
  display: flex;
  min-height: 440px;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

/* Colonne de gauche (Liste hiérarchique) */
.gantt-tree-col {
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  border-right: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  z-index: 5;
}

.gantt-tree-header {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-weight: 700;
  font-size: 12.5px;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-hover, #f8fafc);
}

.gantt-tree-row {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  border-bottom: 1px solid var(--border-color, #f1f5f9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.gantt-tree-row.is-project {
  background: #f8fafc;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.gantt-tree-row.is-task {
  padding-left: 36px;
  color: var(--text-secondary, #334155);
}

/* Zone temporelle défilable à droite */
.gantt-timeline-col {
  flex: 1;
  overflow-x: auto;
  position: relative;
  background: #ffffff;
}

.gantt-timeline-header {
  height: 52px;
  display: flex;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-hover, #f8fafc);
  position: sticky;
  top: 0;
  z-index: 4;
}

.gantt-day-header {
  min-width: 44px;
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border-color, #f1f5f9);
  font-size: 11px;
  color: var(--text-muted, #64748b);
  user-select: none;
}

.gantt-day-header.is-weekend {
  background: rgba(0,0,0,0.02);
}

.gantt-day-header.is-today {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary, #2563eb);
  font-weight: 700;
}

.gantt-timeline-body {
  position: relative;
}

.gantt-timeline-row {
  height: 44px;
  position: relative;
  border-bottom: 1px solid var(--border-color, #f1f5f9);
}

.gantt-timeline-row.is-project {
  background: #f8fafc;
}

/* Grille verticale en arrière-plan */
.gantt-grid-column {
  position: absolute;
  top: 0;
  bottom: 0;
  border-right: 1px dashed var(--border-color, #f1f5f9);
  pointer-events: none;
}

.gantt-grid-column.is-today {
  border-right: 2px solid #ef4444;
  z-index: 3;
}

/* Barres de Gantt */
.gantt-bar-item {
  position: absolute;
  top: 9px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.gantt-bar-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.22);
}

.gantt-bar-item.bar-project {
  background: #2563eb;
  border: 1px solid #1d4ed8;
}

.gantt-bar-item.bar-task {
  background: #3b82f6;
  border: 1px solid #2563eb;
}

.gantt-bar-item.bar-done {
  background: #16a34a;
  border: 1px solid #15803d;
}

.gantt-bar-item.bar-urgent {
  background: #dc2626;
  border: 1px solid #b91c1c;
}

.gantt-bar-progress {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: rgba(255,255,255,0.25);
  pointer-events: none;
}

.gantt-bar-text {
  position: relative;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Indicateur temporel Aujourd'hui */
.gantt-today-badge {
  position: absolute;
  top: 2px;
  background: #ef4444;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  transform: translateX(-50%);
  z-index: 10;
  white-space: nowrap;
}
