/* ============================================================
   tarefas.css — Gestão de tarefas (kanban) sobre back-end Planka.
   Reusa a casca .acc-/.eq-/.conv-; aqui ficam o quadro kanban,
   os cards, etiquetas e o detalhe da tarefa.
   ============================================================ */

/* ---- Etiquetas (labels) ---- */
.tar-tag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-heading); font-weight: 700; font-size: 10.5px; line-height: 1; padding: 3px 8px; border-radius: var(--radius-pill); color: color-mix(in oklab, var(--tag) 72%, #1c1c1c); background: color-mix(in oklab, var(--tag) 15%, var(--stone-0)); border: 1px solid color-mix(in oklab, var(--tag) 32%, transparent); }
.tar-tag.is-pick { cursor: pointer; padding: 5px 10px; background: var(--color-surface); color: var(--color-text-muted); border-color: var(--color-border-strong); transition: all var(--dur-fast); }
.tar-tag.is-pick:hover { border-color: color-mix(in oklab, var(--tag) 45%, transparent); }
.tar-tag.is-pick.on { color: color-mix(in oklab, var(--tag) 72%, #1c1c1c); background: color-mix(in oklab, var(--tag) 15%, var(--stone-0)); border-color: color-mix(in oklab, var(--tag) 40%, transparent); }
.tar-etq-pick { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Pílula de prazo ---- */
.tar-prazo { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-heading); font-weight: 700; font-size: var(--text-xs); padding: 3px 8px; border-radius: var(--radius-sm); white-space: nowrap; }
.tar-prazo.mini { font-size: 10.5px; padding: 2px 6px; }
.tar-prazo.is-ok { background: var(--stone-100); color: var(--color-text-muted); }
.tar-prazo.is-soon { background: var(--sun-100); color: #8a5a12; }
.tar-prazo.is-late { background: var(--danger-bg); color: var(--danger); }

/* ---- Visão geral: fluxo ---- */
.tar-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); align-items: end; padding-top: var(--space-2); }
.tar-flow-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tar-flow-bar { height: 120px; display: flex; align-items: flex-end; }
.tar-flow-bar span { display: block; width: 46px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; transition: height var(--dur-base) var(--ease-out); }
.tar-flow-n { font-family: var(--font-heading); font-weight: 800; font-size: var(--text-h3); color: var(--color-text); }
.tar-flow-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 600; }
.tar-flow-lbl i { width: 9px; height: 9px; border-radius: 3px; flex: none; }

/* ---- Server card (Planka) ---- */
.tar-server { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); padding: var(--space-5); }
.tar-server-l { display: flex; align-items: center; gap: var(--space-3); padding-bottom: var(--space-4); border-bottom: 1px solid var(--color-border); margin-bottom: var(--space-4); }
.tar-server-ic { width: 52px; height: 52px; border-radius: var(--radius-md); flex: none; display: flex; align-items: center; justify-content: center; background: linear-gradient(150deg, var(--stone-700), var(--stone-900)); color: var(--lime-300); }
.tar-server-name { font-family: var(--font-mono); font-weight: 600; font-size: var(--text-base); color: var(--color-text); display: inline-flex; align-items: center; gap: 8px; }
.tar-server-sub { font-size: var(--text-sm); color: var(--color-text-muted); }
.tar-server-sub strong { color: var(--green-700); font-family: var(--font-heading); }

/* ============================================================
   QUADRO (kanban)
   ============================================================ */
.tar-board-wrap { display: grid; grid-template-columns: 248px 1fr; gap: var(--space-5); align-items: start; }

