/* ==========================================================================
   MoveFlow – Aufgaben
   ========================================================================== */

/* Kennzahlen */
.tsk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tsk-stat { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); min-width: 0; }
.tsk-stat__icon { width: 38px; height: 38px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--c-surface-3); color: var(--c-text-2); flex-shrink: 0; }
.tsk-stat__icon svg { width: 18px; height: 18px; }
.tsk-stat__body { display: flex; flex-direction: column; min-width: 0; }
.tsk-stat__value { font-size: 22px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tsk-stat__label { font-size: 12.5px; color: var(--c-text-3); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsk-stat__sub { position: absolute; top: 12px; right: 12px; font-size: 11.5px; font-weight: 600; color: var(--c-text-3); background: var(--c-surface-3); padding: 2px 8px; border-radius: var(--r-full); white-space: nowrap; }
.tsk-stat--blue .tsk-stat__icon { background: var(--c-blue-bg); color: var(--c-blue); }
.tsk-stat--red .tsk-stat__icon { background: var(--c-red-bg); color: var(--c-red); }
.tsk-stat--red .tsk-stat__value { color: var(--c-red-text); }
.tsk-stat--green .tsk-stat__icon { background: var(--c-green-bg); color: var(--c-green); }

/* Schnelleingabe */
.tsk-qa { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; margin-bottom: 14px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); transition: border-color var(--t), box-shadow var(--t); }
.tsk-qa:focus-within { border-color: var(--c-primary); box-shadow: var(--ring); }
.tsk-qa__icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--c-primary-50); color: var(--c-primary); flex-shrink: 0; }
.tsk-qa__icon svg { width: 14px; height: 14px; stroke-width: 2.4; }
.tsk-qa__input { flex: 1; min-width: 0; height: 36px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--c-text); }
.tsk-qa__input::placeholder { color: var(--c-text-4); }
.tsk-qa__picks { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.tsk-qa__pick { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--c-text-2); font: inherit; font-size: 12.5px; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background var(--t-fast), border-color var(--t-fast); }
.tsk-qa__pick:hover { background: var(--c-hover); border-color: var(--c-border); }
.tsk-qa__pick > svg { width: 14px; height: 14px; color: var(--c-text-3); }
.tsk-qa__picks .btn { margin-left: 4px; }

/* Toolbar & Prioritäts-Chips */
.tsk-toolbar { margin-bottom: 10px; }
.tsk-prios { margin-bottom: 18px; }
.tsk-content { display: flex; flex-direction: column; gap: 18px; }

/* Gruppen */
.tsk-group { display: flex; flex-direction: column; gap: 8px; }
.tsk-group__head { display: flex; align-items: center; gap: 8px; padding: 0 4px; min-height: 28px; }
.tsk-group__title { margin: 0; font-size: 13.5px; font-weight: 650; letter-spacing: -0.005em; }
.tsk-group__count { font-size: 11.5px; font-weight: 650; color: var(--c-text-3); background: var(--c-surface-3); padding: 1px 7px; border-radius: var(--r-full); font-variant-numeric: tabular-nums; }
.tsk-group__range { font-size: 12px; color: var(--c-text-3); }
.tsk-group[data-group="overdue"] .tsk-group__title { color: var(--c-red-text); }
.tsk-group[data-group="overdue"] .tsk-group__count { background: var(--c-red-bg); color: var(--c-red-text); }
.tsk-group__toggle { width: 100%; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: var(--r-sm); padding: 4px; }
.tsk-group__toggle:hover { background: var(--c-hover); }
.tsk-group__chev { width: 15px; height: 15px; color: var(--c-text-3); transition: transform var(--t); }
.tsk-group--done.is-open .tsk-group__chev { transform: rotate(90deg); }
.tsk-group--done .tsk-group__title { color: var(--c-text-2); }

