:root{font-family:Inter,'Microsoft YaHei','PingFang SC',sans-serif;color:#24304a;background:#f3f5fa;font-size:16px;font-synthesis:none;--blue:#111c79;--orange:#f57a24;--muted:#7e879b;--border:#e7eaf1}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:4px}button{cursor:pointer}button:disabled{cursor:wait;opacity:.6}button{border:1px solid var(--border);background:white;border-radius:7px;padding:10px 16px;color:#39435a}button:hover{background:#f5f7fc}button.primary{background:var(--blue);color:white;border-color:var(--blue)}button.orange{background:var(--orange);color:white;border-color:var(--orange)}button.small{padding:7px 11px;font-size:14px}.muted{color:var(--muted)}.shell{display:grid;grid-template-columns:258px minmax(0,1fr);min-height:100vh}.sidebar{background:linear-gradient(165deg,#151c80,#0d245d);color:#fff;display:flex;flex-direction:column;padding:28px 16px 18px;position:sticky;top:0;height:100vh}.brand{display:flex;align-items:center;gap:12px;padding:0 8px 32px;border-bottom:1px solid #ffffff19}.logo{width:51px;height:43px;background:#fff;border-radius:9px;overflow:hidden;position:relative;flex-shrink:0}.logo img{position:absolute;width:105px;max-width:none;left:-26px;top:-15px}.brand strong{font-size:18px;line-height:1.6;letter-spacing:1px}.nav-label{font-size:12px;letter-spacing:2px;color:#929bc9;margin:30px 16px 12px}.nav{display:flex;flex-direction:column;gap:7px}.nav button{display:flex;align-items:center;gap:14px;width:100%;text-align:left;background:transparent;border:0;color:#c2cbe8;padding:14px 17px;border-radius:8px;font-size:16px}.nav button:hover{background:#ffffff12;color:white}.nav button.active{background:#ffffff18;color:white;box-shadow:inset 3px 0 var(--orange)}.icon{width:21px;height:21px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.icon svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.nav-sub{padding-left:51px!important;font-size:14px!important}.sidebar-foot{margin-top:auto;padding-top:24px}.profile{display:flex;gap:11px;align-items:center;padding:17px 10px 4px;border-top:1px solid #ffffff1f}.avatar{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:#eaf0ff;color:#304ab4;font-weight:600}.profile small{color:#a8b5d5;display:block;margin-top:4px;font-size:12px}.profile button{margin-left:auto;background:transparent;color:#b8c3dd;border:0;padding:5px}.workspace{min-width:0}.topbar{height:79px;background:white;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;padding:0 36px;gap:20px}.breadcrumb{font-size:14px;color:#8992a4}.breadcrumb b{color:#45516b;font-weight:500}.top-actions{display:flex;align-items:center;gap:20px;font-size:14px}.pill{border:1px solid var(--border);padding:7px 12px;border-radius:5px;color:#69748b}.content{padding:32px 36px;max-width:1800px;margin:auto}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:25px}.page-heading h1{font-size:28px;line-height:1.4;letter-spacing:.4px;margin:0 0 9px;font-weight:650}.page-heading p{font-size:14px;color:var(--muted);margin:0}.actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;margin-bottom:25px}.stat{background:#fff;border:1px solid var(--border);padding:23px 24px;border-radius:10px}.stat-top{display:flex;justify-content:space-between;align-items:center;color:#77819a;font-size:14px}.stat-icon{background:#edf1fc;color:#445dc5;width:38px;height:38px;border-radius:9px;display:grid;place-items:center}.stat:nth-child(2) .stat-icon{background:#fff2e6;color:#e99543}.stat:nth-child(3) .stat-icon{background:#e9f7f4;color:#369a87}.stat:nth-child(4) .stat-icon{background:#f0edfe;color:#8073cc}.stat strong{display:block;font-size:33px;line-height:1.6;margin-top:7px;color:#202e4b;font-weight:650;letter-spacing:1px}.stat small{font-size:13px;color:#8992a4}.panel{background:white;border:1px solid var(--border);border-radius:10px;overflow:hidden}.panel-head{display:flex;align-items:center;justify-content:space-between;padding:21px 24px;border-bottom:1px solid var(--border);gap:12px}.panel-head h2{font-size:18px;font-weight:600;margin:0}.panel-head a{font-size:14px;color:#5265ac;cursor:pointer}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(280px,1fr);gap:24px;margin-bottom:24px}.project-row{display:grid;grid-template-columns:minmax(140px,1fr) 105px 110px;gap:15px;align-items:center;padding:22px 24px;border-bottom:1px solid #f0f2f7}.project-row:last-child{border-bottom:0}.project-row strong{font-size:15px;font-weight:550}.project-row small{display:block;font-size:13px;color:#9099aa;margin-top:8px}.progress{height:6px;background:#edf0f6;border-radius:10px;margin-top:10px;overflow:hidden}.progress span{display:block;height:100%;background:#4c64ce;border-radius:10px}.progress-label{display:flex;justify-content:space-between;font-size:13px;color:#8a94a6}.tag{display:inline-flex;align-items:center;border-radius:5px;padding:5px 9px;font-size:13px;white-space:nowrap;background:#edf2fc;color:#526ecc}.tag.green{background:#eaf6f0;color:#36866a}.tag.orange{background:#fff3e7;color:#d28c38}.tag.red{background:#ffeded;color:#cf6868}.tag.gray{background:#f1f3f7;color:#8b94a5}.todo{display:flex;gap:14px;align-items:center;padding:20px 24px;border-bottom:1px solid #f0f2f7}.todo .badge{background:#fff1e6;color:#e49448;border-radius:8px;padding:11px}.todo strong{font-size:15px;font-weight:500;display:block}.todo p{font-size:13px;color:#939bac;margin:7px 0 0}.todo button{margin-left:auto}.note{padding:16px 24px;background:#fafbfe;font-size:13px;color:#8a94a6}.toolbar{padding:18px 24px;display:flex;gap:12px;border-bottom:1px solid var(--border);align-items:center}.search{min-width:260px;max-width:440px;flex:1}.toolbar input,.toolbar select{padding:10px 13px;border:1px solid var(--border);border-radius:6px;font-size:14px;color:#59647b;background:#fff}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%;white-space:nowrap;text-align:left}th{font-size:13px;font-weight:500;background:#fafbfe;color:#8892a4;padding:15px 24px;border-bottom:1px solid var(--border)}td{font-size:14px;padding:19px 24px;border-bottom:1px solid #edf0f6}tr:last-child td{border-bottom:0}td strong{font-weight:500;color:#263654}td small{display:block;font-size:12px;color:#8e99ab;margin-top:6px}.link{color:#4c61b0!important;border:0;background:transparent;padding:0;font-size:14px}.table-foot{padding:16px 24px;border-top:1px solid var(--border);font-size:13px;color:#939bad}.empty{padding:55px 24px;text-align:center;color:#919aad;line-height:1.9}.empty strong{display:block;color:#58657d;font-size:17px;margin-bottom:7px}.bom-layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:20px}.category{padding:13px}.category h3{font-size:15px;padding:10px;margin:0 0 8px}.category button{width:100%;display:flex;justify-content:space-between;text-align:left;border:0;margin-bottom:6px;padding:14px 12px}.category button.selected{background:#fff1e5;color:#ca7932}.tree-group{padding:17px 24px;background:#fafbfe;font-size:15px;font-weight:600;border-bottom:1px solid var(--border)}.tree-row{padding:21px 24px 21px 48px;display:flex;align-items:center;gap:15px;border-bottom:1px solid var(--border)}.tree-row .branch{color:#e59a52}.tree-row strong{font-size:15px;font-weight:500}.tree-row .right{display:flex;align-items:center;gap:20px;margin-left:auto}.tree-row code{color:#919bae;font-size:12px}.tabs{display:flex;gap:28px;padding:0 24px;border-bottom:1px solid var(--border)}.tabs button{padding:18px 0;border:0;border-radius:0;color:#8b95a8;background:transparent}.tabs button.active{color:#253780;border-bottom:2px solid var(--orange)}.login{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}.login-brand{background:linear-gradient(145deg,#111c79,#0c315c);display:flex;flex-direction:column;justify-content:center;padding:12%;color:white}.login-brand .logo{width:105px;height:80px;margin-bottom:30px}.login-brand .logo img{width:210px;left:-52px;top:-30px}.login-brand h1{font-size:34px;line-height:1.6}.login-brand p{color:#a8b7db;line-height:2}.login-form{display:grid;place-items:center;padding:40px}.login-form form{max-width:390px;width:100%}.login-form h2{font-size:27px;margin-bottom:12px}.login-form p{font-size:14px;color:#8992a6;line-height:1.8;margin-bottom:30px}label{display:block;font-size:14px;color:#5c677d;margin:16px 0 7px}input,textarea,select{width:100%;padding:12px;border:1px solid #dce1eb;border-radius:6px;background:white;color:#29354e}textarea{min-height:105px;resize:vertical}input:focus,textarea:focus,select:focus{outline:2px solid #879bdd55;border-color:#7187cd}.login-form button{width:100%;margin-top:24px;padding:13px}.error{color:#bd4e4e;font-size:14px;margin:14px 0}.helper{font-size:13px;color:#8993a6;line-height:1.8}.notice{border:1px solid #f0dcc2;background:#fff9f0;padding:15px 20px;color:#a97e47;font-size:14px;border-radius:8px;margin-bottom:23px;display:flex;justify-content:space-between;align-items:center;gap:14px}dialog{width:min(650px,calc(100% - 32px));border:0;border-radius:13px;padding:0;box-shadow:0 25px 100px #14265033;max-height:90vh}dialog::backdrop{background:#17244666;backdrop-filter:blur(2px)}.dialog-head{display:flex;justify-content:space-between;align-items:center;padding:22px 26px;border-bottom:1px solid var(--border)}.dialog-head h2{font-size:20px;margin:0}.dialog-body{padding:8px 26px 24px}.dialog-footer{padding:18px 26px;display:flex;justify-content:flex-end;gap:12px;border-top:1px solid var(--border)}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 20px}.form-grid .full{grid-column:1/-1}.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;padding-top:20px}.detail-grid dt{font-size:13px;color:#9098a9;margin-bottom:8px}.detail-grid dd{margin:0;font-size:15px;white-space:pre-wrap;overflow-wrap:anywhere}#toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);background:#253450;color:white;padding:13px 23px;border-radius:8px;z-index:100;display:none;box-shadow:0 8px 30px #0002}.integration{padding:28px;line-height:1.9}.integration h3{font-size:18px}.integration code{font-size:14px;background:#f3f5fa;padding:6px 10px;border-radius:5px;overflow-wrap:anywhere}.loading{padding:80px;text-align:center}.mobile-menu{display:none}.data-note{font-size:12px;color:#99a2b4;margin-top:20px;text-align:right}@media(min-width:1600px){.content{padding:38px 45px}.sidebar{padding-top:34px}.nav button{padding-top:16px;padding-bottom:16px}}@media(max-width:1150px){.shell{grid-template-columns:220px minmax(0,1fr)}.content{padding:25px}.topbar{padding:0 25px}.brand strong{font-size:16px}.dashboard-grid{grid-template-columns:1fr}.stat{padding:18px}.stats{gap:12px}.stat strong{font-size:28px}.bom-layout{grid-template-columns:170px minmax(0,1fr)}}@media(max-width:760px){.shell{display:block}.sidebar{display:none;position:fixed;z-index:20;width:258px}.shell.menu-open .sidebar{display:flex}.mobile-menu{display:block}.topbar{padding:0 18px;height:68px}.top-actions .pill,.top-actions .date{display:none}.content{padding:22px 16px}.page-heading{align-items:flex-start;flex-direction:column}.page-heading h1{font-size:24px}.stats{grid-template-columns:1fr 1fr}.stat{padding:17px}.dashboard-grid{gap:16px}.project-row{grid-template-columns:1fr 90px;padding:18px}.project-row>div:last-child{grid-column:1/-1}.bom-layout{grid-template-columns:1fr}.category{display:flex;overflow:auto;gap:8px}.category h3{display:none}.category button{min-width:130px;margin:0}.toolbar{flex-wrap:wrap;padding:16px}.search{min-width:170px}.tree-row{padding:20px;flex-wrap:wrap}.tree-row .right{width:100%;margin-left:32px}.login{grid-template-columns:1fr}.login-brand{display:none}.login-form{min-height:100vh;padding:28px}.form-grid,.detail-grid{grid-template-columns:1fr}.form-grid .full{grid-column:auto}.notice{align-items:flex-start;flex-direction:column}.top-actions{gap:10px}.breadcrumb{font-size:12px}}
.sidebar{overflow-y:auto}
.toolbar select{width:auto;max-width:180px;flex-shrink:0}.toolbar #count{white-space:nowrap;font-size:13px}.toolbar .search{width:auto;min-width:180px}
.nav-chevron{margin-left:auto;font-size:19px}.nav .nav-parent.group-active{color:white;background:#ffffff0b}.nav .nav-sub{font-size:14px;padding-top:12px;padding-bottom:12px;padding-left:48px!important}.nav .nav-sub.active{background:#ffffff19;box-shadow:inset 3px 0 #f57a24}.project-summary{background:#f6f8fd}.project-progress th,.project-progress td{padding:16px 18px}.project-progress td:first-child{width:48px;min-width:48px}.project-progress td:nth-child(2){min-width:260px}.project-progress td:nth-child(6){min-width:135px}.progress-value{font-size:13px;color:#677797}.task-indent small{margin-left:17px}.gantt-scroll{overflow-x:auto}.gantt{min-width:750px}.gantt-header,.gantt-row{display:grid;grid-template-columns:280px minmax(380px,1fr) 75px}.gantt-header{padding:17px 0;background:#fafbfe;border-bottom:1px solid #e7eaf1;font-size:13px;color:#8892a4}.gantt-header>div:first-child{padding-left:20px}.gantt-axis{display:flex;justify-content:space-between}.gantt-row{min-height:75px;border-bottom:1px solid #edf0f6;align-items:stretch}.gantt-project{background:#f7f9fd}.gantt-name{text-align:left;border:0;border-radius:0;background:transparent;padding:16px;white-space:normal;overflow-wrap:anywhere}.gantt-name strong{font-size:14px;font-weight:500;display:block}.gantt-project .gantt-name strong{font-weight:650}.gantt-name small{display:block;color:#929caf;font-size:12px;margin-top:7px}.gantt-track{position:relative;align-self:stretch;background:repeating-linear-gradient(to right,transparent,transparent calc(20% - 1px),#e8edf6 calc(20% - 1px),#e8edf6 20%)}.gantt-bar{position:absolute;top:27px;height:22px;background:#dfebfa;border:1px solid #91a9e0;border-radius:5px;overflow:hidden;min-width:5px}.gantt-bar span{display:block;height:100%;background:#7796cf}.gantt-bar.project-bar{background:#e4e8fb;border-color:#7083cc}.gantt-bar.project-bar span{background:#405bb9}.gantt-value{align-self:center;text-align:center;font-size:13px;color:#64738d}.gantt-unscheduled{display:inline-block;margin:27px 15px;color:#a0a8b9;font-size:13px}@media(max-width:760px){.gantt-header,.gantt-row{grid-template-columns:230px minmax(380px,1fr) 65px}}
.gantt-axis{padding-right:14px}.gantt-header>div:last-child{text-align:center}
.row-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.project-progress td:last-child{min-width:210px}.add-child{white-space:nowrap;border-color:#dde5f6;color:#5168aa;background:#f8faff}.board-toolbar{display:flex;align-items:center;gap:22px;padding:20px 24px;border-bottom:1px solid #e7eaf1;flex-wrap:wrap}.board-range{font-size:14px;color:#7b879d}.board-count{font-size:13px;color:#909aac;margin-left:auto}.gantt-panel{overflow:visible}.project-picker{position:relative;min-width:275px;max-width:100%;z-index:10}.project-picker summary{display:flex;align-items:center;gap:16px;cursor:pointer;padding:12px 15px;border:1px solid #dfe5ef;border-radius:7px;list-style:none;background:white;color:#748098;font-size:14px}.project-picker summary::-webkit-details-marker{display:none}.project-picker summary strong{font-size:14px;color:#31416a;font-weight:500;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.project-picker summary>span:last-child{margin-left:auto}.project-picker[open] summary{border-color:#8a9dd5;box-shadow:0 0 0 3px #5a73c511}.project-picker-menu{position:absolute;left:0;top:calc(100% + 7px);width:365px;max-width:calc(100vw - 50px);background:white;border:1px solid #e2e7f0;border-radius:9px;box-shadow:0 12px 40px #23345825;overflow:hidden}.picker-actions{display:flex;gap:22px;padding:15px 18px;border-bottom:1px solid #edf0f6}.project-picker-options{max-height:300px;overflow:auto;padding:8px}.project-option{display:flex;align-items:flex-start;gap:12px;margin:0;padding:13px 12px;border-radius:6px;color:#354565;cursor:pointer}.project-option:hover{background:#f3f6fc}.project-option input{width:18px;height:18px;margin:2px 0 0;accent-color:#344fbc;flex-shrink:0}.project-option span{font-size:14px;overflow-wrap:anywhere}.project-option small{display:block;margin-top:7px;color:#929cad;font-size:12px}.picker-footer{border-top:1px solid #edf0f6;padding:12px 18px;text-align:right}.gantt-panel .gantt-scroll{min-height:calc(100vh - 315px);max-height:calc(100vh - 265px);overflow:auto;border-radius:0 0 8px 8px}.gantt-panel .gantt{min-width:880px}.gantt-panel .gantt-header{position:sticky;top:0;z-index:2;background:#f8faff;padding-top:18px;padding-bottom:18px}.gantt-panel .gantt-header,.gantt-panel .gantt-row{grid-template-columns:285px minmax(500px,1fr) 75px}.gantt-panel .gantt-name{padding-top:17px;padding-bottom:17px;min-height:90px}.gantt-panel .gantt-name small{font-size:12px;line-height:1.5;margin-top:5px}.gantt-panel .gantt-bar{top:34px;height:24px}.gantt-panel .gantt-unscheduled{margin-top:34px}.gantt-panel .summary-bar{border-style:dashed}.board-footer{padding:15px 22px;display:flex;align-items:center;justify-content:space-between;gap:20px;border-top:1px solid #e7eaf1;font-size:12px;color:#8994a7;flex-wrap:wrap}.board-footer i{display:inline-block;width:12px;height:8px;border-radius:2px;margin-left:16px;margin-right:3px}.board-footer i:first-child{margin-left:0}.legend-project{background:#405bb9}.legend-task{background:#a8bcdf}.legend-progress{background:#7796cf}@media(max-width:760px){.board-toolbar{padding:16px;gap:12px}.project-picker{width:100%;min-width:0}.project-picker-menu{width:100%}.board-count{margin-left:0}.gantt-panel .gantt-scroll{min-height:450px;max-height:65vh}.gantt-panel .gantt-header,.gantt-panel .gantt-row{grid-template-columns:250px minmax(500px,1fr) 65px}}
.bom-workbench{display:grid;grid-template-columns:280px minmax(0,1fr);gap:24px}.bom-products{min-height:540px}.bom-search{padding:16px}.bom-search input{width:100%;min-width:0}.product-series{border-top:1px solid #e8ecf5}.product-series summary{padding:16px;font-weight:600;cursor:pointer}.product-series summary span{float:right;color:#8996b0}.product-choice{display:block;width:calc(100% - 20px);margin:4px 10px;text-align:left;padding:14px;border:0;background:transparent}.product-choice.selected{background:#fff0e4;color:#be651d;border-left:3px solid #ff7b1b}.product-choice small{display:block;margin-top:6px;color:#8794aa;font-size:12px}.bom-details{min-width:0}.bom-detail-header,.bom-detail-actions{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:24px 26px}.bom-detail-header h2{margin:0}.bom-detail-header p{margin:8px 0 0;color:#8391aa}.bom-detail-actions{padding-top:0}.bom-origin{padding:0 26px 18px;color:#8391aa}.bom-table td,.bom-table th{white-space:normal;min-width:85px}.bom-table td:last-child{max-width:220px}@media(max-width:1000px){.bom-workbench{grid-template-columns:220px minmax(0,1fr)}}@media(max-width:700px){.bom-workbench{grid-template-columns:1fr}.bom-products{min-height:0}.bom-detail-header,.bom-detail-actions{padding:18px;flex-wrap:wrap}}
.bom-table{min-width:720px}.bom-table th,.bom-table td{padding:16px 12px;min-width:70px}.bom-table th{white-space:nowrap}.bom-table td:first-child,.bom-table th:first-child{min-width:40px}.bom-table td:nth-child(2){white-space:nowrap}
.orders-register{min-width:1700px}.orders-register th{white-space:nowrap}.orders-register td{max-width:260px;min-width:110px;white-space:normal;overflow-wrap:anywhere}.orders-register th:nth-child(1),.orders-register td:nth-child(1){position:sticky;left:0;background:#fff;z-index:1}.orders-register th:nth-child(1){background:#f8faff}.order-analysis-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;margin:20px 0}.order-summary{min-width:0}@media(max-width:1200px){.order-analysis-grid{grid-template-columns:1fr}}
.bom-global-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.bom-node{display:flex;align-items:center;gap:4px;padding:10px 6px;border-bottom:1px solid #edf0f7}.bom-node.selected{background:#fff0e4;box-shadow:inset 3px 0 #fa7a20}.bom-node-pick{border:0;background:transparent;padding:4px;text-align:left;flex:1;min-width:0;color:inherit}.bom-node-pick strong{display:block;font-size:15px;overflow-wrap:anywhere}.bom-node-pick small{display:block;font-size:11px;color:#8391aa;margin-top:5px}.bom-context{position:relative;flex-shrink:0}.bom-context summary{list-style:none;cursor:pointer;padding:8px;font-size:20px;line-height:1}.bom-context summary::-webkit-details-marker{display:none}.bom-context>div{position:absolute;right:0;top:32px;background:#fff;border:1px solid #dfe5f0;box-shadow:0 8px 20px #182b5426;border-radius:8px;padding:5px;min-width:120px;z-index:20}.bom-context button{display:block;width:100%;border:0;text-align:left;background:#fff;white-space:nowrap;font-size:14px}.bom-context button:hover{background:#f2f5fb}.bom-full-table{min-width:2900px}.bom-full-table th,.bom-full-table td{min-width:100px;max-width:240px;white-space:normal;overflow-wrap:anywhere;padding:14px 10px}.bom-full-table th{white-space:nowrap}.bom-full-table .bom-checkbox{min-width:44px;width:44px;position:sticky;left:0;background:#fff;z-index:2}.bom-checkbox input{width:16px;height:16px;accent-color:#202887;margin:0}.bom-line-selected td{background:#fff5e9}.bom-line-selected .bom-checkbox{background:#fff5e9}.bom-column-label{display:flex;align-items:center;gap:12px;margin:9px 0}.bom-column-label span{width:28px}.bom-column-label input{flex:1}#bom-dialog-form label input[type=checkbox]{width:16px;min-width:0;height:16px;margin-right:6px}.bom-grid-scroll{min-height:160px;padding-bottom:150px}.bom-context[open]{z-index:30}

.bom-sort-menu>summary{padding:7px 10px;border:1px solid var(--border);border-radius:6px;font-size:14px;cursor:pointer}.bom-sort-menu>div{min-width:165px}.bom-sort-help{font-size:12px;color:var(--muted);padding:0 14px;line-height:1.6}.bom-drag-handle{cursor:grab;color:#7e879b;padding:8px 2px;user-select:none}.bom-node.dragging{opacity:.45}.bom-node.drag-over{box-shadow:inset 0 -3px 0 var(--orange)}.bom-move-buttons{display:flex;flex-direction:column}.bom-move-buttons button{border:0;padding:1px 4px;font-size:13px}.bom-node-pick{min-width:0}.bom-node small{overflow-wrap:anywhere}

.incoming-table{min-width:1050px}.incoming-parent td{background:#f4f6fc}.incoming-parent td:first-child{min-width:280px}.incoming-child{padding-left:36px!important}.incoming-actions{min-width:160px}.incoming-table th{white-space:nowrap}

.bom-sharing{display:flex;align-items:center;gap:6px;white-space:nowrap}.bom-sharing select{min-width:96px;width:auto;color:#253550;opacity:1;background:#f4f6fb}.bom-sharing button{font-size:20px;padding:4px;flex-shrink:0}#bom-sharing-preview{overflow:auto;max-height:260px}#bom-sharing-preview table{font-size:13px}

/* Sidebar hierarchy and selection contrast. */
.nav button:not(.nav-sub){font-size:18px;font-weight:700;line-height:1.5}
.nav .nav-sub{font-size:14px!important;font-weight:400;line-height:1.5}
.nav .nav-parent.group-active{background:#334593;color:#fff}
.nav button.active,.nav .nav-sub.active{background:#dfe8ff;color:#142465;font-weight:600;box-shadow:inset 4px 0 #f57a24}
.nav button.active:hover,.nav .nav-sub.active:hover{background:#edf2ff;color:#142465}
.rules-document{padding:28px 32px;min-height:320px}.rules-line{display:flex;gap:12px;align-items:flex-start;margin:8px 0}.rules-marker{width:24px;padding-top:12px;color:#64748b;text-align:right;flex-shrink:0}.rules-text{flex:1;min-width:0;min-height:46px;padding:10px 12px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere;border:1px solid transparent;border-radius:7px}.rules-text[contenteditable]{border-color:#e1e7f0;background:#fcfdff}.rules-text[contenteditable]:focus{outline:2px solid #667eea;background:white}.rules-format{margin-top:10px;flex-shrink:0}.rules-toggles{display:flex;gap:24px;padding:20px 28px}.rules-toggles input{width:auto}.rules-panel .note{border-top:1px solid #e6ebf3}
.nav-fold-actions{display:flex;gap:8px;margin:0 12px 16px}.nav-fold-actions button{flex:1;background:#ffffff16;color:#e9efff;border:1px solid #7e91d5;padding:8px 4px;font-size:12px}.nav-fold-actions button:hover{background:#4056a3}.nav-children{display:flex;flex-direction:column;gap:7px}.nav .nav-children .nav-sub{padding-left:48px!important}.nav-chevron{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;color:inherit;font-size:28px;line-height:1;flex-shrink:0}.hierarchy-toggle{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;margin-right:8px;border:1px solid #9baed8;border-radius:5px;background:#edf2ff;color:#263f86;font-size:18px;flex-shrink:0}.hierarchy-toggle:hover{background:#dbe6ff}.hierarchy-branch{display:inline-block;margin-right:10px;font-size:22px;font-weight:700;color:#5c73aa}.hierarchy-toolbar{display:flex;gap:8px;padding:0 16px 14px}.hierarchy-toolbar button{flex:1;font-size:12px}.bom-node>.hierarchy-toggle{margin-right:2px}.bom-node>.hierarchy-branch{font-size:18px;color:#677ba4}
.progress-tree-name{display:flex;align-items:center;gap:4px}.progress-tree-name small{display:block}.progress-tree-name .hierarchy-toggle{flex-shrink:0;border:0;border-radius:0;background:transparent;font-size:28px;color:#263f86}.progress-tree-name .hierarchy-toggle:hover{background:transparent;color:#f57a24}.progress-tree-name .hierarchy-branch{flex-shrink:0}

/* Project list typography distinguishes parent projects from child projects. */
#project-list .project-root-row td:nth-child(2) strong{font-size:16px;font-weight:700;color:#24365c;line-height:1.5}
#project-list .project-child-row td:nth-child(2) strong{font-size:14px;font-weight:400;color:#465a7c;line-height:1.5}
#project-list .project-root-row td:nth-child(2) small{font-size:12px;font-weight:500}
#project-list .project-child-row td:nth-child(2) small{font-size:12px;font-weight:400}

/* Weekly Gantt columns and alternating rule blocks. */
.gantt-panel .gantt-axis{position:relative;display:block;padding:0;min-height:38px;background:repeating-linear-gradient(to right,transparent,transparent calc(var(--week-width) - 1px),#dfe5f0 calc(var(--week-width) - 1px),#dfe5f0 var(--week-width))}
.gantt-panel .gantt-axis>span{position:absolute;top:0;padding-left:8px;font-size:12px;white-space:nowrap}.gantt-panel .gantt-axis small{display:block;margin-top:5px;color:#98a4b7;font-size:11px}
.gantt-panel .gantt-track{background:repeating-linear-gradient(to right,transparent,transparent calc(var(--week-width) - 1px),#dfe5f0 calc(var(--week-width) - 1px),#dfe5f0 var(--week-width))}
.rules-line:nth-child(odd) .rules-text{background:#fff}.rules-line:nth-child(even) .rules-text{background:#edf3fc}.rules-line .rules-text[contenteditable]:focus{background:#fff}

/* Shared project hierarchy typography across all project pages. */
#content .project-title-root{font-size:16px!important;font-weight:700!important;color:#24365c!important;line-height:1.5}
#content .project-title-child{font-size:14px!important;font-weight:400!important;color:#465a7c!important;line-height:1.5}

/* Gantt bars inherit their root project's color; descendants share one opacity. */
.gantt-name .gantt-project-code{font-size:12px;font-weight:400;color:#7e8ca4;margin-left:5px;overflow-wrap:anywhere}
.gantt-panel .gantt-bar{border-color:hsla(var(--project-hue),60%,40%,var(--project-alpha));background:hsla(var(--project-hue),60%,40%,calc(var(--project-alpha) * 0.6))}
.gantt-panel .gantt-bar span{background:hsla(var(--project-hue),65%,30%,var(--project-alpha))}

.cost-manual-row td{background:#f4f9f6}.cost-manual-row td:nth-child(2){border-left:3px dashed #6f9983}#content .cost-manual-row .project-title-child{font-style:italic;color:#496c58!important}.cost-manual-badge{display:inline-block;padding:2px 6px;border-radius:4px;font-size:11px;color:#497b60;background:#e0f0e6}.cost-manual-row.bom-line-selected td{background:#fff5e9}

.gantt-panel .gantt-axis{min-height:54px;background:none}.gantt-months,.gantt-weeks{position:relative;height:27px}.gantt-months{border-bottom:1px solid #dfe5f0}.gantt-months span,.gantt-weeks span{position:absolute;top:0;bottom:0;padding:5px 6px;border-left:1px solid #dfe5f0;white-space:nowrap;font-size:12px}.gantt-weeks span{font-size:11px;color:#7e8da5}.gantt-panel .gantt-bar{cursor:help}

/* Persistent, resizable sidebar with single-line navigation labels. */
@media(min-width:761px){.shell{grid-template-columns:var(--sidebar-width,300px) minmax(0,1fr)}.sidebar-resize{position:fixed;left:calc(var(--sidebar-width,300px) - 4px);top:0;bottom:0;width:8px;cursor:col-resize;z-index:25;touch-action:none;background:transparent}.sidebar-resize:hover,.sidebar-resize:focus-visible,.sidebar-resizing .sidebar-resize{background:#8396d280}.sidebar-resizing{user-select:none;cursor:col-resize}.sidebar-resizing *{cursor:col-resize!important}}
.nav button,.brand strong,.sidebar .profile{white-space:nowrap}.nav button{flex-shrink:0}.sidebar-resize:focus-visible{outline:2px solid #536dc0;outline-offset:-2px}
@media(max-width:760px){.sidebar-resize{display:none}.sidebar{width:300px}}

.purchase-line-section{border:1px solid #e1e7f1;border-radius:8px;padding:14px;margin-top:16px}.purchase-form-line{display:grid;grid-template-columns:2fr 1.3fr 1fr 1fr 1fr auto;gap:8px;align-items:end;border-bottom:1px solid #e5eaf3;padding-bottom:12px}.purchase-form-line label{min-width:0}.purchase-form-line button{margin-bottom:0}.purchase-register td{white-space:pre-line;min-width:100px}.purchase-register{min-width:1800px}dialog:has(.purchase-line-section){width:min(1050px,calc(100% - 32px))}@media(max-width:760px){.purchase-form-line{grid-template-columns:1fr 1fr}}

.purchase-supplier-fields{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px;padding-top:16px}.purchase-supplier-fields>div{min-width:0}@media(max-width:760px){.purchase-supplier-fields{grid-template-columns:1fr}}
.warehouse-tabs{display:flex;gap:20px;padding:0 24px;border-bottom:1px solid var(--border)}.warehouse-tabs button{border:0;border-radius:0;padding:18px 4px;background:transparent;border-bottom:3px solid transparent}.warehouse-tabs button.active{color:var(--blue);font-weight:600;border-bottom-color:var(--orange)}.warehouse-tabs small{margin-left:6px;color:var(--muted)}.warehouse-print-frame{position:fixed;width:1px;height:1px;left:-10000px;top:0;border:0}

#purchase-form-lines{overflow-x:auto;max-width:100%;padding-bottom:8px;margin-top:14px}.purchase-lines-table{table-layout:fixed;min-width:1620px;width:100%;border-collapse:collapse}.purchase-lines-table th{white-space:nowrap;padding:12px 8px;background:#f3f6fc;color:#65738f;font-weight:500}.purchase-lines-table .purchase-form-line{display:table-row;min-width:0;padding:0}.purchase-lines-table td{padding:12px 8px;vertical-align:middle;border-bottom:1px solid #e5eaf3}.purchase-lines-table tr:nth-child(even){background:#f7f9fd}.purchase-lines-table input:not([type=checkbox]),.purchase-lines-table select{display:block;width:100%;min-width:0;margin:0}.purchase-lines-table input[type=checkbox]{display:block;width:16px;height:16px;margin:0 auto;cursor:pointer}.purchase-lines-table .purchase-line-selected{background:#fff3e5!important}dialog:has(.purchase-line-section){width:min(1800px,calc(100% - 32px))}.purchase-line-section{min-width:0}

.user-module-picker fieldset{border:1px solid var(--border);border-radius:7px;margin:14px 0;padding:14px}.user-module-picker fieldset>div{display:grid;grid-template-columns:1fr 1fr;gap:10px}.user-module-picker label{display:flex;gap:8px;align-items:center;margin:10px 0}.user-module-picker input[type=checkbox]{width:16px;height:16px;margin:0}.user-module-picker legend{font-weight:600;padding:0 8px}@media(max-width:760px){.user-module-picker fieldset>div{grid-template-columns:1fr}}
.orders-register .order-root{background:#f5f7fe;font-weight:600}.orders-register .order-product td{background:#fff}.orders-register .order-demand td{background:#f0faf6}.orders-register .order-product td:first-child,.orders-register .order-demand td:first-child{padding-left:30px;white-space:nowrap}.order-profit{margin:20px 0}.order-profit-totals{display:flex;gap:36px;flex-wrap:wrap;padding:20px 24px;background:#f8faff}.order-profit-totals strong{margin-left:12px;font-size:19px}.order-loss{color:#c73535}
.orders-register{min-width:2200px}.orders-register th,.orders-register td{white-space:nowrap}.orders-register .order-root td:nth-child(2){min-width:190px}.orders-register .order-root td:nth-child(11),.orders-register .order-root td:nth-child(12){min-width:170px}.orders-register .order-root td:last-child{min-width:180px}
.bom-column-label{position:relative;padding:4px 0;border-radius:6px}.bom-column-label input{min-width:0;margin:0}.bom-column-label .bom-column-drag{flex:0 0 30px;padding:7px 2px;color:#6678a4;cursor:grab;font-size:20px;line-height:1.2;background:#f3f6fc;touch-action:none}.bom-column-label .bom-column-drag:active{cursor:grabbing}.bom-column-label .bom-column-position{flex:0 0 28px;text-align:center;color:#6678a4}.bom-column-label.column-dragging{opacity:.45}.bom-column-label.column-drop-before:before,.bom-column-label.column-drop-after:after{content:'';position:absolute;left:0;right:0;height:3px;background:#f57a24;pointer-events:none}.bom-column-label.column-drop-before:before{top:-4px}.bom-column-label.column-drop-after:after{bottom:-4px}
.bom-grid-scroll{padding-bottom:16px}
/* Application frame: navigation and work area scroll independently. */
body:has(.shell){overflow:hidden}.shell{height:100vh;height:100dvh;min-height:0;overflow:hidden}.sidebar{height:100%;min-height:0;overflow:hidden;padding-bottom:12px;position:relative}.sidebar>.brand{flex-shrink:0}.sidebar-scroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding-right:6px;scrollbar-gutter:stable}.sidebar-foot{flex-shrink:0;margin-top:0;padding-top:12px}.sidebar-foot .profile{padding-top:12px}.workspace{height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) 36px;overflow:hidden}.content{width:100%;max-width:none;margin:0;min-height:0;overflow:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:0;padding:24px}.content>*{flex-shrink:0}.content>.panel:last-of-type,.content>.bom-workbench{flex:1 0 auto}.content>.panel:last-of-type{display:flex;flex-direction:column}.content>.panel:last-of-type>.table-foot,.content>.panel:last-of-type>.note{margin-top:auto}.content .page-heading{flex-shrink:0}.app-status{min-width:0;display:flex;align-items:center;gap:9px;padding:0 20px;border-top:1px solid #dfe5ef;background:#fff;color:#52627e;font-size:13px;overflow:hidden}.app-status-dot{flex:0 0 7px;width:7px;height:7px;background:#43a575;border-radius:50%}#app-status-message{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#app-status-time{margin-left:auto;flex-shrink:0;color:#8b96a8;font-size:12px}.content>.bom-workbench{min-height:540px}.content>.panel:last-of-type>#progress-list,.content>.panel:last-of-type>#project-list,.content>.panel:last-of-type>#record-list{flex:1}
@media(min-width:1600px){.content{padding:28px 32px}}@media(max-width:760px){.shell{display:block}.sidebar{position:fixed;height:100vh;height:100dvh;top:0;bottom:0}.workspace{height:100vh;height:100dvh}.content{padding:18px 16px}.app-status{padding:0 16px}.sidebar>.brand{padding-bottom:20px}}
.workspace{grid-template-rows:auto minmax(0,1fr) auto 36px}.workspace-hscroll{height:18px;min-width:0;overflow-x:scroll;overflow-y:hidden;background:#f4f6fb;border-top:1px solid #e0e6f0;scrollbar-color:#909bb0 #eef1f7}.workspace-hscroll[hidden]{display:none}.workspace-hscroll>div{height:1px}.workspace-hscroll::-webkit-scrollbar{height:16px}.workspace-hscroll::-webkit-scrollbar-thumb{background:#929db1;border:3px solid #eef1f7;border-radius:8px}.workspace-hscroll::-webkit-scrollbar-track{background:#eef1f7}.workspace-horizontal-target::-webkit-scrollbar{height:0;width:10px}.workspace-horizontal-target::-webkit-scrollbar-thumb{background:#9ba5b7;border-radius:6px}
.pmc-table{min-width:1100px}.pmc-table td,.pmc-table th{white-space:nowrap}.pmc-root{background:#f4f6ff}.pmc-group{display:flex;align-items:center;gap:18px;min-height:40px}.pmc-group strong{font-size:16px}.pmc-product td:first-child{padding-left:32px}.pmc-origin td{background:#fafbfe;color:#7d8aa3;font-size:12px;padding-top:8px;padding-bottom:8px}.pmc-progress{min-width:120px}.pmc-progress>.progress{margin-top:8px}.pmc-column{display:flex;gap:8px;align-items:center;margin-bottom:10px}.pmc-column input{flex:1;min-width:0}.pmc-column span{cursor:grab;padding:10px}.pmc-wide{width:min(1400px,95vw);max-width:95vw}.pmc-wide .table-wrap{max-height:55vh}.pmc-panel{min-height:0}
.customer-table th:last-child,.customer-table td:last-child{position:sticky;right:0;box-shadow:-4px 0 7px #21345808;z-index:1}.customer-table th:last-child{background:#fafbfe}.customer-table td:last-child{background:#fff}.customer-table .row-actions{display:flex;flex-direction:row;flex-wrap:nowrap;gap:14px;white-space:nowrap}
.customer-table input[type=checkbox]{width:16px;height:16px;padding:0;margin:0;cursor:pointer}.customer-table th:first-child,.customer-table td:first-child{width:54px;min-width:54px}.customer-table+input[type=checkbox]{width:16px}
.finished-quality-table .fq-root{background:#f5f7fd}.finished-quality-table .fq-child td:first-child{padding-left:45px}.finished-quality-table .fq-bad{background:#fff8f5}.finished-quality-table td{white-space:nowrap}

.purchase-lines-table{min-width:1760px}.purchase-register{min-width:1940px}

/* Unified hierarchy: spacious primary rows, compact secondary rows. */
:root{--hierarchy-primary-size:16px;--hierarchy-secondary-size:14px;--hierarchy-primary-leading:1.7;--hierarchy-secondary-leading:1.45;--hierarchy-primary-space:20px;--hierarchy-secondary-space:11px}
#content :is(tr.project-root-row,tr:has(.project-title-root),tr.order-root,tr.pmc-root,tr.fq-root)>td{font-size:var(--hierarchy-primary-size);line-height:var(--hierarchy-primary-leading);padding-top:var(--hierarchy-primary-space);padding-bottom:var(--hierarchy-primary-space)}
#content :is(tr.project-child-row,tr:has(.project-title-child),tr.cost-manual-row,tr.order-product,tr.order-demand,tr.pmc-product,tr.fq-child)>td{font-size:var(--hierarchy-secondary-size);line-height:var(--hierarchy-secondary-leading);padding-top:var(--hierarchy-secondary-space);padding-bottom:var(--hierarchy-secondary-space)}
#content :is(.project-title-root,.order-root strong,.pmc-root strong,.fq-root strong){font-size:var(--hierarchy-primary-size)!important;font-weight:700!important;line-height:var(--hierarchy-primary-leading)}
#content :is(.project-title-child,.order-product strong,.pmc-product strong,.fq-child strong){font-size:var(--hierarchy-secondary-size)!important;font-weight:500!important;line-height:var(--hierarchy-secondary-leading)}
#content :is(tr.project-root-row,tr:has(.project-title-root),tr.order-root,tr.pmc-root,tr.fq-root)>td small{margin-top:6px;font-size:12px;line-height:1.5}
#content :is(tr.project-child-row,tr:has(.project-title-child),tr.cost-manual-row,tr.order-product,tr.order-demand,tr.pmc-product,tr.fq-child)>td small{margin-top:4px;font-size:12px;line-height:1.45}
#content .pmc-root .pmc-group{min-height:32px;line-height:var(--hierarchy-primary-leading)}
#content .pmc-product .pmc-progress>.progress{margin-top:6px}
.bom-node[data-hierarchy-level="0"]{padding-top:16px;padding-bottom:16px;line-height:var(--hierarchy-primary-leading)}
.bom-node[data-hierarchy-level="0"] .bom-node-pick strong{font-size:var(--hierarchy-primary-size);font-weight:700;line-height:var(--hierarchy-primary-leading)}
.bom-node[data-hierarchy-level]:not([data-hierarchy-level="0"]){padding-top:9px;padding-bottom:9px;line-height:var(--hierarchy-secondary-leading)}
.bom-node[data-hierarchy-level]:not([data-hierarchy-level="0"]) .bom-node-pick strong{font-size:var(--hierarchy-secondary-size);font-weight:500;line-height:var(--hierarchy-secondary-leading)}
.bom-node[data-hierarchy-level] .bom-node-pick small{font-size:12px;line-height:1.45;margin-top:4px}
.nav button:not(.nav-sub){font-size:var(--hierarchy-primary-size);line-height:var(--hierarchy-primary-leading);padding-top:14px;padding-bottom:14px;font-weight:600}
.nav .nav-children .nav-sub{font-size:var(--hierarchy-secondary-size)!important;line-height:var(--hierarchy-secondary-leading);padding-top:9px;padding-bottom:9px;font-weight:400}
.nav-children{gap:4px}

/* Translucent tint for primary hierarchy rows. */
:root{--hierarchy-primary-background:rgba(76,100,206,.07)}
#content :is(tr.project-root-row,tr:has(.project-title-root),tr.order-root,tr.pmc-root,tr.fq-root){background-color:var(--hierarchy-primary-background)}
#content .bom-node[data-hierarchy-level="0"]:not(.selected){background-color:var(--hierarchy-primary-background)}
.nav button.nav-group:not(.active){background-color:rgba(255,255,255,.06)}

/* Manual entries use a translucent pale yellow tint. */
:root{--manual-row-background:rgba(244,193,64,.10)}
#content .cost-manual-row>td{background-color:var(--manual-row-background)}
#content .cost-manual-row>td:nth-child(2){border-left-color:rgba(178,133,32,.55)}
#content .cost-manual-row .project-title-child{color:#806829!important}
#content .cost-manual-badge{color:#8a6d24;background-color:rgba(244,193,64,.17)}
#content .cost-manual-row.bom-line-selected>td{background-color:rgba(244,193,64,.22)}

/* Project board and progress list share the same hierarchy background. */
#content .project-progress tr:has(.project-title-child):not(.bom-line-selected){background-color:transparent}
#content .project-progress tr:has(.project-title-child):not(.bom-line-selected)>td{background-color:transparent}
#content .gantt-panel .gantt-row:has(.project-title-root){background-color:var(--hierarchy-primary-background)}
#content .gantt-panel .gantt-row:has(.project-title-child){background-color:transparent}

.warehouse-subtabs{display:flex;gap:10px;padding:12px 24px;border-bottom:1px solid var(--border);background:#fafbfe}.warehouse-subtabs button{font-size:14px;padding:8px 14px}.warehouse-subtabs button.active{background:rgba(76,100,206,.09);border-color:#91a4d6;color:#263f86}.warehouse-subtabs small{margin-left:5px;color:var(--muted)}.inventory-group>td{background:var(--hierarchy-primary-background);font-size:16px;padding-top:16px;padding-bottom:16px}

/* Shared column resizing for page tables and dialog tables. */
table.resizable-columns{table-layout:fixed!important;min-width:0!important;max-width:none!important}.resizable-columns th{position:relative;padding-right:18px}.resizable-columns th,.resizable-columns td{min-width:0!important;overflow:hidden;text-overflow:ellipsis}.column-resize-handle{position:absolute;right:0;top:0;bottom:0;width:9px;cursor:col-resize;touch-action:none;user-select:none;z-index:5}.column-resize-handle:after{content:'';position:absolute;right:3px;top:20%;bottom:20%;width:2px;background:rgba(76,100,206,.18)}.column-resize-handle:hover:after,.column-resize-handle:focus-visible:after{background:#526ecc}.column-resize-handle:focus-visible{outline:2px solid #7187cd;outline-offset:-2px}.resizing-columns,.resizing-columns *{cursor:col-resize!important;user-select:none!important}

.resizable-columns th,.resizable-columns td{max-width:none!important}.resizable-columns th:has(>input[type=checkbox]),.resizable-columns td:has(>input[type=checkbox]){padding-left:8px;padding-right:8px}

/* Visible column boundaries and wider drag targets. */
.resizable-columns thead th{border-right:1px solid rgba(105,126,171,.4)}.resizable-columns .column-resize-handle{width:14px;right:0}.resizable-columns .column-resize-handle:after{right:0;top:10%;bottom:10%;width:2px;background:rgba(105,126,171,.5)}.resizable-columns .column-resize-handle:hover:after,.resizable-columns .column-resize-handle:focus-visible:after{background:#435fc0;width:3px}

/* Table content follows the chosen width and grows vertically. */
.resizable-columns tbody td,.resizable-columns tfoot td{white-space:pre-wrap!important;overflow-wrap:anywhere;word-break:normal;text-overflow:clip;line-height:1.6}.resizable-columns td>strong,.resizable-columns td>small,.resizable-columns td>a{white-space:inherit;overflow-wrap:anywhere}.resizable-columns td .row-actions{flex-wrap:wrap}.resizable-columns td button:not(.hierarchy-toggle){max-width:none;white-space:nowrap;overflow-wrap:normal;flex-shrink:0}

/* Keep page action buttons on one line and scale as a group. */
.page-heading>div:first-child:not(.page-actions-viewport){flex:1;min-width:0}.page-actions-viewport{position:relative;flex:0 0 auto;max-width:100%}.page-actions-viewport>.actions{position:absolute;right:0;top:0;width:max-content;display:flex;flex-wrap:nowrap!important;transform-origin:top right;gap:10px}.page-actions-viewport>.actions>button,.page-actions-viewport>.actions>details{flex-shrink:0;white-space:nowrap}

#purchase-batch-panel{margin:12px 0;padding:14px;border:1px solid #dce4f4;border-radius:7px;background:#f8faff}#purchase-batch-panel[hidden]{display:none}#purchase-batch-panel p{margin:8px 0}#purchase-batch-preview{max-height:260px;overflow:auto}

.warehouse-label-preview{display:block;width:100%;height:440px;border:1px solid #dce1ef;border-radius:8px;background:#eef0f7}#label-supplier-scan{width:100%;min-height:60px}#label-supplier-message{display:block;margin:8px 0}

#label-payload-details pre{font-family:inherit;white-space:pre-wrap;overflow-wrap:anywhere;background:#f6f8fd;padding:10px;border-radius:6px}

/* Keep login errors distinct from the muted introductory text. */
.login-form p.error{color:#c62828}

/* Keep each module title and its actions visible inside the content scroller. */
.content{--heading-top-space:24px;--heading-side-space:24px}
.content>.page-heading{
 position:sticky;
 top:0;
 z-index:10;
 margin-top:calc(-1 * var(--heading-top-space));
 padding-top:var(--heading-top-space);
 padding-bottom:16px;
 margin-bottom:9px;
 background:#f3f5fa;
}
@media(min-width:1600px){.content{--heading-top-space:28px;--heading-side-space:32px}}
@media(max-width:760px){.content{--heading-top-space:18px;--heading-side-space:16px}}

/* Cover the scroll container padding above and beside the sticky heading. */
.content>.page-heading::before{
 content:"";
 position:absolute;
 top:calc(-1 * var(--heading-top-space));
 bottom:0;
 left:calc(-1 * var(--heading-side-space));
 right:calc(-1 * var(--heading-side-space));
 background:#f3f5fa;
 z-index:-1;
 pointer-events:none;
}

/* Keep the original interactive table header above scrolling rows. */
#content thead.pinned-table-header{position:relative;z-index:8;isolation:isolate;background:#fafbfe}
#content thead.pinned-table-header th,#content thead.pinned-table-header td{background:#fafbfe;box-shadow:inset 0 -1px 0 var(--border)}

/* Translucent schedule bands: projects, tasks, completed intervals. */
.gantt-panel{--plan-project:rgba(100,135,195,.19);--plan-task:rgba(194,160,101,.19);--plan-completed:rgba(103,182,136,.43)}
.gantt-panel .gantt-bar{top:8px;bottom:8px;height:auto;min-width:0;border:1px solid rgba(194,160,101,.28);background:var(--plan-task);border-radius:4px}
.gantt-panel .gantt-bar.project-bar{background:var(--plan-project);border-color:rgba(100,135,195,.28)}
.gantt-panel .gantt-bar span.gantt-completed{height:100%;background:var(--plan-completed);border-right:1px solid rgba(74,145,106,.30)}
.gantt-panel .gantt-bar span.gantt-completed[style="width:0%"]{border:0}
.gantt-panel .summary-bar{border-style:dashed}
.gantt-legend{display:inline-block;width:13px;height:10px;margin:0 5px 0 12px;border-radius:2px;vertical-align:middle}
.gantt-legend:first-child{margin-left:0}.gantt-legend.project{background:var(--plan-project)}.gantt-legend.task{background:var(--plan-task)}.gantt-legend.completed{background:var(--plan-completed)}

/* Frozen names and a shared Today marker on the Gantt time axis. */
.gantt-panel .gantt{position:relative;--gantt-label-width:285px;--gantt-value-width:75px}
.gantt-panel .gantt-header,.gantt-panel .gantt-row{grid-template-columns:var(--gantt-label-width) minmax(500px,1fr) var(--gantt-value-width)}
.gantt-panel .gantt-name{position:sticky;left:0;z-index:5;background:#fff;box-shadow:1px 0 0 #e0e6ef}
.gantt-panel .gantt-row.gantt-project .gantt-name{background:#f5f6fc}
.gantt-panel .gantt-header{z-index:6}
.gantt-panel .gantt-header>div:first-child{position:sticky;left:0;z-index:8;background:#f8faff;box-shadow:1px 0 0 #e0e6ef;align-self:stretch}
.gantt-panel .gantt-axis{overflow:visible}
.gantt-today-line{position:absolute;top:72px;bottom:0;width:2px;background:rgba(211,67,69,.72);z-index:3;pointer-events:none;transform:translateX(-1px)}
.gantt-today-marker{position:absolute;top:100%;height:18px;z-index:7;color:#c94448;pointer-events:none}
.gantt-today-marker i{position:absolute;top:0;left:-5px;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:7px solid #d34345}
.gantt-today-marker b{position:absolute;left:8px;top:0;font-size:11px;line-height:16px;font-weight:500;white-space:nowrap;background:rgba(248,250,255,.95);padding:0 3px;border-radius:2px}
.gantt-panel .gantt-completed{display:flex!important;justify-content:flex-end;align-items:center;overflow:hidden}
.gantt-progress-label{display:block;padding:0 4px;color:#28563c;font-size:11px;font-weight:600;line-height:1.2;white-space:nowrap;overflow:hidden}
@media(max-width:760px){.gantt-panel .gantt{--gantt-label-width:250px;--gantt-value-width:65px}}

/* Both BOM tabs share a detail search while product navigation stays separate. */
.bom-details>.tabs{display:flex;align-items:center;flex-wrap:wrap}.bom-line-search{margin-left:auto;padding:8px 16px;min-width:240px;max-width:100%;flex:0 1 390px}.bom-line-search input{width:100%;font-size:14px;padding:9px 12px}

/* One horizontal scrollbar for the workspace, always above the status bar. */
.workspace>.topbar{grid-row:1}.workspace>.content{grid-row:2}.workspace>.workspace-hscroll{grid-row:3}.workspace>.app-status{grid-row:4}
.workspace-horizontal-target{scrollbar-color:auto}
.workspace-horizontal-target::-webkit-scrollbar:horizontal{height:0!important;display:none}
.workspace-hscroll{position:relative;z-index:12;align-self:end}

.order-attachment-links{display:flex;flex-direction:column;gap:6px;margin-bottom:6px}.order-attachment-links a,.order-attachment-list a{color:#445b9e;text-decoration:none;overflow-wrap:anywhere}.order-attachment-links a:hover,.order-attachment-list a:hover{text-decoration:underline}.order-attachment-list{list-style:none;margin:0 0 18px;padding:0}.order-attachment-list li{display:flex;flex-direction:column;gap:5px;border-bottom:1px solid var(--border);padding:10px 0}.order-attachment-list small{color:var(--muted)}

/* Completed purchases remain readable at the bottom of the register. */
.purchase-register tr.purchase-completed>td{background:#f1f2f4;color:#89909b}.purchase-register tr.purchase-completed strong,.purchase-register tr.purchase-completed small,.purchase-register tr.purchase-completed button.link{color:#89909b}.purchase-register tr.purchase-completed .tag{background:#e5e7eb;color:#7b828e}.purchase-register tr.purchase-completed.bom-line-selected>td{background:#e9e7e2}

.purchase-register>tbody>tr.purchase-order-row>td{background:#f2f3fc}.purchase-register .purchase-material-group>td{padding:0}.purchase-materials{padding:12px 16px 20px 28px;background:#fff}.purchase-materials table{width:100%;min-width:1500px}.purchase-materials th{background:#f8f9fd}.purchase-materials td{white-space:normal}.purchase-material-group.purchase-completed .purchase-materials,.purchase-material-group.purchase-completed td{background:#f1f2f4;color:#89909b}

.purchase-materials table{min-width:2400px}.purchase-materials a{color:#445b9e;overflow-wrap:anywhere}.purchase-materials td{vertical-align:top}.purchase-register>tbody>tr.purchase-completed.purchase-order-row>td{background:#f1f2f4;color:#89909b}

.purchase-register tr.purchase-completed .link,.purchase-register tr.purchase-completed a{color:#89909b!important}

/* The spanning detail cell must expose its table to the outer scroll wrapper.
   Column resizing clips ordinary cells, but clipping this container hides
   entire detail columns and prevents the bottom dock detecting overflow. */
#purchase-list .purchase-register>tbody>.purchase-material-group>td:last-child{overflow:visible;text-overflow:clip}

.receiving-register{min-width:1250px}.receiving-order>td{background:#f2f3fc}.receiving-order>td:first-child{min-width:260px}.receiving-register .receiving-material-group>td,.receiving-materials .receiving-batch-group>td{padding:0}.receiving-materials{padding:12px 16px 18px 24px}.receiving-materials>table{min-width:1850px}.receiving-material-row>td{background:#fff;vertical-align:top;white-space:normal}.receiving-material-row td:nth-child(2){min-width:220px}.receiving-batches{padding:12px 16px 16px 24px;background:#fafbfe}.receiving-batches>table{min-width:950px}.receiving-batches th{background:#f3f6fc}.receiving-batch-row>td{background:#fff;vertical-align:top;white-space:normal}.receiving-batch-row td:first-child{min-width:240px}.receiving-no-batch{padding:10px;color:#8e99ab;font-size:13px}.receiving-register .incoming-actions button{margin:3px}.receiving-unassigned>td{padding:16px;background:#fff8ee}.receiving-register .receiving-completed>td{color:#89909b;background:#f1f2f4}.receiving-register .receiving-completed .link{color:#89909b!important}
#receiving-list .receiving-register>tbody>.receiving-material-group>td:last-child,#receiving-list .receiving-materials>table>tbody>.receiving-batch-group>td:last-child,#receiving-list .receiving-unassigned>td{overflow:visible;text-overflow:clip}

/* Order summaries have stronger type than their material and arrival rows. */
.purchase-register>tbody>.purchase-order-row>td,.receiving-register>tbody>.receiving-order>td{font-size:15px;font-weight:600}
.purchase-register>tbody>.purchase-order-row strong,.receiving-register>tbody>.receiving-order>td:first-child>.link{font-size:16px;font-weight:700}
.purchase-register>tbody>.purchase-order-row>td>.link{font-size:15px;font-weight:600}
.purchase-materials>table>tbody>tr>td,.receiving-materials>table>tbody>.receiving-material-row>td{font-size:14px;font-weight:400}
.purchase-order-row>td>small,.receiving-order>td>small{font-size:12px;font-weight:400}
.receiving-batches>table>tbody>tr>td{font-size:13px;font-weight:400}

.purchase-request-dialog{width:min(1440px,96vw);max-width:96vw}.request-number-row{display:flex;align-items:end;gap:14px;margin-bottom:16px}.request-number-row>label{flex:1;margin:0}.request-number-row input{background:#f6f8fc}.request-common{padding:12px 16px;background:#f6f8fc;border-radius:8px}.request-common h3,.request-detail-heading h3{margin:0 0 12px;font-size:17px}.request-common-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.request-common-grid label{margin:0}.request-common-grid input,.request-common-grid select{width:100%;min-width:0}.request-detail-heading{display:flex;align-items:center;justify-content:space-between;margin:18px 0 8px}.request-detail-heading small{font-size:14px;font-weight:400;color:var(--muted)}.request-lines table{min-width:1100px;table-layout:fixed}.request-lines th,.request-lines td{padding:10px 8px;vertical-align:top;white-space:normal}.request-lines th:first-child{width:50px}.request-lines th:nth-child(2){width:240px}.request-lines th:nth-child(3){width:170px}.request-lines th:nth-child(4){width:100px}.request-lines th:nth-child(5){width:120px}.request-lines th:nth-child(6){width:120px}.request-lines th:nth-child(7){width:210px}.request-lines input{width:100%;min-width:0;margin:0 0 5px}.request-lines small{font-size:11px;line-height:1.5}.request-lines td:last-child button{display:block;margin-bottom:8px;padding:6px 10px;white-space:nowrap}.request-extra{background:#f8faff}.request-detail-actions{display:flex;gap:12px;margin-top:12px}.request-resolution-line{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:14px 0;border-bottom:1px solid var(--border)}.request-resolution-line strong{grid-column:1/-1}@media(max-width:760px){.request-common-grid{grid-template-columns:1fr 1fr}.request-number-row{flex-wrap:wrap}.request-number-row>label{flex-basis:100%}}

.purchase-request-dialog .dialog-body{padding-top:12px}.request-lines td{padding:8px}.request-lines input{height:34px;padding:6px 8px;margin-bottom:4px}.request-lines input[data-request-key="materialId"]{height:26px;font-size:12px;color:var(--muted)}.request-common-grid{gap:9px 12px}.request-common-grid input,.request-common-grid select{height:38px;padding:7px 9px}.request-lines td:last-child button{display:inline-block;margin:0 4px 4px 0}.request-detail-actions{margin-top:8px}

/* Scoped purchase import controls; native approval forms are unchanged. */
.purchase-request-dialog .request-import-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;padding:10px 20px;border:1px solid #245ac6;border-radius:8px;background:#245ac6;color:#fff;font-family:inherit;font-size:15px;font-weight:600;white-space:nowrap;cursor:pointer}
.purchase-request-dialog .request-import-button:hover{background:#19499f}
.purchase-request-dialog .request-import-button:focus-visible,.purchase-request-dialog .request-template-button:focus-visible{outline:3px solid #99baff;outline-offset:2px}
.purchase-request-dialog .request-template-button{display:inline-flex;align-items:center;min-height:42px;padding:9px 14px;border:1px solid #c9d4e8;border-radius:8px;color:#2453a3;text-decoration:none;font-size:14px;white-space:nowrap}
.purchase-request-dialog .request-import-review{margin:14px 0;padding:12px 16px;background:#f3f7ff;border:1px solid #d3dff5;border-radius:8px;font-size:13px}
.purchase-request-dialog .request-import-review p{margin:7px 0}.purchase-request-dialog .request-import-review summary{cursor:pointer;color:#2453a3}.purchase-request-dialog .request-import-review ul{max-height:160px;overflow:auto;padding-left:22px}.purchase-request-dialog .request-review-check{display:flex;align-items:center;gap:8px;margin-top:10px}.purchase-request-dialog .request-review-check input{width:16px;height:16px;margin:0}
@media(max-width:760px){.purchase-request-dialog .request-number-row{flex-wrap:wrap}.purchase-request-dialog .request-number-row>label{flex-basis:100%}}

.bom-node-validity{line-height:1.6;margin-top:3px;white-space:normal}.bom-node.bom-node-unavailable .bom-node-pick,.bom-node.bom-node-unavailable .bom-node-pick strong,.bom-node.bom-node-unavailable .bom-node-pick small{color:#9ca3af}.bom-node.bom-node-unavailable{background:#f4f5f7}

.purchase-delete-button{color:#b42318;border-color:#f2b8b5;background:#fff5f5;white-space:nowrap}.purchase-delete-link{color:#b42318!important;margin-top:6px;display:block!important}.purchase-delete-button:disabled{cursor:not-allowed}

/* Keep the server-assigned purchase number readable in its own leading column. */
#purchase-list .purchase-register>tbody>.purchase-order-row>.purchase-order-code{white-space:nowrap!important;min-width:170px;font-variant-numeric:tabular-nums;font-weight:600}

/* Scale the content within its grid viewport; navigation, header and status stay fixed. */
.content-viewport{min-width:0;min-height:0;overflow:hidden;--workspace-zoom:1}
.content-viewport>#content{width:100%;height:100%;zoom:var(--workspace-zoom)}
.workspace-zoom-controls{display:flex;gap:0;align-items:center;flex-shrink:0;white-space:nowrap}
.workspace-zoom-controls button{padding:5px 8px;min-height:30px;border-radius:0}
.workspace-zoom-controls button:first-child{border-radius:5px 0 0 5px}.workspace-zoom-controls button:last-child{border-radius:0 5px 5px 0}
.workspace-zoom-controls [data-zoom-reset]{min-width:60px;font-variant-numeric:tabular-nums}
#content>.warehouse-work-panel{flex:0 0 auto}#content>.warehouse-work-panel>.note{margin-top:0}
@media(max-width:900px){.top-actions .date{display:none}}
@media print{.content-viewport{--workspace-zoom:1!important}.workspace-zoom-controls{display:none}}

#purchase-list .purchase-line-order-code,.request-line-order-code{white-space:nowrap!important;min-width:170px;font-variant-numeric:tabular-nums}
.request-lines{min-width:1200px}.request-lines th:nth-child(1){width:180px}.request-lines th:nth-child(2){width:60px}.request-lines th:nth-child(3){width:260px}.request-lines th:nth-child(4){width:190px}.request-lines th:nth-child(5){width:90px}.request-lines th:nth-child(6){width:100px}.request-lines th:nth-child(7){width:100px}.request-lines th:nth-child(8){width:190px}.request-lines th:nth-child(9){width:90px}

.purchase-material-actions{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-top:10px}.purchase-material-actions .danger{color:#bd3b34}.receiving-register .purchase-line-order-code{white-space:nowrap!important;min-width:170px}

.purchase-request-dialog .request-lines{min-width:0;max-width:100%}.request-lines .request-import-extra{width:180px!important;min-width:180px}.request-lines .request-line-actions{width:90px!important;white-space:nowrap}

#store-barcode.asset-scan-input{min-height:180px}

.purchase-line-cancelled { color:#8a929f; background:#f0f1f3; }

.purchase-materials td.purchase-link-cell{width:150px;max-width:150px}.purchase-materials a.purchase-link-text{display:block;width:150px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}

/* Warehouse workbench is a child module of the existing warehouse page. */
.warehouse-workspace-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px;padding:5px;background:#e9edf8;border-radius:10px;width:fit-content;max-width:100%}
.warehouse-workspace-tabs button{border:0;background:transparent;color:#5b6c91;min-height:42px;padding:10px 18px;border-radius:7px;font-weight:600}
.warehouse-workspace-tabs button.active{background:#fff;color:#111c79;box-shadow:0 1px 5px #15296b15}
.warehouse-workspace-tabs button:focus-visible{outline:2px solid #f57a24;outline-offset:2px}

.receiving-material-row.purchase-line-cancelled,.receiving-material-row.purchase-line-cancelled strong,.receiving-material-row.purchase-line-cancelled small{color:#8a929f;background:#f0f1f3}.purchase-line-cancelled .purchase-line-order-code small{display:block;color:#8a929f}

/* Unified purchase grid: a single header/colgroup shared by every order. */
.purchase-grid-scroll{container-type:inline-size;border-top:1px solid #e5eaf3}
#purchase-list .purchase-unified-grid{border-collapse:separate;border-spacing:0;table-layout:fixed;min-width:0}
#purchase-list .purchase-unified-grid th{font-size:12px;font-weight:600;padding:12px 18px 12px 12px;white-space:nowrap;color:#687996}
#purchase-list .purchase-unified-grid td{padding:12px;min-width:0;line-height:1.45;vertical-align:middle;white-space:normal!important;border-bottom:1px solid #e8edf4;font-size:13px}
#purchase-list .purchase-unified-grid .purchase-cell-text{display:block;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
#purchase-list .purchase-material-name strong,#purchase-list .purchase-material-name small{display:block;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
#purchase-list .purchase-material-name strong{font-size:13px;font-weight:500}
#purchase-list .purchase-material-name small{color:#8b97aa;font-size:11px;margin-top:4px}
#purchase-list .purchase-unified-grid .purchase-number-cell{text-align:right;font-variant-numeric:tabular-nums}
#purchase-list .purchase-unified-grid .purchase-line-order-code{white-space:nowrap!important;font-variant-numeric:tabular-nums}
#purchase-list .purchase-unified-grid .purchase-link-text{display:block;width:100%;max-width:none;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
#purchase-list .purchase-unified-grid .purchase-attachment-cell a{display:block;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis}
#purchase-list .purchase-unified-grid .purchase-order-row>td{padding:14px 12px!important;background:#f3f5fb;font-size:13px;font-weight:400;overflow:visible}
.purchase-order-summary{position:sticky;left:12px;width:min(1440px,calc(100cqw - 32px));min-width:700px;max-width:100%}
.purchase-summary-title{display:flex;gap:10px;align-items:center;min-height:32px}
.purchase-order-index{color:#8994a8;font-size:12px}.purchase-order-name{font-size:15px!important;min-width:0;max-width:540px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.purchase-summary-actions{display:flex;gap:12px;margin-left:auto;flex-shrink:0}
.purchase-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 24px;margin:10px 0 0 30px}
.purchase-summary-item{display:flex;gap:8px;min-width:0;align-items:baseline;font-size:12px}
.purchase-summary-item>span{color:#8994a8;flex-shrink:0}.purchase-summary-item>strong{font-weight:400;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#4e5e79}
.purchase-summary-files{margin:8px 0 0 30px;font-size:12px}
.purchase-grid-more>td{padding:8px 24px!important;background:#fbfcfe}.purchase-grid-more button{position:sticky;left:24px;font-size:12px}
#purchase-list .purchase-unified-grid .purchase-grid-actions button{font-size:12px}
#purchase-list .purchase-unified-grid .purchase-line-cancelled td,#purchase-list .purchase-unified-grid .purchase-line-cancelled strong{color:#8a929f;background:#f0f1f3}
.request-mapping-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px;margin:10px 0}.request-mapping-grid label{display:grid;grid-template-columns:minmax(90px,1fr) minmax(130px,1fr);align-items:center;gap:8px;font-size:12px}.request-mapping-grid select{height:34px;padding:4px 8px}
.request-original-details{margin-top:12px}.request-original-details summary{color:#687996;cursor:pointer}
#purchase-list .purchase-summary-title>input[type=checkbox]{width:16px;height:16px;min-height:0;flex:0 0 16px;margin:0;padding:0}
#purchase-list .purchase-summary-title>.purchase-order-index{flex:0 0 auto}
#purchase-list .purchase-summary-title>.tree-toggle{flex:0 0 32px}
#purchase-list .purchase-summary-title>.purchase-order-name{flex:1 1 240px;max-width:none;white-space:nowrap!important;font-size:15px;font-weight:600}
#purchase-list .purchase-summary-title>.muted{white-space:nowrap;flex-shrink:0;font-size:12px}
#purchase-list .purchase-summary-item>strong{font-size:12px;font-weight:400}
/* Per-order scrolling; shared widths do not couple scroll positions. */
#purchase-list{min-width:0;max-width:100%;overflow:hidden}
.purchase-order-card{min-width:0;max-width:100%;border-top:1px solid #e3e8f2;margin:0 0 14px;background:white}
#purchase-list .purchase-order-summary{position:static;width:auto;min-width:0;max-width:none;padding:14px 16px;background:#f3f5fb}
#purchase-list .purchase-summary-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 20px;margin:10px 0 0 30px}
#purchase-list .purchase-summary-item{align-items:flex-start;line-height:1.55}
#purchase-list .purchase-summary-item>strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal!important;overflow-wrap:anywhere;overflow:hidden;text-overflow:ellipsis;cursor:pointer;line-height:1.55}
#purchase-list .purchase-summary-item>strong:focus-visible{outline:2px solid #2860c7;outline-offset:2px}
#purchase-list .purchase-summary-item.purchase-summary-long{grid-column:span 2}
#purchase-list .purchase-order-scroll{width:100%;max-width:100%;min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#d5dce7 transparent}
#purchase-list .purchase-order-scroll:hover,#purchase-list .purchase-order-scroll:focus-within{scrollbar-color:#8c9ab1 #f2f5fa}
#purchase-list .purchase-order-scroll::-webkit-scrollbar{height:8px}
#purchase-list .purchase-order-scroll::-webkit-scrollbar-track{background:transparent}
#purchase-list .purchase-order-scroll::-webkit-scrollbar-thumb{background:#d5dce7;border-radius:6px}
#purchase-list .purchase-order-scroll:hover::-webkit-scrollbar-thumb,#purchase-list .purchase-order-scroll:focus-within::-webkit-scrollbar-thumb{background:#8c9ab1}
#purchase-list .purchase-unified-grid .purchase-cell-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal!important;overflow-wrap:anywhere}
#purchase-list .purchase-unified-grid .purchase-number-cell .purchase-cell-text{display:block;white-space:normal!important;overflow:visible;overflow-wrap:normal;word-break:normal}
#purchase-list .purchase-unified-grid .purchase-line-order-code{white-space:normal!important;overflow-wrap:normal;word-break:normal}
#purchase-list .purchase-material-name strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal!important;overflow-wrap:anywhere}
#purchase-list .purchase-unified-grid .purchase-link-text{white-space:nowrap!important}
#purchase-list .purchase-grid-more{padding:8px 16px;background:#fbfcfe}
.purchase-select-all{display:flex;gap:6px;align-items:center;white-space:nowrap;font-size:13px}.purchase-select-all input{width:16px;height:16px;min-height:0;margin:0}
.purchase-full-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7;user-select:text}
@media(max-width:1100px){#purchase-list .purchase-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#purchase-list .purchase-summary-title{flex-wrap:wrap}.purchase-summary-actions{margin-left:0}}
/* Receiving presentation only; receipt/QC/stock handlers remain unchanged. */
#receiving-list{min-width:0;max-width:100%;overflow:hidden}
.receiving-order-card{min-width:0;max-width:100%;border-top:1px solid #e3e8f2;background:#fff;margin-bottom:14px}
.receiving-summary{background:#f3f5fb;padding:14px 16px}
.receiving-summary-title{display:flex;align-items:center;gap:10px;min-width:0}
.receiving-summary-title .tree-toggle{flex:0 0 32px}
.receiving-summary-title>strong{font-size:15px;font-weight:600;min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.receiving-summary-title>.muted{font-size:12px;white-space:nowrap}
.receiving-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 20px;margin:10px 0 0 42px}
.receiving-summary-item{display:flex;align-items:flex-start;gap:8px;min-width:0;font-size:12px;line-height:1.55}
.receiving-summary-item>span:first-child{color:#8994a8;flex-shrink:0}
.receiving-summary-long{grid-column:span 2}
#receiving-list .receiving-cell-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal!important;overflow-wrap:anywhere;overflow:hidden;text-overflow:ellipsis;line-height:1.55;cursor:pointer;min-width:0;font-weight:400}
#receiving-list .receiving-cell-text:focus-visible{outline:2px solid #2860c7;outline-offset:2px}
.receiving-full-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7;user-select:text}
#receiving-list .receiving-order-scroll{width:100%;max-width:100%;min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;container-type:inline-size;scrollbar-width:thin;scrollbar-color:#d5dce7 transparent}
#receiving-list .receiving-order-scroll:hover,#receiving-list .receiving-order-scroll:focus-within{scrollbar-color:#8c9ab1 #f2f5fa}
#receiving-list .receiving-order-scroll::-webkit-scrollbar{height:8px}
#receiving-list .receiving-order-scroll::-webkit-scrollbar-track{background:transparent}
#receiving-list .receiving-order-scroll::-webkit-scrollbar-thumb{background:#d5dce7;border-radius:6px}
#receiving-list .receiving-order-scroll:hover::-webkit-scrollbar-thumb,#receiving-list .receiving-order-scroll:focus-within::-webkit-scrollbar-thumb{background:#8c9ab1}
#receiving-list .receiving-material-table,#receiving-list .receiving-batch-table{table-layout:fixed;border-collapse:separate;border-spacing:0;min-width:0}
#receiving-list th{font-size:12px;font-weight:600;padding:12px 18px 12px 12px;color:#687996;white-space:nowrap}
#receiving-list .receiving-material-row>td,#receiving-list .receiving-batch-row>td{padding:12px;font-size:13px;font-weight:400;line-height:1.5;vertical-align:middle;border-bottom:1px solid #e8edf4}
#receiving-list .receiving-material-row>td:nth-child(2){min-width:0;white-space:nowrap!important}
#receiving-list .receiving-material-row .tree-toggle{width:30px;height:30px;min-height:0;padding:3px}
#receiving-list .receiving-material-row>td:nth-child(3)>strong{display:block;font-size:13px;font-weight:500}
#receiving-list .receiving-material-row>td:nth-child(3)>small{display:block;margin-top:4px;font-size:11px;color:#8b97aa}
#receiving-list .receiving-material-row>td:nth-child(1),#receiving-list .receiving-material-row>td:nth-child(5),#receiving-list .receiving-material-row>td:nth-child(7),#receiving-list .receiving-material-row>td:nth-child(13){white-space:normal!important;overflow-wrap:normal;word-break:normal;font-variant-numeric:tabular-nums}
#receiving-list .receiving-material-row>td:nth-child(5) .receiving-cell-text,#receiving-list .receiving-material-row>td:nth-child(7) .receiving-cell-text,#receiving-list .receiving-material-row>td:nth-child(13) .receiving-cell-text{display:block;overflow:visible;overflow-wrap:normal;-webkit-line-clamp:unset}
#receiving-list .receiving-material-row>td:nth-child(5),#receiving-list .receiving-material-row>td:nth-child(13){text-align:right}
#receiving-list .receiving-material-row>td:last-child button{font-size:12px;white-space:nowrap}
#receiving-list .receiving-batch-group>td{padding:0!important;overflow:visible}
#receiving-list .receiving-batches{padding:10px 16px;background:#fafbfe}
#receiving-list .receiving-no-batch{position:sticky;left:16px;width:fit-content;max-width:calc(100cqw - 32px);padding:6px 0;font-size:12px;white-space:normal!important}
#receiving-list .receiving-batch-table th{background:#edf1f8}
#receiving-list .receiving-batch-row td:first-child{min-width:0}
#receiving-list .receiving-batch-row small{display:block;color:#8b97aa;font-size:11px}
#receiving-list .receiving-material-row.purchase-line-cancelled td,#receiving-list .receiving-material-row.purchase-line-cancelled .receiving-cell-text{background:#f0f1f3;color:#8a929f}
#receiving-list .receiving-unassigned>td{padding:12px 16px;background:#fff8ee}
@media(max-width:1100px){.receiving-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));margin-left:0}.receiving-summary-title{flex-wrap:wrap}}
#receiving-list .receiving-batch-row>td:first-child{position:relative;padding-left:28px}
#receiving-list .receiving-batch-row .hierarchy-branch{position:absolute;left:12px;top:12px;color:#9ca7ba}
.purchase-export-preview{max-height:60vh;overflow:auto}.purchase-export-preview table{min-width:2800px}.purchase-export-preview th{white-space:nowrap;font-size:12px}.purchase-export-preview td{max-width:260px;white-space:pre-wrap!important;overflow-wrap:anywhere;font-size:12px;vertical-align:top}
#modal:has(.purchase-export-preview){width:min(1600px,96vw);max-width:96vw}

/* Purchase selection aligns with the order checkboxes below. */
.toolbar.purchase-filter-toolbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:14px 16px}
.purchase-filter-toolbar .purchase-select-all{margin:0;flex:0 0 auto}
.purchase-filter-toolbar #purchase-status{width:140px;flex:0 0 140px}
.purchase-filter-toolbar #purchase-count{white-space:nowrap;flex:0 0 auto}
.purchase-filter-toolbar #purchase-search{margin-left:auto;flex:1 1 240px;min-width:180px;max-width:560px}

.purchase-order-card:has(.purchase-pending){opacity:.65;background:#f3f4f6}.purchase-pending button:disabled{cursor:not-allowed}.request-project-field{position:relative}.request-project-options{position:absolute;top:100%;left:0;right:0;max-height:240px;overflow-y:auto;z-index:20;background:white;border:1px solid #ccd4e5;border-radius:8px;box-shadow:0 4px 16px #16264b20}.request-project-options[hidden]{display:none}.request-project-options button{display:block;width:100%;text-align:left;border:0;border-radius:0;padding:10px;white-space:normal}.request-project-options button:hover{background:#eef3ff}.purchase-draft-item{display:grid;grid-template-columns:1fr auto auto;gap:10px;padding:12px;border-bottom:1px solid #e5e9f0}.purchase-draft-item span{grid-column:1;font-size:12px;color:#64748b}

.request-template-lines{table-layout:fixed;width:3000px;min-width:3000px}.request-template-lines th,.request-template-lines td{vertical-align:top;padding:10px}.request-template-lines th:first-child{width:60px}.request-template-lines input{width:100%;min-width:0}.request-template-lines td:has([data-request-key=projectId]){overflow:visible}.request-template-lines:has(.request-project-options:not([hidden])){margin-bottom:240px}

/* Editable floating windows; destructive confirmations remain modal. */
dialog.floating-editor{position:fixed;z-index:1000;box-shadow:0 14px 60px #13244940;max-height:90vh}dialog .dialog-head{cursor:move;touch-action:none}dialog .dialog-head button{cursor:pointer}.bom-source-select{min-width:150px;width:100%;appearance:auto;background:#fff;border:1px solid #d4dcee;border-radius:5px;padding:6px 8px}

/* Purchase editor only: keep expanded rows inside the window. */
dialog.purchase-request-dialog[open]{display:flex;flex-direction:column;overflow:hidden;max-height:90vh;max-height:90dvh}
.purchase-request-dialog>.dialog-head{flex:none}
.purchase-request-dialog>#purchase-request-form{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.purchase-request-dialog>#purchase-request-form>.dialog-body{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.purchase-request-dialog>#purchase-request-form>.dialog-footer{flex:none;background:white}

/* Every editor and confirmation must remain usable inside the viewport. */
#modal[open]{display:flex;flex-direction:column;max-width:calc(100vw - 24px);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain}
#modal>.dialog-head{flex:0 0 auto;min-width:0;background:#fff;position:sticky;top:0;z-index:2;gap:12px}
#modal>.dialog-head h2{min-width:0;overflow-wrap:anywhere}
#modal>.dialog-head button{flex:none}
#modal:has(>.dialog-body),#modal:has(>form>.dialog-body){overflow:hidden}
#modal>form{margin:0;min-width:0;min-height:0;max-width:100%;flex:1 1 auto}
#modal>form:has(>.dialog-body){display:flex;flex-direction:column;overflow:hidden}
#modal>.dialog-body,#modal>form>.dialog-body{flex:1 1 auto;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;overflow-wrap:anywhere}
#modal>.dialog-footer,#modal>form>.dialog-footer{flex:0 0 auto;min-width:0;flex-wrap:wrap;background:#fff;position:sticky;bottom:0;z-index:1}
#modal .dialog-body>.form-grid,#modal .dialog-body .form-grid>*{min-width:0}
@media(max-width:680px){#modal .dialog-head{padding:14px 16px}#modal .dialog-body{padding:8px 16px 16px}#modal .dialog-footer{padding:12px 16px;gap:8px}#modal .form-grid{grid-template-columns:minmax(0,1fr)}}

/* Purchase register only: confirmed-received lines are visually complete. */
#purchase-list .purchase-unified-grid .purchase-line-received>td{background:#f1f2f4;color:#89909b}
#purchase-list .purchase-unified-grid .purchase-line-received strong,#purchase-list .purchase-unified-grid .purchase-line-received small,#purchase-list .purchase-unified-grid .purchase-line-received a,#purchase-list .purchase-unified-grid .purchase-line-received button.link{color:#89909b}
#purchase-list .purchase-unified-grid .purchase-line-received .tag{background:#e5e7eb;color:#7b828e}

/* Resize the shared dialog frame without overlapping its internal scrollbars. */
#modal.resizable-dialog{padding:8px;box-sizing:border-box;position:fixed}
.dialog-resize-frame{position:absolute;inset:0;pointer-events:none;z-index:30}
.dialog-resize-handle{position:absolute;display:block;pointer-events:auto;touch-action:none;user-select:none}
.dialog-resize-handle[data-dialog-resize=n],.dialog-resize-handle[data-dialog-resize=s]{left:16px;right:16px;height:7px;cursor:ns-resize}
.dialog-resize-handle[data-dialog-resize=n]{top:0}.dialog-resize-handle[data-dialog-resize=s]{bottom:0}
.dialog-resize-handle[data-dialog-resize=e],.dialog-resize-handle[data-dialog-resize=w]{top:16px;bottom:16px;width:7px;cursor:ew-resize}
.dialog-resize-handle[data-dialog-resize=e]{right:0}.dialog-resize-handle[data-dialog-resize=w]{left:0}
.dialog-resize-handle[data-dialog-resize=nw],.dialog-resize-handle[data-dialog-resize=ne],.dialog-resize-handle[data-dialog-resize=sw],.dialog-resize-handle[data-dialog-resize=se]{width:16px;height:16px}
.dialog-resize-handle[data-dialog-resize=nw]{left:0;top:0;cursor:nwse-resize}.dialog-resize-handle[data-dialog-resize=ne]{right:0;top:0;cursor:nesw-resize}
.dialog-resize-handle[data-dialog-resize=sw]{left:0;bottom:0;cursor:nesw-resize}.dialog-resize-handle[data-dialog-resize=se]{right:0;bottom:0;cursor:nwse-resize}
.dialog-resize-handle[data-dialog-resize=se]::after{content:'';position:absolute;right:4px;bottom:4px;width:7px;height:7px;border-right:2px solid #98a5bf;border-bottom:2px solid #98a5bf}
.dialog-resize-handle:focus-visible{outline:2px solid #3b65d9;outline-offset:-2px}.dialog-resizing{user-select:none}

@media(min-width:760px){
 .content>.bom-workbench{flex:1 1 0;min-height:240px;overflow:hidden;grid-template-rows:minmax(0,1fr)}
 .bom-workbench>.bom-products,.bom-workbench>.bom-details{display:flex;flex-direction:column;min-height:0;overflow:hidden}
 .bom-products>#bom-products,.bom-details>#bom-details{flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain}
 .bom-workbench .bom-grid-scroll{max-height:none}
}

#modal .dialog-hscroll{position:sticky;bottom:0;z-index:2;flex:0 0 18px;width:100%;box-sizing:border-box;align-self:stretch}
#modal .dialog-body .table-wrap{min-width:0;max-width:100%;box-sizing:border-box}

#purchase-execution-form .dialog-body{padding:12px 18px}
#purchase-execution-form .dialog-body>p{margin:0 0 8px}
#purchase-execution-form .form-grid{gap:7px 14px}
#purchase-execution-form label{margin:0;gap:2px}
#purchase-execution-form input,#purchase-execution-form select,#purchase-execution-form textarea{margin:2px 0 0;padding:5px 8px;min-height:32px}
#purchase-execution-form textarea{min-height:44px;height:50px}
#purchase-execution-form .dialog-footer{padding:9px 18px}
.execution-times{display:flex;gap:5px 16px;flex-wrap:wrap;color:#596981;font-size:.88em}
.supplier-tabs{margin:8px 0 12px}.promotion-card{margin:8px 0;padding:12px;border:1px solid #d6deeb;border-radius:6px}.promotion-card legend{font-weight:600}

button.slot-needed{border:1px solid #c13932;color:#a7221b;background:#fff4f2;font-weight:600}

/* Top-level list panels reserve space for their filters and scroll the results. */
#content > .panel:has(> .toolbar, > .tabs + .table-wrap) {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
}
#content > .panel:has(> .toolbar, > .tabs + .table-wrap) > :is(
  .tabs, .toolbar, .warehouse-tabs, .warehouse-subtabs, .table-foot, .note
) {
  flex: none;
}
#content > .panel > .toolbar + div,
#content > .panel > .tabs + .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

/* Use the purchase register's received-row palette. */
#receiving-list .receiving-material-row.receiving-completed > td,
#receiving-list .receiving-batch-group.receiving-completed .receiving-batch-row > td,
#receiving-list .receiving-order-card.receiving-completed .receiving-summary {
  background-color: #f1f2f4;
  color: #89909b;
}
#receiving-list .receiving-completed > td .tag,
#receiving-list .receiving-order-card.receiving-completed .receiving-summary .tag {
  background-color: #e5e7eb;
  color: #7b828e;
}

/* Match the centre of the heading to the centre of its numeric values. */
table th.numeric-cell, table td.numeric-cell, table td.purchase-number-cell,
table td.numeric-cell input {text-align:center!important;font-variant-numeric:tabular-nums}
table th.numeric-cell {padding-inline:12px!important}
table td a.purchase-url {display:block;width:180px;max-width:100%;white-space:nowrap!important;
  overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;word-break:normal}
table.resizable-columns td a.purchase-url {width:100%}

/* Cancelled purchase lines retain their details for traceability. */
.purchase-line-cancelled td:not(:last-child),.purchase-line-cancelled .purchase-cell-text,.purchase-line-cancelled .receiving-cell-text,.purchase-line-cancelled strong,.purchase-line-cancelled small,.purchase-line-cancelled .purchase-link-text{color:#8a929f;text-decoration:line-through}