/* trilho de quadros à esquerda */
.tar-board-rail { display: flex; flex-direction: column; gap: 4px; position: sticky; top: var(--space-4); }
.tar-rail-item { display: flex; align-items: center; gap: var(--space-3); width: 100%; text-align: left; padding: var(--space-2) var(--space-3); border: 1px solid transparent; border-radius: var(--radius-md); background: none; cursor: pointer; transition: all var(--dur-fast); }
.tar-rail-item:hover { background: var(--stone-100); }
.tar-rail-item.active { background: var(--color-surface); border-color: var(--color-border); box-shadow: var(--shadow-xs); }
.tar-rail-ic { width: 30px; height: 30px; border-radius: var(--radius-sm); flex: none; display: flex; align-items: center; justify-content: center; color: #fff; }
.tar-rail-ic.sm { width: 22px; height: 22px; border-radius: 5px; }
.tar-rail-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tar-rail-tx strong { font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm); color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tar-rail-tx span { font-size: 11px; color: var(--color-text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tar-rail-n { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--green-100); color: var(--green-800); font-family: var(--font-heading); font-weight: 700; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.tar-rail-item.active .tar-rail-n { background: var(--green-600); color: #fff; }

/* cabeçalho do quadro */
.tar-board-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-bottom: var(--space-4); margin-bottom: var(--space-4); border-bottom: 1px solid var(--color-border); }
.tar-board-head-l { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.tar-board-ic { width: 44px; height: 44px; border-radius: var(--radius-md); flex: none; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: var(--shadow-sm); }
.tar-board-title { font-family: var(--font-heading); font-weight: 800; font-size: var(--text-h4); color: var(--color-text); display: flex; align-items: center; gap: var(--space-2); }
.tar-board-sub { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: 2px; }
.tar-board-resp { display: inline-flex; align-items: center; gap: 7px; font-size: var(--text-sm); color: var(--color-text-muted); font-weight: 600; white-space: nowrap; }

/* colunas */
.tar-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); align-items: start; }
.tar-col { background: var(--stone-50); border: 1px solid var(--color-border); border-radius: var(--radius-lg); display: flex; flex-direction: column; min-height: 120px; }
.tar-col-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-3) var(--space-2); }
.tar-col-title { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm); color: var(--color-text); white-space: nowrap; }
.tar-col-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--col); flex: none; }
.tar-col-n { font-family: var(--font-heading); font-weight: 700; font-size: 11px; color: var(--color-text-muted); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-pill); min-width: 20px; height: 20px; padding: 0 6px; display: flex; align-items: center; justify-content: center; }
.tar-col-body { display: flex; flex-direction: column; gap: var(--space-2); padding: 0 var(--space-2) var(--space-2); }
.tar-col-empty { text-align: center; font-size: var(--text-xs); color: var(--color-text-faint); padding: var(--space-3) 0; }
.tar-col-add { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; padding: var(--space-2); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md); background: none; color: var(--color-text-muted); font-family: var(--font-heading); font-weight: 600; font-size: var(--text-xs); cursor: pointer; transition: all var(--dur-fast); }
.tar-col-add:hover { border-color: var(--green-400); color: var(--green-700); background: var(--green-50); }

/* card */
.tar-card { position: relative; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); padding: var(--space-3); cursor: pointer; transition: all var(--dur-fast); }
.tar-card:hover { border-color: var(--green-300); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.tar-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tar-card-title { font-family: var(--font-heading); font-weight: 600; font-size: var(--text-sm); color: var(--color-text); line-height: var(--leading-snug); text-wrap: pretty; }
.tar-card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-3); }
.tar-card-meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }
.tar-meta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-heading); font-weight: 600; font-size: 11px; color: var(--color-text-faint); }
.tar-meta.is-done { color: var(--green-700); }
.tar-card-next { position: absolute; top: var(--space-3); right: var(--space-3); width: 26px; height: 26px; border-radius: var(--radius-sm); border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: all var(--dur-fast); }
.tar-card:hover .tar-card-next { opacity: 1; }
.tar-card-next:hover { background: var(--green-600); border-color: var(--green-600); color: #fff; }

/* ---- Tabela ---- */
.tar-row { cursor: pointer; }
.tar-row:hover { background: var(--green-50); }
.tar-td-quadro { display: inline-flex; align-items: center; gap: 7px; font-size: var(--text-sm); color: var(--color-text); font-weight: 500; }
.tar-td-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tar-etapa { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-heading); font-weight: 700; font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; }
.tar-etapa i { width: 8px; height: 8px; border-radius: 3px; background: var(--col); flex: none; }

/* ---- Automações ---- */
.tar-auto-list { display: flex; flex-direction: column; gap: var(--space-2); }
.tar-auto { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--stone-50); transition: opacity var(--dur-base); }
.tar-auto.is-off { opacity: .56; }
.tar-auto-tx { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.tar-auto-gat { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm); color: var(--color-text); }
.tar-auto-gat svg { color: var(--sun-700); }
.tar-auto-arrow { color: var(--color-text-faint); display: inline-flex; }
.tar-auto-acao { font-size: var(--text-sm); color: var(--color-text-muted); }
.tar-auto-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }

/* config de regra (modal) */
.tar-auto-flowsep { display: flex; align-items: center; gap: 8px; margin: var(--space-1) 0; font-family: var(--font-heading); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text-faint); text-transform: uppercase; letter-spacing: .06em; }
.tar-auto-flowsep-arrow { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--sun-100); color: var(--sun-700); font-size: 14px; font-weight: 700; }
.tar-auto-preview { margin-top: var(--space-2); padding: var(--space-4); background: var(--color-surface-subtle, var(--stone-50)); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md); }
.tar-auto-preview-lbl { display: block; font-size: 10.5px; font-weight: var(--weight-bold); text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-faint); margin-bottom: var(--space-2); }

/* ============================================================
   DETALHE DA TAREFA (modal)
   ============================================================ */
