/* ==========================================================================
   v5.1 — TAREFAS DA UNIDADE (/unit/tasks). Prefixo tar-.
   O dia (salas a preparar e a limpar, manutenções que vencem, avulsas), as
   manutenções que se repetem e o histórico.
   ========================================================================== */

.tar-h{ display:flex; align-items:center; flex-wrap:wrap; gap:.35rem .5rem; font-size:1rem; margin:0 0 .8rem; }
.tar-h > svg{ width:18px; height:18px; flex:none; color:var(--ps-mid); }
.tar-h .ps-muted{ font-size:.8rem; font-weight:400; }
.tar-h .ps-chip-btn{ font-size:.8rem; }

.tar-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:.5rem; }

/* O que fica à esquerda de uma linha: ícone, o quê e o detalhe. */
.tar-step-l{ display:flex; align-items:flex-start; gap:.45rem; min-width:0; flex:1 1 15rem; font-size:.88rem; color:var(--ps-ink-2); }
.tar-step-l > svg{ width:16px; height:16px; flex:none; margin-top:.15rem; color:var(--ps-ink-3); }
.tar-step-l > span{ min-width:0; overflow-wrap:anywhere; }
.tar-step-l b{ color:var(--ps-ink); font-weight:600; }
.tar-step-l small{ display:block; font-size:.78rem; color:var(--ps-ink-3); margin-top:.1rem; }

.tar-mark{ display:inline-flex; align-items:center; flex-wrap:wrap; gap:.4rem; margin:0; flex:none; }
.tar-mark .btn svg{ width:15px; height:15px; vertical-align:-2px; }
.tar-done{ display:inline-flex; align-items:center; gap:.3rem; font-size:.8rem; color:var(--ps-in); }
.tar-done svg{ width:15px; height:15px; flex:none; }
[data-bs-theme="dark"] .tar-done{ color:#3ee5b4; }

/* Salas: cada reserva do dia, com preparar (se tem itens) e limpar. */
.tar-room{ padding:.7rem .85rem; border:1px solid var(--ps-border); border-radius:var(--ps-r); background:var(--ps-surface); }
.tar-room.is-due{ box-shadow:inset 3px 0 0 #f59e0b; border-color:rgba(245,158,11,.4); }
.tar-room-h{ display:flex; align-items:center; gap:.65rem; }
.tar-room-t{ display:flex; flex-direction:column; min-width:0; line-height:1.3; }
.tar-room-t b{ font-size:.92rem; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tar-room-t small{ font-size:.78rem; color:var(--ps-ink-3); }
.tar-step{ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.45rem 1rem;
  margin-top:.55rem; padding-top:.55rem; border-top:1px dashed var(--ps-border); }
.tar-step form.d-inline{ margin:0; }

/* Manutenções e avulsas. */
.tar-item{ display:flex; align-items:center; flex-wrap:wrap; gap:.5rem .75rem; padding:.65rem .85rem;
  border:1px solid var(--ps-border); border-radius:var(--ps-r); background:var(--ps-surface); scroll-margin-top:5rem; }
.tar-item > .ps-pill{ flex:none; white-space:nowrap; }
.tar-item > form{ margin:0; }
.tar-item.is-late{ box-shadow:inset 3px 0 0 #e5484d; }
.tar-item.is-today{ box-shadow:inset 3px 0 0 #f59e0b; }
.tar-item.is-soon{ box-shadow:inset 3px 0 0 var(--ps-border-strong); }
.tar-item.is-done{ background:var(--ps-surface-2); }
.tar-item.is-done .tar-step-l b{ color:var(--ps-ink-2); font-weight:500; }
.tar-item:target, .tar-next li:target{ outline:2px solid var(--ps-mid); outline-offset:2px; }

/* Nova avulsa. */
.tar-new > summary{ list-style:none; display:inline-flex; cursor:pointer; }
.tar-new > summary::-webkit-details-marker{ display:none; }
.tar-new > summary svg{ transition:transform .2s var(--ps-ease); }
.tar-new[open] > summary{ border-color:var(--ps-mid); color:var(--ps-ink); }
.tar-new[open] > summary svg{ transform:rotate(45deg); }
.tar-new-form{ margin-top:.75rem; padding:1rem; border:1px dashed var(--ps-border-strong); border-radius:var(--ps-r); background:var(--ps-surface-2); }

.tar-next{ list-style:none; margin:0; padding:0; font-size:.85rem; color:var(--ps-ink-2); }
.tar-next li{ padding:.35rem .1rem; border-top:1px solid var(--ps-border); border-radius:4px; }
.tar-next li:first-child{ border-top:0; }
.tar-next b{ color:var(--ps-ink); font-weight:600; margin-right:.35rem; }

/* Manutenções que se repetem. */
.tar-every{ display:flex; gap:.5rem; }
.tar-every .ps-input{ width:5.5rem; flex:none; }
.tar-every .ps-select{ flex:1; min-width:0; }
.tar-rules{ display:grid; gap:.6rem; }
.ps-form-card.tar-rule{ display:flex; align-items:center; justify-content:space-between; gap:.75rem 1rem; padding:.85rem 1rem; }
.tar-rule.is-archived{ opacity:.7; }
.tar-rule-txt{ display:flex; flex-direction:column; align-items:flex-start; gap:.18rem; min-width:0; }
.tar-rule-txt b{ font-size:.95rem; font-weight:600; overflow-wrap:anywhere; }
.tar-rule-txt small{ font-size:.8rem; color:var(--ps-ink-3); }
.tar-rule-txt small .ps-pill{ margin-left:.25rem; font-size:.68rem; }
.tar-rule-acts{ display:flex; align-items:center; gap:.35rem; flex:none; }
.tar-rule-acts form{ margin:0; }

/* Marcar: "feito" é botão claro com o visto (a página tem muitos — escuros,
   pesavam); "pular" é só texto. */
.tar-mark .tar-ok{ border-color:var(--ps-border-strong); }
.tar-mark .tar-ok:hover{ border-color:var(--ps-in); color:var(--ps-in); background:rgba(0,176,131,.07); }
[data-bs-theme="dark"] .tar-mark .tar-ok:hover{ border-color:#3ee5b4; color:#3ee5b4; }
.tar-mark .tar-skip{ border:0; background:none; color:var(--ps-ink-3); padding-left:.4rem; padding-right:.4rem; }
.tar-mark .tar-skip:hover{ color:var(--ps-ink); text-decoration:underline; }
.tar-step-l small a{ color:inherit; text-decoration:underline; text-decoration-color:rgba(var(--ps-accent-rgb),.8); text-underline-offset:2px; }
