/* Barclay Project Manager — Schedule section (task grid + SVG Gantt). Uses the variables from app.css only. */
.sch { --sch-strong: var(--navy); --sch-row: 28px; flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--surface); }
:root[data-theme="dark"] .sch { --sch-strong: var(--ink); }

/* header strip: job title on the left, Progress / Schedule / Status tiles on the right */
.sch-head { display: flex; align-items: stretch; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.sch-title { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.sch-kick { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--blue); white-space: pre; }
.sch-title h1 { font-size: 21px; color: var(--sch-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 1px 0 2px; }
.sch-sub { color: var(--muted); font-size: 12.5px; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.sch-tiles { display: flex; gap: 8px; flex: none; }
.sch-tiles .tile { width: 168px; background: var(--panel); border-color: transparent; padding: 7px 11px; position: relative; overflow: hidden; }
.sch-tiles .tile b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-tiles .tile em { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-tiles .tile .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 0; min-width: 0; background: var(--line); }
.sch-tiles .tile .bar i { background: var(--blue); }

/* toolbar */
.sch-bar { display: flex; align-items: center; gap: 2px; padding: 5px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--surface); }
.sch-bar .btn.sm { gap: 5px; }
.sch-bar .btn.icon { padding: 2px 6px; }
.sch-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.sch-fill { flex: 1; }
.sch-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-right: 4px; }
.sch-seg .btn { border-radius: 0; min-height: 24px; }
.sch-seg .btn + .btn { border-left: 1px solid var(--line); }
.sch-seg .btn.on { background: var(--sel); color: var(--blue); font-weight: 600; }
.sch-bar .btn.primary { margin-left: 4px; }

/* grid + chart */
.sch-body { flex: 1; min-height: 0; display: flex; }
.sch-grid { flex: none; overflow-x: scroll; overflow-y: auto; position: relative; background: var(--surface); }
.sch-grid:focus { outline: none; }
.sch-split { flex: none; width: 5px; cursor: col-resize; background: var(--line); }
.sch-split:hover, .sch-split.on, .sch-split:focus-visible { background: var(--blue); outline: none; }
.sch-chart { flex: 1; min-width: 0; overflow-x: scroll; overflow-y: auto; position: relative; background: var(--surface); }
.sch-chart:focus { outline: none; }

.sch-tbl { table-layout: fixed; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.sch-tbl th { position: sticky; top: 0; z-index: 2; height: 46px; padding: 0 6px 6px; vertical-align: bottom; text-align: left; white-space: nowrap; overflow: hidden;
  font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); background: var(--surface-2); box-shadow: inset 0 -1px 0 var(--line); }
.sch-tbl th.r, .sch-tbl td.r, .sch-tbl td.num { text-align: right; }
.sch-tbl td { height: var(--sch-row); padding: 0 6px; line-height: 27px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 0 -1px 0 var(--line-2); cursor: default; }
.sch-tbl td.num { color: var(--faint); font-size: 12px; }
.sch-tbl td.tr, .sch-tbl td.nt { color: var(--muted); }
.sch-tbl td.lnk { color: var(--blue); }
.sch-tbl td.late { color: var(--red); }
.sch-tbl td.nm.ind { padding-left: 22px; }
.sch-tbl td.nm.ms { font-weight: 600; }
.sch-tbl .dia { display: inline-block; width: 8px; height: 8px; background: var(--blue); transform: rotate(45deg); margin: 0 7px 1px 1px; }
.sch-tbl .cyc { font-size: 10.5px; font-weight: 700; color: var(--amber); background: var(--wait-bg); border-radius: 8px; padding: 1px 6px; }
.sch-tbl tr.ph td { background: var(--panel); font-weight: 600; color: var(--sch-strong); }
.sch-tbl tr.ph td.num { color: var(--muted); }
.sch-tbl tr.done td:not(.num) { color: var(--muted); }
.sch-tbl tr.done td.late { color: var(--muted); }
.sch-tbl tr:hover td { background: var(--hover); }
.sch-tbl tr.ph:hover td { background: var(--panel); }
.sch-tbl tr.sel td { background: var(--sel); }
.sch-tbl td.cur { outline: 2px solid var(--focus); outline-offset: -2px; }
.sch-grid:not(:focus-within) .sch-tbl td.cur { outline-color: var(--line); }
.sch-tbl tr.ghost td { color: var(--faint); font-style: italic; }
.sch-tbl td.editing { padding: 0 1px; overflow: visible; }
.sch-in { width: 100%; height: 26px; margin: 0; padding: 0 5px; border: 1px solid var(--focus); border-radius: 3px; background: var(--surface); color: var(--ink); font: inherit; font-style: normal; outline: none; box-shadow: 0 0 0 2px var(--sel); }
.sch-in.r { text-align: right; }
.pbar { display: inline-block; vertical-align: middle; width: 32px; height: 5px; background: var(--line-2); border-radius: 3px; overflow: hidden; margin-right: 6px; }
.pbar i { display: block; height: 100%; background: var(--blue); }
.pbar.done i { background: var(--sch-strong); } .pbar.late i { background: var(--red); }
.pv { font-size: 12px; }

/* Gantt (SVG) */
.gc-head { position: sticky; top: 0; z-index: 2; height: 46px; line-height: 0; }
svg.gc { display: block; font-family: var(--font); }
.gc .gh-bg { fill: var(--surface-2); }
.gc .gh-l { stroke: var(--line); stroke-width: 1; }
.gc .gh-t1 { font-size: 11.5px; font-weight: 600; fill: var(--sch-strong); dominant-baseline: central; }
.gc .gh-t2 { font-size: 11px; fill: var(--muted); dominant-baseline: central; }
.gc .gh-t2.c { text-anchor: middle; fill: var(--ink); } .gc .gh-t2.c.off { fill: var(--faint); } .gc .gh-t2.c.on { fill: var(--surface); font-weight: 600; }
.gc .gh-today { fill: var(--red); }
.gc .we { fill: var(--panel); opacity: .55; }
.gc .rph { fill: var(--panel); opacity: .6; }
.gc .rsel { fill: var(--sel); opacity: .75; }
.gc .rl { stroke: var(--line-2); stroke-width: 1; }
.gc .vl { stroke: var(--line-2); stroke-width: 1; }
.gc .today { stroke: var(--red); stroke-width: 2; }
.gc .ph { fill: var(--sch-strong); }
.gc .bk { fill: color-mix(in srgb, var(--blue) 32%, var(--surface)); }
.gc .bk.late { fill: color-mix(in srgb, var(--red) 26%, var(--surface)); }
.gc .fl { fill: var(--blue); } .gc .fl.done { fill: var(--sch-strong); } .gc .fl.late { fill: var(--red); }
.gc .ms { fill: var(--blue); } .gc .ms.done { fill: var(--sch-strong); } .gc .ms.late { fill: var(--red); }
.gc .cur-bar { stroke: var(--sch-strong); stroke-width: 1.5; }
.gc .cy { fill: none; stroke: var(--amber); stroke-width: 2; stroke-dasharray: 2 2; }
.gc .lk { fill: none; stroke: var(--faint); stroke-width: 1.1; }
.gc .ah { fill: var(--faint); }
.gc .lbl { font-size: 11px; fill: var(--muted); dominant-baseline: central; pointer-events: none; }
.gc .lbl.phl { fill: var(--sch-strong); font-weight: 600; }
.sch-chart .gc-body { cursor: default; }

.sch-tip { position: fixed; z-index: 70; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-pop); padding: 6px 10px; font-size: 12px; line-height: 1.45; max-width: 320px; }
.sch-tip b { color: var(--sch-strong); }

