/* Gantt chart */
.gantt-wrap, #gantt-host { --g-label-w: 280px; }
.g-scroll { overflow: auto; max-height: calc(100vh - 290px); min-height: 260px; }
.g-grid { display: grid; position: relative; }
.g-corner { position: sticky; top: 0; left: 0; z-index: 6; background: var(--card2); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: flex-end; padding: 0 14px 10px; font-weight: 600; font-size: 0.88rem; color: var(--muted); height: 58px; gap: 6px; }
.g-corner small { background: var(--bg2); padding: 1px 8px; border-radius: 99px; }
.g-head { position: sticky; top: 0; z-index: 4; background: var(--card2); border-bottom: 1px solid var(--line); height: 58px; }
.g-hrow { display: flex; height: 29px; }
.g-hrow.sub { height: 29px; }
.g-hcell { flex-shrink: 0; border-left: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); padding: 6px 6px 0; white-space: nowrap; overflow: hidden; font-weight: 600; }
.g-hrow.sub .g-hcell { font-weight: 500; padding-top: 5px; }
.g-hcell.day { text-align: center; padding: 2px 0 0; line-height: 1.15; font-size: 0.8rem; }
.g-hcell.day span { display: block; font-size: 0.7rem; opacity: .8; }
.g-hcell.weekend { background: rgba(255, 255, 255, .025); }
.g-hcell.today { color: #fff; background: rgba(248, 113, 113, .22); }
.g-labels { position: sticky; left: 0; z-index: 3; background: var(--card); border-right: 1px solid var(--line); }
.g-label { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 0.92rem; min-width: 0; transition: background .15s; }
.g-label:hover { background: var(--card2); }
.g-label .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-label .meta { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.g-label.group { background: var(--bg2); font-weight: 700; }
.g-label.group .caret { color: var(--muted); width: 10px; font-size: 0.76rem; }
.g-label.group .dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.g-label.group .pct { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.g-label.task { padding-left: 32px; }
.g-label.task.done .t { color: var(--muted); text-decoration: line-through; }
.g-label.task.overdue .t { color: var(--danger); }
.g-body { position: relative; background-image: repeating-linear-gradient(to bottom, transparent 0 39px, rgba(38, 48, 79, .5) 39px 40px); }
.g-vline { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(38, 48, 79, .7); }
.g-weekend { position: absolute; top: 0; bottom: 0; background: rgba(255, 255, 255, .025); }
.g-grouprow { position: absolute; left: 0; right: 0; height: 40px; background: rgba(15, 22, 43, .55); }
.g-overload { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(248, 113, 113, .11) 0 6px, transparent 6px 12px); border-left: 1px dashed rgba(248, 113, 113, .5); border-right: 1px dashed rgba(248, 113, 113, .5); }
.g-overload span { position: sticky; top: 0; display: inline-block; font-size: 0.72rem; font-weight: 700; color: var(--danger); padding: 2px 5px; white-space: nowrap; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 2; box-shadow: 0 0 10px rgba(248, 113, 113, .6); }
.g-today span { position: absolute; top: 2px; left: 4px; font-size: 0.72rem; font-weight: 700; color: #fff; background: var(--danger); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.g-arrows { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 1; overflow: visible; }
.g-arrows path { fill: none; stroke: #94a3b8; stroke-width: 1.5; opacity: .75; }
.g-arrows path.conflict { stroke: var(--danger); stroke-dasharray: 4 3; opacity: 1; }
.g-bar { position: absolute; height: 24px; border-radius: 7px; background: var(--cb); border: 1px solid var(--c); cursor: pointer; overflow: hidden; z-index: 2; transition: transform .12s, box-shadow .12s; }
.g-bar:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .35); z-index: 3; }
.g-bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--c); opacity: .85; }
.g-bar .bl { position: relative; z-index: 1; display: block; padding: 0 8px; line-height: 22px; font-size: 0.78rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.g-bar.done { opacity: .5; }
.g-bar.overdue { border: 2px solid var(--danger); box-shadow: 0 0 0 2px rgba(248, 113, 113, .2); }
.g-bar.conflict { outline: 2px dashed var(--danger); outline-offset: 1px; }
.g-summary { position: absolute; height: 12px; border-radius: 3px; background: color-mix(in srgb, var(--c) 30%, transparent); z-index: 2; }
.g-summary::before, .g-summary::after { content: ''; position: absolute; bottom: -5px; border: 5px solid transparent; border-top-color: var(--c); }
.g-summary::before { left: 0; border-left-color: var(--c); }
.g-summary::after { right: 0; border-right-color: var(--c); }
.g-summary .fill { height: 100%; background: var(--c); border-radius: 3px; }
.g-milestone { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; transform: rotate(45deg); background: var(--warn); border: 2px solid #0b1020; box-shadow: 0 0 0 1px var(--warn); border-radius: 3px; cursor: pointer; z-index: 3; }
.g-milestone.done { background: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.g-milestone.overdue { background: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.g-mlabel { position: absolute; font-size: 0.78rem; color: var(--muted); white-space: nowrap; pointer-events: none; z-index: 2; }
@media (max-width: 820px) {
  #gantt-host { --g-label-w: 150px; }
  .g-label .meta { display: none; }
  .g-label.task { padding-left: 14px; }
  .g-scroll { max-height: calc(100vh - 250px); }
}
