/* Schedule Sistem — style halaman (melengkapi main.css + kalkulator-beton.css) */
.sc-main { display: block; }
#scPanelResult { min-width: 0; }

/* Workspace aplikasi: hampir full-width (tabel/Gantt/dashboard pakai ruang lebar) */
.dk-container.sc-wide { max-width: none; padding-left: 24px; padding-right: 24px; }
.sc-wide .sc-main { min-width: 0; }
/* Konten editorial (SEO) tetap batas-baca */
.sc-wide .calc-content { max-width: 1180px; margin-left: auto; margin-right: auto; }
@media (max-width: 700px) { .dk-container.sc-wide { padding-left: 14px; padding-right: 14px; } }

/* Toolbar + form popup */
.sc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.sc-summary { color: var(--muted); font-size: .86rem; font-family: var(--font-technical); min-width: 0; }
.sc-dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sc-summary b { color: var(--text); }
.modal-box.sc-form-modal { max-width: 640px; width: 100%; max-height: 88vh; overflow-y: auto; text-align: left; }

/* Gantt gaya MS Project */
.gm-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); }
.gm-row { display: flex; height: 26px; border-bottom: 1px solid var(--border); }
.gm-row:last-child { border-bottom: none; }
.gm-row.crit .gm-label .gm-nm { color: var(--on-err); }
.gm-head { height: 36px; position: sticky; top: 0; z-index: 3; }
.gm-label { position: sticky; left: 0; z-index: 2; width: 236px; min-width: 236px; background: var(--surface); display: flex; align-items: center; gap: 6px; padding: 0 8px; border-right: 1px solid var(--border-2); font-size: .76rem; overflow: hidden; }
.gm-head .gm-label { background: var(--surface-2); font-weight: 700; }
.gm-no { color: var(--muted); font-family: var(--font-technical); font-size: .68rem; flex: 0 0 auto; min-width: 16px; text-align: right; }
.gm-id { color: var(--primary-2); font-size: .7rem; flex: 0 0 auto; }
.sc-no { color: var(--muted); font-family: var(--font-technical); font-weight: 600; }
.gm-nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.gm-d { color: var(--muted); font-family: var(--font-technical); font-size: .68rem; flex: 0 0 auto; }
.gm-track { position: relative; flex: 0 0 auto; }
.gm-head .gm-track { height: 36px; }
.gm-wk { position: absolute; top: 0; height: 36px; border-left: 1px solid var(--border); padding: 3px 4px; font-size: .64rem; color: var(--muted); box-sizing: border-box; }
.gm-wk b { color: var(--text); } .gm-wk span { display: block; font-family: var(--font-technical); }
.gm-bar { position: absolute; top: 5px; height: 15px; border-radius: 3px; overflow: hidden; display: flex; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.gm-blab { font-size: .62rem; color: #08111f; font-weight: 700; padding: 0 5px; position: relative; z-index: 1; white-space: nowrap; }
.gm-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,.34); }
.gm-bl { position: absolute; top: 20px; height: 3px; background: #64748b; border-radius: 2px; }

/* Dashboard kartu ringkas */
#scDash { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.sc-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; }
.sc-card-l { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.sc-card-v { font-size: 1.25rem; font-weight: 700; color: var(--primary-2); font-family: var(--font-technical); margin-top: 3px; }

/* util */
.mono { font-family: var(--font-technical); }
.recap-table td.num, .recap-table th.num { text-align: right; font-family: var(--font-technical); white-space: nowrap; }

/* Blok hasil */
.sc-block { margin-bottom: 16px; }
.sc-block h2 { margin: 0 0 12px; }
.sc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: .76rem; color: var(--muted); font-family: var(--font-technical); }
.sc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sc-legend .dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.sc-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Editor aktivitas */
.sc-acttable td, .sc-acttable th { vertical-align: middle; }
.sc-acttable tr.crit { background: rgba(248,113,113,.06); }
.sc-dur { width: 62px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 6px; font-family: var(--font-technical); font-size: .82rem; text-align: right; }
.sc-dur:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.sc-dur[data-ovr] { border-color: var(--accent-text); color: var(--primary-2); font-weight: 600; }
.sc-prog { width: 54px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 6px; font-family: var(--font-technical); font-size: .82rem; text-align: right; }
.sc-vol { width: 66px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 6px; font-family: var(--font-technical); font-size: .82rem; text-align: right; }
.sc-crew { width: 50px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 6px; font-family: var(--font-technical); font-size: .82rem; text-align: right; }
.sc-vol:focus, .sc-crew:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.sc-vol[data-ovr], .sc-crew[data-ovr] { border-color: var(--accent-text); color: var(--primary-2); font-weight: 600; }
.sc-vu { color: var(--muted); font-size: .72rem; margin-left: 3px; }
.sc-actual { width: 64px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 6px; font-family: var(--font-technical); font-size: .82rem; text-align: right; }
.sc-actual:focus { outline: none; border-color: var(--success-text); box-shadow: 0 0 0 2px rgba(34,197,94,.25); }
.sc-actual:not([value=""]):not(:placeholder-shown) { border-color: rgba(34,197,94,.5); color: var(--success-text); }
.sc-prog[readonly] { opacity: .8; cursor: not-allowed; }
/* Monitoring: input kendala/tindakan */
.sc-mnote { width: 100%; min-width: 130px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 7px; font-size: .8rem; }
.sc-mnote:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.sc-montable td:nth-child(6), .sc-montable td:nth-child(7), .sc-montable th:nth-child(6), .sc-montable th:nth-child(7) { min-width: 150px; }
.sc-mdate { background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 3px 6px; font-size: .78rem; font-family: var(--font-technical); }
.sc-mdate:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.sc-exectable th, .sc-exectable td { white-space: nowrap; }
.sc-prog:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.sc-prog[data-ovr] { border-color: var(--success-text); color: var(--success-text); font-weight: 600; }
.sc-actcell { white-space: nowrap; text-align: center; }
.sc-del { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.3); color: var(--on-err); border-radius: 6px; width: 24px; height: 24px; cursor: pointer; margin-left: 8px; font-size: .78rem; line-height: 1; }
.sc-del:hover { background: rgba(248,113,113,.25); color: #fff; }
.sc-tag { font-size: .64rem; color: var(--primary-2); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; }
.sc-predcell { min-width: 150px; }
.sc-pred { width: 100%; min-width: 130px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 7px; font-family: var(--font-technical); font-size: .78rem; }
.sc-pred:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.sc-pred[data-ovr] { border-color: var(--accent-text); color: var(--primary-2); }

/* Alert */
.sc-alert { border-radius: var(--radius-sm); padding: 9px 12px; margin-bottom: 10px; font-size: .84rem; }
.sc-alert.err { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.35); color: var(--on-err); }
.sc-alert.warn { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.35); color: var(--on-warn); }
.sc-alert.info { background: rgba(37,117,252,.10); border: 1px solid rgba(37,117,252,.30); color: var(--primary-2); }

