/* Tâches : ajout rapide, liste, kanban, édition */

/* Ajout rapide */
.quick-add { position: relative; margin-bottom: var(--sp-2); flex: none; }
.quick-add > svg.icon { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--ardoise); pointer-events: none; }
.quick-add .field { padding-left: 32px; padding-right: 36px; }
.quick-add .kbd-hint { position: absolute; right: 7px; top: 7px; }
.quick-add .field:focus ~ .kbd-hint { display: none; }
.qa-preview { display: none; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.qa-preview.on { display: flex; }
.pill.prio { background: var(--ambre-doux); }

/* Tâche dans une liste */
.task { display: flex; align-items: flex-start; gap: var(--sp-3); padding: 9px 0; position: relative; }
.task .check { flex: none; display: grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; color: var(--ardoise); border-radius: 50%; }
.task .check svg { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.task .check .tick { stroke: var(--surface); stroke-width: 2; visibility: hidden; }
.task .check:hover { color: var(--graphite); }
.task.done .check { color: var(--succes); }
.task.done .check circle { fill: var(--succes); }
.task.done .check .tick { visibility: visible; }
.task .source-mark { border-radius: 4px; }
.task .source-mark svg.icon { width: 18px; height: 18px; }
.task .t-body { min-width: 0; flex: 1; display: block; background: var(--surface); }
.task .t-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s; }
.task .t-title:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--trait); }
.task.done .t-title { color: var(--ardoise); text-decoration: line-through; }
.t-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 12px; color: var(--ardoise); }
.t-meta .due.late { color: var(--erreur); }
.t-meta .prio { color: var(--graphite); }
.t-meta .prio.urgent { color: var(--erreur); font-weight: 500; }
.t-meta .src { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.t-meta .tag, .t-meta .proj { max-width: 100%; overflow-wrap: anywhere; }
.t-meta .proj::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--c); margin-right: 5px; }
svg.icon.tiny { width: 12px; height: 12px; }
.mini-btn { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-ctrl); color: var(--ardoise); flex: none; }
.mini-btn:hover { background: var(--surface-2); color: var(--graphite); }
.mini-btn svg.icon { width: 15px; height: 15px; }
.task-list.card { padding: var(--sp-1) var(--sp-5); }

/* Page */
.tasks-page { margin-top: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); }
.tasks-page > .quick-add { max-width: 640px; margin-bottom: 0; }
.tasks-page > .quick-add .field { height: 40px; font-size: 15px; }
.tasks-page > .quick-add > svg.icon { top: 12px; }
.tasks-page > .quick-add .kbd-hint { top: 9px; }
.filters { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center; }
.filters-sep { width: 1px; height: 18px; background: var(--trait); margin: 0 var(--sp-2); }
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--trait); font-size: 12px; color: var(--ardoise); white-space: nowrap; transition: background-color .15s, color .15s, border-color .15s; }
.chip:hover { color: var(--graphite); }
.chip[aria-pressed="true"] { background: var(--graphite); border-color: var(--graphite); color: var(--surface); }
.empty-state p + p { margin-top: 4px; }

/* Listes de tâches */
.lists { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center; }
.list-chip { gap: 6px; height: 30px; font-size: 13px; cursor: pointer; list-style: none; max-width: 100%; min-width: 0; }
.list-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-chip::-webkit-details-marker { display: none; }
.list-chip svg.icon { width: 13px; height: 13px; }
.list-dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--c); flex: none; }
.list-count { font-size: 11px; opacity: .7; }
.lists details { position: relative; }
.lists details[open] > summary { color: var(--graphite); border-color: var(--ardoise); }
.list-form { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 300px; padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); box-shadow: 0 16px 40px -18px rgb(0 0 0 / .35); }
.list-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.list-colors .btn { margin-left: auto; }
.list-color { position: relative; display: grid; place-items: center; width: 22px; height: 22px; cursor: pointer; }
.list-color input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.list-color i { width: 16px; height: 16px; border-radius: 5px; background: var(--c); }
.list-color input:checked + i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.list-color input:focus-visible + i { outline: 2px solid var(--graphite); outline-offset: 3px; }
.list-menu { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 200px; padding: 4px; display: flex; flex-direction: column; }
.list-menu-item { padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.list-menu-item:hover { background: var(--surface-2); }
.list-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); padding-bottom: var(--sp-1); }
.list-title { display: flex; align-items: center; gap: var(--sp-2); font: 600 20px/1.2 var(--f-titre); flex: 1 1 280px; min-width: 0; overflow-wrap: anywhere; }
.list-title .list-dot { width: 12px; height: 12px; border-radius: 4px; }
.list-actions { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center; }
.list-actions > form { display: contents; }
.list-actions details { position: relative; }
.list-actions summary { list-style: none; }
.list-actions summary::-webkit-details-marker { display: none; }
.list-actions .list-form { left: auto; right: 0; }
@media (max-width: 767px) { .list-form { position: fixed; left: 16px; right: 16px; top: auto; width: auto; } .list-actions .list-form { left: 16px; right: 16px; } }
.empty-state a { color: var(--prusse); }

