/* ---------- Tarefas (prefixo tf-) ---------- */

/* Topo: progresso do dia + indicadores */
.tf-top { display: grid; grid-template-columns: 1.8fr repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.tf-day { display: flex; align-items: center; gap: 18px; padding: 16px 20px; overflow: hidden; }
.tf-day::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(120% 140% at 0% 0%, rgba(225, 6, 0, .18), transparent 55%); }
.tf-day.complete::before { background: radial-gradient(120% 140% at 0% 0%, rgba(52, 209, 127, .2), transparent 55%); }
.tf-ring { --p: 0; position: relative; width: 84px; height: 84px; flex: none; }
.tf-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tf-ring circle { fill: none; stroke-width: 10; }
.tf-ring .bg { stroke: var(--s4); }
.tf-ring .fg { stroke: var(--red); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p)); transition: stroke-dashoffset .9s var(--ease), stroke .4s; filter: drop-shadow(0 0 6px rgba(225, 6, 0, .6)); animation: tf-ring-in 1.2s var(--ease) .2s both; }
@keyframes tf-ring-in { from { stroke-dashoffset: 100; } }
.tf-day.complete .tf-ring .fg { stroke: var(--ok); filter: drop-shadow(0 0 8px rgba(52, 209, 127, .6)); }
.tf-ring__c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.tf-ring__c b { font-size: var(--fs-lg); font-weight: 600; }
.tf-ring__c small { font-size: 10px; color: var(--tx-3); }
.tf-day__txt { position: relative; display: grid; gap: 4px; min-width: 0; flex: 1; }
.tf-day__txt small { font-size: var(--fs-xs); }
.tf-day__txt > b { font-size: var(--fs-lg); font-weight: 600; }
.tf-day__txt > span { font-size: var(--fs-xs); }
.tf-day__bar { height: 6px; border-radius: 6px; background: var(--s4); overflow: hidden; margin: 4px 0 2px; }
.tf-day__bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad-red); transition: width .9s var(--ease); }
.tf-day.complete .tf-day__bar i { background: var(--ok); }
#tf-feitas { display: inline-block; }
.tf-bump { animation: tf-bump .6s var(--ease); }
@keyframes tf-bump { 35% { transform: scale(1.45) translateY(-2px); color: var(--ok); } }
.tf-mini .mini__ic.tf-ic-late { background: var(--crit-soft); color: var(--crit); }
.tf-mini .mini__ic.tf-ic-auto { background: var(--info-soft); color: var(--info); }
.tf-mini b { font-size: var(--fs-xl); }
.tf-mini .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tarefa rápida */
.tf-add { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 14px; border-radius: var(--r-md); transition: border-color var(--t-med), box-shadow var(--t-med); }
.tf-add:focus-within { border-color: var(--red-line); box-shadow: 0 0 0 3px rgba(225, 6, 0, .12), var(--shadow-1); }
.tf-add.focus-pulse { animation: flash 1.2s var(--ease); }
.tf-add__ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-red); color: #fff; box-shadow: 0 6px 18px -8px rgba(225, 6, 0, .9); transition: transform var(--t-med) var(--ease); }
.tf-add__ic svg { width: 18px; height: 18px; }
.tf-add:focus-within .tf-add__ic { transform: rotate(90deg); }
.tf-add.sent .tf-add__ic { animation: tf-sent .6s var(--ease); }
@keyframes tf-sent { 40% { transform: scale(1.25) rotate(180deg); } }
.tf-add__in { height: 40px; min-width: 0; background: none; border: 0; outline: none; font-size: var(--fs-md); }
.tf-add__in::placeholder { color: var(--tx-4); }
.tf-add__prev { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 26px; font-size: var(--fs-xs); padding-bottom: 2px; }
.tf-add__prev b { color: var(--tx-2); font-weight: 500; }
.tf-tok { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 6px; border-radius: var(--r-pill); background: var(--s3); border: 1px solid var(--line-2); color: var(--tx-2); animation: rise .35s var(--ease) both; }
.tf-tok svg { width: 13px; height: 13px; margin-left: 4px; }
.tf-tok .avatar { width: 18px; height: 18px; font-size: 8px; }
.tf-tok.crit { color: var(--crit); background: var(--crit-soft); border-color: rgba(255, 75, 92, .3); }
.tf-tok-enter { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.tf-tok-enter svg { width: 13px; height: 13px; }

/* Barra de filtros */
.tf-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tf-chips button { gap: 7px; padding: 0 8px 0 12px; }
.tf-chips button:first-child { padding-left: 12px; }
.tf-chips button svg { width: 14px; height: 14px; color: var(--tx-3); }
.tf-chips button.on svg { color: var(--red-tx); }
.tf-chips .badge { height: 18px; min-width: 18px; font-size: 10px; }
.tf-chips button.on .badge { background: var(--red); color: #fff; }
.tf-chips .tf-chip-late .badge { background: var(--crit-soft); color: var(--crit); }
.tf-search { width: min(300px, 100%); }
.tf-setores { max-height: 0; overflow: hidden; opacity: 0; margin-bottom: 0; transition: max-height .4s var(--ease), opacity .3s, margin .3s; }
.tf-setores.on { max-height: 120px; opacity: 1; margin-bottom: 12px; }
.tf-setores button { height: 30px; padding: 0 12px !important; }

/* Lista agrupada */
.tf-list { padding: 6px 10px 10px; }
.tf-group + .tf-group { border-top: 1px solid var(--line); }
.tf-group__head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 8px; font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--tx-3); }
.tf-group__head b { font-weight: 500; }
.tf-group__head svg { width: 15px; height: 15px; }
.tf-group__head .badge { height: 18px; min-width: 18px; font-size: 10px; }
.tf-group.late .tf-group__head { color: var(--crit); }
.tf-group.late .tf-group__head .badge { background: var(--crit-soft); color: var(--crit); }
.tf-group.hoje .tf-group__head svg { color: var(--warn); }
.tf-group.feito .tf-group__head svg { color: var(--ok); }
.tf-group__list { display: grid; }