.tar-detail { display: grid; grid-template-columns: 1fr 240px; gap: var(--space-5); }
.tar-detail-desc { font-size: var(--text-sm); color: var(--color-text-muted); line-height: var(--leading-relaxed); margin: 0 0 var(--space-4); text-wrap: pretty; }
.tar-detail-block { border-top: 1px solid var(--color-border); padding-top: var(--space-4); }
.tar-detail-block-head { display: flex; align-items: center; justify-content: space-between; }
.tar-detail-block-head span:first-child { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm); color: var(--color-text); }
.tar-detail-pct { font-family: var(--font-heading); font-weight: 700; font-size: var(--text-xs); color: var(--color-text-muted); }
.tar-check-list { display: flex; flex-direction: column; gap: 4px; }
.tar-check { display: flex; align-items: center; gap: var(--space-3); width: 100%; text-align: left; border: none; background: none; padding: 6px 4px; cursor: pointer; border-radius: var(--radius-sm); transition: background var(--dur-fast); }
.tar-check:hover:not(:disabled) { background: var(--stone-50); }
.tar-check:disabled { cursor: default; }
.tar-check-box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--color-border-strong); flex: none; display: flex; align-items: center; justify-content: center; color: #fff; }
.tar-check.on .tar-check-box { background: var(--green-600); border-color: var(--green-600); }
.tar-check span:last-child { font-size: var(--text-sm); color: var(--color-text); }
.tar-check.on span:last-child { color: var(--color-text-faint); text-decoration: line-through; }

.tar-detail-side { display: flex; flex-direction: column; gap: var(--space-4); background: var(--stone-50); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-4); align-self: start; }
.tar-detail-field { display: flex; flex-direction: column; gap: var(--space-2); }
.tar-detail-field .label { margin: 0; }
.tar-detail-prazo { display: flex; }
.tar-stage-seg { display: flex; flex-direction: column; gap: 4px; }
.tar-stage-btn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px var(--space-3); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface); cursor: pointer; font-family: var(--font-heading); font-weight: 600; font-size: var(--text-xs); color: var(--color-text-muted); transition: all var(--dur-fast); }
.tar-stage-btn i { width: 9px; height: 9px; border-radius: 3px; background: var(--col); flex: none; }
.tar-stage-btn:hover:not(:disabled) { border-color: var(--col); }
.tar-stage-btn.active { border-color: var(--col); background: color-mix(in oklab, var(--col) 12%, var(--stone-0)); color: var(--color-text); }
.tar-stage-btn:disabled { cursor: default; }
.tar-detail-meta { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--color-border); padding-top: var(--space-3); }
.tar-detail-meta span { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--color-text-muted); }

/* ============================================================
   CARDS RICOS + DRAG-AND-DROP (estilo Planka)
   ============================================================ */
.tar-tag.mini { font-size: 9.5px; padding: 2px 6px; }
.tar-card.is-grabbable { cursor: grab; }
.tar-card.is-grabbable:active { cursor: grabbing; }
.tar-card.is-dragging { opacity: .45; box-shadow: var(--shadow-md); transform: rotate(1.5deg); }
.tar-col-body.is-drop { background: color-mix(in oklab, var(--info) 9%, transparent); border-radius: var(--radius-md); outline: 2px dashed color-mix(in oklab, var(--info) 45%, transparent); outline-offset: -3px; }
.tar-col-body.is-drop .tar-col-empty { color: var(--info); font-weight: 700; }

.tar-card-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: var(--space-2); }
.tar-badge { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-heading); font-weight: 700; font-size: 10.5px; color: var(--color-text-muted); background: var(--stone-100); border-radius: var(--radius-sm); padding: 2px 6px; }
.tar-badge.is-done { color: var(--green-800); background: var(--green-50); }
.tar-card-foot { align-items: center; }
.tar-stack { display: inline-flex; align-items: center; }
.tar-stack-more { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; margin-left: -8px; background: var(--stone-200); color: var(--color-text-muted); border: 2px solid var(--color-surface); font-family: var(--font-heading); font-weight: 700; font-size: 9px; }
.tar-card-mini-prog { flex: 1; max-width: 84px; height: 5px; border-radius: var(--radius-pill); background: var(--stone-200); overflow: hidden; margin-left: auto; }
.tar-card-mini-prog > div { height: 100%; border-radius: inherit; transition: width var(--dur-base); }

