/* =====================================================================
   STF Taskboard — Gantt (30-day forward planner)
   One row per project task. Leads drag bars to plan multiday spans and
   assign members. Aligns with the studio's calm, hairline-first chrome.
   ===================================================================== */
.tb-gantt { display: flex; flex-direction: column; }

/* legend — now portaled into the shared topbar actions space */
.tb-g-legend { display: flex; align-items: center; gap: 14px; }
.tb-g-legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--fg-3); white-space: nowrap; }
.tb-g-legend .d { width: 9px; height: 9px; border-radius: 2px; }
.tb-g-hint { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--fg-4); white-space: nowrap; }
.tb-g-hint svg { width: 13px; height: 13px; }

/* scroll frame — fills available width, no horizontal scroll */
.tb-g-scroll { overflow: hidden; }
.tb-g-inner { }

/* Gantt flows naturally with the page — no contained viewport. Rows run
   compact (28px) so a typical project load fits one screen with room
   to spare, rather than requiring a scroll. */
.tb-scroll-pad.gantt-mode { padding-bottom: 28px; }
.tb-g-stickyhead { position: sticky; top: 0; z-index: 6; background: var(--bg-1); }

/* shared column geometry: fixed label gutter + timeline */
.tb-g-months,
.tb-g-head,
.tb-g-row { display: grid; grid-template-columns: 248px 1fr; }

/* month strip */
.tb-g-months { border-bottom: 1px solid var(--border-1); }
.tb-g-mrow { display: flex; }
.tb-g-mrow .mo { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-4); padding: 3px 0 3px 10px; border-left: 1px solid var(--border-1); }
.tb-g-mrow .mo:first-child { border-left: none; }

/* corner + day header */
.tb-g-corner { padding: 0 16px; display: flex; align-items: center; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-4); border-right: 1px solid var(--border-1); }
.tb-g-head { border-bottom: 1px solid var(--border-1); background: var(--bg-2); }
.tb-g-days { display: flex; }
.tb-g-day { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0 3px; position: relative; }
.tb-g-day.alt { background: color-mix(in srgb, var(--fg-1) 5%, transparent); }
.tb-g-day.we { background: rgba(0,0,0, 0.09); }
.tb-g-day.wk { box-shadow: inset 1px 0 0 var(--border-1); }
.tb-g-day .wd { font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-4); }
.tb-g-day .dn { font-size: 12px; font-weight: 500; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.tb-g-day.today { background: var(--stf-blueprint-faint); }
.tb-g-day.today .dn { color: var(--stf-blueprint); font-weight: 700; }
.tb-g-day .td { position: absolute; top: -1px; left: 50%; transform: translate(-50%, -100%); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stf-blueprint); white-space: nowrap; display: none; }

/* group label */
.tb-g-group { border-bottom: 1px solid var(--border-1); }
.tb-g-group:last-child { border-bottom: none; }
.tb-g-grouplabel { display: flex; align-items: center; justify-content: flex-start; gap: 9px; padding: 4px 16px; background: var(--bg-2); border-bottom: 1px solid var(--border-1); }
.tb-g-grouplabel .nm { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-2); }
.tb-g-grouplabel .cnt { font-size: 10.5px; color: var(--fg-4); font-variant-numeric: tabular-nums; background: var(--bg-3); border-radius: 999px; padding: 1px 8px; }