/* Panel validasi */
.sc-valid { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; background: var(--bg-2); }
.sc-valid.ok { color: var(--success-text); font-size: .86rem; }
.sc-valid-head { font-size: .82rem; color: var(--text); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sc-valid .sc-alert { margin-bottom: 6px; font-size: .8rem; }
.sc-valid .sc-alert:last-child { margin-bottom: 0; }
.vb { font-size: .68rem; font-weight: 700; border-radius: 999px; padding: 1px 9px; }
.vb.err { background: rgba(248,113,113,.18); color: var(--on-err); }
.vb.warn { background: rgba(245,158,11,.18); color: var(--on-warn); }
.vb.info { background: rgba(37,117,252,.16); color: var(--primary-2); }

/* Project manager */
.proj-bar #scProjSel { width: auto; min-width: 200px; max-width: 100%; flex: 1 1 220px; }
@media (max-width: 560px) {
  .proj-bar #scProjSel { flex-basis: 100%; }
  .proj-bar-main .btn-sm, .proj-bar-main .dk-btn { flex: 1 1 auto; }
  /* Di layar sempit pembungkus label+select harus boleh menyusut. Tanpa
     min-width:0 sebuah item flex tidak pernah mengecil di bawah lebar
     kontennya, sehingga select ber-min-width menonjol keluar dan membuat
     seluruh halaman bisa digeser ke samping. */
  .proj-bar-main > div { min-width: 0; max-width: 100%; flex: 1 1 100%; }
  .proj-bar-main select, .proj-bar-main .calc-select { min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
}

/* Gantt gaya MS Project v2 (tabel kiri + timeline kanan + panah) */
.gm-zoom { display: inline-flex; align-items: center; gap: 6px; float: right; font-size: .76rem; color: var(--muted); }
.gm-zoom select { background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 3px 7px; font-size: .78rem; }
.gm2 { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); overflow: hidden; }
.gm2-left { flex: 0 0 auto; width: 300px; border-right: 2px solid var(--border-2); background: var(--surface); max-height: 560px; overflow: hidden; }
.gm2-lrow { display: flex; align-items: center; height: 26px; border-bottom: 1px solid var(--border); font-size: .74rem; padding: 0 6px; gap: 6px; white-space: nowrap; overflow: hidden; }
.gm2-lrow:last-child { border-bottom: none; }
.gm2-head { height: 34px; background: var(--surface-2); font-weight: 700; position: sticky; top: 0; z-index: 5; }
.gm2-lrow.crit .gm2-nm { color: var(--on-err); }
.gm2-no { width: 22px; flex: 0 0 auto; text-align: right; color: var(--muted); font-family: var(--font-technical); font-size: .68rem; }
.gm2-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.gm2-nm b { color: var(--primary-2); font-size: .68rem; }
.gm2-c { flex: 0 0 auto; width: 30px; text-align: right; color: var(--muted); font-family: var(--font-technical); font-size: .68rem; }
.gm2-dt { width: 42px; }
.gm2-rscroll { flex: 1 1 auto; overflow: auto; max-height: 560px; -webkit-overflow-scrolling: touch; }
.gm2-time { position: relative; }
.gm2-header { position: sticky; top: 0; z-index: 4; height: 34px; background: var(--surface-2); border-bottom: 1px solid var(--border-2); }
.gm2-tick { position: absolute; top: 0; height: 34px; border-left: 1px solid var(--border); padding: 3px 4px; font-size: .62rem; color: var(--muted); box-sizing: border-box; overflow: hidden; }
.gm2-tick b { color: var(--text); display: block; } .gm2-tick span { font-family: var(--font-technical); }
.gm2-body { position: relative; }
.gm2-day { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(148,163,184,.05); }
.gm2-week { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(148,163,184,.22); }
.gm2-arrows { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 1; }
.gm2-bar { position: absolute; height: 15px; border-radius: 3px; overflow: hidden; display: flex; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,.28); z-index: 2; }
.gm2-blab { font-size: .6rem; color: #08111f; font-weight: 700; padding: 0 4px; white-space: nowrap; position: relative; z-index: 1; }
/* Progres sebagai garis tipis di tengah bar (ala MS Project) */
.gm2-fill { position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: 5px; background: rgba(0,0,0,.6); border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
/* Kolom Dur editable di Gantt */
.gm2-durc { width: 66px; flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.gm2-durinp { width: 32px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 5px; padding: 1px 3px; font-family: var(--font-technical); font-size: .7rem; text-align: right; }
.gm2-durinp:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.gm2-durinp[data-ovr] { border-color: var(--accent-text); color: var(--primary-2); font-weight: 600; }
.gm2-du { font-size: .58rem; color: var(--muted); }
/* Handle resize kolom kiri */
.gm-xhandle { flex: 0 0 5px; cursor: col-resize; background: var(--border-2); align-self: stretch; }
.gm-xhandle:hover { background: var(--primary); }
.gm2-bl { position: absolute; height: 3px; background: #64748b; border-radius: 2px; z-index: 2; }
.gm2-today { position: absolute; top: 0; width: 2px; background: #ef4444; z-index: 3; pointer-events: none; box-shadow: 0 0 4px rgba(239,68,68,.6); }
.gm2-today::before { content: "▾"; position: absolute; top: -2px; left: -4px; color: var(--danger-text); font-size: 10px; line-height: 1; }
/* Header timeline 2–3 tingkat */
.gm2-htier { position: relative; border-bottom: 1px solid var(--border); }
.gm2-htier:last-child { border-bottom: none; }
.gm2-tk { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--border); padding: 0 4px; font-size: .6rem; color: var(--muted); box-sizing: border-box; overflow: hidden; white-space: nowrap; display: flex; align-items: center; }
.gm2-tk b { color: var(--text); font-weight: 600; }
.gm2-tk span { font-family: var(--font-technical); margin-left: 4px; }
.gm2-tk-top { background: var(--surface); }
.gm2-tk-top b { font-weight: 700; letter-spacing: .02em; }
.gm2-tk-day { padding: 0; justify-content: center; }
/* Bar Gantt terpilih */
.gm2-bar.gm-sel { outline: 2px solid #fff; outline-offset: 0; box-shadow: 0 0 0 2px #2575fc, 0 1px 3px rgba(0,0,0,.4); z-index: 4; }
.gm2-bar { cursor: grab; }
.gm2-bar::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 9px; cursor: ew-resize; }
.gm2-bar.gm-resizing, .gm2-bar.gm-moving { opacity: .82; outline: 1px dashed #fff; cursor: grabbing; }
/* Context menu Gantt */
.gm-ctx { position: fixed; z-index: 9999; min-width: 184px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.45); padding: 5px; }
.gm-ctx-hd { font-family: var(--font-technical); color: var(--primary-2); font-size: .72rem; padding: 3px 8px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.gm-ctx button { display: block; width: 100%; text-align: left; background: transparent; border: none; color: var(--text); padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: .82rem; }
.gm-ctx button:hover { background: var(--bg-2); }
.gm-ctx button.danger { color: var(--on-err); }
.gm-ctx button.danger:hover { background: rgba(248,113,113,.14); }
/* Minimap Gantt */
.gm-mini { position: relative; height: 52px; margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); overflow: hidden; cursor: pointer; }
.gm-mini-track { position: absolute; inset: 2px; }
.gm-mini-track svg { display: block; width: 100%; height: 100%; }
.gm-mini-vp { position: absolute; top: 0; left: 0; height: 100%; min-width: 12px; min-height: 8px; background: rgba(37,117,252,.20); border: 1px solid var(--primary); border-radius: 3px; cursor: move; box-sizing: border-box; }
.gm2-lrow.gm2-sum { background: var(--surface-2); }
.gm2-lrow.gm2-sum .gm2-no { color: var(--text); font-weight: 700; }
.gm2-lrow.gm2-sum .gm2-nm { color: var(--text); font-weight: 700; font-size: .72rem; letter-spacing: .02em; }
.gm2-sumbar { position: absolute; height: 7px; background: #475569; border-radius: 1px; z-index: 2; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.gm2-sumbar::before, .gm2-sumbar::after { content: ""; position: absolute; bottom: -3px; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid #475569; }
.gm2-sumbar::before { left: 0; } .gm2-sumbar::after { right: 0; }
@media (max-width: 500px) { .gm2-left { width: 172px; } .gm2-dt { display: none; } }
/* Interaksi Gantt: toolbar + pan cursor */
.gm-tb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.gm-tb-btn { flex: 0 0 auto; font-size: .76rem; padding: 6px 11px; border-radius: 7px; border: 1px solid var(--border); background: var(--bg-2); color: var(--muted); cursor: pointer; }
.gm-tb-btn:hover { color: var(--text); border-color: var(--primary); }
.gm-tb-btn:disabled { opacity: .38; cursor: default; border-color: var(--border); color: var(--muted); }
.gm-tb-btn.danger { color: var(--on-err); border-color: rgba(248,113,113,.4); }
.gm-tb-btn.danger:hover { background: rgba(248,113,113,.14); border-color: var(--danger-text); }
.gm-selbox { position: fixed; z-index: 9998; border: 1px solid var(--primary); background: rgba(37,117,252,.14); pointer-events: none; border-radius: 2px; }
.gm-tb-hint { font-size: .7rem; color: var(--muted); font-family: var(--font-technical); margin-left: auto; }
.gm2-rscroll { cursor: grab; }
.gm2-rscroll.gm-grabbing { cursor: grabbing; user-select: none; }
@media (max-width: 600px) { .gm-tb-hint { display: none; } }

/* Pasangan panel 2-kolom di PC */
.sc-pair { display: grid; grid-template-columns: 1fr; column-gap: 16px; }
.sc-pair > .dk-panel { min-width: 0; }
@media (min-width: 960px) { .sc-pair { grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; } }

/* Network Diagram — scroll + zoom */
.net-scroll { overflow: auto; max-height: 560px; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); }
.net-scroll svg { display: block; }

/* Panel collapse */
.dk-panel.sc-block > h2 .sc-caret { display: inline-block; transition: transform .15s; color: var(--muted); font-size: .8em; margin-right: 4px; }
.dk-panel.sc-block.collapsed > h2 .sc-caret { transform: rotate(-90deg); }
.dk-panel.sc-block.collapsed > *:not(h2) { display: none !important; }
.dk-panel.sc-block.collapsed > h2 { margin-bottom: 0; }

/* Task Usage grid (aktivitas × minggu) */
.ug-scroll { overflow: auto; max-height: 520px; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ug { border-collapse: collapse; font-size: .72rem; font-family: var(--font-technical); white-space: nowrap; }
.ug th, .ug td { border: 1px solid var(--border); padding: 3px 6px; text-align: right; min-width: 40px; }
.ug thead th { background: var(--surface-2); color: var(--muted); position: sticky; top: 0; z-index: 2; }
.ug .ug-l { position: sticky; left: 0; z-index: 3; background: var(--surface); text-align: left; min-width: 210px; max-width: 210px; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.ug thead .ug-l { z-index: 4; background: var(--surface-2); }
.ug .ug-no { color: var(--primary-2); font-size: .68rem; margin-right: 4px; }
.ug .ug-u { color: var(--muted); font-size: .92em; }
.ug .ug-sumrow { font-weight: 700; }
.ug .ug-sumrow .ug-l, .ug .ug-cs { background: var(--surface-2); color: var(--text); }
.ug .ug-tot { font-weight: 700; background: var(--bg-2); }
.ug .ug-totrow td { font-weight: 700; background: var(--surface-2); color: var(--text); border-top: 2px solid var(--border-2); }
.ug .ug-cumrow td { color: var(--primary-2); border-top: 1px dashed var(--border-2); }

/* Bar chart horizontal (resource & cost) */
.sc-bars { margin: 4px 0 12px; }
.sc-bar-row { display: flex; align-items: center; gap: 8px; height: 22px; font-size: .78rem; }
.sc-bar-lbl { flex: 0 0 auto; width: 140px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.sc-bar-track { flex: 1 1 auto; min-width: 0; height: 13px; background: var(--bg-2); border-radius: 3px; overflow: hidden; }
.sc-bar-fill { display: block; height: 100%; border-radius: 3px; }
.sc-bar-val { flex: 0 0 auto; width: 96px; text-align: right; font-family: var(--font-technical); font-size: .72rem; color: var(--text); }
@media (max-width: 520px) { .sc-bar-lbl { width: 92px; } .sc-bar-val { width: 78px; } }

/* Baseline */
.sc-baseline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.sc-bl-status { font-size: .78rem; color: var(--text); flex: 1 1 200px; min-width: 0; }

/* ===== Navigator seksi (sticky) + hierarki + poles UI ===== */
/* Shell: sidebar navigator (kiri) + kolom hasil (kanan) */
.sc-shell { display: block; }
.sc-results { min-width: 0; }
@media (min-width: 960px) {
  .sc-shell { display: grid; grid-template-columns: 202px minmax(0,1fr); gap: 20px; align-items: start; }
}
.sc-nav-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; }
@media (min-width: 960px) {
  .sc-nav-side { position: sticky; top: 68px; align-self: start; max-height: calc(100vh - 88px); overflow-y: auto; scrollbar-width: thin; }
}
.sc-nav-side::-webkit-scrollbar { width: 6px; height: 6px; }
/* Ringkasan proyek (health strip) di puncak sidebar */
.sc-health { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.sc-health-ttl { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.sc-health-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sc-hstat { background: var(--bg-2); border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px; min-width: 0; }
.sc-hstat .l { display: block; font-size: .6rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.sc-hstat .v { display: block; font-size: .84rem; font-weight: 700; color: var(--primary-2); font-family: var(--font-technical); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-hstat .v.crit { color: var(--danger-text); }
.sc-hbar { margin-top: 8px; }
.sc-hbar-top { display: flex; justify-content: space-between; font-size: .62rem; color: var(--muted); margin-bottom: 4px; }
.sc-hbar-top .pct { font-family: var(--font-technical); font-weight: 700; color: var(--text); }
.sc-hbar-track { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.sc-hbar-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: #22c55e; transition: width .3s, background .3s; }
.sc-hspi { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.sc-hspi .l { font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.sc-hspi .v { font-size: 1rem; font-weight: 700; font-family: var(--font-technical); color: var(--text); }

/* Network Diagram: toolbar + zoom + node interaktif */
.sc-nettb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.sc-net-search { flex: 1 1 160px; min-width: 0; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 6px 10px; font-size: .82rem; }
.sc-net-search:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.sc-net-btn { flex: 0 0 auto; font-size: .76rem; padding: 6px 11px; border-radius: 7px; border: 1px solid var(--border); background: var(--bg-2); color: var(--muted); cursor: pointer; }
.sc-net-btn:hover { color: var(--text); border-color: var(--primary); }
.sc-net-btn.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.sc-net-zoom { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.sc-net-zb { width: 28px; height: 28px; padding: 0; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); cursor: pointer; font-size: .9rem; line-height: 1; }
.sc-net-zb[data-z="fit"] { width: auto; padding: 0 9px; font-size: .74rem; }
.sc-net-zb:hover { border-color: var(--primary); }
.sc-net-zval { font-family: var(--font-technical); font-size: .74rem; color: var(--muted); min-width: 42px; text-align: center; }
/* lepas cap global svg{max-width:100%} yang menyusutkan diagram */
.net-scroll svg { max-width: none; }
#scNetwork g { cursor: pointer; }
#scNetwork g.sc-nsel rect { stroke: #2575fc !important; stroke-width: 3 !important; }
#scNetwork g.sc-dim { opacity: .15; transition: opacity .2s; }
@keyframes scpulse { 0%,100% { stroke-width: 2; } 50% { stroke-width: 5; } }
#scNetwork g.sc-npulse rect { stroke: #2575fc !important; animation: scpulse .5s ease 2; }

/* Network inspector */
.sc-insp { margin-top: 12px; border: 1px solid var(--primary); border-radius: var(--radius-sm); background: var(--bg-2); padding: 12px 14px; }
.sc-insp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sc-insp-ttl { font-size: .92rem; line-height: 1.4; }
.sc-insp-id { font-family: var(--font-technical); color: var(--primary-2); font-size: .8rem; }
.sc-insp-crit { font-size: .6rem; font-weight: 700; background: rgba(248,113,113,.18); color: var(--on-err); border-radius: 999px; padding: 1px 8px; vertical-align: 1px; }
.sc-insp-x { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; width: 24px; height: 24px; cursor: pointer; flex: 0 0 auto; line-height: 1; }
.sc-insp-x:hover { color: var(--text); border-color: var(--primary); }
.sc-insp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.sc-insp-grid .r { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; border-bottom: 1px dotted var(--border); padding-bottom: 3px; }
.sc-insp-grid .k { color: var(--muted); }
.sc-insp-grid .v { color: var(--text); font-family: var(--font-technical); text-align: right; }
.sc-insp-rel { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .78rem; color: var(--text); }
.sc-insp-rel .k { color: var(--primary-2); font-size: .64rem; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
@media (max-width: 520px) { .sc-insp-grid { grid-template-columns: 1fr; } }

.sc-nav-actions { display: flex; gap: 6px; margin-bottom: 12px; }
.sc-nav-btn { flex: 1 1 auto; font-size: .7rem; padding: 6px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-2); color: var(--muted); cursor: pointer; white-space: nowrap; }
.sc-nav-btn:hover { color: var(--text); border-color: var(--primary); }
.sc-nav-grp { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.sc-nav-grp:last-child { margin-bottom: 0; }
.sc-nav-glabel { display: flex; align-items: center; gap: 7px; font-size: .62rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 2px 0 4px; }
.sc-nav-glabel .n { flex: 0 0 auto; background: var(--primary); color: #fff; width: 16px; height: 16px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: .62rem; font-family: var(--font-technical); }
.sc-nav-glabel .ic { flex: 0 0 auto; width: 15px; height: 15px; }
.sc-nav-chip { display: block; width: 100%; text-align: left; font-size: .77rem; padding: 6px 10px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .12s, background .12s; }
.sc-nav-chip:hover { background: var(--bg-2); color: var(--text); }
.sc-nav-chip.active { background: var(--primary); color: #fff; font-weight: 600; }
/* Mobile (<960px): sidebar jadi bar horizontal sticky di atas */
@media (max-width: 959px) {
  .sc-nav-side { position: sticky; top: 60px; z-index: 30; display: flex; align-items: center; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 16px; box-shadow: 0 4px 14px rgba(0,0,0,.16); }
  .sc-health { display: none; }
  .sc-nav-actions { order: 99; margin-bottom: 0; flex: 0 0 auto; }
  .sc-nav-btn { flex: 0 0 auto; }
  .sc-nav-grp { flex-direction: row; align-items: center; gap: 5px; margin-bottom: 0; flex: 0 0 auto; }
  .sc-nav-glabel { margin: 0; }
  .sc-nav-glabel .txt { display: none; }
  .sc-nav-chip { display: inline-block; width: auto; border: 1px solid var(--border); background: var(--bg-2); border-radius: 999px; padding: 5px 11px; }
}

/* Pembatas seksi bernomor */
.sc-sec { display: flex; align-items: center; gap: 11px; margin: 30px 0 14px; }
.sc-sec:first-child { margin-top: 4px; }
.sc-sec-num { font-family: var(--font-technical); font-size: .82rem; font-weight: 700; color: #fff; background: var(--primary); width: 25px; height: 25px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; box-shadow: 0 2px 6px rgba(37,117,252,.35); }
.sc-sec-ttl { font-size: .8rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text); flex: 0 0 auto; }
.sc-sec-line { flex: 1 1 auto; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

/* anchor offset agar tak tertutup navigator sticky */
#scPanelResult .dk-panel.sc-block { scroll-margin-top: 120px; }

/* Poles header panel: aksen kiri */
#scPanelResult .dk-panel.sc-block > h2 { padding-left: 12px; border-left: 3px solid var(--primary); line-height: 1.3; }
#scPanelResult .dk-panel.sc-block.collapsed > h2 { border-left-color: var(--muted); }
#scPanelResult .dk-panel.sc-block > h2 .gm-zoom { border-left: 0; }

/* Poles kartu dashboard */
.sc-card { transition: border-color .15s, transform .15s, box-shadow .15s; }
.sc-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.14); }

@media (max-width: 700px) {
  .sc-sec { margin: 22px 0 12px; }
}

/* Print */
@media print {
  .sc-nav-side, .sc-sec { display: none !important; }
  .sc-shell { display: block !important; }
  .dk-nav, .dk-footer, .modal-overlay, .skip-link, .breadcrumb, .calc-switch, .calc-content, .sc-export, .dk-page-hero, .proj-bar, #btnPrintRep { display: none !important; }
  .report-head { display: block !important; color: #000 !important; border-bottom: 2px solid #000; padding-bottom: 8px; }
  .report-head h2 { color: #000 !important; }
  .sc-mnote, .sc-mdate, .sc-actual, .sc-vol, .sc-crew, .sc-dur, .sc-prog, .sc-pred { border: 1px solid #ccc !important; color: #000 !important; background: #fff !important; }
  .recap-table th, .recap-table td, .ug th, .ug td { color: #000 !important; }
  body { background: #fff !important; color: #000 !important; }
  .dk-panel { border: 1px solid #ccc; background: #fff !important; color: #000; break-inside: avoid; }
  .sc-layout { display: block; }
  h1, h2, .sc-card-v { color: #000 !important; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ---- P0-B/C: EVM dashboard cards + empty state ---- */
.sc-evm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sc-evm-grid .sc-card { min-width: 0; }
.sc-evm-grid .sc-card-v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-card-s { font-size: .68rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-empty { text-align: center; padding: 26px 16px; border: 1px dashed var(--border); border-radius: 12px; background: var(--bg-1); }
.sc-empty-ic { display: flex; justify-content: center; color: var(--muted); margin-bottom: 8px; }
.sc-empty p { color: var(--muted); max-width: 460px; margin: 0 auto 12px; font-size: .9rem; }
/* ---- P0-A: milestone Project Finish (tabel + Gantt) ---- */
.sc-msrow td { background: rgba(245, 158, 11, .07); font-weight: 500; }
.gm2-ms { position: absolute; z-index: 4; color: var(--warning-text); font-size: 15px; line-height: 1; text-shadow: 0 0 3px #000; }
.gm2-ms .gm2-mslab { position: absolute; left: 16px; top: -1px; white-space: nowrap; font-size: 10px; color: var(--warning-text); font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
/* ---- P1-I: filter/search tabel aktivitas ---- */
.sc-tbfilter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.sc-tbfilter .calc-select { padding: 5px 9px; font-size: .82rem; }
.sc-chk { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; color: var(--text); cursor: pointer; min-height: 32px; }
.sc-chk input { width: 15px; height: 15px; }
/* ---- P1-F: garis Data Date (biru) vs Today (merah) ---- */
.gm2-datadate { position: absolute; top: 0; width: 2px; background: repeating-linear-gradient(to bottom, #2575fc 0, #2575fc 5px, transparent 5px, transparent 9px); z-index: 3; }
.gm2-datadate::after { content: "Data Date"; position: absolute; top: 2px; left: 3px; font-size: 8px; color: #2575fc; font-weight: 700; white-space: nowrap; background: var(--bg-0, #0b1220); padding: 0 2px; }
/* ---- P1-I: header tabel dapat diurutkan ---- */
.sc-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.sc-sortable:hover { color: var(--primary-2); }
.sc-acttable thead th { position: sticky; top: 0; }
/* ---- P1-L: placeholder lazy-render ---- */
.sc-lazy { min-height: 130px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .85rem; border: 1px dashed var(--border); border-radius: 10px; }
/* ---- Kop laporan cetak (js/cetak.js) ---- */
.cetak-head { margin-bottom: 14px; }
.cetak-head-top { font-size: .8rem; letter-spacing: .04em; }
.cetak-head h2 { margin: 4px 0 2px; }
.cetak-head p { margin: 0; font-size: .86rem; }
#cetakBar { display: inline-flex; }

@media print {
  /* sembunyikan kontrol yang tak perlu dicetak */
  #cetakBar, #cetakBtn, .field-form, .field-msg, .pr-filter, .inv-filter, .sc-tbfilter,
  .sk-projbadge-host, .sc-del, .boq-calc, .ews-go, .photo-controls, .photo-toolbar,
  .um-sel, #umAddBtn, #umClearAll, .dk-btn, .btn { display: none !important; }
  .cetak-head { display: block !important; color: #000 !important; border-bottom: 2px solid #000; padding-bottom: 8px; }
  .cetak-head h2, .cetak-head b { color: #000 !important; }
  /* isian form tetap terbaca sebagai teks biasa */
  input, select, textarea { border: none !important; background: transparent !important; color: #000 !important; padding: 0 !important; }
  a { color: #000 !important; text-decoration: none !important; }
  table { break-inside: auto; }
  tr { break-inside: avoid; }
  thead { display: table-header-group; }
  .sc-scroll { overflow: visible !important; max-height: none !important; }
}

/* ---- Badge proyek aktif (halaman modul tanpa pemilih proyek) ---- */
.sk-projbadge { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; background: var(--bg-1); }
.sk-projbadge b { color: var(--text); }
.sk-projbadge a { color: var(--primary); text-decoration: none; font-size: .8rem; }
.sk-projbadge a:hover { text-decoration: underline; }

/* ---- Sistem Peringatan Dini (EWS) lintas-modul ---- */
.ews-head { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ews-badge { font-size: .82rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); }
.ews-b { color: var(--danger-text); border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.08); }
.ews-w { color: var(--warning-text); border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.08); }
.ews-i { color: var(--on-info); border-color: rgba(91,155,255,.4); background: rgba(91,155,255,.08); }
.ews-ok { color: var(--success-text); border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.08); }
.ews-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; text-decoration: none; color: var(--text); font-size: .88rem; transition: border-color .12s, transform .12s; }
.ews-item:hover { transform: translateX(2px); }
.ews-item-b { border-left: 3px solid #f87171; }
.ews-item-b:hover { border-color: var(--danger-text); }
.ews-item-w { border-left: 3px solid #f59e0b; }
.ews-item-w:hover { border-color: var(--warning-text); }
.ews-item-i { border-left: 3px solid #5b9bff; }
.ews-item-i:hover { border-color: var(--on-info); }
.ews-ic { flex-shrink: 0; }
.ews-body { flex: 1; min-width: 0; }
.ews-saran { display: block; margin-top: 4px; font-size: .78rem; color: var(--muted); }
.ews-go { flex-shrink: 0; color: var(--muted); align-self: center; }

/* ---- Cash Flow tabel horizontal (minggu=kolom) ---- */
.sc-cf-h th, .sc-cf-h td { white-space: nowrap; }
.sc-cf-h .sc-cf-lbl { position: sticky; left: 0; z-index: 1; background: var(--bg-1); text-align: left; font-weight: 600; }
.sc-cf-h tbody tr:first-child .sc-cf-lbl { color: var(--accent-text); }
.sc-cf-h tbody tr:last-child .sc-cf-lbl { color: var(--text); }

/* ==========================================================================
   MODE FOKUS — Gantt satu layar penuh, bisa disunting
   --------------------------------------------------------------------------
   Panel Gantt TIDAK dipindah di DOM. Mesin jadwal me-render ulang #scGantt
   berkali-kali; kalau elemennya dipindahkan ke wadah lain, render berikutnya
   bisa kehilangan induknya. Jadi panel aslinya yang dijadikan position:fixed
   dan sisa halaman disembunyikan.
   ========================================================================== */
.gm2-predc, .gm2-progc, .gm2-patok { display: none; }          /* hanya muncul di mode fokus */

/* Panel Gantt berada jauh di dalam main > section > container > panel. Menyembunyikan
   anak-anak <body> juga akan menyembunyikan LELUHUR panel itu — dan display:none
   pada leluhur tetap mematikan anak yang position:fixed. Jadi tidak ada yang
   disembunyikan selain navigasi (bukan leluhur panel); sisanya cukup ditutupi
   oleh host yang latarnya solid dan menutup penuh viewport. */
body.sc-focus { overflow: hidden; }
body.sc-focus .dk-nav { display: none !important; }

.sc-focus-host {
  position: fixed; inset: 0; z-index: 2000; margin: 0 !important;
  border-radius: 0 !important; border: none !important;
  background: var(--bg, #08111F);
  padding: 8px 12px 12px !important;
  display: flex; flex-direction: column; overflow: hidden;
}
/* Judul panel, mini-map, dan caption di bawah Gantt disembunyikan supaya
   tinggi viewport habis untuk bagan — baris bantuan di atas sudah menjelaskan
   mode ini. */
.sc-focus-host > h2,
.sc-focus-host > p { display: none !important; }
.sc-focus-host .gm-tb { flex: 0 0 auto; }
.sc-focus-host #scGantt { flex: 1 1 auto; min-height: 0; display: flex; }
.sc-focus-host .gm2 { flex: 1 1 auto; min-height: 0; }
/* Tinggi ikut viewport, bukan 560px tetap. */
.sc-focus-host .gm2-left,
.sc-focus-host .gm2-rscroll { max-height: none; height: auto; }
.sc-focus-host .gm2-left { width: 560px; overflow-y: auto; }
.sc-focus-host .gm2-predc { display: block; width: 118px; text-align: left; }
.sc-focus-host .gm2-progc { display: block; width: 44px; }
.sc-focus-host .gm2-patok { display: block; width: 124px; }
.sc-focus-host .gm2-patok input { width: 100%; box-sizing: border-box; background: var(--bg-2); color: var(--text); border: 1px solid var(--border); border-radius: 5px; padding: 1px 4px; font-family: var(--font-technical); font-size: .66rem; height: 20px; }
.sc-focus-host .gm2-patok input[data-ovr="1"] { border-color: color-mix(in srgb, var(--warning-text) 53%, transparent); color: var(--on-warn); }
.sc-focus-host .gm2-left { width: 700px; }
.sc-focus-host .gm2-predinp,
.sc-focus-host .gm2-proginp {
  width: 100%; box-sizing: border-box; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px;
  font-family: var(--font-technical); font-size: .68rem; height: 20px;
}
.sc-focus-host .gm2-predinp[data-ovr="1"] { border-color: color-mix(in srgb, var(--accent-text) 40%, transparent); color: var(--on-accent); }
.sc-focus-host .gm2-predinp:focus,
.sc-focus-host .gm2-proginp:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }

/* Baris bantuan + tombol keluar */
.sc-focus-bar { display: none; }
body.sc-focus .sc-focus-bar {
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto; margin: 0 0 6px; font-size: .76rem; color: var(--muted);
}
body.sc-focus .sc-focus-bar b { color: var(--text); }
/* Teks bantuan dipotong, tidak dibungkus — kalau membungkus, baris ini bisa
   menghabiskan 100px+ tinggi viewport yang seharusnya jadi milik bagan. */
body.sc-focus .sc-focus-bar > span {
  flex: 1 1 auto; min-width: 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
body.sc-focus .sc-focus-bar > button { flex: 0 0 auto; }

@media (max-width: 900px) {
  .sc-focus-host .gm2-left { width: 300px; }
  .sc-focus-host .gm2-predc { width: 92px; }
  .sc-focus-host .gm2-progc, .sc-focus-host .gm2-dt, .sc-focus-host .gm2-patok { display: none; }
}

/* Geser baris (drag & drop) di kolom kiri Gantt */
.gm2-lrow[draggable="true"] { cursor: default; }
.sc-focus-host .gm2-lrow[draggable="true"] { cursor: grab; }
.sc-focus-host .gm2-lrow[draggable="true"] input { cursor: auto; }
.gm2-lrow.gm-drag { opacity: .45; }
.gm2-lrow.gm-drop-atas { box-shadow: inset 0 2px 0 0 #22d3ee; }
.gm2-lrow.gm-drop-bawah { box-shadow: inset 0 -2px 0 0 #22d3ee; }
