/* Modèles de tâches (Paramètres → Priorités et délais) et ajout au dossier depuis « Tâches à faire ».
   Coque des modales : .dealManualTask* existante (main.css). Ici seulement le contenu propre à ces écrans. */



/* Formulaires défilants : en-tête et boutons restent visibles, même sur un écran bas. */
.dealPresetTaskForm,
#dealPriorityCustomTaskModal .dealManualTaskForm{
  max-height:calc(100vh - 260px);
  overflow:auto;
}
.dealPresetTaskList{
  display:grid;
  gap:var(--fi-space-xs);
  max-height:280px;
  overflow:auto;
}
.dealPresetTaskGroup,
.dealPresetTaskGroupList{
  display:grid;
  gap:var(--fi-space-xs);
}
.dealPresetTaskGroup + .dealPresetTaskGroup{
  margin-top:var(--fi-space-md);
}
.dealPresetTaskGroupTitle{
  margin:0;
  color:var(--fi-ink-faint);
  font-size:var(--fi-text-xs);
  font-weight:var(--fi-weight-meta);
}
/* « Tâche détaillée… » à gauche, Annuler/Ajouter à droite. */
.dealPresetTaskDetailed{
  margin-right:auto;
}
.dealPresetTaskOption{
  display:grid;
  grid-template-columns:auto 32px minmax(0,1fr);
  align-items:center;
  gap:var(--fi-space-md);
  padding:var(--fi-space-sm) var(--fi-space-md);
  border:1px solid var(--fi-border);
  border-radius:var(--fi-radius-lg);
  background:var(--fi-surface);
  cursor:pointer;
}
.dealPresetTaskOption:has(input:checked){
  border-color:var(--fi-accent-line);
  background:var(--fi-accent-soft);
}
.dealPresetTaskOption.is-added{
  cursor:default;
  opacity:.6;
}
.dealPresetTaskOption strong,
.dealPresetTaskOption small{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.dealPresetTaskOption strong{
  color:var(--fi-ink);
  font-size:var(--fi-text-sm);
  font-weight:var(--fi-weight-meta);
}
.dealPresetTaskOption small{
  color:var(--fi-ink-faint);
  font-size:var(--fi-text-2xs);
}
.dealPresetTaskEmpty{
  margin:0;
  color:var(--fi-ink-faint);
  font-size:var(--fi-text-sm);
}
.dealPresetTaskStatus{
  margin:0;
  min-height:1em;
  color:var(--fi-danger);
  font-size:var(--fi-text-xs);
}
.dealPresetTaskStatus:empty{
  display:none;
}

/* Puce d'icône colorée (choix, aperçu, ligne de paramètres) */
.customTaskPreview,
.dealPresetTaskIcon,
.customTaskRow .customTaskPreview{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  width:28px;
  height:28px;
  border-radius:var(--fi-radius-md);
  background:var(--fi-surface-2);
  color:var(--custom-task-color,var(--fi-ink-soft));
}
.customTaskPreview svg,
.dealPresetTaskIcon svg,
.customTaskPickerGrid svg{
  width:16px;
  height:16px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.customTaskSwatch{
  flex:0 0 auto;
  width:18px;
  height:18px;
  border-radius:var(--fi-radius-circle);
  background:var(--custom-task-color,var(--fi-ink-faint));
}

/* Sélecteurs visuels d'icône et de couleur */
.customTaskPickerButton{
  justify-content:flex-start;
  gap:var(--fi-space-sm);
}
.customTaskPickerGrid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:var(--fi-space-2xs);
  margin-top:var(--fi-space-xs);
  padding:var(--fi-space-xs);
  border:1px solid var(--fi-border);
  border-radius:var(--fi-radius-lg);
  background:var(--fi-surface);
}
.customTaskPickerGrid[hidden]{
  display:none;
}
.customTaskPickerGrid button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:32px;
  border:1px solid transparent;
  border-radius:var(--fi-radius-md);
  background:transparent;
  color:var(--fi-ink-soft);
  cursor:pointer;
}
.customTaskPickerGrid button:hover{
  background:var(--fi-hover-surface);
}
.customTaskPickerGrid button[aria-selected="true"]{
  border-color:var(--fi-accent-line);
  background:var(--fi-accent-soft);
}
.customTaskPickerGrid button:focus-visible{
  box-shadow:var(--fi-shadow-focus-ring);
  outline:none;
}

.customTaskOptions{
  display:grid;
  gap:var(--fi-space-xs);
}

/* Paramètres : section « Tâches personnalisées » sous le tableau existant */
.customTaskSection{
  display:grid;
  gap:var(--fi-space-sm);
  margin-top:var(--fi-space-xl);
}
.customTaskSectionHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--fi-space-md);
}
.customTaskSectionHead strong{
  color:var(--fi-ink);
  font-size:var(--fi-text-base);
  font-weight:var(--fi-weight-heading);
}
.customTaskRow{
  display:grid;
  grid-template-columns:28px minmax(0,1fr) auto auto;
  align-items:center;
  gap:var(--fi-space-md);
  padding:var(--fi-space-sm) var(--fi-space-md);
  border:1px solid var(--fi-border);
  border-radius:var(--fi-radius-lg);
  background:var(--fi-surface);
}
.customTaskRow.is-inactive{
  opacity:.65;
}
.customTaskRowCopy{
  min-width:0;
}
.customTaskRowCopy strong,
.customTaskRowCopy small{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.customTaskRowCopy strong{
  color:var(--fi-ink);
  font-size:var(--fi-text-sm);
  font-weight:var(--fi-weight-meta);
}
.customTaskRowCopy small{
  color:var(--fi-ink-faint);
  font-size:var(--fi-text-2xs);
}
.customTaskRowActions{
  display:flex;
  gap:var(--fi-space-2xs);
}
.customTaskRowActions .fi-button{
  height:32px;
  min-height:32px;
  padding:0 var(--fi-space-md);
  font-size:var(--fi-text-xs);
}

@media(max-width:560px){
  .customTaskRow{
    grid-template-columns:28px minmax(0,1fr) auto;
  }
  .customTaskRowActions{
    grid-column:1 / -1;
    justify-content:flex-end;
  }
  .customTaskPickerGrid{
    grid-template-columns:repeat(5,minmax(0,1fr));
  }
}