/* ---- Checklist interativo ---- */
.tar-check-box { cursor: pointer; transition: all var(--dur-fast); }
.tar-check-box:disabled { cursor: default; }
.tar-check-tx { flex: 1; font-size: var(--text-sm); color: var(--color-text); }
.tar-check.on .tar-check-tx { color: var(--color-text-faint); text-decoration: line-through; }
.tar-check-del { width: 24px; height: 24px; border: none; background: none; border-radius: var(--radius-sm); color: var(--color-text-faint); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; opacity: 0; flex: none; transition: all var(--dur-fast); }
.tar-check:hover .tar-check-del { opacity: 1; }
.tar-check-del:hover { background: var(--danger-bg); color: var(--danger); }
.tar-check-add { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--space-2); background: none; border: none; cursor: pointer; font-family: var(--font-heading); font-weight: 600; font-size: var(--text-sm); color: var(--color-text-muted); padding: 4px; }
.tar-check-add:hover { color: var(--green-700); }
.tar-check-addrow { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.tar-check-addrow .input { flex: 1; }

/* ---- Anexos ---- */
.tar-anx-list { display: flex; flex-direction: column; gap: 6px; }
.tar-anx { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--stone-50); }
.tar-anx-ic { width: 34px; height: 34px; border-radius: var(--radius-sm); flex: none; display: flex; align-items: center; justify-content: center; background: var(--stone-200); color: var(--color-text-muted); }
.tar-anx-ic.is-pdf { background: var(--danger-bg); color: var(--danger); }
.tar-anx-ic.is-img { background: var(--info-bg); color: var(--info); }
.tar-anx-ic.is-xlsx { background: var(--green-50); color: var(--green-700); }
.tar-anx-ic.is-zip { background: var(--sun-100); color: #8a5a12; }
.tar-anx-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tar-anx-tx strong { font-family: var(--font-heading); font-weight: 600; font-size: var(--text-sm); color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tar-anx-tx span { font-size: 11px; color: var(--color-text-faint); }
.tar-anx-dl { width: 30px; height: 30px; border: 1px solid var(--color-border-strong); background: var(--color-surface); border-radius: var(--radius-sm); color: var(--color-text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tar-anx-dl:hover { border-color: var(--green-300); color: var(--green-700); background: var(--green-50); }

/* ---- Tabs Comentários / Atividade ---- */
.tar-tabs { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); }
.tar-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: none; background: none; border-radius: var(--radius-sm); font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm); color: var(--color-text-muted); cursor: pointer; transition: all var(--dur-fast); }
.tar-tabs button:hover { color: var(--color-text); }
.tar-tabs button.active { background: var(--green-50); color: var(--green-800); }
.tar-tab-n { font-size: 10px; background: var(--stone-200); color: var(--color-text-muted); border-radius: var(--radius-pill); padding: 1px 6px; }
.tar-tabs button.active .tar-tab-n { background: var(--green-200); color: var(--green-800); }

/* ---- Composer de comentário ---- */
.tar-cmt-composer { display: flex; gap: var(--space-3); margin-bottom: var(--space-4); }
.tar-cmt-composer-box { flex: 1; min-width: 0; border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface); padding: var(--space-2) var(--space-3); transition: border-color var(--dur-fast); }
.tar-cmt-composer-box:focus-within { border-color: var(--green-400); box-shadow: 0 0 0 3px var(--green-50); }
.tar-cmt-composer-box textarea { width: 100%; border: none; outline: none; background: none; resize: none; font-family: var(--font-body); font-size: var(--text-sm); color: var(--color-text); line-height: var(--leading-normal); min-height: 22px; }
.tar-cmt-composer-box textarea:focus, .tar-cmt-composer-box textarea:focus-visible { box-shadow: none; outline: none; }
.tar-cmt-composer-act { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.tar-cmt-hint { font-size: 10.5px; color: var(--color-text-faint); }

/* ---- Lista de comentários ---- */
.tar-cmt-list { display: flex; flex-direction: column; gap: var(--space-4); }
.tar-cmt { display: flex; gap: var(--space-3); }
.tar-cmt-body { flex: 1; min-width: 0; }
.tar-cmt-top { display: flex; align-items: baseline; gap: var(--space-2); margin-bottom: 3px; }
.tar-cmt-top strong { font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm); color: var(--color-text); }
.tar-cmt-when { font-size: 11px; color: var(--color-text-faint); }
.tar-cmt-text { font-size: var(--text-sm); color: var(--color-text); line-height: var(--leading-relaxed); margin: 0; text-wrap: pretty; }
.tar-cmt-actions { display: flex; align-items: center; gap: var(--space-3); margin-top: 5px; }
.tar-cmt-act { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; cursor: pointer; font-family: var(--font-heading); font-weight: 600; font-size: 11px; color: var(--color-text-muted); padding: 0; transition: color var(--dur-fast); }
.tar-cmt-act:hover { color: var(--green-700); }
.tar-cmt-act.on { color: var(--green-700); }
.tar-cmt-act.is-del:hover { color: var(--danger); }
.tar-cmt-editbox { display: flex; flex-direction: column; gap: var(--space-2); }
.tar-cmt-editbox textarea { width: 100%; min-height: 60px; }

