/* =========================================================================
   Module Tâches — MODÈLES (Lot D) : styles
   -------------------------------------------------------------------------
   Tout est préfixé `.tkm-` pour ne jamais entrer en collision avec
   tablette.css ni taches-core.css. On n'utilise QUE les variables de
   tablette.css (--card, --txt, --txt2, --sep, --blue, --red, --green…) :
   le mode sombre suit donc automatiquement.
   ========================================================================= */

/* ------------------------------ en-têtes -------------------------------- */
.tkm-h2 { margin-bottom: 4px; }
.tkm-intro {
  font-size: 14px; color: var(--txt2); line-height: 1.45;
  margin: -2px 0 14px;
}
.tkm-bar { gap: 8px; margin-bottom: 12px; }
.tkm-bar .tk-in { font-size: 15px; }

/* ------------------------------ liste ----------------------------------- */
.tkm-liste { display: flex; flex-direction: column; gap: 12px; }

.tkm-carte {
  background: var(--card); border-radius: 16px; padding: 13px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
  border-left: 3px solid transparent;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.tkm-carte:hover { box-shadow: 0 3px 12px rgba(0, 0, 0, .1); }
.tkm-carte.err { border-left-color: var(--red); }

.tkm-tete { display: flex; align-items: flex-start; gap: 11px; }
.tkm-ic { font-size: 24px; line-height: 1.1; flex: 0 0 auto; }
.tkm-tt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tkm-tt b { font-size: 16px; font-weight: 600; color: var(--txt); overflow-wrap: anywhere; }
.tkm-desc { font-size: 13px; color: var(--txt2); line-height: 1.4; }

.tkm-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 2px; }
.tkm-pill {
  display: inline-block; padding: 2px 9px; border-radius: 9px;
  font-size: 12px; font-weight: 600; color: var(--txt2);
  background: var(--fill);
}

.tkm-det {
  margin-top: 8px; padding: 3px 0; font-size: 13px; font-weight: 600;
  color: var(--blue); background: none; text-align: left;
}
.tkm-detbox { display: none; margin-top: 6px; }
.tkm-detbox.on { display: block; animation: tkm-in .18s ease; }
@keyframes tkm-in { from { opacity: 0; transform: translateY(-4px); } }

.tkm-etape {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 2px; font-size: 14px; color: var(--txt);
  border-bottom: 1px solid var(--sep);
}
.tkm-etape:last-child { border-bottom: 0; }
.tkm-etape .grow { min-width: 0; overflow-wrap: anywhere; }
.tkm-num {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--txt2);
  background: var(--fill);
}
.tkm-mini { font-size: 12px; color: var(--txt2); white-space: nowrap; }
.tkm-off {
  flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.tkm-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px;
}
.tkm-actions .btn { padding: 8px 13px; font-size: 14px; }
.tkm-auteur { margin-top: 8px; font-size: 11px; color: var(--txt2); }

/* --------------------------- suggestions -------------------------------- */
.tkm-sugs {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--sep);
}
.tkm-sugs > h3 {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--txt2); margin-bottom: 4px;
}
.tkm-sug {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 8px; border-radius: 13px;
  background: var(--card); cursor: pointer;
  transition: background .18s ease;
}
.tkm-sug:hover { background: rgba(0, 122, 255, .07); }
.tkm-sug input[type="checkbox"] { width: auto; accent-color: var(--blue); }
.tkm-sug .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tkm-sug b { font-size: 15px; font-weight: 600; }

/* ============================== ÉDITEUR ================================== */
.tkm-edit .tk-sec:first-of-type { border-top: 0; padding-top: 4px; }

.tkm-nom { display: flex; align-items: center; gap: 8px; }
.tkm-icon {
  width: 54px; flex: 0 0 auto; text-align: center; font-size: 22px !important;
  border: 0; background: var(--card); border-radius: 12px; padding: 10px 4px;
  box-shadow: inset 0 0 0 1px var(--sep); color: var(--txt);
}
.tkm-descin { margin-top: 8px; width: 100%; }

.tkm-hint {
  font-size: 12px; color: var(--txt2); margin: 4px 0 2px; line-height: 1.5;
}
.tkm-hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; background: var(--fill);
  padding: 1px 5px; border-radius: 6px;
}