/* task row */
.tb-g-row { border-top: 1px solid var(--border-1); }
.tb-g-row:first-of-type { border-top: none; }
.tb-g-row:hover { background: var(--bg-2); }
.tb-g-rowlabel { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 0 16px; border-right: 1px solid var(--border-1); min-width: 0; }
.tb-g-rowlabel .t { font-size: 13px; font-weight: 500; color: var(--fg-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.tb-g-title-input {
  font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: var(--fg-1);
  background: transparent; border: none; border-bottom: 1.5px solid var(--stf-blueprint);
  outline: none; padding: 0; width: 100%; min-width: 0; line-height: inherit;
}

/* label row: name + pencil */
.tb-g-label-row { display: flex; align-items: center; gap: 5px; min-width: 0; width: 100%; justify-content: flex-end; }
.tb-g-label-row .tb-g-grip { margin-right: auto; flex-shrink: 0; }
.tb-g-label-row .t { flex: 1; min-width: 0; }
.tb-g-label-row .t.nav { cursor: pointer; }
.tb-g-label-row .t.nav:hover { text-decoration: underline; text-underline-offset: 2px; }

/* drag grip */
.tb-g-grip {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: var(--radius-xs);
  color: var(--fg-4); cursor: grab; padding: 0; line-height: 0;
  opacity: 0; transition: opacity var(--dur-fast) var(--ease-stf), color var(--dur-fast) var(--ease-stf);
}
.tb-g-row:hover .tb-g-grip,
.tb-g-grouplabel:hover .tb-g-grip { opacity: 1; }
.tb-g-grip:hover { color: var(--fg-2); }
.tb-g-grip:active { cursor: grabbing; }

/* collapse chevron */
.tb-g-chevron {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border: none; background: none; padding: 0; cursor: pointer;
  color: var(--fg-3); transition: color var(--dur-fast) var(--ease-stf), transform var(--dur-fast) var(--ease-stf);
}
.tb-g-chevron svg { display: block; transition: transform var(--dur-base) var(--ease-glide); }
.tb-g-chevron.collapsed svg { transform: rotate(-90deg); }
.tb-g-chevron:hover { color: var(--fg-1); }

/* group dragging opacity */
.tb-g-group--dragging { opacity: 0.45; }

/* summary bar row */
.tb-g-summary-row { background: color-mix(in srgb, var(--bg-2) 50%, transparent); }
.tb-g-summary-meta { font-size: 11px; color: var(--fg-4); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.tb-g-summary-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 16px; border-radius: 999px; padding: 0 5px;
  font-size: 10px; font-weight: 700; color: #fff; background: rgba(0,0,0,0.22);
  letter-spacing: 0.04em; pointer-events: none;
}

/* collapsed project: becomes a task-bar row */
.tb-g-grp-name-wrap { display: flex; align-items: center; gap: 4px; width: 100%; }
.tb-g-chevron--right { margin-left: auto; }
.tb-g-grouplabel.is-collapsed { display: grid; grid-template-columns: 248px 1fr; padding: 0; align-items: stretch; }
.tb-g-grouplabel.is-collapsed .tb-g-grp-name-wrap { padding: 6px 16px; border-right: 1px solid var(--border-1); align-items: center; }
.tb-g-grp-name-wrap .nm.nav { cursor: pointer; }
.tb-g-grp-name-wrap .nm.nav:hover { text-decoration: underline; text-underline-offset: 2px; }

/* pencil button — appears on row/grouplabel hover only */
.tb-g-pencil {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: var(--radius-sm);
  border: none; background: none; color: var(--fg-4); cursor: pointer; padding: 0; line-height: 0;
  opacity: 0; transition: opacity var(--dur-fast) var(--ease-stf), color var(--dur-fast) var(--ease-stf), background var(--dur-fast) var(--ease-stf);
}
.tb-g-row:hover .tb-g-pencil,
.tb-g-grouplabel:hover .tb-g-pencil { opacity: 1; }
.tb-g-pencil:hover { color: var(--stf-blueprint); background: var(--stf-blueprint-faint); }

/* group name input */
.tb-g-grp-input {
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-2); background: transparent;
  border: none; border-bottom: 1.5px solid var(--stf-blueprint);
  outline: none; padding: 0; width: 160px;
}

/* rename confirm: allow long names to wrap */
.tb-g-confirm .rng .old,
.tb-g-confirm .rng .new { word-break: break-word; max-width: 90px; }
.tb-g-rowlabel .m { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--fg-4); font-variant-numeric: tabular-nums; }
.tb-g-rowlabel .m .dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }

/* timeline track */
.tb-g-track { position: relative; height: 28px; }
.tb-g-grid { position: absolute; inset: 0; display: flex; }
.tb-g-grid .c { flex: 1; min-width: 0; }
.tb-g-grid .c.alt { background: color-mix(in srgb, var(--fg-1) 5%, transparent); }
.tb-g-grid .c.we { background: rgba(0,0,0, 0.09); }
.tb-g-grid .c.wk { box-shadow: inset 1px 0 0 var(--border-1); }
.tb-g-grid .c.today { background: color-mix(in srgb, var(--stf-blueprint-faint) 70%, transparent); }

/* the bar */
.tb-g-task {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 18px; border-radius: var(--radius-sm); display: flex; align-items: center;
  padding: 0 8px; overflow: hidden; box-shadow: var(--shadow-xs);
  transition: filter var(--dur-fast) var(--ease-stf);
}
.tb-g-task.lead { cursor: grab; }
.tb-g-task.lead:active { cursor: grabbing; }
.tb-g-task:hover { filter: brightness(1.04); }
.tb-g-task .lbl { font-size: 11.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.01em; pointer-events: none; }
.tb-g-task .hl, .tb-g-task .hr { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; }
.tb-g-task .overlap-hr { width: 13px; cursor: ew-resize; }
.tb-g-task .overlap-hr::after { opacity: 0.9; }
.tb-g-task .hl { left: 0; } .tb-g-task .hr { right: 0; }
.tb-g-task .hl::after, .tb-g-task .hr::after { content: ""; position: absolute; top: 50%; transform: translateY(-50%); width: 2px; height: 12px; border-radius: 2px; background: rgba(255,255,255,0.6); opacity: 0; transition: opacity var(--dur-fast) var(--ease-stf); }
.tb-g-task .hl::after { left: 3px; } .tb-g-task .hr::after { right: 3px; }
.tb-g-task:hover .hl::after, .tb-g-task:hover .hr::after { opacity: 1; }
body.tb-g-dragging { cursor: grabbing; user-select: none; }