/* ---- Histórico de atividade ---- */
.tar-act-list { display: flex; flex-direction: column; gap: var(--space-3); }
.tar-act { display: flex; gap: var(--space-3); align-items: flex-start; }
.tar-act-ic { width: 26px; height: 26px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--sun-100); color: var(--sun-700); margin-top: 1px; }
.tar-act-tx { flex: 1; font-size: var(--text-sm); color: var(--color-text-muted); line-height: var(--leading-snug); }
.tar-act-tx strong { font-family: var(--font-heading); font-weight: 700; color: var(--color-text); }
.tar-act-when { display: block; font-size: 11px; color: var(--color-text-faint); margin-top: 1px; }

/* ---- Sidebar: membros + cronômetro ---- */
.tar-side-membros { display: flex; flex-direction: column; gap: var(--space-2); }
.tar-side-membro { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--color-text); }
.tar-side-membro .tk-resp-you { margin-left: 4px; }
.tar-stopwatch { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface); }
.tar-stopwatch.is-run { border-color: var(--green-400); background: var(--green-50); }
.tar-stop-time { flex: 1; font-family: var(--font-mono); font-weight: 600; font-size: var(--text-base); color: var(--color-text); font-variant-numeric: tabular-nums; }
.tar-stopwatch.is-run .tar-stop-time { color: var(--green-800); }
.tar-stop-btn { display: inline-flex; align-items: center; gap: 5px; border: none; background: var(--stone-200); color: var(--color-text); border-radius: var(--radius-sm); padding: 5px 9px; font-family: var(--font-heading); font-weight: 700; font-size: 11px; cursor: pointer; transition: all var(--dur-fast); }
.tar-stopwatch.is-run .tar-stop-btn { background: var(--danger); color: #fff; }
.tar-stop-btn:hover { filter: brightness(.96); }

/* widen the detail grid so the rich card breathes */
.tar-detail { grid-template-columns: 1fr 248px; }

/* ============================================================
   DRAWER LATERAL DO CARTÃO (tkd-*) — entra pela direita,
   ~metade da tela, conteúdo em abas (Checklist primeiro).
   ============================================================ */
.tkd-scrim { position: fixed; inset: 0; z-index: 200; background: color-mix(in srgb, var(--stone-900) 42%, transparent); backdrop-filter: blur(2px); display: flex; justify-content: flex-end; opacity: 0; transition: opacity .24s var(--ease-out); }
.tkd-scrim.is-in { opacity: 1; }
.tkd { width: 50vw; min-width: 460px; max-width: 720px; height: 100%; background: var(--color-surface); box-shadow: -10px 0 36px rgba(20,23,18,.18); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .26s var(--ease-out); will-change: transform; }
.tkd.is-in { transform: none; }

/* cabeçalho */
.tkd-head { padding: var(--space-5) var(--space-6) var(--space-4); border-bottom: 1px solid var(--color-border); flex: none; }
.tkd-head-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.tkd-board { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-heading); font-weight: 700; font-size: var(--text-xs); color: var(--color-text-muted); min-width: 0; }
.tkd-board .tar-rail-ic { flex: none; }
.tkd-x { width: 34px; height: 34px; border: 1px solid var(--color-border-strong); background: var(--color-surface); border-radius: var(--radius-sm); color: var(--color-text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; transition: all var(--dur-fast); }
.tkd-x:hover { background: var(--stone-100); color: var(--color-text); }
.tkd-title { font-size: var(--text-h3); margin: 0; line-height: var(--leading-snug); text-wrap: pretty; }

/* meta sempre visível */
.tkd-meta { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-8); padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--color-border); flex: none; }
.tkd-meta-cell { display: flex; flex-direction: column; gap: 6px; }
.tkd-meta-k { font-family: var(--font-heading); font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-faint); }
.tkd-meta-membros { display: flex; padding-left: 6px; }

/* etapa */
.tkd-stage { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-6); border-bottom: 1px solid var(--color-border); flex: none; flex-wrap: wrap; }
.tkd-stage .tkd-meta-k { flex: none; }
.tkd-stage-seg { display: flex; gap: 4px; flex-wrap: wrap; }
.tkd-stage-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface); cursor: pointer; font-family: var(--font-heading); font-weight: 600; font-size: var(--text-xs); color: var(--color-text-muted); transition: all var(--dur-fast); }
.tkd-stage-btn i { width: 8px; height: 8px; border-radius: 3px; background: var(--col); flex: none; }
.tkd-stage-btn:hover { border-color: var(--col); }
.tkd-stage-btn.active { border-color: var(--col); background: color-mix(in oklab, var(--col) 12%, var(--stone-0)); color: var(--color-text); }

