/* ==========================================================================
   Nexos — Tela Tarefas (prefixo .tk-)
   ========================================================================== */

.tk-view { padding-top: 30px; }

/* ---- Cabeçalho ---- */
.tk-head { display: flex; flex-direction: column; gap: 18px; margin-bottom: 18px; }
.tk-head-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; }
.tk-head-text { min-width: 0; }
.tk-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-3);
}
.tk-eyebrow svg.lucide { width: 14px; height: 14px; }
.tk-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tk-title .chip { font-family: var(--font-ui); font-size: 13px; height: 26px; padding: 0 10px; letter-spacing: 0; }
.tk-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  margin-top: 10px; color: var(--text-2); font-size: var(--fs-md);
}
.tk-summary:empty { display: none; }
.tk-stat { display: inline-flex; align-items: center; gap: 7px; }
.tk-stat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.tk-stat.late { color: var(--danger); font-weight: 560; }
.tk-stat.late::before { background: var(--danger); }
.tk-stat.today::before { background: var(--warning); }
.tk-stat.soon::before { background: var(--info); }
.tk-stat.ok::before { background: var(--success); }
.tk-shared { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-sm); }
.tk-shared svg.lucide { width: 14px; height: 14px; }
.tk-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tk-filters { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.tk-toggle {
  display: inline-flex; align-items: center; gap: 9px; min-height: 34px; padding: 3px 8px 3px 4px;
  border-radius: 10px; font-size: 13px; font-weight: 560; color: var(--text-2);
  transition: color var(--dur), background var(--dur);
}
.tk-toggle:hover { color: var(--text); background: var(--hover); }
.tk-toggle .switch { width: 34px; height: 20px; }
.tk-toggle .switch::after { width: 15px; height: 15px; }
.tk-toggle .switch.on::after { transform: translateX(14px); }
.tk-count { margin-left: auto; font-size: var(--fs-sm); color: var(--text-3); font-weight: 560; }

/* ---- Adicionar tarefa ---- */
.tk-add {
  position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px;
  padding: 7px 7px 7px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.tk-add:hover { border-color: var(--border-2); }
.tk-add:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow); }
.tk-add-plus {
  width: 26px; height: 26px; border-radius: 9px; flex-shrink: 0;
  display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.tk-add-plus svg.lucide { width: 17px; height: 17px; stroke-width: 2.3; }
.tk-add-input {
  flex: 1; min-width: 0; height: 38px; border: 0; outline: none; background: transparent;
  font-size: var(--fs-md); color: var(--text);
}
.tk-add-input::placeholder { color: var(--text-3); }
.tk-add-btn { flex-shrink: 0; }
.tk-parse {
  flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 2px 0 5px 36px; font-size: var(--fs-sm); color: var(--text-3);
}
.tk-parse:empty { display: none; }
.tk-add:not(:focus-within) .tk-parse.is-tip { display: none; }
.tk-parse.is-tip { gap: 7px; }
.tk-parse.is-tip svg.lucide { width: 13px; height: 13px; color: var(--warning); }
.tk-parse b { color: var(--text-2); font-weight: 650; }
.tk-parse-label { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; color: var(--accent-ink); margin-right: 2px; }
.tk-parse-label svg.lucide { width: 12px; height: 12px; }
.tk-pchip { animation: pop .18s var(--ease) both; }
.tk-pchip .avatar { margin-left: -4px; }
button.tk-pspace { cursor: pointer; }
button.tk-pspace:hover { filter: brightness(.97); box-shadow: inset 0 0 0 1px var(--c-s); }

/* ---- Grupos ---- */
.tk-groups { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.tk-group {
  padding: 4px 6px 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: background var(--dur), box-shadow var(--dur), border-color var(--dur);
}
.tk-group.is-empty:not(.tk-g-hoje), .tk-group.is-collapsed {
  background: transparent; box-shadow: none; border-style: dashed;
}
.tk-ghead {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 8px 7px 10px; font-weight: 650; font-size: 13.5px; color: var(--text); text-align: left;
}
.tk-ghead svg.lucide { width: 16px; height: 16px; color: var(--text-3); }
.tk-g-atrasadas .tk-ghead, .tk-g-atrasadas .tk-ghead svg.lucide { color: var(--danger); }
.tk-g-hoje .tk-ghead svg.lucide { color: var(--warning); }
.tk-g-proximos .tk-ghead svg.lucide { color: var(--info); }
.tk-g-feitas .tk-ghead svg.lucide { color: var(--success); }
.tk-group.is-empty .tk-gname { color: var(--text-2); }
.tk-ghead-date { font-weight: 500; font-size: var(--fs-sm); color: var(--text-3); }
.tk-gcount {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: var(--r-full);
  display: inline-grid; place-items: center;
  background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 650;
}
.tk-g-atrasadas .tk-gcount { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.tk-ghead-btn { border-radius: var(--r-sm); transition: background var(--dur); }
.tk-ghead-btn:hover { background: var(--hover); }
.tk-ghead-btn .tk-gcount { margin-left: auto; }
.tk-chev { display: inline-grid; place-items: center; color: var(--text-3); transition: transform .22s var(--ease); }
.tk-chev svg.lucide { color: var(--text-3) !important; }
.tk-group.is-collapsed .tk-chev { transform: rotate(-90deg); }

/* ---- Linhas ---- */
.tk-view .task-row { position: relative; min-height: 50px; padding: 7px 6px 7px 2px; gap: 9px; }
.tk-view .task-row .drag-handle { width: 22px; height: 30px; margin-right: -4px; border-radius: var(--r-xs); }
.tk-view .task-row .drag-handle:hover { background: var(--hover); color: var(--text-2); }
.tk-view .task-row .check { position: relative; }
.tk-view .task-row .check::before { content: ""; position: absolute; inset: -10px; }
.tk-view .task-row .tr-main { padding: 2px 0; }
.tk-view .task-row .tr-title { word-break: break-word; }
.tk-more { opacity: 0; color: var(--text-3); transition: opacity var(--dur), background var(--dur), color var(--dur); }
.task-row:hover .tk-more, .tk-more:focus-visible, .tk-more[aria-expanded="true"] { opacity: 1; }
.tk-noone { width: 24px; height: 24px; border-radius: 50%; border: 1.5px dashed var(--border-2); flex-shrink: 0; }
.tk-links { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--text-3); font-weight: 560; }
.tk-links svg.lucide { width: 12px; height: 12px; }

/* "Batata quente": sem dono e atrasada */
.tk-view .task-row.tk-hot { background: color-mix(in srgb, var(--warning) 7%, transparent); }
.tk-view .task-row.tk-hot:hover { background: color-mix(in srgb, var(--warning) 11%, transparent); }
.tk-anyone { background: color-mix(in srgb, var(--warning) 17%, transparent); color: var(--warning); }
.chip.tk-mine {
  background: var(--accent); color: var(--on-accent); font-weight: 650; padding: 0 10px 0 8px;
  box-shadow: 0 2px 8px var(--accent-ring);
}
.chip.tk-mine:hover { background: var(--accent-2); }
.chip.tk-mine svg.lucide { width: 12px; height: 12px; }

/* recém-criada / concluindo */
.tk-view .task-row.tk-new { animation: tkFlash 1.8s var(--ease); }
@keyframes tkFlash {
  0%, 30% { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent-ring); }
  100% { background: transparent; box-shadow: inset 0 0 0 2px transparent; }
}
.tk-view .task-row.tk-leaving { animation: tkLeave .42s var(--ease) .14s forwards; pointer-events: none; }
@keyframes tkLeave { to { opacity: 0; transform: translateX(14px); } }

/* mudou agora há pouco por outra pessoa (tempo real) */
.task-row.nx-remote { animation: nxRemote 1.6s var(--ease); }
@keyframes nxRemote {
  0% { background: color-mix(in srgb, var(--info) 18%, transparent); box-shadow: inset 3px 0 0 var(--info); }
  100% { background: transparent; box-shadow: inset 3px 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .task-row.nx-remote { animation: none; } }

/* filtro por pessoa */
.tk-who-wrap:empty { display: none; }
.tk-who button { display: inline-flex; align-items: center; gap: 6px; }
.tk-who button .avatar { flex-shrink: 0; font-size: 9.5px; }
.tk-who-more { padding: 0 10px; color: var(--text-3); font-weight: 650; }

/* ---- Zonas de soltar ---- */
.tk-group-end:empty { display: none; }
.tk-drop {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; margin: 0 4px 2px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--text-3);
  transition: background var(--dur), border-color var(--dur);
}
.tk-drop svg.lucide { width: 15px; height: 15px; }
.tk-drop-on { display: none; align-items: center; gap: 7px; }
.tk-drop-done { display: none; }
body.is-dragging .tk-drop { border: 1.5px dashed var(--border-2); min-height: 44px; }
body.is-dragging .tk-drop-done { display: flex; }
body.is-dragging .tk-drop .tk-drop-on { display: inline-flex; }
body.is-dragging .tk-drop .tk-drop-off { display: none; }
.tk-group.drop-target .tk-drop { border-color: var(--accent); color: var(--accent-ink); }

/* ---- Hoje vazio: comemoração ---- */
.tk-celebrate {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  margin: 2px 2px 2px; padding: 22px 16px 18px; border-radius: var(--r);
  background:
    radial-gradient(90% 120% at 50% 0%, color-mix(in srgb, var(--c-mint-s) 15%, transparent), transparent 72%),
    var(--surface-2);
}
.tk-cel-icon {
  width: 50px; height: 50px; border-radius: 17px; display: grid; place-items: center; margin-bottom: 4px;
  background: color-mix(in srgb, var(--c-mint-s) 18%, transparent); color: var(--c-mint-s);
}
.tk-cel-icon svg.lucide { width: 24px; height: 24px; }
.tk-cel-title { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.tk-cel-sub { color: var(--text-2); font-size: 13.5px; max-width: 380px; }
.tk-cel-pull { margin-top: 6px; color: var(--accent-ink); }
.tk-cel-drop { margin-top: 4px; font-size: var(--fs-sm); color: var(--accent-ink); font-weight: 600; }
body.is-dragging .tk-celebrate .tk-cel-drop { display: inline-flex; }
body.is-dragging .tk-celebrate { box-shadow: inset 0 0 0 1.5px var(--border-2); }
.tk-celebrate.is-new { animation: tkCel .7s var(--spring); }
.tk-celebrate.is-new .tk-cel-icon { animation: tkWiggle .9s var(--ease) .1s; }
@keyframes tkCel { 0% { opacity: 0; transform: scale(.92); } 100% { opacity: 1; transform: none; } }
@keyframes tkWiggle { 0%, 100% { transform: none; } 25% { transform: rotate(-12deg) scale(1.08); } 55% { transform: rotate(9deg) scale(1.05); } }

/* ---- Cartão-fantasma: sugestão do Claude ---- */
.tk-ghost {
  position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px;
  margin: 2px 2px 6px; padding: 11px 12px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent); border-radius: var(--r);
  background: var(--accent-soft); font-size: 13.5px; line-height: 1.45;
  animation: pop .25s var(--ease);
}
.tk-ghost-icon { color: var(--accent); display: inline-grid; flex-shrink: 0; }
.tk-ghost-text { flex: 1; min-width: 220px; color: var(--text); }
.tk-ghost-text b { color: var(--accent-ink); font-weight: 650; }
.tk-ghost-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ---- Nenhuma tarefa ---- */
.tk-empty { padding-bottom: 26px; }
.tk-examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 0 18px; margin-top: -18px; }
.chip.tk-example { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.chip.tk-example:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

.tk-hint { margin-top: 26px; }
.tk-hint .btn-icon { margin-left: 0; }

/* ---- Toque / celular ---- */
@media (hover: none) {
  .tk-view .task-row .drag-handle { opacity: .5; }
  .tk-more { opacity: .75; }
}
@media (max-width: 760px) {
  .tk-view { padding-top: 16px; }
  .tk-head { gap: 14px; }
  .tk-head-top { align-items: stretch; }
  .tk-head-actions { width: 100%; }
  .tk-head-actions .btn { flex: 1; height: 40px; }
  .tk-summary { font-size: var(--fs); gap: 4px 12px; }
  .tk-who-wrap { width: 100%; }
  .tk-filters .seg { width: 100%; }
  .tk-filters .seg button { flex: 1; height: 34px; }
  .tk-toggle { min-height: 40px; }
  .tk-add { padding: 5px 5px 5px 10px; }
  .tk-add-input { height: 42px; font-size: 16px; }
  .tk-add-btn { width: 40px; height: 40px; padding: 0; border-radius: 11px; }
  .tk-add-btn span { display: none; }
  .tk-parse { padding-left: 0; }
  .tk-group { padding: 3px 3px 5px; }
  .tk-view .task-row { min-height: 56px; padding: 6px 2px 6px 0; gap: 8px; }
  .tk-view .task-row .drag-handle { width: 28px; height: 40px; margin-right: -6px; }
  .tk-more { width: 36px !important; height: 36px; }
  .chip.tk-mine { height: 30px; padding: 0 12px 0 10px; font-size: 12.5px; }
  .tk-ghost-actions { width: 100%; }
  .tk-ghost-actions .btn { flex: 1; height: 38px; }
  .tk-ghost-text { min-width: 0; }
  .tk-hint { flex-wrap: wrap; }
}