/* Sélecteur Liste / Kanban */
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--trait); border-radius: 8px; background: var(--surface); }
.seg a { padding: 5px 12px; border-radius: 6px; font-size: 13px; color: var(--ardoise); }
.seg a[aria-current="page"] { background: var(--graphite); color: var(--surface); }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; }
.k-col { background: var(--surface-2); border-radius: var(--r-widget); padding: var(--sp-3); min-height: 200px; transition: box-shadow .15s; }
.k-col.drop-target { box-shadow: inset 0 0 0 1.5px var(--ardoise); }
.k-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-2); padding: 2px 4px var(--sp-3); }
.k-list { display: flex; flex-direction: column; gap: var(--sp-2); min-height: 40px; }
.k-list > li + li { border-top: 0; }
.k-card { background: var(--surface); border: 1px solid var(--trait); border-radius: 8px; padding: 10px 12px; cursor: grab; }
.k-card.external { cursor: default; }
.k-card.dragging { opacity: .4; }
.k-card.done .k-title { color: var(--ardoise); text-decoration: line-through; }
.k-head .w-title { min-width: 0; overflow-wrap: anywhere; white-space: normal; line-height: 1.3; }
.k-col, .tcol { min-width: 0; }
.k-title { display: block; overflow-wrap: anywhere; font-weight: 500; margin-bottom: 4px; }
.k-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.k-empty { padding: var(--sp-2) 4px; }

/* Édition */
.task-form { max-width: 720px; margin-top: var(--sp-5); position: relative; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); margin-top: var(--sp-4); }
.form-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-5); }
.field.area { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.delete-task { margin-top: var(--sp-4); margin-left: auto; width: max-content; } /* sous les fiches du cerveau, jamais par-dessus */

/* Réglages Trello */
.help { padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); border-radius: var(--r-ctrl); background: var(--surface-2); font-size: 13px; }
.help ol { margin: 6px 0; padding-left: 20px; }
.help li + li { margin-top: 4px; }
.help a { color: var(--prusse); text-decoration: underline; text-underline-offset: 2px; }
.help a[aria-disabled="true"] { color: var(--ardoise); pointer-events: none; text-decoration: none; }
.boards { border: 0; padding: 0; margin: 0 0 var(--sp-4); }
.board-option { display: flex; align-items: center; gap: var(--sp-3); padding: 10px 0; }
.board-option .grow { flex: 1; min-width: 0; cursor: pointer; }
.switch-row { display: flex; align-items: center; gap: var(--sp-2); font-size: 14px; }
.err-text { color: var(--erreur); }
.rows .sub a { color: var(--prusse); }