/* Liste & Zeilen */
.tsk-list { padding: 0; overflow: hidden; }
.tsk-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 16px; border-bottom: 1px solid var(--c-border); cursor: pointer; transition: background var(--t-fast), opacity var(--t); }
.tsk-row:last-child { border-bottom: 0; }
.tsk-row:hover { background: var(--c-hover); }
.tsk-row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.tsk-row.prio-dringend::before { background: var(--c-red); }
.tsk-row.prio-hoch::before { background: var(--c-orange); }
.tsk-row.is-done::before { background: transparent; }
.tsk-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tsk-row__title { font-size: 14px; font-weight: 550; color: var(--c-text); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsk-row__title .badge { vertical-align: 1px; margin-left: 4px; }
.tsk-row__desc { font-size: 12.5px; color: var(--c-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsk-row__side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tsk-row.is-done .tsk-row__title { color: var(--c-text-3); text-decoration: line-through; text-decoration-color: var(--c-border-3); }
.tsk-row.is-done .tsk-row__prio { display: none; }
.tsk-row.is-completing { opacity: .55; }
.tsk-row.is-completing .tsk-check { background: var(--c-green); border-color: var(--c-green); color: #fff; transform: scale(1.1); }
.tsk-row.is-reopening { opacity: .6; }

/* Checkbox */
.tsk-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--c-border-3); background: var(--c-surface); color: transparent; display: grid; place-items: center; flex-shrink: 0; cursor: pointer; padding: 0; transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast), transform var(--t); }
.tsk-check svg { width: 12px; height: 12px; stroke-width: 3; }
.tsk-check:hover { border-color: var(--c-green); color: var(--c-green); }
.tsk-check.is-progress { border-color: var(--c-blue); background: conic-gradient(var(--c-blue-bg) 0 50%, var(--c-surface) 0); }
.is-done .tsk-check { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.is-done .tsk-check:hover { background: var(--c-surface); color: var(--c-text-3); border-color: var(--c-border-3); }

/* Fälligkeit */
.tsk-due { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 550; color: var(--c-text-2); white-space: nowrap; min-width: 88px; }
.tsk-due svg { width: 14px; height: 14px; color: var(--c-text-3); flex-shrink: 0; }
.tsk-due.is-today { color: var(--c-blue-text); }
.tsk-due.is-today svg { color: var(--c-blue); }
.tsk-due.is-overdue { color: var(--c-red-text); font-weight: 650; }
.tsk-due.is-overdue svg { color: var(--c-red); }
.tsk-due.is-none { color: var(--c-text-4); }
.tsk-due.is-done { color: var(--c-green-text); }
.tsk-due.is-done svg { color: var(--c-green); }

/* Zuständig / Bezug / Menü */
.tsk-noassignee { width: 28px; height: 28px; border-radius: 50%; border: 1.5px dashed var(--c-border-3); display: grid; place-items: center; color: var(--c-text-4); flex-shrink: 0; }
.tsk-noassignee svg { width: 13px; height: 13px; }
.tsk-rel { display: inline-flex; align-items: center; gap: 5px; max-width: 230px; height: 24px; padding: 0 8px; border-radius: var(--r-full); background: var(--c-surface-3); border: 1px solid var(--c-border); color: var(--c-text-2); font-size: 12px; font-weight: 550; white-space: nowrap; transition: border-color var(--t-fast), color var(--t-fast); }
.tsk-rel svg { width: 12px; height: 12px; color: var(--c-text-3); flex-shrink: 0; }
.tsk-rel span { overflow: hidden; text-overflow: ellipsis; }
a.tsk-rel:hover { border-color: var(--c-primary-200); color: var(--c-primary-700); }
a.tsk-rel:hover svg { color: var(--c-primary); }
.tsk-more { opacity: .55; transition: opacity var(--t-fast); }
.tsk-row:hover .tsk-more, .tsk-card:hover .tsk-more, .tsk-more:focus-visible { opacity: 1; }
.tsk-group__add { opacity: .7; }
.tsk-group__add:hover { opacity: 1; }
.tsk-allclear { padding: 12px; }

/* Board */
.tsk-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.tsk-col { display: flex; flex-direction: column; background: var(--c-surface-3); border: 1px solid var(--c-border); border-radius: var(--r-lg); min-height: 320px; transition: background var(--t-fast), border-color var(--t-fast); }
.tsk-col.is-over { background: var(--c-primary-50); border-color: var(--c-primary-200); box-shadow: inset 0 0 0 1px var(--c-primary-200); }
.tsk-col__head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 14px; }
.tsk-col__title { font-size: 13.5px; font-weight: 650; }
.tsk-col__count { font-size: 11.5px; font-weight: 650; color: var(--c-text-3); background: var(--c-surface); padding: 1px 7px; border-radius: var(--r-full); }
.tsk-col__head .icon-btn, .tsk-col__hint { margin-left: auto; }
.tsk-col__hint { font-size: 11.5px; color: var(--c-text-3); }
.tsk-col__body { display: flex; flex-direction: column; gap: 8px; padding: 4px 10px 12px; flex: 1; }
.tsk-col__empty { flex: 1; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1.5px dashed var(--c-border-2); border-radius: var(--r-md); color: var(--c-text-4); font-size: 12.5px; }
.tsk-col__empty svg { width: 20px; height: 20px; }

.tsk-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md); box-shadow: var(--shadow-xs); cursor: grab; transition: box-shadow var(--t), border-color var(--t), opacity var(--t); }
.tsk-card:hover { box-shadow: var(--shadow-md); border-color: var(--c-border-2); }
.tsk-card.is-dragging { opacity: .45; cursor: grabbing; }
.tsk-card.prio-dringend { box-shadow: inset 3px 0 0 var(--c-red), var(--shadow-xs); }
.tsk-card.prio-hoch { box-shadow: inset 3px 0 0 var(--c-orange), var(--shadow-xs); }
.tsk-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tsk-card__title { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.tsk-card__title .tsk-check { width: 20px; height: 20px; margin-top: 0; }
.tsk-card.is-done .tsk-card__title span { color: var(--c-text-3); text-decoration: line-through; }
.tsk-card__desc { font-size: 12.5px; color: var(--c-text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tsk-card .tsk-rel { align-self: flex-start; max-width: 100%; }
.tsk-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--c-border); }
.tsk-card__foot .tsk-due { min-width: 0; }

/* Formular */
.tsk-prio-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tsk-prio-opt { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; height: 38px; border: 1px solid var(--c-border-2); border-radius: var(--r-sm); font-size: 13px; font-weight: 550; color: var(--c-text-2); cursor: pointer; background: var(--c-surface); transition: border-color var(--t-fast), background var(--t-fast); }
.tsk-prio-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tsk-prio-opt:hover { background: var(--c-hover); }
.tsk-prio-opt:has(input:checked) { border-color: var(--c-primary); background: var(--c-primary-50); color: var(--c-text); box-shadow: 0 0 0 1px var(--c-primary); }
.tsk-prio-opt--red:has(input:checked) { border-color: var(--c-red); background: var(--c-red-bg); box-shadow: 0 0 0 1px var(--c-red); }
.tsk-prio-opt--orange:has(input:checked) { border-color: var(--c-orange); background: var(--c-orange-bg); box-shadow: 0 0 0 1px var(--c-orange); }
.tsk-prio-opt--gray:has(input:checked) { border-color: var(--c-text-3); background: var(--c-surface-3); box-shadow: 0 0 0 1px var(--c-text-3); }
.tsk-prio-opt:focus-within { box-shadow: var(--ring); }
.tsk-due-chips { margin-top: 8px; gap: 6px; }
.tsk-due-chips .chip { height: 26px; font-size: 12px; padding: 0 9px; }

/* Responsiv */
@media (max-width: 1180px) {
  .tsk-row__desc { display: none; }
  .tsk-rel { max-width: 170px; }
}
@media (max-width: 1024px) {
  .tsk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tsk-board { grid-template-columns: minmax(0, 1fr); }
  .tsk-col { min-height: 0; }
}
@media (max-width: 680px) {
  .tsk-stats { gap: 8px; }
  .tsk-stat { padding: 12px; gap: 10px; }
  .tsk-stat__icon { width: 32px; height: 32px; }
  .tsk-stat__sub { display: none; }
  .tsk-qa { flex-wrap: wrap; padding: 8px 10px; }
  .tsk-qa__input { flex-basis: calc(100% - 40px); }
  .tsk-qa__picks { width: 100%; overflow-x: auto; padding-top: 6px; border-top: 1px solid var(--c-border); }
  .tsk-qa__picks .btn { margin-left: auto; padding: 0 10px; }
  .tsk-qa__picks .btn span { display: none; }
  .tsk-row { flex-wrap: wrap; align-items: flex-start; padding: 12px 12px 12px 14px; gap: 10px; }
  .tsk-row__main { flex-basis: calc(100% - 34px); }
  .tsk-row__title { white-space: normal; }
  .tsk-row__side { width: 100%; padding-left: 32px; gap: 8px; flex-wrap: wrap; }
  .tsk-row__side .tsk-more { margin-left: auto; }
  .tsk-rel { max-width: 100%; }
  .tsk-due { min-width: 0; }
  .tsk-prio-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
