.worktasks-page{--wt-border:#d9e3ee;--wt-navy:#0f2b46}.worktasks-header{align-items:center}.header-actions,.toolbar-fields,.planner-actionbar>div,.card-actions,.row-actions{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.plan-live{display:inline-flex;align-items:center;gap:.45rem;color:#315168;font-weight:700}.plan-live span{width:.55rem;height:.55rem;border-radius:50%;background:#16a34a;box-shadow:0 0 0 4px #dcfce7}.worktask-tabs{display:flex;gap:.25rem;padding:.35rem;background:#e9eff6;border:1px solid var(--wt-border);border-radius:.7rem;overflow:auto}.worktask-tabs button{border:0;background:transparent;color:#49657a;padding:.65rem 1rem;border-radius:.5rem;font-weight:700;white-space:nowrap}.worktask-tabs button.active{background:#fff;color:var(--wt-navy);box-shadow:0 1px 4px #17324d1a}.work-toolbar{display:flex;justify-content:space-between;gap:1rem;align-items:center;background:#fff;border:1px solid var(--wt-border);border-radius:.7rem;padding:.9rem 1rem}.work-toolbar h3{margin:0;color:var(--wt-navy)}.work-toolbar span{color:#6b7f90;font-size:.82rem}.toolbar-fields .form-control,.toolbar-fields .form-select{width:auto;min-width:145px}.plan-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:.85rem}.plan-card{background:#fff;border:1px solid var(--wt-border);border-radius:.8rem;padding:1rem;transition:.15s}.plan-card:hover,.plan-card.selected{border-color:#69a7d8;box-shadow:0 8px 24px #1f4e7214}.plan-card-head{display:flex;justify-content:space-between;color:#718496;font-size:.78rem}.plan-card h3{margin:.7rem 0 .25rem;color:var(--wt-navy)}.plan-card p{color:#64798a}.plan-card dl{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem;margin:.8rem 0}.plan-card dl div{background:#f5f8fb;padding:.55rem;border-radius:.45rem}.plan-card dt{font-size:.67rem;color:#708497;text-transform:uppercase}.plan-card dd{margin:0;font-weight:700;color:#263f54;overflow:hidden;text-overflow:ellipsis}.status-badge,.priority-badge{display:inline-flex;align-items:center;border-radius:999px;padding:.2rem .48rem;font-size:.7rem;font-weight:800;background:#e8eef4;color:#35536b}.status-open,.status-completed{background:#dcfce7;color:#166534}.status-closed,.status-archived,.status-cancelled{background:#fee2e2;color:#991b1b}.status-draft{background:#f1f5f9;color:#475569}.priority-low{background:#e0f2fe;color:#075985}.priority-normal{background:#e8eef4;color:#334155}.priority-high{background:#ffedd5;color:#9a3412}.priority-critical{background:#fee2e2;color:#991b1b}.empty-state{min-height:220px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.55rem;background:#fff;border:1px dashed #b8c8d6;border-radius:.8rem;color:#6a7e8e}.empty-state strong{font-size:1.15rem;color:#28465c}.planner-actionbar{display:flex;justify-content:space-between;align-items:center;padding:.65rem .8rem;background:#edf6ff;border:1px solid #c9e1f5;border-radius:.65rem;color:#315a79}.timeline-shell{position:relative;overflow:auto;max-height:62vh;background:#fff;border:1px solid var(--wt-border);border-radius:.65rem;user-select:none}.timeline-grid{display:grid;grid-template-columns:270px repeat(var(--slot-count),56px);min-width:max-content}.timeline-head{position:sticky;top:0;z-index:20;background:#edf2f7}.employee-sticky{position:sticky;left:0;z-index:10;display:flex;flex-direction:column;justify-content:center;padding:.55rem .7rem;background:#fff;border-right:1px solid #cbd8e4;border-bottom:1px solid #e5edf3}.employee-sticky.head{z-index:30;background:#dce8f2;font-weight:800}.employee-sticky strong{font-size:.78rem;color:#1d374c}.employee-sticky span,.employee-sticky small{font-size:.66rem;color:#718494}.time-head{height:42px;display:flex;align-items:center;justify-content:center;border-right:1px solid #dbe4ec;border-bottom:1px solid #cbd8e4;font-size:.66rem;font-weight:800;color:#39566d}.timeline-row{position:relative;min-height:62px}.time-slot{min-height:62px;border:0;border-right:1px solid #edf1f5;border-bottom:1px solid #edf1f5;background:repeating-linear-gradient(135deg,#fff,#fff 8px,#fbfdff 8px,#fbfdff 16px)}.time-slot:hover{background:#e7f3fd}.time-slot.selected{background:#c8e6ff;box-shadow:inset 0 0 0 1px #4c9cd6}.task-block{z-index:5;grid-row:1;align-self:center;height:42px;margin:0 2px;border:0;border-radius:.45rem;padding:.25rem .42rem;text-align:left;overflow:hidden;box-shadow:0 2px 6px #0f233740;display:flex;flex-direction:column;justify-content:center;line-height:1.05;cursor:pointer}.task-block b{font-size:.69rem}.task-block span{font-size:.63rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.task-block small{font-size:.56rem;opacity:.85}.planner-context-menu{position:fixed;right:2rem;bottom:2rem;z-index:70;width:230px;background:#fff;border:1px solid #cbd8e4;border-radius:.65rem;box-shadow:0 16px 50px #0f223840;padding:.35rem}.planner-context-menu button{display:block;width:100%;padding:.58rem .7rem;border:0;background:#fff;text-align:left;border-radius:.35rem;color:#29455b}.planner-context-menu button:hover{background:#eef5fb}.planner-context-menu button.danger{color:#b91c1c}.template-chip{border-left:4px solid var(--template-color);padding-left:.4rem}.pagination-bar{display:flex;justify-content:space-between;align-items:center;padding:.7rem;color:#607587}.worktask-kpis{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.report-grid,.template-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:.8rem}.report-panel,.template-card{background:#fff;border:1px solid var(--wt-border);border-radius:.7rem;padding:1rem}.report-panel h3,.template-card h3{margin:0 0 .7rem;color:var(--wt-navy)}.metric-row{display:flex;justify-content:space-between;padding:.48rem 0;border-bottom:1px solid #edf1f5}.template-card{display:grid;grid-template-columns:10px 1fr;gap:.8rem}.template-swatch{background:var(--template-color);border-radius:999px}.template-card p{color:#63798b}.field-list{display:flex;flex-wrap:wrap;gap:.35rem;margin:.7rem 0}.field-list span{background:#edf2f7;border-radius:999px;padding:.25rem .45rem;font-size:.67rem}.field-list span.required{background:#dbeafe;color:#1e40af}.modal-backdrop-pop{position:fixed;inset:0;z-index:100;background:#0b1b2b99;display:flex;align-items:center;justify-content:center;padding:1rem}.pop-modal{width:min(900px,96vw);max-height:92vh;display:flex;flex-direction:column;background:#f8fafc;border-radius:.85rem;box-shadow:0 25px 80px #08162480;overflow:hidden}.pop-modal>header,.pop-modal>footer{display:flex;align-items:center;justify-content:space-between;padding:1rem 1.2rem;background:#fff;border-bottom:1px solid var(--wt-border)}.pop-modal>footer{justify-content:flex-end;border-top:1px solid var(--wt-border);border-bottom:0}.pop-modal h3{margin:.1rem 0;color:var(--wt-navy)}.modal-close{border:0;background:#e8eef4;border-radius:50%;width:32px;height:32px;font-size:1.2rem}.modal-body{padding:1rem 1.2rem;overflow:auto}.task-entry-modal{width:min(1200px,98vw)}.form-grid.three-column{grid-template-columns:repeat(3,minmax(0,1fr))}.form-grid.four-column{grid-template-columns:repeat(4,minmax(0,1fr))}.span-2{grid-column:span 2}.span-3{grid-column:span 3}.assigned-employees{margin-top:1rem;padding:1rem;background:#fff;border:1px solid var(--wt-border);border-radius:.65rem}.assigned-employees .section-header{display:flex;justify-content:space-between;align-items:center}.employee-add-select{max-width:330px}.member-row{display:grid;grid-template-columns:minmax(180px,1.4fr) repeat(2,minmax(170px,1fr)) 120px 120px auto;align-items:center;gap:.5rem;padding:.65rem 0;border-top:1px solid #edf1f5}.member-row.standby-member-row{grid-template-columns:minmax(180px,1.2fr) repeat(2,minmax(160px,1fr)) 110px minmax(135px,.85fr) minmax(170px,1.1fr) 120px auto}.member-row>div{display:flex;flex-direction:column}.member-row span{font-size:.7rem;color:#6c8192}.manhours-strip{display:flex;gap:1.5rem;padding:.7rem;margin-top:.5rem;background:#eef6fc;border-radius:.45rem;color:#3c5e76}.conflict-warning{display:flex;flex-direction:column;gap:.25rem;margin-top:.8rem;padding:.8rem;background:#fff7ed;border:1px solid #fed7aa;border-radius:.5rem;color:#9a3412}.details-kv{display:grid;grid-template-columns:repeat(4,1fr);gap:.6rem}.details-kv div{display:flex;flex-direction:column;padding:.7rem;background:#fff;border:1px solid #e0e8ef;border-radius:.5rem}.details-kv span{font-size:.7rem;color:#6d8293}.member-detail-list>div{display:flex;justify-content:space-between;gap:.8rem;padding:.7rem;border-bottom:1px solid #e6edf3}.planner-loading{min-height:260px;display:flex;flex-direction:column;gap:.8rem;align-items:center;justify-content:center;color:#62798b}.skeleton-line,.skeleton-grid{width:70%;height:18px;border-radius:.4rem;background:linear-gradient(90deg,#e6edf3,#f5f8fa,#e6edf3);background-size:200% 100%;animation:wtShimmer 1.2s infinite}.skeleton-grid{height:130px}@keyframes wtShimmer{to{background-position:-200% 0}}.toast-inline.danger{background:#fee2e2;color:#991b1b}.danger-text{color:#b91c1c!important}.check-inline{display:flex!important;align-items:center;gap:.35rem;white-space:nowrap}.link-button{border:0;background:none;color:#1769aa;font-weight:700;padding:0}.task-list-table{min-width:1500px}
@media(max-width:900px){.work-toolbar,.planner-actionbar{align-items:flex-start;flex-direction:column}.toolbar-fields{width:100%}.toolbar-fields .form-control,.toolbar-fields .form-select{flex:1;min-width:130px}.form-grid.three-column,.form-grid.four-column{grid-template-columns:1fr 1fr}.span-3{grid-column:span 2}.member-row{grid-template-columns:1fr 1fr}.details-kv{grid-template-columns:1fr 1fr}.timeline-grid{grid-template-columns:220px repeat(var(--slot-count),52px)}}
@media(max-width:600px){.form-grid.three-column,.form-grid.four-column{grid-template-columns:1fr}.span-2,.span-3{grid-column:span 1}.details-kv{grid-template-columns:1fr}.plan-grid{grid-template-columns:1fr}.modal-backdrop-pop{padding:.25rem}.pop-modal{max-height:98vh}.member-row{grid-template-columns:1fr}.member-row>div{grid-column:1}.manhours-strip{flex-direction:column;gap:.3rem}}

/* Adaptive Work Tasks layouts */
@media(max-width:1024px){
  .worktasks-page{min-width:0;max-width:100%}
  .worktask-tabs{max-width:100%;scrollbar-width:thin}
  .work-toolbar,.planner-actionbar{align-items:flex-start;flex-direction:column}
  .toolbar-fields{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .toolbar-fields .form-control,.toolbar-fields .form-select{width:100%;min-width:0}
  .timeline-shell{max-width:100%;max-height:68dvh}
  .timeline-grid{grid-template-columns:220px repeat(var(--slot-count),52px)}
  .planner-context-menu{right:.75rem;bottom:.75rem;max-width:calc(100vw - 1.5rem)}
}
@media(max-width:600px){
  .worktasks-header{align-items:flex-start}
  .toolbar-fields{grid-template-columns:1fr}
  .plan-card dl{grid-template-columns:1fr 1fr}
  .timeline-grid{grid-template-columns:170px repeat(var(--slot-count),48px)}
  .employee-sticky{padding:.45rem}.task-block{height:46px}
  .planner-context-menu{left:.5rem;right:.5rem;bottom:.5rem;width:auto}
  .report-grid,.template-grid{grid-template-columns:1fr}
  .assigned-employees{padding:.7rem}.employee-add-select{max-width:none;width:100%}
}

/* Planner performance is controlled by the compact grid rules below. */

/* WorkTasks Virtual Timeline Render Fix */
.timeline-virtual-container {
    height: 720px !important;
    min-height: 720px !important;
    overflow-y: auto;
    overflow-x: visible;
    display: block;
    position: relative;
}

.timeline-shell {
    contain: none !important;
    min-height: 300px;
    display: block;
}

.timeline-row {
    height: 62px;
    min-height: 62px;
    width: max-content;
    display: grid;
}

.timeline-row > .employee-sticky,
.timeline-row > .time-slot,
.timeline-row > .task-block {
    visibility: visible !important;
    opacity: 1 !important;
}

.timeline-grid.timeline-row {
    grid-auto-rows: 62px;
}

/* Team-scoped editable planner */
.team-selection-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: #fff;
    border: 1px solid var(--wt-border);
    border-left: 4px solid #1769aa;
    border-radius: .65rem;
}
.team-selection-card label { font-weight: 800; color: var(--wt-navy); white-space: nowrap; }
.team-selection-card .form-select { width: min(360px, 100%); }
.team-selection-card span { color: #b45309; font-weight: 700; }
.planner-toolbar .toolbar-fields > select:first-of-type { display: none; }
.employee-sticky > button { display: none !important; }
.timeline-virtual-container { height: auto !important; min-height: 0 !important; overflow: visible; }
.timeline-shell { --employee-column-width: 240px; --planner-cell-width: 72px; --planner-row-height: 64px; }
.timeline-grid { grid-template-columns: var(--employee-column-width) repeat(var(--slot-count), var(--planner-cell-width)); }
.timeline-grid.timeline-row { height: var(--planner-row-height); min-height: var(--planner-row-height); grid-auto-rows: var(--planner-row-height); }
.employee-sticky, .time-head, .time-slot { box-sizing: border-box; overflow: hidden; resize: none; }
.time-head { width: var(--planner-cell-width); height: 44px; }
.time-slot { width: var(--planner-cell-width); height: var(--planner-row-height); min-height: var(--planner-row-height); }
.employee-sticky { width: var(--employee-column-width); height: var(--planner-row-height); }
.employee-sticky.head { height: 44px; }
.time-slot { cursor: crosshair; touch-action: none; }
.time-slot.selected {
    background: #b9ddff !important;
    box-shadow: inset 0 0 0 2px #1769aa;
}

/* Main planner selectors: Team + Shift Name + Shift */
.worktask-main-selectors{display:grid;grid-template-columns:minmax(260px,1.5fr) minmax(140px,.65fr) minmax(140px,.65fr);gap:12px;align-items:end}
.worktask-main-selectors label{display:flex;flex-direction:column;gap:5px;font-weight:700}
.worktask-main-selectors>span{grid-column:1/-1}
@media(max-width:850px){.worktask-main-selectors{grid-template-columns:1fr}}

.pm-extra-block{border:1px solid #cbd5e1;border-radius:10px;padding:12px;background:#f8fafc}.pm-sr-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}.pm-notes-head{display:flex;justify-content:space-between;align-items:center;margin:12px 0 8px}.pm-notes-table{overflow-x:auto}.pm-note-row{display:grid;grid-template-columns:42px 150px minmax(220px,1fr) 150px 150px 75px;gap:6px;align-items:center;margin-bottom:6px}.pm-note-header{font-weight:700;font-size:12px;background:#e2e8f0;padding:7px;border-radius:6px}.span-4{grid-column:1/-1}@media(max-width:900px){.pm-sr-grid{grid-template-columns:1fr}.pm-note-row{min-width:800px}}

/* 2026-08-29 compact planner: Name + Shift + Login ID + denser time grid */
.timeline-shell{--employee-name-width:190px;--employee-shift-width:32px;--employee-login-width:82px;--planner-cell-width:48px;--planner-row-height:38px}
.timeline-grid{grid-template-columns:var(--employee-name-width) var(--employee-shift-width) var(--employee-login-width) repeat(var(--slot-count),var(--planner-cell-width))}
.timeline-grid.timeline-row{height:var(--planner-row-height);min-height:var(--planner-row-height);grid-auto-rows:var(--planner-row-height)}
.employee-name-sticky,.employee-shift-sticky,.employee-login-sticky{position:sticky;z-index:10;display:flex;align-items:center;padding:.2rem .35rem;background:#fff;border-right:1px solid #cbd8e4;border-bottom:1px solid #e5edf3;box-sizing:border-box;overflow:hidden;height:var(--planner-row-height)}
.employee-name-sticky{left:0;width:var(--employee-name-width)}
.employee-shift-sticky{left:var(--employee-name-width);width:var(--employee-shift-width);justify-content:center}
.employee-login-sticky{left:calc(var(--employee-name-width) + var(--employee-shift-width));width:var(--employee-login-width);justify-content:center}
.employee-name-sticky.head,.employee-shift-sticky.head,.employee-login-sticky.head{z-index:30;height:36px;background:#dce8f2;font-weight:800;font-size:.68rem}
.employee-name-sticky strong{font-size:.67rem;line-height:1.05;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.employee-shift-sticky span{font-size:.62rem;font-weight:900;white-space:nowrap;text-align:center}
.employee-login-sticky span{font-size:.63rem;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.time-head{width:var(--planner-cell-width);height:36px;font-size:.58rem;padding:0}
.time-slot{width:var(--planner-cell-width);height:var(--planner-row-height);min-height:var(--planner-row-height)}
.task-block{height:29px;margin:0 1px;padding:.12rem .24rem;border-radius:.32rem;display:flex;flex-direction:row;align-items:center;gap:.18rem;white-space:nowrap}
.task-block b,.task-block span{font-size:.57rem;line-height:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.task-block b{font-weight:900}.task-block span{font-weight:700}.task-block small{display:none}
@media(max-width:900px){.timeline-shell{--employee-name-width:165px;--employee-shift-width:32px;--employee-login-width:76px;--planner-cell-width:46px}}

/* 2026-08-29 planner horizontal scroll + compact Shift column */
.timeline-shell{overflow-x:scroll!important;overflow-y:auto!important;scrollbar-gutter:stable;max-width:100%}
.timeline-grid{width:max-content;min-width:max-content}
.timeline-shell::-webkit-scrollbar{height:12px;width:10px}
.timeline-shell::-webkit-scrollbar-track{background:#e8eef4;border-radius:8px}
.timeline-shell::-webkit-scrollbar-thumb{background:#8fa8bc;border-radius:8px;border:2px solid #e8eef4}
.employee-shift-sticky{padding-left:.12rem;padding-right:.12rem}
.employee-shift-sticky.head{font-size:.62rem}
.hoist-crane-grid{display:grid;grid-template-columns:repeat(6,minmax(110px,1fr));gap:8px;margin-top:8px}
.hoist-crane-item{display:flex;flex-direction:column;gap:4px;padding:6px;border:1px solid #d9e3ee;border-radius:6px;background:#fff}
.hoist-crane-option{display:flex;align-items:center;gap:5px;margin:0;font-weight:700;white-space:nowrap;line-height:1}
.hoist-crane-option input{margin:0}
.hoist-crane-option span{display:inline;line-height:1}
.hoist-note-input{height:28px!important;min-height:28px!important;padding:2px 6px!important;font-size:.72rem!important}
@media(max-width:900px){.hoist-crane-grid{grid-template-columns:repeat(3,minmax(105px,1fr))}}
@media(max-width:600px){.hoist-crane-grid{grid-template-columns:repeat(2,minmax(100px,1fr))}}

/* 2026-08-29 AMOC planner final horizontal control + exact compact Shift column */
.timeline-frame{width:100%;max-width:100%;min-width:0}
.timeline-shell{
    --employee-shift-width:30px;
    overflow-x:auto!important;
    overflow-y:auto!important;
    overscroll-behavior-inline:contain;
    scrollbar-gutter:stable;
}
.employee-shift-sticky{width:var(--employee-shift-width);min-width:var(--employee-shift-width);max-width:var(--employee-shift-width);padding-left:0!important;padding-right:0!important}
.employee-shift-sticky.head{font-size:.58rem!important;letter-spacing:-.01em;white-space:nowrap}
.timeline-horizontal-control{display:grid;grid-template-columns:18px minmax(0,1fr) 18px;align-items:center;gap:6px;width:100%;padding:5px 8px 3px;background:#f4f7fa;border:1px solid var(--wt-border);border-top:0;border-radius:0 0 .65rem .65rem;color:#607587;box-sizing:border-box}
.timeline-horizontal-control>span{text-align:center;font-size:.75rem;font-weight:900;line-height:1}
.timeline-horizontal-range{display:block;width:100%;height:16px;margin:0;cursor:ew-resize;accent-color:#1769aa}
.timeline-horizontal-range:disabled{opacity:.38;cursor:default}
.timeline-horizontal-range::-webkit-slider-runnable-track{height:7px;border-radius:999px;background:#d6e1ea;border:1px solid #b9cbd9}
.timeline-horizontal-range::-webkit-slider-thumb{width:22px;height:14px;margin-top:-4px;border-radius:999px;background:#1769aa;border:2px solid #fff;box-shadow:0 1px 3px #102a4050;-webkit-appearance:none}
.timeline-horizontal-range{-webkit-appearance:none;appearance:none;background:transparent}
.timeline-horizontal-range::-moz-range-track{height:7px;border-radius:999px;background:#d6e1ea;border:1px solid #b9cbd9}
.timeline-horizontal-range::-moz-range-thumb{width:20px;height:12px;border-radius:999px;background:#1769aa;border:2px solid #fff}
.timeline-frame>.timeline-shell{border-radius:.65rem .65rem 0 0}