/* abas */
.tkd-tabs { display: flex; gap: 2px; padding: var(--space-2) var(--space-3) 0; border-bottom: 1px solid var(--color-border); flex: none; overflow-x: auto; scrollbar-width: none; }
.tkd-tabs::-webkit-scrollbar { display: none; }
.tkd-tab { display: inline-flex; align-items: center; gap: 5px; padding: 10px 9px; border: none; background: none; border-bottom: 2px solid transparent; cursor: pointer; font-family: var(--font-heading); font-weight: 700; font-size: var(--text-xs); color: var(--color-text-muted); transition: color var(--dur-fast); margin-bottom: -1px; white-space: nowrap; }
.tkd-tab:hover { color: var(--color-text); }
.tkd-tab.active { color: var(--green-800); border-bottom-color: var(--green-600); }
.tkd-tab-n { font-size: 10px; background: var(--stone-200); color: var(--color-text-muted); border-radius: var(--radius-pill); padding: 1px 6px; }
.tkd-tab.active .tkd-tab-n { background: var(--green-100); color: var(--green-800); }

/* corpo */
.tkd-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--space-5) var(--space-6); animation: tkd-fade .2s var(--ease-out); }
@keyframes tkd-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.tkd-desc { padding: var(--space-3) var(--space-4); background: var(--stone-50); border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: var(--space-4); }
.tkd-desc p { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); line-height: var(--leading-relaxed); text-wrap: pretty; }
.tkd-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-1); }
.tkd-section-head span:first-child { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm); color: var(--color-text); }

/* caixa de justificativa */
.tar-check.is-justify { background: var(--green-50); border-radius: var(--radius-sm); }
.tkd-justify { margin: 4px 0 var(--space-3) 32px; padding: var(--space-3); border: 1px solid var(--green-300); border-radius: var(--radius-md); background: var(--green-50); display: flex; flex-direction: column; gap: var(--space-2); animation: tkd-fade .15s var(--ease-out); }
.tkd-justify.is-remove { border-color: var(--danger-border); background: var(--danger-bg); }
.tkd-justify-lbl { display: inline-flex; align-items: flex-start; gap: 6px; font-family: var(--font-heading); font-weight: 700; font-size: var(--text-xs); color: var(--green-800); line-height: var(--leading-snug); }
.tkd-justify-lbl svg { flex: none; margin-top: 1px; }
.tkd-justify.is-remove .tkd-justify-lbl { color: var(--danger); }
.tkd-justify textarea { min-height: 52px; resize: vertical; background: var(--color-surface); }
.tkd-justify-act { display: flex; gap: var(--space-2); }
.tkd-link { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--space-4); background: none; border: none; cursor: pointer; font-family: var(--font-heading); font-weight: 600; font-size: var(--text-xs); color: var(--color-text-muted); padding: 0; }
.tkd-link:hover { color: var(--green-700); }

/* comentário de conclusão */
.tar-cmt.is-conclusao .tar-cmt-text { color: var(--color-text); }
.tkd-cmt-tag { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-heading); font-weight: 700; font-size: 9.5px; padding: 1px 6px; border-radius: var(--radius-pill); background: var(--green-100); color: var(--green-800); }
.tkd-cmt-item { font-size: var(--text-xs); color: var(--color-text-muted); font-style: italic; margin: 2px 0 4px; padding-left: var(--space-3); border-left: 2px solid var(--green-300); }
.tkd-act-motivo { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: var(--text-xs); color: var(--color-text-muted); background: var(--stone-100); border-radius: var(--radius-sm); padding: 3px 8px; line-height: var(--leading-snug); }
.tkd-act-motivo svg { color: var(--color-text-faint); flex: none; }

@container portal (max-width: 760px) {
  .tkd { width: 100vw; min-width: 0; max-width: none; }
}

/* ---- Responsivo ---- */
@container portal (max-width: 1080px) {
  .tar-board-wrap { grid-template-columns: 1fr; }
  .tar-board-rail { position: static; flex-direction: row; overflow-x: auto; padding-bottom: var(--space-2); }
  .tar-rail-item { flex: none; width: 210px; }
  .tar-cols { grid-template-columns: repeat(2, 1fr); }
}
@container portal (max-width: 760px) {
  .tar-cols { grid-template-columns: 1fr; }
  .tar-detail { grid-template-columns: 1fr; }
  .tar-flow { gap: var(--space-2); }
  .tar-flow-bar span { width: 32px; }
}

/* ============================================================
   GOVERNANÇA (admin): nota, visibilidade, quadros, acessos
   ============================================================ */
.tar-gov-note { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--green-50); border: 1px solid var(--green-200); border-radius: var(--radius-md); color: var(--green-900); font-size: var(--text-sm); line-height: var(--leading-snug); }
.tar-gov-note svg { color: var(--green-700); flex: none; margin-top: 2px; }

.tar-vis-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.tar-vis-col { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-4); background: var(--stone-50); }
.tar-vis-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.tar-vis-col-head span { font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm); color: var(--color-text); }
.tar-vis-col p { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); line-height: var(--leading-snug); }

