/* ══════════════════════════════════════════════
   Modals & Forms
   ══════════════════════════════════════════════ */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,12,30,.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition-base);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--gradient-card);
  backdrop-filter: var(--blur-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  width: min(480px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  transform: translateY(-12px);
  transition: transform var(--transition-base);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-size: var(--text-base); font-weight: var(--weight-semi); color: var(--color-text);
}
.modal-close {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: var(--color-bg-card-2); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); font-size: 18px; color: var(--color-muted);
  cursor: pointer; transition: background var(--transition-fast);
}
.modal-close:hover { background: var(--color-red); color: #fff; border-color: var(--color-red); }

.modal-body  { display: flex; flex-direction: column; gap: var(--space-3); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: var(--space-2);
  border-top: 1px solid var(--color-border); padding-top: var(--space-3);
}

.form-group  { display: flex; flex-direction: column; gap: 6px; }
.form-label  { font-size: var(--text-xs); font-weight: 600; color: var(--color-muted); text-transform: uppercase; letter-spacing: .06em; }
.form-input  {
  background: var(--color-bg-card-2); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); color: var(--color-text);
  font-size: var(--text-sm); font-family: var(--font-sans);
  padding: 8px 12px; outline: none;
  transition: border-color var(--transition-fast);
}
.form-input:focus { border-color: var(--color-purple); }

.btn-cancel {
  background: var(--color-bg-card-2); border: 1px solid var(--color-border);
  color: var(--color-muted); border-radius: var(--radius-md);
  padding: 8px 18px; font-size: var(--text-sm); font-family: var(--font-sans); cursor: pointer;
  transition: background var(--transition-fast);
}
.btn-cancel:hover { background: var(--color-bg-hover); }

.btn-submit {
  background: var(--gradient-purple); color: #fff; border: none;
  border-radius: var(--radius-md); padding: 8px 20px;
  font-size: var(--text-sm); font-weight: 600; font-family: var(--font-sans); cursor: pointer;
  transition: opacity var(--transition-fast);
}
.btn-submit:hover { opacity: .85; }

/* Color picker */
.color-picker { display: flex; gap: 8px; }
.color-btn {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--c); border: 2px solid transparent;
  cursor: pointer; transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.color-btn:hover  { transform: scale(1.15); }
.color-btn.active { border-color: #fff; transform: scale(1.15); }

/* Task list styles */
.task-item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 6px 0; border-bottom: 1px solid var(--color-border);
}
.task-check  { cursor: pointer; accent-color: var(--color-purple); width: 15px; height: 15px; }
.task-label  { flex: 1; font-size: var(--text-sm); color: var(--color-text-2); }
.task-item.done .task-label { text-decoration: line-through; color: var(--color-muted); }
.task-delete {
  background: none; border: none; color: var(--color-muted);
  font-size: 16px; cursor: pointer; padding: 0 4px; opacity: 0;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}
.task-item:hover .task-delete { opacity: 1; }
.task-delete:hover { color: var(--color-red); }

.add-task-form  { display: flex; gap: var(--space-2); }
.add-task-input {
  flex: 1; background: var(--color-bg-card-2); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); color: var(--color-text);
  font-size: var(--text-sm); font-family: var(--font-sans); padding: 7px 12px; outline: none;
}
.add-task-input:focus { border-color: var(--color-purple); }
.add-task-btn {
  background: var(--gradient-purple); color: #fff; border: none;
  border-radius: var(--radius-md); width: 34px; height: 34px;
  font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
/* ═══════════════════════════════════════════════════════════
   projets.css — Page Projets
   ═══════════════════════════════════════════════════════════ */

html:has(.projets-layout),
body:has(.projets-layout) { overflow: hidden; height: 100%; }
body:has(.projets-layout) { display: flex; flex-direction: column; }
body:has(.projets-layout) .main {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(167,139,250,.4) transparent;
}
body:has(.projets-layout) .main::-webkit-scrollbar { width: 5px; }
body:has(.projets-layout) .main::-webkit-scrollbar-thumb { background: rgba(167,139,250,.4); border-radius: 3px; }

/* ── Toolbar ── */
.projets-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-5); gap: var(--space-3); flex-wrap: wrap;
}
.projets-toolbar__right { display: flex; align-items: center; gap: var(--space-2); }
.projets-title { font-size: var(--text-xl); font-weight: var(--weight-bold); color: var(--color-text); }
.projets-count { font-size: var(--text-sm); color: var(--color-muted); font-weight: 400; margin-left: 8px; }