.tf-row { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) 150px 140px 96px; gap: 14px; align-items: center; padding: 11px 10px; border-radius: var(--r-md); transition: background var(--t-fast), opacity .35s var(--ease), transform .35s var(--ease); animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 25ms); }
.tf-row:hover { background: rgba(255, 255, 255, .03); }
.tf-row.late { background: linear-gradient(90deg, rgba(255, 75, 92, .06), transparent 60%); }
.tf-row.late::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--crit); }
.tf-row.out { opacity: 0; transform: translateX(24px); }
.tf-new { animation: tf-new 1.4s var(--ease) both !important; }
@keyframes tf-new { 0% { opacity: 0; transform: translateY(-12px) scale(.98); background: rgba(225, 6, 0, .22); } 35% { opacity: 1; transform: none; } 100% { background: transparent; } }
.tf-card.tf-new { animation: tf-new-card 1.2s var(--ease) both !important; }
@keyframes tf-new-card { 0% { opacity: 0; transform: translateY(-12px) scale(.97); box-shadow: 0 0 0 2px var(--red); } 40% { opacity: 1; transform: none; } }

.tf-check { width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--line-3); background: var(--bg-2); display: grid; place-items: center; flex: none; transition: background var(--t-med) var(--ease), border-color var(--t-med), box-shadow var(--t-med), transform var(--t-fast); }
.tf-check:hover { border-color: var(--ok); box-shadow: 0 0 0 4px rgba(52, 209, 127, .12); }
.tf-check:active { transform: scale(.88); }
.tf-check svg { width: 16px; height: 16px; fill: none; stroke: #06240F; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .35s var(--ease) .12s; }
.done > .tf-check, .done .tf-card__top > .tf-check { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 14px -2px rgba(52, 209, 127, .7); animation: tf-pop .45s var(--ease); }
.done > .tf-check svg, .done .tf-card__top > .tf-check svg { stroke-dashoffset: 0; }
@keyframes tf-pop { 45% { transform: scale(1.25); } }

.tf-main { min-width: 0; display: grid; gap: 5px; }
.tf-title { position: relative; justify-self: start; font-weight: 500; font-size: var(--fs-sm); line-height: 1.35; transition: color .35s; }
.tf-title span { position: relative; background-image: linear-gradient(var(--tx-3), var(--tx-3)); background-repeat: no-repeat; background-position: 0 58%; background-size: 0 1.5px; transition: background-size .45s var(--ease); }
.done .tf-title { color: var(--tx-3); }
.done .tf-title span { background-size: 100% 1.5px; }
.tf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--fs-2xs); color: var(--tx-3); min-width: 0; }
.tf-link { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--r-xs); background: var(--s3); color: var(--tx-2); white-space: nowrap; }
.tf-link .mono { font-size: 11px; }
.tf-link svg { width: 12px; height: 12px; color: var(--tx-3); }
.tf-orig { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tf-orig svg { width: 12px; height: 12px; }
.tf-orig.ia { color: var(--red-tx); }
.tf-orig.auto { color: var(--info); }
.tf-why { color: var(--tx-4); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 44ch; }
.tf-why::before { content: "·"; margin-right: 8px; color: var(--tx-4); }
.tf-doing { display: inline-flex; align-items: center; gap: 6px; color: var(--warn); }
.tf-doing i { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 0 rgba(246, 167, 35, .6); animation: tf-pulse 1.8s infinite; }
@keyframes tf-pulse { 70% { box-shadow: 0 0 0 6px rgba(246, 167, 35, 0); } }
.done .tf-doing { display: none; }
.tf-resp { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tf-resp > span:last-child { display: grid; min-width: 0; line-height: 1.25; }
.tf-resp b { font-weight: 500; font-size: var(--fs-xs); }
.tf-resp small { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-due { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--tx-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tf-due svg { width: 14px; height: 14px; color: var(--tx-3); }
.tf-due.hoje { color: var(--tx); }
.tf-due.hoje svg { color: var(--warn); }
.tf-due.crit { color: var(--crit); font-weight: 500; }
.tf-due.crit svg { color: var(--crit); }
.tf-prio { height: 22px; font-size: 11px; }
.done .tf-prio, .done .tf-due, .done .tf-resp { opacity: .55; }
.tf-empty { display: grid; justify-items: center; gap: 6px; padding: 48px 20px; text-align: center; font-size: var(--fs-sm); }
.tf-empty svg { width: 28px; height: 28px; color: var(--red-tx); }

/* Quadro */
.tf-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.tf-col { background: rgba(20, 18, 21, .6); border: 1px solid var(--line); border-radius: var(--r-lg); min-height: 360px; }
.tf-col__head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 12px; border-bottom: 1px dashed var(--line-2); font-size: var(--fs-sm); }
.tf-col__head b { font-weight: 500; }
.tf-col__head svg { width: 16px; height: 16px; color: var(--tx-3); }
.tf-col.doing .tf-col__head svg { color: var(--warn); } .tf-col.done .tf-col__head svg { color: var(--ok); }
.tf-col__head .badge { margin-left: auto; }
.tf-col__body { padding: 10px; display: grid; gap: 10px; }
.tf-col__empty { border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: 24px 12px; text-align: center; color: var(--tx-4); font-size: var(--fs-xs); }
.tf-card { position: relative; display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--r-md); background: linear-gradient(180deg, var(--s2), var(--s1)); border: 1px solid var(--line); animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 30ms); transition: opacity .35s, transform .35s var(--ease); }
.tf-card.late { border-color: rgba(255, 75, 92, .35); }
.tf-card.out { opacity: 0; transform: scale(.95); }
.tf-card__top { display: flex; gap: 10px; align-items: flex-start; }
.tf-card__top .tf-check { margin-top: -1px; }
.tf-card__why { font-size: var(--fs-2xs); color: var(--tx-3); padding: 6px 8px; border-radius: var(--r-xs); background: var(--bg-2); }
.tf-card__foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tf-card__foot .tf-prio { margin-left: auto; }

/* Responsivo */
@media (max-width: 1380px) {
  .tf-top { grid-template-columns: 1fr 1fr; }
  .tf-row { grid-template-columns: 30px minmax(0, 1fr) 130px 130px 90px; }
}
@media (max-width: 1100px) {
  .tf-row { grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "ck main pr" "ck foot foot"; row-gap: 8px; }
  .tf-row > .tf-check { grid-area: ck; align-self: start; margin-top: 1px; }
  .tf-main { grid-area: main; } .tf-pr { grid-area: pr; align-self: start; }
  .tf-resp, .tf-when { grid-row: 2; }
  .tf-resp { grid-column: 2; } .tf-when { grid-column: 3; justify-self: end; }
}
@media (max-width: 760px) {
  .tf-top { grid-template-columns: 1fr; }
  .tf-top .tf-mini { display: none; }
  .tf-add { grid-template-columns: 34px 1fr; }
  .tf-add kbd { display: none; }
  .tf-add__prev { grid-column: 1 / -1; }
  .tf-tok-enter { display: none; }
  .tf-add__in { font-size: var(--fs-sm); }
  .tf-chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .tf-chips::-webkit-scrollbar { display: none; }
  .tf-chips button { flex: none; }
  .tf-search { width: 100%; }
  .tf-setores.on { max-height: 200px; }
  .tf-list { padding: 4px 4px 8px; }
  .tf-row { padding: 12px 8px; gap: 8px 10px; }
  .tf-why { display: none; }
  .tf-board { grid-template-columns: 1fr; }
  .tf-col { min-height: 0; }
}