@media (max-width: 1179px) {
  .kanban { grid-template-columns: repeat(3, minmax(240px, 1fr)); overflow-x: auto; padding-bottom: var(--sp-2); scroll-snap-type: x mandatory; }
  .k-col { scroll-snap-align: start; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .quick-add .kbd-hint { display: none; }
  .tasks-page > .quick-add .field { font-size: 16px; } /* évite le zoom iOS */
  .task-list.card { padding: var(--sp-1) var(--sp-4); }
  .kanban { grid-template-columns: repeat(3, 82%); margin: 0 calc(var(--sp-4) * -1); padding: 0 var(--sp-4) var(--sp-2); }
  .form-grid { grid-template-columns: 1fr; }
  .delete-task { position: static; margin-top: var(--sp-3); }
  .seg a { padding: 5px 10px; }
}

/* Onglets Mes tâches / Trello */
.screens { display: flex; gap: var(--sp-5); margin-top: var(--sp-5); border-bottom: 1px solid var(--trait); }
.screens a { display: inline-flex; align-items: center; gap: 6px; padding: 0 2px 10px; margin-bottom: -1px; font-size: 14px; color: var(--ardoise); border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.screens a:hover { color: var(--graphite); }
.screens a[aria-current="page"] { color: var(--graphite); font-weight: 500; border-bottom-color: var(--graphite); }
.screens svg.icon { width: 15px; height: 15px; }

/* Écran Trello : colonnes comme dans Trello, défilement horizontal */
.tboard + .tboard { margin-top: var(--sp-6); }
.tboard-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-3); }
.tboard-head .w-title { font-size: 17px; }
.tboard-sync { margin-left: auto; font-size: 12px; }
.tboard-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 280px); gap: var(--sp-3); overflow-x: auto; padding-bottom: var(--sp-3); scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--trait) transparent; }
.tboard-cols { align-items: start; cursor: grab; overscroll-behavior-x: contain; scrollbar-width: auto; }
.tboard-cols.panning { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.tboard-cols.panning a { pointer-events: none; }
.tboard-scroll { display: inline-flex; gap: 4px; }
.tboard-scroll .mini-btn { width: 30px; height: 30px; }
@media (max-width: 767px) { .tboard-scroll { display: none; } }
.tcol { scroll-snap-align: start; min-height: 120px; }
.tcol.done { opacity: .7; }
.tcol:target { box-shadow: inset 0 0 0 1.5px var(--prusse); }
.tcol-mine { display: inline-block; margin: 0 4px var(--sp-2); }
.tboard-note { font-size: 13px; }
.tboard-note a { color: var(--prusse); }
@media (max-width: 767px) {
  .tboard-cols { grid-auto-columns: 82%; }
  .tboard-sync { margin-left: 0; }
}

/* Suggestions de tâches (tri IA des mails) */
.suggestion { display: flex; align-items: center; gap: var(--sp-2); padding: 8px 4px; }
.sg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sg-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; color: inherit; cursor: pointer; max-width: 100%; }
.sg-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.sg-pop-meta { font-size: 13px; color: var(--ardoise); margin-bottom: var(--sp-3); }
.sg-pop-mail { display: flex; flex-direction: column; gap: 4px; padding: var(--sp-3); margin-bottom: var(--sp-3); border-radius: var(--r-ctrl); background: var(--surface-2); font-size: 13px; overflow-wrap: anywhere; }
.sg-pop-subject { font-weight: 500; }
.sg-pop .ev-pop-actions form { display: contents; }
.sg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--ardoise); }
.sg-from { color: var(--ardoise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.sg-from:hover { color: var(--graphite); text-decoration: underline; text-underline-offset: 3px; }
.sg-actions { display: flex; gap: 2px; flex: none; }
.sg-actions form { display: contents; }
.sg-accept:hover { color: var(--succes); }
.suggestion-list.card { padding: 0 var(--sp-3); }
.tw-suggestions { margin-bottom: var(--sp-3); padding: 6px 8px; border-radius: var(--r-ctrl); background: color-mix(in oklab, var(--ambre-doux) 55%, transparent); }
.sg-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--ardoise); padding: 0 4px; }
.tw-suggestions .suggestion { padding: 6px 4px; }
.tw-suggestions .sg-title { font-size: 13px; }
/* Tâche pour une semaine (sans jour précis), et projet affiché aussi dans les listes compactes (widget) */
.t-meta .due.week { font-style: normal; border: 1px dashed currentColor; border-radius: 6px; padding: 0 5px; }
.t-meta .proj.compact { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tâche tirée d'un mail : lien vers le mail d'origine (liste et page de la tâche) */
.t-meta .t-mail { display: inline-flex; align-items: center; color: var(--ardoise); }
.t-meta .t-mail:hover { color: var(--graphite); }
.task-source-mail { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-4); padding: 10px 12px; border-radius: var(--r-ctrl); background: var(--surface-2); font-size: 13px; }
.task-source-mail > span { flex: 1 1 240px; min-width: 0; }

/* Recherche dans les tâches (sans IA) */
.tasks-search { margin: var(--sp-3) 0 var(--sp-2); max-width: none; }
.tasks-search-info { font-size: 13px; margin-bottom: var(--sp-2); }