.status-filter-select {
  background: var(--color-bg-card-2); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); color: var(--color-text-2);
  font-size: var(--text-sm); font-family: var(--font-sans);
  padding: 6px 12px; cursor: pointer;
}
.btn-manage-statuses {
  background: var(--color-bg-card-2); border: 1px solid var(--color-border);
  color: var(--color-muted); border-radius: var(--radius-md);
  width: 34px; height: 34px; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.btn-manage-statuses:hover { background: var(--color-purple); color: #fff; border-color: var(--color-purple); }

.btn-new-project {
  background: var(--gradient-purple); color: #fff; border: none;
  border-radius: var(--radius-md); padding: 8px 18px;
  font-size: var(--text-sm); font-weight: var(--weight-semi);
  font-family: var(--font-sans); cursor: pointer;
  transition: opacity var(--transition-fast);
}
.btn-new-project:hover { opacity: .85; }

/* ── Grille projets ── */
.projets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

/* ── Card projet ── */
.project-card {
  background: var(--gradient-card);
  backdrop-filter: var(--blur-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  cursor: pointer;
  transition: border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.project-card--purple::before  { background: var(--gradient-purple); }
.project-card--blue::before    { background: linear-gradient(90deg,#60a5fa,#818cf8); }
.project-card--teal::before    { background: var(--gradient-teal); }
.project-card--orange::before  { background: linear-gradient(90deg,#fb923c,#f59e0b); }
.project-card--red::before     { background: linear-gradient(90deg,#f87171,#fb7185); }
.project-card--yellow::before  { background: linear-gradient(90deg,#fbbf24,#f59e0b); }
.project-card--green::before   { background: linear-gradient(90deg,#34d399,#10b981); }

.project-card:hover {
  border-color: rgba(167,139,250,.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.project-card__header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.project-card__name {
  font-size: var(--text-base); font-weight: var(--weight-semi); color: var(--color-text);
  line-height: 1.3;
}
.project-card__desc {
  font-size: var(--text-xs); color: var(--color-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.project-status-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; border-radius: var(--radius-full);
  padding: 3px 10px; white-space: nowrap; flex-shrink: 0;
}
.project-status-badge--purple  { background: rgba(167,139,250,.2); color: var(--color-purple); }
.project-status-badge--blue    { background: rgba(96,165,250,.2);  color: var(--color-blue); }
.project-status-badge--teal    { background: rgba(52,211,153,.2);  color: var(--color-teal); }
.project-status-badge--orange  { background: rgba(251,146,60,.2);  color: var(--color-orange); }
.project-status-badge--red     { background: rgba(248,113,113,.2); color: var(--color-red); }
.project-status-badge--yellow  { background: rgba(251,191,36,.2);  color: var(--color-yellow); }
.project-status-badge--green   { background: rgba(52,211,153,.2);  color: #34d399; }
.project-status-badge--default { background: rgba(122,131,154,.15); color: var(--color-muted); }

/* Barre de progression */
.project-card__progress-wrap {
  margin-bottom: var(--space-3);
}
.project-card__progress-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--text-xs); color: var(--color-muted); margin-bottom: 5px;
}
.project-card__progress-pct { font-weight: 600; color: var(--color-text-2); }
.project-card__progress-bar {
  height: 5px; background: var(--color-bg-card-2);
  border-radius: 99px; overflow: hidden;
}
.project-card__progress-fill {
  height: 100%; border-radius: 99px;
  transition: width .4s ease;
}
.project-card__progress-fill--purple  { background: var(--gradient-purple); }
.project-card__progress-fill--blue    { background: linear-gradient(90deg,#60a5fa,#818cf8); }
.project-card__progress-fill--teal    { background: var(--gradient-teal); }
.project-card__progress-fill--orange  { background: linear-gradient(90deg,#fb923c,#f59e0b); }
.project-card__progress-fill--red     { background: linear-gradient(90deg,#f87171,#fb7185); }
.project-card__progress-fill--yellow  { background: linear-gradient(90deg,#fbbf24,#f59e0b); }
.project-card__progress-fill--green   { background: linear-gradient(90deg,#34d399,#10b981); }

.project-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--text-xs); color: var(--color-muted);
  border-top: 1px solid var(--color-border); padding-top: var(--space-2); margin-top: var(--space-2);
}
.project-card__links { display: flex; align-items: center; gap: 4px; }

/* ── Vue détail ── */
.detail-header {
  display: flex; align-items: flex-start; gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.btn-back {
  background: var(--color-bg-card-2); border: 1px solid var(--color-border);
  color: var(--color-text-2); border-radius: var(--radius-md);
  padding: 7px 14px; font-size: var(--text-sm); font-family: var(--font-sans);
  cursor: pointer; white-space: nowrap;
  transition: background var(--transition-fast);
}
.btn-back:hover { background: var(--color-bg-hover); }
.detail-header__info { flex: 1; min-width: 0; }
.detail-title {
  font-size: var(--text-xl); font-weight: var(--weight-bold);
  color: var(--color-text);
}
.detail-meta { display: flex; align-items: center; gap: var(--space-3); margin-top: 4px; }
.detail-progress-text { font-size: var(--text-sm); color: var(--color-muted); white-space: nowrap;}

.detail-header__actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.btn-edit-project {
  background: var(--color-bg-card-2); border: 1px solid var(--color-border);
  color: var(--color-text-2); border-radius: var(--radius-md);
  padding: 7px 14px; font-size: var(--text-sm); font-family: var(--font-sans); cursor: pointer;
}
.btn-delete-project {
  background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.25);
  color: var(--color-red); border-radius: var(--radius-md);
  padding: 7px 14px; font-size: var(--text-sm); font-family: var(--font-sans); cursor: pointer;
}

.detail-progress-bar-wrap {
  height: 6px; background: var(--color-bg-card-2);
  border-radius: 99px; overflow: hidden; margin-bottom: var(--space-5);
}
.detail-progress-bar {
  height: 100%; border-radius: 99px; background: var(--gradient-purple);
  transition: width .4s ease;
}

.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4);
}
.detail-card { display: flex; flex-direction: column; }

/* ── Liens fichiers ── */
.link-item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: var(--color-bg-card-2); margin-bottom: 6px;
}
.link-item__icon { font-size: 16px; flex-shrink: 0; }
.link-item__name { flex: 1; font-size: var(--text-sm); color: var(--color-text-2); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-item__del { background: none; border: none; color: var(--color-muted); font-size: 16px; cursor: pointer; padding: 0 4px; }
.link-item__del:hover { color: var(--color-red); }

/* ── Résultats recherche lien ── */
.link-result-item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 8px var(--space-3); border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--transition-fast);
  font-size: var(--text-sm); color: var(--color-text-2);
}
.link-result-item:hover { background: var(--color-bg-hover); }
.link-result-item.linked { color: var(--color-purple); }

/* ── Modal statuts ── */
.status-manage-row {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 5px 0;
}
.status-manage-color {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.status-manage-name { flex: 1; font-size: var(--text-sm); color: var(--color-text-2); }
.status-manage-del {
  background: none; border: none; color: var(--color-muted);
  font-size: 16px; cursor: pointer; padding: 0 4px;
}
.status-manage-del:hover { color: var(--color-red); }

/* ── Badge projet dans documents ── */
.project-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700;
  background: rgba(167,139,250,.15); color: var(--color-purple);
  border: 1px solid rgba(167,139,250,.25);
  border-radius: var(--radius-full); padding: 2px 8px;
  white-space: nowrap;
}

/* ── Mobile projets ── */
@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }

  /* Fichiers liés collapsible en premier sur mobile */
  .detail-card--files {
    order: -1;
  }
  .detail-card--files .detail-card-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .detail-card--files .detail-card-body {
    display: none;
  }
  .detail-card--files.open .detail-card-body {
    display: block;
  }
  .detail-card--files .collapse-icon {
    transition: transform .2s;
    color: var(--color-muted);
  }
  .detail-card--files.open .collapse-icon {
    transform: rotate(180deg);
  }

  /* Header projet */
  .projet-detail-header {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  .projet-detail-header h1 {
    font-size: var(--text-lg) !important;
    word-break: break-word;
  }
}
