/* =====================================================================
   Task board (/tasks/) - reuses dashboard.css tokens, adds board bits.
   Class prefix: tt-  (team tracker) to avoid clashing with dashboard.css
   ===================================================================== */

.tt-wrap { max-width: none; }

.tt-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 4px 0 22px;
}
.tt-seg {
  display: inline-flex; border: 1px solid var(--hair); border-radius: 10px; overflow: hidden;
}
.tt-seg button {
  border: 0; background: rgba(18,20,24,0.6); color: var(--text-mid);
  font: inherit; font-size: 13px; padding: 8px 14px; cursor: pointer;
  border-right: 1px solid var(--hair); transition: background .15s ease, color .15s ease;
}
.tt-seg button:last-child { border-right: 0; }
.tt-seg button:hover { color: var(--text-hi); }
.tt-seg button.active { background: var(--gold); color: #1a1408; font-weight: 700; }

.tt-select, .tt-search {
  font: inherit; font-size: 13px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--hair); background: rgba(18,20,24,0.6); color: var(--text-hi); outline: none;
  transition: border-color .15s ease;
}
.tt-select:focus, .tt-search:focus { border-color: var(--gold-line); }
.tt-search { min-width: 200px; flex: 1; max-width: 320px; }
.tt-select option { background: #16181c; }

.tt-spacer { flex: 1; }
.tt-meta { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
#ttFoot { white-space: normal; line-height: 1.5; }

.tt-add {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--gold-line);
  background: rgba(212,175,95,0.14); color: var(--gold-bright);
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .15s ease;
}
.tt-add:hover { background: rgba(212,175,95,0.24); }

/* stage groups */
.tt-group { margin-bottom: 26px; }
/* Full-width header band so each pipeline/stage section is easy to spot
   all the way across the board. */
.tt-group-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold-bright);
  padding: 10px 15px; margin-bottom: 14px;
  background: linear-gradient(90deg, rgba(212,175,95,0.16), rgba(212,175,95,0.04) 55%, transparent);
  border: 1px solid var(--gold-faint);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
}
.tt-group-head .tt-count {
  background: var(--gold); color: #1a1408; font-size: 11px; font-weight: 700;
  border-radius: 10px; padding: 1px 9px;
}
.tt-group-head .tt-pipe {
  margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500;
  font-size: 12px; color: var(--text-mid);
}

/* task card */
.tt-card {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 14px 16px; margin-bottom: 9px;
  border: 1px solid var(--hair); border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 60%), var(--panel);
  transition: border-color .15s ease, transform .15s ease;
}
.tt-card:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.12); }

/* Overdue = a red backlit glow (same idea as the home page's glowing tiles).
   This layers on top of the card's own fill, so a solid-red P1 card still
   reads as P1 while the halo marks it overdue - fill = priority, glow = late. */
.tt-card.tt-overdue {
  border-color: rgba(226,66,60,0.75);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 0 0 1px rgba(226,66,60,0.45),
    0 0 30px -4px rgba(226,66,60,0.60),
    0 20px 40px -26px rgba(0,0,0,0.9);
}
.tt-card.tt-overdue:hover { border-color: rgba(226,66,60,0.95); }

/* Priority ranking - color-coded like the original tracker.
   Fills are ~80% opaque (only 20% transparent) so priority reads at a glance. */