/* Fiche d'une tâche en fenêtre (clic sur une tâche) : verre, comme la barre de commande */
.task-modal {
  width: min(520px, calc(100vw - 32px)); margin: 14vh auto auto; padding: 0; border: 1px solid var(--glass-line); border-radius: 18px;
  color: var(--graphite); background: color-mix(in oklab, var(--surface) 95%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 24px 60px -20px rgb(0 0 0 / .45);
}
.task-modal::backdrop { background: rgb(0 0 0 / .28); }
.task-detail { padding: var(--sp-5); display: grid; gap: var(--sp-3); }
.td-head { position: relative; padding-right: 36px; }
.td-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 500 11.5px/1.3 var(--f-donnees); color: var(--ardoise); text-transform: uppercase; letter-spacing: .04em; }
.td-kicker .proj { text-transform: none; letter-spacing: 0; }
.td-head h2 { margin-top: 6px; font: 600 20px/1.25 var(--f-titre); overflow-wrap: anywhere; }
.td-head h2.is-done { text-decoration: line-through; color: var(--ardoise); }
.td-close { position: absolute; top: -4px; right: -4px; }
.td-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.td-notes { max-height: 40vh; overflow-y: auto; padding: 10px 12px; border-radius: var(--r-ctrl); background: var(--surface-2); }
.td-source { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--ardoise); }
.td-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--trait); }
.td-actions form { display: inline-flex; }

/* Revue de la semaine (lundi) : étapes, tâches en retard à trancher, priorités */
.review-page { max-width: 920px; margin: var(--sp-5) auto var(--sp-7); padding: 0 var(--sp-4); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
.review-setup p { margin: 0 0 var(--sp-3); }
.review-setup-form { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.review-setup-form .field { max-width: 360px; }
.review-steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-2); }
.review-steps a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-ctrl); color: var(--ardoise); text-decoration: none; font-size: 13px; border: 1px solid var(--trait); background: var(--surface); }
.review-steps .current a { color: var(--graphite); border-color: var(--graphite); font-weight: 600; }
.review-steps .passed a { color: var(--graphite); }
.review-step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); font: 600 12px/1 var(--f-donnees); flex: none; }
.review-steps .current .review-step-n { background: var(--graphite); color: var(--surface); }
.review-step-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-step { padding: var(--sp-5) var(--sp-6); display: grid; gap: var(--sp-3); }
.review-step h2 { font: 600 20px/1.3 var(--f-titre); margin: 0; }
.review-step h3 { font: 600 14px/1.3 var(--f-titre); margin: 0 0 var(--sp-2); }
.review-step > .muted { margin: 0; }
.review-tasks, .review-counts, .review-events, .review-week-tasks, .review-priorities ul { list-style: none; margin: 0; padding: 0; }
.review-tasks > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); padding: 10px 0; border-bottom: 1px solid var(--trait); }
.review-task-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; }
.review-task-title > a { color: inherit; text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.review-task-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.review-task-actions form { display: contents; }
.review-task-actions .btn { height: 30px; padding: 0 10px; font-size: 13px; }
.review-counts li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--trait); max-width: 420px; }
.review-week { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
.review-events > li { margin-bottom: var(--sp-2); }
.review-events ul { list-style: none; margin: 4px 0 0; padding: 0 0 0 var(--sp-3); font-size: 14px; display: grid; gap: 2px; }
.review-week-tasks li { padding: 4px 0; font-size: 14px; border-bottom: 1px solid var(--trait); }
.review-priorities { display: grid; gap: var(--sp-3); }
.review-priorities li { padding: 6px 0; border-bottom: 1px solid var(--trait); }
.review-priorities .btn { justify-self: start; }
.review-nav { display: flex; justify-content: space-between; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--trait); }
.review-nav .btn.primary:only-child { margin-left: auto; }
@media (max-width: 767px) {
  .review-steps ol { display: flex; flex-wrap: wrap; }
  .review-page { padding: 0; margin-top: var(--sp-4); }
  .review-step-label { display: none; }
  .review-steps .current .review-step-label { display: inline; }
  .review-week { grid-template-columns: 1fr; }
  .review-step { padding: var(--sp-4); }
}

/* Priorités de la semaine, sur l'accueil (choisies pendant la revue du lundi) */
.week-priorities { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--sp-3); margin: var(--sp-2) 0 0; font-size: 14px; }
.week-priorities ol { display: contents; list-style: none; }
.week-priorities li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); }
.week-priorities li.done { text-decoration: line-through; color: var(--ardoise); }
.week-priorities li a { color: inherit; text-decoration: none; }