/* --- échéances relatives --- */
.tkm-off-box { margin-top: 6px; }
.tkm-offs { display: flex; gap: 10px; flex-wrap: wrap; }
.tkm-off1 { flex: 1 1 110px; min-width: 100px; }
.tkm-off1 label { margin-top: 0 !important; }
.tkm-jplus {
  display: flex; align-items: center; gap: 4px;
  background: var(--card); border-radius: 12px; padding: 2px 4px 2px 10px;
  box-shadow: inset 0 0 0 1px var(--sep);
}
.tkm-jplus > span {
  font-size: 13px; font-weight: 700; color: var(--txt2); flex: 0 0 auto;
}
.tkm-jplus input {
  border: 0 !important; background: transparent !important;
  box-shadow: none !important; padding: 9px 4px !important;
  width: 100%; min-width: 40px; font-variant-numeric: tabular-nums;
}
.tkm-jplus.sm { flex: 0 0 auto; padding: 0 2px 0 7px; }
.tkm-jplus.sm > span { font-size: 11px; }
.tkm-jplus.sm input { padding: 6px 2px !important; width: 46px; font-size: 14px; }

/* --- checklist du modèle --- */
.tkm-cl { display: flex; flex-direction: column; gap: 6px; }
.tkm-cli {
  display: flex; align-items: center; gap: 6px;
  padding: 4px; border-radius: 12px;
  background: var(--fill-3);
  transition: background .18s ease, opacity .18s ease, transform .12s ease;
}
.tkm-cli .tk-in { font-size: 15px; padding: 8px 11px; min-width: 0; }
.tkm-cli.drag { opacity: .45; }
.tkm-cli.over { background: rgba(0, 122, 255, .16); transform: translateY(1px); }
.tkm-grip {
  flex: 0 0 auto; padding: 0 3px; color: var(--txt2);
  font-size: 15px; cursor: grab; user-select: none;
}
.tkm-grip:active { cursor: grabbing; }

/* --- sous-tâches --- */
.tkm-st {
  border-radius: 14px; background: var(--fill-3);
  padding: 9px 10px; margin-bottom: 10px;
}
.tkm-st-tete { display: flex; align-items: center; gap: 7px; }
.tkm-st-tete .tk-in { font-size: 15px; padding: 8px 11px; min-width: 0; }
.tkm-st-corps { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.tkm-st-l { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tkm-st-l select {
  flex: 1 1 140px; min-width: 120px; font-size: 14px !important;
  padding: 8px 10px !important;
}
.tkm-st-l .tk-switch { margin-top: 0; white-space: nowrap; }

.tkm-deps { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.tkm-deps-lb { font-size: 12px; font-weight: 600; color: var(--txt2); }
.tk-mchip.sm {
  padding: 4px 9px; font-size: 12px; border-radius: 9px; max-width: 190px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tkm-stcl {
  min-height: 60px; font-size: 14px !important; line-height: 1.5;
}

/* ============================== APERÇU =================================== */
.tkm-appform { margin-bottom: 6px; }
.tkm-prev {
  margin-top: 6px; background: var(--card); border-radius: 16px;
  padding: 10px 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.tkm-prev-tt {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--txt2);
  padding-bottom: 8px; border-bottom: 1px solid var(--sep); margin-bottom: 4px;
}
.tkm-prev-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid var(--sep);
}
.tkm-prev-row:last-child { border-bottom: 0; }
.tkm-prev-row .grow { min-width: 0; }
.tkm-prev-row.principal .tkm-num { background: var(--blue); color: #fff; }
.tkm-prev-t {
  font-size: 15px; font-weight: 600; color: var(--txt); overflow-wrap: anywhere;
}
.tkm-prev-m { font-size: 12.5px; color: var(--txt2); margin-top: 2px; }
.tkm-prev-m i { opacity: .7; font-style: normal; }
.tkm-prev-cl {
  display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px;
  font-size: 12px; color: var(--txt2);
}

/* -------------------------- panneau de config --------------------------- */
.tkm-cfliste { display: flex; flex-direction: column; }
.tkm-cfliste .tkm-ic { font-size: 18px; }

/* ------------------------------ responsive ------------------------------ */
@media (max-width: 699px) {
  .tkm-bar { flex-wrap: wrap; }
  .tkm-bar .btn { width: 100%; }
  .tkm-actions .btn { flex: 1 1 auto; }
  .tkm-cli { flex-wrap: wrap; }
  .tkm-cli .tk-in { flex: 1 1 100%; order: -1; }
  .tkm-st-l select { flex: 1 1 100%; }
  .tk-mchip.sm { max-width: 130px; }
  .tkm-offs { gap: 8px; }
  .tkm-off1 { flex: 1 1 90px; min-width: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  .tkm-carte, .tkm-cli, .tkm-sug, .tkm-detbox.on { transition: none; animation: none; }
}
