/* gantt.css - Gantt tab (planner.digimax.mu). All selectors are prefixed .gt */
.gt {
  --gt-red: #E3262E; --gt-ink: #161616; --gt-line: #E3E5E8; --gt-muted: #6B7280;
  --gt-bg: #fff; --gt-soft: #F6F7F8; --gt-row: 28px; --gt-head: 62px; --gt-lw: 470px;
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0;
  color: var(--gt-ink); font-family: inherit;
}
.gt [hidden] { display: none !important; }

/* toolbar */
.gt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.gt-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gt-muted); }
.gt-field input, .gt-date {
  font: inherit; font-size: 13px; color: var(--gt-ink); border: 1px solid var(--gt-line); border-radius: 6px;
  padding: 4px 6px; background: #fff; min-height: 30px;
}
.gt-btn, .gt-seg button {
  font: inherit; font-size: 13px; border: 1px solid var(--gt-line); background: #fff; color: var(--gt-ink);
  padding: 5px 11px; border-radius: 6px; cursor: pointer; min-height: 30px; white-space: nowrap;
}
.gt-btn:hover, .gt-seg button:hover { border-color: #C9CDD2; background: var(--gt-soft); }
.gt-btn:disabled { opacity: .45; cursor: not-allowed; }
.gt-btn-primary { background: var(--gt-red); border-color: var(--gt-red); color: #fff; }
.gt-btn-primary:hover { background: #C81F27; border-color: #C81F27; }
.gt-seg { display: inline-flex; }
.gt-seg button { border-radius: 0; margin-left: -1px; }
.gt-seg button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.gt-seg button:last-child { border-radius: 0 6px 6px 0; }
.gt-seg button[aria-pressed="true"] { background: var(--gt-ink); border-color: var(--gt-ink); color: #fff; position: relative; }
.gt :focus-visible { outline: 2px solid var(--gt-red); outline-offset: 1px; }

/* banners */
.gt-overrun {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border-radius: 8px;
  background: #FDECEC; border: 1px solid #F5B8BA; color: #8A1218; font-size: 14px;
}
.gt-overrun .gt-btn { border-color: var(--gt-red); color: var(--gt-red); }
.gt-empty { padding: 32px; text-align: center; color: var(--gt-muted); }

/* scroll panel: one container scrolls both ways; list column + header are sticky */
.gt-scroll {
  overflow: auto; border: 1px solid var(--gt-line); border-radius: 10px; background: var(--gt-bg);
  max-height: max(360px, calc(100vh - 260px)); overscroll-behavior: contain;
}
.gt-grid { display: grid; grid-template-columns: var(--gt-lw) max-content; width: max-content; min-width: 100%; }
.gt-corner {
  position: sticky; top: 0; left: 0; z-index: 4; height: var(--gt-head); background: #fff;
  border-right: 1px solid var(--gt-line); border-bottom: 1px solid var(--gt-line); display: flex; align-items: flex-end;
}
.gt-head { position: sticky; top: 0; z-index: 3; height: var(--gt-head); background: #fff; }
.gt-head-svg, .gt-chart-svg { display: block; }
.gt-list { position: sticky; left: 0; z-index: 2; background: #fff; border-right: 1px solid var(--gt-line); min-width: 0; }
.gt-chart { position: relative; }
.gt-split {
  position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 5; touch-action: none;
}
.gt-split::after { content: ""; position: absolute; left: 3px; top: 25%; bottom: 25%; width: 2px; border-radius: 2px; background: #C9CDD2; }
.gt-split:hover::after { background: var(--gt-red); }

/* rows: one grid template for header, groups and tasks */
.gt-colhead, .gt-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 0 118px 118px 0 0 0; column-gap: 0; align-items: center;
  padding: 0 8px; min-width: 0;
}
.gt-colhead { width: 100%; height: 22px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--gt-muted); }
.gt-row { height: var(--gt-row); border-bottom: 1px solid #F0F1F3; font-size: 13px; }
.gt-row > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gt-c-group, .gt-c-wd, .gt-c-status, .gt-c-people { visibility: hidden; }
.gt-c-start, .gt-c-end { padding-left: 6px; }
.gt-grow { background: var(--gt-soft); font-weight: 600; cursor: pointer; }
.gt-grow .gt-c-task { display: flex; align-items: center; gap: 6px; }
.gt-caret { width: 12px; flex: none; color: var(--gt-muted); }
.gt-gname { overflow: hidden; text-overflow: ellipsis; }
.gt-pct { flex: none; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 10px; background: #fff; border: 1px solid var(--gt-line); }
.gt-grow .gt-c-start, .gt-grow .gt-c-end { font-weight: 400; font-size: 12px; color: var(--gt-muted); padding-left: 7px; }
.gt-open { cursor: pointer; }
.gt-open:hover .gt-name { text-decoration: underline; }
.gt-code { font-weight: 600; margin-right: 6px; }
.gt-dia { color: var(--gt-ink); margin-right: 4px; font-size: 11px; }
.gt-trow .gt-c-task { padding-left: 18px; }
.gt-trow.gt-cancelled .gt-name { text-decoration: line-through; color: var(--gt-muted); }
.gt-date { width: 100%; min-height: 24px; padding: 1px 4px; font-size: 12px; border-color: transparent; background: transparent; }
.gt-date:hover:not(:disabled), .gt-date:focus { border-color: var(--gt-line); background: #fff; }
.gt-date:disabled { color: var(--gt-ink); opacity: 1; -webkit-text-fill-color: var(--gt-ink); }
.gt-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.gt-chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.gt-none { color: var(--gt-muted); grid-template-columns: 1fr; }

/* view: timeline only = narrow name column, no date cells */
.gt-view-timeline .gt-colhead, .gt-view-timeline .gt-row { grid-template-columns: minmax(0, 1fr) 0 0 0 0 0 0; column-gap: 0; }
.gt-view-timeline .gt-c-start, .gt-view-timeline .gt-c-end { visibility: hidden; }
/* view: dates only = full-width list */
.gt-view-dates .gt-grid { grid-template-columns: 1fr; width: 100%; }
.gt-view-dates .gt-head, .gt-view-dates .gt-chart, .gt-view-dates .gt-split,
.gt-view-dates [data-act="today"] { display: none; }
.gt-view-dates .gt-corner, .gt-view-dates .gt-list { position: static; border-right: 0; }
.gt-view-dates .gt-corner { height: 34px; }
.gt-view-dates .gt-colhead, .gt-view-dates .gt-row {
  grid-template-columns: minmax(180px, 2.4fr) minmax(110px, 1.2fr) 124px 124px 76px 120px minmax(70px, .8fr); column-gap: 10px;
}
.gt-view-dates .gt-c-group, .gt-view-dates .gt-c-wd, .gt-view-dates .gt-c-status, .gt-view-dates .gt-c-people { visibility: visible; }
.gt-view-dates .gt-c-start, .gt-view-dates .gt-c-end { padding-left: 0; }
.gt-view-dates .gt-row { height: 34px; }
.gt-view-dates .gt-grid { min-width: 880px; }

/* svg */
.gt svg text { font-family: inherit; }
.gt-ht { font-size: 11px; fill: #4B5563; }
.gt-hb { font-weight: 600; fill: var(--gt-ink); }
.gt-hs { font-size: 10px; }
.gt-hl { stroke: var(--gt-line); stroke-width: 1; }
.gt-today-t { fill: var(--gt-red); font-weight: 600; font-size: 10px; }
.gt-we { fill: #F2F3F5; }
.gt-nw { fill: #FBE3E4; fill-opacity: .75; }
.gt-nw-t { font-size: 10px; fill: #B4262C; letter-spacing: .02em; }
.gt-grid-l { stroke: #ECEEF0; stroke-width: 1; }
.gt-gstripe { fill: var(--gt-soft); }
.gt-lbl { font-size: 11px; fill: #374151; pointer-events: none; }
.gt-lbl-b { font-weight: 600; }
.gt-dep { fill: none; stroke: #7C838C; stroke-width: 1.2; pointer-events: none; }
.gt-bar { cursor: pointer; }
.gt-bar.gt-editable { cursor: grab; touch-action: none; }
.gt-bar.gt-dragging { cursor: grabbing; opacity: .9; }
.gt-bar.gt-dragging rect:not(.gt-rh):not(.gt-hit) { filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.gt-rh { cursor: ew-resize; }
.gt-bar:hover rect:first-of-type:not(.gt-hit) { stroke-width: 2; }
.gt-flag-t { font-size: 10px; font-weight: 600; fill: #fff; pointer-events: none; }
.gt-flag.gt-editable { cursor: ew-resize; touch-action: none; }

/* tip + toast */
.gt-tip {
  position: absolute; left: 0; top: 0; z-index: 20; pointer-events: none; white-space: nowrap;
  background: var(--gt-ink); color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.gt-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--gt-ink); color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: calc(100vw - 32px);
}

/* phones */
@media (max-width: 640px) {
  .gt { --gt-lw: 190px !important; }
  .gt-view-both .gt-colhead, .gt-view-both .gt-row { grid-template-columns: minmax(0, 1fr) 0 0 0 0 0 0; column-gap: 0; }
  .gt-view-both .gt-c-start, .gt-view-both .gt-c-end { visibility: hidden; }
  .gt-split { display: none; }
  .gt-toolbar { gap: 6px; }
  .gt-btn, .gt-seg button { padding: 5px 8px; }
}

/* public holidays (project.holidays minus holiday_skip) */
.gt-hol { fill: #FFE7B3; fill-opacity: .7; }
.gt-holflag { fill: #D98E04; stroke: #D98E04; stroke-width: 1; }
.gt-holcode { font-size: 8px; font-weight: 600; fill: #9A6200; }
.gt-grow .gt-c-group { font-weight: 400; color: var(--gt-muted); font-size: 12px; }

/* toolbar popovers: "Set timeline" + "Change view" */
.gt-pop { position: relative; }
.gt-drop::after { content: ""; display: inline-block; margin-left: 7px; vertical-align: 2px; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; }
.gt-drop[aria-expanded="true"] { border-color: var(--gt-ink); }
.gt-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; background: #fff; border: 1px solid var(--gt-line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 12px; min-width: 220px;
  max-width: min(340px, calc(100vw - 32px));
}
.gt-panel-timeline { display: grid; gap: 10px; width: 300px; }
.gt-panel-timeline .gt-field { justify-content: space-between; color: var(--gt-ink); }
.gt-panel-timeline .gt-field input { width: 160px; }
.gt-hint { margin: 0; font-size: 12px; line-height: 1.45; color: var(--gt-muted); }
.gt-panel-view { padding: 6px; min-width: 180px; }
.gt-mhead { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--gt-muted); padding: 8px 10px 4px; }
.gt-panel-view button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; font: inherit; font-size: 14px;
  background: none; border: 0; border-radius: 6px; padding: 7px 10px; cursor: pointer; color: var(--gt-ink);
}
.gt-panel-view button::before { content: ""; width: 14px; flex: none; text-align: center; color: var(--gt-red); font-weight: 700; }
.gt-panel-view button[aria-checked="true"]::before { content: "\2713"; }
.gt-panel-view button:hover { background: var(--gt-soft); }
.gt-today-btn { border-color: #F5B8BA; color: var(--gt-red); }

/* today: full-height red line above shading, pill in header */
.gt-today-l { pointer-events: none; }
.gt-today-t { font-size: 10px; font-weight: 600; fill: #fff; }
.gt-today-h { pointer-events: none; }
.gt-hq { stroke: #C9CDD2; stroke-width: 1; }
.gt-grid-q { stroke: #D5D8DC; stroke-width: 1; }

@media (max-width: 640px) {
  .gt-panel { position: fixed; left: 16px; right: 16px; top: auto; max-width: none; width: auto; }
  .gt-panel-timeline { width: auto; }
}

/* selection (store.selectedTaskId) */
.gt-trow.gt-sel { background: rgba(227, 38, 46, .08); box-shadow: inset 3px 0 0 #E3262E; }
.gt-selband { fill: rgba(227, 38, 46, .08); pointer-events: none; }
.gt-bar.gt-sel > rect:nth-of-type(1):not(.gt-hit), .gt-ms.gt-sel path { stroke: #E3262E; stroke-width: 2; }
.gt-openbtn {
  margin-left: auto; flex: none; border: 0; background: none; color: var(--gt-muted); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 3px 5px; border-radius: 4px; opacity: 0;
}
.gt-trow .gt-c-task { display: flex; align-items: center; min-width: 0; }
.gt-trow .gt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gt-trow:hover .gt-openbtn, .gt-trow.gt-sel .gt-openbtn, .gt-openbtn:focus-visible { opacity: 1; }
.gt-openbtn:hover { background: #fff; color: var(--gt-red); }
@media (hover: none) { .gt-openbtn { opacity: 1; } }
.gt-scroll:focus { outline: none; }
.gt-scroll:focus-visible { outline: 2px solid var(--gt-red); outline-offset: 2px; }

/* v0.2: executor initials + My tasks */
.gt-badge { fill: #fff; stroke: var(--gt-ink); stroke-width: 1; }
.gt-badge-t { font-size: 8px; font-weight: 600; fill: var(--gt-ink); pointer-events: none; }
.gt-ppl { pointer-events: auto; }
.gt-pbadge {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 3px;
  border-radius: 50%; border: 1px solid var(--gt-ink); font-size: 10px; font-weight: 600; background: #fff;
}
.gt-mine[aria-pressed="true"] { background: var(--gt-ink); border-color: var(--gt-ink); color: #fff; }