/* empty state */
.sch-empty { max-width: 640px; margin: 30px auto 0; text-align: center; }
.sch-empty .card-b { padding: 28px 30px 26px; }
.sch-empty h2 { font-size: 19px; margin: 14px 0 6px; }
.sch-empty p { margin: 0 auto 18px; max-width: 470px; }
.sch-empty-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.sch-empty-art { display: flex; flex-direction: column; gap: 7px; width: 260px; margin: 0 auto; }
.sch-empty-art i { display: block; height: 9px; border-radius: 3px; background: color-mix(in srgb, var(--blue) 32%, var(--surface)); }
.sch-empty-art i:first-child { background: var(--blue); }

@media (max-width: 1100px) { .sch-tiles .tile { width: 136px; } .sch-bar .btn.sm span { display: none; } .sch-seg .btn.sm span, .sch-seg .btn { font-size: 12px; } }
.sch-bar .btn.sch-more { margin-left: 4px; }
@media (max-width: 1100px) { .sch-bar .btn.sch-more span { display: inline; } }
.gc .hol { fill: #9aa7b2; opacity: .38; }
.gc .hol:hover { opacity: .6; }
:root[data-theme="dark"] .gc .bk { fill: color-mix(in srgb, var(--blue) 55%, var(--surface)); }
:root[data-theme="dark"] .gc .bk.late { fill: color-mix(in srgb, var(--red) 50%, var(--surface)); }
:root[data-theme="dark"] .gc .hol { fill: #7d8b97; opacity: .45; }