/* assignee cluster, just right of the bar */
.tb-g-people-wrap { position: absolute; top: 50%; transform: translateY(-50%); }
.tb-g-people { display: flex; align-items: center; }
.tb-g-av {
  width: 19px; height: 19px; border-radius: 999px; margin-left: -6px; flex: none;
  display: grid; place-items: center; font-size: 9px; font-weight: 600; color: #fff;
  font-family: var(--font-sans); line-height: 1; text-align: center;
  letter-spacing: 0.02em; font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--bg-1); box-shadow: var(--shadow-xs);
  -webkit-font-smoothing: antialiased;
}
.tb-g-av:first-child { margin-left: 0; }
.tb-g-av.rm { cursor: pointer; transition: transform var(--dur-fast) var(--ease-stf); }
.tb-g-av.rm:hover { transform: translateY(-2px); }
.tb-g-add {
  box-sizing: border-box;
  width: 19px; height: 19px; border-radius: 999px; margin-left: 4px; flex: none; padding: 0;
  display: flex; align-items: center; justify-content: center; line-height: 0;
  border: 1px dashed var(--border-2); background: var(--bg-1);
  color: var(--fg-3); cursor: pointer; transition: border-color var(--dur-fast) var(--ease-stf), color var(--dur-fast) var(--ease-stf);
}
.tb-g-add svg { display: block; }
.tb-g-add:hover { border-color: var(--stf-blueprint); color: var(--stf-blueprint); border-style: solid; }

/* =====================================================================
   External deadline — the bar extends, in a muted tone of the same hue,
   from the task's internal end (solid bar end) out to the client date.
   Internal deadline = the solid bar's own right edge (no separate marker).
   ===================================================================== */
.tb-g-ext {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border: 1px solid transparent;
  background-clip: padding-box;
  z-index: 0; pointer-events: auto;
}
.tb-g-ext .cap { position: absolute; top: 4px; bottom: 4px; right: 0; width: 2.5px; border-radius: 2px; transition: width var(--dur-fast) var(--ease-stf), filter var(--dur-fast) var(--ease-stf); }
/* draggable external-deadline edge (leads) */
.tb-g-ext.lead .exth { position: absolute; top: -2px; bottom: -2px; right: -3px; width: 12px; cursor: ew-resize; z-index: 2; }
.tb-g-ext.lead:hover .cap { width: 4px; filter: brightness(1.15); }
.tb-g-ext.lead.planning .cap { width: 4px; }
/* when extended, the solid bar squares off its right edge so the two read as one continuous bar */
.tb-g-task.has-ext { border-top-right-radius: 0; border-bottom-right-radius: 0; box-shadow: none; }

/* legend swatch: solid bar + muted tail */
.tb-g-legend .lg .bar { display: inline-flex; align-items: center; height: 9px; }
.tb-g-legend .lg .bar .solid { width: 13px; height: 9px; border-radius: 2px 0 0 2px; background: var(--fg-3); }
.tb-g-legend .lg .bar .tail { width: 10px; height: 9px; border-radius: 0 2px 2px 0; background: color-mix(in srgb, var(--fg-3) 22%, var(--bg-1)); border: 1px solid color-mix(in srgb, var(--fg-3) 42%, transparent); border-left: none; }

/* schedule-change confirm — reuses .tb-confirm chrome, a touch wider */
.tb-g-confirm { width: 224px; }
.tb-g-confirm .rng { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 11.5px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.tb-g-confirm .rng .old { color: var(--fg-4); text-decoration: line-through; }
.tb-g-confirm .rng .arw { color: var(--fg-4); }
.tb-g-confirm .rng .new { color: var(--stf-blueprint); font-weight: 600; }

/* assign modal — roster list big enough to see everyone at once */
.tb-g-roster { display: flex; flex-direction: column; gap: 2px; max-height: 52vh; overflow-y: auto; padding: 2px 0; }
.tb-g-rosteritem { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 12px; border: none; background: none; border-radius: var(--radius-md); cursor: pointer; transition: background var(--dur-fast) var(--ease-stf); }
.tb-g-rosteritem:hover:not(:disabled) { background: var(--bg-2); }
.tb-g-rosteritem:disabled { cursor: default; }
.tb-g-rosteritem .nm { font-size: 13.5px; color: var(--fg-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-g-rosteritem .role { font-size: 11px; color: var(--fg-4); }
.tb-g-rosteritem .meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.tb-g-rosteritem .load { margin-left: auto; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-4); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-g-rosteritem.assigned .nm { color: var(--fg-3); }
.tb-g-rosteritem.assigned .load { color: var(--stf-success); display: inline-flex; align-items: center; gap: 4px; }
.tb-g-rosteritem .av { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; flex: none; letter-spacing: 0.02em; -webkit-font-smoothing: antialiased; }