/* grid de quadros */
.tar-q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--space-4); }
.tar-q-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.tar-q-head { display: flex; align-items: center; gap: var(--space-3); }
.tar-q-id { flex: 1; min-width: 0; }
.tar-q-title { font-family: var(--font-heading); font-weight: 800; font-size: var(--text-base); color: var(--color-text); }
.tar-q-origem { font-size: var(--text-xs); color: var(--color-text-faint); }
.tar-q-desc { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); line-height: var(--leading-snug); text-wrap: pretty; }
.tar-q-rows { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--color-border); padding-top: var(--space-3); }
.tar-q-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.tar-q-k { font-family: var(--font-heading); font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-faint); }
.tar-q-v { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--color-text); font-weight: 500; }
.tar-q-v em { color: var(--color-text-muted); font-style: normal; }
.tar-q-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: auto; }
.tar-q-actions { display: flex; align-items: center; gap: var(--space-2); }
.tar-ava-stack { display: flex; align-items: center; }
.tar-ava-stack .eq-avatar { margin-left: -7px; border: 2px solid var(--color-surface); }
.tar-ava-stack .eq-avatar:first-child { margin-left: 0; }
.tar-ava-rest { background: var(--stone-200) !important; color: var(--color-text-muted) !important; }

/* acessos */
.tar-acc-legend { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.tar-acc-legend-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--stone-50); font-size: var(--text-sm); color: var(--color-text-muted); }
.tar-perm-list { display: flex; flex-direction: column; }
.tar-perm { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); border-top: 1px solid var(--color-border); }
.tar-perm:first-child { border-top: none; }
.tar-perm-l { width: 168px; flex: none; }
.tar-perm-l strong { display: block; font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm); color: var(--color-text); }
.tar-perm-l span { font-size: var(--text-xs); color: var(--color-text-muted); }
.tar-perm-caps { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.tar-cap { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-heading); font-weight: 600; font-size: var(--text-xs); padding: 5px 10px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text-muted); cursor: pointer; transition: all var(--dur-fast); }
.tar-cap:disabled { cursor: default; }
.tar-cap-box { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--color-border-strong); display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.tar-cap.on { background: var(--green-50); border-color: var(--green-400); color: var(--green-800); }
.tar-cap.on .tar-cap-box { background: var(--green-600); border-color: var(--green-600); }

/* membros (modal de acesso) */
.tar-mem-list { display: flex; flex-direction: column; gap: 6px; margin-top: var(--space-2); }
.tar-mem { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--stone-50); }
.tar-mem-nome { flex: 1; font-size: var(--text-sm); color: var(--color-text); font-weight: 500; display: flex; align-items: center; gap: var(--space-2); }
.tar-mem-tag { font-family: var(--font-heading); font-weight: 700; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--green-800); background: var(--green-100); padding: 2px 6px; border-radius: var(--radius-pill); }
.tar-mem-x { width: 26px; height: 26px; border: none; background: none; border-radius: var(--radius-sm); color: var(--color-text-faint); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tar-mem-x:hover { background: var(--danger-bg); color: var(--danger); }

@container portal (max-width: 720px) {
  .tar-vis-split, .tar-acc-legend { grid-template-columns: 1fr; }
  .tar-perm { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .tar-perm-l { width: auto; }
}

/* ============================================================
   ÁREA TAREFAS DO MORADOR (tk-*) — visualização
   ============================================================ */
.tk { display: grid; grid-template-columns: 256px 1fr; gap: var(--space-5); align-items: start; }
.tk--full { display: block; }
.tk-side { display: flex; flex-direction: column; gap: var(--space-2); position: sticky; top: var(--space-4); }
.tk-side-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); background: linear-gradient(150deg, var(--green-700), var(--green-900)); border-radius: var(--radius-md); color: #fff; }
.tk-side-mark { width: 38px; height: 38px; border-radius: var(--radius-sm); background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; color: var(--lime-300); flex: none; }
.tk-side-tx { display: flex; flex-direction: column; }
.tk-side-tx strong { font-family: var(--font-heading); font-weight: 800; font-size: var(--text-base); }
.tk-side-tx span { font-size: 11px; opacity: .85; display: inline-flex; align-items: center; gap: 6px; }

.tk-mine { display: flex; align-items: center; gap: var(--space-3); width: 100%; text-align: left; padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); cursor: pointer; transition: all var(--dur-fast); }
.tk-mine:hover { border-color: var(--green-300); }
.tk-mine.active { background: var(--green-50); border-color: var(--green-400); }
.tk-mine-ic { width: 30px; height: 30px; border-radius: var(--radius-sm); background: var(--green-100); color: var(--green-700); display: flex; align-items: center; justify-content: center; flex: none; }
.tk-mine-tx { flex: 1; font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm); color: var(--color-text); }
.tk-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--green-600); color: #fff; font-family: var(--font-heading); font-weight: 700; font-size: 11px; display: flex; align-items: center; justify-content: center; }