.tt-card.tt-rank1 { border-color: #e0524e; background: rgba(198,58,54,0.80); }
.tt-card.tt-rank1 .tt-title, .tt-card.tt-rank1 .tt-sub, .tt-card.tt-rank1 .tt-client,
.tt-card.tt-rank1 .tt-due, .tt-card.tt-rank1 .tt-due.tt-od, .tt-card.tt-rank1 .tt-note { color: #fff; }
.tt-card.tt-rank2 { border-color: #e0a84a; border-width: 2px; background: rgba(150,104,36,0.80); }
.tt-card.tt-rank2 .tt-title, .tt-card.tt-rank2 .tt-sub, .tt-card.tt-rank2 .tt-client,
.tt-card.tt-rank2 .tt-due, .tt-card.tt-rank2 .tt-note { color: #fff6e8; }
/* P3 keeps its gold border for identification but uses the same (unranked)
   fill as a plain card - a lighter-touch priority signal. */
.tt-card.tt-rank3 { border-color: #d9c24a; border-width: 2px; }
.tt-ranktag {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
  border-radius: 8px; padding: 1px 8px; margin-left: 6px; vertical-align: middle;
  border: 1px solid var(--hair); color: var(--text-mid);
}
.tt-card.tt-rank1 .tt-ranktag { background: #e0524e; color: #fff; border-color: #e0524e; }
.tt-card.tt-rank2 .tt-ranktag { color: #e0a84a; border-color: rgba(224,168,74,0.6); }
.tt-card.tt-rank3 .tt-ranktag { color: #d9c24a; border-color: rgba(217,194,74,0.55); }

/* Per-card priority selector */
.tt-rank {
  font: inherit; font-size: 11px; padding: 3px 6px; min-width: 58px;
  border-radius: 8px; border: 1px solid var(--hair); background: rgba(18,20,24,0.6);
  color: var(--text-mid); cursor: pointer; outline: none;
}
.tt-rank:focus { border-color: var(--gold-line); }
.tt-rank option { background: #16181c; }

/* Per-person assignee badge colors */
.tt-badge.u1 { border-color: rgba(120,160,224,0.6); color: #a9c6f2; }
.tt-badge.u2 { border-color: rgba(150,130,220,0.6); color: #c7b1f0; }
.tt-badge.u3 { border-color: rgba(110,180,130,0.6); color: #9fdcaa; }
.tt-badge.u4 { border-color: rgba(224,168,90,0.6);  color: #f0c58c; }
.tt-badge.u5 { border-color: rgba(110,200,196,0.6); color: #9fe0dc; }
.tt-badge.u0 { border-color: var(--hair); color: var(--text-mid); }

.tt-check {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 20px; height: 20px; margin-top: 1px; border-radius: 6px;
  border: 2px solid var(--gold-line); background: rgba(18,20,24,0.6); cursor: pointer;
  transition: background .15s ease;
}
.tt-check:checked { background: var(--gold); border-color: var(--gold); }
.tt-check:checked::after { content: "\2713"; display: block; color: #1a1408; font-size: 14px; font-weight: 800; line-height: 16px; text-align: center; }
.tt-check:disabled { opacity: .5; cursor: default; }

.tt-body { flex: 1; min-width: 0; }
.tt-title { font-size: 15px; font-weight: 600; color: var(--text-hi); }
.tt-sub { font-size: 12.5px; color: var(--text-mid); margin-top: 3px; }
.tt-sub .tt-client { color: var(--text); font-weight: 600; }
.tt-due { font-weight: 600; }
.tt-due.tt-od { color: #ef6b66; }
.tt-note { font-size: 12.5px; color: var(--text-dim); margin-top: 5px; white-space: pre-wrap; }
.tt-stflag { display: inline-block; font-size: 10.5px; color: var(--gold-bright); border: 1px solid var(--hair); border-radius: 9px; padding: 0 7px; margin-left: 6px; }

.tt-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.tt-badge { font-size: 11px; border-radius: 10px; padding: 2px 9px; border: 1px solid var(--hair); color: var(--text-mid); white-space: nowrap; }
/* Multiple assignees: one tidy right-aligned row that wraps. */
.tt-badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 180px; }

/* Assignee toggles in the add/edit popup. */
.tt-assignee {
  -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit;
  font-size: 12.5px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--hair); background: rgba(18, 20, 24, 0.55); color: var(--text-dim);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.tt-assignee:hover { color: var(--text-mid); border-color: var(--gold-faint); }
.tt-assignee.on {
  color: var(--gold-bright); border-color: var(--gold-line);
  background: rgba(212, 175, 95, 0.13); font-weight: 600;
}
.tt-assignee.on::before { content: "✓ "; }

/* Projects in a stage with no open tasks - visible, one tap to fix. */
.tt-idle { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 4px 2px; }
.tt-idle-lab { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); margin-right: 2px; }
.tt-idle-chip {
  -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit;
  font-size: 12px; padding: 4px 11px; border-radius: 999px;
  border: 1px dashed var(--hair); background: none; color: var(--text-dim);
  transition: color .15s ease, border-color .15s ease;
}
.tt-idle-chip:hover { color: var(--gold-bright); border-color: var(--gold-line); }
.tt-edit {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--hair); background: none; color: var(--text-mid); transition: color .15s ease, border-color .15s ease;
}
.tt-edit:hover { color: var(--gold-bright); border-color: var(--gold-faint); }

.tt-done-wrap { margin-top: 26px; border-top: 1px solid var(--hair-soft); padding-top: 14px; }
.tt-done-wrap summary { cursor: pointer; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); font-weight: 700; }
.tt-done-wrap .tt-title { text-decoration: line-through; color: var(--text-dim); font-weight: 400; }

.tt-state { padding: 40px 4px; color: var(--text-dim); font-size: 14px; text-align: center; }
.tt-err {
  display: none; margin: 0 0 16px; padding: 12px 16px; border-radius: 10px;
  border: 1px solid rgba(224,136,108,0.5); background: rgba(224,136,108,0.08); color: #e0a84a; font-size: 13.5px;
}
.tt-err.show { display: block; }

/* modal */
.tt-overlay {
  position: fixed; inset: 0; z-index: 30; display: none;
  align-items: center; justify-content: center; padding: 18px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
}
.tt-overlay.show { display: flex; }
.tt-modal {
  width: 100%; max-width: 460px; border-radius: 16px; padding: 22px;
  background: var(--panel-solid); border: 1px solid var(--hair);
  border-top: 4px solid var(--gold);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.8);
}
.tt-modal h3 { font-size: 18px; color: var(--text-hi); margin-bottom: 14px; }
.tt-modal label { display: block; font-size: 12.5px; color: var(--text-mid); font-weight: 600; margin: 12px 0 4px; }
.tt-modal input, .tt-modal select, .tt-modal textarea {
  width: 100%; font: inherit; font-size: 14px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--hair); background: rgba(18,20,24,0.6); color: var(--text-hi); outline: none;
}
.tt-modal textarea { resize: vertical; min-height: 60px; }
.tt-modal input:focus, .tt-modal select:focus, .tt-modal textarea:focus { border-color: var(--gold-line); }
.tt-modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.t-btn.danger {
  border-color: rgba(224,82,78,0.5); background: rgba(224,82,78,0.10); color: #e8908c;
}
.t-btn.danger:hover { background: rgba(224,82,78,0.20); color: #ffd9d6; }
.tt-modal select#f_rank option { background: #16181c; }

.tt-toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #26241f; border: 1px solid var(--gold-line); color: var(--text-hi);
  padding: 11px 18px; border-radius: 10px; font-size: 13.5px; z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.tt-toast.show { opacity: 1; }

/* ---- calendar view: the month as a workload map --------------------------- */
.tt-hrs {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  border: 1px solid var(--gold-line); color: var(--gold-bright);
  border-radius: 8px; padding: 0 7px; vertical-align: 1px;
}
.tt-card.tt-rank1 .tt-hrs, .tt-card.tt-rank2 .tt-hrs { color: #fff; border-color: rgba(255,255,255,0.55); }
.tt-lnk { color: var(--gold-bright); font-weight: 600; text-decoration: none; border-bottom: 1px dashed rgba(212,175,95,0.5); }
.tt-lnk:hover { border-bottom-style: solid; }
.tt-card.tt-rank1 .tt-lnk, .tt-card.tt-rank2 .tt-lnk { color: #fff; border-color: rgba(255,255,255,0.55); }

.tt-cal-bar { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; flex-wrap: wrap; }
.tt-cal-nav {
  -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit;
  font-size: 13px; font-weight: 700; padding: 6px 13px; border-radius: 9px;
  border: 1px solid var(--hair); background: rgba(18,20,24,0.6); color: var(--text-mid);
  transition: color .15s ease, border-color .15s ease;
}
.tt-cal-nav:hover { color: var(--gold-bright); border-color: var(--gold-line); }
.tt-cal-month { font-size: 16px; font-weight: 700; color: var(--text-hi); margin-left: 6px; }
.tt-cal-sum { margin-left: auto; font-size: 12.5px; color: var(--text-dim); }

/* The month fills whatever width it has (no horizontal scrolling) and every
   tile is the same fixed size whether the day is empty or stacked: a busy
   day's list scrolls inside its tile instead of stretching the row. */
.tt-cal-wrap { overflow: visible; --cal-tile: 148px; }
.tt-cal {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto; grid-auto-rows: var(--cal-tile);
  gap: 5px; min-width: 0; width: 100%;
}
.tt-cal-dow {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-dim); text-align: center; padding: 2px 0 6px; overflow: hidden; white-space: nowrap;
}
.tt-cal-cell {
  height: var(--cal-tile); min-height: 0; box-sizing: border-box; min-width: 0;
  border: 1px solid var(--hair-soft); border-radius: 10px;
  background: var(--panel); padding: 6px 6px 7px;
  display: flex; flex-direction: column; gap: 4px; overflow: hidden;
}
.tt-cal-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; padding-right: 1px; }
.tt-cal-list::-webkit-scrollbar { width: 5px; }
.tt-cal-list::-webkit-scrollbar-thumb { background: rgba(212,175,95,0.35); border-radius: 3px; }
.tt-cal-cell.out { background: none; border-color: transparent; }
.tt-cal-cell.wknd { background: rgba(18,20,24,0.35); }
.tt-cal-cell.today { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-glow) inset; }
.tt-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.tt-cal-d { font-size: 11.5px; font-weight: 700; color: var(--text-dim); }
.tt-cal-cell.today .tt-cal-d { color: var(--gold-bright); }
.tt-cal-n { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--text-dim); border: 1px dashed var(--hair); border-radius: 8px; padding: 0 6px; white-space: nowrap; }
.tt-cal-load {
  font-size: 10.5px; font-weight: 700; border-radius: 8px; padding: 0 7px;
  border: 1px solid var(--hair); color: var(--text-mid); white-space: nowrap;
}
.tt-cal-load.ok   { color: #9fdcaa; border-color: rgba(111,177,133,0.55); }
.tt-cal-load.warn { color: #e0a84a; border-color: rgba(224,168,74,0.55); }
.tt-cal-load.hot  { color: #ef6b66; border-color: rgba(226,66,60,0.6); background: rgba(226,66,60,0.12); }

.tt-cal-task {
  -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit; text-align: left;
  display: flex; align-items: center; gap: 5px; width: 100%;
  font-size: 11.5px; padding: 3px 7px; border-radius: 8px;
  border: 1px solid var(--hair); background: rgba(255,255,255,0.025); color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.tt-cal-task:hover { border-color: var(--gold-line); background: rgba(212,175,95,0.10); }
.tt-cal-task .tt-cal-tt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-cal-task .tt-cal-h { flex: none; font-size: 10px; font-weight: 700; color: var(--gold-bright); }
.tt-cal-task.p1 { border-color: rgba(224,82,78,0.7); background: rgba(198,58,54,0.55); color: #fff; }
.tt-cal-task.p1 .tt-cal-h { color: #ffe3e1; }
.tt-cal-task.p2 { border-color: rgba(224,168,74,0.65); background: rgba(150,104,36,0.45); color: #fff3df; }
.tt-cal-task.p3 { border-color: rgba(217,194,74,0.55); }
.tt-cal-task.od { box-shadow: 0 0 0 1px rgba(226,66,60,0.5); }
.tt-cal-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; }
.tt-cal-dot.u1 { color: #a9c6f2; } .tt-cal-dot.u2 { color: #c7b1f0; }
.tt-cal-dot.u3 { color: #9fdcaa; } .tt-cal-dot.u4 { color: #f0c58c; }
.tt-cal-dot.u5 { color: #9fe0dc; } .tt-cal-dot.u0 { color: var(--text-dim); }
.tt-cal-hint { font-size: 12px; color: var(--text-dim); margin-top: 12px; line-height: 1.55; }
/* narrow screens: seven columns still fit; chips shed their hour tags */
@media (max-width: 900px) {
  .tt-cal-wrap { --cal-tile: 124px; }
  .tt-cal { gap: 3px; }
  .tt-cal-cell { padding: 4px 4px 5px; border-radius: 7px; }
  .tt-cal-task { font-size: 10.5px; padding: 2px 5px; gap: 3px; }
  .tt-cal-task .tt-cal-h, .tt-cal-load, .tt-cal-n { display: none; }
  .tt-cal-ev { font-size: 10px; padding: 2px 4px; }
  .tt-cal-ev .tt-cal-evt { display: none; }
}
@media (max-width: 560px) {
  .tt-cal-wrap { --cal-tile: 104px; }
  .tt-cal-dow { font-size: 9.5px; letter-spacing: .04em; }
  .tt-cal-d { font-size: 10.5px; }
  .tt-cal-task { font-size: 9.5px; padding: 2px 3px; border-radius: 5px; }
  .tt-cal-dot { width: 6px; height: 6px; }
}

/* ---- per-task work steps (the "what got done" log on each card) ---------- */
.tt-steps { margin-top: 8px; border-top: 1px dashed rgba(255,255,255,0.16); padding-top: 6px; }
.tt-step { display: flex; align-items: baseline; gap: 7px; font-size: 12px; color: var(--text-mid); padding: 1.5px 0; }
.tt-step-ck { color: #8fd8a2; font-weight: 700; flex: none; }
.tt-step-tx { min-width: 0; overflow-wrap: anywhere; }
.tt-step-meta { flex: none; margin-left: auto; font-size: 10.5px; color: var(--text-dim); white-space: nowrap; }
.tt-step-del { flex: none; border: 0; background: none; color: var(--text-dim); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; visibility: hidden; }
.tt-step:hover .tt-step-del { visibility: visible; }
.tt-step-del:hover { color: #e88b86; }
.tt-step-addrow { display: flex; gap: 6px; margin-top: 5px; }
.tt-step-in {
  flex: 1; min-width: 0; font: inherit; font-size: 12px; color: var(--text-hi);
  background: rgba(0,0,0,0.20); border: 1px dashed rgba(255,255,255,0.18); border-radius: 8px; padding: 5px 10px;
}
.tt-step-in::placeholder { color: var(--text-dim); }
.tt-step-in:focus { border-style: solid; border-color: var(--gold-faint); outline: none; }
.tt-step-add {
  flex: none; border: 1px solid var(--hair); background: none; color: var(--gold-bright);
  border-radius: 8px; font: inherit; font-size: 11.5px; font-weight: 600; padding: 4px 12px; cursor: pointer;
}
.tt-step-add:hover { border-color: var(--gold-faint); }
/* keep the log legible on priority-filled cards */
.tt-card.tt-rank1 .tt-step, .tt-card.tt-rank2 .tt-step { color: #fff; }
.tt-card.tt-rank1 .tt-step-meta, .tt-card.tt-rank2 .tt-step-meta { color: rgba(255,255,255,0.75); }
.tt-card.tt-rank1 .tt-step-ck, .tt-card.tt-rank2 .tt-step-ck { color: #b8f4c6; }
.tt-card.tt-rank1 .tt-step-in, .tt-card.tt-rank2 .tt-step-in { color: #fff; background: rgba(0,0,0,0.25); }

/* Microsoft 365 calendar events on the task calendar - clearly not tasks */
.tt-cal-ev { display: flex; align-items: center; gap: 5px; width: 100%; box-sizing: border-box; margin: 2px 0; padding: 3px 6px; border-radius: 7px; border: 1px dashed rgba(143,184,224,0.55); background: rgba(143,184,224,0.08); color: #c9dcee; font-size: 11px; text-decoration: none; text-align: left; }
.tt-cal-ev:hover { background: rgba(143,184,224,0.16); }
.tt-cal-evdot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #8fb8e0; display: inline-block; }
.tt-cal-evt { flex: none; font-weight: 700; color: #8fb8e0; font-size: 10px; }
.tt-cal-ev .tt-cal-tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-cal-evkey { color: #8fb8e0; } .tt-cal-evnote { color: #e0c274; }