.tk-group { display: flex; flex-direction: column; gap: 2px; margin-top: var(--space-2); }
.tk-group-h { font-family: var(--font-heading); font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-faint); padding: var(--space-2) var(--space-2) 4px; }
.tk-group-empty { font-size: var(--text-xs); color: var(--color-text-faint); padding: 2px var(--space-2) var(--space-2); }
.tk-q { display: flex; align-items: center; gap: var(--space-2); width: 100%; text-align: left; padding: 7px var(--space-2); border: 1px solid transparent; border-radius: var(--radius-md); background: none; cursor: pointer; transition: all var(--dur-fast); }
.tk-q:hover { background: var(--stone-100); }
.tk-q.active { background: var(--color-surface); border-color: var(--color-border); box-shadow: var(--shadow-xs); }
.tk-q .tar-rail-ic.sm { flex: none; }
.tk-q-tx { flex: 1; min-width: 0; font-family: var(--font-heading); font-weight: 600; font-size: var(--text-sm); color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-q svg { color: var(--color-text-faint); flex: none; }
.tk-q-n { flex: none; min-width: 19px; height: 19px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--green-100); color: var(--green-800); font-family: var(--font-heading); font-weight: 700; font-size: 11px; display: flex; align-items: center; justify-content: center; }

.tk-main { min-width: 0; }
.tk-pane-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding-bottom: var(--space-4); margin-bottom: var(--space-4); border-bottom: 1px solid var(--color-border); }
.tk-pane-head-l { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.tk-pane-title { font-family: var(--font-heading); font-weight: 800; font-size: var(--text-h3); color: var(--color-text); display: flex; align-items: center; gap: var(--space-3); margin: 0; }
.tk-pane-sub { font-size: var(--text-sm); color: var(--color-text-muted); margin: 2px 0 0; }
.tk-vista-seg { display: inline-flex; background: var(--stone-100); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 3px; flex: none; }
.tk-vista-seg button { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; padding: 6px var(--space-3); border-radius: var(--radius-sm); font-family: var(--font-heading); font-weight: 600; font-size: var(--text-xs); color: var(--color-text-muted); cursor: pointer; }
.tk-vista-seg button.active { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-xs); }

.tk-cols-people { grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); }
.tk-person-head { background: var(--stone-50); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.tk-person-stage, .tk-row-stage { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-heading); font-weight: 700; font-size: 10px; color: var(--color-text-muted); margin-bottom: 5px; white-space: nowrap; }
.tk-person-stage i, .tk-row-stage i { width: 7px; height: 7px; border-radius: 2px; background: var(--col); flex: none; }

.tk-mine-list { display: flex; flex-direction: column; gap: var(--space-5); }
.tk-mine-block { display: flex; flex-direction: column; gap: 6px; }
.tk-mine-block-h { display: inline-flex; align-items: center; gap: var(--space-2); align-self: flex-start; background: none; border: none; cursor: pointer; font-family: var(--font-heading); font-weight: 800; font-size: var(--text-base); color: var(--color-text); padding: 0; }
.tk-mine-block-h svg:last-child { color: var(--color-text-faint); }
.tk-row { display: flex; align-items: center; gap: var(--space-4); width: 100%; text-align: left; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-xs); cursor: pointer; transition: all var(--dur-fast); }
.tk-row:hover { border-color: var(--green-300); transform: translateY(-1px); }
.tk-row-stage { flex: none; width: 104px; margin: 0; }
.tk-row-title { flex: 1; min-width: 0; font-size: var(--text-sm); color: var(--color-text); font-weight: 500; }
.tk-row-meta { display: inline-flex; align-items: center; gap: var(--space-3); flex: none; }

.tk-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); padding: var(--space-16) var(--space-5); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-lg); }
.tk-empty-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--green-100); color: var(--green-700); display: flex; align-items: center; justify-content: center; }
.tk-empty strong { font-family: var(--font-heading); font-weight: 700; font-size: var(--text-lg); color: var(--color-text); }
.tk-empty span { font-size: var(--text-sm); color: var(--color-text-muted); max-width: 340px; }

.tk-resp { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--color-text); font-weight: 500; }
.tk-resp-you { font-family: var(--font-heading); font-weight: 700; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--green-800); background: var(--green-100); padding: 2px 6px; border-radius: var(--radius-pill); }
.tk-stage-read { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm); color: var(--color-text); }
.tk-stage-read i { width: 10px; height: 10px; border-radius: 3px; background: var(--col); flex: none; }
.tk-readonly-note { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--color-text-faint); margin: 0; border-top: 1px solid var(--color-border); padding-top: var(--space-3); }

@container portal (max-width: 1080px) {
  .tk { grid-template-columns: 1fr; }
  .tk-side { position: static; }
}
@container portal (max-width: 760px) {
  .tk-pane-head { flex-direction: column; }
  .tk-row { flex-wrap: wrap; gap: var(--space-2); }
  .tk-row-stage { width: auto; }
}
