:root{--bg:#eef4fb;--paper:#fff;--ink:#001844;--muted:#5e7197;--line:#dce7f5;--navy:#081936;--primary:#42b6ff;--accent:#4ee7e7;--success:#0aa36d;--warning:#e69d22;--danger:#d64162;--shadow:0 10px 24px rgba(12,31,66,.08)}
html[data-theme=dark]{--bg:#07111f;--paper:#0e1e35;--ink:#e9f2ff;--muted:#91a4c6;--line:#22395f;--navy:#050b14;--primary:#3aa7ff;--accent:#63f4ff;--shadow:0 14px 30px rgba(0,0,0,.25)}
html[data-theme=tech]{--bg:#eaf2fb;--paper:#ffffff;--ink:#001844;--muted:#587096;--line:#d9e6f5;--navy:#071936;--primary:#42b6ff;--accent:#4ee7e7;--shadow:0 12px 28px rgba(12,31,66,.10)}
*{box-sizing:border-box}body{margin:0;font-family:Inter,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--ink);overflow-x:hidden}.top{background:linear-gradient(115deg,#071832 0%,#0b234b 58%,#132f63 100%);color:#fff;padding:14px 24px}.header{display:grid;grid-template-columns:minmax(280px,1fr) minmax(260px,420px) 150px 190px;gap:12px;align-items:center}.brand h1{margin:0;font-size:25px;white-space:nowrap}.brand span{font-size:12px;color:#b9d7ff}.global-search,.wide-input,.textarea,.mini-select{width:100%;border:1px solid var(--line);border-radius:12px;padding:0 13px;height:40px;background:var(--paper);color:var(--ink);font-weight:800}.textarea{height:150px;padding:12px;font-family:Consolas,monospace;font-size:12px;line-height:1.45}.mini-select{min-width:170px;max-width:260px}.btn-main,.tool-btn{height:40px;border-radius:12px;border:1px solid transparent;padding:0 14px;font-weight:900;cursor:pointer;white-space:nowrap}.btn-main{background:linear-gradient(135deg,var(--primary),var(--accent));color:#fff}.tool-btn{background:var(--paper);color:var(--ink);border-color:var(--line)}.tool-btn:hover,.btn-main:hover{filter:brightness(1.04)}.switches{display:flex;gap:8px}.switches select{height:40px;border-radius:12px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.09);color:#fff;font-weight:900;padding:0 8px}.tabs{margin-top:12px;background:rgba(10,30,65,.72);border:1px solid rgba(255,255,255,.08);border-radius:18px;padding:8px;display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:8px}.tab{height:40px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.04);color:#fff;font-weight:900;font-size:13px;border-radius:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.tab.active{color:#69f6ff;border-color:rgba(77,230,240,.6);background:rgba(28,184,225,.16)}.page{padding:18px 24px 32px}.module{display:none}.module.active{display:block}.title-panel,.card,.toolbar-panel{background:var(--paper);border:1px solid var(--line);border-radius:19px;box-shadow:var(--shadow)}.title-panel{padding:16px 18px;margin-bottom:14px;display:flex;justify-content:space-between;align-items:center;gap:12px}.toolbar-panel{padding:12px;margin-bottom:14px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}.kicker{font-size:11px;font-weight:950;letter-spacing:2.4px;color:#5970ff;text-transform:uppercase;margin-bottom:5px}h2{font-size:22px;margin:0}.filters,.search-row{display:flex;gap:8px;align-items:center}.search-row .wide-input{min-width:260px}.select{height:38px;border:1px solid var(--line);border-radius:12px;padding:9px 12px;font-weight:900}.kpi-row{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin-bottom:14px}.kpi{position:relative;background:var(--paper);border:1px solid var(--line);border-radius:16px;min-height:92px;padding:14px 12px;box-shadow:var(--shadow);overflow:hidden}.kpi:before{content:"";position:absolute;top:0;left:0;right:0;height:4px;background:linear-gradient(90deg,var(--primary),var(--accent))}.kpi-title{font-size:11.5px;color:var(--muted);font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kpi-number{font-size:28px;font-weight:950;margin:7px 0 2px}.kpi-note{font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card-grid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:14px;margin-bottom:14px}.dashboard-grid{grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr)}.formula-grid{grid-template-columns:minmax(0,1.1fr) minmax(360px,.9fr)}.card{overflow:hidden;margin-bottom:14px}.card-head{padding:13px 15px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px}.card-head h3{margin:0;font-size:16px}.card-body{padding:15px}.pill,.tag{border-radius:999px;padding:5px 9px;font-size:11px;font-weight:900;white-space:nowrap}.pill{background:#f7fbff;border:1px solid #d8e4f2;color:#001944}.pill.ok,.tag.published,.tag.ok{background:#eafff4;color:#067a51}.pill.warn,.tag.pending,.tag.review{background:#fff8e8;color:#9d6300}.pill.blue,.tag.info{background:#eff8ff;color:#116caa}.tag.danger{background:#fff0f3;color:#b12d4c}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:13px}.table{width:100%;border-collapse:separate;border-spacing:0;min-width:760px}.table th{text-align:left;font-size:10.5px;color:var(--muted);letter-spacing:.65px;text-transform:uppercase;background:rgba(90,120,160,.10);padding:10px 11px;border-bottom:1px solid var(--line);white-space:nowrap}.table td{font-size:12.3px;padding:9px 11px;border-bottom:1px solid rgba(150,170,200,.22);vertical-align:middle;line-height:1.25}.table tr:last-child td{border-bottom:0}.table input,.table select{height:32px;border:1px solid var(--line);border-radius:9px;padding:0 8px;background:var(--paper);color:var(--ink);font-weight:750;min-width:84px}.money{font-weight:950;color:var(--ink)}.num{text-align:right}.pos{color:var(--danger);font-weight:900}.neg{color:var(--success);font-weight:900}.muted{color:var(--muted)}.price-card{border:1px solid var(--line);border-radius:14px;background:var(--paper);padding:14px;margin-top:12px}.price-card h3{margin:0 0 8px;font-size:16px}.price-card .final{font-size:26px;font-weight:950;margin:8px 0}.portal{background:linear-gradient(115deg,#081936,#102b5d);border-radius:20px;padding:18px;color:#fff}.portal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.portal-card{background:var(--paper);color:var(--ink);border-radius:16px;padding:15px}.lock-note{margin-top:12px;border:1px solid var(--line);background:rgba(66,182,255,.08);border-radius:12px;padding:10px 12px;font-size:12px;font-weight:800;color:var(--muted)}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.form-grid label{font-size:11px;font-weight:900;color:var(--muted);text-transform:uppercase;letter-spacing:.55px}.form-grid label input{margin-top:5px}.action-box{border:1px solid var(--line);border-radius:12px;background:rgba(66,182,255,.08);padding:10px 12px;margin-bottom:12px;font-size:12px;font-weight:800}.action-box.ok{background:#eafff4;color:#067a51}.action-box.warn{background:#fff8e8;color:#9d6300}.modal-backdrop{position:fixed;inset:0;background:rgba(2,10,25,.52);display:none;align-items:center;justify-content:center;padding:20px;z-index:20}.modal-backdrop.show{display:flex}.modal{width:min(620px,100%);background:var(--paper);color:var(--ink);border-radius:22px;border:1px solid var(--line);box-shadow:0 22px 55px rgba(0,0,0,.28);padding:24px}.modal-icon{width:54px;height:54px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,var(--primary),var(--accent));color:#fff;font-weight:950;font-size:28px}.modal h3{margin:12px 0 6px}.modal p{color:var(--muted);line-height:1.45}.suggestion{display:flex;justify-content:space-between;align-items:center;border:1px solid var(--line);border-radius:13px;padding:10px;margin-top:8px;gap:10px}.suggestion small{color:var(--muted)}.modal-actions{margin-top:14px;display:flex;justify-content:flex-end;gap:8px}.hidden{display:none!important}@media(max-width:1450px){.header{grid-template-columns:270px minmax(260px,1fr) 145px 180px}.brand h1{font-size:22px}.brand span{display:none}.card-grid,.dashboard-grid,.formula-grid{grid-template-columns:1fr}.kpi-row{gap:8px}.kpi-number{font-size:25px}.tabs{gap:6px}.tab{font-size:12px}}@media(max-width:1100px){.header{grid-template-columns:1fr 1fr}.tabs{grid-template-columns:repeat(3,1fr)}.kpi-row{grid-template-columns:repeat(6,minmax(106px,1fr));overflow:auto}.switches{justify-content:flex-end}.form-grid{grid-template-columns:1fr}.toolbar-panel{overflow:auto;flex-wrap:nowrap}.toolbar-panel>*{flex:0 0 auto}}
html[data-theme=dark] .pill{background:#152b4c;color:#e9f2ff;border-color:#27456d}html[data-theme=dark] .portal-card{background:var(--paper);color:var(--ink)}
/* V5 production feature hardening */
.edit-actions{display:inline-flex;gap:8px;align-items:center}.edit-actions.hidden{display:none!important}
.table input:disabled,.table select:disabled,.wide-input:disabled{background:rgba(120,150,190,.08);color:var(--muted);cursor:not-allowed}
.table input:not(:disabled),.wide-input:not(:disabled){box-shadow:0 0 0 1px rgba(66,182,255,.10) inset}
.card.hidden,.hidden{display:none!important}.compact-form{grid-template-columns:repeat(2,minmax(0,1fr))}.compact-form label{display:flex;align-items:center;gap:8px;text-transform:none;letter-spacing:0;font-size:12px;color:var(--ink)}
#bomImportPanel{margin-top:0;margin-bottom:14px}.approval-action{display:flex;gap:6px}.toolbar-panel .edit-actions .btn-main,.toolbar-panel .edit-actions .tool-btn{height:38px}.tab[data-tab="approval"]{position:relative}.tab[data-tab="approval"]:after{content:"";position:absolute;top:8px;right:13px;width:6px;height:6px;border-radius:50%;background:#ffbd4a}
@media(max-width:1450px){.tabs{grid-template-columns:repeat(9,minmax(0,1fr))}.compact-form{grid-template-columns:1fr}}


/* V6 layout refinement: no cramming, full-width management cards, smarter customer display */
.dashboard-stack,.module-stack{display:grid;grid-template-columns:1fr;gap:14px;margin-bottom:14px}.dashboard-stack .card,.module-stack .card{width:100%;margin-bottom:0}.dashboard-grid{grid-template-columns:1fr!important}.smart-toolbar{display:grid;grid-template-columns:minmax(260px,1fr) repeat(8,auto);align-items:center}.pager{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.customer-focus{display:grid;grid-template-columns:300px minmax(0,1fr);gap:14px;align-items:stretch}.customer-summary{border:1px solid var(--line);border-radius:16px;padding:14px;background:linear-gradient(180deg,rgba(66,182,255,.10),rgba(78,231,231,.04))}.customer-summary h4{font-size:18px;margin:0 0 4px}.customer-summary .big{font-size:28px;font-weight:950;margin-top:10px}.customer-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.metric{border:1px solid var(--line);border-radius:14px;padding:12px;background:rgba(66,182,255,.06)}.metric span{font-size:11px;color:var(--muted);font-weight:900;text-transform:uppercase}.metric b{display:block;font-size:20px;margin-top:5px}.model-chip-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.model-chip{border:1px solid rgba(78,231,231,.40);background:rgba(66,182,255,.10);border-radius:999px;padding:7px 10px;font-size:12px;font-weight:900;color:var(--ink)}.portfolio-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:10px;margin-bottom:14px}.portfolio-card{border:1px solid var(--line);border-radius:15px;padding:12px;background:var(--paper);cursor:pointer;box-shadow:0 6px 14px rgba(12,31,66,.06);transition:.18s ease}.portfolio-card:hover,.portfolio-card.active{border-color:var(--accent);box-shadow:0 0 0 1px rgba(78,231,231,.45),0 12px 24px rgba(66,182,255,.12);transform:translateY(-1px)}.portfolio-card h4{margin:0;font-size:14px}.portfolio-card small{display:block;color:var(--muted);margin-top:3px}.portfolio-card b{display:block;font-size:22px;margin-top:7px}.tool-btn,.btn-main{position:relative;transition:.18s ease;box-shadow:0 5px 14px rgba(12,31,66,.07)}.tool-btn:hover,.tool-btn:focus,.tool-btn.active-action{border-color:var(--accent);box-shadow:0 0 0 1px rgba(78,231,231,.50),0 0 18px rgba(66,182,255,.18),0 10px 20px rgba(12,31,66,.12);outline:none;transform:translateY(-1px)}.btn-main:hover,.btn-main:focus{box-shadow:0 0 0 1px rgba(78,231,231,.60),0 0 24px rgba(78,231,231,.30),0 12px 24px rgba(12,31,66,.15);outline:none;transform:translateY(-1px)}.tool-btn:active,.btn-main:active{transform:translateY(0);filter:brightness(1.08)}.table tr.selectable-row{cursor:pointer}.table tr.selectable-row:hover td{background:rgba(66,182,255,.10)}.table tr.selected-row td{background:rgba(78,231,231,.12);box-shadow:inset 3px 0 0 var(--accent)}.history-panel{margin-top:14px;border:1px solid var(--line);border-radius:14px;padding:12px;background:rgba(66,182,255,.06)}.history-panel h4{margin:0 0 10px;font-size:15px}.conflict-list{display:grid;gap:8px}.conflict-item{border:1px solid var(--line);border-radius:12px;padding:10px;background:rgba(214,65,98,.08)}@media(max-width:1450px){.smart-toolbar{grid-template-columns:minmax(220px,1fr) repeat(4,auto);overflow:auto}.customer-focus{grid-template-columns:1fr}.customer-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:900px){.smart-toolbar{grid-template-columns:1fr}.smart-toolbar>*{width:100%}.customer-metrics{grid-template-columns:1fr}}

/* V7 focused search layout: search belongs to the table it controls, not duplicate top actions */
.action-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;overflow-x:auto}
.card-head-search{display:grid;grid-template-columns:auto minmax(260px,520px) auto;align-items:center;gap:12px}
.card-search{height:40px;border:1px solid var(--line);border-radius:13px;background:var(--paper);color:var(--ink);font-weight:850;padding:0 14px;box-shadow:inset 0 1px 0 rgba(255,255,255,.08);min-width:0;width:100%}
.card-search:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 1px rgba(78,231,231,.45),0 0 18px rgba(66,182,255,.14)}
.row-hint{font-size:11px;color:var(--muted);font-weight:850;margin-top:6px}.draft-row td{background:rgba(255,248,232,.68)!important}.draft-row input{border-color:#f1c16c!important}.current-model-note{display:inline-flex;align-items:center;gap:8px;color:var(--muted);font-size:12px;font-weight:850}.empty-focused-state{border:1px dashed var(--line);border-radius:14px;padding:16px;color:var(--muted);font-weight:850;background:rgba(66,182,255,.05)}
@media(max-width:1180px){.card-head-search{grid-template-columns:1fr}.card-head-search .pager{justify-content:flex-start}}

/* V8: Unified full-width module layout */
.dashboard-compact-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px;padding:0 2px}
.mini-title span,.card-kicker{display:block;font-size:10.5px;font-weight:950;letter-spacing:2.2px;color:#5970ff;text-transform:uppercase;margin-bottom:4px}
.mini-title b{display:block;font-size:20px;letter-spacing:-.25px;color:var(--ink)}
.card-head-actions{align-items:center}
.card-head-actions>div:first-child{min-width:240px}
.action-strip{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.action-strip .edit-actions{display:inline-flex;gap:8px;align-items:center;flex-wrap:wrap}
.module-stack{grid-template-columns:1fr!important}
.module-stack>.card{width:100%;margin-bottom:0}
.pro-form-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.notification-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.card-head .card-kicker+h3{margin-top:0}
#poScan .textarea{height:170px}
#calculation .wide-input,#customer .wide-input{max-width:none}
#admin .module-stack .card,#formula .module-stack .card,#approval .module-stack .card,#poScan .module-stack .card,#calculation .module-stack .card,#customer .module-stack .card{border-radius:18px}
#admin .form-grid label,#formula .form-grid label{min-width:0}
@media(max-width:1300px){.card-head-actions{display:grid;grid-template-columns:1fr;align-items:flex-start}.action-strip{justify-content:flex-start}.pro-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.notification-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-compact-head{align-items:flex-start;flex-direction:column}}
@media(max-width:800px){.pro-form-grid,.notification-grid{grid-template-columns:1fr}.action-strip{overflow:auto;flex-wrap:nowrap;width:100%;justify-content:flex-start}.action-strip>*{flex:0 0 auto}.dashboard-compact-head .filters{overflow:auto;width:100%}}

/* V9 UX polish: cleaner PO scan, admin tabs, table-style formula editor, focused calculation detail */
.po-upload-grid{display:grid;grid-template-columns:minmax(220px,280px) auto minmax(150px,1fr);gap:10px;align-items:center}
.file-picker{height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:12px;padding:0 14px;background:var(--paper);color:var(--ink);font-weight:950;cursor:pointer;transition:.18s ease;box-shadow:0 5px 14px rgba(12,31,66,.07)}
.file-picker input{display:none}.file-picker:hover{border-color:var(--accent);box-shadow:0 0 0 1px rgba(78,231,231,.45),0 10px 20px rgba(12,31,66,.10);transform:translateY(-1px)}
.po-hidden-text{height:0!important;min-height:0!important;padding:0!important;border:0!important;opacity:0;position:absolute;pointer-events:none}
.formula-editor-wrap .table{min-width:900px}.formula-editor-table td:first-child{font-weight:950}.formula-editor-table input{width:100%;min-width:180px;height:34px}
.admin-tabs{margin-bottom:14px}.admin-tabs .tool-btn.active,.admin-tab.active{border-color:var(--accent);background:rgba(66,182,255,.16);color:var(--accent);box-shadow:0 0 0 1px rgba(78,231,231,.42),0 0 18px rgba(66,182,255,.16)}
.admin-panel.hidden{display:none!important}.admin-panel{display:grid;gap:14px}.notification-grid label{border:1px solid var(--line);border-radius:12px;padding:12px;background:rgba(66,182,255,.06);font-size:12px!important;color:var(--ink)!important;text-transform:none!important;letter-spacing:0!important}
#approvalActionResult:empty{display:none}.approval-cleared{opacity:.72}.calc-summary-note{margin-bottom:10px}.calc-detail-active{border-color:var(--accent)}
.table tr.selected-row td{background:rgba(66,182,255,.045)!important;box-shadow:inset 3px 0 0 var(--accent);}
.table tr.selected-row td+td{box-shadow:none}.table tr.selectable-row:hover td{background:rgba(66,182,255,.075)}
#poScan .card:first-child .card-body{padding-bottom:18px}#poScan .lock-note{margin-top:12px}
@media(max-width:900px){.po-upload-grid{grid-template-columns:1fr}.file-picker{width:100%}}

/* V10: login status, ECN-style vertical menu, and focused Price Quotation UX */
.header{grid-template-columns:minmax(280px,1fr) minmax(260px,420px) 150px minmax(230px,310px)}
.user-zone{position:relative;display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0}
.login-btn{height:40px;color:#fff;background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.18)}
.user-status{height:44px;display:flex;align-items:center;gap:9px;min-width:0;max-width:240px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.08);border-radius:14px;padding:0 10px;color:#fff}
.user-avatar{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,var(--primary),var(--accent));font-size:12px;font-weight:950;color:#fff;flex:0 0 auto}
.user-status span:last-child{min-width:0;display:block}.user-status b{display:block;font-size:12.5px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-status small{display:block;margin-top:2px;color:#b9d7ff;font-size:10px;font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.icon-menu{width:40px;height:40px;border:1px solid rgba(255,255,255,.18);border-radius:13px;background:rgba(255,255,255,.08);color:#fff;font-size:24px;font-weight:950;line-height:0;cursor:pointer;display:grid;place-items:center;transition:.18s ease}
.icon-menu:hover,.icon-menu:focus{border-color:var(--accent);box-shadow:0 0 0 1px rgba(78,231,231,.42),0 0 18px rgba(66,182,255,.18);outline:none}
.user-menu{position:absolute;right:0;top:50px;width:280px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:18px;box-shadow:0 22px 50px rgba(0,0,0,.22);padding:12px;z-index:35}
.user-menu-head{display:flex;align-items:center;justify-content:space-between;padding:2px 2px 10px;border-bottom:1px solid var(--line);margin-bottom:10px}.menu-close{width:30px;height:30px;border-radius:10px;border:1px solid var(--line);background:var(--paper);color:var(--ink);font-size:20px;font-weight:950;cursor:pointer}.menu-close:hover{border-color:var(--accent);color:var(--accent)}
.user-menu-row{display:grid;grid-template-columns:86px minmax(0,1fr);align-items:center;gap:8px;margin-bottom:9px}.user-menu-row span{font-size:12px;color:var(--muted);font-weight:950}.user-menu select{height:38px;border-radius:12px;border:1px solid var(--line);background:var(--paper);color:var(--ink);font-weight:900;padding:0 10px}.menu-action{width:100%;margin-top:8px}.auth-modal .auth-label{display:block;margin-top:10px;font-size:12px;font-weight:950;color:var(--muted)}.auth-modal .wide-input{margin-top:5px}.calc-model-link{color:var(--ink);cursor:pointer}.calc-model-link:hover{color:var(--accent);text-decoration:underline}.quotation-summary{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin-bottom:12px}.quotation-summary .metric{background:rgba(66,182,255,.06)}#calculation .card-head-search{grid-template-columns:auto minmax(260px,520px) auto}.tab[data-tab="calculation"]{letter-spacing:-.1px}
@media(max-width:1450px){.header{grid-template-columns:270px minmax(260px,1fr) 145px minmax(210px,280px)}}
@media(max-width:1100px){.header{grid-template-columns:1fr 1fr}.user-zone{justify-content:flex-start}.user-menu{left:0;right:auto}.quotation-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.user-status{max-width:190px}.quotation-summary{grid-template-columns:1fr}.user-menu{width:min(280px,calc(100vw - 36px))}}

/* V11: Dashboard recent pricing changes drilldown */
.recent-change-table .change-row{cursor:pointer}.recent-change-table .change-row:hover td{background:rgba(66,182,255,.08)}.mini-view-btn{height:32px;padding:0 10px;font-size:11px}.change-detail-modal{width:min(1080px,calc(100vw - 40px));max-height:88vh;overflow:auto}.modal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}.modal-head h3{margin:4px 0 0}.change-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:10px 0 12px}.change-summary-grid>div{border:1px solid var(--line);border-radius:14px;background:rgba(66,182,255,.06);padding:11px}.change-summary-grid span{display:block;font-size:10.5px;text-transform:uppercase;letter-spacing:.7px;color:var(--muted);font-weight:950}.change-summary-grid b{display:block;margin-top:5px;font-size:14px}.before-value{color:var(--muted);font-weight:850}.after-value{font-weight:950;color:var(--ink)}.delta-up{color:var(--danger);font-weight:950}.delta-down{color:var(--success);font-weight:950}.delta-flat{color:var(--muted);font-weight:950}#changeDetailTable{margin-top:12px}@media(max-width:900px){.change-summary-grid{grid-template-columns:1fr 1fr}.change-detail-modal{max-height:92vh}}@media(max-width:560px){.change-summary-grid{grid-template-columns:1fr}}

/* V12: Risk & Exception Alerts replaces duplicated reprice priority */
.severity-pill{height:28px;border-radius:999px;border:1px solid var(--line);padding:0 10px;font-size:11px;font-weight:950;background:var(--paper);color:var(--ink);cursor:pointer;white-space:nowrap}
.severity-pill.critical{background:#fff0f3;color:#b12d4c;border-color:#f1bdca;box-shadow:0 0 0 1px rgba(214,65,98,.10)}
.severity-pill.high{background:#fff8e8;color:#9d6300;border-color:#f7d69a;box-shadow:0 0 0 1px rgba(230,157,34,.10)}
.severity-pill.medium{background:#eff8ff;color:#116caa;border-color:#c7e8ff;box-shadow:0 0 0 1px rgba(66,182,255,.10)}
#riskAlertTable tbody tr{cursor:pointer}#riskAlertTable tbody tr:hover td{background:rgba(66,182,255,.075)}
html[data-theme=dark] .severity-pill.medium{background:#152b4c;color:#d9eeff;border-color:#27456d}html[data-theme=dark] .severity-pill.high{background:#3a2d16;color:#ffd990;border-color:#735224}html[data-theme=dark] .severity-pill.critical{background:#3b1521;color:#ffcbd6;border-color:#7b3045}
.row-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.danger-btn{border-color:rgba(214,65,98,.45)!important;color:#b12d4c!important;background:linear-gradient(180deg,#fff8fa,#fff0f4)!important}
[data-theme="dark"] .danger-btn,[data-theme="tech"] .danger-btn{color:#ffb8c8!important;background:rgba(214,65,98,.12)!important;border-color:rgba(255,120,150,.45)!important}

/* V14: wider professional drilldown modals and controlled approval focus */
.modal.modal-wide{width:min(1180px,calc(100vw - 72px));max-height:88vh;overflow:auto;padding:28px 32px}.modal.modal-wide .table{min-width:980px}.modal.modal-wide #modalSuggestions{margin-top:12px}.change-detail-modal{width:min(1240px,calc(100vw - 64px));padding:28px 32px}.change-detail-modal .table{min-width:1040px}.change-detail-modal p,.modal.modal-wide p{font-size:14px;line-height:1.5}.before-value,.after-value{display:inline-block;min-width:72px}.approval-next{box-shadow:0 0 0 1px rgba(78,231,231,.35),0 10px 24px rgba(66,182,255,.22)!important}.approval-next:hover{box-shadow:0 0 0 2px rgba(78,231,231,.55),0 14px 30px rgba(66,182,255,.30)!important;transform:translateY(-1px)}.edit-actions .btn-main{border-color:rgba(78,231,231,.7)}#modalPrimary.hidden{display:none!important}.conflict-list{display:grid;gap:8px}.conflict-item{border:1px solid var(--line);border-radius:12px;background:rgba(66,182,255,.06);padding:10px 12px}.conflict-item small{color:var(--muted);font-weight:850}
@media(max-width:760px){.modal.modal-wide,.change-detail-modal{width:calc(100vw - 28px);padding:20px}.modal.modal-wide .table,.change-detail-modal .table{min-width:760px}}
/* V15 material master workflow polish */
.material-toolbar .mini-select{max-width:260px;min-width:190px;flex:0 0 auto}.missing-material-row td{background:rgba(255,236,198,.72)!important;box-shadow:inset 3px 0 0 #ffb84d}.danger-action{border-color:rgba(214,65,98,.35)!important;color:#b12d4c!important}.danger-action:hover{border-color:#d64162!important;box-shadow:0 0 0 1px rgba(214,65,98,.35),0 10px 20px rgba(214,65,98,.12)!important}.table td .pill.warn{display:inline-flex;align-items:center;justify-content:center}.material-toolbar{align-items:center}.material-toolbar .edit-actions{margin-left:auto}
/* V16: customer entry portal + smarter material usage search */
.entry-gateway,.guest-portal{min-height:100vh;background:linear-gradient(130deg,#071832 0%,#0b234b 55%,#0e3a77 100%);color:#fff;padding:34px;display:grid;place-items:center}.entry-shell{width:min(1180px,100%);display:grid;grid-template-columns:minmax(320px,.9fr) minmax(420px,1.1fr);gap:26px;align-items:center}.entry-brand{padding:28px}.entry-kicker{display:inline-block;color:#6ff6ff;text-transform:uppercase;letter-spacing:3px;font-weight:950;font-size:12px;margin-bottom:12px}.entry-brand h1{font-size:48px;line-height:1.02;margin:0 0 16px}.entry-brand p{font-size:17px;line-height:1.6;color:#c7dcff;margin:0}.entry-options{display:grid;grid-template-columns:1fr 1fr;gap:18px}.entry-card{min-height:280px;text-align:left;border:1px solid rgba(255,255,255,.16);border-radius:28px;background:rgba(255,255,255,.08);color:#fff;padding:28px;cursor:pointer;box-shadow:0 22px 60px rgba(0,0,0,.28);transition:.18s ease}.entry-card:hover{transform:translateY(-4px);border-color:rgba(111,246,255,.78);box-shadow:0 28px 76px rgba(32,210,234,.24)}.entry-icon{width:68px;height:68px;border-radius:22px;display:grid;place-items:center;background:linear-gradient(135deg,var(--primary),var(--accent));font-size:32px;margin-bottom:22px}.entry-card b{display:block;font-size:28px;margin-bottom:10px}.entry-card small{display:block;color:#d7e7ff;line-height:1.55;font-size:15px}.guest-portal{display:block;place-items:unset}.guest-topbar{width:min(1320px,100%);margin:0 auto 18px;display:flex;justify-content:space-between;align-items:center;gap:16px}.guest-topbar h1{margin:0;font-size:32px}.guest-topbar span{color:#bdd9ff}.guest-layout{width:min(1320px,100%);margin:0 auto;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(420px,.95fr);gap:18px}.guest-card-panel{background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow);overflow:hidden}.guest-chat{height:520px;overflow:auto;padding:18px;display:flex;flex-direction:column;gap:12px;background:linear-gradient(180deg,rgba(66,182,255,.05),transparent)}.ai-msg,.user-msg{max-width:88%;border-radius:18px;padding:13px 15px;line-height:1.45;font-size:14px}.ai-msg{background:rgba(66,182,255,.10);border:1px solid var(--line);align-self:flex-start}.user-msg{background:linear-gradient(135deg,var(--primary),var(--accent));color:#fff;align-self:flex-end}.guest-chat-input{display:grid;grid-template-columns:minmax(0,1fr) 110px;gap:10px;padding:14px;border-top:1px solid var(--line)}.file-btn{display:inline-flex;align-items:center;justify-content:center;height:42px;border:1px solid var(--line);border-radius:13px;padding:0 14px;font-weight:950;background:var(--paper);cursor:pointer;margin-bottom:12px}.file-btn input{display:none}.guest-card-panel .card-body{padding:16px}.material-head{grid-template-columns:auto minmax(360px,1fr) auto}.material-search-group{display:flex;gap:8px;align-items:center;min-width:0}.material-search-group .card-search{min-width:280px}.material-used-modal{width:min(1180px,calc(100vw - 64px));max-height:88vh;overflow:auto;padding:28px 32px}.material-used-modal .table{min-width:980px}.material-toolbar .mini-select#materialStatusFilter{max-width:290px;min-width:220px}.app-shell.hidden{display:none!important}@media(max-width:1050px){.entry-shell,.guest-layout{grid-template-columns:1fr}.entry-options{grid-template-columns:1fr}.entry-brand h1{font-size:38px}.guest-chat{height:400px}.material-head{grid-template-columns:1fr}.material-search-group{flex-wrap:wrap}.material-search-group .card-search{min-width:100%}}@media(max-width:700px){.entry-gateway,.guest-portal{padding:18px}.entry-brand{padding:8px}.entry-brand h1{font-size:32px}.guest-topbar{align-items:flex-start;flex-direction:column}.guest-chat-input{grid-template-columns:1fr}.material-used-modal{width:calc(100vw - 28px);padding:20px}}

/* V17 Guest quotation assistant redesign */
.guest-topbar-pro{max-width:1440px;margin-bottom:18px}.guest-topbar-pro h1{font-size:34px;margin:4px 0 4px}.guest-assistant-shell{width:min(1440px,100%);margin:0 auto}.guest-assistant-card{background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:30px;box-shadow:0 32px 90px rgba(0,0,0,.28);overflow:hidden;min-height:calc(100vh - 190px);display:flex;flex-direction:column}.guest-assistant-head{display:grid;grid-template-columns:72px minmax(0,1fr) auto;gap:18px;align-items:center;padding:22px 24px;border-bottom:1px solid var(--line);background:linear-gradient(135deg,rgba(66,182,255,.11),rgba(75,238,229,.06))}.assistant-badge{width:62px;height:62px;border-radius:22px;display:grid;place-items:center;background:linear-gradient(135deg,var(--primary),var(--accent));color:#fff;font-size:24px;font-weight:1000;box-shadow:0 18px 40px rgba(38,198,238,.32)}.guest-assistant-head h3{font-size:24px;margin:3px 0 6px}.guest-assistant-head p{margin:0;color:var(--muted);line-height:1.45}.guest-head-actions{display:flex;gap:10px;align-items:center;justify-content:flex-end}.guest-scan-btn{position:relative;overflow:hidden;min-width:140px}.guest-scan-btn input{position:absolute;inset:0;opacity:0;cursor:pointer}.guest-quick-actions{display:flex;gap:10px;flex-wrap:wrap;padding:14px 24px;border-bottom:1px solid var(--line);background:rgba(66,182,255,.035)}.chip-btn{height:38px;border:1px solid var(--line);border-radius:999px;padding:0 14px;background:var(--paper);color:var(--ink);font-weight:900;cursor:pointer;box-shadow:0 8px 20px rgba(4,25,56,.06)}.chip-btn:hover{border-color:rgba(43,201,229,.9);box-shadow:0 0 0 3px rgba(55,217,234,.12),0 14px 28px rgba(18,119,160,.15);transform:translateY(-1px)}.pro-chat{height:auto;min-height:430px;max-height:calc(100vh - 410px);padding:22px 24px;background:linear-gradient(180deg,rgba(66,182,255,.045),rgba(255,255,255,.02));gap:14px}.welcome-msg{max-width:860px}.welcome-msg p{margin:8px 0 10px}.mini-hint-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:10px}.mini-hint-grid span{border:1px solid var(--line);background:rgba(255,255,255,.55);border-radius:12px;padding:9px 10px;font-weight:900;font-size:12px}.guest-compose{display:grid;grid-template-columns:minmax(0,1fr) 120px;gap:12px;padding:16px 24px;border-top:1px solid var(--line);background:var(--paper)}.guest-input{width:100%;min-height:54px;max-height:150px;resize:vertical;border:1px solid var(--line);border-radius:18px;padding:16px 18px;font-weight:850;font-size:15px;background:var(--paper);color:var(--ink);outline:none}.guest-input:focus{border-color:rgba(43,201,229,.9);box-shadow:0 0 0 4px rgba(55,217,234,.15)}.guest-safety-note{padding:12px 24px;border-top:1px solid var(--line);font-weight:850;color:var(--muted);background:rgba(66,182,255,.07)}.guest-result-card{border:1px solid var(--line);border-radius:18px;overflow:hidden;background:rgba(255,255,255,.7);margin-top:10px}.guest-result-title{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);font-weight:1000}.guest-result-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:10px 0}.guest-kpi{border:1px solid var(--line);border-radius:14px;padding:10px 12px;background:rgba(66,182,255,.06)}.guest-kpi b{display:block;font-size:18px}.guest-file-note{font-size:12px;color:var(--muted);margin-top:7px}.guest-chat .table-wrap{margin-top:10px;max-height:330px}.guest-chat .table{min-width:980px}.guest-chat .table th,.guest-chat .table td{font-size:12px;padding:10px 12px}.ai-msg .tag,.user-msg .tag{color:inherit}@media(max-width:1050px){.guest-assistant-head{grid-template-columns:1fr}.assistant-badge{display:none}.guest-head-actions{justify-content:flex-start;flex-wrap:wrap}.mini-hint-grid{grid-template-columns:1fr 1fr}.pro-chat{max-height:none}.guest-compose{grid-template-columns:1fr}}@media(max-width:620px){.mini-hint-grid{grid-template-columns:1fr}.guest-assistant-card{border-radius:22px}.guest-assistant-head,.guest-quick-actions,.pro-chat,.guest-compose,.guest-safety-note{padding-left:16px;padding-right:16px}}


/* V18 Guest Quotation Assistant - full screen professional chat */
.guest-portal{min-height:100vh;padding:18px 24px;background:radial-gradient(circle at 22% 0%,rgba(75,238,229,.18),transparent 30%),linear-gradient(130deg,#06172f 0%,#0a2550 54%,#0f3d80 100%);display:block!important;color:#fff}
.guest-portal.hidden{display:none!important}.guest-full-shell{width:min(1760px,100%);height:calc(100vh - 36px);margin:0 auto;display:flex;flex-direction:column;gap:14px}.guest-chat-topbar{width:100%;margin:0;flex:0 0 auto;padding:14px 18px;border:1px solid rgba(255,255,255,.14);border-radius:24px;background:rgba(255,255,255,.08);box-shadow:0 18px 45px rgba(0,0,0,.22);backdrop-filter:blur(10px)}.guest-brand-line h1{font-size:30px;margin:0 0 4px}.guest-brand-line p{margin:0;color:#d8eaff;font-weight:700}.guest-chat-topbar .entry-kicker{margin-bottom:5px}.guest-full-chat-shell{width:100%;margin:0;flex:1 1 auto;min-height:0}.guest-chat-card-full{height:100%;min-height:0;border-radius:28px;display:flex;flex-direction:column;box-shadow:0 30px 90px rgba(0,0,0,.28)}.guest-quick-actions-pro{padding:12px 18px;gap:9px;flex:0 0 auto}.guest-chat-full{flex:1 1 auto;min-height:0;max-height:none;height:auto;padding:20px 24px}.guest-guide-msg{max-width:780px;background:linear-gradient(135deg,rgba(66,182,255,.14),rgba(75,238,229,.08));border-color:rgba(87,193,230,.33)}.guest-guide-msg p{margin:8px 0 0;color:var(--muted);font-weight:700}.guest-compose-full{flex:0 0 auto;padding:14px 18px;background:linear-gradient(180deg,rgba(255,255,255,.95),rgba(255,255,255,.88));border-top:1px solid var(--line);grid-template-columns:minmax(0,1fr) 120px}.guest-compose-full .btn-main{height:54px;border-radius:18px}.guest-result-card{width:100%;max-width:100%;background:rgba(255,255,255,.94);border-radius:20px}.guest-result-title{padding:13px 16px;align-items:flex-start}.guest-result-title>div:first-child{display:grid;gap:4px}.guest-result-title small{display:block;font-size:12px;color:var(--muted);font-weight:800}.guest-result-actions{display:flex;gap:8px;align-items:center}.guest-result-actions .tool-btn{height:34px;border-radius:11px}.guest-result-body{padding:0 14px 14px}.compact-result-summary{grid-template-columns:repeat(3,minmax(0,1fr));max-width:760px}.guest-chat .table-wrap{max-height:44vh}.guest-chat .table{min-width:1040px}.guest-safety-note{display:none!important}@media(max-width:900px){.guest-portal{padding:12px}.guest-full-shell{height:calc(100vh - 24px)}.guest-chat-topbar{align-items:flex-start;flex-direction:column}.guest-head-actions{width:100%;justify-content:space-between}.guest-brand-line h1{font-size:24px}.guest-quick-actions-pro{overflow:auto;flex-wrap:nowrap}.guest-quick-actions-pro>*{flex:0 0 auto}.guest-compose-full{grid-template-columns:1fr}.compact-result-summary{grid-template-columns:1fr}.guest-chat-full{padding:16px}.guest-chat-card-full{border-radius:22px}}


/* V19 - Guest quotation workspace polish */
.guest-full-shell{width:min(1720px,calc(100vw - 48px));height:calc(100vh - 28px);gap:10px}
.guest-chat-topbar{width:100%;max-width:100%;padding:10px 18px;border-radius:20px;min-height:74px;box-sizing:border-box}
.guest-chat-topbar .entry-kicker{font-size:10px;letter-spacing:3px;margin-bottom:3px;color:#8ff8ff}
.guest-brand-line h1{font-size:25px;line-height:1.05;margin:0 0 3px}
.guest-brand-line p{font-size:13.5px;line-height:1.35;max-width:760px;color:#d9eaff}
.guest-head-actions .tool-btn{height:42px;min-width:88px;border-radius:14px;background:#fff;color:#001b46}
.guest-quick-actions-pro{padding:8px 16px;gap:8px;min-height:48px;align-items:center}
.guest-quick-actions-pro .chip-btn{height:34px;padding:0 14px;font-size:13px}
.guest-chat-card-full{border-radius:24px}
.guest-chat-full{padding:16px 18px;gap:10px;background:linear-gradient(180deg,rgba(66,182,255,.035),rgba(255,255,255,.02))}
.guest-chat-full:empty::before{content:'Type a model code, paste PO lines, or attach a PO file to get approved quotation results.';display:block;margin:6px auto 0;max-width:720px;text-align:center;color:var(--muted);font-weight:850;background:rgba(66,182,255,.08);border:1px solid var(--line);border-radius:16px;padding:12px 16px}
.guest-compose-full{grid-template-columns:118px minmax(0,1fr) 108px;padding:10px 16px;gap:10px;align-items:end}
.guest-compose-full .btn-main{height:50px;border-radius:16px}
.attach-btn{height:50px;border:1px solid var(--line);border-radius:16px;display:inline-flex;align-items:center;justify-content:center;background:var(--paper);color:var(--ink);font-weight:1000;cursor:pointer;box-shadow:0 8px 20px rgba(4,25,56,.07);position:relative;overflow:hidden}
.attach-btn:hover{border-color:rgba(43,201,229,.9);box-shadow:0 0 0 3px rgba(55,217,234,.12),0 14px 28px rgba(18,119,160,.15);transform:translateY(-1px)}
.attach-btn input{position:absolute;inset:0;opacity:0;cursor:pointer}
.guest-input{min-height:50px;padding:14px 16px;border-radius:16px}
.ai-msg.result-msg{max-width:100%;width:100%;padding:0;background:transparent;border:0;box-shadow:none}
.ai-msg.result-msg .guest-result-card{margin-top:0}
.guest-result-card{border-radius:18px;background:rgba(255,255,255,.97)}
.guest-result-title{padding:12px 16px;align-items:center}
.guest-result-body{padding:0 14px 12px}
.guest-result-summary.compact-result-summary{grid-template-columns:repeat(3,minmax(0,1fr));max-width:650px;margin:8px 0}
.guest-result-card .table-wrap{max-height:360px;overflow:auto;border-radius:14px;border:1px solid var(--line);margin-top:8px}
.guest-result-card .table{min-width:1080px}
.guest-result-card .table th,.guest-result-card .table td{font-size:12px;padding:9px 10px;line-height:1.25}
.guest-result-card .table-wrap::-webkit-scrollbar,.guest-chat-full::-webkit-scrollbar{width:8px;height:8px}
.guest-result-card .table-wrap::-webkit-scrollbar-track,.guest-chat-full::-webkit-scrollbar-track{background:rgba(6,24,52,.06);border-radius:999px}
.guest-result-card .table-wrap::-webkit-scrollbar-thumb,.guest-chat-full::-webkit-scrollbar-thumb{background:rgba(24,78,130,.38);border-radius:999px;border:2px solid rgba(255,255,255,.55)}
.guest-result-card .table-wrap::-webkit-scrollbar-thumb:hover,.guest-chat-full::-webkit-scrollbar-thumb:hover{background:rgba(43,201,229,.65)}
.guest-result-actions .guest-export-result{background:#fff;color:#001b46;border-color:var(--line);font-weight:1000}
.guest-result-actions .guest-export-result:hover{border-color:rgba(43,201,229,.9);box-shadow:0 0 0 3px rgba(55,217,234,.13)}
@media(max-width:900px){.guest-full-shell{width:calc(100vw - 24px);height:calc(100vh - 24px)}.guest-chat-topbar{min-height:auto}.guest-compose-full{grid-template-columns:1fr}.attach-btn,.guest-compose-full .btn-main{width:100%}.guest-result-card .table-wrap{max-height:320px}}


/* V20 - Guest multilingual assistant polish */
.guest-lang-select{height:42px;min-width:92px;border:1px solid rgba(255,255,255,.22);border-radius:14px;background:rgba(255,255,255,.12);color:#fff;font-weight:1000;padding:0 12px;outline:none;box-shadow:inset 0 1px 0 rgba(255,255,255,.12)}
.guest-lang-select option{color:#001b46;background:#fff}
.guest-chat-full .ai-msg:not(.result-msg){max-width:min(980px,78%);border-radius:18px;padding:12px 16px;background:rgba(255,255,255,.96);border:1px solid var(--line);box-shadow:0 10px 28px rgba(4,25,56,.06)}
.guest-chat-full .ai-msg:not(.result-msg) p{margin:6px 0 0;color:var(--muted);font-weight:750;line-height:1.45}
.guest-chat-full .user-msg{max-width:min(680px,70%);margin-left:auto;border-radius:18px;padding:12px 16px;background:linear-gradient(135deg,#38bdf8,#48e4df);color:#fff;box-shadow:0 12px 26px rgba(34,168,209,.22);font-weight:850}
@media(max-width:900px){.guest-lang-select{width:100%}.guest-chat-full .ai-msg:not(.result-msg),.guest-chat-full .user-msg{max-width:100%}}

/* V22 - Guest AI stability, theme selector and sharper readability */
.guest-head-actions{display:flex;align-items:center;gap:10px;flex-wrap:nowrap}
.guest-theme-select{height:42px;min-width:108px;border:1px solid rgba(255,255,255,.22);border-radius:14px;background:rgba(255,255,255,.12);color:#fff;font-weight:1000;padding:0 12px;outline:none;box-shadow:inset 0 1px 0 rgba(255,255,255,.12)}
.guest-theme-select option{color:#001b46;background:#fff}
.guest-chat-full{font-family:"Segoe UI",Inter,Roboto,Arial,sans-serif;color:#001844;font-weight:650;letter-spacing:-.01em}
.guest-chat-full .ai-msg:not(.result-msg){color:#001844;border-color:#cfe0f4;background:#fff;box-shadow:0 10px 28px rgba(4,25,56,.08)}
.guest-chat-full .ai-msg:not(.result-msg) b{color:#001844;font-weight:950;font-size:15px;line-height:1.25}
.guest-chat-full .ai-msg:not(.result-msg) p{color:#314a78;font-weight:850;font-size:13.5px;line-height:1.55;margin-top:7px}
.guest-chat-full .user-msg{font-size:14px;font-weight:900;text-shadow:0 1px 0 rgba(0,0,0,.08)}
.guest-input{font-family:"Segoe UI",Inter,Roboto,Arial,sans-serif;font-weight:850;color:#001844;background:#fff;letter-spacing:0}
.guest-input::placeholder{color:#5b6f94;opacity:1;font-weight:800}
.guest-result-card{color:#001844}.guest-result-title span{color:#001844;font-weight:950}.guest-result-title small{color:#314a78;font-weight:850;line-height:1.45}
.guest-result-card .table th{color:#435d88;font-weight:950;background:#edf3fa}.guest-result-card .table td{color:#001844;font-weight:650;background:#fff}.guest-result-card .table td b{font-weight:950}
html[data-theme=dark] .guest-portal{background:radial-gradient(circle at 22% 0%,rgba(75,238,229,.12),transparent 30%),linear-gradient(130deg,#030a13 0%,#07162d 56%,#0c254c 100%)}
html[data-theme=dark] .guest-chat-topbar{background:rgba(14,30,53,.88)}
html[data-theme=dark] .guest-assistant-card,html[data-theme=dark] .guest-chat-card-full{background:#071323;color:#edf5ff;border-color:#22395f}
html[data-theme=dark] .guest-compose-full{background:#071323;border-color:#22395f}
html[data-theme=dark] .guest-chat-full .ai-msg:not(.result-msg),html[data-theme=dark] .guest-result-card{background:#0f2038;color:#edf5ff;border-color:#28476f}
html[data-theme=dark] .guest-chat-full .ai-msg:not(.result-msg) b,html[data-theme=dark] .guest-result-title span{color:#ffffff}
html[data-theme=dark] .guest-chat-full .ai-msg:not(.result-msg) p,html[data-theme=dark] .guest-result-title small{color:#b8c9e8}
html[data-theme=dark] .guest-input,html[data-theme=dark] .attach-btn{background:#0f2038;color:#ffffff;border-color:#28476f}
html[data-theme=dark] .guest-input::placeholder{color:#aebfde}
html[data-theme=dark] .guest-result-card .table th{background:#172b49;color:#cfe2ff}
html[data-theme=dark] .guest-result-card .table td{background:#0f2038;color:#edf5ff}
html[data-theme=light] .guest-portal{background:#eaf2fb;color:#001844}
html[data-theme=light] .guest-chat-topbar{background:#fff;color:#001844;border-color:#dce7f5}.guest-chat-topbar .guest-lang-select,.guest-chat-topbar .guest-theme-select{background:rgba(255,255,255,.14)}
html[data-theme=light] .guest-chat-topbar .entry-kicker{color:#3b66ff}html[data-theme=light] .guest-brand-line p{color:#425b86}
html[data-theme=light] .guest-lang-select,html[data-theme=light] .guest-theme-select{background:#fff;color:#001844;border-color:#dce7f5}
@media(max-width:900px){.guest-head-actions{width:100%;display:grid;grid-template-columns:1fr 1fr 1fr}.guest-theme-select,.guest-lang-select,.guest-head-actions .tool-btn{width:100%;min-width:0}}

/* V23 - sharper guest typography, refined dark theme, login stability support */
.guest-portal,
.guest-portal *{
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:geometricPrecision;
}
.guest-portal{font-family:"Segoe UI Variable","Segoe UI",Inter,Roboto,Arial,sans-serif}
.guest-brand-line h1{font-weight:720;letter-spacing:-.025em}
.guest-brand-line p{font-weight:540;letter-spacing:-.005em}
.guest-chat-topbar .entry-kicker{font-weight:680;letter-spacing:3.6px}
.guest-quick-actions-pro .chip-btn,
.guest-head-actions .tool-btn,
.guest-lang-select,
.guest-theme-select,
.attach-btn,
.guest-compose-full .btn-main{font-weight:720;letter-spacing:-.01em}
.guest-chat-full{font-weight:500;letter-spacing:-.012em}
.guest-chat-full .ai-msg:not(.result-msg){font-weight:500;line-height:1.52}
.guest-chat-full .ai-msg:not(.result-msg) b{font-weight:720;font-size:15px;letter-spacing:-.015em}
.guest-chat-full .ai-msg:not(.result-msg) p{font-weight:500;font-size:13.5px;line-height:1.62;color:#274268}
.guest-chat-full .user-msg{font-weight:560;text-shadow:none;letter-spacing:-.01em}
.guest-input{font-weight:500;font-size:14px;line-height:1.45}
.guest-input::placeholder{font-weight:500;color:#5f7190}
.guest-result-title span{font-weight:720;letter-spacing:-.012em}
.guest-result-title small{font-weight:500;line-height:1.55}
.guest-result-card .table th{font-weight:680;letter-spacing:.45px}
.guest-result-card .table td{font-weight:500;line-height:1.35}
.guest-result-card .table td b,.guest-result-card .money{font-weight:700}
html[data-theme=dark] .guest-portal{
  background:
    radial-gradient(circle at 15% 4%,rgba(86,232,255,.16),transparent 26%),
    radial-gradient(circle at 85% 0%,rgba(72,128,255,.11),transparent 32%),
    linear-gradient(135deg,#030b17 0%,#07162a 54%,#0a2245 100%);
}
html[data-theme=dark] .guest-chat-topbar{
  background:linear-gradient(135deg,rgba(18,42,76,.92),rgba(8,20,38,.96));
  border:1px solid rgba(113,231,255,.20);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 20px 60px rgba(0,0,0,.28),0 0 0 1px rgba(38,207,232,.04);
}
html[data-theme=dark] .guest-chat-card-full{
  background:linear-gradient(180deg,#08172b 0%,#061120 100%);
  border:1px solid rgba(105,220,255,.18);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 24px 70px rgba(0,0,0,.34);
}
html[data-theme=dark] .guest-quick-actions-pro{
  background:linear-gradient(180deg,rgba(17,39,70,.72),rgba(8,21,39,.66));
  border-bottom:1px solid rgba(107,219,255,.16);
}
html[data-theme=dark] .guest-quick-actions-pro .chip-btn{
  background:linear-gradient(180deg,rgba(24,51,87,.9),rgba(12,31,58,.9));
  border-color:rgba(121,213,255,.22);
  color:#eaf5ff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 8px 18px rgba(0,0,0,.20);
}
html[data-theme=dark] .guest-quick-actions-pro .chip-btn:hover{
  border-color:rgba(90,239,255,.65);
  box-shadow:0 0 0 3px rgba(71,224,239,.10),0 12px 28px rgba(0,0,0,.26);
}
html[data-theme=dark] .guest-chat-full{
  background:
    radial-gradient(circle at 22% 8%,rgba(68,203,255,.07),transparent 26%),
    radial-gradient(circle at 82% 20%,rgba(78,231,231,.045),transparent 30%),
    linear-gradient(180deg,rgba(8,23,42,.96),rgba(5,15,29,.98));
  color:#edf6ff;
}
html[data-theme=dark] .guest-chat-full .ai-msg:not(.result-msg){
  background:linear-gradient(180deg,rgba(18,39,68,.96),rgba(13,31,56,.96));
  border:1px solid rgba(117,212,255,.22);
  color:#edf6ff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 12px 30px rgba(0,0,0,.22);
}
html[data-theme=dark] .guest-chat-full .ai-msg:not(.result-msg) b{color:#ffffff}
html[data-theme=dark] .guest-chat-full .ai-msg:not(.result-msg) p{color:#c7d8ee;font-weight:500}
html[data-theme=dark] .guest-chat-full .user-msg{
  background:linear-gradient(135deg,#1996dc,#44ddd8);
  color:#fff;
  box-shadow:0 12px 32px rgba(0,169,224,.24);
}
html[data-theme=dark] .guest-compose-full{
  background:linear-gradient(180deg,rgba(7,18,34,.96),rgba(5,14,27,.98));
  border-top:1px solid rgba(105,220,255,.18);
}
html[data-theme=dark] .guest-input,
html[data-theme=dark] .attach-btn{
  background:linear-gradient(180deg,#10243f,#0c1d34);
  color:#f3f8ff;
  border-color:rgba(112,210,255,.25);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 8px 24px rgba(0,0,0,.18);
}
html[data-theme=dark] .guest-input:focus{
  border-color:rgba(86,233,255,.78);
  box-shadow:0 0 0 3px rgba(86,233,255,.13),inset 0 1px 0 rgba(255,255,255,.06);
}
html[data-theme=dark] .guest-lang-select,
html[data-theme=dark] .guest-theme-select{
  background:linear-gradient(180deg,rgba(27,52,88,.92),rgba(15,34,62,.92));
  border-color:rgba(127,218,255,.25);
  color:#f4f8ff;
}
html[data-theme=dark] .guest-head-actions .tool-btn{
  background:#ffffff;
  color:#001b46;
  box-shadow:0 10px 24px rgba(0,0,0,.20);
}
html[data-theme=dark] .guest-result-card{
  background:linear-gradient(180deg,#0f2038,#0b1b31);
  border:1px solid rgba(117,212,255,.20);
}
html[data-theme=dark] .guest-result-card .table th{background:#152945;color:#c9ddf7;font-weight:680}
html[data-theme=dark] .guest-result-card .table td{background:#0e1f37;color:#f1f6ff;font-weight:500}
html[data-theme=light] .guest-chat-full .ai-msg:not(.result-msg){box-shadow:0 10px 24px rgba(20,48,86,.065)}
html[data-theme=light] .guest-chat-full .ai-msg:not(.result-msg) p{color:#2f4770}

/* V25 Guest analytics / OCR admin visualization */
.analytics-kpi-row{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px;margin-bottom:18px}
.analytics-kpi{padding:16px 18px;border:1px solid rgba(27,115,202,.16);border-radius:18px;background:linear-gradient(180deg,#fff,#f5fbff);box-shadow:0 14px 32px rgba(20,54,96,.08)}
.analytics-kpi span{display:block;font-size:13px;letter-spacing:.04em;color:#617594;font-weight:650;margin-bottom:8px}
.analytics-kpi b{font-size:30px;color:#001a46;font-weight:760;letter-spacing:-.03em}
.analytics-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:16px}
.analytics-grid.single{grid-template-columns:1fr}
.analytics-card{padding:18px;border:1px solid rgba(33,111,189,.16);border-radius:20px;background:linear-gradient(180deg,#fff,#f8fcff);box-shadow:0 16px 38px rgba(20,48,86,.07)}
.analytics-card h4{margin:0 0 14px;font-size:17px;color:#001a46;font-weight:760}
.bar-list{display:flex;flex-direction:column;gap:12px}.bar-row{display:grid;grid-template-columns:190px 1fr 48px;align-items:center;gap:12px}.bar-label{display:flex;flex-direction:column;gap:2px;min-width:0}.bar-label b{font-size:13px;color:#001f54;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-label small{font-size:11px;color:#6f7f99;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-track{height:11px;border-radius:99px;background:#e7f2ff;overflow:hidden}.bar-track span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#37c7ff,#3be1dc);box-shadow:0 0 14px rgba(53,208,238,.35)}.bar-row strong{font-size:13px;color:#001f54;text-align:right}
.mini-trend{height:160px;display:grid;grid-template-columns:repeat(14,minmax(0,1fr));align-items:end;gap:8px;padding:10px 6px 0}.trend-col{height:132px;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:6px}.trend-col span{width:100%;min-height:8px;border-radius:10px 10px 4px 4px;background:linear-gradient(180deg,#44dff0,#258dff);box-shadow:0 8px 18px rgba(37,141,255,.22)}.trend-col small{font-size:10px;color:#70809a;transform:rotate(-35deg);transform-origin:center top;margin-top:6px;white-space:nowrap}
.ocr-health{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:14px 16px;border-radius:16px;background:#f4faff;border:1px solid #d3e8ff}.ocr-health b{font-size:15px}.ocr-health.ready b{color:#00855c}.ocr-health.not-ready b{color:#ad6b00}.ocr-health span{color:#506584;font-weight:620}.ocr-health code{font-size:12px;background:#eef6ff;border:1px solid #d7e8fb;border-radius:10px;padding:6px 8px;color:#163b68}.ocr-health small{color:#677b98;font-weight:650}
html[data-theme=dark] .analytics-kpi,html[data-theme=dark] .analytics-card{background:linear-gradient(180deg,#0f2038,#0b1b31);border-color:rgba(117,212,255,.20);box-shadow:0 18px 38px rgba(0,0,0,.22)}
html[data-theme=dark] .analytics-kpi span,html[data-theme=dark] .bar-label small,html[data-theme=dark] .trend-col small{color:#9ab2d2}html[data-theme=dark] .analytics-kpi b,html[data-theme=dark] .analytics-card h4,html[data-theme=dark] .bar-label b,html[data-theme=dark] .bar-row strong{color:#f4f8ff}html[data-theme=dark] .bar-track{background:#142a49}html[data-theme=dark] .ocr-health{background:#10243f;border-color:rgba(117,212,255,.20)}html[data-theme=dark] .ocr-health span{color:#c8d9ee}html[data-theme=dark] .ocr-health code{background:#08192d;border-color:rgba(117,212,255,.20);color:#dceeff}
@media (max-width:1200px){.analytics-kpi-row{grid-template-columns:repeat(3,minmax(0,1fr))}.analytics-grid{grid-template-columns:1fr}.bar-row{grid-template-columns:150px 1fr 42px}}


/* V28 - Guest quotation result refinement */
.guest-result-card .tag.ok,
.guest-result-card .tag.published{
  background:#e7fff1;
  color:#05734e;
  border:1px solid rgba(5,115,78,.12);
}
html[data-theme=dark] .guest-result-card .tag.ok,
html[data-theme=dark] .guest-result-card .tag.published{
  background:rgba(28,201,132,.16);
  color:#7dffc9;
  border:1px solid rgba(125,255,201,.28);
  box-shadow:0 0 0 1px rgba(125,255,201,.04) inset;
}
html[data-theme=dark] .guest-result-card .tag.danger{
  background:rgba(255,87,121,.15);
  color:#ffb3c3;
  border:1px solid rgba(255,128,154,.28);
}
.guest-attachment-pill{
  border:1px solid rgba(76,216,238,.35);
  border-radius:16px;
  background:linear-gradient(135deg,#35bde9,#45e0dc);
  color:#fff;
  padding:10px 15px;
  font-weight:650;
  cursor:pointer;
  box-shadow:0 10px 24px rgba(35,170,220,.22);
}
.guest-attachment-pill:hover{filter:brightness(1.04);transform:translateY(-1px)}
.guest-image-preview-overlay{
  position:fixed;
  inset:0;
  z-index:80;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
  background:rgba(3,10,22,.62);
  backdrop-filter:blur(7px);
}
.guest-image-preview-box{
  width:min(1120px,94vw);
  max-height:88vh;
  border-radius:22px;
  background:var(--paper);
  color:var(--ink);
  border:1px solid var(--line);
  box-shadow:0 28px 80px rgba(0,0,0,.35);
  padding:16px;
  position:relative;
  overflow:auto;
}
.guest-image-preview-title{font-weight:720;margin:2px 48px 12px 2px;color:var(--ink)}
.guest-image-preview-box img{display:block;max-width:100%;height:auto;margin:0 auto;border-radius:14px;border:1px solid var(--line)}
.guest-image-preview-close{
  position:absolute;
  right:14px;
  top:12px;
  width:36px;
  height:36px;
  border-radius:50%;
  border:1px solid var(--line);
  background:var(--paper);
  color:var(--ink);
  font-size:24px;
  font-weight:600;
  cursor:pointer;
}
html[data-theme=dark] .guest-image-preview-box{
  background:#08172b;
  border-color:rgba(105,220,255,.24);
}
html[data-theme=dark] .guest-image-preview-close{background:#10243f;color:#f3f8ff;border-color:rgba(112,210,255,.28)}

/* V29 - Sapali Internal AI Support */
.internal-ai-shell{border:1px solid var(--line);border-radius:24px;background:var(--paper);box-shadow:var(--shadow);overflow:hidden;min-height:calc(100vh - 230px);display:grid;grid-template-rows:auto auto 1fr auto}
.internal-ai-topbar{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:20px 22px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,rgba(255,255,255,.82),rgba(246,251,255,.72))}
.internal-ai-topbar h3{margin:4px 0 6px;font-size:22px;color:var(--ink);font-weight:720;letter-spacing:-.02em}.internal-ai-topbar p{margin:0;color:var(--muted);font-weight:520}.internal-quick-actions{padding:14px 18px;border-bottom:1px solid var(--line)}.internal-chat{min-height:480px;max-height:calc(100vh - 410px);padding:18px;background:linear-gradient(180deg,rgba(250,253,255,.96),rgba(248,252,255,.98))}.internal-compose{border-top:1px solid var(--line);padding:14px 18px}.internal-result-card{width:100%}.internal-section{margin-top:14px;padding:14px;border:1px solid var(--line);border-radius:18px;background:rgba(240,248,255,.68)}.internal-section h4{margin:0 0 12px;color:var(--ink);font-size:16px;font-weight:720}.history-card{border:1px solid var(--line);border-radius:18px;padding:14px;background:var(--paper);margin-bottom:12px}.history-title{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:12px}.history-title b{font-size:17px;color:var(--ink)}.history-title span{color:var(--muted);font-weight:560}.history-timeline{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}.history-step{border:1px solid var(--line);border-radius:16px;padding:12px;background:linear-gradient(180deg,#fff,#f7fbff)}.history-step.latest{border-color:rgba(35,207,226,.65);box-shadow:0 0 0 2px rgba(43,217,230,.08),0 12px 28px rgba(34,180,220,.12)}.history-step.latest:before{content:'Latest';display:inline-block;margin-bottom:6px;border-radius:999px;padding:4px 9px;background:#ddfff9;color:#007a72;font-size:11px;font-weight:750}.history-date{display:block;color:var(--muted);font-size:12px;font-weight:650}.history-step b{display:block;font-size:20px;margin:4px 0;color:var(--ink)}.history-step small{display:block;color:var(--muted);font-weight:540;line-height:1.35}
html[data-theme=dark] .internal-ai-shell{background:linear-gradient(180deg,#08192d,#071528);border-color:rgba(100,216,255,.22);box-shadow:0 24px 60px rgba(0,0,0,.28)}html[data-theme=dark] .internal-ai-topbar{background:linear-gradient(135deg,#0f2847,#0a1d36);border-color:rgba(100,216,255,.22)}html[data-theme=dark] .internal-chat{background:linear-gradient(180deg,#061427,#061326)}html[data-theme=dark] .internal-section{background:rgba(16,36,63,.72);border-color:rgba(100,216,255,.20)}html[data-theme=dark] .history-card{background:#0b1d34;border-color:rgba(100,216,255,.20)}html[data-theme=dark] .history-step{background:linear-gradient(180deg,#10243f,#0a1c32);border-color:rgba(100,216,255,.18)}html[data-theme=dark] .history-step.latest{border-color:rgba(76,230,240,.6);box-shadow:0 0 0 2px rgba(76,230,240,.08),0 18px 34px rgba(0,0,0,.24)}html[data-theme=dark] .history-step.latest:before{background:rgba(82,255,220,.14);color:#8dffdf}
/* V31 Admin permission UX */
.permission-layout{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);gap:14px;margin-top:14px}.permission-panel{border:1px solid var(--line);border-radius:16px;background:linear-gradient(180deg,rgba(66,182,255,.06),rgba(66,182,255,.025));padding:13px}.permission-title{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:10px}.permission-title b{font-size:14px}.permission-title small{color:var(--muted);font-weight:800}.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.permission-grid.dense{grid-template-columns:repeat(3,minmax(0,1fr))}.permission-group{display:grid;gap:8px;align-content:start}.permission-group h4{margin:0 0 2px;font-size:11px;text-transform:uppercase;letter-spacing:.9px;color:var(--muted)}.permission-check{display:flex;gap:9px;align-items:flex-start;border:1px solid var(--line);border-radius:13px;background:var(--paper);padding:10px;cursor:pointer;min-height:62px;transition:.18s ease}.permission-check input{margin-top:3px;accent-color:var(--accent)}.permission-check span{display:grid;gap:3px}.permission-check b{font-size:12px}.permission-check small{font-size:10.5px;line-height:1.25;color:var(--muted);font-weight:750}.permission-check.selected{border-color:rgba(68,218,255,.72);box-shadow:0 0 0 1px rgba(68,218,255,.18),0 0 18px rgba(68,218,255,.10);background:rgba(66,182,255,.10)}.chip-line{display:flex;flex-wrap:wrap;gap:5px;max-width:360px}.chip-line span,.chip-line small{display:inline-flex;align-items:center;border:1px solid var(--line);background:rgba(66,182,255,.08);border-radius:999px;padding:3px 7px;font-size:10px;font-weight:900}.link-btn{border:0;background:transparent;color:var(--accent);font-weight:950;cursor:pointer;padding:0;text-align:left}.link-btn:hover{text-decoration:underline}.notify-route{border:1px solid var(--line);border-radius:16px;background:linear-gradient(180deg,rgba(66,182,255,.06),rgba(66,182,255,.02));padding:12px;margin-bottom:11px;display:grid;gap:10px}.notify-main{display:grid;grid-template-columns:minmax(220px,.9fr) minmax(180px,.6fr);gap:10px}.notify-address{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.notify-route label{font-size:11px;font-weight:900;color:var(--muted);text-transform:uppercase;letter-spacing:.5px}.notify-toggles{display:flex;gap:8px;flex-wrap:wrap}.notify-toggles label{border:1px solid var(--line);border-radius:999px;background:var(--paper);padding:7px 10px;color:var(--ink);text-transform:none;letter-spacing:0}.notify-toggles input{accent-color:var(--accent)}.security-polish-note{border:1px solid var(--line);border-radius:14px;background:rgba(66,182,255,.08);padding:11px 13px;margin-bottom:12px;color:var(--muted);font-size:12px;font-weight:800}.security-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin-top:12px}.security-role-card{border:1px solid var(--line);border-radius:15px;background:var(--paper);padding:12px;display:grid;gap:10px}.security-role-card b{font-size:14px}.security-role-card small{display:block;color:var(--muted);font-weight:800;margin-top:4px;line-height:1.3}.security-role-flags{display:flex;gap:6px;flex-wrap:wrap}.security-summary{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:10px}@media(max-width:1300px){.permission-layout{grid-template-columns:1fr}.permission-grid.dense{grid-template-columns:repeat(2,minmax(0,1fr))}.security-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.notify-address{grid-template-columns:1fr}.notify-main{grid-template-columns:1fr}}@media(max-width:760px){.permission-grid,.permission-grid.dense,.security-card-grid{grid-template-columns:1fr}}
[data-theme="dark"] .permission-check,[data-theme="dark"] .notify-route,[data-theme="dark"] .security-role-card{background:rgba(8,22,45,.72);border-color:rgba(116,219,255,.18)}[data-theme="dark"] .permission-check.selected{background:rgba(0,210,255,.12);border-color:rgba(108,236,255,.7)}[data-theme="dark"] .notify-toggles label{background:rgba(8,22,45,.85);border-color:rgba(116,219,255,.2)}

/* V32 Smart Admin permission + connection UX */
.access-designer{display:grid;gap:13px;margin-top:14px}.access-summary-card{border:1px solid var(--line);border-radius:17px;background:linear-gradient(135deg,rgba(66,182,255,.10),rgba(78,231,231,.04));padding:13px;display:grid;grid-template-columns:minmax(280px,.8fr) minmax(0,1.2fr);gap:12px;align-items:center}.access-summary-card h4{margin:2px 0 0;font-size:15px}.selected-access-summary{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.access-chip{display:inline-grid;gap:1px;border:1px solid var(--line);border-radius:13px;background:var(--paper);padding:7px 9px;min-width:74px}.access-chip b{font-size:12px}.access-chip small{font-size:9.5px;color:var(--muted);font-weight:850;text-transform:uppercase}.access-chip.blue{background:rgba(66,182,255,.12);border-color:rgba(66,182,255,.35)}.access-chip.green{background:rgba(46,213,115,.12);border-color:rgba(46,213,115,.35)}.smart-permission-layout{margin-top:0}.smart-permission-control{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:end;margin-bottom:10px}.smart-permission-control label{font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.55px;color:var(--muted)}.smart-permission-control select{margin-top:6px}.permission-count{border:1px solid var(--line);border-radius:999px;background:rgba(66,182,255,.10);padding:9px 11px;font-size:11px;font-weight:950;white-space:nowrap}.permission-group.smart{grid-column:1/-1}.permission-grid.smart-grid{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}.permission-grid.smart-grid.dense{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}.notify-smart-shell{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(300px,.85fr);gap:14px}.notify-builder-card,.notify-route-list-card{border:1px solid var(--line);border-radius:18px;background:linear-gradient(180deg,rgba(66,182,255,.07),rgba(66,182,255,.025));padding:13px}.notify-builder-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:12px}.notify-builder-head h4{margin:2px 0 0;font-size:15px}.notify-builder-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.notify-builder-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.notify-builder-grid label,.notify-channel-card label{font-size:11px;font-weight:950;color:var(--muted);text-transform:uppercase;letter-spacing:.55px}.notify-channel-panels{display:grid;gap:10px;margin-top:12px}.notify-channel-card{border:1px solid var(--line);border-radius:15px;background:var(--paper);padding:12px}.notify-route-list-card #notificationRoutesEditor{display:grid;gap:8px;max-height:430px;overflow:auto;padding-right:2px}.notify-route-card{width:100%;border:1px solid var(--line);background:var(--paper);color:var(--ink);border-radius:14px;padding:10px 11px;text-align:left;cursor:pointer;display:grid;gap:3px}.notify-route-card b{font-size:12.5px}.notify-route-card small{font-size:10px;color:var(--muted);font-weight:850}.notify-route-card span{font-size:10.5px;font-weight:900;color:var(--muted)}.notify-route-card.active{border-color:rgba(68,218,255,.72);background:rgba(66,182,255,.11);box-shadow:0 0 0 1px rgba(68,218,255,.18),0 10px 24px rgba(66,182,255,.09)}
[data-theme="dark"] .access-summary-card,[data-theme="dark"] .notify-builder-card,[data-theme="dark"] .notify-route-list-card,[data-theme="dark"] .notify-channel-card{background:rgba(8,22,45,.72);border-color:rgba(116,219,255,.18)}[data-theme="dark"] .access-chip,[data-theme="dark"] .notify-route-card{background:rgba(8,22,45,.85);border-color:rgba(116,219,255,.20)}[data-theme="dark"] .notify-route-card.active{background:rgba(0,210,255,.12);border-color:rgba(108,236,255,.7)}
@media(max-width:1200px){.access-summary-card,.notify-smart-shell{grid-template-columns:1fr}.selected-access-summary{justify-content:flex-start}.notify-builder-grid{grid-template-columns:1fr}.notify-builder-grid.two{grid-template-columns:1fr}}

/* V32 Mobile fitting mode */
@media(max-width:760px){html.is-mobile-view body{font-size:12px}.top{padding:8px 9px}.header{grid-template-columns:1fr!important;gap:8px}.brand h1{font-size:18px!important;white-space:normal}.brand span{display:none}.switches,.user-zone{width:100%;justify-content:space-between}.tabs{display:flex!important;overflow-x:auto;grid-template-columns:none!important;border-radius:14px;padding:6px;gap:6px}.tab{flex:0 0 112px;height:34px;font-size:10.5px;border-radius:10px}.page{padding:10px 9px 18px}.title-panel{padding:11px;align-items:flex-start;flex-direction:column}.title-panel h2{font-size:17px}.toolbar-panel{padding:9px;overflow-x:auto;flex-wrap:nowrap}.toolbar-panel .tool-btn,.toolbar-panel .btn-main{height:34px;font-size:10.5px;padding:0 9px}.card{border-radius:14px}.card-head{padding:10px;align-items:flex-start;flex-direction:column}.card-head h3{font-size:14px}.card-body{padding:10px}.kpi-row{grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible}.kpi{min-height:74px;padding:10px}.kpi-number{font-size:20px}.form-grid,.pro-form-grid,.permission-layout,.smart-permission-layout,.notify-smart-shell{grid-template-columns:1fr!important}.smart-permission-control{grid-template-columns:1fr}.permission-count{width:max-content}.wide-input,.mini-select,.textarea{height:35px;border-radius:10px;font-size:12px;padding:0 9px}.textarea{height:94px;padding:9px}.btn-main,.tool-btn{height:35px;border-radius:10px;font-size:11px;padding:0 10px}.action-strip{display:flex;gap:7px;flex-wrap:wrap;width:100%}.search-row,.filters{display:grid;grid-template-columns:1fr;width:100%}.search-row .wide-input{min-width:0}.table-wrap{max-width:100%;overflow:auto;border-radius:11px}.table{min-width:620px}.table th{font-size:9px;padding:6px 7px;letter-spacing:.35px}.table td{font-size:10px;padding:6px 7px;line-height:1.2}.table input,.table select{height:28px;min-width:64px;font-size:10px}.pill,.tag{font-size:9.5px;padding:4px 7px}.chip-line{max-width:220px}.chip-line span,.chip-line small{font-size:9px;padding:2px 6px}.access-summary-card{padding:10px}.access-summary-card h4,.notify-builder-head h4{font-size:13px}.selected-access-summary{gap:5px}.access-chip{min-width:auto;padding:6px 7px}.permission-grid.smart-grid,.permission-grid.smart-grid.dense{grid-template-columns:1fr}.permission-check{min-height:52px;padding:8px}.permission-check b{font-size:11px}.permission-check small{font-size:9.5px}.notify-builder-card,.notify-route-list-card{padding:10px;border-radius:14px}.notify-builder-head{display:grid;grid-template-columns:1fr;gap:8px}.modal{padding:16px;border-radius:18px}.guest-full-shell{width:calc(100vw - 12px)!important;height:calc(100vh - 12px)!important}.guest-chat-topbar{padding:10px;border-radius:16px}.guest-brand-line h1{font-size:19px!important}.guest-chat-full{padding:10px!important}.guest-compose-full{padding:10px!important}.guest-result-card .table{min-width:620px}.guest-result-card .table th,.guest-result-card .table td{font-size:10px;padding:6px 7px}}
@media(max-width:430px){.kpi-row{grid-template-columns:1fr}.table{min-width:560px}.guest-result-card .table{min-width:560px}.tab{flex-basis:104px}.brand h1{font-size:16px!important}}

/* V33 production polish: price quotation detail + simplified Admin UX */
.quote-control-board{display:grid;grid-template-columns:1fr 1fr 1.1fr 1fr;gap:10px;margin-bottom:12px}.quote-id-card{border:1px solid var(--line);border-radius:15px;background:linear-gradient(180deg,rgba(66,182,255,.08),rgba(66,182,255,.025));padding:12px}.quote-id-card span{display:block;font-size:10.5px;font-weight:950;color:var(--muted);text-transform:uppercase;letter-spacing:.55px}.quote-id-card b{display:block;font-size:18px;margin-top:5px}.quote-id-card small{display:block;margin-top:5px;color:var(--muted);font-weight:850}.quote-id-card.highlight{border-color:rgba(68,218,255,.55);background:rgba(66,182,255,.12)}.quote-id-card.risk b{color:var(--danger)}.price-bridge{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:9px;margin-bottom:13px}.bridge-item{border:1px solid var(--line);border-radius:14px;background:var(--paper);padding:10px}.bridge-item>div:first-child{display:flex;justify-content:space-between;gap:8px;align-items:center}.bridge-item b{font-size:12px}.bridge-item span{font-size:14px;font-weight:950}.bridge-item small{display:block;margin-top:6px;color:var(--muted);font-size:10.5px;font-weight:850}.bridge-bar{height:7px;border-radius:999px;background:rgba(120,150,190,.18);overflow:hidden;margin-top:8px}.bridge-bar i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,var(--primary),var(--accent))}.bridge-item.material .bridge-bar i{background:linear-gradient(90deg,#34c6ff,#4ee7e7)}.bridge-item.labor .bridge-bar i{background:linear-gradient(90deg,#8fd3ff,#7fd1ae)}.bridge-item.overhead .bridge-bar i{background:linear-gradient(90deg,#ffd166,#ff9f43)}.bridge-item.packing .bridge-bar i{background:linear-gradient(90deg,#a78bfa,#60a5fa)}.bridge-item.total{border-color:rgba(68,218,255,.58);background:rgba(66,182,255,.10)}.quote-detail-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(340px,.85fr);gap:12px}.quote-detail-block{border:1px solid var(--line);border-radius:16px;background:linear-gradient(180deg,rgba(66,182,255,.045),rgba(66,182,255,.015));padding:12px}.quote-detail-block h4,.quote-material-modal h4{margin:0 0 5px;font-size:14px}.quote-detail-block p{margin:0 0 10px;color:var(--muted);font-size:11.5px;font-weight:850}.material-drill{font-weight:950}.quote-material-modal{display:grid;gap:10px}.quote-material-modal .table{min-width:560px}.clean-access-summary{grid-template-columns:minmax(260px,1fr) auto;background:rgba(66,182,255,.06)}.selected-access-summary.compact{justify-content:flex-end}.access-mini-chip{display:inline-flex;align-items:center;border:1px solid var(--line);background:var(--paper);border-radius:999px;padding:7px 10px;font-size:11px;font-weight:950}.access-mini-chip.strong{color:#067a51;background:#eafff4}.permission-panel.smart-permission-panel{background:linear-gradient(180deg,rgba(66,182,255,.045),rgba(66,182,255,.012));border-radius:16px}.permission-grid.smart-grid{max-height:360px;overflow:auto;padding-right:2px}.permission-check{min-height:auto}.permission-check small{line-height:1.25}.admin-clean-body{display:grid;gap:12px}.admin-clean-note{border:1px solid var(--line);background:rgba(66,182,255,.06);border-radius:13px;padding:10px 12px;color:var(--muted);font-size:12px;font-weight:850}.pro-notify-shell{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}.notify-config-card{border:1px solid var(--line);border-radius:17px;background:linear-gradient(180deg,rgba(66,182,255,.055),rgba(66,182,255,.018));padding:13px}.notify-section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:11px}.notify-section-head h4{margin:2px 0 0;font-size:15px}.compact-notify-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.connection-fieldset,.route-fieldset{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:10px;border:1px solid var(--line);border-radius:14px;background:var(--paper);padding:11px}.route-fieldset{grid-template-columns:repeat(2,minmax(0,1fr))}.connection-fieldset label,.route-fieldset label,.full-note-label{font-size:10.5px;font-weight:950;color:var(--muted);text-transform:uppercase;letter-spacing:.5px}.full-note-label{display:block;margin-top:10px}.configured-routes-clean{border:1px solid var(--line);border-radius:16px;background:rgba(66,182,255,.035);padding:12px}.configured-routes-clean #notificationRoutesEditor{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;margin-top:9px;max-height:210px;overflow:auto}.notify-route-card.compact{min-height:58px;padding:9px 10px}.notify-route-card.compact b{font-size:12px}.notify-route-card.compact span{font-size:10.5px}.admin-tabs{gap:10px}.admin-tabs .admin-tab{min-width:150px}
[data-theme="dark"] .quote-id-card,[data-theme="dark"] .bridge-item,[data-theme="dark"] .quote-detail-block,[data-theme="dark"] .notify-config-card,[data-theme="dark"] .configured-routes-clean,[data-theme="dark"] .connection-fieldset,[data-theme="dark"] .route-fieldset,[data-theme="dark"] .permission-panel.smart-permission-panel{background:rgba(8,22,45,.72);border-color:rgba(116,219,255,.18)}[data-theme="dark"] .access-mini-chip{background:rgba(8,22,45,.85);border-color:rgba(116,219,255,.2)}[data-theme="dark"] .access-mini-chip.strong{background:rgba(0,220,140,.13);color:#83ffd5}
@media(max-width:1200px){.quote-control-board,.quote-detail-grid,.pro-notify-shell{grid-template-columns:1fr}.compact-notify-grid,.connection-fieldset,.route-fieldset{grid-template-columns:1fr}.selected-access-summary.compact{justify-content:flex-start}}
@media(max-width:760px){.quote-control-board{grid-template-columns:1fr}.quote-id-card b{font-size:15px}.price-bridge{grid-template-columns:1fr}.quote-detail-block{padding:9px}.configured-routes-clean #notificationRoutesEditor{grid-template-columns:1fr}.admin-tabs .admin-tab{min-width:132px}}

/* V34 CS011 costing layout */
.material-price-summary{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0 0 12px;padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:rgba(52,211,235,.08);font-weight:800;color:var(--muted)}
.cs011-board .quote-id-card{min-height:86px}.cs011-total-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:12px 0}.cs011-total-row>div{border:1px solid var(--line);border-radius:16px;padding:14px 16px;background:linear-gradient(180deg,rgba(52,211,235,.10),rgba(255,255,255,.02))}.cs011-total-row span{display:block;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-size:11px;font-weight:900}.cs011-total-row b{display:block;font-size:22px;margin-top:6px;color:var(--text)}
.cs011-detail-grid{grid-template-columns:minmax(520px,1.25fr) minmax(420px,.95fr);align-items:start}.formula-layout-block table tbody tr:last-child{background:rgba(52,211,235,.08);font-weight:900}.final-price-cell{color:#0891b2;font-weight:950}.formula-chip-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:8px 0 16px}.formula-chip{border:1px solid var(--line);background:var(--soft);border-radius:12px;padding:10px 12px;display:flex;justify-content:space-between;gap:10px;font-weight:850}.formula-chip b{color:#0e7490}.formula-material-drill{font-weight:950}.quote-material-modal{max-height:70vh;overflow:auto}.quote-material-modal h4{margin:12px 0 8px}.link-btn.material-drill,.formula-material-drill{color:#0e7490;text-decoration:none;border:0;background:transparent;cursor:pointer;font-weight:950;padding:0}.link-btn.material-drill:hover,.formula-material-drill:hover{text-decoration:underline}
@media (max-width: 900px){.cs011-total-row{grid-template-columns:1fr}.cs011-detail-grid{grid-template-columns:1fr}.formula-chip-row{grid-template-columns:1fr}.material-price-summary{font-size:11px}.quote-id-card b{font-size:18px}}

/* V35 Sapali quotation UX refinement: horizontal formula, row limit and compact BOM editor */
.quotation-head{align-items:center}.quotation-pager{gap:8px;flex-wrap:wrap}.row-limit-label{display:inline-flex;align-items:center;gap:7px;font-size:11px;font-weight:950;color:var(--muted);text-transform:uppercase;letter-spacing:.45px}.calc-limit-select{min-width:96px;max-width:110px;height:36px}.quotation-limit-note{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 10px;border:1px solid var(--line);background:rgba(66,182,255,.07);border-radius:12px;padding:9px 12px;color:var(--muted);font-size:12px;font-weight:850}.formula-horizontal-wrap{max-width:100%;border-radius:16px}.formula-horizontal-table{min-width:1280px;border-spacing:0}.formula-horizontal-table th{vertical-align:top;text-align:center;min-width:112px;white-space:normal;background:linear-gradient(180deg,rgba(66,182,255,.14),rgba(66,182,255,.05))}.formula-horizontal-table th span{display:block;font-size:9px;color:var(--muted);font-weight:950;letter-spacing:.5px;text-transform:uppercase}.formula-horizontal-table th b{display:block;margin-top:3px;font-size:11px;line-height:1.18;color:var(--ink);text-transform:none;letter-spacing:0}.formula-horizontal-table td{text-align:center;vertical-align:top;min-width:112px}.formula-amount-cell{background:rgba(255,255,255,.38);font-size:13px}.formula-amount-cell .money,.formula-material-amount{font-size:14px;font-weight:950}.formula-amount-cell small{display:block;margin-top:4px;color:var(--muted);font-size:9.5px;font-weight:900}.material-total-cell{background:rgba(52,211,235,.12)}.formula-material-amount{border:0;background:transparent;color:#0e7490;cursor:pointer;padding:0;text-decoration:underline;text-underline-offset:3px}.formula-note-row td{font-size:10.5px;text-align:left;color:var(--muted);background:rgba(90,120,160,.04)}.formula-driver-note{display:block;max-width:170px;line-height:1.25}.bom-pretty-wrap{border-radius:16px}.bom-pretty-table{min-width:980px}.bom-pretty-table th{background:linear-gradient(180deg,rgba(66,182,255,.14),rgba(66,182,255,.04))}.bom-pretty-table td{vertical-align:top;padding:10px 11px}.bom-main-cell b,.bom-amount-cell b,.bom-price-cell b,.bom-compact-cell b{display:block;font-size:13px}.bom-main-cell small,.bom-qty-cell small,.bom-price-cell small,.bom-compact-cell small{display:block;color:var(--muted);font-size:10.5px;font-weight:850;margin-top:3px}.bom-main-cell input,.bom-material-cell input,.bom-qty-cell input{width:100%;min-width:0;height:31px;margin-top:6px;border-radius:10px}.bom-material-cell input+input{margin-top:6px}.bom-compact-cell span,.bom-price-cell span{display:block;text-transform:uppercase;letter-spacing:.45px;color:var(--muted);font-size:9.5px;font-weight:950}.bom-qty-cell{max-width:110px}.bom-amount-cell{text-align:right;background:rgba(66,182,255,.045)}.bom-pretty-table input:disabled{background:rgba(120,150,190,.065);border-color:transparent;color:var(--ink);box-shadow:none}.bom-pretty-table input[type=hidden]{display:none!important}[data-theme="dark"] .formula-horizontal-table th,[data-theme="dark"] .bom-pretty-table th{background:rgba(55,134,185,.18)}[data-theme="dark"] .formula-amount-cell,[data-theme="dark"] .bom-amount-cell{background:rgba(52,211,235,.08)}@media(max-width:900px){.quotation-head{display:grid;grid-template-columns:1fr;align-items:stretch}.quotation-pager{width:100%;display:grid;grid-template-columns:1fr 1fr}.quotation-pager .btn-main{grid-column:1/-1}.row-limit-label{justify-content:space-between}.formula-horizontal-table{min-width:1050px}.bom-pretty-table{min-width:820px}}

/* V36 Sapali pricing refinement: Excel-style formula, clean quotation detail, full BOM fields */
.formula-editor-wrap{border-radius:16px}.formula-editor-horizontal{min-width:1280px}.formula-editor-horizontal th{min-width:130px;text-align:center;background:linear-gradient(180deg,rgba(66,182,255,.14),rgba(66,182,255,.045));font-size:11px}.formula-editor-horizontal td{vertical-align:top;text-align:center}.formula-editor-horizontal .formula-field{width:100%;min-width:105px;height:34px;border-radius:10px;font-weight:900}.formula-editor-value-row small{display:block;margin-top:4px;color:var(--muted);font-size:9.5px;font-weight:950;text-transform:uppercase}.formula-editor-note-row td{background:rgba(52,211,235,.06);color:var(--muted);font-size:10.5px;line-height:1.22;font-weight:850;text-align:left}
.formula-full-width{width:100%;overflow:hidden}.formula-full-width h4{font-size:15px}.formula-full-width p{max-width:1180px}.cs011-total-row.compact{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:10px 0}.cs011-total-row.compact>div{padding:11px 13px}.cs011-total-row.compact b{font-size:18px}.formula-horizontal-wrap{overflow-x:auto;border:1px solid var(--line);background:linear-gradient(180deg,rgba(255,255,255,.7),rgba(255,255,255,.28))}.formula-horizontal-table{min-width:1720px}.formula-horizontal-table th{min-width:92px;padding:9px 8px}.formula-horizontal-table th:first-child,.formula-horizontal-table td:first-child{min-width:122px}.formula-horizontal-table th b{font-size:10.5px}.formula-horizontal-table th span{font-size:8.5px}.formula-horizontal-table td{min-width:92px;padding:9px 8px}.formula-amount-cell .money,.formula-material-amount{font-size:13px}.formula-meta-cell{background:rgba(120,150,190,.065)}.formula-note-row{display:none}.quote-detail-grid.cs011-detail-grid{grid-template-columns:1fr}.quote-material-modal .table{min-width:880px}.quote-material-modal .table th,.quote-material-modal .table td{white-space:nowrap}.material-total-cell{box-shadow:inset 0 0 0 1px rgba(6,182,212,.22)}
.bom-full-field-table{min-width:1180px;border-collapse:separate;border-spacing:0}.bom-full-field-table th{font-size:11px;text-align:left;white-space:nowrap}.bom-full-field-table td{padding:12px 12px;vertical-align:middle}.bom-full-field-table td:nth-child(4),.bom-full-field-table td:nth-child(5),.bom-full-field-table td:nth-child(6),.bom-full-field-table td:nth-child(7),.bom-full-field-table td:nth-child(8),.bom-full-field-table td:nth-child(9){text-align:right}.bom-cell-text{display:inline-block;font-weight:850;color:var(--ink);min-height:18px}.bom-code-cell .bom-cell-text{font-weight:950;color:#087b94}.bom-cell-input{width:100%;min-width:88px;height:32px;border-radius:10px;font-weight:850}.bom-full-field-table .num-cell input{text-align:right}.bom-amount-cell b{font-size:13px;color:var(--ink)}.bom-full-field-table input[type=hidden]{display:none!important}.bom-full-field-table tbody tr:hover{background:rgba(66,182,255,.055)}
[data-theme="dark"] .formula-horizontal-wrap{background:rgba(8,22,45,.62)}[data-theme="dark"] .formula-editor-note-row td{background:rgba(52,211,235,.08)}[data-theme="dark"] .formula-meta-cell{background:rgba(120,180,220,.08)}[data-theme="dark"] .bom-full-field-table tbody tr:hover{background:rgba(80,210,255,.08)}
@media(max-width:900px){.formula-editor-horizontal{min-width:980px}.formula-horizontal-table{min-width:1450px}.cs011-total-row.compact{grid-template-columns:1fr}.bom-full-field-table{min-width:980px}}

/* Formula module V3: keep Formula Profiles clean; show full horizontal formula only after click */
.formula-profile-table tbody tr{cursor:pointer}
.formula-profile-table tbody tr:hover{background:rgba(66,182,255,.07)}
.formula-profile-table tbody tr.selected-row{background:rgba(52,211,235,.14)}
.compact-formula-head h3{margin-bottom:0}
.formula-preview-result{display:grid;gap:10px}
.formula-preview-head{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);border-radius:14px;background:rgba(66,182,255,.055);padding:9px 12px;font-weight:900;color:var(--muted)}
.formula-preview-head b{color:var(--ink);font-size:13px}
.formula-preview-head span{font-size:11px;text-align:right}
.formula-loading{padding:8px 0}
#formulaEditorCard .card-body{display:grid;gap:10px}
#formulaEditorCard .formula-editor-wrap{margin-top:0}
#formulaEditorCard .action-box{margin-bottom:0}
.lock-note.compact{padding:9px 12px;margin:0}
#formula .formula-horizontal-wrap{margin-top:0}
#formula .formula-horizontal-table th{padding-top:8px;padding-bottom:8px}
#formula .formula-horizontal-table td{padding-top:8px;padding-bottom:8px}
#formula .formula-editor-horizontal{min-width:1180px}
#formula .formula-editor-horizontal th{font-size:10.5px;padding:8px}
#formula .formula-editor-horizontal td{padding:8px}
#formula .formula-editor-horizontal .formula-field{height:32px}
[data-theme="dark"] .formula-preview-head{background:rgba(55,134,185,.13)}
@media(max-width:900px){.formula-preview-head{align-items:flex-start;flex-direction:column}.formula-preview-head span{text-align:left}}

/* V4 formula interaction + cleaner quotation screen */
.formula-horizontal-table th small{display:block;margin-top:4px;font-size:8.3px;line-height:1.1;color:var(--muted);font-weight:900;letter-spacing:.35px;text-transform:uppercase;opacity:.82}
.formula-clickable-cell{cursor:pointer;transition:box-shadow .15s ease, background .15s ease, transform .15s ease}
.formula-clickable-cell:hover{box-shadow:inset 0 0 0 2px rgba(66,182,255,.35);background:rgba(66,182,255,.10)}
.formula-adjustable-cell{background:linear-gradient(180deg,rgba(255,168,37,.30),rgba(255,168,37,.12))!important;box-shadow:inset 0 0 0 1px rgba(245,158,11,.28)}
.formula-target-cell{background:rgba(255,168,37,.34)!important;box-shadow:inset 0 0 0 3px rgba(245,126,0,.55)!important}
.formula-related-cell{background:rgba(52,211,235,.20)!important;box-shadow:inset 0 0 0 2px rgba(6,182,212,.42)!important}
.formula-example-note{border:1px solid var(--line);border-radius:12px;background:rgba(66,182,255,.055);padding:8px 10px;color:var(--muted);font-size:11.5px;font-weight:850}
.formula-cell-modal{display:grid;gap:10px;text-align:left}.formula-line{border:1px solid var(--line);border-radius:13px;background:rgba(66,182,255,.045);padding:10px 12px}.formula-line b{display:block;margin-bottom:5px}.formula-line p{margin:0;color:var(--text);font-weight:800;line-height:1.45}.formula-chip-row{display:flex;gap:6px;flex-wrap:wrap}.formula-chip{display:inline-flex;border:1px solid var(--line);background:var(--paper);border-radius:999px;padding:6px 9px;font-size:11px;font-weight:900;color:var(--ink)}
#calculation .card-body{padding-top:12px}
[data-theme="dark"] .formula-example-note,[data-theme="dark"] .formula-line{background:rgba(55,134,185,.13)}
[data-theme="dark"] .formula-adjustable-cell{background:rgba(245,158,11,.22)!important}
[data-theme="dark"] .formula-target-cell{background:rgba(245,126,0,.30)!important}
[data-theme="dark"] .formula-related-cell{background:rgba(34,211,238,.22)!important}

/* V5 quotation UX polish */
html[lang="vi"] body,
html[lang="vi"] button,
html[lang="vi"] input,
html[lang="vi"] select,
html[lang="vi"] textarea,
html[lang="vi"] .table,
html[lang="vi"] .modal { font-family: Arial, "Segoe UI", sans-serif !important; }
.quotation-insight-row{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:0 0 12px;align-items:stretch}.quote-insight-card{border:1px solid var(--line);border-radius:16px;background:linear-gradient(180deg,rgba(255,255,255,.86),rgba(66,182,255,.055));min-height:98px;padding:12px 14px;text-align:left;color:var(--ink);box-shadow:0 10px 24px rgba(9,30,66,.06);overflow:hidden}.quote-insight-card span{display:block;font-size:10.5px;font-weight:950;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);line-height:1.25}.quote-insight-card b{display:block;margin:7px 0 4px;font-size:20px;line-height:1.05;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.quote-insight-card small{display:block;font-size:11px;font-weight:850;line-height:1.28;color:var(--muted)}.quote-insight-card.final{border-color:rgba(34,211,238,.55);background:linear-gradient(180deg,rgba(207,250,254,.65),rgba(255,255,255,.75))}.quote-insight-card.history-action{cursor:pointer}.quote-insight-card.history-action:hover{transform:translateY(-1px);border-color:rgba(14,165,233,.75);box-shadow:0 14px 30px rgba(14,165,233,.16)}.quote-insight-card.reason{grid-column:auto}.quote-insight-card.reason small{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.quote-insight-card.fx b{font-size:18px}.formula-horizontal-table th small{display:none!important}.formula-horizontal-table th b{font-size:11px;line-height:1.22}.formula-adjustable-cell{background:linear-gradient(180deg,rgba(255,183,77,.38),rgba(255,243,224,.46))!important;border-color:rgba(251,146,60,.55)!important}.formula-target-cell{outline:3px solid rgba(20,184,166,.55);outline-offset:-3px}.formula-related-cell{box-shadow:inset 0 0 0 2px rgba(96,165,250,.55)}.internal-price-detail-btn{background:linear-gradient(135deg,rgba(34,211,238,.18),rgba(59,130,246,.13));border-color:rgba(34,211,238,.55)}[data-theme="dark"] .quote-insight-card{background:rgba(8,22,45,.78);border-color:rgba(116,219,255,.18)}[data-theme="dark"] .quote-insight-card.final{background:rgba(12,74,110,.45);border-color:rgba(34,211,238,.45)}[data-theme="dark"] .formula-adjustable-cell{background:rgba(251,146,60,.20)!important;border-color:rgba(251,146,60,.55)!important}@media(max-width:1320px){.quotation-insight-row{grid-template-columns:repeat(3,minmax(0,1fr))}.quote-insight-card.reason{grid-column:span 2}}@media(max-width:820px){.quotation-insight-row{grid-template-columns:1fr}.quote-insight-card.reason{grid-column:auto}.quote-insight-card b{font-size:18px}}
/* v7 quotation draft controls */
.quotation-insight-row-v7{grid-template-columns:repeat(5,minmax(0,1fr));}
.quotation-draft-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border:1px solid var(--line);border-radius:14px;background:rgba(66,182,255,.055);padding:10px 12px;margin:0 0 12px;}
.quotation-draft-toolbar .muted{flex:1 1 420px;font-size:11.5px;font-weight:850;line-height:1.35;}
.fx-edit-card label{display:block;margin-top:6px;font-size:10px;font-weight:950;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;}
.quote-fx-input{width:100%;height:30px;margin-top:4px;border:1px solid var(--line);border-radius:9px;background:var(--paper);color:var(--ink);font-weight:900;padding:0 8px;}
.material-draft-input{width:118px;max-width:100%;height:31px;border:1px solid var(--line);border-radius:9px;background:var(--paper);color:var(--ink);font-weight:850;padding:0 8px;}
.material-draft-input.small{width:76px;}
.modal-extra-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px;}
.quote-material-modal .table{min-width:1060px;}
.quote-material-modal input:focus,.quote-fx-input:focus{outline:2px solid rgba(34,211,238,.35);border-color:rgba(34,211,238,.75);}
@media(max-width:1320px){.quotation-insight-row-v7{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:820px){.quotation-insight-row-v7{grid-template-columns:1fr;}.quotation-draft-toolbar{display:grid;grid-template-columns:1fr;}.quotation-draft-toolbar .tool-btn,.quotation-draft-toolbar .btn-main{width:100%;}}

/* V8 refinement: remove top smart search, compact modal UX, and workflow visibility */
.header{grid-template-columns:minmax(300px,1fr) auto;justify-content:space-between}.header .global-search,#runGlobalSearch{display:none!important}.user-zone{justify-self:end}.tabs{grid-template-columns:repeat(8,minmax(0,1fr))}
.modal-backdrop{padding:14px}.modal.smart-modal-box,.modal{border-radius:20px;padding:18px 20px;max-height:86vh;overflow:auto}.modal .modal-icon{width:44px;height:44px;font-size:22px;margin-bottom:8px}.modal h3{margin:6px 0 4px;font-size:20px}.modal p{margin:0 0 12px;font-size:13px;line-height:1.4;color:var(--muted)}#modalSuggestions{max-height:62vh;overflow:auto}.modal.modal-wide{width:min(980px,calc(100vw - 48px));max-height:86vh;padding:20px 22px}.modal.modal-wide .table{min-width:760px}.modal.modal-wide .table th{padding:8px 10px;font-size:10px}.modal.modal-wide .table td{padding:8px 10px;font-size:12px}.modal-actions{position:sticky;bottom:-18px;background:linear-gradient(180deg,rgba(255,255,255,0),var(--paper) 35%);padding-top:12px}.modal-extra-actions{position:sticky;bottom:44px;background:var(--paper);padding-top:10px}.modal-textarea{height:92px;min-height:92px;font-family:inherit}.modal-field-label{display:grid;gap:6px;font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}.danger-btn{border-color:rgba(225,55,91,.45)!important;color:#b12d4c!important;background:#fff5f7!important}.row-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.row-actions .tool-btn,.row-actions .btn-main{height:32px;border-radius:10px;padding:0 10px;font-size:11px}.bom-wf-panel{border:1px solid rgba(255,159,67,.38);background:linear-gradient(180deg,rgba(255,159,67,.12),rgba(66,182,255,.035));border-radius:16px;padding:12px;margin-bottom:12px}.bom-wf-title{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;margin-bottom:10px}.bom-wf-title b{font-size:14px}.bom-wf-title small{max-width:720px;color:var(--muted);font-size:11px;font-weight:850}.mini-wf-list{margin-top:10px}.workflow-queue-table .table{min-width:1180px}.workflow-queue-table small{color:var(--muted);font-weight:850}.workflow-queue-table td:nth-child(9){min-width:220px;max-width:320px;white-space:normal}[data-theme="dark"] .modal-actions,[data-theme="dark"] .modal-extra-actions{background:linear-gradient(180deg,rgba(8,20,40,0),var(--paper) 35%)}[data-theme="dark"] .danger-btn{background:rgba(225,55,91,.16)!important;color:#ffb4c2!important}
@media(max-width:1100px){.header{grid-template-columns:1fr auto}.tabs{grid-template-columns:repeat(4,1fr)}}

/* V9 - professional workflow approval board */
.workflow-board{display:grid;gap:12px}
.workflow-board-title{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);background:linear-gradient(180deg,rgba(66,182,255,.075),rgba(255,255,255,.55));border-radius:16px;padding:12px 14px}
.workflow-board-title b{display:block;font-size:15px;font-weight:1000;color:var(--ink)}
.workflow-board-title small{display:block;margin-top:2px;color:var(--muted);font-weight:800;line-height:1.35}
.workflow-row-card{display:grid;grid-template-columns:130px 190px minmax(430px,1fr) 250px;gap:12px;align-items:stretch;border:1px solid var(--line);border-radius:18px;background:rgba(255,255,255,.94);box-shadow:0 10px 26px rgba(4,25,56,.06);padding:12px;position:relative;overflow:hidden}
.workflow-row-card:before{content:'';position:absolute;left:0;top:0;bottom:0;width:4px;background:linear-gradient(180deg,#37d9ea,#4b7cff)}
.workflow-row-card.is-returned:before{background:linear-gradient(180deg,#ff7a90,#ffbd66)}
.wf-id-block,.wf-object-block{border:1px solid rgba(213,226,242,.9);border-radius:14px;background:rgba(248,252,255,.8);padding:10px 11px;display:flex;flex-direction:column;justify-content:center;gap:3px;min-width:0}
.wf-id-block b,.wf-object-block b{font-size:13px;line-height:1.25;color:var(--ink);font-weight:1000;word-break:break-word}
.wf-id-block small,.wf-object-block small{font-size:11px;color:var(--muted);font-weight:850;line-height:1.25}
.wf-status-dot{width:10px;height:10px;border-radius:50%;background:#37d9ea;box-shadow:0 0 0 4px rgba(55,217,234,.12);margin-bottom:4px}
.wf-status-dot.requester{background:#ff7a90;box-shadow:0 0 0 4px rgba(255,122,144,.16)}
.wf-status-dot.final{background:#ffbd4a;box-shadow:0 0 0 4px rgba(255,189,74,.16)}
.wf-flow-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:stretch}
.wf-step-card{border:1px solid rgba(213,226,242,.9);border-radius:14px;background:#fff;padding:10px 11px;min-height:78px;display:flex;flex-direction:column;gap:3px;justify-content:center;transition:.18s ease;position:relative;overflow:hidden}
.wf-step-card span{font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:#5b739d;font-weight:1000}
.wf-step-card b{font-size:13px;line-height:1.25;color:var(--ink);font-weight:1000;word-break:break-word}
.wf-step-card small{font-size:11px;line-height:1.25;color:var(--muted);font-weight:800}
.wf-step-card.active{border-color:rgba(43,201,229,.88);background:linear-gradient(180deg,rgba(55,217,234,.18),rgba(255,255,255,.88));box-shadow:inset 0 0 0 1px rgba(55,217,234,.14),0 10px 22px rgba(34,168,209,.10)}
.wf-step-card.active:after{content:'NOW';position:absolute;right:8px;top:7px;font-size:9px;font-weight:1000;color:#007b9b;background:rgba(55,217,234,.16);border:1px solid rgba(55,217,234,.36);border-radius:999px;padding:2px 6px}
.wf-step-card.done{border-color:rgba(33,186,117,.45);background:linear-gradient(180deg,rgba(31,203,129,.11),#fff)}
.wf-step-card.done:after{content:'OK';position:absolute;right:8px;top:7px;font-size:9px;font-weight:1000;color:#00894b;background:rgba(33,186,117,.14);border:1px solid rgba(33,186,117,.28);border-radius:999px;padding:2px 6px}
.wf-step-card.returned{border-color:rgba(225,55,91,.45);background:linear-gradient(180deg,rgba(255,122,144,.16),#fff)}
.wf-step-card.returned:after{content:'RETURN';position:absolute;right:8px;top:7px;font-size:9px;font-weight:1000;color:#b12d4c;background:rgba(225,55,91,.12);border:1px solid rgba(225,55,91,.28);border-radius:999px;padding:2px 6px}
.wf-backup{display:block;color:#87620c!important;background:rgba(255,189,74,.14);border:1px solid rgba(255,189,74,.28);border-radius:10px;padding:4px 6px;margin-top:3px}
.wf-mini-link{align-self:flex-start;margin-top:4px;border:0;background:transparent;color:#007b9b;font-weight:1000;font-size:11px;cursor:pointer;padding:0;text-decoration:underline;text-underline-offset:2px}
.wf-action-block{display:flex;align-items:center;justify-content:flex-end}
.wf-actions{justify-content:flex-end;gap:7px}.wf-actions .tool-btn{height:34px;border-radius:12px;padding:0 11px;font-size:11px;font-weight:1000}.reject-note-text{color:#b12d4c}
.modal-input{width:100%;height:42px;border:1px solid var(--line);border-radius:12px;padding:0 12px;background:#fff;color:var(--ink);font-weight:850;outline:none}
@media(max-width:1200px){.workflow-row-card{grid-template-columns:1fr}.wf-action-block{justify-content:flex-start}.wf-actions{justify-content:flex-start}.wf-flow-grid{grid-template-columns:1fr}}
[data-theme="dark"] .workflow-board-title,[data-theme="dark"] .workflow-row-card,[data-theme="dark"] .wf-id-block,[data-theme="dark"] .wf-object-block,[data-theme="dark"] .wf-step-card{background:rgba(12,30,55,.92);border-color:#244162;color:#edf5ff}[data-theme="dark"] .wf-id-block b,[data-theme="dark"] .wf-object-block b,[data-theme="dark"] .wf-step-card b,[data-theme="dark"] .workflow-board-title b{color:#fff}[data-theme="dark"] .wf-step-card.active{background:linear-gradient(180deg,rgba(55,217,234,.18),rgba(12,30,55,.96))}[data-theme="dark"] .wf-step-card.done{background:linear-gradient(180deg,rgba(31,203,129,.13),rgba(12,30,55,.96))}[data-theme="dark"] .wf-step-card.returned{background:linear-gradient(180deg,rgba(255,122,144,.16),rgba(12,30,55,.96))}[data-theme="dark"] .modal-input{background:#0f2038;color:#fff;border-color:#28476f}

/* V10 - compact decision-package workflow UX */
.wf-pro-board{display:grid;gap:12px}
.wf-pro-head{display:flex;align-items:center;justify-content:space-between;gap:14px;border:1px solid var(--line);border-radius:18px;background:linear-gradient(180deg,rgba(66,182,255,.07),rgba(255,255,255,.76));padding:13px 16px}
.wf-pro-head b{display:block;font-size:16px;font-weight:1000;color:var(--ink)}
.wf-pro-head small{display:block;margin-top:3px;color:var(--muted);font-weight:800;line-height:1.35}
.wf-pro-stats{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.wf-pro-stats span{border:1px solid var(--line);background:var(--paper);border-radius:999px;padding:6px 10px;font-size:11px;font-weight:1000;color:var(--ink)}
.wf-pro-stats .return{background:#fff4f6;color:#b12d4c;border-color:rgba(225,55,91,.25)}
.wf-pro-list{display:grid;gap:9px}
.wf-pro-row{display:grid;grid-template-columns:minmax(220px,.95fr) minmax(420px,1.65fr) minmax(190px,.7fr) 220px;gap:12px;align-items:center;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.97);box-shadow:0 9px 24px rgba(4,25,56,.055);padding:11px 12px;position:relative;overflow:hidden}
.wf-pro-row:before{content:'';position:absolute;left:0;top:0;bottom:0;width:5px;background:#37d9ea}.wf-pro-row.stage-final:before{background:#ffbd4a}.wf-pro-row.stage-requester:before{background:#ff7a90}.wf-pro-row.stage-done:before{background:#21ba75}
.wf-pro-main,.wf-pro-evidence,.wf-pro-reviewer{min-width:0}.wf-pro-meta{display:flex;align-items:center;gap:8px;min-width:0}.wf-pro-meta b{font-size:12px;font-weight:1000;color:var(--muted);white-space:nowrap}.wf-type-pill{display:inline-flex;align-items:center;border:1px solid rgba(55,217,234,.34);background:rgba(55,217,234,.12);color:#007b9b;border-radius:999px;padding:5px 8px;font-size:10px;font-weight:1000;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap}.wf-pro-object{margin-top:6px;font-size:16px;font-weight:1000;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wf-pro-object small{font-size:12px;color:var(--muted);font-weight:850}.wf-pro-created{margin-top:4px;color:var(--muted);font-size:11px;font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wf-pro-evidence>span,.wf-pro-reviewer>span{display:block;margin-bottom:6px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:1000}.wf-pro-evidence>div{display:flex;gap:6px;flex-wrap:wrap}.wf-chip{display:inline-flex;min-width:104px;max-width:190px;flex-direction:column;gap:2px;border:1px solid rgba(213,226,242,.92);border-radius:12px;background:rgba(248,252,255,.95);padding:7px 9px}.wf-chip small{font-size:9px;color:var(--muted);font-weight:1000;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wf-chip b{font-size:12px;color:var(--ink);font-weight:1000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wf-chip.strong{background:rgba(55,217,234,.10);border-color:rgba(55,217,234,.32)}.wf-chip.warn{background:rgba(255,189,74,.13);border-color:rgba(255,189,74,.38)}
.wf-pro-reviewer{border:1px solid rgba(213,226,242,.92);border-radius:14px;background:rgba(66,182,255,.06);padding:10px 11px}.wf-pro-reviewer b{display:block;font-size:13px;line-height:1.25;color:var(--ink);font-weight:1000}.wf-pro-actions{display:flex;justify-content:flex-end}.wf-pro-actions .row-actions{justify-content:flex-end}.wf-pro-actions .tool-btn{height:34px;border-radius:12px;font-size:11px;font-weight:1000}.wf-pro-actions .danger-btn{opacity:.92}.wf-mini-link{display:inline-flex;margin-top:7px}
.wf-detail-package{display:grid;gap:12px}.wf-detail-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.wf-detail-summary>div{border:1px solid var(--line);border-radius:14px;background:rgba(66,182,255,.06);padding:10px}.wf-detail-summary span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:1000}.wf-detail-summary b{display:block;margin-top:4px;font-size:13px;color:var(--ink);font-weight:1000;word-break:break-word}.wf-detail-chipbar{display:flex;gap:6px;flex-wrap:wrap}.wf-detail-section{border:1px solid var(--line);border-radius:15px;background:rgba(255,255,255,.72);padding:12px}.wf-detail-section h4{margin:0 0 10px;font-size:15px}.wf-detail-timeline{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.wf-reject-block{border:1px solid rgba(225,55,91,.25);border-radius:14px;background:#fff5f7;padding:10px 12px}.wf-reject-block b{color:#b12d4c}.wf-reject-block p{margin:5px 0 0!important;color:#7d2035!important;font-weight:850}
@media(max-width:1280px){.wf-pro-row{grid-template-columns:1fr}.wf-pro-actions{justify-content:flex-start}.wf-pro-actions .row-actions{justify-content:flex-start}.wf-detail-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.wf-detail-timeline{grid-template-columns:1fr}}
@media(max-width:640px){.wf-detail-summary{grid-template-columns:1fr}.wf-pro-head{align-items:flex-start;flex-direction:column}.wf-chip{max-width:100%;width:100%}}
[data-theme="dark"] .wf-pro-head,[data-theme="dark"] .wf-pro-row,[data-theme="dark"] .wf-chip,[data-theme="dark"] .wf-pro-reviewer,[data-theme="dark"] .wf-detail-section,[data-theme="dark"] .wf-detail-summary>div{background:rgba(12,30,55,.94);border-color:#244162;color:#edf5ff}[data-theme="dark"] .wf-pro-head b,[data-theme="dark"] .wf-pro-object,[data-theme="dark"] .wf-chip b,[data-theme="dark"] .wf-pro-reviewer b,[data-theme="dark"] .wf-detail-summary b{color:#fff}[data-theme="dark"] .wf-reject-block{background:rgba(225,55,91,.12);border-color:rgba(255,122,144,.26)}

/* V11 - clean approval workflow table */
.wf-simple-board{display:grid;gap:10px}
.wf-simple-head{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);border-radius:16px;background:linear-gradient(180deg,rgba(66,182,255,.07),rgba(255,255,255,.7));padding:10px 13px}
.wf-simple-head b{font-size:16px;font-weight:1000;color:var(--ink)}
.wf-simple-head span{border:1px solid rgba(255,189,74,.38);background:rgba(255,189,74,.12);border-radius:999px;padding:5px 10px;font-size:12px;font-weight:1000;color:#9b6500}
.wf-simple-table{min-width:1120px}
.wf-simple-table th{font-size:10px;letter-spacing:.08em;color:var(--muted);background:rgba(235,242,250,.92)}
.wf-simple-table td{vertical-align:middle;padding:11px 12px}
.wf-simple-table td b{display:block;font-weight:1000;color:var(--ink);line-height:1.25}
.wf-simple-table td small{display:block;margin-top:3px;color:var(--muted);font-size:11px;font-weight:850;line-height:1.25}
.wf-simple-row{border-left:4px solid #37d9ea}
.wf-simple-row.stage-final{border-left-color:#ffbd4a}
.wf-simple-row.stage-requester{border-left-color:#ff7a90}
.wf-active-cell{background:linear-gradient(180deg,rgba(55,217,234,.16),rgba(55,217,234,.05));box-shadow:inset 3px 0 0 #37d9ea}
.wf-returned-cell{background:linear-gradient(180deg,rgba(255,122,144,.13),rgba(255,122,144,.04));box-shadow:inset 3px 0 0 #ff7a90}
.wf-simple-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap;min-width:210px}
.wf-simple-actions .tool-btn{height:31px;border-radius:11px;font-size:11px;font-weight:1000;padding:0 10px}
.wf-simple-actions .tool-btn.compact{padding:0 9px}
.wf-simple-actions .ok-btn{border-color:rgba(31,203,129,.38)!important;background:rgba(31,203,129,.08)!important;color:#087c4c!important}
.affected-model-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
@media(max-width:980px){.wf-simple-table{min-width:920px}.wf-simple-actions{justify-content:flex-start}}
[data-theme="dark"] .wf-simple-head,[data-theme="dark"] .wf-simple-table td,[data-theme="dark"] .wf-active-cell,[data-theme="dark"] .wf-returned-cell{background:rgba(12,30,55,.92);border-color:#244162;color:#edf5ff}
[data-theme="dark"] .wf-simple-table td b,[data-theme="dark"] .wf-simple-head b{color:#fff}
[data-theme="dark"] .wf-simple-table th{background:#162b49;color:#bcd0ea}

/* V12: cleaner approval WF UX */
.wf-checker-cell[data-local-change-checker]{cursor:pointer;position:relative;transition:.15s ease}
.wf-checker-cell[data-local-change-checker]:hover{box-shadow:inset 0 0 0 1px rgba(52,211,235,.55);background:rgba(52,211,235,.08)!important}
.wf-checker-cell[data-local-change-checker] small::after{content:' ↗';font-weight:1000;color:#0891b2}
.wf-simple-actions{min-width:170px}
.wf-simple-actions .tool-btn.compact{min-width:78px}
.wf-detail-lean{display:grid;gap:10px}.wf-detail-lean h4{margin:0;font-size:16px}.wf-detail-lean .table{min-width:620px}.wf-detail-lean .table th,.wf-detail-lean .table td{padding:9px 11px}.wf-detail-lean .table td:first-child{width:210px;color:var(--muted);font-weight:950}
.wf-approver-list{display:grid;gap:8px;max-height:300px;overflow:auto;padding-right:2px}.wf-approver-option{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:13px;padding:10px 11px;background:rgba(66,182,255,.045);cursor:pointer}.wf-approver-option:hover{border-color:rgba(34,211,238,.65);background:rgba(34,211,238,.08)}.wf-approver-option input{width:17px;height:17px;accent-color:#22cde6}.wf-approver-option span{display:grid;gap:2px}.wf-approver-option b{font-size:13px;color:var(--ink)}.wf-approver-option small{font-size:11px;color:var(--muted);font-weight:850}
[data-theme="dark"] .wf-approver-option,[data-theme="dark"] .wf-detail-lean .table td{background:rgba(12,30,55,.92);border-color:#244162;color:#edf5ff}
[data-theme="dark"] .wf-approver-option b{color:#fff}

/* V15 Customer 360 dashboard compact single-row redesign */
.customer360-card{display:grid;gap:10px;border:1px solid var(--line);border-radius:18px;padding:12px;background:linear-gradient(180deg,rgba(78,231,231,.10),rgba(66,182,255,.04));box-shadow:0 10px 28px rgba(12,31,66,.06)}
.customer360-metrics{display:grid;grid-template-columns:minmax(0,1.16fr) minmax(0,.70fr) minmax(0,.82fr) minmax(0,.88fr);gap:10px;align-items:stretch}
.customer360-cell{min-width:0;border:1px solid rgba(66,182,255,.20);border-radius:14px;padding:clamp(9px,1vw,13px) clamp(10px,1.1vw,14px);background:rgba(255,255,255,.60);text-align:left;color:var(--ink);height:100%;overflow:hidden}
.customer360-cell span{display:block;font-size:clamp(8px,.72vw,11px);letter-spacing:.08em;text-transform:uppercase;font-weight:950;color:var(--muted);margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.customer360-cell b{display:block;font-size:clamp(16px,1.7vw,24px);line-height:1.12;font-weight:950;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.customer360-cell small{display:block;color:var(--muted);font-weight:750;margin-top:3px;font-size:clamp(10px,.85vw,13px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.customer360-main{background:linear-gradient(180deg,rgba(78,231,231,.16),rgba(255,255,255,.55));border-color:rgba(78,231,231,.55)}
.customer360-click,.customer360-top-card{cursor:pointer;font-family:inherit;appearance:none;-webkit-appearance:none}
.customer360-click:hover,.customer360-click:focus,.customer360-top-card:hover,.customer360-top-card:focus{border-color:var(--accent);box-shadow:0 0 0 1px rgba(78,231,231,.45),0 10px 22px rgba(66,182,255,.15);outline:none;transform:translateY(-1px)}
.customer360-top3{border:1px solid rgba(66,182,255,.16);border-radius:14px;padding:8px;background:rgba(255,255,255,.45);overflow:hidden}
.customer360-top-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-items:stretch}
.customer360-top-card{min-width:0;border:1px solid rgba(66,182,255,.18);border-radius:12px;padding:8px 10px;background:rgba(255,255,255,.68);text-align:left;color:var(--ink);display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;column-gap:8px;align-items:center;overflow:hidden}
.customer360-top-card.active{border-color:rgba(78,231,231,.85);background:linear-gradient(180deg,rgba(78,231,231,.20),rgba(255,255,255,.72))}
.customer360-top-card span{grid-row:1/3;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:999px;background:rgba(66,182,255,.12);color:var(--muted);font-size:11px;font-weight:1000}
.customer360-top-card b{display:block;font-size:clamp(13px,1.05vw,16px);line-height:1.12;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.customer360-top-card small{display:block;color:var(--muted);font-weight:800;margin-top:1px;font-size:clamp(10px,.82vw,12px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#customerPortfolioTable:empty{display:none}
@media(max-width:900px){.customer360-card{padding:9px}.customer360-metrics{gap:6px}.customer360-cell{border-radius:11px;padding:8px 7px}.customer360-cell b{font-size:14px}.customer360-cell small{font-size:9px}.customer360-top3{padding:6px}.customer360-top-list{gap:6px}.customer360-top-card{padding:7px 6px;column-gap:5px}.customer360-top-card span{width:22px;height:22px;font-size:10px}.customer360-top-card b{font-size:12px}.customer360-top-card small{font-size:9px}}
[data-theme="dark"] .customer360-card,[data-theme="dark"] .customer360-top3{background:rgba(12,30,55,.70);border-color:#244162}
[data-theme="dark"] .customer360-cell,[data-theme="dark"] .customer360-top-card{background:rgba(12,30,55,.92);border-color:#244162;color:#edf5ff}
[data-theme="dark"] .customer360-main,[data-theme="dark"] .customer360-top-card.active{background:linear-gradient(180deg,rgba(34,211,238,.18),rgba(12,30,55,.92));border-color:rgba(34,211,238,.55)}
[data-theme="dark"] .customer360-cell b,[data-theme="dark"] .customer360-top-card b{color:#fff}


/* v16 BOM lifecycle / discontinued WF */
.danger-soft-btn{border-color:rgba(255,122,144,.42)!important;background:rgba(255,122,144,.08)!important;color:#b12d4c!important}
.danger-soft-btn:disabled{opacity:.68;cursor:not-allowed;color:var(--muted)!important;background:rgba(120,150,190,.08)!important;border-color:var(--line)!important}
.bom-lifecycle-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}
.bom-lifecycle-strip>div{border:1px solid var(--line);border-radius:14px;background:linear-gradient(180deg,rgba(66,182,255,.08),rgba(255,255,255,.72));padding:10px 12px;min-height:66px}
.bom-lifecycle-strip span,.mini-info-grid span{display:block;font-size:10px;color:var(--muted);font-weight:1000;text-transform:uppercase;letter-spacing:.08em;margin-bottom:4px}
.bom-lifecycle-strip b,.mini-info-grid b{display:block;font-size:13px;font-weight:1000;color:var(--ink);line-height:1.22}
.bom-lifecycle-strip small{display:block;color:var(--muted);font-size:10.5px;font-weight:850;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bom-lifecycle-strip.lifecycle-pending>div:nth-child(4){border-color:rgba(255,189,74,.55);background:rgba(255,189,74,.10)}
.bom-lifecycle-strip.lifecycle-locked>div:nth-child(4){border-color:rgba(255,122,144,.45);background:rgba(255,122,144,.08)}
.mini-info-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:12px}
.mini-info-grid>div{border:1px solid var(--line);border-radius:13px;background:rgba(66,182,255,.06);padding:9px 10px}
.discontinue-wf-form{display:grid;gap:10px}
@media(max-width:900px){.bom-lifecycle-strip,.mini-info-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:560px){.bom-lifecycle-strip,.mini-info-grid{grid-template-columns:1fr;}}
[data-theme="dark"] .bom-lifecycle-strip>div,[data-theme="dark"] .mini-info-grid>div{background:rgba(12,30,55,.82);border-color:#244162}

/* v17 BOM approval lock + cleaner BOM table */
.compact-bom-warning .mini-wf-list{display:none!important}
.compact-bom-warning .table-wrap{margin-top:8px}
.compact-bom-warning .table th,.compact-bom-warning .table td{padding:9px 12px;vertical-align:middle}
.compact-bom-warning .row-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.bom-pretty-wrap{overflow:auto;border:1px solid var(--line);background:rgba(255,255,255,.62)}
.bom-full-field-table{min-width:1120px;table-layout:fixed;border-collapse:separate;border-spacing:0}
.bom-full-field-table th,.bom-full-field-table td{vertical-align:middle!important;padding:9px 10px!important;line-height:1.22}
.bom-full-field-table th{font-size:10.5px;text-align:left;white-space:nowrap}
.bom-full-field-table th:nth-child(1),.bom-full-field-table td:nth-child(1){width:150px}
.bom-full-field-table th:nth-child(2),.bom-full-field-table td:nth-child(2){width:150px}
.bom-full-field-table th:nth-child(3),.bom-full-field-table td:nth-child(3){width:150px}
.bom-full-field-table th:nth-child(4),.bom-full-field-table td:nth-child(4){width:90px;text-align:right}
.bom-full-field-table th:nth-child(5),.bom-full-field-table td:nth-child(5){width:95px;text-align:right}
.bom-full-field-table th:nth-child(6),.bom-full-field-table td:nth-child(6){width:120px;text-align:right}
.bom-full-field-table th:nth-child(7),.bom-full-field-table td:nth-child(7){width:75px;text-align:center}
.bom-full-field-table th:nth-child(8),.bom-full-field-table td:nth-child(8){width:120px;text-align:right}
.bom-full-field-table th:nth-child(9),.bom-full-field-table td:nth-child(9){width:120px;text-align:right;background:rgba(66,182,255,.045)}
.bom-full-field-table th:nth-child(10),.bom-full-field-table td:nth-child(10){width:82px;text-align:center}
.bom-full-field-table .bom-cell-text{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:850;color:var(--ink)}
.bom-full-field-table .bom-code-cell .bom-cell-text{color:#02738b;font-weight:1000}
.bom-full-field-table .num-cell .bom-cell-text,.bom-full-field-table .bom-price-cell .bom-cell-text,.bom-full-field-table .bom-size-cell .bom-cell-text,.bom-full-field-table .bom-weight-cell .bom-cell-text,.bom-full-field-table .bom-qty-cell .bom-cell-text{text-align:right;font-variant-numeric:tabular-nums}
.bom-full-field-table .bom-qty-cell .bom-cell-text{text-align:center}
.bom-full-field-table input.bom-cell-input{width:100%;height:30px;border-radius:10px;font-size:12px;text-align:inherit}
.bom-full-field-table td.num-cell input.bom-cell-input{text-align:right}
.bom-full-field-table td.bom-qty-cell input.bom-cell-input{text-align:center}
.bom-full-field-table .bom-amount-cell b{font-variant-numeric:tabular-nums;font-size:13px;color:var(--ink)}
.bom-lifecycle-strip.lifecycle-pending>div{box-shadow:inset 0 0 0 1px rgba(255,189,74,.12)}
[data-theme="dark"] .bom-pretty-wrap{background:rgba(12,30,55,.70);border-color:#244162}
[data-theme="dark"] .bom-full-field-table .bom-cell-text,[data-theme="dark"] .bom-full-field-table .bom-amount-cell b{color:#edf5ff}

/* v24: Material price edit mode */
.rate-edit-input{
  width:118px;
  max-width:100%;
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
  font-weight:900;
  color:var(--text);
  box-shadow:inset 0 1px 0 rgba(15,23,42,.04);
}
.rate-edit-input:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(52,211,235,.18);
}
.rate-edit-input.number-cell{text-align:right}
body.dark .rate-edit-input{background:rgba(15,23,42,.8);color:var(--text)}

/* v25 material price / excel import polish */
.import-command-row { flex-wrap: wrap; gap: 10px; }
.compact-version { white-space: nowrap; min-width: 54px; justify-content: center; }
.excel-import-preview h4 { margin: 14px 0 8px; }
.import-field-strip { margin-top: 10px; padding: 12px 14px; border: 1px solid rgba(37, 99, 235, .14); border-radius: 16px; background: rgba(236, 254, 255, .6); }
.rate-edit-input.number-cell { min-width: 110px; text-align: right; }
#ratesTable td:nth-child(6), #ratesTable td:nth-child(8), #ratesTable td:nth-child(9) { text-align: right; }
#ratesTable td:last-child { text-align: center; }

/* v27 Excel import preview: compact tabs + BOM master/detail */
.compact-import-summary { line-height: 1.55; }
.compact-import-purpose { margin: 10px 0 12px; }
.legacy-import-summary,
.compact-import-purpose { display: none; }
.import-tabs {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:10px 0 12px;
}
.import-tab {
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  font-weight:900;
  border-radius:999px;
  padding:9px 14px;
  cursor:pointer;
}
.import-tab.active {
  border-color:var(--accent);
  background:rgba(52,211,235,.16);
  color:var(--brand);
  box-shadow:0 8px 22px rgba(52,211,235,.12);
}
.import-tab-panel { display:none; }
.import-tab-panel.active { display:block; }
.import-detail-title {
  margin:4px 0 10px;
  padding:10px 12px;
  border:1px solid rgba(52,211,235,.35);
  border-radius:14px;
  background:rgba(236,254,255,.7);
}
.mini-btn { padding:8px 12px; min-height:34px; }
body.dark .import-tab { background:rgba(15,23,42,.78); }
body.dark .import-detail-title { background:rgba(52,211,235,.12); }

/* v28 BOM formula inspector + traceability polish */
.formula-mini-btn {
  margin-left: 6px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(6, 182, 212, .35);
  border-radius: 999px;
  background: rgba(236, 254, 255, .85);
  color: #00758f;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}
.formula-mini-btn:hover { background: #cffafe; box-shadow: 0 6px 16px rgba(6, 182, 212, .18); }
.bom-formula-clickable { cursor: help; position: relative; }
.bom-formula-target { outline: 2px solid #0ea5e9 !important; background: #e0f2fe !important; }
.bom-formula-related { outline: 2px solid #f59e0b !important; background: #fff7ed !important; }
.bom-pretty-table td[data-bom-cell="lineUnitPrice"],
.bom-pretty-table td[data-bom-cell="lineAmount"] { white-space: nowrap; }
.bom-cell-input { max-width: 170px; }

/* v29: BOM formula is opened by clicking the Unit price / Amount cell directly; no visible ƒ icon. */
.bom-formula-clickable {
  cursor: pointer;
}
.bom-formula-clickable:hover {
  background: rgba(236, 254, 255, .9) !important;
  box-shadow: inset 0 0 0 1px rgba(6, 182, 212, .28);
}

/* v30 - i18n polish + tech button hierarchy */
:root{
  --btn-glow: rgba(34,211,238,.22);
  --btn-border-tech: rgba(34,211,238,.34);
}
html[data-lang="vi"] body{font-family:Arial,"Segoe UI",Roboto,sans-serif;}
.card-head h3,.quotation-head h3,.mini-title b{font-size:15px;letter-spacing:-.01em;line-height:1.2;}
.card-kicker,.kicker,.mini-title span{font-size:10px;letter-spacing:.22em;font-weight:1000;color:#5574ff;text-transform:uppercase;}
.tool-btn,.btn-main,.chip-btn,.tab,.mini-select,.attach-btn{font-size:12px;letter-spacing:-.01em;}
.tool-btn,.chip-btn,.attach-btn{
  position:relative;
  border-color:rgba(64,120,190,.24);
  background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(244,250,255,.88));
  box-shadow:0 1px 0 rgba(255,255,255,.9) inset,0 8px 20px rgba(15,45,80,.06);
}
.tool-btn:before,.chip-btn:before,.attach-btn:before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
  background:linear-gradient(90deg,rgba(34,211,238,.22),rgba(96,165,250,.12),rgba(34,211,238,.04));
  opacity:.48;
  mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  padding:1px;
  -webkit-mask-composite:xor;
  mask-composite:exclude;
}
.btn-main{
  background:linear-gradient(135deg,#35c6f3 0%,#2ee7d2 100%);
  box-shadow:0 10px 24px rgba(34,211,238,.22),0 1px 0 rgba(255,255,255,.24) inset;
  border-color:rgba(255,255,255,.24);
  text-shadow:0 1px 0 rgba(0,0,0,.16);
}
.tool-btn:hover,.chip-btn:hover,.attach-btn:hover{
  border-color:var(--btn-border-tech);
  box-shadow:0 12px 28px var(--btn-glow),0 1px 0 rgba(255,255,255,.9) inset;
  transform:translateY(-1px);
}
.btn-main:hover{transform:translateY(-1px);filter:brightness(1.03);}
.toolbar-panel{gap:10px;padding:11px 12px;}
.toolbar-panel .tool-btn,.toolbar-panel .btn-main{height:38px;border-radius:13px;padding:0 13px;}
.table th{font-size:10px;letter-spacing:.075em;padding:9px 10px;}
.table td{font-size:12px;padding:8px 10px;}
.pill,.tag{font-size:10.5px;padding:4px 8px;}
.kpi-title,.metric span,.customer360-cell span{font-size:10.5px;letter-spacing:.08em;}
.kpi-number,.customer360-cell b{font-size:24px;line-height:1.05;}
.customer360-cell small,.kpi-note{font-size:10.5px;}
.form-grid label,.auth-label{font-size:10.5px;letter-spacing:.07em;}
input,select,textarea,.wide-input,.mini-select{font-size:12px;}
[data-theme="dark"] .tool-btn,[data-theme="dark"] .chip-btn,[data-theme="dark"] .attach-btn{
  background:linear-gradient(180deg,rgba(20,45,82,.92),rgba(13,31,62,.88));
  border-color:rgba(124,219,255,.20);
  box-shadow:0 1px 0 rgba(255,255,255,.06) inset,0 10px 24px rgba(0,0,0,.20);
}
[data-theme="dark"] .tool-btn:hover,[data-theme="dark"] .chip-btn:hover,[data-theme="dark"] .attach-btn:hover{border-color:rgba(34,211,238,.52);box-shadow:0 12px 28px rgba(34,211,238,.15);}
@media(max-width:1100px){.tool-btn,.btn-main,.chip-btn,.tab{font-size:11.5px}.card-head h3,.quotation-head h3{font-size:14px}.toolbar-panel .tool-btn,.toolbar-panel .btn-main{height:36px;padding:0 11px}}


/* v32 - Internal AI language + hierarchy polish */
.internal-ai-shell{min-height:calc(100vh - 260px)}
.internal-ai-topbar{padding:16px 18px;align-items:flex-start;}
.internal-ai-topbar h3{font-size:18px!important;font-weight:850;line-height:1.18;margin:3px 0 5px;letter-spacing:-.015em;}
.internal-ai-topbar p{font-size:12.5px;line-height:1.35;max-width:900px;font-weight:650;}
.internal-ai-topbar .action-strip{align-self:flex-start;}
.internal-quick-actions{padding:10px 14px;gap:8px;}
.internal-quick-actions .chip-btn{height:34px;border-radius:12px;padding:0 12px;font-size:11.5px;}
.internal-chat{min-height:400px;max-height:calc(100vh - 385px);padding:14px;}
.internal-compose{padding:11px 14px;}
.internal-compose .attach-btn,.internal-compose .btn-main{height:38px;border-radius:13px;font-size:11.8px;}
.internal-compose .guest-input{font-size:12.5px;line-height:1.35;min-height:38px;}
.internal-result-card .guest-result-title span{font-size:13px;font-weight:900;}
.internal-result-card .guest-result-title small{font-size:11.5px;line-height:1.35;}
.internal-section{margin-top:10px;padding:11px;border-radius:15px;}
.internal-section h4{font-size:13.5px;font-weight:900;margin-bottom:9px;}
.history-step.latest:before{content:attr(data-latest-label)!important;}
html[data-lang="vi"] .internal-ai-topbar h3,html[data-lang="vi"] .internal-ai-topbar p,html[data-lang="vi"] .internal-quick-actions .chip-btn{font-family:Arial,"Segoe UI",Roboto,sans-serif;}

/* V33 - professional compact modal system */
.modal-backdrop{padding:18px!important;backdrop-filter:blur(4px);background:rgba(2,10,25,.58)!important;align-items:center!important;justify-content:center!important;}
.modal{width:min(720px,calc(100vw - 38px));max-height:84vh!important;display:flex;flex-direction:column;padding:0!important;overflow:hidden!important;border-radius:22px!important;border:1px solid rgba(130,190,240,.34)!important;box-shadow:0 28px 70px rgba(0,15,40,.34), inset 0 1px 0 rgba(255,255,255,.35)!important;background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(246,252,255,.97))!important;}
.smart-modal-box.modal-wide,.modal.modal-wide{width:min(1080px,calc(100vw - 42px));}
.smart-modal-head,.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:18px 20px 14px;border-bottom:1px solid rgba(135,170,210,.28);background:linear-gradient(135deg,rgba(64,210,235,.10),rgba(75,124,255,.05));position:relative;}
.smart-modal-head:before,.modal-head:before{content:'';position:absolute;left:0;right:0;top:0;height:3px;background:linear-gradient(90deg,var(--primary),var(--accent),#7c8cff);}
.smart-modal-head>div,.modal-head>div{min-width:0;}
.smart-modal-head h3,.modal-head h3,.modal h3{margin:2px 0 0!important;font-size:20px!important;line-height:1.18!important;font-weight:1000;color:var(--ink);}
.smart-modal-head p,#modalMessage{margin:6px 0 0!important;color:var(--muted)!important;font-size:13px!important;line-height:1.42!important;font-weight:700;max-width:900px;}
#genericModalBox .modal-icon{display:none!important;}
.modal-x-close,.menu-close{flex:0 0 auto;width:34px;height:34px;border-radius:12px;border:1px solid rgba(118,166,210,.42);background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(235,247,255,.88));color:var(--ink);font-size:23px;font-weight:950;line-height:1;display:grid;place-items:center;cursor:pointer;box-shadow:0 9px 22px rgba(4,25,56,.08);}
.modal-x-close:hover,.menu-close:hover{border-color:rgba(34,211,238,.75);box-shadow:0 0 0 3px rgba(34,211,238,.16),0 12px 26px rgba(4,25,56,.12);transform:translateY(-1px);}
.smart-modal-body,#modalSuggestions{padding:16px 20px;max-height:calc(84vh - 150px)!important;overflow:auto!important;display:grid;gap:12px;}
.smart-modal-body:empty,#modalSuggestions:empty{display:none;}
.smart-modal-actions,.modal-actions{position:static!important;bottom:auto!important;margin:0!important;padding:12px 20px 16px!important;border-top:1px solid rgba(135,170,210,.24);background:linear-gradient(180deg,rgba(246,252,255,.82),rgba(255,255,255,.98))!important;display:flex!important;justify-content:flex-end!important;align-items:center!important;gap:10px!important;flex-wrap:wrap;min-height:58px;}
.modal-extra-actions{position:static!important;bottom:auto!important;margin:0!important;padding:0!important;background:transparent!important;display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;}
.modal-extra-actions.hidden{display:none!important;}
.smart-modal-actions .tool-btn,.smart-modal-actions .btn-main,.modal-actions .tool-btn,.modal-actions .btn-main{height:38px;border-radius:12px;padding:0 16px;font-size:12px;letter-spacing:.01em;}
.smart-modal-actions .btn-main,.modal-actions .btn-main{box-shadow:0 12px 28px rgba(34,211,238,.22);}
.formula-cell-modal,.quote-material-modal,.wf-approver-list{display:grid;gap:10px;}
.formula-line,.wf-approver-option,.modal-field-label,.suggestion{border:1px solid rgba(135,170,210,.32)!important;border-radius:15px!important;background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(240,250,255,.66))!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.65);}
.formula-line{padding:12px 14px!important;}
.wf-approver-list{max-height:min(360px,52vh);overflow:auto;padding-right:2px;}
.wf-approver-option{display:grid!important;grid-template-columns:auto 1fr;align-items:center;gap:12px;padding:12px 14px!important;margin:0!important;cursor:pointer;}
.wf-approver-option input{width:18px;height:18px;accent-color:var(--primary);}
.wf-approver-option b{display:block;font-size:13px;line-height:1.2;white-space:normal;}
.wf-approver-option small{display:block;margin-top:3px;color:var(--muted);font-size:11px;font-weight:800;}
.modal-field-label{padding:12px 14px!important;background:linear-gradient(180deg,rgba(66,182,255,.055),rgba(255,255,255,.86))!important;}
.modal-textarea{height:96px!important;min-height:96px!important;border-radius:12px!important;}
.auth-modal,.material-used-modal,.change-detail-modal{width:min(920px,calc(100vw - 42px));}
.auth-modal{width:min(520px,calc(100vw - 42px));}
.auth-modal .modal-icon{display:none;}
.auth-modal h3{margin-top:0!important;}
.material-used-modal .table-wrap,.change-detail-modal .table-wrap,.quote-material-modal .table-wrap{max-height:52vh;overflow:auto;}
[data-theme="dark"] .modal{background:linear-gradient(180deg,rgba(13,30,55,.98),rgba(9,22,43,.98))!important;border-color:rgba(116,219,255,.22)!important;}
[data-theme="dark"] .smart-modal-head,[data-theme="dark"] .modal-head{background:linear-gradient(135deg,rgba(31,166,210,.12),rgba(65,90,160,.08));border-bottom-color:rgba(116,219,255,.18);}
[data-theme="dark"] .smart-modal-actions,[data-theme="dark"] .modal-actions{background:linear-gradient(180deg,rgba(9,22,43,.82),rgba(9,22,43,.98))!important;border-top-color:rgba(116,219,255,.16);}
[data-theme="dark"] .modal-x-close,[data-theme="dark"] .menu-close,[data-theme="dark"] .formula-line,[data-theme="dark"] .wf-approver-option,[data-theme="dark"] .modal-field-label,[data-theme="dark"] .suggestion{background:linear-gradient(180deg,rgba(18,42,76,.96),rgba(12,31,59,.86))!important;border-color:rgba(116,219,255,.20)!important;color:#edf5ff;}
@media(max-width:760px){.modal-backdrop{padding:10px!important;align-items:flex-end!important}.modal,.modal.modal-wide,.smart-modal-box.modal-wide{width:100%!important;max-height:92vh!important;border-radius:18px 18px 0 0!important}.smart-modal-head,.modal-head{padding:14px 14px 11px}.smart-modal-body,#modalSuggestions{padding:12px 14px;max-height:calc(92vh - 140px)!important}.smart-modal-actions,.modal-actions{padding:10px 14px 12px!important}.modal-actions .tool-btn,.modal-actions .btn-main{height:36px;font-size:11px}}

/* V34 - popup/table/page UX refinement */
.page-jump-input{
  width:58px;height:34px;border:1px solid var(--line);border-radius:11px;background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(239,249,255,.88));
  color:var(--ink);font-weight:1000;text-align:center;outline:none;box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 6px 16px rgba(15,45,80,.05);
}
.page-jump-input:focus{border-color:rgba(34,211,238,.72);box-shadow:0 0 0 3px rgba(34,211,238,.16),inset 0 1px 0 rgba(255,255,255,.8)}
.page-jump-input::-webkit-outer-spin-button,.page-jump-input::-webkit-inner-spin-button{margin:0}
.page-total-note{display:flex;justify-content:flex-end;align-items:center;margin-top:8px;color:var(--muted);font-size:11px;font-weight:850;letter-spacing:.01em;}
.compact-pager{gap:6px}.compact-pager .tool-btn{height:34px;border-radius:11px;padding:0 11px;font-size:11px;}
.text-action{border:0;background:transparent;color:#087ea4;font-weight:1000;font-size:11.5px;cursor:pointer;padding:0 2px;text-decoration:none;white-space:nowrap;line-height:1.2;}
.text-action:hover{color:#0bbbd6;text-decoration:underline;text-underline-offset:3px;}
.table td .tool-btn,.table td .btn-main{height:auto;min-height:0;border:0;background:transparent!important;box-shadow:none!important;padding:0 2px;border-radius:0;color:#087ea4;font-size:11.5px;font-weight:1000;}
.table td .tool-btn:before,.table td .btn-main:before{display:none!important;}
.table td .tool-btn:hover,.table td .btn-main:hover{transform:none;filter:none;color:#0bbbd6;text-decoration:underline;text-underline-offset:3px;}
.compact-version{font-size:10.5px;padding:3px 8px!important;min-width:auto!important;background:rgba(66,182,255,.10)!important;color:#08739a!important;border-color:rgba(78,190,225,.34)!important;}
.quote-material-modal{gap:8px!important;}
.quote-material-modal .table th{font-size:9.8px;padding:8px 9px;}
.quote-material-modal .table td{font-size:11.8px;padding:7px 9px;}
.quote-material-modal .material-draft-input{height:31px;border-radius:9px;min-width:86px;font-size:11.5px;text-align:right;}
.quote-material-modal .material-draft-input.small{min-width:62px;}
.smart-modal-head,.modal-head{padding:15px 18px 12px!important;}
.smart-modal-head h3,.modal-head h3,.modal h3{font-size:18px!important;}
.smart-modal-head p,#modalMessage{font-size:12.2px!important;margin-top:4px!important;}
.smart-modal-body,#modalSuggestions{padding:14px 18px!important;gap:9px!important;}
.smart-modal-actions,.modal-actions{min-height:52px!important;padding:10px 18px 13px!important;}
#modalKicker.hidden{display:none!important;}
[data-theme="dark"] .page-jump-input{background:linear-gradient(180deg,rgba(20,45,82,.92),rgba(13,31,62,.88));color:#fff;border-color:rgba(124,219,255,.22)}
[data-theme="dark"] .text-action,[data-theme="dark"] .table td .tool-btn,[data-theme="dark"] .table td .btn-main{color:#6eeaff;}
[data-theme="dark"] .text-action:hover,[data-theme="dark"] .table td .tool-btn:hover,[data-theme="dark"] .table td .btn-main:hover{color:#b6fbff;}
[data-theme="dark"] .page-total-note{color:#a9c4e7;}

/* V37 - Login polish, material master aggregation, wider usage popup */
.login-pro-modal{
  width:min(760px,calc(100vw - 42px))!important;
  padding:0!important;
  overflow:hidden!important;
  border:1px solid rgba(88,216,240,.28)!important;
  box-shadow:0 32px 90px rgba(0,14,39,.38), inset 0 1px 0 rgba(255,255,255,.42)!important;
}
.login-pro-modal:before{content:"";display:block;height:4px;background:linear-gradient(90deg,var(--primary),var(--accent),#7c8cff)}
.auth-hero{display:grid;grid-template-columns:68px minmax(0,1fr);gap:16px;align-items:center;padding:24px 26px 14px;background:linear-gradient(135deg,rgba(56,211,235,.12),rgba(84,115,255,.06))}
.auth-icon{width:64px;height:64px;border-radius:22px;display:grid;place-items:center;background:linear-gradient(135deg,#2fbcea,#49e1d8);color:#fff;font-weight:1000;font-size:20px;box-shadow:0 16px 38px rgba(37,187,224,.28)}
.login-pro-modal .auth-hero h3{font-size:25px!important;margin:3px 0 4px!important;letter-spacing:-.02em}
.login-pro-modal .auth-hero p{margin:0!important;max-width:520px;color:var(--muted);font-weight:700}
.auth-demo-line{margin:0 26px 12px;padding:9px 12px;border:1px solid rgba(80,160,220,.20);border-radius:14px;background:rgba(66,182,255,.07);color:var(--muted);font-size:12px;font-weight:800}
.login-pro-modal .auth-label{margin:10px 26px 0!important;display:grid!important;gap:6px;color:var(--muted);font-size:11px!important;letter-spacing:.08em;text-transform:uppercase;font-weight:950}
.login-pro-modal .wide-input{height:46px;border-radius:14px;font-size:15px;background:linear-gradient(180deg,#fff,#f9fcff);box-shadow:inset 0 1px 0 rgba(255,255,255,.8)}
.auth-help-row{margin:10px 26px 0;display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:12px;color:var(--muted);font-weight:800}
.auth-help-row .link-btn{height:auto;border:0;background:transparent;color:#007da8;font-weight:950;text-decoration:none;cursor:pointer;padding:0}
.auth-help-row .link-btn:hover{text-decoration:underline;color:#00a5c9}
.login-pro-modal #loginResult{margin:12px 26px 0}.auth-actions{padding:16px 26px 24px!important;border-top:0!important;background:transparent!important}.auth-actions .tool-btn,.auth-actions .btn-main{min-width:112px;height:42px}
html[data-theme=dark] .login-pro-modal{background:#0d1d33!important;border-color:rgba(110,228,255,.24)!important}html[data-theme=dark] .auth-hero{background:linear-gradient(135deg,rgba(42,198,232,.15),rgba(78,99,215,.08))}html[data-theme=dark] .auth-demo-line{background:rgba(71,195,236,.08);border-color:rgba(110,228,255,.18)}html[data-theme=dark] .login-pro-modal .wide-input{background:#0f2540;color:#f4f9ff;border-color:rgba(120,210,255,.25)}
.material-price-summary.compact-material-hint{display:flex;align-items:center;gap:10px;margin:0 0 12px;padding:9px 12px;border:1px solid rgba(255,180,80,.28);border-radius:14px;background:rgba(255,248,232,.68);color:#845300;font-size:12px;font-weight:850}.material-price-summary.compact-material-hint .pill{flex:0 0 auto}
#ratesTable .text-action{border:0;background:transparent;padding:0;color:#007c9b;font-weight:950;cursor:pointer;text-decoration:none}#ratesTable .text-action:hover{text-decoration:underline;color:#00a9c8}#ratesTable .link-btn{font-weight:1000;color:#00809b}.compact-version{padding:3px 8px!important;font-size:10.5px!important}.page-total-note{text-align:right;margin-top:10px;color:var(--muted);font-weight:850;font-size:12px}
.material-used-modal{width:min(1540px,calc(100vw - 38px))!important;max-height:92vh!important;padding:0!important;overflow:hidden!important}.material-used-modal .modal-head{padding:16px 20px 12px!important}.material-used-modal #materialUsedSummary{padding:14px 20px 8px}.material-used-modal #materialUsedTable{padding:0 20px 12px}.material-used-modal .table-wrap{max-height:64vh!important;overflow:auto}.material-used-modal .table{min-width:1320px!important}.material-used-modal .modal-actions{padding:10px 20px 16px!important}
@media(max-width:760px){.login-pro-modal{width:100%!important}.auth-hero{grid-template-columns:1fr;padding:20px}.auth-demo-line,.login-pro-modal .auth-label,.auth-help-row,.login-pro-modal #loginResult{margin-left:20px;margin-right:20px}.auth-actions{padding:14px 20px 20px!important}.material-used-modal{width:100%!important;max-height:92vh!important;border-radius:18px 18px 0 0!important}}
/* v38 material price master: unified usage drilldown + clean version history */
.material-used-modal .table{min-width:1520px!important}
.material-used-modal #materialUsedSummary .compact-summary-grid{grid-template-columns:1.2fr .8fr .8fr 1fr}
.version-link{font-weight:950;color:var(--primary);text-decoration:none}
.version-link:hover{text-decoration:underline;text-underline-offset:3px}
.history-panel .empty-focused-state{margin-top:8px;padding:18px;border:1px dashed var(--line);border-radius:16px;background:rgba(66,182,255,.06);font-weight:850;color:var(--muted)}
.history-panel h4{margin:12px 0 8px;font-size:15px}

/* V Material architecture fix: keep Material Master and BOM Usage separate */
.material-code-warnings{display:flex;gap:5px;flex-wrap:wrap;margin-top:4px}.material-code-warning{font-size:10px;padding:3px 7px}.missing-material-link b{color:#116caa}.material-usage-table .usage-warning-row td{background:rgba(66,182,255,.055)}.usage-cell-flag{display:block;margin:-9px -11px;padding:9px 11px;border-radius:9px;min-height:30px}.missing-material-code-cell{background:rgba(255,232,236,.92)!important;color:#a11e3a!important;font-weight:950}.missing-qty-cell{background:rgba(255,248,214,.98)!important;color:#925d00!important;font-weight:950}.missing-unit-price-cell{background:rgba(255,232,236,.92)!important;color:#a11e3a!important;font-weight:950}.missing-amount-cell{background:rgba(255,239,220,.98)!important;color:#9b5200!important;font-weight:950}.usage-status-tags{display:flex;gap:5px;flex-wrap:wrap;align-items:center}.material-used-modal .material-usage-table{min-width:1460px!important}.material-used-modal #materialUsedSummary small{display:block;margin-top:3px;color:var(--muted);font-size:10.5px;font-weight:850}.change-detail-modal{width:min(1760px,calc(100vw - 42px))!important;max-height:92vh!important}.change-detail-modal #changeDetailSummary{padding:14px 20px 8px}.change-detail-modal #changeDetailTable{padding:0 20px 12px;overflow:auto}.change-detail-modal #changeDetailTable .table-wrap{max-height:64vh!important;overflow:auto}.change-detail-modal #changeDetailTable .table{min-width:1320px!important}.smart-modal-box.modal-wide,.modal.modal-wide{width:min(1760px,calc(100vw - 42px))!important}.smart-modal-box.modal-wide .table,.modal.modal-wide .table{min-width:1200px}
[data-theme="dark"] .material-usage-table .usage-warning-row td{background:rgba(66,182,255,.10)}[data-theme="dark"] .missing-material-code-cell,[data-theme="dark"] .missing-unit-price-cell{background:rgba(150,42,64,.30)!important;color:#ffdce4!important}[data-theme="dark"] .missing-qty-cell,[data-theme="dark"] .missing-amount-cell{background:rgba(165,105,20,.28)!important;color:#ffe6b5!important}


/* v39: Popup table usability - sticky headers and reliable 2-axis scrolling. */
.smart-modal-box,
.modal-box,
.material-used-modal,
.change-detail-modal {
  max-width: min(96vw, 1760px);
}

.smart-modal-body .table-wrap,
.modal .table-wrap,
.modal-body .table-wrap,
#materialUsedTable.table-wrap,
#changeDetailTable.table-wrap,
.material-used-modal .table-wrap,
.change-detail-modal .table-wrap,
.excel-import-preview .table-wrap,
.quote-material-modal .table-wrap,
.history-panel .table-wrap {
  max-width: 100%;
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.smart-modal-body .table-wrap,
.modal-body .table-wrap,
.excel-import-preview .table-wrap,
.quote-material-modal .table-wrap,
.history-panel .table-wrap {
  max-height: min(62vh, 620px);
}

#materialUsedTable.table-wrap,
#changeDetailTable.table-wrap {
  max-height: calc(92vh - 230px) !important;
}

.smart-modal-body .table,
.modal .table,
.modal-body .table,
.material-used-modal .table,
.change-detail-modal .table,
.excel-import-preview .table,
.quote-material-modal .table,
.history-panel .table {
  width: max-content;
  min-width: 100%;
}

.material-used-modal #materialUsedTable .table,
#materialUsedTable .table {
  min-width: 1680px !important;
}

.change-detail-modal #changeDetailTable .table,
#changeDetailTable .table {
  min-width: 1320px !important;
}

.smart-modal-body .table th,
.modal .table th,
.modal-body .table th,
.material-used-modal .table th,
.change-detail-modal .table th,
.excel-import-preview .table th,
.quote-material-modal .table th,
.history-panel .table th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--panel-solid, #edf3fa);
  box-shadow: 0 1px 0 var(--line, #d7e4f2);
}

.smart-modal-body .table td,
.smart-modal-body .table th,
.modal .table td,
.modal .table th,
.modal-body .table td,
.modal-body .table th,
.material-used-modal .table td,
.material-used-modal .table th,
.change-detail-modal .table td,
.change-detail-modal .table th {
  white-space: nowrap;
}

.material-used-modal .usage-status-tags,
.material-used-modal .line-breakable,
.change-detail-modal .line-breakable {
  white-space: normal;
}

html[data-theme="dark"] .smart-modal-body .table th,
html[data-theme="dark"] .modal .table th,
html[data-theme="dark"] .modal-body .table th,
html[data-theme="dark"] .material-used-modal .table th,
html[data-theme="dark"] .change-detail-modal .table th,
html[data-theme="dark"] .excel-import-preview .table th,
html[data-theme="dark"] .quote-material-modal .table th,
html[data-theme="dark"] .history-panel .table th {
  background: #172b49;
}

/* v40 material/BOM data quality alignment with Excel BOM sheet */
.tag.attention{background:#fff1d6!important;color:#b45309!important;border:1px solid rgba(180,83,9,.20)!important;font-weight:950}
[data-theme="dark"] .tag.attention{background:rgba(180,83,9,.20)!important;color:#ffd29a!important;border-color:rgba(255,190,110,.28)!important}
.pa-price-value{display:flex;justify-content:center;align-items:center;width:100%;min-width:70px;text-align:center;font-weight:900;color:var(--ink)}
.pa-price-value.pa-price-invalid{color:#b45309!important;background:rgba(255,241,214,.72);border-radius:10px;padding:5px 8px}
.invalid-pa-price-cell{background:rgba(255,241,214,.92)!important;color:#b45309!important;font-weight:950}
.invalid-pa-price-bom{background:rgba(255,241,214,.64)!important;color:#b45309!important}
#ratesTable .table td:nth-child(5),
#ratesTable .table th:nth-child(5),
.material-usage-table td:nth-child(9),
.material-usage-table th:nth-child(9),
.bom-full-field-table td:nth-child(6),
.bom-full-field-table th:nth-child(6){text-align:center}
.material-usage-table .usage-status-tags .tag.attention{font-size:10.5px;letter-spacing:.05px}


/* v41 Material price UX cleanup: compact status, balanced columns, clear Plastic/AL label */
.material-toolbar{gap:10px;}
.material-toolbar #materialStatusFilter{margin-left:18px;min-width:250px;max-width:320px;}
#ratesTable .table{min-width:1280px;}
#ratesTable .table td{font-size:12.8px;line-height:1.28;}
#ratesTable .table td:nth-child(1){width:150px;}
#ratesTable .table td:nth-child(1) .material-drill,
#ratesTable .table td:nth-child(1) .material-drill b{font-size:14px!important;font-weight:850!important;letter-spacing:.01em;}
#ratesTable .table td:nth-child(3),
#ratesTable .table td:nth-child(4),
#ratesTable .table td:nth-child(5),
#ratesTable .table td:nth-child(6),
#ratesTable .table td:nth-child(7),
#ratesTable .table td:nth-child(8){font-size:13px;}
#ratesTable .table td:nth-child(3),
#ratesTable .table td:nth-child(4),
#ratesTable .table td:nth-child(5){text-align:center;}
#ratesTable .table td:nth-child(6),
#ratesTable .table td:nth-child(7){text-align:right;}
#ratesTable .usage-status-tags.compact-status-tags{justify-content:flex-start;gap:0;}
#ratesTable .usage-status-tags.compact-status-tags .tag.attention,
.material-usage-table .usage-status-tags.compact-status-tags .tag.attention{color:#b45309;background:#fff2d6;border:1px solid #fdba74;font-weight:950;}
#ratesTable .tag.attention{font-size:11.2px;padding:5px 10px;}
#ratesTable .material-new-code{min-width:132px;font-weight:900;}
#ratesTable .material-new-unit{min-width:96px;}
#ratesTable .material-new-price{min-width:112px;text-align:right;}
#ratesTable .danger-link{color:#b45309!important;}
.material-usage-table td{font-size:12.7px;}
.material-usage-table td:nth-child(7),
.material-usage-table td:nth-child(8),
.material-usage-table td:nth-child(9),
.material-usage-table td:nth-child(10),
.material-usage-table td:nth-child(11),
.material-usage-table td:nth-child(12){font-size:13px;}
.material-usage-table td:nth-child(7),
.material-usage-table td:nth-child(8),
.material-usage-table td:nth-child(9),
.material-usage-table td:nth-child(11){text-align:center;}

/* v42: Model/BOM table, Material Price and Material cost visual alignment */
/* Model/BOM detail: keep values readable and vertically aligned without making Amount oversized. */
.bom-pretty-table.bom-full-field-table{min-width:1120px;table-layout:auto;}
.bom-pretty-table.bom-full-field-table th{font-size:10.4px;padding:10px 12px;line-height:1.18;vertical-align:middle;}
.bom-pretty-table.bom-full-field-table td{font-size:13.2px;padding:11px 12px;line-height:1.22;vertical-align:middle;}
.bom-pretty-table.bom-full-field-table .bom-code-cell b,
.bom-pretty-table.bom-full-field-table .bom-cell-text{font-size:13.2px;font-weight:900;line-height:1.22;}
.bom-pretty-table.bom-full-field-table .num-cell,
.bom-pretty-table.bom-full-field-table .bom-amount-cell{text-align:right;font-variant-numeric:tabular-nums;}
.bom-pretty-table.bom-full-field-table .bom-size-cell,
.bom-pretty-table.bom-full-field-table .bom-weight-cell,
.bom-pretty-table.bom-full-field-table .pa-price-col,
.bom-pretty-table.bom-full-field-table .bom-qty-cell{text-align:center;}
.bom-pretty-table.bom-full-field-table .bom-line-amount-view{font-size:14px;font-weight:950;line-height:1.22;}

/* Material Price main table: material code should not dominate Used models. */
#ratesTable .table td:nth-child(1){width:142px;}
#ratesTable .table td:nth-child(1) .material-drill,
#ratesTable .table td:nth-child(1) .material-drill b{font-size:13px!important;font-weight:900!important;line-height:1.18!important;letter-spacing:0!important;}
#ratesTable .table td:nth-child(8) .text-action{font-size:13px!important;font-weight:950!important;}
#ratesTable .table td:nth-child(2){font-size:12.8px;}

/* Material cost modal: align numeric cells directly under headers. */
.quote-material-modal .table{min-width:1080px;}
.quote-material-modal .table th,
.quote-material-modal .table td{vertical-align:middle!important;line-height:1.2!important;}
.quote-material-modal .table th:nth-child(3),
.quote-material-modal .table th:nth-child(4),
.quote-material-modal .table th:nth-child(5),
.quote-material-modal .table th:nth-child(6),
.quote-material-modal .table th:nth-child(7),
.quote-material-modal .table th:nth-child(8),
.quote-material-modal .table td:nth-child(3),
.quote-material-modal .table td:nth-child(4),
.quote-material-modal .table td:nth-child(5),
.quote-material-modal .table td:nth-child(6),
.quote-material-modal .table td:nth-child(7),
.quote-material-modal .table td:nth-child(8){text-align:right;font-variant-numeric:tabular-nums;}
.quote-material-modal .table th:nth-child(5),
.quote-material-modal .table th:nth-child(6),
.quote-material-modal .table td:nth-child(5),
.quote-material-modal .table td:nth-child(6){text-align:center;}
.quote-material-modal .material-draft-input{display:block;margin:0 auto;height:32px;line-height:32px;text-align:right;font-variant-numeric:tabular-nums;}
.quote-material-modal .material-draft-input.small{text-align:center;}

/* v43: requested UX cleanup for Material Price, Formula profiles and editable BOM lines */
#ratesTable .table{table-layout:fixed;min-width:1360px;}
#ratesTable .table th,#ratesTable .table td{vertical-align:middle;}
#ratesTable .table th:nth-child(1),#ratesTable .table td:nth-child(1){width:150px;}
#ratesTable .table th:nth-child(2),#ratesTable .table td:nth-child(2){width:150px;}
#ratesTable .table th:nth-child(3),#ratesTable .table td:nth-child(3),
#ratesTable .table th:nth-child(4),#ratesTable .table td:nth-child(4),
#ratesTable .table th:nth-child(5),#ratesTable .table td:nth-child(5){width:118px;text-align:center;font-variant-numeric:tabular-nums;}
#ratesTable .table th:nth-child(6),#ratesTable .table td:nth-child(6),
#ratesTable .table th:nth-child(7),#ratesTable .table td:nth-child(7){width:138px;text-align:right;font-variant-numeric:tabular-nums;}
#ratesTable .table th:nth-child(8),#ratesTable .table td:nth-child(8){width:120px;text-align:center;}
#ratesTable .table th:nth-child(9),#ratesTable .table td:nth-child(9){width:126px;text-align:center;}
#ratesTable .table th:nth-child(10),#ratesTable .table td:nth-child(10){width:110px;text-align:center;}
#ratesTable .table td:nth-child(1) .material-drill,
#ratesTable .table td:nth-child(1) .material-drill b{font-size:12.4px!important;line-height:1.16!important;white-space:normal;text-align:left;word-break:break-word;}
.warning-status-btn{border:0;background:transparent;padding:0;margin:0;cursor:pointer;}
.warning-status-btn .tag{box-shadow:0 6px 16px rgba(180,83,9,.10);}
.warning-status-btn:hover .tag{text-decoration:underline;text-underline-offset:3px;filter:brightness(1.03);}
.formula-profile-table{min-width:1180px;}
.formula-profile-table td{vertical-align:middle;}
.formula-select-orb{width:34px;height:34px;border-radius:999px;border:2px solid rgba(20,120,255,.35);background:linear-gradient(180deg,#fff,#f2f8ff);cursor:pointer;position:relative;box-shadow:inset 0 1px 0 rgba(255,255,255,.9);}
.formula-select-orb:after{content:"";position:absolute;inset:7px;border-radius:999px;background:transparent;transition:.16s ease;}
.formula-select-orb.active{border-color:#1684ff;box-shadow:0 0 0 4px rgba(22,132,255,.10);}
.formula-select-orb.active:after{background:#1684ff;}
.formula-margin-chip{display:inline-flex;align-items:center;justify-content:center;min-width:112px;border-radius:999px;padding:7px 11px;font-size:11.5px;font-weight:1000;font-variant-numeric:tabular-nums;}
.formula-margin-chip.target{background:linear-gradient(180deg,rgba(34,211,238,.16),rgba(22,132,255,.08));color:#00698a;border:1px solid rgba(34,160,220,.24);}
.formula-margin-chip.min{background:rgba(255,248,232,.92);color:#925d00;border:1px solid rgba(245,158,11,.25);}
.formula-used-link{font-size:12.5px!important;}
.bom-pretty-table .bom-action-cell{text-align:center;width:72px;}
.bom-pretty-table .bom-cell-input{width:100%;min-width:74px;text-align:center;font-variant-numeric:tabular-nums;}
.bom-pretty-table [data-bom-field="partCode"],
.bom-pretty-table [data-bom-field="materialCode"],
.bom-pretty-table [data-bom-field="partName"]{text-align:left;}

/* Market input forecast: customer/user provided aluminium index, no external LME fetch. */
.market-forecast-panel {
  margin: 14px 0 16px;
  padding: 14px;
  border: 1px solid rgba(125, 179, 224, 0.34);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(232, 246, 255, 0.94), rgba(255, 255, 255, 0.9));
  box-shadow: 0 10px 24px rgba(7, 43, 92, 0.06);
}
.market-forecast-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.market-forecast-head b {
  display: block;
  color: #06235a;
  font-size: 15px;
  letter-spacing: .03em;
}
.market-forecast-head small {
  display: block;
  margin-top: 3px;
  color: #557098;
  font-size: 12px;
  line-height: 1.35;
}
.market-forecast-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(130px, .8fr) minmax(140px, .8fr) minmax(130px, .7fr) auto;
  gap: 10px;
  align-items: end;
}
.market-forecast-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #4e6a94;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.market-forecast-grid input,
.market-forecast-grid select {
  min-height: 40px;
  border: 1px solid #cce0f5;
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
  color: #08285e;
  font-weight: 800;
  font-size: 14px;
}
.market-forecast-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}
.market-forecast-result {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.market-forecast-result div {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(202, 223, 244, 0.8);
}
.market-forecast-result span {
  display: block;
  color: #557098;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.market-forecast-result b {
  display: block;
  margin-top: 4px;
  color: #002253;
  font-size: 16px;
}
.guest-forecast-card .guest-kpi b {
  font-size: 15px;
}
@media (max-width: 1000px) {
  .market-forecast-grid,
  .market-forecast-result {
    grid-template-columns: 1fr 1fr;
  }
  .market-forecast-actions {
    justify-content: flex-start;
  }
}

/* v43 Market forecast comparison tables */
.market-forecast-result-table {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}
.market-forecast-result-table .table-wrap {
  margin: 0;
  border-radius: 14px;
  overflow-x: auto;
}
.market-forecast-result-table .table th,
.market-forecast-result-table .table td {
  padding: 9px 12px;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1.25;
}
.market-forecast-result-table .table th {
  font-size: 11px;
  letter-spacing: .07em;
  white-space: nowrap;
}
.market-forecast-result-table .table td:nth-child(n+3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.market-forecast-result-table .mini-section-title {
  margin: 4px 0 -4px;
  color: #06235a;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .03em;
}
.guest-forecast-card .table-wrap {
  margin: 8px 0 10px;
  max-width: 100%;
  overflow-x: auto;
}
.guest-forecast-card .table th,
.guest-forecast-card .table td {
  padding: 9px 12px;
  font-size: 13px;
  vertical-align: middle;
}
.guest-forecast-card .table td:nth-child(n+2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* v44 Market Forecast compact integration into formula table */
.market-forecast-panel {
  padding: 12px 14px;
}
.market-forecast-grid {
  grid-template-columns: minmax(145px, .8fr) minmax(125px, .65fr) minmax(145px, .7fr) minmax(145px, .7fr) auto;
}
.market-forecast-compact {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 9px;
}
.forecast-mini-card {
  border: 1px solid rgba(196, 221, 245, .92);
  background: rgba(255, 255, 255, .78);
  border-radius: 14px;
  padding: 9px 11px;
  min-height: 62px;
}
.forecast-mini-card span {
  display: block;
  color: #557098;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.forecast-mini-card b {
  display: block;
  margin-top: 4px;
  color: #06235a;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
.forecast-mini-card small {
  display: block;
  margin-top: 3px;
  color: #597095;
  font-size: 11.5px;
  font-weight: 800;
}
.forecast-mini-card.highlight {
  background: linear-gradient(180deg, rgba(236, 254, 255, .92), rgba(255,255,255,.86));
  border-color: rgba(34, 211, 238, .38);
}
.forecast-mini-card.final {
  background: linear-gradient(180deg, rgba(240, 253, 250, .95), rgba(255,255,255,.88));
  border-color: rgba(45, 212, 191, .44);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 8px 18px rgba(20, 184, 166, .08);
}
.compact-note {
  margin-top: 10px;
  padding: 9px 12px;
}
.formula-fc-cell {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 128px;
  width: 100%;
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.formula-fc-main small {
  display: block;
  color: #557098;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.formula-fc-main b {
  color: #007a91;
  font-size: 14px;
}
.formula-fc-sub {
  color: #58729b;
  font-size: 10.5px;
  font-weight: 800;
}
.formula-fc-delta {
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 900;
  background: rgba(239, 246, 255, .9);
}
.formula-fc-delta.down {
  color: #0369a1;
  background: rgba(224, 242, 254, .95);
}
.formula-fc-delta.up {
  color: #b45309;
  background: rgba(255, 251, 235, .95);
}
.formula-material-amount.formula-fc-cell {
  text-decoration: none !important;
  border: 1px solid rgba(34, 211, 238, .28);
  border-radius: 12px;
  padding: 6px 8px;
  background: linear-gradient(180deg, rgba(236,254,255,.9), rgba(255,255,255,.78));
}
.formula-fc-breakdown-cell {
  gap: 1px;
  min-width: 0;
}
.formula-fc-breakdown-cell .formula-fc-main small {
  font-size: 8.5px;
  letter-spacing: .04em;
}
.formula-fc-breakdown-cell .formula-fc-main b {
  font-size: 13px;
}
.formula-fc-breakdown-cell .formula-fc-sub {
  font-size: 9px;
}
.formula-fc-breakdown-cell .formula-fc-delta {
  padding: 1px 5px;
  font-size: 9px;
}
.forecast-diff {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.forecast-diff small {
  font-size: 10px;
  opacity: .82;
}
.forecast-diff.down { color: #0369a1; }
.forecast-diff.up { color: #b45309; }
.forecast-material-modal .table-wrap {
  margin-bottom: 14px;
  overflow-x: auto;
}
.forecast-material-modal .table th,
.forecast-material-modal .table td {
  white-space: nowrap;
}
@media (max-width: 1200px) {
  .market-forecast-compact {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

/* v45 Forecast UI clean-up: no repeated input table, FC integrated in formula/material detail */
.market-forecast-inline{
  display:grid;
  grid-template-columns:repeat(3,minmax(160px,1fr));
  gap:9px;
  margin-top:10px;
}
.market-forecast-inline>div{
  border:1px solid rgba(196,221,245,.92);
  background:rgba(255,255,255,.78);
  border-radius:13px;
  padding:9px 11px;
  min-height:56px;
}
.market-forecast-inline>div.highlight{
  background:linear-gradient(180deg,rgba(236,254,255,.95),rgba(255,255,255,.88));
  border-color:rgba(34,211,238,.42);
}
.market-forecast-inline span{
  display:block;
  color:#557098;
  font-size:10.5px;
  font-weight:900;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.market-forecast-inline b{
  display:block;
  margin-top:4px;
  color:#06235a;
  font-size:14.5px;
  font-variant-numeric:tabular-nums;
}
.forecast-material-summary{
  display:grid;
  grid-template-columns:repeat(3,minmax(180px,1fr));
  gap:10px;
  margin:8px 0 10px;
}
.forecast-material-summary>div{
  border:1px solid rgba(196,221,245,.92);
  background:rgba(255,255,255,.82);
  border-radius:13px;
  padding:10px 12px;
}
.forecast-material-summary>div.highlight{
  background:linear-gradient(180deg,rgba(236,254,255,.96),rgba(255,255,255,.88));
  border-color:rgba(34,211,238,.42);
}
.forecast-material-summary span{
  display:block;
  color:#557098;
  font-size:10.5px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.forecast-material-summary b{
  display:block;
  margin-top:4px;
  color:#06235a;
  font-size:15px;
  font-variant-numeric:tabular-nums;
}
.forecast-material-modal .table{min-width:1580px;}
.forecast-material-modal .table th,
.forecast-material-modal .table td{font-size:11.5px!important;padding:7px 9px!important;vertical-align:middle!important;}
.forecast-material-modal .table td:nth-child(n+3){text-align:right;font-variant-numeric:tabular-nums;}
.forecast-material-modal .table td:nth-child(1),
.forecast-material-modal .table td:nth-child(2){text-align:left;}
.formula-fc-cell .formula-fc-main b{font-size:14.5px;}
.quote-insight-card.final b{font-variant-numeric:tabular-nums;}
@media(max-width:1000px){.market-forecast-inline,.forecast-material-summary{grid-template-columns:1fr;}}

/* v46 Price Quotation forecast compact row */
.market-forecast-panel-compact{
  padding:11px 12px;
  margin:12px 0 14px;
}
.market-forecast-panel-compact .market-forecast-head{
  margin-bottom:9px;
  align-items:center;
}
.market-forecast-panel-compact .market-forecast-head b{font-size:14px;}
.market-forecast-panel-compact .market-forecast-head small{
  font-size:11.3px;
  line-height:1.25;
}
.market-forecast-grid-compact{
  display:grid;
  grid-template-columns:minmax(112px,.78fr) minmax(100px,.62fr) minmax(108px,.68fr) minmax(132px,.82fr) minmax(112px,.64fr) minmax(148px,.92fr) minmax(150px,.78fr);
  gap:7px;
  align-items:stretch;
}
.market-forecast-grid-compact label,
.market-forecast-readout{
  min-width:0;
  border:1px solid rgba(196,221,245,.92);
  background:rgba(255,255,255,.82);
  border-radius:12px;
  padding:7px 8px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
}
.market-forecast-grid-compact label{
  color:#557098;
  font-size:9.8px;
  font-weight:950;
  letter-spacing:.055em;
  text-transform:uppercase;
}
.market-forecast-grid-compact input,
.market-forecast-grid-compact select{
  min-height:30px;
  height:30px;
  border-radius:9px;
  padding:4px 7px;
  font-size:12.3px;
  font-weight:900;
}
.market-forecast-readout span{
  color:#557098;
  font-size:9.8px;
  font-weight:950;
  letter-spacing:.055em;
  text-transform:uppercase;
  white-space:nowrap;
}
.market-forecast-readout b{
  color:#06235a;
  font-size:12.6px;
  font-weight:1000;
  line-height:1.15;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.market-forecast-readout.highlight{
  background:linear-gradient(180deg,rgba(236,254,255,.98),rgba(255,255,255,.9));
  border-color:rgba(34,211,238,.42);
}
.market-forecast-grid-compact .market-forecast-actions{
  display:grid;
  grid-template-columns:1fr;
  gap:6px;
  align-content:center;
}
.market-forecast-grid-compact .market-forecast-actions .tool-btn,
.market-forecast-grid-compact .market-forecast-actions .btn-main{
  height:30px;
  min-height:30px;
  border-radius:9px;
  padding:0 9px;
  font-size:11px;
}
.market-forecast-note{
  margin-top:8px;
  margin-bottom:0;
  padding:8px 10px;
}
@media(max-width:1050px){
  .market-forecast-grid-compact{
    grid-template-columns:repeat(3,minmax(150px,1fr));
  }
  .market-forecast-grid-compact .market-forecast-actions{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:820px){
  .market-forecast-grid-compact{grid-template-columns:1fr;}
  .market-forecast-grid-compact .market-forecast-actions{grid-template-columns:1fr;}
}

/* Customer PO quotation totals: USD-only public view */
.guest-result-card .guest-po-result-table{width:100%;min-width:1320px;table-layout:fixed}
.guest-po-result-table .guest-po-col-model{width:13%}
.guest-po-result-table .guest-po-col-name{width:13%}
.guest-po-result-table .guest-po-col-qty{width:6%}
.guest-po-result-table .guest-po-col-quote{width:10%}
.guest-po-result-table .guest-po-col-total{width:10.5%}
.guest-po-result-table .guest-po-col-status{width:8.5%}
.guest-po-result-table .guest-po-col-note{width:39%}
.guest-po-result-table th:nth-child(-n+6),
.guest-po-result-table td:nth-child(-n+6){white-space:nowrap}
.guest-po-result-table th:nth-child(3),
.guest-po-result-table th:nth-child(4),
.guest-po-result-table th:nth-child(5),
.guest-po-result-table td:nth-child(3),
.guest-po-result-table td:nth-child(4),
.guest-po-result-table td:nth-child(5){text-align:right;font-variant-numeric:tabular-nums}
.guest-po-result-table th:nth-child(6),
.guest-po-result-table td:nth-child(6){text-align:center}
.guest-po-result-table td:nth-child(1),
.guest-po-result-table td:nth-child(2){font-size:12.9px;font-weight:760}
.guest-po-result-table td:nth-child(1) .guest-model-history{color:#0d2f69!important;font-weight:900}
.guest-po-result-table td:nth-child(7){font-size:10.2px;line-height:1.22;color:var(--muted);font-weight:620;overflow-wrap:anywhere}
.guest-result-card .table tbody tr.guest-missing-price-row td{background:transparent;border-color:rgba(150,170,200,.22);color:inherit}
.guest-result-card .table tbody tr.guest-missing-price-row td:first-child{box-shadow:none}
.guest-price-missing{display:inline;color:#c77700;font-weight:850;white-space:nowrap;background:transparent;border:0;padding:0;min-height:0;border-radius:0}
.guest-po-total-bar{display:grid;grid-template-columns:13fr 13fr 6fr 10fr 10.5fr 8.5fr 39fr;gap:0;align-items:center;margin-top:12px;padding:10px 0;border-top:1px solid rgba(190,207,228,.9);background:transparent;min-width:0}
.guest-po-total-spacer{min-height:1px}
.guest-po-total-value{grid-column:5;display:grid;gap:3px;padding:0 11px;text-align:right;align-self:stretch;align-content:center}
.guest-po-total-value span{font-size:11px;color:var(--muted);font-weight:700;white-space:nowrap}
.guest-po-total-value b{font-size:20px;color:#001844;letter-spacing:-.02em;white-space:nowrap;font-variant-numeric:tabular-nums}
.guest-po-total-note{grid-column:6 / 8;display:flex;align-items:center;padding:0 14px 0 14px;font-size:10px;line-height:1.24;color:var(--muted);font-weight:620}
html[data-theme=dark] .guest-result-card .table tbody tr.guest-missing-price-row td{background:transparent;color:inherit;border-color:rgba(150,170,200,.22)}
html[data-theme=dark] .guest-price-missing{background:transparent;color:#ffd071}
html[data-theme=dark] .guest-po-total-value b{color:#fff}
html[data-theme=dark] .guest-po-total-note{color:#b8c9e8}
@media(max-width:760px){.guest-po-total-bar{grid-template-columns:1fr;padding:12px 0}.guest-po-total-spacer{display:none}.guest-po-total-value,.guest-po-total-note{grid-column:1;padding:0;text-align:left}.guest-po-total-note{margin-top:8px}.guest-po-total-value b{font-size:19px}}

/* v48 Guest PO readability: sticky header and single status indicator */
.guest-po-table-wrap{
  position:relative;
  isolation:isolate;
  scrollbar-gutter:stable;
}
.guest-po-table-wrap .guest-po-result-table thead th{
  position:sticky;
  top:0;
  z-index:6;
  background:var(--paper);
  box-shadow:inset 0 -1px 0 var(--line),0 4px 10px rgba(7,25,54,.10);
}
.guest-value-empty{
  display:inline-block;
  min-width:10px;
  color:var(--muted);
  font-weight:750;
  text-align:center;
}
html[data-theme=dark] .guest-po-table-wrap .guest-po-result-table thead th{
  background:var(--paper);
  box-shadow:inset 0 -1px 0 var(--line),0 4px 12px rgba(0,0,0,.28);
}

/* v49 Guest PO professional table typography and depth */
.guest-po-table-wrap .guest-po-result-table thead th{
  min-height:44px;
  padding:12px 12px!important;
  border-left:0!important;
  border-right:0!important;
  border-top:0!important;
  border-bottom:2px solid rgba(74,211,235,.72)!important;
  background:linear-gradient(180deg,#1c467c 0%,#123563 58%,#0d2b55 100%)!important;
  color:#fff!important;
  font-size:11.5px!important;
  font-weight:950!important;
  line-height:1.18!important;
  letter-spacing:.055em;
  text-transform:uppercase;
  white-space:normal!important;
  vertical-align:middle!important;
  text-shadow:0 1px 1px rgba(0,0,0,.22);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18),inset 0 -1px 0 rgba(0,0,0,.18),0 5px 14px rgba(4,26,61,.20)!important;
}
.guest-po-table-wrap .guest-po-result-table thead th:first-child{border-top-left-radius:12px}
.guest-po-table-wrap .guest-po-result-table thead th:last-child{border-top-right-radius:12px}
.guest-po-result-table tbody td{
  padding:11px 12px!important;
  font-size:12.8px!important;
  line-height:1.28!important;
  vertical-align:middle!important;
}
.guest-po-result-table td:nth-child(1),
.guest-po-result-table td:nth-child(2){font-size:13.2px!important}
.guest-po-result-table td:nth-child(3),
.guest-po-result-table td:nth-child(4),
.guest-po-result-table td:nth-child(5){font-size:13px!important;font-weight:760}
.guest-po-result-table td:nth-child(7){font-size:10.9px!important;line-height:1.3!important;font-weight:620}
.guest-po-result-table .tag.danger{
  background:#fff0d9!important;
  border:1px solid #efb55e!important;
  color:#b85f00!important;
  box-shadow:0 3px 9px rgba(202,113,13,.12);
  font-weight:900!important;
}
.guest-po-result-table .tag.published{
  box-shadow:0 3px 9px rgba(26,143,90,.10);
}
html[data-theme=dark] .guest-po-table-wrap .guest-po-result-table thead th{
  background:linear-gradient(180deg,#254d82 0%,#173966 58%,#102d51 100%)!important;
  color:#fff!important;
}
html[data-theme=dark] .guest-po-result-table .tag.danger{
  background:#4a3217!important;
  border-color:#9a672b!important;
  color:#ffd18a!important;
}


/* V32 - Guest PO status color and chat avatars */
.guest-chat-full .guest-chat-bubble{position:relative}
.guest-chat-full .guest-chat-bubble-ai:not(.result-msg){margin-left:56px}
.guest-chat-full .guest-chat-bubble-ai.result-msg{margin-left:56px;max-width:calc(100% - 56px)}
.guest-chat-full .guest-chat-bubble-user{margin-right:56px}
.guest-chat-full .guest-chat-bubble-ai::before,
.guest-chat-full .guest-chat-bubble-user::after{
  content:'';
  position:absolute;
  top:10px;
  width:36px;
  height:36px;
  border-radius:50%;
  display:grid;
  place-items:center;
  font-size:16px;
  font-weight:900;
  box-shadow:0 10px 22px rgba(15,42,82,.16), inset 0 1px 0 rgba(255,255,255,.55);
}
.guest-chat-full .guest-chat-bubble-ai::before{
  content:'AI';
  left:-50px;
  color:#fff;
  background:linear-gradient(135deg,#123f7a 0%, #1d66b3 58%, #35d1df 100%);
  border:1px solid rgba(18,78,132,.28);
  letter-spacing:.04em;
}
.guest-chat-full .guest-chat-bubble-user::after{
  content:'👤';
  right:-50px;
  color:#0d2f69;
  background:linear-gradient(135deg,#ffffff 0%, #eaf4ff 100%);
  border:1px solid #c9d9ee;
  font-size:17px;
}
.guest-chat-full .ai-msg.result-msg::before{top:14px}
.guest-po-result-table .tag.danger{
  background:linear-gradient(180deg,#fff1df 0%, #ffe5c1 100%)!important;
  border:1px solid #f1b25b!important;
  color:#c46f00!important;
  box-shadow:0 4px 10px rgba(217,133,19,.16)!important;
  font-weight:950!important;
}
.guest-result-actions .tag.danger,
.guest-result-card .tag.danger{
  background:linear-gradient(180deg,#fff2e2 0%,#ffe8c7 100%);
  border-color:#efb55e;
  color:#c46f00;
  font-weight:950;
}
.guest-result-card .table td:nth-child(3),
.guest-result-card .table td:nth-child(4),
.guest-result-card .table td:nth-child(5),
.guest-result-card .table td .money{font-variant-numeric:tabular-nums}
html[data-theme=dark] .guest-chat-full .guest-chat-bubble-ai::before{
  background:linear-gradient(135deg,#14355f 0%, #1c568f 58%, #1fa8b4 100%);
  border-color:#35639c;
}
html[data-theme=dark] .guest-chat-full .guest-chat-bubble-user::after{
  background:linear-gradient(135deg,#10233c 0%, #183452 100%);
  border-color:#35577f;
  color:#dfeeff;
}
html[data-theme=dark] .guest-po-result-table .tag.danger,
html[data-theme=dark] .guest-result-actions .tag.danger,
html[data-theme=dark] .guest-result-card .tag.danger{
  background:linear-gradient(180deg,#563615 0%, #472a0b 100%)!important;
  border-color:#b77d32!important;
  color:#ffd18a!important;
}
@media(max-width:900px){
  .guest-chat-full .guest-chat-bubble-ai:not(.result-msg),
  .guest-chat-full .guest-chat-bubble-ai.result-msg,
  .guest-chat-full .guest-chat-bubble-user{margin-left:0;margin-right:0;max-width:100%}
  .guest-chat-full .guest-chat-bubble-ai::before,
  .guest-chat-full .guest-chat-bubble-user::after{display:none}
}

/* V33 - Model/BOM Product + Packing workspace */
.model-bom-directory-card{margin-bottom:14px}
.model-bom-directory-head{display:grid!important;grid-template-columns:minmax(190px,240px) minmax(340px,1fr) auto;gap:14px;align-items:center}
.model-bom-directory-title{min-width:0}.model-bom-directory-title h3{margin:2px 0 0}.model-bom-directory-actions{justify-content:flex-end;flex-wrap:nowrap}
.depth-btn{box-shadow:0 8px 18px rgba(17,57,112,.10),inset 0 1px 0 rgba(255,255,255,.7)}
.depth-btn:hover{transform:translateY(-1px);box-shadow:0 11px 24px rgba(17,57,112,.15),inset 0 1px 0 rgba(255,255,255,.75)}
.model-bom-workspace-card{overflow:hidden;border-color:#cfdff1;box-shadow:0 18px 44px rgba(26,60,103,.10)}
.model-bom-workspace-head{display:grid;grid-template-columns:auto minmax(320px,1fr) auto;gap:14px;align-items:center;padding:12px 14px;border-bottom:1px solid #d8e5f3;background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)}
.model-bom-switcher{display:inline-grid;grid-template-columns:1fr 1fr;gap:5px;padding:4px;border:1px solid #cbdced;border-radius:15px;background:#edf4fb;box-shadow:inset 0 1px 3px rgba(34,67,107,.08)}
.model-bom-switch{min-width:126px;height:42px;border:0;border-radius:11px;background:transparent;color:#52698c;font-size:13.5px;font-weight:850;display:flex;align-items:center;justify-content:center;gap:8px;cursor:pointer;transition:.18s ease}
.model-bom-switch:hover{color:#0d3d78;background:rgba(255,255,255,.72)}
.model-bom-switch.active{color:#fff;background:linear-gradient(180deg,#174b91 0%,#0a326b 100%);box-shadow:0 8px 18px rgba(9,48,106,.22),inset 0 1px 0 rgba(255,255,255,.2)}
.model-bom-switch .switch-icon{font-size:16px;line-height:1}.model-bom-context{min-width:0;display:flex;align-items:center;gap:16px;padding:0 4px}
.model-bom-context>div{min-width:0;display:grid;gap:2px}.model-bom-context span{font-size:10.5px;color:#6c81a2;font-weight:750}.model-bom-context b{font-size:13.5px;color:#0a2c61;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.model-bom-context .context-divider{width:1px;height:30px;background:#dbe6f2;flex:0 0 1px}
.model-bom-action-zone{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:nowrap}.model-bom-action-zone .tool-btn,.model-bom-action-zone .btn-main{height:38px;white-space:nowrap}
.packing-ai-btn{background:linear-gradient(180deg,#25c4ef 0%,#129ed5 100%);box-shadow:0 10px 22px rgba(22,163,210,.24),inset 0 1px 0 rgba(255,255,255,.36)}
.model-bom-pane{background:#f7fbff}.model-bom-section-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:15px 16px 10px;background:#fff}.model-bom-section-head h3{margin:2px 0 0}.model-bom-pane-body{padding:0 16px 16px}
.packing-context-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 16px;border-bottom:1px solid #dce7f3;background:#fff}
.packing-scenario-group{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.packing-scenario-group>span{font-size:11px;font-weight:850;color:#647a9c;margin-right:2px}.packing-scenario-chip{height:34px;border:1px solid #d1deee;border-radius:10px;background:#fff;color:#415a7f;padding:0 14px;font-weight:800;cursor:pointer;box-shadow:0 4px 10px rgba(31,63,103,.05)}
.packing-scenario-chip:hover{border-color:#77b8eb;transform:translateY(-1px)}.packing-scenario-chip.active{background:linear-gradient(180deg,#163f7d,#0b2f65);color:#fff;border-color:#153d75;box-shadow:0 7px 15px rgba(11,47,101,.18)}
.packing-plan-meta{display:flex;align-items:center;gap:8px;color:#496080;font-weight:800}.packing-plan-meta>span:first-child{color:#0b3068}
.packing-summary-grid{display:grid;grid-template-columns:repeat(6,minmax(150px,1fr));gap:10px;padding:14px 16px 12px}
.packing-summary-card{min-width:0;display:grid;grid-template-columns:38px minmax(0,1fr);gap:10px;align-items:center;padding:12px;border:1px solid #d7e4f2;border-radius:14px;background:#fff;box-shadow:0 8px 19px rgba(26,62,103,.055),inset 0 1px 0 rgba(255,255,255,.8)}
.packing-summary-icon{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;font-weight:950;font-size:17px;background:#e9f3ff;color:#1965b0}.packing-summary-card.cyan .packing-summary-icon{background:#e7fbff;color:#0b96b1}.packing-summary-card.green .packing-summary-icon{background:#e9faf0;color:#1f8b52}.packing-summary-card.purple .packing-summary-icon{background:#f2ebff;color:#7c48c9}.packing-summary-card.amber .packing-summary-icon{background:#fff4df;color:#c37600}.packing-summary-card.teal .packing-summary-icon{background:#e8faf7;color:#198c7a}
.packing-summary-card>div{min-width:0}.packing-summary-card span:not(.packing-summary-icon){display:block;color:#6e82a1;font-size:10.5px;font-weight:750}.packing-summary-card b{display:block;margin-top:4px;color:#0a2b61;font-size:13.3px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
.packing-inline-input,.packing-cost-input,.packing-qty-input{height:30px;border:1px solid #83bfe8;border-radius:8px;background:#fff;color:#0b2e63;font-weight:850;padding:0 8px;outline:none;box-shadow:0 0 0 3px rgba(40,174,223,.08)}.packing-inline-input{width:104px}.packing-cost-input{width:120px;text-align:right}.packing-qty-input{width:68px;text-align:right}
.packing-main-grid{display:grid;grid-template-columns:minmax(0,2.15fr) minmax(300px,.85fr);gap:12px;padding:0 16px 16px}.packing-bom-panel,.packing-insight-card{border:1px solid #d7e4f2;border-radius:15px;background:#fff;box-shadow:0 9px 22px rgba(24,57,99,.055);overflow:hidden}
.packing-panel-head,.packing-insight-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 14px;border-bottom:1px solid #e0eaf4}.packing-panel-head h3,.packing-insight-head h3{margin:2px 0 0;font-size:15px}.packing-readonly-note{font-size:10.5px;color:#7186a5;font-weight:750;background:#f1f6fb;border:1px solid #d7e4f0;border-radius:999px;padding:6px 10px}
.packing-bom-table-wrap{max-height:380px;margin:0!important;border:0!important;border-radius:0!important}.packing-bom-table{min-width:960px}.packing-bom-table thead th{position:sticky;top:0;z-index:3;background:linear-gradient(180deg,#f3f7fc,#eaf1f9);color:#435e84;border-bottom:1px solid #ccdbea;font-size:10.8px;font-weight:900;white-space:nowrap}.packing-bom-table td{font-size:11.8px;padding:9px 10px!important;vertical-align:middle}.packing-bom-table td:nth-child(1),.packing-bom-table td:nth-child(3){white-space:nowrap}.packing-bom-table .number-cell{text-align:right;font-variant-numeric:tabular-nums}.packing-component-link{font-weight:900;color:#0c4e91}
.packing-cost-strip{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));border-top:1px solid #dce7f2;background:#f8fbff}.packing-cost-strip>div{padding:12px 14px;border-right:1px solid #e1eaf4}.packing-cost-strip>div:last-child{border-right:0}.packing-cost-strip span{display:block;color:#6d82a2;font-size:10.5px;font-weight:750}.packing-cost-strip b{display:block;margin-top:4px;color:#0b2f66;font-size:13.2px;font-weight:900;font-variant-numeric:tabular-nums}.packing-cost-strip .total{background:linear-gradient(180deg,#edf7ff,#e6f2ff)}.packing-cost-strip .total b{color:#0871c8;font-size:15px}
.packing-insight-stack{display:grid;gap:12px;align-content:start}.fit-score{border:1px solid #8ed9b0;background:#edfbf3;color:#198554;border-radius:999px;padding:5px 9px;font-size:12px;font-weight:950}.packing-fit-grid{display:grid;grid-template-columns:112px 1fr;gap:9px 10px;padding:13px 14px}.packing-fit-grid span,.packing-formula-grid span{color:#7083a1;font-size:10.8px;font-weight:750}.packing-fit-grid b,.packing-formula-grid b{color:#17335f;font-size:11.5px;text-align:right;font-variant-numeric:tabular-nums}.packing-check-list{display:grid;gap:7px;padding:0 14px 14px}.packing-check-list span{font-size:11px;color:#25694b;font-weight:720}.packing-check-list .warn{color:#ae6d07}.packing-formula-grid{display:grid;grid-template-columns:1fr auto;gap:10px;padding:13px 14px}.packing-formula-grid .formula-price{color:#0873cd;font-size:14px}
.packing-suggest-layout{display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:14px}.packing-candidate-list{display:grid;gap:10px}.packing-candidate-card{position:relative;display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px;padding:12px;border:1px solid #d6e3f1;border-radius:14px;background:#fff}.packing-candidate-card.recommended{border-color:#47a9ef;box-shadow:0 0 0 3px rgba(48,168,235,.10),0 12px 28px rgba(20,77,136,.09)}.candidate-rank{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#e9f4ff;color:#0b6ab8;font-weight:950}.recommended .candidate-rank{background:#137fda;color:#fff}.candidate-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.candidate-head span{display:block;font-size:10.5px;color:#27865d;font-weight:850}.candidate-head b{display:block;margin-top:3px;color:#102f64}.candidate-head strong{color:#0c65b7;border:1px solid #9fcdf0;border-radius:8px;padding:4px 7px;font-size:11px}.candidate-metrics{display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));gap:8px;margin:10px 0}.candidate-metrics>div{padding:8px;background:#f7faff;border-radius:9px}.candidate-metrics span,.packing-profile-used span{display:block;font-size:9.8px;color:#7185a3;font-weight:750}.candidate-metrics b,.packing-profile-used b{display:block;margin-top:3px;font-size:11px;color:#17345f}.candidate-reasons{display:flex;gap:14px;flex-wrap:wrap;color:#27714e;font-size:10.5px;font-weight:720}.candidate-actions{display:flex;gap:8px;margin-top:10px}.candidate-actions .btn-main,.candidate-actions .tool-btn{height:34px}.packing-profile-used{border:1px solid #d7e4f2;border-radius:14px;background:#f8fbff;padding:13px;align-self:start}.packing-profile-used h4{margin:0 0 10px}.packing-profile-used>div{padding:8px 0;border-bottom:1px solid #e2ebf5}.packing-profile-used>div:last-child{border-bottom:0}
.packing-formula-drilldown{display:grid;gap:0;border:1px solid #d7e4f2;border-radius:12px;overflow:hidden}.packing-formula-drilldown>div{display:flex;justify-content:space-between;gap:14px;padding:10px 12px;border-bottom:1px solid #e2ebf4}.packing-formula-drilldown>div:last-child{border-bottom:0}.packing-formula-drilldown span{color:#657c9d;font-size:11px}.packing-formula-drilldown b{color:#15325f;font-variant-numeric:tabular-nums}.packing-formula-drilldown .final{background:#eef7ff}.packing-formula-drilldown .final b{color:#0873cd;font-size:14px}
html[data-theme=dark] .model-bom-workspace-head,html[data-theme=dark] .model-bom-section-head,html[data-theme=dark] .packing-context-row{background:#0d2038;border-color:#29466d}.model-bom-workspace-card html[data-theme=dark]{background:#071525}html[data-theme=dark] .model-bom-pane{background:#071525}html[data-theme=dark] .model-bom-context b,html[data-theme=dark] .packing-summary-card b,html[data-theme=dark] .packing-cost-strip b,html[data-theme=dark] .packing-fit-grid b,html[data-theme=dark] .packing-formula-grid b{color:#eaf3ff}html[data-theme=dark] .packing-summary-card,html[data-theme=dark] .packing-bom-panel,html[data-theme=dark] .packing-insight-card{background:#0f223b;border-color:#2a476d}html[data-theme=dark] .packing-cost-strip{background:#0b1c31;border-color:#29466d}html[data-theme=dark] .packing-cost-strip .total{background:#123151}
@media(max-width:1450px){.model-bom-workspace-head{grid-template-columns:auto minmax(260px,1fr)}.model-bom-action-zone{grid-column:1 / -1;justify-content:flex-start}.packing-summary-grid{grid-template-columns:repeat(3,minmax(180px,1fr))}}
@media(max-width:1050px){.model-bom-directory-head{grid-template-columns:1fr}.model-bom-directory-actions{justify-content:flex-start;flex-wrap:wrap}.model-bom-workspace-head{grid-template-columns:1fr}.model-bom-context{order:2;overflow:auto}.model-bom-action-zone{order:3}.packing-main-grid{grid-template-columns:1fr}.packing-summary-grid{grid-template-columns:repeat(2,minmax(170px,1fr))}.packing-suggest-layout{grid-template-columns:1fr}.candidate-metrics{grid-template-columns:repeat(2,minmax(120px,1fr))}}
@media(max-width:650px){.model-bom-switcher{width:100%}.model-bom-switch{min-width:0}.model-bom-context{gap:10px}.model-bom-context .context-divider{display:none}.packing-summary-grid{grid-template-columns:1fr}.packing-cost-strip{grid-template-columns:1fr 1fr}.packing-context-row{align-items:flex-start;flex-direction:column}.candidate-metrics{grid-template-columns:1fr}}
/* V33.1 - compact selected-model context to avoid duplicate header hierarchy */
.model-bom-context{min-width:0!important;display:grid!important;grid-template-columns:auto auto minmax(0,1fr);gap:8px!important;align-items:center;padding:8px 11px!important;border:1px solid #d5e3f1;border-radius:12px;background:#f6f9fd;box-shadow:inset 0 1px 0 rgba(255,255,255,.8)}
.model-bom-context .model-context-caption{font-size:10px!important;text-transform:uppercase;letter-spacing:.06em;color:#7185a3!important;font-weight:800!important;white-space:nowrap}
.model-bom-context>b{font-size:13.5px!important;color:#0a2f68!important;white-space:nowrap}
.model-context-meta{min-width:0;display:flex!important;align-items:center;gap:7px;color:#607798!important;font-size:11px!important;font-weight:750!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.model-context-meta i{font-style:normal;color:#9aabc0}
html[data-theme=dark] .model-bom-context{background:#10233c;border-color:#2c4a70}html[data-theme=dark] .model-bom-context>b{color:#edf6ff!important}
@media(max-width:1050px){.model-bom-context{order:2!important;overflow:visible!important;width:max-content;max-width:100%}}
/* V34 - Production Packaging Engine links, Pallet Catalog and formula drilldowns */
.packing-loading-state,.packing-empty-state{margin:16px;padding:28px;border:1px solid #d4e3f2;border-radius:18px;background:linear-gradient(135deg,#fff 0%,#f3f9ff 100%);box-shadow:0 12px 28px rgba(23,62,108,.07)}
.packing-loading-state{display:flex;align-items:center;gap:12px;color:#264d7d}.packing-empty-state{display:grid;grid-template-columns:54px minmax(0,1fr) auto;gap:18px;align-items:center}.packing-empty-icon{width:52px;height:52px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(145deg,#dff4ff,#e8efff);color:#0b6db8;font-size:23px;box-shadow:inset 0 1px 0 #fff}.packing-empty-state h3{margin:3px 0 7px;color:#0c2e61}.packing-empty-state p{margin:0;color:#657b9c;line-height:1.5}.packing-empty-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.packing-pallet-detail-link{max-width:100%;font-weight:950;color:#0b5da3;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.packing-price-link{color:#0b67af;font-weight:850;text-decoration-style:dotted;text-underline-offset:3px}.packing-amount-link{color:#0a315f;text-decoration:none}.packing-price-link:hover,.packing-amount-link:hover,.packing-pallet-detail-link:hover{color:#09a5c7}.packing-bom-table tbody tr:hover td{background:#f6fbff}.packing-bom-table td:nth-child(6),.packing-bom-table td:nth-child(7){font-variant-numeric:tabular-nums}
.pallet-detail-summary{display:grid;grid-template-columns:repeat(5,minmax(130px,1fr));gap:10px;margin-bottom:12px}.pallet-detail-summary>div{padding:11px 12px;border:1px solid #d8e5f2;border-radius:12px;background:#f7fbff}.pallet-detail-summary span{display:block;color:#7185a3;font-size:10px;font-weight:750}.pallet-detail-summary b{display:block;margin-top:4px;color:#103263;font-size:12.5px;font-weight:900;font-variant-numeric:tabular-nums}.pallet-catalog-code{font-weight:950;color:#0a4f91}.packing-profile-form{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:12px;margin-bottom:15px}.packing-profile-form label{display:grid;gap:6px;color:#526b8e;font-size:11px;font-weight:800}.packing-profile-form input[type=number]{height:40px;border:1px solid #c9dbed;border-radius:10px;padding:0 11px;color:#0c2e62;font-weight:850;background:#fff;outline:none}.packing-profile-form input[type=number]:focus{border-color:#39addf;box-shadow:0 0 0 3px rgba(45,174,224,.12)}.packing-profile-form .packing-check-input{display:flex;align-items:center;gap:8px;align-self:end;height:40px;padding:0 11px;border:1px solid #d5e3f1;border-radius:10px;background:#f7fbff}.candidate-reasons .warn{color:#b46c00}
html[data-theme=dark] .packing-loading-state,html[data-theme=dark] .packing-empty-state{background:linear-gradient(135deg,#10243e,#0b1b30);border-color:#2b4b73}html[data-theme=dark] .packing-empty-state h3,html[data-theme=dark] .pallet-detail-summary b{color:#eef6ff}html[data-theme=dark] .pallet-detail-summary>div,html[data-theme=dark] .packing-profile-form .packing-check-input{background:#10243e;border-color:#2b4b73}html[data-theme=dark] .packing-profile-form input[type=number]{background:#0c1c31;border-color:#31527a;color:#eef6ff}
@media(max-width:1100px){.packing-empty-state{grid-template-columns:54px 1fr}.packing-empty-actions{grid-column:1/-1;justify-content:flex-start}.pallet-detail-summary{grid-template-columns:repeat(2,minmax(130px,1fr))}.packing-profile-form{grid-template-columns:repeat(2,minmax(150px,1fr))}}
@media(max-width:650px){.packing-empty-state{grid-template-columns:1fr}.packing-empty-icon{display:none}.pallet-detail-summary,.packing-profile-form{grid-template-columns:1fr}}

/* V35 - production Pallet Catalog and code convention */
.packing-code-convention{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 12px;padding:11px 14px;border:1px solid #cfe0f4;border-radius:14px;background:linear-gradient(135deg,#f5f9fe,#edf7ff);color:#29456e;font-size:11px;line-height:1.35}
.packing-code-convention b{color:#082e68;font-size:12px}
.packing-code-convention span{padding-left:12px;border-left:1px solid #c6d8ee}
.pallet-detail-summary{grid-template-columns:repeat(auto-fit,minmax(145px,1fr))}
html[data-theme=dark] .packing-code-convention{background:linear-gradient(135deg,#10243e,#132d4b);border-color:#294b75;color:#c4d7ef}
html[data-theme=dark] .packing-code-convention b{color:#fff}
html[data-theme=dark] .packing-code-convention span{border-left-color:#35577f}
@media(max-width:760px){.packing-code-convention{display:grid}.packing-code-convention span{padding-left:0;border-left:0}}

/* V36 - searchable centralized Pallet Catalog */
.pallet-catalog-toolbar{display:grid;grid-template-columns:minmax(220px,1.5fr) minmax(160px,.8fr) minmax(150px,.7fr) auto;gap:10px;align-items:end;margin:0 0 12px;padding:12px;border:1px solid #d4e2f1;border-radius:14px;background:#f8fbff}
.pallet-catalog-toolbar label{display:grid;gap:5px;color:#647b9d;font-size:10.5px;font-weight:800}.pallet-catalog-toolbar input,.pallet-catalog-toolbar select{height:38px;border:1px solid #cbdced;border-radius:10px;background:#fff;color:#0d315f;padding:0 11px;font-weight:780;outline:none}.pallet-catalog-toolbar input:focus,.pallet-catalog-toolbar select:focus{border-color:#3caadb;box-shadow:0 0 0 3px rgba(35,170,219,.11)}.pallet-catalog-toolbar .btn-main{height:38px;min-width:94px}.pallet-catalog-result-count{margin:0 0 7px;color:#667d9f;font-size:10.5px;font-weight:720}
html[data-theme=dark] .pallet-catalog-toolbar{background:#0f223b;border-color:#29496f}html[data-theme=dark] .pallet-catalog-toolbar input,html[data-theme=dark] .pallet-catalog-toolbar select{background:#0a1a2d;border-color:#315276;color:#eef6ff}
@media(max-width:900px){.pallet-catalog-toolbar{grid-template-columns:1fr 1fr}.pallet-catalog-toolbar .btn-main{width:100%}}
@media(max-width:580px){.pallet-catalog-toolbar{grid-template-columns:1fr}}

/* Non-blocking module loading indicator. Navigation remains clickable while PostgreSQL data loads. */
.tab{position:relative}
.tab.loading::after{
  content:"";
  position:absolute;
  top:7px;
  right:8px;
  width:7px;
  height:7px;
  border-radius:50%;
  background:#67f5ff;
  box-shadow:0 0 0 3px rgba(103,245,255,.14);
  animation:module-loading-pulse .9s ease-in-out infinite alternate;
}
@keyframes module-loading-pulse{from{opacity:.35;transform:scale(.8)}to{opacity:1;transform:scale(1.08)}}
@media(prefers-reduced-motion:reduce){.tab.loading::after{animation:none}}

/* V37 - fast module hydration and visible PostgreSQL loading states */
.module-inline-loading{min-height:92px;display:flex;align-items:center;justify-content:center;gap:11px;color:#5d7394;font-size:12px;font-weight:760;background:linear-gradient(180deg,rgba(247,251,255,.72),rgba(241,247,253,.55));border:1px dashed #d2e0ef;border-radius:14px}
.module-inline-spinner{width:18px;height:18px;border:2px solid #c7d9ec;border-top-color:#17b8d1;border-radius:50%;animation:module-inline-spin .7s linear infinite}
@keyframes module-inline-spin{to{transform:rotate(360deg)}}
.module[aria-busy="true"]{cursor:default}
.module[aria-busy="true"] .card{contain:layout paint style}
html[data-theme=dark] .module-inline-loading{color:#bfd0e8;background:linear-gradient(180deg,rgba(14,32,55,.8),rgba(10,25,44,.72));border-color:#2b4a6f}
@media(prefers-reduced-motion:reduce){.module-inline-spinner{animation:none}}

/* V38 - unified horizontal Model/BOM workspace */
.model-bom-workspace-head{
  display:grid!important;
  grid-template-columns:auto minmax(240px,1fr) auto!important;
  grid-template-rows:auto!important;
  gap:12px!important;
  align-items:center!important;
  padding:12px 16px!important;
}
.model-bom-switcher{grid-column:1!important;grid-row:1!important}
.model-bom-context{grid-column:2!important;grid-row:1!important;width:max-content;max-width:100%;justify-self:start}
.model-bom-action-zone{grid-column:3!important;grid-row:1!important;justify-self:end!important;justify-content:flex-end!important;flex-wrap:wrap!important}
.model-bom-contained-layout,.packing-contained-layout{display:flex;flex-direction:column;min-height:0;background:#f7fbff}
.model-bom-list-panel{width:100%;min-width:0;background:#fff;border-right:0;border-bottom:1px solid #d7e4f1;display:block}
.model-bom-detail-panel{width:100%;min-width:0;background:#f7fbff;overflow:visible}
.contained-panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 9px}
.contained-panel-head h3{margin:2px 0 0}
.contained-toolbar{display:grid;grid-template-columns:minmax(300px,1fr) auto;gap:12px;align-items:center;padding:0 16px 11px}
.contained-search{width:100%!important;max-width:none!important;margin:0!important}
.contained-pager{justify-content:flex-end!important;padding:0!important;flex-wrap:wrap}
.master-table-hint{color:#6d82a1;font-size:10.5px;font-weight:750;text-align:right}
.contained-list-body{min-height:0;padding:0 16px 14px;overflow:visible}
#productBomList #modelTable .table-wrap,#packingBomList .table-wrap{max-height:330px;overflow:auto;border:1px solid #d7e4f1;border-radius:12px;background:#fff}
#productBomList #modelTable .table{width:100%;min-width:1120px}
#productBomList #modelTable thead th,#packingBomList thead th{position:sticky;top:0;z-index:2;background:linear-gradient(180deg,#f3f7fc,#eaf1f9);white-space:nowrap}
#productBomList #modelTable td,#packingBomList td{vertical-align:middle}
#productBomList #modelTable tbody tr,#packingBomList tbody tr{cursor:pointer}
#productBomList #modelTable tbody tr:hover td,#packingBomList tbody tr:hover td{background:#f4f9ff}
#productBomList #modelTable tbody tr.selected-row td,#packingBomList tbody tr.selected-row td{background:#e8f4ff!important;box-shadow:inset 3px 0 0 #1689d6}
.model-bom-section-head{padding:14px 16px 10px;border-top:0;border-bottom:1px solid #e0e9f3}
.model-bom-pane-body{padding:12px 16px 16px}
#productBomPane .model-bom-detail-panel{border-top:0}
#productBomPane .bom-lifecycle-strip{gap:0;margin:0 0 12px;border:1px solid #d7e4f1;border-radius:12px;overflow:hidden;background:#fff}
#productBomPane .bom-lifecycle-strip>div{min-height:58px;border:0;border-right:1px solid #e0e9f3;border-radius:0;background:#fff;padding:9px 12px}
#productBomPane .bom-lifecycle-strip>div:last-child{border-right:0}
#productBomPane .bom-pretty-wrap{max-height:420px;border-radius:12px;background:#fff}
#productBomPane .bom-full-field-table{width:100%;min-width:1180px}
#productBomPane .lock-note{margin-top:12px}
.packing-master-toolbar{grid-template-columns:minmax(340px,620px) minmax(220px,1fr);justify-content:start;gap:14px}
#packingBomPane #packingBomSearch{width:100%!important;max-width:620px!important;height:36px;min-height:36px;padding:0 13px;border-radius:10px;font-size:12px;box-shadow:inset 0 1px 2px rgba(20,48,82,.04)}
#packingBomPane .master-table-hint{align-self:center;justify-self:end;max-width:360px;font-size:10.5px;line-height:1.35}
.packing-master-table{width:100%;min-width:1160px}
.packing-master-table td:nth-child(7),.packing-master-table td:nth-child(8){text-align:right;font-variant-numeric:tabular-nums}
.packing-master-code{font-weight:950;color:#075b9e}
.packing-master-name{font-weight:760;color:#29476e}
.compact-row-action{height:30px!important;padding:0 10px!important;font-size:10.5px!important}
#packingBomDetail{min-height:0;overflow:visible;background:#f7fbff}
#packingBomDetail>.packing-loading-state{min-height:180px}
.packing-browser-detail-head{position:static;border-bottom:1px solid #d8e5f3}
.packing-workspace-heading{background:#fff}
.packing-context-row{padding:10px 16px;background:#fff}
.packing-summary-grid{grid-template-columns:repeat(6,minmax(135px,1fr));gap:0;padding:12px 16px}
.packing-summary-card{grid-template-columns:30px minmax(0,1fr);gap:8px;padding:10px 12px;border-radius:0;border-right:0;box-shadow:none}
.packing-summary-card:first-child{border-radius:12px 0 0 12px}
.packing-summary-card:last-child{border-right:1px solid #d7e4f2;border-radius:0 12px 12px 0}
.packing-summary-icon{width:30px;height:30px;border-radius:9px;font-size:14px}
.packing-summary-card b{font-size:12.5px}
.packing-main-grid{display:grid;grid-template-columns:1fr;gap:12px;padding:0 16px 16px}
.packing-bom-panel,.packing-insight-card{border-radius:12px;box-shadow:none}
.packing-bom-table-wrap{max-height:390px}
.packing-bom-table{width:100%;min-width:980px}
.packing-insight-stack{grid-template-columns:minmax(0,1.45fr) minmax(300px,.8fr);gap:12px}
.packing-fit-grid{grid-template-columns:120px minmax(0,1fr);column-gap:14px}
.packing-check-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 14px}
.pallet-detail-summary{display:grid;grid-template-columns:repeat(6,minmax(130px,1fr));gap:0;margin-bottom:12px;border:1px solid #d8e5f2;border-radius:12px;overflow:hidden}
.pallet-detail-summary>div{border:0;border-right:1px solid #d8e5f2;border-radius:0;background:#fff;padding:10px 12px}
.pallet-detail-summary>div:last-child{border-right:0}
.packing-empty-state{margin:14px 16px 16px;border-radius:12px;box-shadow:none}
html[data-theme=dark] .model-bom-contained-layout,html[data-theme=dark] .model-bom-detail-panel,html[data-theme=dark] #packingBomDetail{background:#071525}
html[data-theme=dark] .model-bom-list-panel{background:#0d2038;border-color:#29466d}
html[data-theme=dark] #productBomList #modelTable .table-wrap,html[data-theme=dark] #packingBomList .table-wrap{background:#0f223b;border-color:#29466d}
html[data-theme=dark] #productBomPane .bom-lifecycle-strip,html[data-theme=dark] #productBomPane .bom-lifecycle-strip>div,html[data-theme=dark] .pallet-detail-summary>div{background:#0f223b;border-color:#29466d}
html[data-theme=dark] #productBomList #modelTable tbody tr:hover td,html[data-theme=dark] #packingBomList tbody tr:hover td{background:#112a47}
html[data-theme=dark] #productBomList #modelTable tbody tr.selected-row td,html[data-theme=dark] #packingBomList tbody tr.selected-row td{background:#153657!important}
@media(max-width:1500px){
  .model-bom-workspace-head{grid-template-columns:auto minmax(220px,1fr)!important}
  .model-bom-action-zone{grid-column:1 / -1!important;grid-row:2!important;justify-self:start!important;justify-content:flex-start!important}
  .packing-summary-grid{grid-template-columns:repeat(3,minmax(170px,1fr));gap:8px}
  .packing-summary-card,.packing-summary-card:first-child,.packing-summary-card:last-child{border:1px solid #d7e4f2;border-radius:10px}
}
@media(max-width:1050px){
  .model-bom-workspace-head{grid-template-columns:1fr!important}
  .model-bom-switcher{grid-column:1!important;grid-row:1!important}
  .model-bom-context{grid-column:1!important;grid-row:2!important}
  .model-bom-action-zone{grid-column:1!important;grid-row:3!important}
  .contained-toolbar,.packing-master-toolbar{grid-template-columns:1fr}
  .contained-pager{justify-content:flex-start!important}
  .master-table-hint{text-align:left}
  .packing-insight-stack{grid-template-columns:1fr}
  .pallet-detail-summary{grid-template-columns:repeat(3,minmax(130px,1fr));gap:8px;border:0;overflow:visible}
  .pallet-detail-summary>div{border:1px solid #d8e5f2!important;border-radius:10px}
}
@media(max-width:700px){
  .packing-summary-grid{grid-template-columns:1fr}
  .packing-check-list{grid-template-columns:1fr}
  .pallet-detail-summary{grid-template-columns:1fr}
}


/* v43 — Model/BOM visual polish, customer portal security and market intelligence */
#modelbom .table{border-collapse:separate;border-spacing:0;width:100%}
#modelbom .table th{border-left:0!important;border-right:0!important;border-top:0!important;background:linear-gradient(180deg,#f6f9fd 0%,#edf4fb 100%);color:#506889;letter-spacing:.055em;font-size:10.5px;padding:11px 12px}
#modelbom .table td{border-left:0!important;border-right:0!important;border-top:0!important;border-bottom:1px solid #e6edf5!important;padding:11px 12px;background:#fff;transition:background .16s ease,box-shadow .16s ease}
#modelbom .table tbody tr:last-child td{border-bottom:0!important}
#modelbom .table tbody tr.selectable-row:hover td{background:#f4f9ff!important}
#productBomList #modelTable tbody tr.selected-row td,#packingBomList tbody tr.selected-row td{background:linear-gradient(90deg,#e8f6ff 0%,#f5fbff 100%)!important;box-shadow:none!important;border-bottom-color:#cce6f8!important}
#productBomList #modelTable tbody tr.selected-row td:first-child,#packingBomList tbody tr.selected-row td:first-child{box-shadow:inset 4px 0 0 #0fb3d4!important;border-radius:9px 0 0 9px}
#productBomList #modelTable tbody tr.selected-row td:last-child,#packingBomList tbody tr.selected-row td:last-child{border-radius:0 9px 9px 0}
#bomLineEditor .table-wrap{border:1px solid #d7e3ef;border-radius:16px;overflow:auto;background:#fff;box-shadow:0 10px 30px rgba(23,61,105,.07)}
#bomLineEditor .table td{font-size:12px;white-space:nowrap}
#bomLineEditor .table tbody tr:hover td{background:#f7fbff}
#modelbom .model-bom-workspace-card{border:1px solid #cfdeed;border-radius:20px;box-shadow:0 24px 60px rgba(24,63,110,.12)}
#modelbom .model-bom-pane{background:linear-gradient(180deg,#f8fbff 0%,#f3f8fd 100%)}
#modelbom .model-bom-section-head{background:rgba(255,255,255,.92);backdrop-filter:blur(8px)}
#modelbom .contained-list-body{padding:0 16px 16px}
#modelbom .table-wrap{border-radius:14px;border-color:#d8e4f0;box-shadow:0 8px 24px rgba(23,61,105,.055)}

.calculation-detail-loading{min-height:150px;display:flex;align-items:center;justify-content:center;gap:14px;border:1px solid #d7e5f2;border-radius:16px;background:linear-gradient(135deg,#f7fbff,#eef8fc);color:#173b6b}
.calculation-detail-loading>div{display:grid;gap:4px}.calculation-detail-loading small{color:#6b7f9d}
.loading-spinner{width:22px;height:22px;border:3px solid rgba(13,157,198,.18);border-top-color:#0c9fc8;border-radius:50%;display:inline-block;animation:sapali-spin .8s linear infinite;flex:0 0 auto}
@keyframes sapali-spin{to{transform:rotate(360deg)}}

.guest-account-badge{display:flex;align-items:center;gap:9px;border:1px solid rgba(175,219,255,.28);background:rgba(255,255,255,.08);border-radius:14px;padding:7px 11px;color:#fff;min-width:185px}
.guest-account-badge span:last-child{display:grid;line-height:1.2}.guest-account-badge b{font-size:12px}.guest-account-badge small{font-size:9.5px;color:#bcd5ec;margin-top:2px}
.guest-account-avatar{width:30px;height:30px;border-radius:10px;display:grid;place-items:center;background:linear-gradient(135deg,#45d4f1,#25c8ae);font-size:11px;font-weight:950;box-shadow:0 6px 16px rgba(33,199,214,.24)}
.guest-quote-value{font-weight:850;font-variant-numeric:tabular-nums;color:#123768}.guest-quote-value.suggested{display:inline-block;color:#006d80;background:linear-gradient(90deg,#dffbff,#e9fff8);border:1px solid #a9e8e7;border-radius:9px;padding:5px 8px;box-shadow:0 5px 14px rgba(18,177,193,.10)}
.guest-result-market-footer{display:grid;grid-template-columns:minmax(230px,.65fr) minmax(680px,1.35fr);gap:14px;align-items:stretch;margin-top:14px}
.guest-market-explain{border:1px solid #d8e6f2;border-radius:16px;padding:14px;background:linear-gradient(145deg,#f8fbff,#eff7fd);display:flex;flex-direction:column;justify-content:center;gap:6px}.guest-market-explain b{font-size:13px;color:#0e3568}.guest-market-explain span{font-size:11px;line-height:1.45;color:#637895}
.guest-market-ribbon{display:grid;grid-template-columns:auto repeat(3,minmax(150px,1fr));gap:9px;border:1px solid #cce4ef;border-radius:18px;padding:10px;background:linear-gradient(135deg,#062a50 0%,#0a4770 55%,#087a83 100%);box-shadow:0 16px 34px rgba(5,55,91,.18);color:#fff;overflow:hidden}
.guest-market-ribbon.loading{grid-template-columns:auto 1fr;align-items:center;min-height:95px}.market-ribbon-head{padding:8px 10px;display:flex;flex-direction:column;justify-content:center;min-width:125px}.market-ribbon-head span{font-size:9px;font-weight:950;letter-spacing:.16em;color:#76e6ef}.market-ribbon-head small{font-size:9px;color:#b9d4e5;margin-top:7px;line-height:1.35}
.market-ribbon-card{position:relative;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.09);border-radius:13px;padding:10px 11px;display:grid;gap:3px;min-width:0;backdrop-filter:blur(8px)}.market-ribbon-card>span{font-size:9px;text-transform:uppercase;letter-spacing:.07em;color:#bfe9f2;font-weight:850}.market-ribbon-card>b{font-size:18px;color:#fff;line-height:1.2}.market-ribbon-card small{font-size:9px;color:#d2e9f2}.market-ribbon-card em{font-style:normal;font-size:8px;color:#8ec7d8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.market-ribbon-card.lme{box-shadow:inset 0 3px 0 #58d9ff}.market-ribbon-card.pvc{box-shadow:inset 0 3px 0 #c7a5ff}.market-ribbon-card.adjustment{box-shadow:inset 0 3px 0 #65efbc}.market-unavailable{font-size:11px!important;color:#ffd58c!important}
.guest-po-col-quote,.guest-po-col-suggest{width:11%}.guest-po-col-total{width:11%}.guest-po-result-table td:nth-child(4),.guest-po-result-table td:nth-child(5),.guest-po-result-table td:nth-child(6){text-align:right}

.customer-history-tabs{display:flex;gap:8px;padding:5px;border:1px solid #d6e4f1;border-radius:13px;background:#eef5fb;width:max-content;max-width:100%;margin-bottom:12px}.customer-history-tabs button{border:0;background:transparent;border-radius:9px;padding:9px 14px;font-weight:850;color:#617695;cursor:pointer}.customer-history-tabs button.active{color:#fff;background:linear-gradient(135deg,#11549b,#0789a1);box-shadow:0 7px 16px rgba(16,91,145,.22)}
.customer-history-chart{border:1px solid #d6e4f1;border-radius:18px;background:linear-gradient(180deg,#fff,#f7fbff);padding:12px;box-shadow:0 10px 30px rgba(22,60,105,.07)}.customer-history-chart svg{width:100%;height:auto;min-height:270px;display:block}.history-chart-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 8px 8px}.history-chart-toolbar>div{display:flex;gap:14px;flex-wrap:wrap}.history-chart-toolbar>span{font-size:10px;color:#70839f;font-weight:850}.history-legend{display:flex;align-items:center;gap:6px;font-size:10px;font-weight:850;color:#4d6688}.history-legend i{width:18px;height:3px;border-radius:4px;background:#2385d0}.history-legend.lme i{background:#11a9cc}.history-legend.pvc i{background:#8c68d8}.history-legend.fob i{background:#153e86}.history-grid{stroke:#dfe8f1;stroke-width:1}.history-axis-label{fill:#7184a0;font-size:10px}.history-line{fill:none;stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round}.history-line.fob{stroke:#153e86}.history-line.lme{stroke:#11a9cc}.history-line.pvc{stroke:#8c68d8}.history-dot{stroke:#fff;stroke-width:2}.history-dot.fob{fill:#153e86}.history-dot.lme{fill:#11a9cc}.history-dot.pvc{fill:#8c68d8}.history-source-row{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:12px;border:1px solid #dce7f1;border-radius:13px;padding:11px 13px;background:#f7fafc;color:#5f7390;font-size:10px;line-height:1.45}.history-source-row small{text-align:right;color:#6f819a}

html[data-theme=dark] #modelbom .table td{background:#0f223a;border-bottom-color:#29425f!important}html[data-theme=dark] #modelbom .table th{background:#102942;color:#b9cce2}html[data-theme=dark] #productBomList #modelTable tbody tr.selected-row td,html[data-theme=dark] #packingBomList tbody tr.selected-row td{background:linear-gradient(90deg,#153955,#112d47)!important}html[data-theme=dark] .customer-history-chart{background:#0c2038;border-color:#294663}
@media(max-width:1250px){.guest-result-market-footer{grid-template-columns:1fr}.guest-market-ribbon{grid-template-columns:repeat(3,minmax(150px,1fr))}.market-ribbon-head{grid-column:1/-1;flex-direction:row;align-items:center;justify-content:space-between}}
@media(max-width:760px){.guest-account-badge{display:none}.guest-market-ribbon{grid-template-columns:1fr}.market-ribbon-head{grid-column:auto}.history-source-row{grid-template-columns:1fr}.history-source-row small{text-align:left}.guest-result-market-footer{display:block}.guest-market-explain{margin-bottom:10px}}

/* v44 — premium selected BOM view without segmented vertical stripes */
#productBomList #modelTable tbody tr.selected-row td,
#packingBomList tbody tr.selected-row td{
  background:linear-gradient(180deg,#eaf8ff 0%,#f7fcff 100%)!important;
  box-shadow:none!important;
  border-top:1px solid #bfe5f2!important;
  border-bottom:1px solid #bfe5f2!important;
}
#productBomList #modelTable tbody tr.selected-row td:first-child,
#packingBomList tbody tr.selected-row td:first-child{
  box-shadow:none!important;
  border-left:1px solid #bfe5f2!important;
  border-radius:11px 0 0 11px;
  color:#074f7b;
  font-weight:950;
}
#productBomList #modelTable tbody tr.selected-row td:last-child,
#packingBomList tbody tr.selected-row td:last-child{
  border-right:1px solid #bfe5f2!important;
  border-radius:0 11px 11px 0;
}
#productBomPane .bom-lifecycle-strip{
  gap:10px;
  margin:0 0 14px;
  border:0;
  border-radius:0;
  overflow:visible;
  background:transparent;
}
#productBomPane .bom-lifecycle-strip>div{
  position:relative;
  min-height:76px;
  border:1px solid #d4e4f1!important;
  border-radius:15px!important;
  background:linear-gradient(145deg,#ffffff 0%,#f5faff 100%)!important;
  padding:13px 14px!important;
  box-shadow:0 10px 24px rgba(20,61,107,.065),inset 0 1px 0 rgba(255,255,255,.9);
  overflow:hidden;
}
#productBomPane .bom-lifecycle-strip>div::after{
  content:'';
  position:absolute;
  left:0;right:0;top:0;
  height:3px;
  background:linear-gradient(90deg,#39c5ef,#30d8b5);
  opacity:.72;
}
#productBomPane .bom-lifecycle-strip>div:nth-child(2)::after{background:linear-gradient(90deg,#4a86e8,#6e66df)}
#productBomPane .bom-lifecycle-strip>div:nth-child(3)::after{background:linear-gradient(90deg,#9b73e5,#d67fd5)}
#productBomPane .bom-lifecycle-strip>div:nth-child(4)::after{background:linear-gradient(90deg,#22c790,#88df65)}
#productBomPane .bom-lifecycle-strip span{margin-top:2px;color:#687f9e}
#productBomPane .bom-lifecycle-strip b{font-size:14px;color:#092f67}
#productBomPane .bom-lifecycle-strip small{margin-top:6px}
#productBomPane #bomLineEditor .bom-pretty-wrap{
  border:1px solid #d4e4f1;
  border-radius:16px;
  box-shadow:0 14px 34px rgba(21,61,106,.075);
}
#productBomPane #bomLineEditor .bom-pretty-table thead th{
  background:linear-gradient(180deg,#eef7fc 0%,#e7f1f8 100%);
  border-bottom:1px solid #cbdce9!important;
}
#productBomPane #bomLineEditor .bom-pretty-table tbody tr:nth-child(even) td{background:#fbfdff}
#productBomPane #bomLineEditor .bom-pretty-table tbody tr:hover td{background:#eef9ff!important}
html[data-theme=dark] #productBomPane .bom-lifecycle-strip>div{
  background:linear-gradient(145deg,#122b46 0%,#0d2239 100%)!important;
  border-color:#2a4b6c!important;
}
html[data-theme=dark] #productBomPane .bom-lifecycle-strip b{color:#eef8ff}


/* V45 — visible customer price-history affordance */
.guest-model-history{display:inline-flex!important;align-items:center;gap:6px!important;color:#0d4d8d!important;font-weight:900!important;text-decoration:none!important}
.guest-model-history i{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:6px;background:#e8f7fb;color:#0794aa;font-style:normal;font-size:10px;transition:transform .18s ease,background .18s ease}
.guest-model-history:hover i{transform:translate(2px,-2px);background:#c9f2f4}

/* V46 — customer quote clarity, MOQ control, market reference, USD history and screenshot preview */
#guestPortal .guest-result-overview{
  display:grid;
  grid-template-columns:minmax(420px,.92fr) minmax(520px,1.08fr);
  gap:14px;
  align-items:stretch;
  margin:0 0 12px;
}
#guestPortal .compact-result-summary{
  display:grid;
  grid-template-columns:repeat(3,minmax(112px,1fr));
  gap:10px;
  margin:0;
}
#guestPortal .compact-result-summary .guest-kpi{
  min-height:86px;
  padding:14px 16px;
  border:1px solid #d3e5f2;
  border-radius:16px;
  background:linear-gradient(145deg,#fff 0%,#f1f8fd 100%);
  box-shadow:0 9px 23px rgba(22,64,108,.065),inset 0 1px 0 #fff;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:5px;
}
#guestPortal .compact-result-summary .guest-kpi span{
  color:#647b9a;
  font-size:10px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}
#guestPortal .compact-result-summary .guest-kpi b{
  color:#082e67;
  font-size:23px;
  line-height:1;
  font-variant-numeric:tabular-nums;
}
#guestPortal .guest-market-compact{
  min-width:0;
  min-height:86px;
  display:grid;
  grid-template-columns:minmax(145px,.72fr) repeat(2,minmax(165px,1fr));
  gap:9px;
  padding:9px;
  border:1px solid #b9e0eb;
  border-radius:17px;
  color:#fff;
  background:linear-gradient(125deg,#062c51 0%,#074b70 55%,#087f84 100%);
  box-shadow:0 12px 28px rgba(4,61,92,.18),inset 0 1px 0 rgba(255,255,255,.13);
  overflow:hidden;
}
#guestPortal .guest-market-compact.loading{
  grid-template-columns:auto 1fr;
  align-items:center;
  justify-content:center;
  color:#d7f6fb;
}
#guestPortal .guest-market-compact-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:7px 8px;
  min-width:0;
}
#guestPortal .guest-market-compact-head>div{display:grid;gap:5px;min-width:0}
#guestPortal .guest-market-compact-head span{
  color:#77e7ef;
  font-size:9px;
  font-weight:950;
  letter-spacing:.16em;
  white-space:nowrap;
}
#guestPortal .guest-market-compact-head small{color:#b7d9e8;font-size:9px;font-weight:750}
#guestPortal .market-status-dot{
  width:9px;height:9px;border-radius:50%;flex:0 0 auto;
  background:#ffc15e;box-shadow:0 0 0 5px rgba(255,193,94,.12);
}
#guestPortal .market-status-dot.live{background:#55efb2;box-shadow:0 0 0 5px rgba(85,239,178,.12)}
#guestPortal .market-status-dot.offline{background:#ff8690;box-shadow:0 0 0 5px rgba(255,134,144,.12)}
#guestPortal .guest-market-compact-card{
  min-width:0;
  display:grid;
  align-content:center;
  gap:2px;
  padding:9px 11px;
  border:1px solid rgba(255,255,255,.19);
  border-radius:13px;
  background:rgba(255,255,255,.09);
  box-shadow:inset 0 3px 0 #5de0ff;
  backdrop-filter:blur(7px);
}
#guestPortal .guest-market-compact-card.pvc{box-shadow:inset 0 3px 0 #c9a4ff}
#guestPortal .guest-market-compact-card>span{
  color:#c5ebf4;font-size:8.5px;font-weight:900;letter-spacing:.07em;text-transform:uppercase;
}
#guestPortal .guest-market-compact-card>b{
  color:#fff;font-size:17px;line-height:1.12;font-weight:950;font-variant-numeric:tabular-nums;
}
#guestPortal .guest-market-compact-card>small{color:#d3e9f1;font-size:8.5px}
#guestPortal .guest-market-compact-card>em{
  color:#8fc8d8;font-size:7.5px;font-style:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
#guestPortal .market-unavailable{font-size:10px!important;color:#ffd48a!important}

#guestPortal .guest-po-table-wrap,#guestPortal .guest-lookup-table-wrap{
  border:1px solid #d5e3ef;
  border-radius:15px;
  overflow:auto;
  box-shadow:0 9px 25px rgba(17,56,99,.06);
  background:#fff;
}
#guestPortal .guest-po-result-table,#guestPortal .guest-lookup-result-table{table-layout:fixed;min-width:1180px;margin:0}
#guestPortal .guest-po-result-table thead th,#guestPortal .guest-lookup-result-table thead th{
  background:linear-gradient(180deg,#17487f 0%,#103665 100%);
  color:#fff;
  border-bottom:2px solid #2bd1d8!important;
  font-size:9.5px;
  letter-spacing:.035em;
  line-height:1.18;
  padding:12px 10px;
  white-space:normal;
  text-align:left;
}
#guestPortal .guest-po-result-table tbody td,#guestPortal .guest-lookup-result-table tbody td{
  padding:11px 10px;
  border-bottom:1px solid #e2eaf2!important;
  color:#0c2d5e;
  font-size:10.5px;
  line-height:1.32;
  vertical-align:middle;
  background:#fff;
}
#guestPortal .guest-po-result-table tbody tr:nth-child(even) td,#guestPortal .guest-lookup-result-table tbody tr:nth-child(even) td{background:#fbfdff}
#guestPortal .guest-po-result-table tbody tr:hover td,#guestPortal .guest-lookup-result-table tbody tr:hover td{background:#eef9fd!important}
#guestPortal .guest-po-col-model{width:12%}#guestPortal .guest-po-col-name{width:11%}#guestPortal .guest-po-col-moq{width:5.5%}
#guestPortal .guest-po-col-qty{width:6.5%}#guestPortal .guest-po-col-quote{width:10%}#guestPortal .guest-po-col-suggest{width:10%}
#guestPortal .guest-po-col-total{width:10%}#guestPortal .guest-po-col-status{width:8%}#guestPortal .guest-po-col-note{width:27%}
#guestPortal .guest-lookup-col-model{width:15%}#guestPortal .guest-lookup-col-name{width:14%}#guestPortal .guest-lookup-col-moq{width:7%}
#guestPortal .guest-lookup-col-quote{width:13%}#guestPortal .guest-lookup-col-suggest{width:14%}#guestPortal .guest-lookup-col-status{width:10%}#guestPortal .guest-lookup-col-note{width:27%}
#guestPortal .guest-po-result-table th:nth-child(3),#guestPortal .guest-po-result-table th:nth-child(4),
#guestPortal .guest-po-result-table th:nth-child(5),#guestPortal .guest-po-result-table th:nth-child(6),#guestPortal .guest-po-result-table th:nth-child(7),
#guestPortal .guest-po-result-table td:nth-child(3),#guestPortal .guest-po-result-table td:nth-child(4),
#guestPortal .guest-po-result-table td:nth-child(5),#guestPortal .guest-po-result-table td:nth-child(6),#guestPortal .guest-po-result-table td:nth-child(7){text-align:right}
#guestPortal .guest-below-moq-row td{background:linear-gradient(90deg,#fffaf1,#fff)!important}
#guestPortal .guest-below-moq-cell{
  background:#fff1d9!important;
  box-shadow:inset 3px 0 0 #ff9f2e;
}
#guestPortal .guest-qty-warning{display:grid;justify-items:end;gap:2px}
#guestPortal .guest-qty-warning b{color:#b14b00;font-size:11px;font-variant-numeric:tabular-nums}
#guestPortal .guest-qty-warning small{
  color:#a45a12;font-size:7.5px;font-weight:900;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;
}
#guestPortal .guest-po-total-bar{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:20px;
  margin-top:10px;
  padding:10px 14px;
  border-top:1px solid #d8e6f1;
  background:linear-gradient(90deg,rgba(246,251,255,.4),#f2f9fd);
}
#guestPortal .guest-po-total-value{display:grid;text-align:right;gap:2px}
#guestPortal .guest-po-total-value span{font-size:9px;color:#657d9b;font-weight:900;text-transform:uppercase;letter-spacing:.06em}
#guestPortal .guest-po-total-value b{font-size:19px;color:#062e67;font-variant-numeric:tabular-nums}
#guestPortal .guest-po-total-note{max-width:410px;color:#607896;font-size:9px;line-height:1.35}

#guestPortal .customer-history-tabs{margin-bottom:12px}
#guestPortal .customer-history-table-wrap{
  border:1px solid #d7e4ef;border-radius:16px;overflow:auto;background:#fff;box-shadow:0 10px 28px rgba(20,60,103,.06)
}
#guestPortal .customer-history-table-wrap .table{margin:0;min-width:760px}
#guestPortal .customer-history-table-wrap th{
  background:linear-gradient(180deg,#17487f,#103665);color:#fff;border-bottom:2px solid #2bd1d8!important;padding:12px 14px;font-size:10px
}
#guestPortal .customer-history-table-wrap td{padding:11px 14px;font-size:10.5px;font-variant-numeric:tabular-nums}
#guestPortal .customer-history-table-wrap th:not(:first-child),#guestPortal .customer-history-table-wrap td:not(:first-child){text-align:right}
#guestPortal .customer-history-chart{padding:14px 14px 8px}
#guestPortal .history-source-row{grid-template-columns:minmax(320px,1fr) minmax(280px,.8fr)}

.guest-image-preview-overlay{
  position:fixed;inset:0;z-index:10050;display:grid;place-items:center;padding:24px;background:rgba(3,22,47,.72);backdrop-filter:blur(8px)
}
.guest-image-preview-overlay.hidden{display:none!important}
.guest-image-preview-box{
  position:relative;width:min(1180px,94vw);max-height:90vh;display:grid;grid-template-rows:auto minmax(260px,1fr);gap:12px;
  padding:18px;border:1px solid #cce3ef;border-radius:22px;background:#fff;box-shadow:0 28px 80px rgba(0,22,51,.32)
}
.guest-image-preview-title{padding-right:46px;color:#0a2f64;font-size:14px;font-weight:950;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.guest-image-preview-close{
  position:absolute;top:12px;right:12px;width:36px;height:36px;border:1px solid #cfe2ef;border-radius:50%;background:#f8fcff;color:#0b3269;font-size:23px;font-weight:900;cursor:pointer
}
.guest-image-preview-stage{
  position:relative;min-height:260px;max-height:calc(90vh - 86px);display:grid;place-items:center;overflow:auto;border:1px solid #d7e5ef;border-radius:15px;background:repeating-conic-gradient(#f7fbfe 0 25%,#edf5fa 0 50%) 50%/20px 20px
}
.guest-image-preview-stage img{display:none;max-width:100%;height:auto;object-fit:contain}
.guest-image-preview-stage img.ready{display:block}
.guest-image-preview-loading{color:#637c99;font-size:11px;font-weight:800;padding:18px;text-align:center}
.guest-image-preview-loading.error{color:#a74631;background:#fff3ef;border:1px solid #ffd4c8;border-radius:12px}

@media(max-width:1220px){
  #guestPortal .guest-result-overview{grid-template-columns:1fr}
  #guestPortal .guest-market-compact{grid-template-columns:minmax(135px,.55fr) repeat(2,minmax(180px,1fr))}
}
@media(max-width:760px){
  #guestPortal .compact-result-summary{grid-template-columns:repeat(3,1fr)}
  #guestPortal .compact-result-summary .guest-kpi{min-height:72px;padding:11px}
  #guestPortal .compact-result-summary .guest-kpi b{font-size:19px}
  #guestPortal .guest-market-compact{grid-template-columns:1fr 1fr}
  #guestPortal .guest-market-compact-head{grid-column:1/-1}
  #guestPortal .guest-po-total-bar{align-items:flex-end;flex-direction:column;gap:6px}
  #guestPortal .guest-po-total-note{text-align:right}
  #guestPortal .history-source-row{grid-template-columns:1fr}.history-source-row small{text-align:left}
  .guest-image-preview-overlay{padding:8px}.guest-image-preview-box{width:98vw;max-height:96vh;border-radius:16px;padding:12px}.guest-image-preview-stage{max-height:calc(96vh - 70px)}
}

/* Customer AI V49 — FC status, screenshot OCR feedback and premium price history */
#guestPortal .guest-result-status,
#guestPortal .guest-fc-status{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  min-height:28px;padding:5px 10px;border-radius:999px;
  font-size:9px;font-weight:950;letter-spacing:.025em;white-space:nowrap;
  border:1px solid transparent;box-shadow:0 5px 14px rgba(10,47,91,.08)
}
#guestPortal .guest-result-status i,
#guestPortal .guest-fc-status i{width:7px;height:7px;border-radius:50%;box-shadow:0 0 0 4px currentColor;opacity:.82}
#guestPortal .guest-result-status.fc-ready,
#guestPortal .guest-fc-status.fc-ready{color:#087f62;background:#e8fbf5;border-color:#b4ecd9}
#guestPortal .guest-result-status.review-required,
#guestPortal .guest-fc-status.review-required{color:#a85b00;background:#fff6e8;border-color:#ffd8a1}
#guestPortal .guest-fc-status.fc-unavailable{color:#875000;background:#fff4dc;border-color:#f5cd80}
#guestPortal .compact-result-summary .guest-kpi.fc-ready{background:linear-gradient(145deg,#f4fffb,#e7faf4);border-color:#bfeada}
#guestPortal .compact-result-summary .guest-kpi.fc-ready b{color:#087f62}
#guestPortal .compact-result-summary .guest-kpi.review{background:linear-gradient(145deg,#fffdf8,#fff5e6);border-color:#f4d8ad}
#guestPortal .compact-result-summary .guest-kpi.review b{color:#a85b00}

#guestPortal .guest-scan-progress{
  display:flex;align-items:center;gap:13px;padding:14px 16px;
  border:1px solid #bde2ee;border-radius:16px;
  background:linear-gradient(120deg,#f6fcff,#ebf9fb);
  color:#0b3568;box-shadow:0 10px 24px rgba(12,70,111,.08)
}
#guestPortal .guest-scan-progress>div{display:grid;gap:3px}
#guestPortal .guest-scan-progress b{font-size:11px}
#guestPortal .guest-scan-progress small{font-size:8.5px;color:#67809e;font-weight:750}
#guestPortal .guest-scan-empty-body{display:grid;gap:6px;padding:18px;color:#4d6685}
#guestPortal .guest-scan-empty-body b{color:#0d3569;font-size:12px}
#guestPortal .guest-scan-empty-body span{font-size:10px;line-height:1.45}

.history-approval-date{display:grid;gap:2px;min-width:128px}
.history-approval-date b{color:#0a3168;font-size:10.5px}
.history-approval-date small{color:#7a8ea8;font-size:7.5px;font-weight:850;text-transform:uppercase;letter-spacing:.055em}
.history-approved-badge{
  display:inline-flex;padding:5px 9px;border-radius:999px;background:#e9faf3;color:#087c60;
  border:1px solid #bfead8;font-size:8px;font-weight:950;text-transform:uppercase;letter-spacing:.04em
}
.customer-history-table-wrap .table{min-width:920px}
.customer-history-table-wrap th:first-child,.customer-history-table-wrap td:first-child{text-align:left}

.customer-history-chart.premium{
  display:grid;gap:12px;padding:14px;border:1px solid #d4e5f1;border-radius:20px;
  background:linear-gradient(145deg,#ffffff 0%,#f5faff 58%,#f0fbfb 100%);
  box-shadow:0 18px 46px rgba(9,50,95,.10),inset 0 1px 0 #fff
}
.history-series-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.history-series-card{
  position:relative;overflow:hidden;display:grid;gap:3px;padding:12px 14px;
  border:1px solid #d5e4ef;border-radius:15px;background:rgba(255,255,255,.92);
  box-shadow:0 8px 20px rgba(12,53,95,.06)
}
.history-series-card:before{content:"";position:absolute;inset:0 auto 0 0;width:4px;background:#1f4f96}
.history-series-card.lme:before{background:#10a9b6}
.history-series-card.pvc:before{background:#9a62d6}
.history-series-card span{display:flex;align-items:center;gap:7px;color:#637b99;font-size:8.5px;font-weight:950;text-transform:uppercase;letter-spacing:.06em}
.history-series-card span i{width:18px;height:3px;border-radius:3px;background:#1f4f96}
.history-series-card.lme span i{background:#10a9b6}
.history-series-card.pvc span i{background:#9a62d6}
.history-series-card b{color:#082e67;font-size:20px;line-height:1.05;font-variant-numeric:tabular-nums}
.history-series-card small{color:#788da7;font-size:8.5px;font-weight:750}
.history-series-card em{font-style:normal;font-weight:950}
.history-series-card em.up{color:#098264}.history-series-card em.down{color:#c24e5d}
.history-chart-frame{
  position:relative;overflow:hidden;padding:8px 4px 0;border:1px solid #d8e7f1;border-radius:17px;
  background:linear-gradient(180deg,#fbfdff,#f4f9fd);box-shadow:inset 0 1px 0 #fff
}
.history-chart-frame:before{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(circle at 12% 0%,rgba(43,209,216,.10),transparent 30%),radial-gradient(circle at 90% 15%,rgba(154,98,214,.08),transparent 28%)
}
.history-chart-frame svg{position:relative;display:block;width:100%;height:auto;min-height:350px}
.history-grid{stroke:#d8e5ef;stroke-width:1;stroke-dasharray:4 5}
.history-axis-label{fill:#7388a4;font-size:10px;font-weight:750;font-variant-numeric:tabular-nums}
.history-axis-label.x{font-size:9px}
.history-axis-caption{position:absolute;z-index:2;top:12px;font-size:8.5px;font-weight:950;letter-spacing:.06em;text-transform:uppercase}
.history-axis-caption.left{left:18px;color:#1f4f96}
.history-axis-caption.right{right:18px;color:#138d9a}
.history-line{fill:none;stroke-width:3.4;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 3px 4px rgba(20,62,110,.12))}
.history-line.fob{stroke:#1f4f96}
.history-line.lme{stroke:#10a9b6}
.history-line.pvc{stroke:#9a62d6}
.history-dot{stroke:#fff;stroke-width:2.3;cursor:help}
.history-dot.fob{fill:#1f4f96}
.history-dot.lme{fill:#10a9b6}
.history-dot.pvc{fill:#9a62d6}
.history-approval-marker{stroke:#1f4f96;stroke-width:1;stroke-dasharray:3 5;opacity:.28}
.history-approval-pin{fill:#1f4f96;stroke:#fff;stroke-width:2}
.history-chart-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#7187a2;font-size:8.5px;font-weight:750}
.history-chart-foot span:first-child{display:flex;align-items:center;gap:7px}
.history-chart-foot i.approval{width:9px;height:9px;border-radius:50%;background:#1f4f96;box-shadow:0 0 0 4px rgba(31,79,150,.12)}

@media(max-width:760px){
  .history-series-cards{grid-template-columns:1fr}
  .history-chart-frame svg{min-height:280px}
  .history-chart-foot{align-items:flex-start;flex-direction:column}
}
.history-approval-date small{display:block;margin-top:3px;line-height:1.2}
.history-approved-badge.previous{background:#eef4fa;color:#607894;border-color:#d4e0eb}
.history-approved-badge.current{background:#e9faf3;color:#087c60;border-color:#bfead8}

/* v49.1 — customer history triple-axis refinement */
#guestPortal .customer-history-table-wrap .table{width:100%;}
.history-axis-caption.right.multi{display:flex;align-items:center;gap:16px;right:18px;}
.history-axis-caption.right.multi span{display:inline-flex;align-items:center;gap:5px;}
.history-axis-caption.right.multi span:before{content:"";width:13px;height:3px;border-radius:3px;background:currentColor;}
.history-axis-caption.right.multi .lme{color:#1098a7;}
.history-axis-caption.right.multi .pvc{color:#9259ce;}
.history-axis-label.lme-axis{fill:#1098a7;font-weight:850;}
.history-axis-label.pvc-axis{fill:#9259ce;font-weight:850;}
.history-axis-label.fob-axis{fill:#1f4f96;font-weight:850;}

/* Customer AI V50 — responsive processing workspace, aligned totals and commercial guidance */

#guestPortal .guest-suggest-price{display:inline-grid;justify-items:center;gap:3px;white-space:nowrap}
#guestPortal .guest-suggest-price>small{color:#07836f;font-size:7.2px;font-weight:950;letter-spacing:.025em;text-transform:uppercase}

#guestPortal .guest-po-result-table tfoot td{
  background:linear-gradient(180deg,#f6fbff 0%,#eef8fc 100%)!important;
  border-top:2px solid #b9deea!important;
  border-bottom:0!important;
  padding:11px 10px!important;
  vertical-align:middle;
}
#guestPortal .guest-po-result-table tfoot td:nth-child(7){text-align:right}
#guestPortal .guest-po-commercial-note{
  display:flex;align-items:center;gap:10px;min-height:52px;padding:9px 12px;
  border:1px solid #b9e5df;border-radius:13px;
  background:linear-gradient(115deg,#effdf8 0%,#f5fbff 100%);
  box-shadow:inset 0 1px 0 #fff,0 7px 18px rgba(13,104,102,.06)
}
#guestPortal .guest-po-commercial-note>i{
  width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;border-radius:10px;
  background:linear-gradient(135deg,#08a98f,#2dd6cf);color:#fff;font-style:normal;font-size:15px;
  box-shadow:0 7px 16px rgba(8,169,143,.22)
}
#guestPortal .guest-po-commercial-note>div{display:grid;gap:2px;text-align:left}
#guestPortal .guest-po-commercial-note b{color:#075d56;font-size:10px;font-weight:950}
#guestPortal .guest-po-commercial-note span{color:#446d78;font-size:8.5px;line-height:1.35;font-weight:750}
#guestPortal .guest-po-result-table tfoot .guest-po-total-value{
  display:grid;justify-items:end;gap:3px;white-space:nowrap
}
#guestPortal .guest-po-result-table tfoot .guest-po-total-value span{
  color:#627b99;font-size:8px;font-weight:950;text-transform:uppercase;letter-spacing:.055em
}
#guestPortal .guest-po-result-table tfoot .guest-po-total-value b{
  color:#052f68;font-size:16px;font-weight:1000;font-variant-numeric:tabular-nums
}
#guestPortal .guest-po-result-table tfoot .guest-po-total-note{
  color:#627b96;font-size:8.2px;line-height:1.35;text-align:left
}

#guestPortal .guest-processing-card{overflow:hidden}
#guestPortal .guest-processing-card .guest-result-title{
  background:linear-gradient(120deg,#f5fcff,#effafb);border-bottom-color:#cce6ee
}
#guestPortal .guest-processing-badge{
  min-width:76px;display:flex;align-items:center;justify-content:center;gap:9px;
  padding:7px 10px;border:1px solid #b9e3ea;border-radius:999px;
  background:#eafafa;color:#087989;font-variant-numeric:tabular-nums
}
#guestPortal .guest-processing-badge b{font-size:10px}
#guestPortal .guest-processing-overview{
  display:grid;grid-template-columns:minmax(280px,.7fr) minmax(520px,1.3fr);gap:14px;
  margin:12px 0;padding:13px;border:1px solid #cce4ee;border-radius:17px;
  background:linear-gradient(130deg,#f7fcff,#f2fbfb)
}
#guestPortal .guest-processing-copy{display:grid;align-content:center;gap:5px;min-width:0}
#guestPortal .guest-processing-copy>b{color:#083b70;font-size:13px}
#guestPortal .guest-processing-copy>span{color:#637b96;font-size:9px;line-height:1.4;font-weight:750}
#guestPortal .guest-processing-bar{height:7px;margin-top:5px;border-radius:999px;background:#dbeaf1;overflow:hidden}
#guestPortal .guest-processing-bar>i{
  display:block;width:8%;height:100%;border-radius:inherit;
  background:linear-gradient(90deg,#12a9d6,#21d3c6,#5ae2bd);
  box-shadow:0 0 16px rgba(33,211,198,.35);transition:width .45s ease
}
#guestPortal .guest-processing-steps{
  display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;align-items:stretch
}
#guestPortal .guest-processing-steps>span{
  min-width:0;display:grid;grid-template-columns:22px minmax(0,1fr);gap:7px;align-items:center;
  padding:8px;border:1px solid #d4e4ee;border-radius:12px;background:#fff;
  color:#7890a9;font-size:7.8px;line-height:1.25;font-weight:850
}
#guestPortal .guest-processing-steps>span>i{
  width:22px;height:22px;display:grid;place-items:center;border-radius:8px;
  background:#edf3f7;color:#7b91a7;font-style:normal;font-size:8px
}
#guestPortal .guest-processing-steps>span.active{
  border-color:#66cfdb;background:#edfbfc;color:#075d71;box-shadow:0 7px 17px rgba(22,160,177,.10)
}
#guestPortal .guest-processing-steps>span.active>i{background:#14aabb;color:#fff}
#guestPortal .guest-processing-steps>span.done{border-color:#b9ead9;background:#f0fcf7;color:#18745c}
#guestPortal .guest-processing-steps>span.done>i{background:#27bd8e;color:#fff}
#guestPortal .guest-processing-market{
  display:flex;align-items:center;gap:10px;margin-bottom:10px;padding:9px 12px;
  border:1px solid #c9e3ec;border-radius:13px;background:#f4fbfd;color:#0c4773
}
#guestPortal .guest-processing-market>div{display:grid;gap:1px}
#guestPortal .guest-processing-market b{font-size:9px}
#guestPortal .guest-processing-market small{font-size:7.5px;color:#6d849d;font-weight:750}
#guestPortal .guest-processing-table{max-height:250px!important;pointer-events:none}
#guestPortal .guest-processing-table tbody td{height:44px}
#guestPortal .guest-skeleton-line{
  display:block;width:72%;height:8px;border-radius:999px;
  background:linear-gradient(90deg,#e5edf3 15%,#f7fbfd 45%,#e5edf3 75%);
  background-size:220% 100%;animation:guestSkeletonSweep 1.35s linear infinite
}
#guestPortal .guest-processing-table td:nth-child(2n) .guest-skeleton-line{width:52%}
#guestPortal .guest-processing-table td:nth-child(7) .guest-skeleton-line{width:82%}
@keyframes guestSkeletonSweep{0%{background-position:180% 0}100%{background-position:-40% 0}}

@media(max-width:1180px){
  #guestPortal .guest-processing-overview{grid-template-columns:1fr}
  #guestPortal .guest-processing-steps{grid-template-columns:repeat(5,minmax(130px,1fr));overflow:auto;padding-bottom:3px}
}

/* Customer AI V52 — unified query pipeline and result-focused workspace */
#guestPortal.guest-result-focus .guest-chat-topbar{
  padding:9px 16px;
  border-radius:18px;
}
#guestPortal.guest-result-focus .guest-brand-line h1{font-size:24px;margin-bottom:0}
#guestPortal.guest-result-focus .guest-brand-line p{display:none}
#guestPortal.guest-result-focus .guest-chat-topbar .entry-kicker{margin-bottom:2px;font-size:10px}
#guestPortal.guest-result-focus .guest-quick-actions-pro{padding:7px 14px;gap:7px}
#guestPortal.guest-result-focus .guest-quick-actions-pro .chip-btn{height:34px;padding:0 12px;font-size:11px}
#guestPortal.guest-result-focus .guest-chat-full{padding:10px 14px;gap:9px}

#guestPortal.guest-result-focus .guest-compose-full{padding:8px 16px;align-items:center}
#guestPortal.guest-result-focus .guest-input{height:50px;min-height:50px;max-height:96px;resize:none;padding:13px 16px}
#guestPortal.guest-result-focus .attach-btn,#guestPortal.guest-result-focus .guest-compose-full .btn-main{height:50px}
#guestPortal .guest-chat-bubble-ai.result-msg{margin-left:0;max-width:100%}
#guestPortal .guest-chat-bubble-ai.result-msg::before{display:none}
#guestPortal .guest-result-card.guest-result-collapsed{
  max-height:64px;
  opacity:.9;
  border-color:#c8dbe8;
  box-shadow:0 7px 18px rgba(18,54,94,.05);
}
#guestPortal .guest-result-card.guest-result-collapsed .guest-result-body{display:none}
#guestPortal .guest-result-card.guest-result-collapsed .guest-result-title{
  min-height:62px;
  border-bottom:0;
  background:linear-gradient(100deg,#f8fcff,#f2f8fb);
}
#guestPortal .guest-result-card.guest-result-collapsed .guest-result-title small{
  max-width:760px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
#guestPortal .guest-result-toggle{height:32px!important;white-space:nowrap}
#guestPortal .guest-po-table-wrap,#guestPortal .guest-lookup-table-wrap{
  max-height:min(62vh,680px)!important;
}
#guestPortal .guest-po-result-table tbody td,#guestPortal .guest-lookup-result-table tbody td{
  padding:8px 9px;
  font-size:10.2px;
  line-height:1.25;
}
#guestPortal .guest-po-result-table thead th,#guestPortal .guest-lookup-result-table thead th{
  position:sticky;
  top:0;
  z-index:3;
  padding:10px 9px;
}
#guestPortal .guest-result-body{padding:0 12px 11px}
#guestPortal .guest-result-overview{margin-bottom:9px;gap:10px}
#guestPortal .compact-result-summary .guest-kpi{min-height:72px;padding:10px 13px}
#guestPortal .guest-market-compact{min-height:72px;padding:7px}
#guestPortal .guest-po-commercial-note{
  min-height:66px;
  padding:12px 15px;
  gap:13px;
  border-width:1.5px;
  background:linear-gradient(115deg,#e7fff7 0%,#edfaff 100%);
  box-shadow:inset 0 1px 0 #fff,0 10px 24px rgba(13,104,102,.10)
}
#guestPortal .guest-po-commercial-note>i{
  width:40px;height:40px;border-radius:13px;font-size:19px
}
#guestPortal .guest-po-commercial-note>div{gap:4px}
#guestPortal .guest-po-commercial-note b{font-size:14px;line-height:1.15}
#guestPortal .guest-po-commercial-note span{font-size:11.5px;line-height:1.42;font-weight:720}

@media(max-width:760px){
  #guestPortal.guest-result-focus .guest-brand-line p{display:block;font-size:11px}
  #guestPortal .guest-po-table-wrap,#guestPortal .guest-lookup-table-wrap{max-height:58vh!important}
  #guestPortal .guest-po-commercial-note b{font-size:12px}
  #guestPortal .guest-po-commercial-note span{font-size:10px}
}
#guestPortal .guest-po-col-status{width:10.5%}
#guestPortal .guest-po-col-note{width:24.5%}
#guestPortal .guest-po-result-table td:nth-child(8),#guestPortal .guest-po-result-table th:nth-child(8){white-space:nowrap}


/* Customer Portal V53 — full-width history, Suggested FOB series and persistent chat results */
#guestPortal .guest-quick-actions-pro .guest-clear-chat-btn{
  margin-left:auto;border-color:#efc5cc;background:#fff7f8;color:#aa2840;
}
#guestPortal .guest-quick-actions-pro .guest-clear-chat-btn:hover{background:#ffeef1;border-color:#e69aa8}
.modal.customer-history-modal{
  width:calc(100vw - 24px)!important;max-width:none!important;
  height:min(94vh,980px);max-height:94vh!important;border-radius:22px!important;
}
.customer-history-modal .smart-modal-head{padding:20px 28px 16px!important}
.customer-history-modal .smart-modal-head h3{font-size:27px!important;line-height:1.15!important}
.customer-history-modal .smart-modal-head p{font-size:14px!important;margin-top:7px!important}
.customer-history-modal #modalSuggestions{
  padding:20px 28px 28px!important;max-height:calc(94vh - 128px)!important;gap:14px!important;
}
.customer-history-modal .customer-history-tabs button{font-size:14px;padding:11px 18px}
.customer-history-modal .customer-history-table-wrap{border-radius:16px;overflow:auto;border:1px solid #d8e5ef}
.customer-history-modal .customer-history-table-wrap .table{min-width:1180px;width:100%;margin:0}
.customer-history-modal .customer-history-table-wrap th{font-size:13px!important;padding:14px 16px!important;white-space:nowrap}
.customer-history-modal .customer-history-table-wrap td{font-size:14px!important;padding:15px 16px!important}
.customer-history-modal .history-approval-date{min-width:165px}
.customer-history-modal .history-approval-date b{font-size:15px}
.customer-history-modal .history-approval-date small{font-size:10px}
.customer-history-modal .history-approved-badge{font-size:10px;padding:7px 11px}
.customer-history-modal .history-suggested-value{color:#c26b00;font-size:16px}
.customer-history-modal .history-source-row{font-size:12px;padding:14px 16px}
.customer-history-modal .history-series-cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.customer-history-modal .history-series-card{padding:15px 17px}
.customer-history-modal .history-series-card span{font-size:10px}
.customer-history-modal .history-series-card b{font-size:25px}
.customer-history-modal .history-series-card small{font-size:10px}
.customer-history-modal .history-chart-frame svg{min-height:430px}
.customer-history-modal .history-axis-label{font-size:11px}
.customer-history-modal .history-axis-caption{font-size:10px}
.customer-history-modal .history-chart-foot{font-size:10px}
.history-series-card.suggested:before{background:#ef8a17}
.history-series-card.suggested span i{background:#ef8a17}
.history-line.suggested{stroke:#ef8a17;stroke-dasharray:9 6}
.history-dot.suggested{fill:#ef8a17}
@media(max-width:980px){
  .customer-history-modal .history-series-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  #guestPortal .guest-quick-actions-pro .guest-clear-chat-btn{margin-left:0}
}
@media(max-width:760px){
  .modal.customer-history-modal{width:100%!important;height:94vh!important;border-radius:18px 18px 0 0!important}
  .customer-history-modal .smart-modal-head{padding:15px 16px 12px!important}
  .customer-history-modal .smart-modal-head h3{font-size:21px!important}
  .customer-history-modal #modalSuggestions{padding:14px 14px 20px!important}
  .customer-history-modal .history-series-cards{grid-template-columns:1fr}
}

/* V54 — per-module viewport fit and stable navigation at 100% zoom */
html{max-width:100%;overflow-x:hidden}
.app-shell,.page,.module,.module-stack,.dashboard-stack,.admin-panel,
.card,.card-head,.card-body,.toolbar-panel,.title-panel,
.card-grid,.dashboard-grid,.formula-grid,.analytics-grid,.analytics-card,
.model-bom-workspace-card,.model-bom-pane,.model-bom-contained-layout,
.packing-contained-layout,.model-bom-list-panel,.model-bom-detail-panel{
  min-width:0;
  max-width:100%;
}
.page{width:100%;overflow-x:clip}
.module.active{width:100%;max-width:100%}
.card-head>*,.card-body>*,.action-strip,.search-row,.filters,.pager,
.material-search-group,.quotation-pager,.admin-clean-body,.notify-control-shell{
  min-width:0;
}
.table-wrap{
  width:100%;
  max-width:100%;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable both-edges;
}
.table-wrap::-webkit-scrollbar{width:10px;height:10px}
.table-wrap::-webkit-scrollbar-thumb{background:#b8cce0;border:2px solid transparent;border-radius:999px;background-clip:padding-box}
.table-wrap::-webkit-scrollbar-track{background:rgba(170,193,216,.14)}
html[data-theme=dark] .table-wrap::-webkit-scrollbar-thumb{background:#436482;border:2px solid transparent;background-clip:padding-box}

/* Keep the main horizontal scrollbar visible inside laptop-height viewports. */
#ratesTable .table-wrap{max-height:clamp(300px,calc(100dvh - 365px),640px)}
#formulaFullTable .table-wrap{max-height:clamp(320px,calc(100dvh - 315px),680px)}
#calculation #calcResult>.table-wrap,
#calculation #calcResult .quotation-result-table-wrap{max-height:clamp(250px,calc(100dvh - 485px),560px)}
#dashboard #recentChangesTable .table-wrap{max-height:clamp(250px,calc(100dvh - 430px),500px)}
#admin #conflictTable .table-wrap,
#admin #monitoringTable .table-wrap,
#admin #userTable .table-wrap,
#admin #guestRecentChatTable .table-wrap{max-height:clamp(280px,calc(100dvh - 390px),560px)}

/* Toolbars stay inside the module instead of creating page-level horizontal overflow. */
.toolbar-panel{max-width:100%;overflow:visible;flex-wrap:wrap}
.material-toolbar #materialStatusFilter{margin-left:auto;min-width:220px;max-width:320px}
.material-toolbar .edit-actions{margin-left:0}
.admin-tabs{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:thin}
.admin-tabs .admin-tab{flex:1 0 150px;min-width:150px}
.card-head,.card-head-actions{flex-wrap:wrap}
.card-head-actions .action-strip{margin-left:auto;justify-content:flex-end;flex-wrap:wrap}

/* Model/BOM keeps a clear hierarchy: three BOM tabs, then compact context actions. */
.model-bom-workspace-head{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  grid-template-rows:auto!important;
  align-items:center!important;
  gap:14px!important;
  padding:11px 16px!important;
}
.model-bom-switcher{
  grid-column:1!important;
  grid-row:1!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(118px,auto))!important;
  width:max-content!important;
  max-width:100%!important;
  gap:5px!important;
  padding:4px!important;
  white-space:nowrap;
}
.model-bom-switch{min-width:118px!important;height:38px!important;padding:0 14px!important;font-size:12px!important;line-height:1!important}
.model-bom-switch .switch-icon{font-size:14px!important}
.model-bom-action-zone{
  grid-column:2!important;
  grid-row:1!important;
  justify-self:end!important;
  justify-content:flex-end!important;
  gap:7px!important;
  flex-wrap:wrap!important;
}
.model-bom-action-zone .tool-btn,.model-bom-action-zone .btn-main{
  min-height:0!important;
  height:34px!important;
  padding:0 12px!important;
  border-radius:10px!important;
  font-size:11.5px!important;
  font-weight:760!important;
  line-height:1!important;
  box-shadow:none!important;
}
.model-bom-action-zone .packing-ai-btn{padding:0 14px!important;box-shadow:0 5px 12px rgba(16,171,210,.16)!important}
@media(max-width:1180px){
  .model-bom-workspace-head{grid-template-columns:1fr!important}
  .model-bom-switcher{grid-column:1!important;grid-row:1!important}
  .model-bom-action-zone{grid-column:1!important;grid-row:2!important;justify-self:start!important;justify-content:flex-start!important}
}
@media(max-width:760px){
  .model-bom-switcher{width:100%!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .model-bom-switch{min-width:0!important;padding:0 8px!important}
  .packing-master-toolbar{grid-template-columns:1fr!important}
  #packingBomPane .master-table-hint{justify-self:start;text-align:left}
}

/* Internal AI reserves a viewport workspace so the compose bar always remains visible. */
#poScan{overflow:hidden}
#poScan .internal-ai-shell{
  height:clamp(470px,calc(100dvh - 178px),840px);
  min-height:0!important;
  max-height:calc(100dvh - 178px);
  grid-template-rows:auto auto minmax(0,1fr) auto;
  contain:layout paint;
}
#poScan .internal-ai-topbar{min-width:0;flex-wrap:wrap}
#poScan .internal-ai-topbar>div:first-child{min-width:0;flex:1 1 520px}
#poScan .internal-ai-topbar p{max-width:100%;overflow-wrap:anywhere}
#poScan .internal-quick-actions{max-width:100%;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:thin}
#poScan .internal-quick-actions>*{flex:0 0 auto}
#poScan .internal-chat{
  min-height:0!important;
  max-height:none!important;
  overflow:auto!important;
  overscroll-behavior:contain;
}
#poScan .internal-chat .table-wrap{max-width:100%}
#poScan .internal-compose,#poScan .internal-compose .guest-input{min-width:0}

/* Analytics and other dynamic result roots shrink inside their cards. */
.analytics-kpi-row,.analytics-grid{width:100%}
.analytics-card{overflow:hidden}
.analytics-card>div,#guestAnalyticsKpi,#guestVisitTrend,#guestCountryChart,
#guestIntentChart,#guestModelChart,#guestRecentChatTable,#guestOcrHealth{min-width:0;max-width:100%}
.mini-trend{max-width:100%;overflow-x:auto;overflow-y:hidden}
.bar-row,.bar-label{min-width:0}

@media(max-width:1180px){
  .card-head-search{grid-template-columns:1fr!important}
  .card-head-search .pager,.quotation-pager{justify-content:flex-start!important;flex-wrap:wrap}
  .material-search-group{display:grid;grid-template-columns:minmax(0,1fr) auto;width:100%}
  .material-toolbar #materialStatusFilter{margin-left:0}
  .pro-notify-shell,.quote-detail-grid{grid-template-columns:1fr}
}
@media(max-width:1100px) and (min-width:761px){
  #poScan .internal-ai-shell{
    height:calc(100dvh - 206px);
    max-height:calc(100dvh - 206px);
  }
}
@media(max-width:760px){
  .page{overflow-x:hidden}
  .toolbar-panel{overflow-x:auto;flex-wrap:nowrap}
  .material-search-group{grid-template-columns:1fr}
  #poScan{overflow:visible}
  #poScan .internal-ai-shell{
    height:calc(100dvh - 160px);
    max-height:calc(100dvh - 160px);
    min-height:420px!important;
    border-radius:16px;
  }
  #poScan .internal-compose{grid-template-columns:1fr!important}
  #poScan .internal-compose .attach-btn,#poScan .internal-compose .btn-main{width:100%}
}

/* V55 — canonical Material Price master and controlled before/after approval review */
#rates .material-head{align-items:center}
#ratesTable .table{min-width:880px}
#ratesTable .table th:nth-child(1){width:25%}
#ratesTable .table th:nth-child(2){width:11%}
#ratesTable .table th:nth-child(3){width:24%}
#ratesTable .table th:nth-child(4){width:15%}
#ratesTable .table th:nth-child(5){width:14%}
#ratesTable .table th:nth-child(6){width:11%}
#ratesTable .material-drill b{font-size:15px;letter-spacing:.01em}
#ratesTable .material-master-unit{display:inline-flex;min-width:54px;justify-content:center;padding:7px 10px;border-radius:10px;background:rgba(20,130,183,.08);color:var(--text)}
#ratesTable .material-master-price{font-size:16px;white-space:nowrap}
#ratesTable .material-master-price-input{min-width:150px;text-align:right;font-weight:900}
#ratesTable .compact-material-hint{justify-content:flex-start;line-height:1.45}

.modal.rate-revision-preview-modal{
  width:min(1320px,calc(100vw - 36px));
  max-width:1320px;
  max-height:min(92vh,920px);
  overflow:hidden;
}
.rate-revision-preview-modal .modal-head{align-items:flex-start}
.rate-revision-preview-modal .modal-head h3{font-size:24px;margin:3px 0 4px}
.rate-revision-preview-modal .modal-head p{max-width:780px;color:var(--muted);margin:0}
.rate-preview-body{padding:18px 22px;overflow:auto;display:grid;gap:16px;min-height:0}
.rate-preview-summary-grid{display:grid;grid-template-columns:1.4fr repeat(3,minmax(0,1fr));gap:12px}
.rate-preview-summary-grid>div{min-width:0;padding:14px 15px;border:1px solid var(--line);border-radius:15px;background:var(--soft)}
.rate-preview-summary-grid span{display:block;color:var(--muted);font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.07em}
.rate-preview-summary-grid b{display:block;margin-top:6px;font-size:15px;line-height:1.35}
.rate-preview-summary-grid small{display:block;margin-top:5px;color:var(--muted);font-size:10px;line-height:1.4}
.rate-market-reference-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:14px;border:1px solid rgba(27,157,190,.25);border-radius:16px;background:rgba(39,198,210,.06)}
.rate-market-reference-grid label>span,.rate-preview-reason{font-size:11px;font-weight:900;color:var(--muted)}
.rate-market-input{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;margin-top:7px;border:1px solid var(--line);border-radius:11px;background:var(--surface);overflow:hidden}
.rate-market-input input{width:100%;border:0!important;background:transparent!important;padding:10px 11px;font-size:15px;font-weight:900;color:var(--text);outline:none}
.rate-market-input em{padding:0 10px;color:var(--muted);font-size:10px;font-style:normal;font-weight:900;white-space:nowrap}
.rate-preview-table-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
.rate-preview-table-title b{font-size:15px}
.rate-preview-table-title span{font-size:11px;font-weight:900;color:var(--muted)}
#rateRevisionPreviewTable .table-wrap{max-height:330px;border:1px solid var(--line);border-radius:14px}
#rateRevisionPreviewTable .table{min-width:960px;margin:0}
#rateRevisionPreviewTable th{position:sticky;top:0;z-index:2;background:var(--soft)}
#rateRevisionPreviewTable td,#rateRevisionPreviewTable th{padding:12px 13px}
.rate-preview-reason{display:grid;gap:7px}
.rate-preview-reason textarea{width:100%;resize:vertical;min-height:64px;border:1px solid var(--line);border-radius:12px;padding:11px 12px;background:var(--surface);color:var(--text);font:inherit}
.sapali-return-link{width:max-content;min-height:34px;padding:0 13px;display:inline-flex;align-items:center;justify-content:center;border:1px solid color-mix(in srgb,var(--accent) 42%,transparent);border-radius:999px;color:var(--accent);background:color-mix(in srgb,var(--accent) 9%,transparent);font-size:11px;font-weight:900;letter-spacing:.025em;text-decoration:none;transition:transform .18s,border-color .18s,background .18s}
.sapali-return-link:hover{transform:translateX(-2px);border-color:var(--accent);background:color-mix(in srgb,var(--accent) 15%,transparent)}
.entry-brand .sapali-return-link{margin-bottom:20px;color:#61dbe7;border-color:rgba(97,219,231,.42);background:rgba(53,193,209,.08)}
.brand .sapali-return-link{margin-bottom:8px}
.guest-head-actions .sapali-return-link{margin-right:4px}
.delta-up{color:#c35f00;font-weight:900}
.delta-down{color:#00866a;font-weight:900}
.delta-flat{color:var(--muted);font-weight:900}
.rate-revision-preview-modal .modal-actions{border-top:1px solid var(--line);padding:14px 22px;background:var(--surface)}
@media(max-width:1050px){
  .rate-preview-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .rate-market-reference-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:680px){
  .modal.rate-revision-preview-modal{width:100%;max-height:94vh;border-radius:18px 18px 0 0}
  .rate-preview-body{padding:14px}
  .rate-preview-summary-grid,.rate-market-reference-grid{grid-template-columns:1fr}
}

/* Unified Pricing sign-in ------------------------------------------------ */
.pricing-login-gateway.entry-gateway{
  position:relative;
  min-height:100vh;
  overflow:hidden;
  isolation:isolate;
  padding:28px 34px;
  display:grid;
  place-items:center;
  background:linear-gradient(130deg,#06162f 0%,#092955 54%,#104a8d 100%);
  color:#fff;
}
.pricing-login-backdrop,.pricing-login-grid{position:absolute;inset:0;z-index:-2;pointer-events:none}
.pricing-login-backdrop{background:radial-gradient(circle at 13% 17%,rgba(61,225,239,.18),transparent 26%),radial-gradient(circle at 86% 80%,rgba(76,111,255,.28),transparent 35%),linear-gradient(115deg,transparent 0 59%,rgba(255,255,255,.038) 59% 60%,transparent 60%)}
.pricing-login-backdrop:before,.pricing-login-backdrop:after{content:"";position:absolute;border:1px solid rgba(104,205,255,.17);border-radius:50%}
.pricing-login-backdrop:before{width:560px;height:560px;right:-190px;top:-260px}.pricing-login-backdrop:after{width:390px;height:390px;left:-230px;bottom:-250px}
.pricing-login-grid{opacity:.38;background-image:linear-gradient(rgba(104,190,247,.065) 1px,transparent 1px),linear-gradient(90deg,rgba(104,190,247,.065) 1px,transparent 1px);background-size:58px 58px;mask-image:linear-gradient(100deg,#000,transparent 84%)}
.pricing-login-shell{width:min(1320px,100%);min-height:min(790px,calc(100vh - 56px));display:grid;grid-template-columns:minmax(0,1.08fr) minmax(420px,.72fr);gap:clamp(50px,6vw,96px);align-items:center;padding:38px 0}
.pricing-login-story{min-width:0}
.pricing-login-toolbar{margin-bottom:clamp(34px,5vh,62px);display:flex;align-items:center;justify-content:space-between;gap:16px}
.pricing-login-toolbar .sapali-return-link{min-height:42px;margin:0;padding:0 17px;color:#8cebf6;border-color:rgba(105,221,239,.36);background:rgba(26,160,187,.1)}
.pricing-login-preferences{display:inline-flex;align-items:center;gap:8px;padding:6px;border:1px solid rgba(255,255,255,.13);border-radius:16px;background:rgba(255,255,255,.065);box-shadow:0 16px 40px rgba(0,0,0,.12);backdrop-filter:blur(18px)}
.pricing-login-preferences label{display:inline-flex;align-items:center;gap:7px;color:#eef6ff;font-size:10px;font-weight:900}
.pricing-login-preferences select{min-height:32px;padding:0 10px;border:1px solid rgba(143,189,255,.32);border-radius:10px;background:rgba(255,255,255,.09);color:#fff;font:inherit;font-size:10px;font-weight:900;cursor:pointer}
.pricing-login-preferences option{color:#081735;background:#fff}
.pricing-brand-lockup{margin-bottom:31px;display:flex;align-items:center;gap:15px}.pricing-brand-lockup>div{display:grid;gap:2px}.pricing-brand-lockup strong{font-size:25px;line-height:1;letter-spacing:.08em}.pricing-brand-lockup small{color:#83a8d5;font-size:9px;font-weight:850;letter-spacing:.31em}
.pricing-brand-mark{width:49px;height:49px;position:relative;display:grid;place-items:center;border:1px solid rgba(118,223,248,.42);border-radius:15px;background:linear-gradient(145deg,rgba(49,194,225,.23),rgba(64,103,232,.18));box-shadow:0 15px 36px rgba(2,13,34,.25)}
.pricing-brand-mark i{position:absolute;width:22px;height:2px;border-radius:2px;background:#80e9f4;transform-origin:left}.pricing-brand-mark i:nth-child(1){transform:rotate(-42deg);left:13px;top:29px}.pricing-brand-mark i:nth-child(2){width:18px;transform:rotate(42deg);left:12px;top:17px}.pricing-brand-mark i:nth-child(3){width:11px;height:11px;left:26px;top:12px;border:2px solid #80e9f4;border-radius:50%;background:transparent}
.pricing-login-kicker{margin-bottom:16px;display:inline-flex;align-items:center;gap:10px;color:#77e8f4;font-size:11px;font-weight:900;letter-spacing:.2em;text-transform:uppercase}.pricing-login-kicker i{width:7px;height:7px;border-radius:50%;background:#55e0b7;box-shadow:0 0 0 6px rgba(85,224,183,.12),0 0 22px rgba(85,224,183,.65)}
.pricing-login-story h1{max-width:760px;margin:0;font-size:clamp(48px,4.35vw,72px);line-height:.97;letter-spacing:-.052em;text-wrap:balance}.pricing-login-story>p{max-width:720px;margin:22px 0 0;color:#c6dcf6;font-size:16px;line-height:1.72}
.pricing-flow-map{position:relative;max-width:720px;margin-top:35px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.pricing-flow-line{position:absolute;left:7%;right:18%;top:13px;height:1px;background:linear-gradient(90deg,#44d8e9,rgba(92,190,255,.34),#4c8eff)}
.pricing-flow-map>div:not(.pricing-flow-line){position:relative;z-index:1;display:grid;gap:8px}.pricing-flow-map span{width:27px;height:27px;display:grid;place-items:center;border:1px solid rgba(119,232,244,.64);border-radius:50%;background:#0b2b55;color:#85eff7;font-size:8px;font-weight:900;box-shadow:0 0 0 5px rgba(57,201,231,.08)}.pricing-flow-map strong{color:#edf8ff;font-size:12px}.pricing-flow-map small{color:#779abc;font-size:9px;font-weight:800}
.pricing-login-proof{max-width:720px;margin-top:27px;padding-top:22px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;border-top:1px solid rgba(159,204,246,.15)}.pricing-login-proof>div{display:grid;gap:6px}.pricing-login-proof span{color:#7898bd;font-size:9px;font-weight:900;letter-spacing:.15em;text-transform:uppercase}.pricing-login-proof strong{color:#e6f3ff;font-size:11px;line-height:1.4}
.pricing-login-card{position:relative;overflow:hidden;padding:clamp(35px,4vw,50px);border:1px solid rgba(255,255,255,.72);border-radius:30px;background:rgba(255,255,255,.97);color:#091a34;box-shadow:0 34px 90px rgba(1,12,31,.38),inset 0 1px 0 #fff}
.pricing-login-card:before{content:"";position:absolute;inset:0 0 auto;height:4px;background:linear-gradient(90deg,#34cadc,#318cff,#6a75ff)}.pricing-login-card:after{content:"";position:absolute;width:190px;height:190px;right:-90px;top:-105px;border-radius:50%;background:rgba(54,156,255,.09)}
.pricing-card-icon{width:57px;height:57px;position:relative;margin-bottom:28px;border-radius:18px;background:linear-gradient(145deg,#0d315e,#1264ab);box-shadow:0 15px 32px rgba(15,86,154,.24)}.pricing-card-icon span{position:absolute;border-radius:50%}.pricing-card-icon span:nth-child(1){width:23px;height:23px;left:15px;top:12px;border:2px solid #8cedf5}.pricing-card-icon span:nth-child(2){width:15px;height:2px;left:34px;top:36px;background:#8cedf5;transform:rotate(46deg)}.pricing-card-icon span:nth-child(3){width:7px;height:7px;left:12px;bottom:9px;background:#42d9b1;box-shadow:0 0 0 4px rgba(66,217,177,.13)}
.pricing-card-kicker{color:#237ada;font-size:10px;font-weight:950;letter-spacing:.2em;text-transform:uppercase}.pricing-login-card h2{margin:8px 0 0;font-size:34px;line-height:1.05;letter-spacing:-.035em}.pricing-login-card>p{margin:11px 0 0;color:#657a98;font-size:13px;line-height:1.6}
.pricing-login-form{margin-top:30px;display:grid;gap:19px}.pricing-login-field{display:grid;gap:8px;color:#607492;font-size:10px;font-weight:900;letter-spacing:.09em;text-transform:uppercase}.pricing-input-wrap{position:relative;display:block}.pricing-input-wrap>b{position:absolute;z-index:1;left:17px;top:50%;transform:translateY(-50%);color:#3a8dde;font-size:12px}.pricing-input-wrap input{width:100%;height:54px;padding:0 16px 0 43px;border:1px solid #d4e0ed;border-radius:15px;outline:0;background:linear-gradient(180deg,#fff,#f8fbff);color:#0b1e3a;font:inherit;font-size:14px;letter-spacing:normal;text-transform:none;transition:border-color .18s,box-shadow .18s,transform .18s}.pricing-input-wrap input:focus{border-color:#47a6ef;box-shadow:0 0 0 4px rgba(52,151,232,.11);transform:translateY(-1px)}
.pricing-login-help{display:flex;align-items:center;justify-content:space-between;gap:14px}.pricing-login-help>span{display:inline-flex;align-items:center;gap:7px;color:#69809d;font-size:10px;font-weight:800}.pricing-login-help>span i{width:6px;height:6px;border-radius:50%;background:#32d6a2;box-shadow:0 0 0 4px rgba(50,214,162,.12)}.pricing-login-help .link-btn{color:#267bc6;font-size:10px}
.pricing-login-submit{width:100%;height:54px;padding:0 20px 0 22px;display:flex;align-items:center;justify-content:space-between;border:0;border-radius:15px;background:linear-gradient(105deg,#1578d5,#28a9f1);color:#fff;font:inherit;font-size:12px;font-weight:900;letter-spacing:.025em;box-shadow:0 16px 32px rgba(24,125,209,.25);cursor:pointer;transition:transform .18s,box-shadow .18s,filter .18s}.pricing-login-submit:hover{transform:translateY(-2px);box-shadow:0 21px 38px rgba(24,125,209,.34);filter:saturate(1.1)}.pricing-login-submit>b{font-size:18px;font-weight:500}
.pricing-login-form #loginResult .action-box{margin:0;padding:11px 13px;border-radius:12px;font-size:11px}
.pricing-role-note{margin-top:24px;padding:16px;display:grid;grid-template-columns:31px 1fr;gap:12px;border:1px solid #dce9f4;border-radius:16px;background:#f5faff}.pricing-role-note>span{width:31px;height:31px;display:grid;place-items:center;border-radius:10px;background:#e0f7f3;color:#0f9d7b;font-weight:950}.pricing-role-note p{margin:0;display:grid;gap:4px}.pricing-role-note strong{color:#28415f;font-size:11px}.pricing-role-note small{color:#70839d;font-size:10px;line-height:1.45}
html[data-theme=dark] .pricing-login-card{border-color:rgba(114,192,245,.20);background:rgba(8,27,53,.97);color:#edf7ff;box-shadow:0 34px 90px rgba(0,0,0,.45)}html[data-theme=dark] .pricing-login-card>p,html[data-theme=dark] .pricing-login-help>span{color:#9cb2ce}html[data-theme=dark] .pricing-login-field{color:#96abc6}html[data-theme=dark] .pricing-input-wrap input{border-color:#29486b;background:#0e294a;color:#eff8ff}html[data-theme=dark] .pricing-role-note{border-color:#264665;background:#0b2341}html[data-theme=dark] .pricing-role-note strong{color:#d9ecff}html[data-theme=dark] .pricing-role-note small{color:#91a8c4}
@media(max-width:1050px){.pricing-login-shell{grid-template-columns:1fr minmax(380px,.8fr);gap:42px}.pricing-login-story h1{font-size:clamp(42px,5vw,59px)}.pricing-login-proof{grid-template-columns:1fr;gap:10px}.pricing-flow-map small{display:none}}
@media(max-width:840px){.pricing-login-gateway.entry-gateway{overflow:auto;place-items:start center;padding:20px 16px 36px}.pricing-login-shell{width:min(680px,100%);grid-template-columns:1fr;gap:30px;padding:0}.pricing-login-toolbar{margin-bottom:32px}.pricing-login-proof{grid-template-columns:repeat(3,1fr)}.pricing-login-card{padding:34px}}
@media(max-width:560px){.pricing-login-toolbar{align-items:stretch;flex-direction:column;gap:10px}.pricing-login-preferences{width:100%;justify-content:space-between}.pricing-brand-lockup{margin:28px 0 22px}.pricing-login-story h1{font-size:39px}.pricing-login-story>p{font-size:14px}.pricing-flow-map{grid-template-columns:1fr;gap:17px}.pricing-flow-line{display:none}.pricing-flow-map>div:not(.pricing-flow-line){grid-template-columns:30px 1fr;align-items:center}.pricing-flow-map small{grid-column:2}.pricing-login-proof{grid-template-columns:1fr}.pricing-login-card{padding:28px 22px;border-radius:24px}.pricing-login-card h2{font-size:30px}}

/* Shared Sapali identity: elegant platform access denial */
.platform-denied{position:relative;min-height:100vh;overflow:hidden;padding:32px;display:grid;place-items:center;isolation:isolate;color:#fff;background:radial-gradient(circle at 18% 12%,rgba(53,211,229,.16),transparent 26%),radial-gradient(circle at 82% 86%,rgba(63,105,255,.25),transparent 34%),linear-gradient(130deg,#06162f,#092650 54%,#0b4383)}
.platform-denied-orbit{position:absolute;z-index:-1;width:760px;height:760px;right:-300px;top:-360px;border:1px solid rgba(108,207,255,.18);border-radius:50%}.platform-denied-orbit:after{content:"";position:absolute;inset:120px;border:1px solid rgba(108,207,255,.11);border-radius:50%}
.platform-denied-shell{width:min(860px,100%);display:grid;gap:22px}.platform-denied-shell>.sapali-return-link{color:#8cebf6;border-color:rgba(105,221,239,.36);background:rgba(26,160,187,.1)}
.platform-denied-card{position:relative;overflow:hidden;padding:clamp(34px,5vw,64px);border:1px solid rgba(255,255,255,.16);border-radius:32px;background:linear-gradient(145deg,rgba(8,31,62,.94),rgba(10,49,92,.88));box-shadow:0 38px 100px rgba(0,0,0,.35);backdrop-filter:blur(22px)}
.platform-denied-card:before{content:"";position:absolute;inset:0 0 auto;height:3px;background:linear-gradient(90deg,#3bd8e8,#2f92ee,#6976ff)}
.platform-denied-icon{width:66px;height:66px;position:relative;margin-bottom:28px;border:1px solid rgba(111,229,241,.36);border-radius:20px;background:linear-gradient(145deg,rgba(49,194,225,.22),rgba(64,103,232,.18))}.platform-denied-icon span{position:absolute;width:24px;height:19px;left:20px;top:27px;border:2px solid #86edf5;border-radius:5px}.platform-denied-icon i{position:absolute;width:17px;height:16px;left:24px;top:15px;border:2px solid #86edf5;border-bottom:0;border-radius:12px 12px 0 0}
.platform-denied-kicker{color:#7be7f3;font-size:10px;font-weight:950;letter-spacing:.22em}.platform-denied-card h1{max-width:700px;margin:13px 0 0;font-size:clamp(36px,5vw,58px);line-height:1.02;letter-spacing:-.045em}.platform-denied-card>p{max-width:650px;margin:17px 0 0;color:#bcd3ee;font-size:15px;line-height:1.65}
.platform-denied-identity{margin-top:30px;padding:18px 20px;display:grid;gap:6px;border:1px solid rgba(136,196,241,.16);border-radius:17px;background:rgba(255,255,255,.055)}.platform-denied-identity span{color:#789bbc;font-size:9px;font-weight:900;letter-spacing:.14em;text-transform:uppercase}.platform-denied-identity strong{color:#fff;font-size:18px}.platform-denied-identity small{color:#9db5d0;font-size:11px}
.platform-denied-actions{margin-top:22px;display:flex;gap:11px;flex-wrap:wrap}.platform-denied-actions a,.platform-denied-actions button{min-height:49px;padding:0 18px;display:inline-flex;align-items:center;justify-content:center;gap:24px;border-radius:14px;font:inherit;font-size:11px;font-weight:900;text-decoration:none;cursor:pointer}.platform-denied-primary{border:0;background:linear-gradient(105deg,#1578d5,#28a9f1);color:#fff;box-shadow:0 15px 30px rgba(24,125,209,.24)}.platform-denied-actions button{border:1px solid rgba(143,189,255,.24);background:rgba(255,255,255,.06);color:#dcecff}
.platform-denied-trust{margin-top:26px;padding-top:19px;display:flex;align-items:center;gap:10px;border-top:1px solid rgba(159,204,246,.14)}.platform-denied-trust>i{width:7px;height:7px;border-radius:50%;background:#48d7ae;box-shadow:0 0 0 6px rgba(72,215,174,.11)}.platform-denied-trust span{display:grid;gap:3px}.platform-denied-trust strong{font-size:11px}.platform-denied-trust small{color:#809fbe;font-size:10px}
@media(max-width:560px){.platform-denied{padding:18px}.platform-denied-shell{gap:16px}.platform-denied-card{padding:30px 23px;border-radius:25px}.platform-denied-card h1{font-size:36px}.platform-denied-actions{display:grid}.platform-denied-actions a,.platform-denied-actions button{width:100%}}

/* Material master + workbook packing standard (2026-07-23) */
#ratesTable .material-master-name{display:block;min-width:145px;max-width:260px;color:var(--text);font-weight:800;line-height:1.35;white-space:normal}
#ratesTable .material-new-name{min-width:180px}
#ratesTable table th:nth-child(1){min-width:145px}
#ratesTable table th:nth-child(2){min-width:175px}
#ratesTable table th:nth-child(3){min-width:175px;text-align:right}
#ratesTable table th:nth-child(4){min-width:95px;text-align:center}
#ratesTable table td:nth-child(3){text-align:right}
#ratesTable table td:nth-child(4){text-align:center}
.packing-workbook-standard{margin:14px 16px 16px;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:0 8px 24px rgba(23,62,108,.05)}
.packing-workbook-standard .packing-panel-head{padding:14px 16px 8px}
.packing-workbook-grid{grid-template-columns:repeat(4,minmax(165px,1fr));padding:10px 16px 12px;gap:8px}
.packing-workbook-note{margin:0 16px 14px}
html[data-theme=dark] .packing-workbook-standard{background:#0d2038;border-color:#29496b}
@media(max-width:1050px){.packing-workbook-grid{grid-template-columns:repeat(2,minmax(165px,1fr))}}
@media(max-width:650px){.packing-workbook-grid{grid-template-columns:1fr}}

/* Material Price visual consistency + whole-VND display (2026-07-23) */
#ratesTable .table tbody td{
  font-size:13px!important;
  line-height:1.28!important;
  font-weight:800;
  color:var(--ink);
}
#ratesTable .material-master-name,
#ratesTable .material-master-unit,
#ratesTable .material-master-price,
#ratesTable .material-drill,
#ratesTable .material-drill b,
#ratesTable .text-action{
  font-size:13px!important;
  line-height:1.28!important;
  font-weight:800!important;
  color:var(--ink)!important;
}
#ratesTable .material-master-price{
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
#ratesTable .material-master-unit{
  min-width:58px;
  padding:6px 9px;
  background:rgba(90,120,160,.08);
}
#ratesTable .material-drill,
#ratesTable .text-action{
  text-decoration:none!important;
}
#ratesTable .material-drill:hover,
#ratesTable .text-action:hover{
  color:var(--primary)!important;
  text-decoration:underline!important;
  text-underline-offset:3px;
}
#ratesTable .muted{
  color:var(--muted)!important;
  font-size:13px!important;
}
#ratesTable .warning-status-btn,
#ratesTable .tag,
#ratesTable .pill{
  font-size:11px!important;
}
html[data-theme="dark"] #ratesTable .material-master-unit{
  background:rgba(120,160,205,.12);
}
/* Pricing governance extension: unified typography, Plastic BOM and FC workspace */
.module table td,.module table th,.module input,.module select,.module button{font-size:14px}
.module table td{color:#111827;font-weight:500}.module table td b{color:inherit;font-size:inherit}.module table .tag,.module table .pill{font-size:12px}
.price-up{color:#b42318!important;font-weight:700}.price-down{color:#067647!important;font-weight:700}
.quotation-view-tabs{display:flex;gap:8px;margin-top:10px}.quotation-view-tab{border:1px solid #cbd5e1;background:#fff;color:#111827;border-radius:10px;padding:7px 13px;font-weight:700}.quotation-view-tab.active{background:#0b5b74;color:#fff;border-color:#0b5b74}
.fc-control-panel{display:grid;grid-template-columns:minmax(260px,1fr) repeat(3,minmax(135px,180px)) auto auto;gap:12px;align-items:end;margin-bottom:16px;padding:16px;border:1px solid #d8e3ef;border-radius:16px;background:#f8fbff}.fc-control-panel p{margin:4px 0 0;color:#475467}.fc-control-panel label{display:grid;gap:6px;font-weight:700;color:#111827}.fc-control-panel input{width:100%;padding:10px;border:1px solid #cbd5e1;border-radius:10px;color:#111827;background:#fff}
.plastic-contained-layout{min-height:590px}.plastic-bom-row{width:100%;display:flex;justify-content:space-between;align-items:center;text-align:left;border:0;border-bottom:1px solid #e5e7eb;background:#fff;color:#111827;padding:13px 14px}.plastic-bom-row:hover,.plastic-bom-row.active{background:#eef8fb}.plastic-bom-row span{display:grid;gap:3px}.plastic-bom-row small{color:#667085}.plastic-bom-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:14px 0}.plastic-bom-summary>div{border:1px solid #d8e3ef;border-radius:12px;padding:12px;background:#fff;display:grid;gap:4px}.plastic-bom-summary span{color:#667085}.plastic-bom-summary b{color:#111827}
.packing-formula-detail{display:grid;gap:16px}
@media(max-width:1100px){.fc-control-panel{grid-template-columns:1fr 1fr}.fc-control-panel>div:first-child{grid-column:1/-1}}

/* V57 — unified product UI scale, premium controls, quotation reliability and Product-style Plastic BOM */
:root{
  --ui-font-xs:10.5px;
  --ui-font-sm:11.5px;
  --ui-font-md:12.25px;
  --ui-font-title:15px;
  --ui-control-h:34px;
  --ui-control-radius:10px;
  --ui-text:#111827;
  --ui-text-soft:#52657f;
}

/* Undo the former blanket 14px rule. Keep hierarchy intentional and consistent. */
.page .module button,
.page .module input,
.page .module select,
.page .module textarea{font-size:var(--ui-font-sm)!important}
.page .module .table th{font-size:var(--ui-font-xs)!important;font-weight:800!important;line-height:1.15!important}
.page .module .table td{font-size:var(--ui-font-md)!important;font-weight:500!important;line-height:1.28!important;color:var(--ui-text)!important}
.page .module .table td b{font-size:inherit!important;color:inherit!important;font-weight:800!important}
.page .module .card-head h3,
.page .module .contained-panel-head h3,
.page .module .model-bom-section-head h3,
.page .module .internal-ai-topbar h3{font-size:var(--ui-font-title)!important;line-height:1.25!important;font-weight:850!important;color:var(--ui-text)!important}
.page .module .card-kicker,
.page .module .kicker{font-size:10px!important;line-height:1.1!important;letter-spacing:.14em!important}
.page .module .muted,
.page .module small{font-size:10.5px}

/* One compact, modern control language across every internal module. */
.page .module .tool-btn,
.page .module .btn-main,
.page .module .chip-btn,
.page .module .quotation-view-tab,
.page .module .admin-tab,
.page .module .customer-history-tabs button{
  min-height:0!important;
  height:var(--ui-control-h)!important;
  padding:0 12px!important;
  border-radius:var(--ui-control-radius)!important;
  font-size:var(--ui-font-sm)!important;
  font-weight:760!important;
  line-height:1!important;
  letter-spacing:0!important;
  box-shadow:none!important;
  transition:transform .16s ease,border-color .16s ease,background .16s ease,box-shadow .16s ease,color .16s ease!important;
}
.page .module .tool-btn:hover,
.page .module .chip-btn:hover,
.page .module .quotation-view-tab:hover,
.page .module .admin-tab:hover{
  transform:translateY(-1px);
  border-color:#8ecbe3!important;
  background:linear-gradient(180deg,#fff 0%,#f1f9fd 100%)!important;
  box-shadow:0 7px 16px rgba(21,88,132,.10)!important;
  color:#073b67!important;
}
.page .module .btn-main:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 18px rgba(11,154,189,.20)!important;
  filter:none!important;
}
.page .module .tool-btn:active,
.page .module .btn-main:active,
.page .module .chip-btn:active,
.page .module .quotation-view-tab:active{transform:translateY(0) scale(.985)}
.page .module .compact-row-action{height:28px!important;padding:0 9px!important;font-size:10.5px!important;border-radius:8px!important}
.page .module .pill,
.page .module .tag{font-size:10.5px!important;padding:4px 8px!important;font-weight:800!important}

.page .module .wide-input,
.page .module .global-search,
.page .module .card-search,
.page .module .mini-select,
.page .module .select,
.page .module input:not([type=checkbox]):not([type=radio]),
.page .module select{
  height:36px!important;
  min-height:36px!important;
  border-radius:10px!important;
  padding-top:0!important;
  padding-bottom:0!important;
  font-size:12px!important;
  font-weight:650!important;
}
.page .module textarea{font-size:12px!important;font-weight:500!important}

/* Normal data is black. Color is reserved for status, warnings and price movement. */
html:not([data-theme=dark]) .page .module,
html:not([data-theme=dark]) .page .module h2,
html:not([data-theme=dark]) .page .module h3,
html:not([data-theme=dark]) .page .module h4,
html:not([data-theme=dark]) .page .module label,
html:not([data-theme=dark]) .page .module .money,
html:not([data-theme=dark]) .page .module .metric b,
html:not([data-theme=dark]) .page .module .kpi-number{color:var(--ui-text)}
html:not([data-theme=dark]) .page .module .card-kicker,
html:not([data-theme=dark]) .page .module .kpi-title,
html:not([data-theme=dark]) .page .module .kpi-note,
html:not([data-theme=dark]) .page .module .master-table-hint{color:var(--ui-text-soft)}

/* Dashboard and analytics hierarchy. */
.page #dashboard .kpi{min-height:84px;padding:12px}
.page #dashboard .kpi-title{font-size:10.5px!important}
.page #dashboard .kpi-number{font-size:24px!important;margin:5px 0 1px!important}
.page #dashboard .kpi-note{font-size:10px!important}
.page #dashboard .metric b{font-size:18px!important}
.page #dashboard .customer-summary .big{font-size:24px!important}

/* Model/BOM tab and toolbar remain the visual reference for the rest of the app. */
.model-bom-switcher{border-radius:13px!important;padding:3px!important;gap:4px!important}
.model-bom-switch{height:36px!important;min-width:116px!important;padding:0 12px!important;border-radius:9px!important;font-size:11.5px!important;font-weight:780!important}
.model-bom-switch .switch-icon{font-size:13px!important}
.model-bom-action-zone .tool-btn,.model-bom-action-zone .btn-main{height:32px!important;padding:0 11px!important;font-size:11px!important;border-radius:9px!important}

/* Product-style Plastic BOM master and detail workspace. */
#plasticBomPane .model-bom-list-panel{background:#fff}
#plasticBomPane .contained-toolbar{grid-template-columns:minmax(320px,620px) minmax(0,1fr);padding-bottom:10px}
#plasticBomPane #plasticBomSearch{max-width:620px!important;height:34px!important;min-height:34px!important}
#plasticBomList .plastic-master-table-wrap{max-height:330px;overflow:auto;border-radius:12px;background:#fff}
#plasticBomList .plastic-master-table{min-width:1040px;width:100%}
#plasticBomList .plastic-master-table thead th{position:sticky;top:0;z-index:2}
#plasticBomList .plastic-master-table tbody tr{cursor:pointer}
#plasticBomList .plastic-master-table tbody tr:hover td{background:#f5faff!important}
#plasticBomList .plastic-master-table tbody tr.selected-row td{
  background:linear-gradient(180deg,#eaf8ff 0%,#f8fcff 100%)!important;
  border-top:1px solid #bfe5f2!important;
  border-bottom:1px solid #bfe5f2!important;
}
#plasticBomList .plastic-master-table tbody tr.selected-row td:first-child{border-left:1px solid #bfe5f2!important;border-radius:10px 0 0 10px}
#plasticBomList .plastic-master-table tbody tr.selected-row td:last-child{border-right:1px solid #bfe5f2!important;border-radius:0 10px 10px 0}
.plastic-master-code{color:#075b9e!important;font-weight:900!important}
.plastic-master-name{font-weight:650;color:#243b58}
.plastic-master-table td:nth-child(4),.plastic-master-table td:nth-child(5){font-variant-numeric:tabular-nums}

#plasticBomDetail{background:#f7fbff;min-height:0}
.plastic-detail-head{background:#fff!important;display:flex;align-items:center;justify-content:space-between;gap:12px}
.plastic-detail-identity{display:flex;align-items:center;gap:8px;min-width:0}
.plastic-detail-identity>b{font-size:13px;color:#0b315f;white-space:nowrap}
.plastic-bom-pane-body{padding:12px 16px 16px!important}
.plastic-lifecycle-strip{
  display:grid;
  grid-template-columns:repeat(6,minmax(120px,1fr));
  margin:0 0 12px;
  border:1px solid #d7e4f1;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
}
.plastic-lifecycle-strip>div{min-width:0;padding:10px 12px;border-right:1px solid #e0e9f3;background:#fff}
.plastic-lifecycle-strip>div:last-child{border-right:0}
.plastic-lifecycle-strip span{display:block;color:#667b98;font-size:9.75px;font-weight:760;line-height:1.2;margin-bottom:4px}
.plastic-lifecycle-strip b{display:block;color:#102f5a;font-size:12px;font-weight:850;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
.plastic-lifecycle-strip .plastic-price-metric{background:linear-gradient(145deg,#f0fbff,#effcf8)}
.plastic-lifecycle-strip .plastic-price-metric b{color:#075b70}
.plastic-lines-wrap{max-height:410px;border-radius:12px!important;background:#fff}
.plastic-lines-table{min-width:1050px;width:100%}
.plastic-lines-table td:nth-child(1),
.plastic-lines-table td:nth-child(4),
.plastic-lines-table td:nth-child(6),
.plastic-lines-table td:nth-child(7){font-variant-numeric:tabular-nums}
.plastic-lines-table tbody tr:hover td{background:#f7fbff!important}
.packing-formula-summary{grid-template-columns:repeat(3,minmax(150px,1fr));margin-bottom:0}

/* Price Quotation is a real workspace, not one oversized empty strip. */
#calculation .quotation-head{display:grid!important;grid-template-columns:auto minmax(300px,1fr) auto;align-items:center;gap:14px;padding:12px 16px!important}
#calculation .quotation-head>div:first-child{min-width:0}
#calculation .quotation-head h3{margin-bottom:7px!important}
#calculation .quotation-view-tabs{display:inline-flex;align-items:center;gap:4px;margin:0!important;padding:3px;border:1px solid #d5e1ed;border-radius:12px;background:#eef5fb;width:max-content;max-width:100%}
#calculation .quotation-view-tab{height:30px!important;border:0!important;border-radius:8px!important;padding:0 11px!important;background:transparent!important;color:#526780!important;box-shadow:none!important}
#calculation .quotation-view-tab:hover{transform:none;background:rgba(255,255,255,.75)!important;color:#0b426c!important;box-shadow:none!important}
#calculation .quotation-view-tab.active{background:linear-gradient(135deg,#0b5b82,#0a8794)!important;color:#fff!important;box-shadow:0 5px 12px rgba(8,101,132,.18)!important}
#calculation #calcModels{width:100%;max-width:680px;justify-self:center}
#calculation .quotation-pager{justify-self:end;flex-wrap:nowrap}
#calculation .row-limit-label{font-size:10px!important;color:#5d7190;font-weight:760;display:flex;align-items:center;gap:6px}
#calculation .calc-limit-select{min-width:102px!important;width:102px!important}
#calculation .card-body{padding:12px 16px 16px}
#calculation .empty-focused-state{min-height:180px;display:flex;align-items:center;justify-content:center;text-align:center;border:1px dashed #ccdce9;border-radius:13px;background:linear-gradient(180deg,#fbfdff,#f4f9fd);color:#5d7190;font-size:12px;font-weight:650;padding:24px}
#calculation .fc-control-panel{grid-template-columns:minmax(280px,1fr) repeat(3,minmax(130px,160px)) auto auto;gap:10px;padding:13px;border-radius:13px;margin-bottom:12px}
#calculation .fc-control-panel h3{font-size:15px!important;margin:2px 0 0}
#calculation .fc-control-panel p{font-size:10.5px;line-height:1.4}
#calculation .fc-control-panel label{font-size:10.5px!important;gap:4px}
#calculation .fc-control-panel input{height:34px!important;min-height:34px!important}

html[data-theme=dark] .page .module .table td{color:#e9f1fb!important}
html[data-theme=dark] .page .module .card-head h3,
html[data-theme=dark] .page .module .contained-panel-head h3,
html[data-theme=dark] .page .module .model-bom-section-head h3{color:#edf5ff!important}
html[data-theme=dark] #plasticBomPane .model-bom-list-panel,
html[data-theme=dark] #plasticBomDetail,
html[data-theme=dark] .plastic-lifecycle-strip,
html[data-theme=dark] .plastic-lifecycle-strip>div{background:#0f223b;border-color:#29466d}
html[data-theme=dark] .plastic-lifecycle-strip b{color:#edf5ff}
html[data-theme=dark] #calculation .quotation-view-tabs{background:#10253e;border-color:#29466d}
html[data-theme=dark] #calculation .quotation-view-tab{color:#bed0e5!important}

@media(max-width:1250px){
  #calculation .quotation-head{grid-template-columns:1fr auto!important}
  #calculation #calcModels{grid-column:1/-1;grid-row:2;max-width:none;justify-self:stretch}
  #calculation .quotation-pager{grid-column:2;grid-row:1}
  #calculation .fc-control-panel{grid-template-columns:repeat(3,minmax(130px,1fr))}
  #calculation .fc-control-panel>div:first-child{grid-column:1/-1}
  .plastic-lifecycle-strip{grid-template-columns:repeat(3,minmax(140px,1fr));gap:0}
  .plastic-lifecycle-strip>div:nth-child(3){border-right:0}
  .plastic-lifecycle-strip>div:nth-child(-n+3){border-bottom:1px solid #e0e9f3}
}
@media(max-width:760px){
  #calculation .quotation-head{grid-template-columns:1fr!important}
  #calculation .quotation-pager,#calculation #calcModels{grid-column:1;grid-row:auto;justify-self:stretch}
  #calculation .quotation-pager{overflow-x:auto;justify-content:flex-start}
  #calculation .quotation-view-tabs{width:100%}
  #calculation .quotation-view-tab{flex:1 1 0;padding:0 7px!important}
  #calculation .fc-control-panel{grid-template-columns:1fr}
  .plastic-lifecycle-strip{grid-template-columns:1fr}
  .plastic-lifecycle-strip>div{border-right:0!important;border-bottom:1px solid #e0e9f3!important}
  .plastic-lifecycle-strip>div:last-child{border-bottom:0!important}
}

/* V58 — quotation navigation reliability, FC table controls and Plastic BOM price linkage */
#calculation.module.active{display:block!important}
#calculation.module.active>.module-stack{display:grid!important;visibility:visible!important;opacity:1!important}
#calculation .quote-view-note{display:flex;align-items:flex-start;gap:10px;margin:0 0 10px;padding:9px 11px;border:1px solid #d7e4f1;border-radius:11px;background:linear-gradient(180deg,#f8fcff,#f1f7fc);color:#263d59}
#calculation .quote-view-note b{flex:0 0 auto;font-size:11px;font-weight:850;color:#0b5b82}
#calculation .quote-view-note span{font-size:10.75px;line-height:1.42;color:#5c708b;font-weight:600}
#calculation .fc-price-table-wrap{max-height:clamp(300px,calc(100dvh - 430px),560px);overflow:auto}
#calculation .fc-price-table{min-width:980px}
#calculation .fc-price-table th{position:sticky;top:0;z-index:2}
#calculation .fc-price-table th,.fc-price-table td{vertical-align:middle}
#calculation .fc-check-cell{width:46px!important;min-width:46px!important;max-width:46px!important;text-align:center!important;padding-left:8px!important;padding-right:8px!important}
#calculation .table input.fc-row-check,
#calculation input.fc-row-check{appearance:auto!important;-webkit-appearance:checkbox!important;width:16px!important;height:16px!important;min-width:16px!important;min-height:16px!important;max-width:16px!important;padding:0!important;margin:0 auto!important;border-radius:3px!important;box-shadow:none!important;display:block!important;cursor:pointer}
#calculation .fc-price-table td.num,#calculation .fc-price-table th:nth-child(n+4){text-align:right}
#calculation .fc-price-table tbody tr:hover td{background:#f7fbff}
#calculation .price-up{color:#b45309!important;font-weight:850}
#calculation .price-down{color:#047857!important;font-weight:850}

#ratesTable .plastic-price-link-note{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 10px;padding:10px 12px;border:1px solid #b9e2dc;border-radius:12px;background:linear-gradient(180deg,#f2fffb,#eefaf8)}
#ratesTable .plastic-price-link-note.has-warning{border-color:#f0d49a;background:linear-gradient(180deg,#fffaf0,#fff7e7)}
#ratesTable .plastic-price-link-note>div:first-child{display:grid;gap:3px;min-width:0}
#ratesTable .plastic-price-link-note b{font-size:11.5px;color:#075b70}
#ratesTable .plastic-price-link-note span{font-size:10.5px;line-height:1.4;color:#5c708b;font-weight:620}
#ratesTable .plastic-price-link-metrics{display:flex;gap:6px;align-items:center;white-space:nowrap}
#ratesTable .plastic-price-link-metrics span{padding:4px 8px;border-radius:999px;background:#e8f7f4;color:#09675c;font-weight:800}
#ratesTable .plastic-price-link-metrics span.warn{background:#fff0d3;color:#9a5b00}

html[data-theme=dark] #calculation .quote-view-note{background:#10253e;border-color:#29466d;color:#dbe9f7}
html[data-theme=dark] #calculation .quote-view-note span{color:#b8c9dc}
html[data-theme=dark] #ratesTable .plastic-price-link-note{background:#102a31;border-color:#2d5a5b}

@media(max-width:760px){
  #calculation .quote-view-note,#ratesTable .plastic-price-link-note{display:grid;grid-template-columns:1fr}
  #ratesTable .plastic-price-link-metrics{white-space:normal;flex-wrap:wrap}
}

/* Pricing integration hardening: Plastic final cost, FC interactions and shared row limits */
#calculation #fcNewPricePane,#calculation #priceApprovedPane{position:relative;z-index:1;pointer-events:auto}
#calculation .fc-control-panel,#calculation .fc-control-panel *{pointer-events:auto}
#calculation .fc-control-panel input{position:relative;z-index:2;cursor:text;user-select:text}
#calculation .fc-row-check{width:16px!important;height:16px!important;min-width:16px!important;min-height:16px!important;cursor:pointer;accent-color:#0a8194}
#calculation .fc-check-cell{width:46px!important;min-width:46px!important;text-align:center!important;padding-left:10px!important;padding-right:10px!important}
#calculation .fc-data-note{margin:-3px 0 10px;padding:8px 11px;border:1px solid #d9e7f2;border-radius:10px;background:#f5faff;color:#40566f;font-size:10.5px;line-height:1.45}
#calculation .fc-price-table td .price-up{color:#b42318;font-weight:700}
#calculation .fc-price-table td .price-down{color:#067647;font-weight:700}
#calculation [data-approved-history],#calculation [data-open-price-history]{cursor:pointer;pointer-events:auto}

.plastic-lifecycle-strip-expanded{grid-template-columns:repeat(7,minmax(120px,1fr))!important}
.plastic-detail-section-title{display:flex;align-items:end;justify-content:space-between;gap:12px;margin:15px 0 8px}
.plastic-detail-section-title h4{margin:2px 0 0;font-size:14px;color:#111827}
.plastic-process-cost-wrap{max-height:320px}
.plastic-process-cost-table{min-width:780px}
.plastic-process-cost-table th:nth-child(1),.plastic-process-cost-table td:nth-child(1){width:54px;text-align:center}
.plastic-process-cost-table th:nth-child(4),.plastic-process-cost-table td:nth-child(4){text-align:right}
.plastic-final-cost-row td{background:#eafbf7!important;border-top:2px solid #25b79f!important}
.plastic-final-cost-row td:nth-child(3),.plastic-final-cost-row td:nth-child(4){font-weight:800;color:#073b35}
.plastic-price-link-note.has-warning{border-color:#f5c26b;background:#fff9ed}

@media(max-width:1280px){.plastic-lifecycle-strip-expanded{grid-template-columns:repeat(4,minmax(130px,1fr))!important}}
@media(max-width:760px){.plastic-lifecycle-strip-expanded{grid-template-columns:1fr 1fr!important}}

/* Price Quotation V20260724.3 — pagination, export, sharper popups, history chart */
#calculation .quotation-head{gap:16px;align-items:center;flex-wrap:wrap}
#calculation .quotation-pager{display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
#calculation .quotation-page-controls{display:flex;gap:8px;align-items:center;flex-wrap:nowrap}
#calculation .quotation-page-controls .tool-btn{height:38px;padding:0 14px;min-width:72px}
#calculation #calcPageInput{width:74px;height:38px;border-radius:12px;text-align:center;font-weight:800}
#calculation #calcExportBtn{height:38px;padding:0 16px}
#calculation .quote-view-note{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;flex-wrap:wrap}
#calculation .quote-view-note span{max-width:920px}
#calculation #priceApprovedPane .table td,#calculation #fcNewPricePane .table td,#calculation #calcResult .table td{vertical-align:middle}
.approved-discount-cell{display:grid;gap:2px;line-height:1.12;min-width:112px}
.approved-discount-cell b{font-size:14px}
.approved-discount-cell small{font-size:11px;font-weight:850}
.approved-discount-cell.down b,.approved-discount-cell.down small{color:#067647}
.approved-discount-cell.up b,.approved-discount-cell.up small{color:#b42318}
.approved-discount-cell.flat b,.approved-discount-cell.flat small{color:#475467}
.quotation-export-picker{display:grid;gap:10px}
.quotation-export-picker .export-choice{height:42px;justify-content:flex-start;padding:0 14px;font-weight:850}
.modal.quotation-history-modal{width:min(1360px,calc(100vw - 34px))!important;max-width:none!important;border-radius:24px!important}
.quotation-history-modal .smart-modal-head{padding:22px 26px 14px!important}
.quotation-history-modal .smart-modal-head h3{font-size:30px!important;letter-spacing:-.02em;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
.quotation-history-modal .smart-modal-head p{font-size:15px!important;color:#4c627c!important;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
.quotation-history-modal #modalSuggestions{padding:18px 26px 26px!important;max-height:calc(92vh - 136px)!important}
.quotation-history-modal .table th,.quotation-history-modal .table td{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
.quotation-history-modal-body{display:grid;gap:16px}
.quotation-history-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.quotation-history-card{position:relative;border:1px solid #d7e5f2;border-radius:18px;background:linear-gradient(180deg,#ffffff,#f7fbff);padding:16px 18px;display:grid;gap:5px;overflow:hidden}
.quotation-history-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:5px;background:#8aa4bf}
.quotation-history-card.price:before{background:#0a8194}.quotation-history-card.lme:before{background:#b26b00}.quotation-history-card.pvc:before{background:#6b46c1}.quotation-history-card.meta:before{background:#667085}
.quotation-history-card span{font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;color:#5b7088}
.quotation-history-card b{font-size:26px;line-height:1.05;color:#062a4d}
.quotation-history-card small{font-size:11px;color:#51667c;font-weight:800}.quotation-history-card small em{font-style:normal;font-weight:900}.quotation-history-card small em.up{color:#b42318}.quotation-history-card small em.down{color:#067647}
.quotation-history-chart-card,.quotation-history-table-card{border:1px solid #d7e5f2;border-radius:20px;background:linear-gradient(180deg,#ffffff,#f8fbff)}
.quotation-history-chart-head,.quotation-history-table-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:16px 18px 10px}
.quotation-history-chart-head b,.quotation-history-table-head b{font-size:17px;color:#072f57}
.quotation-history-chart-head small,.quotation-history-table-head small{display:block;margin-top:4px;color:#60758a;font-size:12px;font-weight:700}
.quotation-history-base-badge{padding:7px 12px;border-radius:999px;background:#e7f2ff;color:#0f5ea6;font-size:11px;font-weight:900;letter-spacing:.06em;text-transform:uppercase}
.quotation-history-chart-frame{padding:0 10px 0 4px}
.quotation-history-chart-frame svg{width:100%;min-height:360px;display:block}
.quotation-history-grid{stroke:#dbe7f2;stroke-width:1}.quotation-history-axis{font-size:11px;fill:#60758a;font-weight:800}
.quotation-history-line{fill:none;stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round}
.quotation-history-line.price{stroke:#0a8194}.quotation-history-line.lme{stroke:#b26b00}.quotation-history-line.pvc{stroke:#6b46c1}
.quotation-history-dot{stroke:#fff;stroke-width:2.5}.quotation-history-dot.price{fill:#0a8194}.quotation-history-dot.lme{fill:#b26b00}.quotation-history-dot.pvc{fill:#6b46c1}
.quotation-history-point-label{font-size:10px;font-weight:950;paint-order:stroke;stroke:#fff;stroke-width:4px;stroke-linejoin:round;letter-spacing:.01em;pointer-events:none}.quotation-history-point-label.price{fill:#087b8d}.quotation-history-point-label.lme{fill:#a96500}.quotation-history-point-label.pvc{fill:#6b46c1}
.quotation-history-legend{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:6px 18px 18px;color:#60758a;font-size:12px;font-weight:800}
.quotation-history-legend span{display:inline-flex;align-items:center;gap:8px}.quotation-history-legend span i{display:inline-block;width:18px;height:4px;border-radius:999px;background:#0a8194}.quotation-history-legend span.lme i{background:#b26b00}.quotation-history-legend span.pvc i{background:#6b46c1}.quotation-history-legend small{color:#51667c}
.quotation-history-table-card .table-wrap,.quotation-history-table-card>.table{margin:0}
.quotation-history-table-card .table{min-width:1020px}
html[data-theme=dark] .approved-discount-cell.flat b,html[data-theme=dark] .approved-discount-cell.flat small{color:#c8d3e0}
html[data-theme=dark] .quotation-history-card,html[data-theme=dark] .quotation-history-chart-card,html[data-theme=dark] .quotation-history-table-card{background:linear-gradient(180deg,#0e2138,#102843);border-color:#27476a}
html[data-theme=dark] .quotation-history-card b,html[data-theme=dark] .quotation-history-chart-head b,html[data-theme=dark] .quotation-history-table-head b{color:#edf5ff}
html[data-theme=dark] .quotation-history-card span,html[data-theme=dark] .quotation-history-card small,html[data-theme=dark] .quotation-history-chart-head small,html[data-theme=dark] .quotation-history-table-head small,html[data-theme=dark] .quotation-history-axis,html[data-theme=dark] .quotation-history-legend{color:#b9c8da}
html[data-theme=dark] .quotation-history-grid{stroke:#28496b}
@media(max-width:1180px){#calculation .quotation-head{align-items:stretch}#calculation .quotation-pager{justify-content:flex-start}.quotation-history-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){#calculation .quotation-page-controls{width:100%;justify-content:flex-start;flex-wrap:wrap}#calculation .quotation-page-controls .tool-btn{min-width:0}.quotation-history-cards{grid-template-columns:1fr}.modal.quotation-history-modal{width:100%!important;border-radius:18px 18px 0 0!important}.quotation-history-modal .smart-modal-head{padding:16px 16px 12px!important}.quotation-history-modal .smart-modal-head h3{font-size:23px!important}.quotation-history-modal #modalSuggestions{padding:14px 14px 20px!important}.quotation-history-chart-frame svg{min-height:290px}}

/* Price Quotation V20260724.4 — hierarchy, dual currency and adaptive history */
#calculation .quotation-pager{gap:7px!important}
#calculation .quotation-page-controls{gap:5px!important}
#calculation #calcPageBackBtn,#calculation #calcPageGoBtn{height:30px!important;min-width:48px!important;padding:0 9px!important;border-radius:9px!important;font-size:10.5px!important;font-weight:800!important;box-shadow:none!important}
#calculation #calcPageInput{width:52px!important;height:30px!important;min-height:30px!important;border-radius:9px!important;font-size:11px!important;padding:0 5px!important}
#calculation #calcExportBtn{height:32px!important;padding:0 11px!important;border-radius:9px!important;font-size:10.5px!important}
#calculation #calculateBtn{height:36px!important;padding:0 15px!important;border-radius:10px!important;font-size:11px!important}
#calculation .calc-limit-select{height:32px!important;min-height:32px!important;width:92px!important;min-width:92px!important;font-size:10.5px!important}
#calculation .row-limit-label{gap:4px!important}
#calculation #calcResult .table,#calculation #priceApprovedPane .table{min-width:1320px}
#calculation .dual-price-cell{display:grid;gap:2px;min-width:108px;line-height:1.08;font-variant-numeric:tabular-nums}
#calculation .dual-price-cell b{font-size:12.5px;color:#102b4d;white-space:nowrap}
#calculation .dual-price-cell b small{font-size:8.5px;color:#60758a;font-weight:850}
#calculation .dual-price-cell span{font-size:10px;color:#526780;font-weight:750;white-space:nowrap}
#calculation .dual-price-cell em{font-size:8.5px;color:#6b7f95;font-style:normal;font-weight:750;white-space:nowrap}
#calculation .dual-price-cell.emphasis b{color:#062f57;font-weight:900}
#calculation .approved-discount-cell{min-width:118px}
#calculation .approved-discount-cell b{font-size:11.5px!important;white-space:nowrap}
#calculation .approved-discount-cell small{font-size:10px!important}
#calculation .fc-price-table{min-width:1280px!important}
#calculation .fc-price-table td{font-size:11px!important}
#calculation .fc-price-table th{font-size:9.5px!important}
#calculation .quotation-view-tab{font-size:10.5px!important}

.modal.quotation-history-modal{width:min(1280px,calc(100vw - 38px))!important}
.quotation-history-modal .smart-modal-head{padding:17px 22px 12px!important}
.quotation-history-modal .smart-modal-head h3{font-size:24px!important}
.quotation-history-modal .smart-modal-head p{font-size:11.5px!important;margin-top:4px!important}
.quotation-history-modal #modalSuggestions{padding:14px 20px 20px!important;gap:11px!important}
.quotation-history-modal-body{gap:11px!important}
.quotation-history-cards{gap:8px!important}
.quotation-history-card{border-radius:14px!important;padding:11px 13px!important;gap:3px!important}
.quotation-history-card:before{width:4px!important}
.quotation-history-card span{font-size:8.5px!important;letter-spacing:.065em!important}
.quotation-history-card b{font-size:20px!important}
.quotation-history-card small{font-size:9px!important}
.quotation-history-chart-card,.quotation-history-table-card{border-radius:15px!important}
.quotation-history-chart-head,.quotation-history-table-head{padding:11px 14px 7px!important}
.quotation-history-chart-head b,.quotation-history-table-head b{font-size:14px!important}
.quotation-history-chart-head small,.quotation-history-table-head small{font-size:9.5px!important;margin-top:2px!important}
.quotation-history-base-badge{padding:5px 9px!important;font-size:8.5px!important}
.quotation-history-chart-frame{padding:0 7px 0 2px!important}
.quotation-history-chart-frame svg{min-height:300px!important}
.quotation-history-axis{font-size:8.5px!important}
.quotation-history-line{stroke-width:2.5!important}
.quotation-history-dot{stroke-width:2!important}
.quotation-history-legend{gap:10px!important;padding:3px 14px 12px!important;font-size:9px!important}
.quotation-history-legend span{gap:5px!important}.quotation-history-legend span i{width:14px!important;height:3px!important}
.quotation-history-table-card .table th{font-size:9px!important;padding:7px 9px!important}
.quotation-history-table-card .table td{font-size:10.5px!important;padding:7px 9px!important}
.history-inferred-date{display:block;font-size:8px;color:#8a6a22;font-weight:750;margin-top:2px}

.modal.quotation-export-modal{width:min(760px,calc(100vw - 42px))!important}
.quotation-export-config{display:grid;gap:14px}
.quotation-export-section{display:grid;gap:8px}
.quotation-export-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.quotation-export-choice,.quotation-export-columns label{display:flex;gap:9px;align-items:flex-start;border:1px solid #d6e3ef;border-radius:12px;background:#f8fbff;padding:11px;cursor:pointer;transition:.16s ease}
.quotation-export-choice.selected{border-color:#33b7ca;background:#eefcff;box-shadow:0 0 0 2px rgba(51,183,202,.12)}
.quotation-export-choice input,.quotation-export-columns input{width:15px!important;height:15px!important;min-width:15px!important;margin-top:2px!important;accent-color:#0a8194}
.quotation-export-choice span,.quotation-export-columns span{display:grid;gap:3px}
.quotation-export-choice b,.quotation-export-columns b{font-size:11px;color:#102e51}
.quotation-export-choice small,.quotation-export-columns small{font-size:9px;color:#60758a;line-height:1.3;font-weight:700}
.quotation-export-columns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.quotation-export-presets{display:flex;gap:7px;flex-wrap:wrap}
.quotation-export-presets .tool-btn{height:31px!important;font-size:10px!important;padding:0 10px!important}
html[data-theme=dark] #calculation .dual-price-cell b,html[data-theme=dark] .quotation-export-choice b,html[data-theme=dark] .quotation-export-columns b{color:#edf5ff}
html[data-theme=dark] #calculation .dual-price-cell span,html[data-theme=dark] #calculation .dual-price-cell em{color:#b8c9dc}
html[data-theme=dark] .quotation-export-choice,html[data-theme=dark] .quotation-export-columns label{background:#10243d;border-color:#29496b}
@media(max-width:900px){.quotation-export-choices,.quotation-export-columns{grid-template-columns:1fr}.quotation-history-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:760px){#calculation #calcPageBackBtn,#calculation #calcPageGoBtn{height:30px!important}.quotation-history-cards{grid-template-columns:1fr!important}.quotation-history-chart-frame svg{min-height:250px!important}}

/* Price Quotation V20260724.5 — clean unit headers, centered price columns and export polish */
#calculation .quotation-th-title{display:block;font-size:9.5px;line-height:1.15;font-weight:900;letter-spacing:.035em;color:inherit;white-space:normal}
#calculation .quotation-th-unit{display:block;margin-top:3px;font-size:8px;line-height:1;font-weight:800;letter-spacing:.055em;color:#62768d;text-transform:uppercase;white-space:nowrap}
.quotation-header-toggle{display:grid;gap:2px;width:100%;padding:0;border:0;background:transparent;color:inherit;text-align:center;cursor:pointer}.quotation-header-toggle:hover .quotation-th-title{color:#0b7ea6}.quotation-header-toggle:hover .quotation-th-unit{color:#0b7ea6}
#calculation .table th{vertical-align:middle!important;line-height:1.15!important}
#calculation #calcResult .table th:nth-child(n+3),
#calculation #calcResult .table td:nth-child(n+3),
#calculation #priceApprovedPane .table th:nth-child(n+3),
#calculation #priceApprovedPane .table td:nth-child(n+3),
#calculation #fcNewPricePane .table th:nth-child(n+4),
#calculation #fcNewPricePane .table td:nth-child(n+4){text-align:center!important}
#calculation #fcNewPricePane .table th:nth-child(1),
#calculation #fcNewPricePane .table td:nth-child(1){text-align:center!important}
#calculation .dual-price-cell{justify-items:center;text-align:center!important;margin:0 auto}
#calculation .approved-discount-cell{justify-items:center;text-align:center!important;margin:0 auto}
#calculation .fc-price-table td.num{ text-align:center!important }
#calculation #calcResult .table td,#calculation #priceApprovedPane .table td,#calculation #fcNewPricePane .table td{font-variant-numeric:tabular-nums}
#calculation #calcResult .table th,#calculation #priceApprovedPane .table th,#calculation #fcNewPricePane .table th{height:44px;padding-top:7px!important;padding-bottom:7px!important}
#calculation #calcResult .table td,#calculation #priceApprovedPane .table td,#calculation #fcNewPricePane .table td{padding-top:8px!important;padding-bottom:8px!important}
#calculation #calcResult .table td:nth-child(5){white-space:normal;min-width:160px}
#calculation #calcResult .table td:nth-child(1),#calculation #priceApprovedPane .table td:nth-child(1),#calculation #fcNewPricePane .table td:nth-child(2){font-weight:850}
#calculation .price-up{color:#b42318!important}
#calculation .price-down{color:#067647!important}
html[data-theme=dark] #calculation .quotation-th-unit{color:#aebfd2}
@media(max-width:900px){#calculation .quotation-th-title{font-size:9px}#calculation .quotation-th-unit{font-size:7.5px}}

/* Quotation Decision V2 — AI Suggested / Incharge Proposed / Final Approved */
#calculation #calcResult .table{min-width:1840px}
#calculation #calcResult .table th,#calculation #calcResult .table td{vertical-align:middle;text-align:center}
#calculation #calcResult .table th:nth-child(1),#calculation #calcResult .table td:nth-child(1),
#calculation #calcResult .table th:nth-child(2),#calculation #calcResult .table td:nth-child(2),
#calculation #calcResult .table th:nth-child(4),#calculation #calcResult .table td:nth-child(4),
#calculation #calcResult .table th:nth-child(5),#calculation #calcResult .table td:nth-child(5),
#calculation #calcResult .table th:nth-child(11),#calculation #calcResult .table td:nth-child(11){text-align:left}
#calculation #calcResult .table th:nth-child(1){width:135px}#calculation #calcResult .table th:nth-child(2){width:100px}
#calculation #calcResult .table th:nth-child(3){width:70px}#calculation #calcResult .table th:nth-child(4){width:120px}
#calculation #calcResult .table th:nth-child(5){width:180px}#calculation #calcResult .table th:nth-child(6),
#calculation #calcResult .table th:nth-child(7),#calculation #calcResult .table th:nth-child(8){width:145px}
#calculation #calcResult .table th:nth-child(9){width:190px}#calculation #calcResult .table th:nth-child(10){width:125px}
#calculation #calcResult .table th:nth-child(11){width:270px}
.incharge-proposal-editor{display:grid;justify-items:center;gap:0;min-width:118px;margin:0 auto}
.incharge-proposal-editor.compact input{width:112px;height:30px;border:1px solid #cfddeb;border-radius:10px;background:#fff;padding:0 8px;text-align:center;font-size:11.5px;font-weight:800;color:#0a2747;font-variant-numeric:tabular-nums;outline:none}
.incharge-proposal-editor input:focus{border-color:#23a9bd;box-shadow:0 0 0 3px rgba(35,169,189,.12)}
.incharge-proposal-editor input::placeholder{font-size:14px;font-weight:700;color:#91a0b1}
.quotation-note-btn{display:grid;gap:3px;width:100%;min-height:38px;padding:7px 10px;border:1px solid #d7e5f2;border-radius:11px;background:#f8fbff;text-align:left;color:#0b3156;cursor:pointer;transition:.16s ease}
.quotation-note-btn:hover{border-color:#69c7d4;background:#effbfc;transform:translateY(-1px);box-shadow:0 7px 18px rgba(20,82,116,.10)}
.quotation-note-btn b{font-size:10.5px;line-height:1.3}.quotation-note-btn small{font-size:9px;color:#6b8096;font-weight:750}
.quotation-no-match{display:flex;align-items:flex-start;gap:15px;border:1px dashed #b9cde0;border-radius:18px;background:linear-gradient(180deg,#fbfdff,#f2f8fd);padding:22px 24px;max-width:780px;margin:14px auto}
.quotation-no-match-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:#e5f4ff;color:#0b6f9f;font-size:22px;font-weight:950}
.quotation-no-match b{font-size:15px;color:#0a2c50}.quotation-no-match p{margin:3px 0 8px;font-size:13px;font-weight:850;color:#a34100}.quotation-no-match small{font-size:11px;color:#657b91;font-weight:800}
.quotation-suggestion-list{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px}.quotation-suggestion-btn{height:30px!important;padding:0 10px!important;font-size:10.5px!important}
.quotation-note-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}
.quotation-note-summary>div{display:grid;gap:4px;padding:13px 14px;border:1px solid #d8e5f1;border-radius:14px;background:#f8fbff}
.quotation-note-summary span{font-size:9.5px;text-transform:uppercase;letter-spacing:.07em;color:#64788e;font-weight:900}.quotation-note-summary b{font-size:15px;color:#0b2e51;font-variant-numeric:tabular-nums}
.quotation-note-modal{width:min(1220px,calc(100vw - 52px))!important}.quotation-note-detail .table{min-width:980px}
.quote-impact-value{font-weight:900;font-variant-numeric:tabular-nums}.quote-impact-value.increase{color:#b42318}.quote-impact-value.decrease{color:#067647}.quote-impact-value.neutral{color:#667085}
.quotation-note-editor{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end;padding:12px;border:1px solid #d8e5f1;border-radius:14px;background:#f8fbff}.quotation-note-editor label{display:grid;gap:6px;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.05em;color:#5d7289}
.wf-price-discount{display:grid;gap:2px;font-weight:900}.wf-price-discount small{font-size:10px;font-weight:900}.wf-price-discount.increase{color:#b42318}.wf-price-discount.decrease{color:#067647}
.wf-quotation-decision{display:grid;gap:12px}.wf-quotation-title{display:flex;align-items:center;justify-content:space-between;gap:12px}.wf-quotation-title h4{margin:2px 0 0;font-size:17px}.wf-quotation-decision .table{min-width:1280px}
.final-price-approval-modal{width:min(1120px,calc(100vw - 56px))!important}.final-approval-editor{display:grid;gap:14px}.final-approval-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.final-approval-grid>div{display:grid;gap:5px;padding:13px;border:1px solid #d6e4f0;border-radius:14px;background:#f8fbff}.final-approval-grid span{font-size:9.5px;text-transform:uppercase;letter-spacing:.06em;color:#65798e;font-weight:900}.final-approval-grid b{font-size:14px;color:#0b2d4f;font-variant-numeric:tabular-nums}.final-approval-grid b.increase{color:#b42318}.final-approval-grid b.decrease{color:#067647}
.final-approved-field{position:relative;display:grid;gap:6px;padding:14px 16px;border:1px solid #62c8d3;border-radius:16px;background:#effcfd}.final-approved-field>span{font-size:10px;font-weight:950;text-transform:uppercase;letter-spacing:.07em;color:#0c6470}.final-approved-field input{height:46px;border:1px solid #b7dce2;border-radius:11px;background:#fff;padding:0 68px 0 14px;font-size:22px;font-weight:950;color:#062f54;text-align:right;font-variant-numeric:tabular-nums}.final-approved-field small{position:absolute;right:31px;bottom:28px;color:#4d6c80;font-size:11px;font-weight:900}
.decision-history-card .table{min-width:1540px}.quotation-history-combined{display:grid;gap:16px}
html[data-theme=dark] .incharge-proposal-editor input{background:#0c2138;border-color:#34516f;color:#edf5ff}html[data-theme=dark] .quotation-note-btn,html[data-theme=dark] .quotation-no-match,html[data-theme=dark] .quotation-note-summary>div,html[data-theme=dark] .quotation-note-editor,html[data-theme=dark] .final-approval-grid>div{background:#10253e;border-color:#2b4b6c}html[data-theme=dark] .quotation-note-btn b,html[data-theme=dark] .quotation-note-summary b,html[data-theme=dark] .final-approval-grid b,html[data-theme=dark] .quotation-no-match b{color:#eef6ff}html[data-theme=dark] .quotation-no-match p{color:#ffbf87}html[data-theme=dark] .quotation-no-match small{color:#b7c9db}
@media(max-width:980px){.quotation-note-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.final-approval-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:680px){.quotation-note-summary,.final-approval-grid{grid-template-columns:1fr}.quotation-note-editor{grid-template-columns:1fr}.quotation-note-modal,.final-price-approval-modal{width:100%!important}.incharge-proposal-editor{min-width:150px}}

/* Pricing quotation currency-toggle + PVC detail forecast fix 20260724.4 */
#calculation .quotation-main-table{min-width:1180px}
#calculation .quotation-approved-table{min-width:900px}
#calculation .quotation-main-table th,#calculation .quotation-main-table td,
#calculation .quotation-approved-table th,#calculation .quotation-approved-table td{text-align:center;vertical-align:middle}
#calculation .quotation-main-table th:nth-child(-n+3),#calculation .quotation-main-table td:nth-child(-n+3),
#calculation .quotation-approved-table th:nth-child(-n+2),#calculation .quotation-approved-table td:nth-child(-n+2){text-align:left}
#calculation .quotation-header-toggle{min-height:28px;border-radius:8px;padding:3px 5px}
#calculation .quotation-header-toggle:focus-visible{outline:2px solid rgba(10,129,148,.38);outline-offset:2px}
#calculation .dual-price-cell.usd-primary b{font-size:12.5px}
#calculation .dual-price-cell.usd-primary span{font-size:9.5px;margin-top:1px}
#calculation .dual-amount-cell{display:grid;justify-items:center;gap:2px;min-width:98px;margin:0 auto;text-align:center}
#calculation .dual-amount-cell b{font-size:11.5px!important;white-space:nowrap}
#calculation .dual-amount-cell span{font-size:9.5px;font-weight:800;color:#5d7289;white-space:nowrap}
#calculation .dual-amount-cell small{font-size:9.5px!important;white-space:nowrap}
#calculation .incharge-proposal-editor.compact{min-width:104px}
#calculation .incharge-proposal-editor.compact input{width:100px;height:30px}
#calculation .incharge-proposal-editor.compact small{font-size:9px;color:#60758a;font-weight:800;white-space:nowrap}
#calculation .fc-price-table td{vertical-align:middle;text-align:center!important}
#calculation .fc-price-table th{text-align:center!important}
#calculation .fc-price-table th:nth-child(2),#calculation .fc-price-table td:nth-child(2),
#calculation .fc-price-table th:nth-child(3),#calculation .fc-price-table td:nth-child(3){text-align:left!important}
.market-forecast-grid-dual-input{grid-template-columns:minmax(108px,.72fr) minmax(108px,.72fr) minmax(108px,.72fr) minmax(105px,.66fr) minmax(130px,.82fr) minmax(138px,.88fr) minmax(150px,.98fr) minmax(142px,.78fr)!important}
.market-forecast-readout.plastic-impact{background:linear-gradient(180deg,rgba(247,244,255,.98),rgba(255,255,255,.92));border-color:rgba(124,92,214,.32)}
.market-forecast-readout.plastic-impact b{color:#5a36b4}
html[data-theme=dark] #calculation .dual-amount-cell span,html[data-theme=dark] #calculation .incharge-proposal-editor.compact small{color:#b8c9dc}
html[data-theme=dark] .market-forecast-readout.plastic-impact{background:linear-gradient(180deg,#1b1736,#10243d);border-color:#5a4b91}
html[data-theme=dark] .market-forecast-readout.plastic-impact b{color:#c9b7ff}
@media(max-width:1420px){.market-forecast-grid-dual-input{grid-template-columns:repeat(4,minmax(0,1fr))!important}.market-forecast-grid-dual-input .market-forecast-actions{grid-template-columns:repeat(2,minmax(0,1fr));grid-column:span 2}}
@media(max-width:900px){.market-forecast-grid-dual-input{grid-template-columns:repeat(2,minmax(0,1fr))!important}.market-forecast-grid-dual-input .market-forecast-actions{grid-column:span 2}}
@media(max-width:620px){.market-forecast-grid-dual-input{grid-template-columns:1fr!important}.market-forecast-grid-dual-input .market-forecast-actions{grid-column:auto;grid-template-columns:1fr}}

/* Quotation UX V20260724.10 — two-row toolbar, compact tables and PO OCR review */
#calculation .quotation-toolbar-shell{display:grid!important;grid-template-columns:1fr!important;gap:9px!important;padding:12px 16px!important;align-items:stretch!important}
#calculation .quotation-primary-row{display:grid;grid-template-columns:auto minmax(280px,1fr) auto;gap:12px;align-items:center;min-width:0}
#calculation .quotation-secondary-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:34px}
#calculation .quotation-view-tabs{display:flex;align-items:center;gap:5px;flex-wrap:nowrap}
#calculation .quotation-view-tab{height:34px;min-width:82px;padding:0 12px;border-radius:10px;font-size:10.5px;font-weight:850;white-space:nowrap}
#calculation #calcModels{width:100%;max-width:none;height:36px!important;min-height:36px!important;justify-self:stretch}
#calculation .quotation-main-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;white-space:nowrap}
#calculation .quotation-main-actions .tool-btn,#calculation .quotation-main-actions .btn-main{height:34px!important;min-height:34px!important;padding:0 12px!important;border-radius:10px!important;font-size:10.5px!important}
#calculation .quotation-pager{display:flex!important;align-items:center;justify-content:flex-end!important;gap:7px!important;flex-wrap:nowrap!important;margin-left:auto}
#calculation .row-limit-label{height:32px;display:flex;align-items:center;gap:7px;font-size:9.5px!important;letter-spacing:.04em}
#calculation .calc-limit-select{height:32px!important;min-height:32px!important;min-width:84px!important;width:84px!important;padding:0 24px 0 9px!important;font-size:10.5px!important}
#calculation .quotation-page-controls{display:flex;align-items:center;gap:6px}
#calculation .quotation-page-controls .tool-btn{height:30px!important;min-height:30px!important;min-width:54px!important;padding:0 9px!important;border-radius:9px!important;font-size:10px!important}
#calculation #calcPageInput{height:30px!important;min-height:30px!important;width:52px!important;padding:0 5px!important;border-radius:9px!important;font-size:10.5px!important}
#calculation .card-body{padding-top:12px}
#calculation .quotation-main-table{width:100%!important;min-width:0!important;table-layout:fixed!important}
#calculation .quotation-main-table th,#calculation .quotation-main-table td{padding:9px 7px!important;vertical-align:middle!important;text-align:center!important;line-height:1.25!important}
#calculation .quotation-main-table th{font-size:9.4px!important;letter-spacing:.035em!important}
#calculation .quotation-main-table td{font-size:10.5px!important}
#calculation .quotation-main-table th:nth-child(1),#calculation .quotation-main-table td:nth-child(1){width:11%;text-align:left!important}
#calculation .quotation-main-table th:nth-child(2),#calculation .quotation-main-table td:nth-child(2){width:8%;text-align:left!important}
#calculation .quotation-main-table th:nth-child(3),#calculation .quotation-main-table td:nth-child(3){width:15%}
#calculation .quotation-main-table th:nth-child(4),#calculation .quotation-main-table td:nth-child(4),
#calculation .quotation-main-table th:nth-child(5),#calculation .quotation-main-table td:nth-child(5),
#calculation .quotation-main-table th:nth-child(6),#calculation .quotation-main-table td:nth-child(6){width:11%}
#calculation .quotation-main-table th:nth-child(7),#calculation .quotation-main-table td:nth-child(7){width:12%}
#calculation .quotation-main-table th:nth-child(8),#calculation .quotation-main-table td:nth-child(8){width:10%}
#calculation .quotation-main-table th:nth-child(9),#calculation .quotation-main-table td:nth-child(9){width:11%}
#calculation .quotation-formula-code{display:inline-block;white-space:nowrap;font-size:10.3px;font-weight:750;letter-spacing:-.01em}
#calculation .dual-price-cell{gap:1px;justify-items:center}
#calculation .dual-price-cell b{font-size:12px!important;white-space:nowrap}
#calculation .dual-price-cell span{font-size:9px!important;white-space:nowrap}
#calculation .approved-discount-cell{min-width:0;justify-items:center;gap:1px}
#calculation .approved-discount-cell b{font-size:11px!important;white-space:nowrap}
#calculation .approved-discount-cell small{font-size:9px!important}
#calculation .incharge-proposal-editor{min-width:0!important}
#calculation .incharge-proposal-editor.compact input{width:88px!important;height:30px!important;font-size:10.5px!important}
#calculation .quotation-note-btn{min-height:34px!important;padding:6px 8px!important;text-align:center!important}
#calculation .quotation-note-btn b{font-size:9.8px!important}.quotation-note-btn small{font-size:8.5px!important}
#calculation .quotation-header-toggle{min-height:24px!important;padding:1px 3px!important}
#calculation .quotation-th-title{font-size:9.4px!important;line-height:1.15!important}
#calculation .quotation-th-unit{font-size:7.8px!important;margin-top:2px!important}
#calculation .fc-price-table{width:100%!important;min-width:0!important;table-layout:fixed!important}
#calculation .fc-price-table th,#calculation .fc-price-table td{padding:8px 6px!important;text-align:center!important;font-size:10px!important}
#calculation .fc-price-table th:nth-child(1),#calculation .fc-price-table td:nth-child(1){width:4%}
#calculation .fc-price-table th:nth-child(2),#calculation .fc-price-table td:nth-child(2){width:12%;text-align:left!important}
#calculation .fc-price-table th:nth-child(3),#calculation .fc-price-table td:nth-child(3){width:8%;text-align:left!important}
#calculation .fc-price-table th:nth-child(4),#calculation .fc-price-table td:nth-child(4),
#calculation .fc-price-table th:nth-child(5),#calculation .fc-price-table td:nth-child(5){width:13%}
#calculation .fc-price-table th:nth-child(6),#calculation .fc-price-table td:nth-child(6){width:12%}
#calculation .fc-price-table th:nth-child(7),#calculation .fc-price-table td:nth-child(7){width:9%}
#calculation .fc-price-table th:nth-child(8),#calculation .fc-price-table td:nth-child(8),
#calculation .fc-price-table th:nth-child(9),#calculation .fc-price-table td:nth-child(9){width:14.5%}
#calculation .quotation-approved-table{width:100%!important;min-width:0!important;table-layout:fixed!important}
#calculation .quotation-approved-table th,#calculation .quotation-approved-table td{padding:9px 8px!important;text-align:center!important}
#calculation .quotation-approved-table th:nth-child(1),#calculation .quotation-approved-table td:nth-child(1){width:16%;text-align:left!important}
#calculation .quotation-approved-table th:nth-child(2),#calculation .quotation-approved-table td:nth-child(2){width:10%;text-align:left!important}
#calculation .quotation-approved-table th:nth-child(3),#calculation .quotation-approved-table td:nth-child(3),
#calculation .quotation-approved-table th:nth-child(4),#calculation .quotation-approved-table td:nth-child(4){width:18%}
#calculation .quotation-approved-table th:nth-child(5),#calculation .quotation-approved-table td:nth-child(5){width:16%}
#calculation .quotation-approved-table th:nth-child(6),#calculation .quotation-approved-table td:nth-child(6){width:12%}
#calculation .quotation-approved-table th:nth-child(7),#calculation .quotation-approved-table td:nth-child(7){width:10%}
.quotation-po-filter{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;flex:1;padding:6px 8px;border:1px solid #b9dfeb;border-radius:11px;background:linear-gradient(180deg,#f4fdff,#eef9fc)}
.quotation-po-filter-main{display:flex;align-items:center;gap:8px;min-width:0}.quotation-po-filter-icon{display:grid;place-items:center;width:30px;height:26px;border-radius:8px;background:#0d8297;color:#fff;font-size:9px;font-weight:950}.quotation-po-filter-main div{display:grid;gap:1px;min-width:0}.quotation-po-filter-main b{font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.quotation-po-filter-main small{font-size:8.8px;color:#5b7087;font-weight:750}.quotation-po-filter-actions{display:flex;gap:6px}.quotation-po-filter-actions .tool-btn{height:27px!important;min-height:27px!important;padding:0 8px!important;font-size:9px!important}
.quotation-po-review{display:grid;gap:14px}.quotation-po-review-kpis{display:grid;grid-template-columns:120px 120px minmax(220px,1fr);gap:10px}.quotation-po-review-kpis>div{display:grid;gap:3px;padding:12px 14px;border:1px solid #d8e5ef;border-radius:14px;background:#f8fbff}.quotation-po-review-kpis span{font-size:9px;font-weight:900;letter-spacing:.06em;text-transform:uppercase;color:#667b91}.quotation-po-review-kpis b{font-size:17px;color:#082e54}.quotation-po-issue-block{display:grid;gap:8px}.quotation-po-issue-block h4{margin:0;font-size:13px}.quotation-po-review-table,.quotation-po-issue-table{min-width:0!important;width:100%!important;table-layout:fixed}.quotation-po-review-table th,.quotation-po-review-table td,.quotation-po-issue-table th,.quotation-po-issue-table td{padding:8px!important;font-size:10px!important}
.quotation-ocr-health{display:grid;gap:12px}.quotation-ocr-health-status{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;border-radius:13px}.quotation-ocr-health-status.warn{background:#fff4e5;border:1px solid #f6cc88;color:#8a4800}.quotation-ocr-health-status b{font-size:14px}.quotation-ocr-health-status span{font-size:10px;font-weight:800}.quotation-ocr-health p{margin:0;color:#445c75}.quotation-ocr-paths{display:grid;gap:8px}.quotation-ocr-paths>div{display:grid;grid-template-columns:90px 1fr;gap:10px;align-items:center}.quotation-ocr-paths span{font-size:10px;font-weight:900;color:#60758b}.quotation-ocr-paths code{padding:9px 11px;border-radius:9px;background:#0b1f34;color:#d8ebff;font-size:11px;overflow-wrap:anywhere}
html[data-theme=dark] .quotation-po-filter{background:#102942;border-color:#2e6070}html[data-theme=dark] .quotation-po-review-kpis>div{background:#10243b;border-color:#2a4b6d}html[data-theme=dark] .quotation-po-review-kpis b{color:#eef7ff}
@media(max-width:1180px){#calculation .quotation-primary-row{grid-template-columns:auto 1fr}#calculation .quotation-main-actions{grid-column:1/-1;justify-content:flex-end}#calculation .quotation-secondary-row{align-items:flex-start;flex-wrap:wrap}#calculation .quotation-pager{margin-left:auto}.quotation-po-review-kpis{grid-template-columns:1fr 1fr}.quotation-po-review-kpis>div:last-child{grid-column:1/-1}}
@media(max-width:860px){#calculation .quotation-primary-row{grid-template-columns:1fr}#calculation .quotation-view-tabs{overflow-x:auto}#calculation .quotation-main-actions{grid-column:1;justify-content:flex-start;flex-wrap:wrap}#calculation .quotation-secondary-row{display:grid;grid-template-columns:1fr}#calculation .quotation-pager{margin-left:0;justify-content:flex-start!important;overflow-x:auto}#calculation .quotation-main-table,#calculation .fc-price-table,#calculation .quotation-approved-table{min-width:980px!important;table-layout:auto!important}.quotation-po-filter{width:100%}}
#calculation .quotation-formula-code{white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important}
#calculation .quotation-main-table th,#calculation .fc-price-table th,#calculation .quotation-approved-table th{white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important}
#calculation .quotation-main-table td:nth-child(3){white-space:nowrap!important}

/* Quotation detail V20260724.11 — separate Aluminum/PVC, live market data and compact formula table */
.forecast-material-split{padding:15px!important}
.market-forecast-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.market-live-badge{display:inline-flex;align-items:center;min-height:26px;padding:0 10px;border-radius:999px;background:#e8f7ff;border:1px solid #b9e2f4;color:#0b6584;font-size:9.5px;font-weight:900;white-space:nowrap}
.forecast-material-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(190px,.55fr);gap:12px;align-items:stretch;margin-top:12px}
.forecast-material-card,.forecast-shared-card{border:1px solid #d6e5f1;border-radius:16px;background:#fff;padding:13px;min-width:0}
.forecast-material-card.aluminum-card{background:linear-gradient(180deg,#f5fbff,#ffffff);border-color:#b9def2}
.forecast-material-card.plastic-card{background:linear-gradient(180deg,#faf7ff,#ffffff);border-color:#d7c9f3}
.forecast-material-card-head{display:flex;gap:10px;align-items:flex-start;margin-bottom:10px}
.forecast-material-card-head>div{min-width:0}.forecast-material-card-head b{display:block;font-size:12.5px;color:#0a2d50}.forecast-material-card-head small{display:block;margin-top:3px;font-size:9.3px;line-height:1.35;color:#667b91;font-weight:700}
.forecast-material-icon{display:grid;place-items:center;flex:0 0 34px;height:34px;border-radius:10px;background:#dff5ff;color:#08789a;font-size:10px;font-weight:950}.plastic-card .forecast-material-icon{background:#eee7ff;color:#6645bd}
.forecast-material-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.forecast-material-fields.one-field{grid-template-columns:1fr}
.forecast-material-fields label{display:grid;grid-template-columns:1fr auto;gap:4px 8px;align-items:center;font-size:9px;font-weight:900;color:#425b75;text-transform:uppercase;letter-spacing:.04em}.forecast-material-fields label em{font-style:normal;color:#788da2;font-size:8.5px}
.forecast-material-fields input,.forecast-shared-card>input{grid-column:1/-1;width:100%;height:34px;border:1px solid #cbddea;border-radius:10px;padding:0 10px;background:#fff;font-size:12px;font-weight:850;color:#0b2d4e;outline:none}
.forecast-material-fields input:focus,.forecast-shared-card>input:focus{border-color:#23a9bd;box-shadow:0 0 0 3px rgba(35,169,189,.1)}
.forecast-market-source{margin-top:7px;min-height:24px;padding:5px 7px;border-radius:8px;background:rgba(98,130,160,.07);color:#6b8095;font-size:8.5px;font-weight:750;line-height:1.3;overflow:hidden;text-overflow:ellipsis}
.forecast-material-results{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px}.forecast-material-results.one-result{grid-template-columns:1fr}.forecast-material-results>div{padding:9px 10px;border:1px solid #dce8f2;border-radius:11px;background:#f8fbfe}.forecast-material-results span{display:block;font-size:8.5px;font-weight:900;color:#63788e;text-transform:uppercase;letter-spacing:.04em}.forecast-material-results b{display:block;margin-top:3px;font-size:12px;color:#0b3158}.forecast-material-results .highlight{background:#effcff;border-color:#aee7ef}.forecast-material-results .plastic-impact{background:#f6f1ff;border-color:#d8c9f7}.forecast-material-results .plastic-impact b{color:#5a36b4}.forecast-material-results small{display:block;margin-top:3px;color:#6c8095;font-size:8.5px;font-weight:750}
.forecast-shared-card{display:grid;grid-template-rows:auto auto 1fr;gap:10px;background:linear-gradient(180deg,#f8fbfe,#f3f8fc)}.forecast-shared-card>div:first-child b{display:block;font-size:12px;color:#0b2e52}.forecast-shared-card>div:first-child small{display:block;margin-top:3px;font-size:9px;line-height:1.35;color:#6b8096;font-weight:700}.forecast-shared-card .market-forecast-actions{align-self:end;display:grid;grid-template-columns:1fr;gap:7px}.forecast-shared-card .market-forecast-actions button{height:32px;padding:0 9px;font-size:9.5px}
.insight-price-stack{display:grid;gap:2px}.quote-insight-card .insight-price-stack b{margin:7px 0 0;font-size:18px}.insight-price-stack b em{font-style:normal;font-size:9px;color:#667b91}.quote-insight-card .insight-price-stack small{font-size:10px;color:#4d6a87}
#calcDetailResult .formula-horizontal-table{width:100%!important;min-width:100%!important;table-layout:fixed!important}
#calcDetailResult .formula-horizontal-table th,#calcDetailResult .formula-horizontal-table td{min-width:0!important;padding:8px 6px!important;text-align:center!important;vertical-align:middle!important}
#calcDetailResult .formula-horizontal-table th b{font-size:9.7px!important;line-height:1.18!important;word-break:keep-all!important;overflow-wrap:normal!important;hyphens:none!important;display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#calcDetailResult .formula-horizontal-table td{font-size:11px!important}
#calcDetailResult .formula-horizontal-table th:nth-child(1),#calcDetailResult .formula-horizontal-table td:nth-child(1){width:9%!important}
#calcDetailResult .formula-horizontal-table th:nth-child(2),#calcDetailResult .formula-horizontal-table td:nth-child(2){width:7%!important}
#calcDetailResult .formula-horizontal-table th:nth-child(3),#calcDetailResult .formula-horizontal-table td:nth-child(3){width:6%!important}
#calcDetailResult .formula-horizontal-table th:nth-child(4),#calcDetailResult .formula-horizontal-table td:nth-child(4){width:10%!important}
#calcDetailResult .formula-horizontal-table th:nth-child(n+5),#calcDetailResult .formula-horizontal-table td:nth-child(n+5){width:7.5%!important}
#calcDetailResult .formula-horizontal-table .money,#calcDetailResult .formula-horizontal-table .formula-material-amount{font-size:11.5px!important}
#calcDetailResult .formula-horizontal-table small{font-size:8.3px!important}
html[data-theme=dark] .market-live-badge{background:#0f324b;border-color:#32647d;color:#bfeaff}html[data-theme=dark] .forecast-material-card,html[data-theme=dark] .forecast-shared-card{background:#10253e;border-color:#2d4d6e}html[data-theme=dark] .forecast-material-card.aluminum-card{background:linear-gradient(180deg,#102c44,#10253e)}html[data-theme=dark] .forecast-material-card.plastic-card{background:linear-gradient(180deg,#201a3d,#10253e)}html[data-theme=dark] .forecast-material-card-head b,html[data-theme=dark] .forecast-shared-card>div:first-child b,html[data-theme=dark] .forecast-material-results b{color:#edf5ff}html[data-theme=dark] .forecast-material-fields input,html[data-theme=dark] .forecast-shared-card>input{background:#0a1d32;border-color:#365675;color:#eef6ff}html[data-theme=dark] .forecast-market-source,html[data-theme=dark] .forecast-material-results>div{background:#0d2139;border-color:#294968}
@media(max-width:1180px){.forecast-material-layout{grid-template-columns:1fr 1fr}.forecast-shared-card{grid-column:1/-1;grid-template-columns:1fr 180px 260px;grid-template-rows:auto;align-items:end}.forecast-shared-card .market-forecast-actions{grid-template-columns:1fr 1fr}}
@media(max-width:760px){.forecast-material-layout{grid-template-columns:1fr}.forecast-shared-card{grid-column:auto;grid-template-columns:1fr;grid-template-rows:auto}.forecast-material-fields{grid-template-columns:1fr}.market-forecast-head-actions{justify-content:flex-start}.market-live-badge{white-space:normal}}

@media(max-width:1180px){#calcDetailResult .formula-horizontal-table{min-width:1260px!important}}

/* FC batch workflow + packing reliability V20260724.12 */
.fc-selected-count{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:20px;margin-left:7px;padding:0 7px;border-radius:999px;background:rgba(255,255,255,.22);font-size:9px;font-weight:950;letter-spacing:.02em}
.wf-batch-decision .table-wrap{max-height:52vh;overflow:auto;border:1px solid #d9e6f1;border-radius:14px}
.wf-batch-decision .table{min-width:1180px}
.wf-batch-decision .table th{position:sticky;top:0;z-index:2;background:#eaf1f8}
.batch-summary-strip{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.batch-summary-strip span{display:inline-flex;align-items:center;min-height:28px;padding:0 10px;border-radius:999px;border:1px solid #d5e4ef;background:#f6fbff;color:#31506e;font-size:10px;font-weight:900}
.batch-item-actions{display:flex;gap:6px;justify-content:center;flex-wrap:wrap}.danger-outline{border-color:#efb5b0!important;color:#a72b22!important;background:#fff8f7!important}
.batch-review-status{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:0 9px;border-radius:999px;background:#edf4fa;color:#35536f;font-size:9.5px;font-weight:900;white-space:nowrap}.batch-review-status.returned{background:#fff1ed;color:#ad3327}.batch-review-status.excluded{background:#f1f2f4;color:#596170}.batch-review-status.approved{background:#e7f9ef;color:#087443}.batch-review-status.checked{background:#e7f5ff;color:#08658d}
.batch-review-reason{display:block;max-width:180px;margin:4px auto 0;color:#6b7e91;font-size:8.5px;line-height:1.25;text-align:center}
.batch-final-editor{display:grid;gap:14px}.batch-final-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.batch-final-summary>div{display:grid;gap:3px;padding:12px 14px;border:1px solid #d9e6f1;border-radius:13px;background:#f8fbfe}.batch-final-summary span{font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;color:#667b91}.batch-final-summary b{font-size:14px;color:#0b2e50}.batch-final-table{min-width:980px}.batch-final-table input{width:100%;height:32px;border:1px solid #cbddea;border-radius:9px;padding:0 8px;background:#fff;font-size:10px;font-weight:800;color:#0b2e50}.batch-final-price-input{text-align:right;font-variant-numeric:tabular-nums}.batch-final-note-input{min-width:220px}
#packingBomList .packing-loading-state,#packingBomDetail .packing-loading-state{min-height:92px}.packing-loading-state .spinner{width:18px;height:18px}
html[data-theme=dark] .wf-batch-decision .table-wrap,html[data-theme=dark] .batch-final-summary>div{border-color:#2c4c6d;background:#10253e}html[data-theme=dark] .wf-batch-decision .table th{background:#17314d}html[data-theme=dark] .batch-summary-strip span{border-color:#2e506f;background:#102a45;color:#d2e5f6}html[data-theme=dark] .batch-final-summary b{color:#eef7ff}html[data-theme=dark] .batch-final-table input{background:#0b1f35;border-color:#365675;color:#eef7ff}
@media(max-width:900px){.batch-final-summary{grid-template-columns:1fr 1fr}.wf-batch-decision .table{min-width:1080px}}

/* Packing cleanup 2026-07-24: official Pallet Master only; compact empty state */
.packing-empty-state.compact{margin:12px 16px 16px;padding:14px 16px;grid-template-columns:38px minmax(0,1fr) auto;gap:12px;border-radius:12px;box-shadow:none;background:linear-gradient(135deg,#fbfdff,#f4f9ff)}
.packing-empty-state.compact .packing-empty-icon{width:36px;height:36px;border-radius:11px;font-size:16px;box-shadow:none}
.packing-empty-copy{display:grid;gap:2px;min-width:0}
.packing-empty-copy>b{font-size:13px;line-height:1.25;color:#12375f}
.packing-empty-copy>span{font-size:11.5px;line-height:1.4;color:#536b86}
.packing-empty-copy>small{font-size:10.5px;line-height:1.35;color:#71849a}
.packing-empty-state.compact .packing-empty-actions{gap:7px}
.packing-empty-state.compact .packing-empty-actions .btn-main,
.packing-empty-state.compact .packing-empty-actions .tool-btn{height:32px;padding:0 11px;font-size:11px;border-radius:9px}
.packing-scenario-group{min-height:34px}
.packing-scenario-group .packing-scenario-chip{height:32px;padding:0 12px;font-size:11px}
.packing-code-convention{font-size:11px;line-height:1.45}
html[data-theme=dark] .packing-empty-state.compact{background:linear-gradient(135deg,#10243e,#0b1b30)}
html[data-theme=dark] .packing-empty-copy>b{color:#edf5ff}
html[data-theme=dark] .packing-empty-copy>span,html[data-theme=dark] .packing-empty-copy>small{color:#b7c7d8}
@media(max-width:900px){.packing-empty-state.compact{grid-template-columns:36px minmax(0,1fr)}.packing-empty-state.compact .packing-empty-actions{grid-column:1/-1;justify-content:flex-start}}


/* Pricing linkage/alignment hotfix 2026-07-25 */
.formula-horizontal-table{table-layout:fixed!important;min-width:1520px!important}
.formula-horizontal-table th,.formula-horizontal-table td{text-align:center!important;vertical-align:middle!important;white-space:normal!important;word-break:normal}
.formula-horizontal-table th{line-height:1.2!important;min-width:112px}
.formula-horizontal-table td .formula-fc-cell,.formula-horizontal-table td .formula-material-amount{margin-inline:auto;justify-content:center;text-align:center}
.formula-horizontal-table td[data-formula-code="PACKAGING_COST"]{background:rgba(95,188,255,.08)}
.formula-horizontal-table td[data-formula-code="PACKAGING_COST"] .money{color:#087ea4}
.quotation-main-table th,.quotation-main-table td,.quotation-approved-table th,.quotation-approved-table td,.fc-price-table th,.fc-price-table td{text-align:center!important;vertical-align:middle!important}
.quotation-main-table td:first-child,.quotation-approved-table td:first-child,.fc-price-table td:nth-child(2){text-align:left!important}
.quotation-decision-table .num,.fc-price-table .num{text-align:center!important;font-variant-numeric:tabular-nums}
.bom-pretty-table.bom-full-field-table th{text-align:center!important;vertical-align:middle!important}
.bom-pretty-table.bom-full-field-table td:nth-child(1),.bom-pretty-table.bom-full-field-table td:nth-child(2),.bom-pretty-table.bom-full-field-table td:nth-child(3){text-align:left!important}
.bom-pretty-table.bom-full-field-table td:nth-child(n+4){text-align:center!important;font-variant-numeric:tabular-nums}
.quote-material-modal .table th,.quote-material-modal .table td,.forecast-material-modal .table th,.forecast-material-modal .table td{text-align:center!important;vertical-align:middle!important;font-variant-numeric:tabular-nums}
.quote-material-modal .table th:nth-child(-n+2),.quote-material-modal .table td:nth-child(-n+2),.forecast-material-modal .table th:nth-child(-n+2),.forecast-material-modal .table td:nth-child(-n+2){text-align:left!important}
.plastic-bom-link-badge{display:block;margin-top:3px;font-size:9.5px;font-weight:900;color:#087ea4;letter-spacing:.02em}

/* CS011 FC workflow urgent fix 2026-07-25 */
#calculation .fc-model-link{appearance:none;border:0;background:transparent;padding:0;color:#075f82;font:inherit;font-weight:950;text-decoration:underline;text-decoration-color:rgba(7,95,130,.25);text-underline-offset:3px;cursor:pointer}
#calculation .fc-model-link:hover,#calculation .fc-model-link:focus-visible{color:#03a7b8;text-decoration-color:currentColor;outline:none}
#calculation .fc-recalc-status{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0;padding:9px 12px;border:1px solid #cfe2ee;border-radius:11px;background:#f5fbff;color:#31506d;font-size:10px}
#calculation .fc-recalc-status b{color:#0b3155;font-size:10.5px}#calculation .fc-recalc-status span{font-weight:800;text-align:right}
#calculation .fc-recalc-status.dirty{border-color:#f0cf8f;background:#fff8e9;color:#8a5600}#calculation .fc-recalc-status.dirty b{color:#7a4700}
#calculation .fc-recalc-status.ready{border-color:#a8dfc2;background:#effbf5;color:#147044}#calculation .fc-recalc-status.ready b{color:#075d37}
#calculation #recalcFcBtn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:126px}
#calculation #submitSelectedFcBtn:disabled{opacity:.55;cursor:not-allowed;filter:saturate(.5)}
.quotation-import-cancel{border-color:#f0b9b4!important;color:#a72b22!important;background:#fff8f7!important}
html[data-theme=dark] #calculation .fc-model-link{color:#62d9ef}html[data-theme=dark] #calculation .fc-recalc-status{background:#10263d;border-color:#31526e;color:#c8d9e8}html[data-theme=dark] #calculation .fc-recalc-status b{color:#f1f7ff}html[data-theme=dark] #calculation .fc-recalc-status.dirty{background:#352a12;border-color:#725b25;color:#ffd989}html[data-theme=dark] #calculation .fc-recalc-status.ready{background:#102e25;border-color:#286b52;color:#a8ebcb}
@media(max-width:900px){#calculation .fc-recalc-status{align-items:flex-start;flex-direction:column}#calculation .fc-recalc-status span{text-align:left}}


/* PO FC Ver.4: keep the imported-row status readable and review columns separated. */
#calculation .fc-price-table th:nth-child(1),#calculation .fc-price-table td:nth-child(1){width:3.5%!important}
#calculation .fc-price-table th:nth-child(2),#calculation .fc-price-table td:nth-child(2){width:10.5%!important}
#calculation .fc-price-table th:nth-child(3),#calculation .fc-price-table td:nth-child(3){width:7%!important}
#calculation .fc-price-table th:nth-child(4),#calculation .fc-price-table td:nth-child(4),
#calculation .fc-price-table th:nth-child(5),#calculation .fc-price-table td:nth-child(5){width:10.5%!important}
#calculation .fc-price-table th:nth-child(6),#calculation .fc-price-table td:nth-child(6){width:10%!important}
#calculation .fc-price-table th:nth-child(7),#calculation .fc-price-table td:nth-child(7){width:7%!important}
#calculation .fc-price-table th:nth-child(8),#calculation .fc-price-table td:nth-child(8),
#calculation .fc-price-table th:nth-child(9),#calculation .fc-price-table td:nth-child(9){width:10.5%!important}
#calculation .fc-price-table th:nth-child(10),#calculation .fc-price-table td:nth-child(10){width:20%!important;text-align:left!important}
#calculation .fc-status-cell{white-space:normal!important;overflow-wrap:anywhere;line-height:1.25}
#calculation .fc-status-note{display:block;margin-top:5px;color:#667b91;font-size:9.5px!important;line-height:1.3}
.forecast-aluminum-policy{display:grid!important;grid-template-columns:auto repeat(3,minmax(0,1fr));align-items:center;gap:7px;margin-top:8px;padding:7px 8px;border:1px solid #d8e6ef;border-radius:10px;background:#f7fbfe;font-size:10px!important;line-height:1.25}
.forecast-aluminum-policy b{font-size:9px!important;letter-spacing:.035em;text-transform:uppercase;color:#536d87;white-space:nowrap}
.forecast-aluminum-policy span{display:block;padding:6px 7px;border:1px solid #d7e5ef;border-radius:8px;background:#fff;color:#173b5f;font-size:9.5px!important;font-weight:800;text-align:center;white-space:nowrap}
html[data-theme=dark] .forecast-aluminum-policy{background:#0d2138;border-color:#294968}html[data-theme=dark] .forecast-aluminum-policy span{background:#102a45;border-color:#31516e;color:#dceafa}
@media(max-width:900px){.forecast-aluminum-policy{grid-template-columns:1fr}.forecast-aluminum-policy b{white-space:normal}.forecast-aluminum-policy span{text-align:left}}
#calculation .fc-price-table-wrap{position:relative;isolation:isolate}
#calculation .fc-price-table thead{position:relative;z-index:4}
#calculation .fc-price-table thead th{position:sticky;top:0;z-index:4;background:#eaf1f8!important;background-clip:padding-box;box-shadow:0 1px 0 #cbdbe8}
html[data-theme=dark] #calculation .fc-price-table thead th{background:#17314d!important;box-shadow:0 1px 0 #31506d}
.quotation-po-review-kpis{grid-template-columns:120px 120px 120px minmax(240px,1fr)!important}
.quotation-po-issue-table th:nth-child(1),.quotation-po-issue-table td:nth-child(1){width:18%}
.quotation-po-issue-table th:nth-child(2),.quotation-po-issue-table td:nth-child(2){width:31%}
.quotation-po-issue-table th:nth-child(3),.quotation-po-issue-table td:nth-child(3){width:36%}
.quotation-po-issue-table th:nth-child(4),.quotation-po-issue-table td:nth-child(4){width:15%}
.quotation-po-issue-table td{white-space:normal!important;overflow-wrap:anywhere;word-break:break-word;vertical-align:top!important}
@media(max-width:1100px){.quotation-po-review-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}}

/* v42 controlled Excel BOM + Material approval import */
.excel-import-approval-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:14px 0 10px;padding:12px;border:1px solid var(--line);border-radius:14px;background:rgba(66,182,255,.06)}
.excel-import-approval-actions .tool-btn{min-height:36px}
.excel-import-preview .excel-bom-model-check{width:17px;height:17px;accent-color:var(--primary)}
.excel-import-preview [data-import-panel="bom-main"] .table-wrap{max-height:min(54vh,560px)}
.excel-import-preview [data-import-panel="materials"] .table-wrap{max-height:min(58vh,620px)}
#excelBomApplyResult{margin-top:10px}
@media(max-width:760px){.excel-import-approval-actions{align-items:stretch}.excel-import-approval-actions .tool-btn{width:100%}}

/* Material Price: canonical seven-column layout. Keep legacy 10-column rules
   from stretching the left cells or producing uneven row heights. */
#ratesTable .table-wrap{
  width:100%;
  overflow:auto;
}
#ratesTable .table{
  width:100%;
  min-width:980px;
  table-layout:fixed;
}
#ratesTable .table th,
#ratesTable .table td{
  height:auto;
  padding:10px 12px;
  vertical-align:middle;
}
#ratesTable .table th:nth-child(1),
#ratesTable .table td:nth-child(1){width:16%;text-align:left;}
#ratesTable .table th:nth-child(2),
#ratesTable .table td:nth-child(2){width:24%;text-align:left;}
#ratesTable .table th:nth-child(3),
#ratesTable .table td:nth-child(3){width:17%;text-align:right;}
#ratesTable .table th:nth-child(4),
#ratesTable .table td:nth-child(4){width:10%;text-align:center;}
#ratesTable .table th:nth-child(5),
#ratesTable .table td:nth-child(5){width:12%;text-align:center;}
#ratesTable .table th:nth-child(6),
#ratesTable .table td:nth-child(6){width:12%;text-align:center;}
#ratesTable .table th:nth-child(7),
#ratesTable .table td:nth-child(7){width:9%;text-align:center;}
#ratesTable .material-drill{
  width:100%;
  min-width:0;
  display:block;
  overflow-wrap:anywhere;
  text-align:left;
}
#ratesTable .material-master-name{
  min-width:0;
  max-width:none;
  display:-webkit-box;
  overflow:hidden;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  line-clamp:2;
}
#ratesTable .table-input{
  width:100%;
  min-width:0;
  max-width:100%;
}

/* BOM Workspace adds a selection checkbox at runtime, so the enhanced
   Material Price table has eight columns rather than the base seven. */
#ratesTable .table[data-batch-enhanced="1"]{
  min-width:1120px;
}
#ratesTable .table[data-batch-enhanced="1"] th,
#ratesTable .table[data-batch-enhanced="1"] td{
  white-space:normal;
  overflow-wrap:break-word;
}
#ratesTable .table[data-batch-enhanced="1"] th:nth-child(1),
#ratesTable .table[data-batch-enhanced="1"] td:nth-child(1){width:4%;padding-inline:6px;text-align:center;}
#ratesTable .table[data-batch-enhanced="1"] th:nth-child(2),
#ratesTable .table[data-batch-enhanced="1"] td:nth-child(2){width:14%;text-align:left;}
#ratesTable .table[data-batch-enhanced="1"] th:nth-child(3),
#ratesTable .table[data-batch-enhanced="1"] td:nth-child(3){width:22%;text-align:left;}
#ratesTable .table[data-batch-enhanced="1"] th:nth-child(4),
#ratesTable .table[data-batch-enhanced="1"] td:nth-child(4){width:16%;text-align:right;}
#ratesTable .table[data-batch-enhanced="1"] th:nth-child(5),
#ratesTable .table[data-batch-enhanced="1"] td:nth-child(5){width:9%;text-align:center;}
#ratesTable .table[data-batch-enhanced="1"] th:nth-child(6),
#ratesTable .table[data-batch-enhanced="1"] td:nth-child(6){width:12%;text-align:center;}
#ratesTable .table[data-batch-enhanced="1"] th:nth-child(7),
#ratesTable .table[data-batch-enhanced="1"] td:nth-child(7){width:13%;text-align:center;}
#ratesTable .table[data-batch-enhanced="1"] th:nth-child(8),
#ratesTable .table[data-batch-enhanced="1"] td:nth-child(8){width:10%;text-align:center;}

/* V7.3 — direct BOM import, balanced Material Price workspace and batch-select approval */
#bomImportPanel{border:1px solid #c9deed;box-shadow:0 14px 38px rgba(13,54,92,.08)}
#bomImportPanel.import-processing{pointer-events:none}
#bomImportPanel.import-processing .card-head{opacity:.78}
.excel-import-loading,.excel-apply-progress{display:flex;align-items:center;gap:12px;min-height:76px;padding:16px 18px;border:1px solid #cfe3f1;border-radius:14px;background:linear-gradient(135deg,#f7fbff,#eef9fc)}
.excel-import-loading>div,.excel-apply-progress>div{display:grid;gap:4px}.excel-import-loading b,.excel-apply-progress b{font-size:13px;color:#0c3155}.excel-import-loading small,.excel-apply-progress small{color:#687f95;font-weight:700}
.excel-import-error-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:10px}
.excel-import-approval-actions{align-items:center;flex-wrap:wrap}
.excel-import-approval-actions .excel-bom-apply-btn{min-height:36px}

#rates .material-toolbar{display:grid;grid-template-columns:repeat(4,max-content) minmax(190px,1fr);gap:8px;align-items:center;padding:10px 14px;margin-bottom:10px}
#rates .material-toolbar #materialStatusFilter{justify-self:end;width:min(100%,260px);margin-left:0}
#rates .material-toolbar .edit-actions{grid-column:1/-1;justify-self:end;margin-top:2px}
#rates>.card:not(#rateHistoryCard){overflow:hidden}
#rates .material-head{display:grid;grid-template-columns:max-content minmax(280px,1fr) max-content;gap:14px;align-items:center;padding:12px 16px}
#rates .material-head h3{white-space:nowrap;margin:0}
#rates .material-search-group{display:grid;grid-template-columns:minmax(220px,1fr) max-content;gap:8px;width:100%;min-width:0}
#rates .material-search-group .card-search{width:100%;min-width:0}
#rates .compact-pager{display:grid;grid-template-columns:max-content 64px max-content;gap:6px;align-items:center}
#rates .card-body{padding:12px 16px 14px}
#ratesTable .plastic-price-link-note{margin:0 0 8px;padding:9px 12px}
.material-batch-toolbar{display:grid!important;grid-template-columns:minmax(250px,1fr) auto;gap:14px;align-items:center;margin:0 0 8px!important;padding:10px 12px!important;border-radius:13px!important}
.material-batch-copy{display:grid;gap:2px;min-width:0}.material-batch-copy b{font-size:12px}.material-batch-copy span{font-size:10px;line-height:1.35}
.material-batch-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}.material-batch-actions .tool-btn,.material-batch-actions .btn-main{min-height:32px;padding:7px 11px}.material-batch-actions strong{min-width:72px;text-align:right;font-size:10px;color:#516b84}
#ratesTable .table-wrap{border:1px solid #d7e5ef;border-radius:13px;overflow:auto}
#ratesTable .table{table-layout:fixed;min-width:1040px}
#ratesTable .table th,#ratesTable .table td{padding-top:10px;padding-bottom:10px;vertical-align:middle}
#ratesTable .table th:first-child,#ratesTable .table td:first-child{width:48px;min-width:48px;text-align:center}
#ratesTable .table th:nth-child(2),#ratesTable .table td:nth-child(2){width:15%}
#ratesTable .table th:nth-child(3),#ratesTable .table td:nth-child(3){width:24%}
#ratesTable .table th:nth-child(4),#ratesTable .table td:nth-child(4){width:18%;text-align:right}
#ratesTable .table th:nth-child(5),#ratesTable .table td:nth-child(5){width:10%;text-align:center}
#ratesTable .table th:nth-child(6),#ratesTable .table td:nth-child(6){width:13%;text-align:center}
#ratesTable .table th:nth-child(7),#ratesTable .table td:nth-child(7){width:11%;text-align:center}
#ratesTable .table th:nth-child(8),#ratesTable .table td:nth-child(8){width:9%;text-align:center}
#ratePageTotalInfo{padding:8px 4px 0;text-align:right}
#rates .lock-note{margin-top:10px}

.approval-batch-toolbar{display:grid!important;grid-template-columns:minmax(170px,220px) repeat(3,max-content) minmax(80px,1fr);gap:8px;align-items:center}
.approval-batch-toolbar #approvalBatchCount{justify-self:end}
#approvalQueueTable .approval-select-all-head{display:flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap;min-width:96px}
#approvalQueueTable .approval-select-all-head span{font-size:9px;letter-spacing:.03em}
#approvalQueueTable .selection-col{text-align:center}

@media(max-width:1100px){
  #rates .material-toolbar{grid-template-columns:repeat(2,max-content) minmax(190px,1fr)}
  #rates .material-toolbar #materialStatusFilter{grid-column:3;grid-row:1/3}
  #rates .material-head{grid-template-columns:1fr max-content}
  #rates .material-head h3{grid-column:1/-1}
  .material-batch-toolbar{grid-template-columns:1fr}.material-batch-actions{justify-content:flex-start}.material-batch-actions strong{margin-left:auto}
  .approval-batch-toolbar{grid-template-columns:1fr 1fr 1fr}.approval-batch-toolbar #approvalBatchCount{justify-self:start}
}
@media(max-width:760px){
  #rates .material-toolbar{display:flex;flex-wrap:wrap}
  #rates .material-toolbar #materialStatusFilter{width:100%;max-width:none}
  #rates .material-head{display:flex;flex-direction:column;align-items:stretch}
  #rates .material-search-group{grid-template-columns:1fr}
  #rates .compact-pager{align-self:flex-end}
  .material-batch-actions{display:grid;grid-template-columns:1fr 1fr}.material-batch-actions strong{margin-left:0;text-align:left}
  .approval-batch-toolbar{grid-template-columns:1fr 1fr}
}

/* V7.4 — BOM readiness repair + compact Material Price workspace */
#rates .material-master-card{overflow:hidden;border-radius:18px}
#rates .material-head{
  display:grid!important;
  grid-template-columns:minmax(180px,240px) minmax(340px,1fr) auto!important;
  align-items:center!important;
  gap:14px!important;
  min-height:72px;
  padding:12px 16px!important;
}
#rates .material-title-block{display:grid;gap:2px;min-width:0}
#rates .material-title-block .card-kicker{font-size:9px;letter-spacing:.11em;color:#607a95}
#rates .material-title-block h3{margin:0;font-size:16px;white-space:nowrap}
#rates .material-search-group{display:grid!important;grid-template-columns:minmax(220px,1fr) max-content!important;gap:8px!important;min-width:0;width:100%}
#rates .material-search-group .card-search{width:100%;height:38px;min-width:0}
#rates .material-head-tools{display:flex;align-items:center;justify-content:flex-end;gap:8px;white-space:nowrap}
#rates .material-head-tools #materialStatusFilter{width:184px;min-width:184px;margin:0}
#rates .material-head-tools .compact-pager{display:grid!important;grid-template-columns:max-content 54px max-content!important;gap:5px!important;align-items:center}
#rates .material-head-tools .compact-pager .tool-btn{min-width:52px;padding-inline:10px}
#rates .material-master-body{padding:10px 14px 14px!important}
#rates .material-command-bar.material-toolbar{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  margin:0 0 10px!important;
  padding:9px 10px!important;
  border:1px solid #d7e6f0;
  border-radius:12px;
  background:linear-gradient(135deg,#f8fbfe,#f2f8fc);
  box-shadow:none;
}
#rates .material-command-primary,#rates .material-command-secondary{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
#rates .material-command-secondary{justify-content:flex-end}
#rates .material-command-bar .tool-btn,#rates .material-command-bar .btn-main{min-height:34px;padding:7px 12px}
#rates .material-command-bar #newRateSetBtn{box-shadow:0 5px 14px rgba(15,142,181,.12)}
#rates .material-command-bar .edit-actions{display:inline-flex!important;align-items:center;gap:7px;margin:0!important}
#rates .material-command-bar .edit-actions.hidden{display:none!important}
#rates #rateActionResult:empty{display:none}
#rates #rateActionResult:not(:empty){margin:0 0 8px}
#ratesTable .plastic-price-link-note{margin:0 0 8px!important;padding:8px 11px!important;border-radius:11px}
#ratesTable .plastic-price-link-note p,#ratesTable .plastic-price-link-note small{line-height:1.35}
#rates .material-batch-toolbar{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  min-height:48px;
  margin:0 0 8px!important;
  padding:7px 9px!important;
  border:1px solid #d7e7f1!important;
  border-radius:11px!important;
  background:#f7fbfe!important;
}
#rates .material-batch-copy{display:flex!important;align-items:center;gap:8px;white-space:nowrap}
#rates .material-batch-copy b{font-size:11px;color:#183f61}
#rates .material-batch-copy span{display:inline-flex;align-items:center;justify-content:center;min-width:70px;padding:5px 8px;border-radius:999px;background:#e8f4fb;color:#285a7e;font-size:10px;font-weight:800}
#rates .material-batch-actions{display:flex!important;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}
#rates .material-batch-actions .tool-btn,#rates .material-batch-actions .btn-main{min-height:31px;padding:6px 10px;font-size:10px}
#ratesTable .table-wrap{overflow:auto!important;border:1px solid #d7e5ef!important;border-radius:12px!important}
#ratesTable .table{min-width:980px!important;table-layout:fixed!important}
#ratesTable .table thead th{height:38px;padding:8px 10px!important;font-size:10px;letter-spacing:.05em}
#ratesTable .table tbody td{height:50px;padding:8px 10px!important;vertical-align:middle}
#ratesTable .table th:first-child,#ratesTable .table td:first-child{width:46px!important;min-width:46px!important;text-align:center}
#ratesTable .table th:nth-child(2),#ratesTable .table td:nth-child(2){width:15%!important}
#ratesTable .table th:nth-child(3),#ratesTable .table td:nth-child(3){width:24%!important}
#ratesTable .table th:nth-child(4),#ratesTable .table td:nth-child(4){width:18%!important;text-align:right}
#ratesTable .table th:nth-child(5),#ratesTable .table td:nth-child(5){width:9%!important;text-align:center}
#ratesTable .table th:nth-child(6),#ratesTable .table td:nth-child(6){width:13%!important;text-align:center}
#ratesTable .table th:nth-child(7),#ratesTable .table td:nth-child(7){width:11%!important;text-align:center}
#ratesTable .table th:nth-child(8),#ratesTable .table td:nth-child(8){width:10%!important;text-align:center}
#ratePageTotalInfo{padding:7px 2px 0!important;text-align:right!important;font-size:10px}
#rates .material-master-note{margin-top:8px!important;padding:8px 11px!important;font-size:10px;line-height:1.35}

/* Import preview makes empty BOM placeholders explicit instead of treating them as existing BOMs. */
.excel-import-preview .import-eligible-summary{border-left:4px solid #25b6d2}
.excel-import-preview .excel-bom-model-check{width:16px;height:16px}
.excel-import-preview [data-import-panel="bom-main"] .table-wrap{max-height:390px;overflow:auto}
.excel-import-preview [data-import-panel="bom-main"] table td:nth-child(5){white-space:normal;min-width:180px}

@media(max-width:1280px){
  #rates .material-head{grid-template-columns:minmax(170px,210px) minmax(280px,1fr)!important}
  #rates .material-head-tools{grid-column:1/-1;justify-content:flex-end}
}
@media(max-width:900px){
  #rates .material-head{display:flex!important;flex-direction:column;align-items:stretch!important}
  #rates .material-head-tools{justify-content:space-between;flex-wrap:wrap}
  #rates .material-search-group{grid-template-columns:1fr!important}
  #rates .material-command-bar.material-toolbar{align-items:stretch!important;flex-direction:column}
  #rates .material-command-secondary{justify-content:flex-start}
  #rates .material-batch-toolbar{align-items:stretch!important;flex-direction:column}
  #rates .material-batch-actions{justify-content:flex-start}
}


/* V7.5 — verified BOM workbook mapping + balanced Material Price columns */
#ratesTable .material-price-table-wrap{
  width:100%;
  border:1px solid #d7e5ef;
  border-radius:13px;
  overflow:auto;
}
#ratesTable .material-price-table{
  width:100%!important;
  min-width:1080px!important;
  table-layout:fixed!important;
  border-collapse:separate;
  border-spacing:0;
}
#ratesTable .material-price-table col.material-col-select{width:4%}
#ratesTable .material-price-table col.material-col-code{width:15%}
#ratesTable .material-price-table col.material-col-name{width:23%}
#ratesTable .material-price-table col.material-col-price{width:18%}
#ratesTable .material-price-table col.material-col-unit{width:9%}
#ratesTable .material-price-table col.material-col-models{width:13%}
#ratesTable .material-price-table col.material-col-status{width:10%}
#ratesTable .material-price-table col.material-col-version{width:8%}
#ratesTable .material-price-table th,
#ratesTable .material-price-table td{
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  box-sizing:border-box;
  padding:10px 12px!important;
  height:54px;
  vertical-align:middle!important;
}
#ratesTable .material-price-table th{
  white-space:normal;
  line-height:1.2;
  font-size:11px;
}
#ratesTable .material-price-table th:nth-child(1),
#ratesTable .material-price-table td:nth-child(1),
#ratesTable .material-price-table th:nth-child(5),
#ratesTable .material-price-table td:nth-child(5),
#ratesTable .material-price-table th:nth-child(6),
#ratesTable .material-price-table td:nth-child(6),
#ratesTable .material-price-table th:nth-child(7),
#ratesTable .material-price-table td:nth-child(7),
#ratesTable .material-price-table th:nth-child(8),
#ratesTable .material-price-table td:nth-child(8){text-align:center!important}
#ratesTable .material-price-table th:nth-child(4),
#ratesTable .material-price-table td:nth-child(4){text-align:right!important}
#ratesTable .material-price-table th:nth-child(2),
#ratesTable .material-price-table td:nth-child(2),
#ratesTable .material-price-table th:nth-child(3),
#ratesTable .material-price-table td:nth-child(3){text-align:left!important}
#ratesTable .material-price-table .table-input{
  width:100%;
  min-width:0!important;
  max-width:100%;
  box-sizing:border-box;
}
#ratesTable .material-price-table .material-master-name,
#ratesTable .material-price-table .material-drill,
#ratesTable .material-price-table [data-material-used]{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#ratesTable .material-price-table .material-master-price{font-variant-numeric:tabular-nums}
#ratesTable .material-price-table .tag,
#ratesTable .material-price-table .warning-status-btn{max-width:100%}
#ratesTable .material-price-table .warning-status-btn{white-space:normal}

.import-model-selection-toolbar{
  display:grid;
  grid-template-columns:minmax(260px,1fr) auto;
  gap:12px;
  align-items:center;
  margin:0 0 10px;
  padding:9px 10px;
  border:1px solid #d7e6f0;
  border-radius:12px;
  background:linear-gradient(135deg,#f8fbfe,#f2f8fc);
}
.import-model-search input{
  width:100%;
  height:36px;
  border:1px solid var(--line);
  border-radius:11px;
  padding:0 12px;
  background:var(--paper);
  color:var(--ink);
  font-weight:800;
  outline:none;
}
.import-model-search input:focus{
  border-color:rgba(43,201,229,.9);
  box-shadow:0 0 0 3px rgba(55,217,234,.12);
}
.import-model-selection-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}
.import-model-table-wrap{max-height:48vh;overflow:auto}
.import-model-table{width:100%;min-width:900px;table-layout:fixed}
.import-model-table col.import-col-select{width:5%}
.import-model-table col.import-col-model{width:22%}
.import-model-table col.import-col-lines{width:12%}
.import-model-table col.import-col-amount{width:20%}
.import-model-table col.import-col-status{width:31%}
.import-model-table col.import-col-detail{width:10%}
.import-model-table th,.import-model-table td{padding:10px 12px;vertical-align:middle}
.import-model-table th:nth-child(1),.import-model-table td:nth-child(1),
.import-model-table th:nth-child(3),.import-model-table td:nth-child(3),
.import-model-table th:nth-child(4),.import-model-table td:nth-child(4),
.import-model-table th:nth-child(6),.import-model-table td:nth-child(6){text-align:center}
.import-model-table tr[hidden]{display:none!important}
.excel-import-approval-actions{
  position:sticky;
  bottom:0;
  z-index:4;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(8px);
}
.excel-import-selection-summary{
  margin-right:auto;
  min-width:150px;
  font-size:12px;
  color:#4f6982;
}
.excel-import-selection-summary b{font-size:15px;color:#0b4d75}

@media(max-width:1100px){
  #ratesTable .material-price-table{min-width:980px!important}
  .import-model-selection-toolbar{grid-template-columns:1fr}
  .import-model-selection-actions{justify-content:flex-start}
}
.excel-import-approval-actions .excel-bom-apply-btn:disabled{
  opacity:.42!important;
  cursor:not-allowed!important;
  filter:grayscale(.35);
  box-shadow:none!important;
}

/* V7.7 verified approval, BOM batch review and Material Price alignment */
.approval-control-bar{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin:0 0 12px;padding:12px 14px;border:1px solid #d6e6f2;border-radius:14px;background:linear-gradient(180deg,#f8fcff,#f1f8fc)}
.approval-control-left,.approval-control-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.approval-control-actions{justify-content:flex-end}
.approval-control-actions>b{min-width:82px;text-align:right;color:var(--muted);font-size:12px}
.approval-acting-control{display:grid;gap:4px;min-width:280px}
.approval-acting-control>span{font-size:10px;font-weight:900;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.approval-acting-control .mini-select{width:100%;min-width:280px}
#approvalQueueTable .wf-simple-table{min-width:1180px;table-layout:fixed}
#approvalQueueTable .wf-simple-table th:first-child,#approvalQueueTable .wf-simple-table td:first-child{width:64px!important;min-width:64px!important;text-align:center}
#approvalQueueTable .wf-simple-table th:nth-child(2){width:17%}
#approvalQueueTable .wf-simple-table th:nth-child(3){width:25%}
#approvalQueueTable .wf-simple-table th:nth-child(4),#approvalQueueTable .wf-simple-table th:nth-child(5),#approvalQueueTable .wf-simple-table th:nth-child(6){width:14%}
#approvalQueueTable .wf-simple-table th:nth-child(7){width:16%}
#approvalQueueTable input[type="checkbox"]{width:17px;height:17px;accent-color:#10b9d0}

.bom-batch-review-modal.modal-wide{width:min(1500px,96vw)!important;max-width:1500px!important}
.bom-batch-review-summary{display:grid;grid-template-columns:repeat(3,minmax(130px,1fr));gap:10px;margin:0 0 12px}
.bom-batch-review-summary>span{display:grid;gap:3px;padding:10px 12px;border:1px solid #d6e6f2;border-radius:12px;background:#f7fbfe}
.bom-batch-review-summary small{font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.bom-batch-review-summary b{font-size:20px;color:var(--text)}
.bom-batch-review-summary .warn{background:#fff8e9;border-color:#f2d49b}.bom-batch-review-summary .ok{background:#effcf5;border-color:#bce8d0}
.bom-batch-review-layout{display:grid;grid-template-columns:minmax(300px,360px) minmax(0,1fr);gap:14px;min-height:520px}
.bom-batch-model-panel,.bom-batch-detail-panel{min-width:0;border:1px solid #d5e5f1;border-radius:14px;background:#fff;overflow:hidden}
.bom-batch-panel-head{display:grid;gap:8px;padding:12px;border-bottom:1px solid #dce8f1;background:#f5faff}
.bom-batch-panel-head .card-search{width:100%;height:38px}
.bom-batch-model-list{height:500px;overflow:auto;padding:7px}
.bom-batch-model-row{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 6px;padding:10px 11px;border:1px solid transparent;border-radius:11px;background:#f8fbfd;color:var(--text);text-align:left;cursor:pointer}
.bom-batch-model-row:hover{border-color:#9bd8e7;background:#f0fbfe}.bom-batch-model-row.active{border-color:#20bad1;background:#eafaff;box-shadow:inset 3px 0 0 #10b9d0}
.bom-batch-model-row>span{display:grid;gap:3px;min-width:0}.bom-batch-model-row b{font-size:12px;overflow-wrap:anywhere}.bom-batch-model-row small{font-size:10px;color:var(--muted)}
.bom-batch-row-metrics{text-align:right!important;flex:0 0 auto}.bom-batch-row-metrics .danger-text{color:#b45309}.bom-batch-row-metrics .ok-text{color:#087b56}
.bom-batch-detail-panel{padding:12px;overflow:auto}.bom-batch-detail-panel .table-wrap{max-height:455px}.bom-batch-detail-panel .table{min-width:980px}

#ratesTable .material-price-table-wrap{overflow:auto!important;border:1px solid #d6e5ef!important;border-radius:12px!important}
#ratesTable .material-price-table{width:100%!important;min-width:920px!important;table-layout:fixed!important}
#ratesTable .material-price-table col.material-col-select{width:4%!important}
#ratesTable .material-price-table col.material-col-code{width:11%!important}
#ratesTable .material-price-table col.material-col-name{width:18%!important}
#ratesTable .material-price-table col.material-col-price{width:14%!important}
#ratesTable .material-price-table col.material-col-unit{width:8%!important}
#ratesTable .material-price-table col.material-col-models{width:21%!important}
#ratesTable .material-price-table col.material-col-status{width:13%!important}
#ratesTable .material-price-table col.material-col-version{width:11%!important}
#ratesTable .material-price-table th,#ratesTable .material-price-table td{height:50px!important;padding:8px 10px!important;vertical-align:middle!important}
#ratesTable .material-price-table th:nth-child(1),#ratesTable .material-price-table td:nth-child(1){text-align:center!important;padding-left:6px!important;padding-right:6px!important}
#ratesTable .material-price-table th:nth-child(2),#ratesTable .material-price-table td:nth-child(2),#ratesTable .material-price-table th:nth-child(3),#ratesTable .material-price-table td:nth-child(3){text-align:left!important}
#ratesTable .material-price-table th:nth-child(4),#ratesTable .material-price-table td:nth-child(4){text-align:right!important;padding-right:16px!important}
#ratesTable .material-price-table th:nth-child(n+5),#ratesTable .material-price-table td:nth-child(n+5){text-align:center!important}
#ratesTable .material-price-table .material-drill,#ratesTable .material-price-table .material-master-name{width:auto!important;min-width:0!important;max-width:100%!important;margin:0!important}
#ratesTable .material-price-table .material-master-price{display:inline-block;min-width:92px;text-align:right}
#ratesTable .material-price-table .material-master-unit{min-width:52px!important;padding:6px 8px!important}
#ratesTable .material-price-table .table-input{width:100%!important;min-width:0!important;max-width:100%!important}
.excel-import-complete{border-color:#9bdcbe!important;background:linear-gradient(180deg,#effdf5,#e8faf1)!important}

@media(max-width:1000px){
  .approval-control-bar{align-items:stretch;flex-direction:column}.approval-control-actions{justify-content:flex-start}.approval-acting-control,.approval-acting-control .mini-select{min-width:220px}
  .bom-batch-review-layout{grid-template-columns:1fr}.bom-batch-model-list{height:260px}.bom-batch-detail-panel{min-height:420px}
}
html[data-theme="dark"] .approval-control-bar,html[data-theme="dark"] .bom-batch-model-panel,html[data-theme="dark"] .bom-batch-detail-panel{background:#0d2138;border-color:#294661}
html[data-theme="dark"] .bom-batch-panel-head,html[data-theme="dark"] .bom-batch-model-row{background:#112b45}html[data-theme="dark"] .bom-batch-model-row.active{background:#0c3b50}

/* V7.7.7 — Price Quotation popup integrity.
   Each popup receives an explicit class and geometry. This prevents the shared
   generic modal from inheriting a narrow class left by the popup opened before it. */
.modal.quotation-material-cost-modal{
  width:min(1640px,calc(100vw - 28px))!important;
  max-width:none!important;
  max-height:94vh!important;
  padding:0!important;
  overflow:hidden!important;
}
.quotation-material-cost-modal .smart-modal-head{
  padding:18px 24px 14px!important;
  border-bottom:1px solid var(--line);
}
.quotation-material-cost-modal .smart-modal-head h3{
  font-size:25px!important;
  line-height:1.15!important;
}
.quotation-material-cost-modal #modalSuggestions{
  display:block!important;
  width:100%!important;
  max-height:calc(94vh - 92px)!important;
  padding:16px 20px 22px!important;
  overflow:auto!important;
}
.quotation-material-cost-modal .quote-material-modal{
  display:grid!important;
  gap:12px!important;
  width:100%!important;
  min-width:0!important;
}
.quotation-material-cost-modal .quote-material-modal>h4{
  margin:4px 0 0!important;
  font-size:15px!important;
}
.quotation-material-cost-modal .table-wrap{
  width:100%!important;
  max-width:100%!important;
  max-height:64vh!important;
  overflow:auto!important;
  border:1px solid var(--line);
  border-radius:14px;
  scrollbar-gutter:stable both-edges;
}
.quotation-material-cost-modal .table{
  width:100%!important;
  min-width:1320px!important;
  table-layout:auto!important;
  margin:0!important;
}
.quotation-material-cost-modal .forecast-material-modal .table{
  min-width:1780px!important;
}
.quotation-material-master-modal .table{
  min-width:1420px!important;
}
.quotation-material-cost-modal .table th{
  position:sticky!important;
  top:0!important;
  z-index:8!important;
  white-space:nowrap!important;
}
.quotation-material-cost-modal .table td{
  white-space:nowrap!important;
}
.quotation-material-cost-modal .forecast-material-summary{
  grid-template-columns:repeat(3,minmax(190px,1fr))!important;
}
.modal.quotation-cost-drilldown-modal{
  width:min(1180px,calc(100vw - 36px))!important;
  max-width:none!important;
  max-height:90vh!important;
}
.quotation-cost-drilldown-modal #modalSuggestions{
  max-height:calc(90vh - 118px)!important;
  padding:16px 22px 22px!important;
}
.modal.quotation-approval-result-modal{
  width:min(1480px,calc(100vw - 34px))!important;
  max-width:none!important;
  max-height:92vh!important;
}
.quotation-approval-result-modal #modalSuggestions{
  max-height:calc(92vh - 132px)!important;
  padding:14px 20px 22px!important;
}
.quotation-approval-result-modal .table-wrap{
  max-height:64vh!important;
  overflow:auto!important;
}
.quotation-approval-result-modal .table{
  min-width:1220px!important;
}
.modal.quotation-po-scan-modal{
  width:min(1540px,calc(100vw - 30px))!important;
  max-width:none!important;
  max-height:94vh!important;
}
.quotation-po-scan-modal #modalSuggestions{
  max-height:calc(94vh - 142px)!important;
  padding:14px 20px 20px!important;
}
.modal.quotation-history-modal{
  width:min(1480px,calc(100vw - 32px))!important;
  max-width:none!important;
  max-height:94vh!important;
}
.quotation-history-modal #modalSuggestions{
  max-height:calc(94vh - 132px)!important;
}
.modal.quotation-note-modal{
  width:min(1260px,calc(100vw - 36px))!important;
  max-width:none!important;
  max-height:92vh!important;
}
.modal.quotation-export-modal{
  width:min(780px,calc(100vw - 34px))!important;
  max-width:none!important;
}

@media(max-width:760px){
  .modal.quotation-material-cost-modal,
  .modal.quotation-cost-drilldown-modal,
  .modal.quotation-approval-result-modal,
  .modal.quotation-po-scan-modal,
  .modal.quotation-history-modal,
  .modal.quotation-note-modal,
  .modal.quotation-export-modal{
    width:100%!important;
    max-height:94vh!important;
    border-radius:18px 18px 0 0!important;
  }
  .quotation-material-cost-modal .smart-modal-head{padding:14px 14px 11px!important}
  .quotation-material-cost-modal .smart-modal-head h3{font-size:20px!important}
  .quotation-material-cost-modal #modalSuggestions{padding:12px 12px 18px!important}
  .quotation-material-cost-modal .forecast-material-summary{grid-template-columns:1fr!important}
}

/* V7.7.7 — A model without approved commercial history stays visibly blank. */
.dual-price-cell.empty-approved-price b{font-size:16px!important;color:var(--muted)!important}
.dual-price-cell.empty-approved-price span{font-size:10px!important;line-height:1.25!important;color:var(--muted)!important;white-space:normal!important}

/* V7.7.7 - complete Price Quotation modal coverage */
.modal.quotation-ocr-modal{
  width:min(1260px,calc(100vw - 40px))!important;
  max-width:none!important;
  max-height:92vh!important;
}
.quotation-ocr-modal #modalSuggestions{
  max-height:calc(92vh - 132px)!important;
  overflow:auto!important;
  padding:16px 20px 22px!important;
}
.modal.quotation-message-modal{
  width:min(900px,calc(100vw - 44px))!important;
  max-width:none!important;
  max-height:86vh!important;
}
.quotation-message-modal #modalSuggestions{
  max-height:calc(86vh - 132px)!important;
  overflow:auto!important;
}
@media(max-width:680px){
  .modal.quotation-ocr-modal,.modal.quotation-message-modal{
    width:100%!important;max-height:96vh!important;border-radius:18px 18px 0 0!important;
  }
}

/* V8.1.1 — separate Material FX and FOB selling FX in FC New Price. */
#calculation .fc-control-panel.fc-control-panel-v811{
  display:grid!important;
  grid-template-columns:minmax(230px,.78fr) minmax(500px,1.55fr) minmax(170px,.48fr) minmax(210px,.58fr)!important;
  align-items:stretch!important;
  gap:16px!important;
  padding:14px!important;
  border:1px solid #cfdeeb!important;
  border-radius:15px!important;
  background:linear-gradient(180deg,#f9fcff 0%,#f3f8fc 100%)!important;
}
#calculation .fc-control-summary{
  display:flex;
  min-width:0;
  flex-direction:column;
  justify-content:center;
  padding:2px 8px 2px 2px;
}
#calculation .fc-control-summary h3{margin:3px 0 2px!important}
#calculation .fc-control-summary p{margin:2px 0 0!important;max-width:320px}
#calculation .fc-input-group{
  position:relative;
  min-width:0;
  padding:10px 11px 11px;
  border:1px solid #c9dceb;
  border-radius:13px;
  background:#fff;
  box-shadow:0 4px 13px rgba(26,73,111,.045);
}
#calculation .fc-material-group{background:linear-gradient(180deg,#f5fbff 0%,#ffffff 100%)}
#calculation .fc-fob-group{
  margin-left:13px;
  border-color:#bfe3d9;
  background:linear-gradient(180deg,#f4fcf9 0%,#ffffff 100%);
}
#calculation .fc-fob-group::before{
  content:"";
  position:absolute;
  left:-15px;
  top:12px;
  bottom:12px;
  width:1px;
  background:#c9d8e5;
}
#calculation .fc-input-group-head{
  display:flex;
  min-height:31px;
  align-items:center;
  justify-content:center;
  gap:7px;
  margin:0 0 8px;
  text-align:center;
}
#calculation .fc-input-group-head b{
  color:#0c5276;
  font-size:10.5px;
  font-weight:950;
  letter-spacing:.095em;
}
#calculation .fc-fob-group .fc-input-group-head b{color:#08705b}
#calculation .fc-input-group-head small{
  color:#6c8196;
  font-size:8.75px;
  font-weight:700;
  letter-spacing:0;
}
#calculation .fc-material-input-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(125px,1fr));
  gap:9px;
}
#calculation .fc-fob-input-grid{display:grid;grid-template-columns:1fr}
#calculation .fc-input-group label{display:grid!important;gap:5px!important;min-width:0}
#calculation .fc-input-group label>span{
  display:flex;
  align-items:baseline;
  justify-content:center;
  gap:5px;
  color:#183c5e;
  font-size:10.5px;
  font-weight:900;
  text-align:center;
}
#calculation .fc-input-group label>span em{
  color:#6e8197;
  font-size:8.5px;
  font-style:normal;
  font-weight:800;
}
#calculation .fc-input-group input{
  height:36px!important;
  min-height:36px!important;
  padding:0 10px!important;
  border:1px solid #bfd3e3!important;
  border-radius:9px!important;
  background:#fff!important;
  color:#092b4d!important;
  font-size:11.5px!important;
  font-weight:850!important;
  text-align:center;
  font-variant-numeric:tabular-nums;
}
#calculation .fc-fob-group input{border-color:#add8cb!important;background:#fbfffd!important}
#calculation .fc-control-actions{
  display:grid;
  grid-template-columns:1fr;
  align-content:center;
  gap:9px;
  min-width:0;
}
#calculation .fc-control-actions .tool-btn,
#calculation .fc-control-actions .btn-main{
  width:100%;
  min-width:0;
  height:36px!important;
  padding:0 12px!important;
  white-space:nowrap;
}
html[data-theme=dark] #calculation .fc-control-panel.fc-control-panel-v811{background:linear-gradient(180deg,#10253e,#0d2036)!important;border-color:#2d4c69!important}
html[data-theme=dark] #calculation .fc-input-group{background:#102841;border-color:#31526f;box-shadow:none}
html[data-theme=dark] #calculation .fc-fob-group{background:#102f2a;border-color:#2f665b}
html[data-theme=dark] #calculation .fc-fob-group::before{background:#31506b}
html[data-theme=dark] #calculation .fc-control-summary h3{color:#f2f7ff!important}
html[data-theme=dark] #calculation .fc-control-summary p{color:#b7c8da!important}
html[data-theme=dark] #calculation .fc-control-summary .card-kicker{color:#83cfff!important}
html[data-theme=dark] #calculation .fc-input-group-head b{color:#7bd7f5}
html[data-theme=dark] #calculation .fc-fob-group .fc-input-group-head b{color:#70e1bd}
html[data-theme=dark] #calculation .fc-input-group-head small{color:#adc0d4}
html[data-theme=dark] #calculation .fc-input-group label>span{color:#edf5ff}
html[data-theme=dark] #calculation .fc-input-group label>span em{color:#afc2d7}
html[data-theme=dark] #calculation .fc-input-group input{background:#0a1d31!important;border-color:#365875!important;color:#f2f7ff!important}
html[data-theme=dark] #calculation .fc-fob-group input{background:#0b2723!important;border-color:#3f7468!important}
@media(max-width:1320px){
  #calculation .fc-control-panel.fc-control-panel-v811{
    grid-template-columns:minmax(220px,.72fr) minmax(450px,1.5fr) minmax(160px,.5fr)!important;
  }
  #calculation .fc-control-actions{grid-column:1/-1;grid-template-columns:1fr 1fr}
}
@media(max-width:980px){
  #calculation .fc-control-panel.fc-control-panel-v811{grid-template-columns:1fr 1fr!important}
  #calculation .fc-control-summary{grid-column:1/-1}
  #calculation .fc-material-group{grid-column:1/-1}
  #calculation .fc-fob-group{margin-left:0}
  #calculation .fc-fob-group::before{display:none}
  #calculation .fc-control-actions{grid-column:auto;grid-template-columns:1fr}
}
@media(max-width:680px){
  #calculation .fc-control-panel.fc-control-panel-v811{grid-template-columns:1fr!important}
  #calculation .fc-material-input-grid{grid-template-columns:1fr}
  #calculation .fc-control-actions{grid-column:auto}
  #calculation .fc-input-group-head{align-items:flex-start;flex-direction:column;justify-content:flex-start;text-align:left}
  #calculation .fc-input-group label>span{justify-content:flex-start}
}

/* V8.1.2 — approved commercial price market basis and clear BOM currency headers. */
.quotation-market-unit{display:block;margin-top:2px;font-size:10px;line-height:1;color:#64748b;text-align:center;font-weight:700}
.quotation-approved-table td:nth-child(4),.quotation-approved-table td:nth-child(5){text-align:center}
.quotation-approved-table th:nth-child(4),.quotation-approved-table th:nth-child(5){text-align:center}
.bom-full-field-table .quotation-th-title,.bom-full-field-table .quotation-th-unit{display:block;text-align:center}

/* Model/BOM Ver.8.1.5: one compact action model and Version-driven history */
.bom-version-link {
  appearance: none;
  border: 1px solid #b8ddf3;
  border-radius: 999px;
  background: #eef9ff;
  color: #006b9a;
  min-width: 58px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.bom-version-link:hover { border-color: #1abbd2; background: #ddf8ff; transform: translateY(-1px); }
.inline-version-link { min-width: auto; }
.detail-identity-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.bom-lifecycle-editor {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(190px, .55fr) minmax(340px, 1.5fr);
  gap: 14px;
  align-items: stretch;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid #c9dfef;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7fcff, #eef7ff);
}
.bom-lifecycle-editor-copy,
.bom-lifecycle-editor label,
.bom-lifecycle-impact { display: flex; flex-direction: column; gap: 6px; }
.bom-lifecycle-editor-copy b { color: #092c57; font-size: 14px; }
.bom-lifecycle-editor-copy small,
.bom-lifecycle-editor label > span { color: #5d7190; font-size: 11px; font-weight: 800; }
.bom-lifecycle-editor select,
.bom-lifecycle-editor textarea { width: 100%; border: 1px solid #c9dced; border-radius: 10px; background: #fff; padding: 10px 11px; font: inherit; }
.bom-lifecycle-editor textarea { min-height: 70px; resize: vertical; }
.bom-lifecycle-reason { grid-column: span 1; }
.bom-lifecycle-impact { justify-content: center; }
.status-impact { display: block; border-radius: 10px; padding: 10px 12px; font-size: 12px; font-weight: 700; }
.status-impact.ok { background: #eafaf2; color: #087548; }
.status-impact.warning { background: #fff4df; color: #9b5d00; }
@media (max-width: 1180px) { .bom-lifecycle-editor { grid-template-columns: 1fr 1fr; } .bom-lifecycle-impact { grid-column: 1 / -1; } }


/* Price Quotation Ver.8.1.7: direct chart values and compact paging controls. */
#calculation #calcPageBackBtn,
#calculation #calcPageGoBtn{height:30px!important;min-width:54px!important;padding:0 9px!important;border-radius:9px!important;font-size:10px!important;font-weight:850!important}
#calculation .quotation-approved-table th:nth-child(1),#calculation .quotation-approved-table td:nth-child(1){width:14%!important;text-align:left!important}
#calculation .quotation-approved-table th:nth-child(2),#calculation .quotation-approved-table td:nth-child(2){width:9%!important;text-align:left!important}
#calculation .quotation-approved-table th:nth-child(3),#calculation .quotation-approved-table td:nth-child(3){width:16%!important}
#calculation .quotation-approved-table th:nth-child(4),#calculation .quotation-approved-table td:nth-child(4),
#calculation .quotation-approved-table th:nth-child(5),#calculation .quotation-approved-table td:nth-child(5){width:14%!important}
#calculation .quotation-approved-table th:nth-child(6),#calculation .quotation-approved-table td:nth-child(6){width:13%!important}
#calculation .quotation-approved-table th:nth-child(7),#calculation .quotation-approved-table td:nth-child(7){width:11%!important}
#calculation .quotation-approved-table th:nth-child(8),#calculation .quotation-approved-table td:nth-child(8){width:9%!important}
.approved-date-cell{display:inline-flex;align-items:center;justify-content:center;min-width:92px;font-size:11px;font-weight:800;color:#314f6d;font-variant-numeric:tabular-nums;white-space:nowrap}
.history-version-pill{display:inline-flex;align-items:center;justify-content:center;min-width:54px;padding:5px 9px;border:1px solid #b8ddf3;border-radius:999px;background:#eef9ff;color:#006b9a;font-size:10px;font-weight:900;white-space:nowrap}
.recalculation-confirmation{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:4px}
.recalculation-confirmation>div{display:grid;gap:3px;padding:13px;border:1px solid #d5e5f1;border-radius:13px;background:linear-gradient(180deg,#fff,#f5fbff);text-align:center}
.recalculation-confirmation span{color:#61778d;font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.055em}.recalculation-confirmation b{color:#062f57;font-size:25px;line-height:1}.recalculation-confirmation small{color:#60758a;font-size:9px;font-weight:750}
@media(max-width:760px){#calculation #calcPageBackBtn,#calculation #calcPageGoBtn{height:30px!important}.recalculation-confirmation{grid-template-columns:1fr}}

html[data-theme=dark] .approved-date-cell{color:#dbe8f5}

html[data-theme=dark] .quotation-history-point-label{stroke:#102843}


/* Price Quotation Ver.8.1.8: collision-safe chart labels, direct paging and popup fit. */
#calculation #calcPageInput[readonly]{cursor:default;user-select:none;background:linear-gradient(180deg,#f7fbff,#eef6fd);color:#12324f;border-color:#c9ddeb;box-shadow:none}
#calculation #calcPageGoBtn:disabled,#calculation #calcPageBackBtn:disabled{opacity:.45;cursor:not-allowed;filter:none}

.quotation-history-chart-head{display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;align-items:start!important}
.quotation-history-chart-title{min-width:0}
.quotation-history-label-toggle{align-self:center;justify-self:center;height:30px;padding:0 12px;border:1px solid #b9d9ed;border-radius:999px;background:#f2faff;color:#087896;font:850 10px/1 Arial,"Segoe UI",sans-serif;cursor:pointer;white-space:nowrap;box-shadow:0 5px 14px rgba(24,105,145,.08)}
.quotation-history-label-toggle:hover{border-color:#5cc6dc;background:#e8faff}
.quotation-history-base-badge{justify-self:end}
.quotation-history-chart-card.labels-hidden .quotation-history-label-layer{display:none}
.quotation-history-point-label{font-size:9.5px!important;stroke-width:3.5px!important}

/* Main Price Quotation tables: units stay in headers; values remain numeric only. */
#calculation .quotation-main-table .dual-price-cell b small,
#calculation .quotation-main-table .quotation-market-unit,
#calculation .fc-price-table .dual-price-cell b small,
#calculation .fc-price-table .quotation-market-unit,
#calculation .quotation-approved-table .dual-price-cell b small,
#calculation .quotation-approved-table .quotation-market-unit{display:none!important}
#calculation .dual-price-cell,#calculation .approved-discount-cell{min-width:0!important}

/* Price Quotation popup geometry and balanced columns. */
.modal.quotation-material-cost-modal,
.modal.quotation-history-modal,
.modal.quotation-approval-result-modal,
.modal.quotation-po-scan-modal,
.modal.quotation-note-modal,
.modal.quotation-cost-drilldown-modal{height:auto!important;min-height:0!important}
.quotation-material-cost-modal #modalSuggestions,
.quotation-history-modal #modalSuggestions,
.quotation-approval-result-modal #modalSuggestions,
.quotation-po-scan-modal #modalSuggestions,
.quotation-note-modal #modalSuggestions,
.quotation-cost-drilldown-modal #modalSuggestions{min-height:0!important}

.quotation-material-cost-modal .table-wrap{max-height:66vh!important;overflow:auto!important}
.quotation-material-cost-modal .table{width:100%!important;min-width:0!important;table-layout:fixed!important}
.quotation-material-cost-modal .table th{white-space:normal!important;line-height:1.16!important;text-align:center!important;padding:8px 6px!important}
.quotation-material-cost-modal .table td{white-space:nowrap!important;padding:8px 7px!important;overflow:hidden;text-overflow:ellipsis}
.quotation-material-cost-modal .table th:first-child,.quotation-material-cost-modal .table td:first-child,
.quotation-material-cost-modal .table th:nth-child(2),.quotation-material-cost-modal .table td:nth-child(2){text-align:left!important}
.quotation-material-cost-modal .quote-material-modal:not(.forecast-material-modal) .table th:nth-child(1){width:15%}
.quotation-material-cost-modal .quote-material-modal:not(.forecast-material-modal) .table th:nth-child(2){width:17%}
.quotation-material-cost-modal .quote-material-modal:not(.forecast-material-modal) .table th:nth-child(3){width:9%}
.quotation-material-cost-modal .quote-material-modal:not(.forecast-material-modal) .table th:nth-child(4){width:10%}
.quotation-material-cost-modal .quote-material-modal:not(.forecast-material-modal) .table th:nth-child(5){width:15%}
.quotation-material-cost-modal .quote-material-modal:not(.forecast-material-modal) .table th:nth-child(6){width:8%}
.quotation-material-cost-modal .quote-material-modal:not(.forecast-material-modal) .table th:nth-child(7){width:13%}
.quotation-material-cost-modal .quote-material-modal:not(.forecast-material-modal) .table th:nth-child(8){width:13%}
.quotation-material-cost-modal .forecast-material-modal .table{min-width:1380px!important}
.quotation-material-cost-modal .forecast-material-modal .table th:nth-child(1){width:8%}
.quotation-material-cost-modal .forecast-material-modal .table th:nth-child(2){width:9%}
.quotation-material-cost-modal .forecast-material-modal .table th:nth-child(3){width:5%}
.quotation-material-cost-modal .forecast-material-modal .table th:nth-child(4){width:6%}
.quotation-material-cost-modal .forecast-material-modal .table th:nth-child(5){width:5%}
.quotation-material-cost-modal .forecast-material-modal .table th:nth-child(6),
.quotation-material-cost-modal .forecast-material-modal .table th:nth-child(7),
.quotation-material-cost-modal .forecast-material-modal .table th:nth-child(8),
.quotation-material-cost-modal .forecast-material-modal .table th:nth-child(9),
.quotation-material-cost-modal .forecast-material-modal .table th:nth-child(10),
.quotation-material-cost-modal .forecast-material-modal .table th:nth-child(11){width:9%}
.quotation-material-cost-modal .forecast-material-modal .table th:nth-child(12){width:8%}
.quotation-material-cost-modal .forecast-material-modal .table th:nth-child(13){width:5%}

.quotation-history-table-card .table{width:100%!important;min-width:0!important;table-layout:fixed!important}
.quotation-history-table-card .table th,.quotation-history-table-card .table td{white-space:normal!important;overflow-wrap:anywhere}
.quotation-history-table-card .table th:nth-child(1){width:10%}.quotation-history-table-card .table th:nth-child(2){width:16%}.quotation-history-table-card .table th:nth-child(3){width:15%}.quotation-history-table-card .table th:nth-child(4){width:14%}.quotation-history-table-card .table th:nth-child(5){width:14%}.quotation-history-table-card .table th:nth-child(6){width:17%}.quotation-history-table-card .table th:nth-child(7){width:14%}

.quotation-approval-result-modal .table{width:100%!important;min-width:0!important;table-layout:fixed!important}
.quotation-approval-result-modal .table th,.quotation-approval-result-modal .table td{white-space:normal!important;overflow-wrap:anywhere;padding:8px 7px!important}
.quotation-po-scan-modal .table{width:100%!important;min-width:0!important;table-layout:fixed!important}
.quotation-po-scan-modal .table th,.quotation-po-scan-modal .table td{white-space:normal!important;overflow-wrap:anywhere}
.quotation-note-modal .table{width:100%!important;min-width:0!important;table-layout:fixed!important}
.quotation-note-modal .table th:nth-child(1){width:20%}.quotation-note-modal .table th:nth-child(2){width:16%}.quotation-note-modal .table th:nth-child(3){width:13%}.quotation-note-modal .table th:nth-child(4){width:51%}
.quotation-note-modal .table th,.quotation-note-modal .table td{white-space:normal!important;overflow-wrap:anywhere}
.quotation-cost-drilldown-modal .packing-formula-summary{grid-template-columns:repeat(3,minmax(0,1fr))!important}

html[data-theme=dark] #calculation #calcPageInput[readonly]{background:linear-gradient(180deg,#152d49,#10243d);color:#edf7ff;border-color:#31506d}
html[data-theme=dark] .quotation-history-label-toggle{background:#15344d;color:#75e9f5;border-color:#36677b}

@media(max-width:900px){
  .quotation-history-chart-head{grid-template-columns:1fr auto!important}
  .quotation-history-label-toggle{grid-column:1/2;grid-row:2;justify-self:start;margin-top:7px}
  .quotation-history-base-badge{grid-column:2;grid-row:1/3;align-self:center}
  .quotation-material-cost-modal .table{min-width:920px!important}
  .quotation-material-cost-modal .forecast-material-modal .table{min-width:1280px!important}
}


/* V8.1.9 — Material Price master normalization */
#addMaterialBatchBtn,
#materialSelectVisible,
#materialSelectMissing,
#materialSelectPage,
#ratesTable .plastic-price-link-note{display:none!important}

#rates .material-head{
  grid-template-columns:minmax(190px,220px) minmax(360px,1fr) auto!important;
  gap:12px!important;
}
#rates .material-search-group{grid-template-columns:minmax(280px,1fr) max-content!important}
#rates .material-head-tools #materialStatusFilter{width:170px!important;min-width:170px!important}
#rates .material-head-tools .compact-pager{grid-template-columns:max-content 52px max-content!important}
#rates .material-head-tools .compact-pager .tool-btn{min-width:64px!important}
#rates .material-head-tools .compact-pager .tool-btn:disabled{opacity:.42;cursor:not-allowed;box-shadow:none}

#rates .material-command-bar.material-toolbar{margin-bottom:8px!important}
#rates .material-batch-toolbar{min-height:44px!important;padding:6px 9px!important;margin-bottom:8px!important}
#rates .material-batch-actions .tool-btn,
#rates .material-batch-actions .btn-main{min-width:88px}

#ratesTable .material-price-table{min-width:1080px!important}
#ratesTable .material-price-table col.material-col-select{width:4%!important}
#ratesTable .material-price-table col.material-col-code{width:12%!important}
#ratesTable .material-price-table col.material-col-name{width:14%!important}
#ratesTable .material-price-table col.material-col-price{width:11%!important}
#ratesTable .material-price-table col.material-col-unit{width:7%!important}
#ratesTable .material-price-table col.material-col-models{width:15%!important}
#ratesTable .material-price-table col.material-col-update{width:14%!important}
#ratesTable .material-price-table col.material-col-status{width:12%!important}
#ratesTable .material-price-table col.material-col-version{width:11%!important}
#ratesTable .material-price-table thead th{
  height:36px!important;
  padding:7px 9px!important;
  font-size:9.5px!important;
  line-height:1.2!important;
  font-weight:800!important;
  letter-spacing:.045em!important;
}
#ratesTable .material-price-table tbody td{
  height:46px!important;
  padding:7px 9px!important;
  font-size:11.5px!important;
  line-height:1.25!important;
  font-weight:550!important;
}
#ratesTable .material-price-table th:nth-child(4),
#ratesTable .material-price-table td:nth-child(4){text-align:right!important;padding-right:12px!important}
#ratesTable .material-price-table th:nth-child(n+5),
#ratesTable .material-price-table td:nth-child(n+5){text-align:center!important}
#ratesTable .material-price-table .material-drill,
#ratesTable .material-price-table .material-drill b{
  font-size:12px!important;
  font-weight:700!important;
  line-height:1.2!important;
}
#ratesTable .material-price-table .material-master-name{
  font-size:11.5px!important;
  font-weight:550!important;
  color:var(--text)!important;
}
#ratesTable .material-price-table .material-master-price{
  min-width:0!important;
  font-size:12px!important;
  font-weight:700!important;
}
#ratesTable .material-price-table .material-master-unit{
  min-width:44px!important;
  padding:5px 7px!important;
  font-size:10.8px!important;
  font-weight:700!important;
}
#ratesTable .material-price-table [data-material-used],
#ratesTable .material-price-table .version-link{
  font-size:11.1px!important;
  font-weight:650!important;
}
#ratesTable .material-latest-update{
  display:inline-block;
  white-space:nowrap;
  color:#405d78;
  font-size:11px;
  font-weight:650;
  font-variant-numeric:tabular-nums;
}
#ratesTable .tag{font-size:10.2px!important;font-weight:700!important;padding:5px 9px!important}
#ratesTable .tag.material-discontinued{background:#f2f4f7;color:#667085;border:1px solid #d9dee7}
#ratesTable .selection-col{font-size:10px!important;color:#607a95}
#ratesTable .batch-check{width:15px;height:15px}

@media(max-width:1280px){
  #rates .material-head{grid-template-columns:minmax(170px,210px) minmax(300px,1fr)!important}
  #rates .material-head-tools{grid-column:1/-1}
}

/* V8.2.0 — Material Price controlled edit/import workflow */
#rates .material-search-group{display:block!important;min-width:0!important}
#rates .material-search-group .card-search{width:100%!important;min-width:0!important}
#rates .material-head{grid-template-columns:minmax(200px,235px) minmax(360px,1fr) auto!important;gap:14px!important}
#rates .material-head-tools{gap:9px!important}
#rates .material-head-tools #materialStatusFilter{width:158px!important;min-width:158px!important;height:36px!important}
#rates .material-head-tools .compact-pager{display:grid!important;grid-template-columns:58px 44px 58px!important;gap:5px!important;align-items:center!important}
#rates .material-head-tools .compact-pager .tool-btn{width:58px!important;min-width:58px!important;height:34px!important;min-height:34px!important;padding:5px 7px!important;font-size:11px!important;font-weight:700!important;border-radius:10px!important}
#rates .material-head-tools .compact-pager .page-jump-input{width:44px!important;min-width:44px!important;height:34px!important;min-height:34px!important;padding:4px!important;text-align:center!important;font-size:11.5px!important;font-weight:750!important;border-radius:10px!important}
#rates .material-command-primary{display:flex!important;align-items:center!important;gap:7px!important;flex-wrap:wrap!important}
#rates .material-command-primary .edit-actions{display:flex;align-items:center;gap:7px}
#rates .material-command-primary .edit-actions.hidden{display:none!important}
#rates .danger-soft{border-color:#f2c4c4!important;background:#fff7f7!important;color:#a83c3c!important}
#rates .danger-soft:hover{background:#ffeded!important;border-color:#e69b9b!important}

#ratesTable .material-price-table{min-width:1040px!important;table-layout:fixed!important}
#ratesTable .material-price-table col.material-col-select{width:3.5%!important}
#ratesTable .material-price-table col.material-col-code{width:13%!important}
#ratesTable .material-price-table col.material-col-name{width:17%!important}
#ratesTable .material-price-table col.material-col-price{width:13%!important}
#ratesTable .material-price-table col.material-col-unit{width:6.5%!important}
#ratesTable .material-price-table col.material-col-models{width:12%!important}
#ratesTable .material-price-table col.material-col-update{width:14%!important}
#ratesTable .material-price-table col.material-col-status{width:11%!important}
#ratesTable .material-price-table col.material-col-version{width:10%!important}
#ratesTable .material-price-table thead th{padding:7px 8px!important;font-size:9.3px!important}
#ratesTable .material-price-table tbody td{padding:7px 8px!important;font-size:11.2px!important;font-weight:500!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(1),
#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(1),
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(2),
#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(2){text-align:left!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(3){text-align:center!important}
#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(3){text-align:left!important;padding-left:7px!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(n+4),
#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(n+4){text-align:center!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(2),
#ratesTable .material-price-table.material-selection-mode td:nth-child(2),
#ratesTable .material-price-table.material-selection-mode th:nth-child(3),
#ratesTable .material-price-table.material-selection-mode td:nth-child(3){text-align:left!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(4){text-align:center!important}
#ratesTable .material-price-table.material-selection-mode td:nth-child(4){text-align:left!important;padding-left:7px!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(n+5),
#ratesTable .material-price-table.material-selection-mode td:nth-child(n+5){text-align:center!important}
#ratesTable .material-price-table .material-master-price{display:inline-block!important;min-width:72px!important;text-align:right!important}
#ratesTable .material-price-table .material-master-name{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#ratesTable .material-price-table .material-drill b{font-size:11.7px!important;font-weight:700!important}
#ratesTable .material-price-table [data-material-used],
#ratesTable .material-price-table .version-link{font-size:10.9px!important;font-weight:600!important}
#rates .material-batch-toolbar{grid-template-columns:minmax(180px,1fr) auto!important;background:linear-gradient(135deg,rgba(56,189,248,.035),rgba(45,212,191,.025))!important}
#rates .material-batch-copy b{font-size:12px!important}
#rates .material-batch-copy span{font-size:10px!important}

.material-import-modal{width:min(1180px,94vw)!important;max-width:1180px!important;height:auto!important;max-height:90vh!important;display:flex!important;flex-direction:column!important}
.material-import-modal .modal-head{flex:0 0 auto}
.material-import-body{padding:14px 18px 4px;overflow:auto;min-height:220px;max-height:68vh}
.material-import-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:12px}
.material-import-kpis>div{display:grid;gap:3px;padding:10px 12px;border:1px solid #d7e6f0;border-radius:12px;background:#f8fbfd}
.material-import-kpis span{font-size:9.5px;font-weight:750;letter-spacing:.05em;text-transform:uppercase;color:#58718c}
.material-import-kpis b{font-size:18px;line-height:1.1;color:#092b55;font-variant-numeric:tabular-nums}
.material-import-table-wrap{border:1px solid #d6e5ef;border-radius:12px;overflow:auto;max-height:44vh}
.material-import-table{width:100%!important;min-width:980px!important;table-layout:fixed!important}
.material-import-table th{position:sticky;top:0;z-index:2;background:#edf3f8!important;padding:8px 7px!important;font-size:9.4px!important;line-height:1.15!important;white-space:normal!important}
.material-import-table td{padding:6px 7px!important;font-size:11px!important;vertical-align:middle!important}
.material-import-table th:nth-child(1){width:5%}.material-import-table th:nth-child(2){width:16%}.material-import-table th:nth-child(3){width:20%}.material-import-table th:nth-child(4){width:8%}.material-import-table th:nth-child(5){width:15%}.material-import-table th:nth-child(6){width:19%}.material-import-table th:nth-child(7){width:17%}
.material-import-table .table-input{width:100%!important;min-width:0!important;height:32px!important;padding:5px 7px!important;font-size:11px!important}
.material-import-table input.number-cell{text-align:right!important;font-variant-numeric:tabular-nums}
.material-import-table .tag{display:inline-flex;margin-bottom:2px}
.material-import-row-note{display:block;color:#6c7d90;font-size:9.5px;line-height:1.25;white-space:normal}
.material-import-warning-row{background:#fffaf0}
.material-import-existing-row{background:#f6f8fa;color:#697a8a}
.material-import-existing-row input,.material-import-existing-row select{background:#eef2f5!important;color:#7d8995!important}
.material-import-warning-list{display:grid;gap:6px;margin-top:10px}
.material-import-warning-list>div{display:grid;grid-template-columns:72px minmax(0,1fr);gap:8px;padding:7px 9px;border:1px solid #f1d8a7;border-radius:9px;background:#fffaf0;font-size:10.5px}
.material-import-warning-list b{color:#9b6510}.material-import-warning-list span{color:#66553b}
.material-import-modal .modal-actions{flex:0 0 auto}

@media(max-width:1280px){
  #rates .material-head{grid-template-columns:minmax(180px,215px) minmax(300px,1fr)!important}
  #rates .material-head-tools{grid-column:1/-1;justify-content:flex-end}
}
@media(max-width:760px){
  .material-import-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
}
/* Final V8.2.0 column ratio: keep Material name and Standard unit price adjacent and compact. */
#ratesTable .material-price-table col.material-col-select{width:3.5%!important}
#ratesTable .material-price-table col.material-col-code{width:14%!important}
#ratesTable .material-price-table col.material-col-name{width:12%!important}
#ratesTable .material-price-table col.material-col-price{width:11%!important}
#ratesTable .material-price-table col.material-col-unit{width:7%!important}
#ratesTable .material-price-table col.material-col-models{width:16%!important}
#ratesTable .material-price-table col.material-col-update{width:15%!important}
#ratesTable .material-price-table col.material-col-status{width:11%!important}
#ratesTable .material-price-table col.material-col-version{width:10.5%!important}
/* Override legacy nth-child widths so the final colgroup ratios are authoritative. */
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(1),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(1){width:14.5%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(2),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(2){width:12.5%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(3),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(3){width:11.5%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(4),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(4){width:7%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(5),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(5){width:16.5%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(6),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(6){width:15.5%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(7),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(7){width:11.5%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(8),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(8){width:11%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(1),#ratesTable .material-price-table.material-selection-mode td:nth-child(1){width:3.5%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(2),#ratesTable .material-price-table.material-selection-mode td:nth-child(2){width:14%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(3),#ratesTable .material-price-table.material-selection-mode td:nth-child(3){width:12%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(4),#ratesTable .material-price-table.material-selection-mode td:nth-child(4){width:11%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(5),#ratesTable .material-price-table.material-selection-mode td:nth-child(5){width:7%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(6),#ratesTable .material-price-table.material-selection-mode td:nth-child(6){width:16%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(7),#ratesTable .material-price-table.material-selection-mode td:nth-child(7){width:15%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(8),#ratesTable .material-price-table.material-selection-mode td:nth-child(8){width:11%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(9),#ratesTable .material-price-table.material-selection-mode td:nth-child(9){width:10.5%!important}

/* V8.2.1 — editable material master fields and controlled multi-model BOM import. */
#rates .compact-pager{gap:5px!important}
#rates .compact-pager .pager-secondary{height:30px!important;min-width:52px!important;padding:0 10px!important;border-radius:9px!important;font-size:10.5px!important}
#rates .compact-pager .page-jump-input{width:48px!important;height:30px!important;padding:0 5px!important;border-radius:9px!important;font-size:10.5px!important;text-align:center!important}
#ratesTable .material-price-table .material-master-name-input,
#ratesTable .material-price-table .material-master-price-input,
#ratesTable .material-price-table .material-master-unit-input{height:32px!important;min-width:0!important;width:100%!important;padding:5px 7px!important;border-radius:9px!important;font-size:10.8px!important;font-weight:650!important}
#ratesTable .material-price-table .material-master-name-input{text-align:left!important}
#ratesTable .material-price-table .material-master-price-input{text-align:right!important;font-variant-numeric:tabular-nums}
#ratesTable .material-price-table .material-master-unit-input{text-align:center!important;padding-right:22px!important}
#ratesTable .material-price-table col.material-col-name{width:16%!important}
#ratesTable .material-price-table col.material-col-price{width:11%!important}
#ratesTable .material-price-table col.material-col-models{width:13%!important}
#ratesTable .material-price-table col.material-col-update{width:14%!important}
#ratesTable .material-price-table col.material-col-status{width:10.5%!important}
#ratesTable .material-price-table col.material-col-version{width:11%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(1),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(1){width:14.5%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(2),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(2){width:16%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(3),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(3){width:11.5%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(4),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(4){width:7%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(5),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(5){width:14%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(6),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(6){width:14.5%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(7),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(7){width:11%!important}
#ratesTable .material-price-table:not(.material-selection-mode) th:nth-child(8),#ratesTable .material-price-table:not(.material-selection-mode) td:nth-child(8){width:11.5%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(3),#ratesTable .material-price-table.material-selection-mode td:nth-child(3){width:16%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(4),#ratesTable .material-price-table.material-selection-mode td:nth-child(4){width:11%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(6),#ratesTable .material-price-table.material-selection-mode td:nth-child(6){width:13%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(7),#ratesTable .material-price-table.material-selection-mode td:nth-child(7){width:14%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(8),#ratesTable .material-price-table.material-selection-mode td:nth-child(8){width:10.5%!important}
#ratesTable .material-price-table.material-selection-mode th:nth-child(9),#ratesTable .material-price-table.material-selection-mode td:nth-child(9){width:11%!important}

#bomImportPanel .card-head{padding-bottom:9px}
#bomImportPanel .card-body{padding-top:10px}
.bom-import-preview-v821{display:grid;gap:12px}
.bom-import-overview{display:grid;grid-template-columns:minmax(320px,.78fr) minmax(620px,1.45fr);gap:14px;align-items:stretch}
.bom-import-file-meta{display:flex;flex-direction:column;justify-content:center;gap:5px;padding:14px 16px;border:1px solid #cfe2ef;border-radius:14px;background:linear-gradient(135deg,#f9fcff,#eef8fd)}
.bom-import-file-meta h3{margin:0;color:#082c57;font-size:15px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bom-import-file-meta p{margin:0;color:#587087;font-size:10.5px;line-height:1.45;font-weight:650}
.bom-import-file-meta small{color:#5f7690;font-size:10px}
.bom-import-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
.bom-import-kpi-grid>div{display:grid;align-content:center;gap:3px;min-width:0;padding:11px 12px;border:1px solid #d7e5ef;border-left:4px solid #55b7d2;border-radius:13px;background:#f9fcfe}
.bom-import-kpi-grid>div.existing{border-left-color:#8293a8;background:#f7f9fb}
.bom-import-kpi-grid>div.ready{border-left-color:#18b981;background:#f1fcf7}
.bom-import-kpi-grid>div.error{border-left-color:#e56868;background:#fff7f7}
.bom-import-kpi-grid span{color:#5e7389;font-size:9px;font-weight:850;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}
.bom-import-kpi-grid b{color:#082c57;font-size:23px;line-height:1;font-variant-numeric:tabular-nums}
.bom-import-kpi-grid small{color:#6b7e91;font-size:9px;line-height:1.2}
.bom-import-tabs{margin-top:0!important}
.bom-import-list-toolbar{display:grid!important;grid-template-columns:minmax(300px,1fr) 170px auto!important;gap:8px!important;align-items:center!important;margin-bottom:9px!important}
.bom-import-list-toolbar .import-model-search input{height:34px!important}
.bom-import-list-toolbar .mini-select{height:34px!important;min-width:0!important;width:100%!important}
.bom-import-list-toolbar .import-model-selection-actions{justify-content:flex-end!important;flex-wrap:nowrap!important}
.bom-import-result-table{min-width:1050px!important;table-layout:fixed!important}
.bom-import-result-table col.import-col-select{width:4%!important}
.bom-import-result-table col.import-col-model{width:14%!important}
.bom-import-result-table col.import-col-version{width:11%!important}
.bom-import-result-table col.import-col-lines{width:7%!important}
.bom-import-result-table col.import-col-status{width:13%!important}
.bom-import-result-table col.import-col-note{width:43%!important}
.bom-import-result-table col.import-col-detail{width:8%!important}
.bom-import-result-table th,.bom-import-result-table td{padding:8px 9px!important;font-size:10.5px!important;vertical-align:middle!important}
.bom-import-result-table th{font-size:9.2px!important;line-height:1.15!important;white-space:normal!important}
.bom-import-result-table td:nth-child(2){text-align:left!important}
.bom-import-result-table td:nth-child(2)>b{display:block;color:#082b54;font-size:11px}
.bom-import-result-table td:nth-child(2)>small{display:block;margin-top:2px;color:#7a8b9b;font-size:9px}
.bom-import-result-table td:nth-child(6){text-align:left!important}
.bom-import-version{display:inline-flex;align-items:center;justify-content:center;min-width:66px;padding:5px 8px;border:1px solid #c7ddec;border-radius:999px;background:#f3f9fd;color:#235373;font-size:9.5px;font-weight:800;white-space:nowrap}
.bom-import-status{display:inline-flex;align-items:center;justify-content:center;min-width:88px;padding:5px 8px;border-radius:999px;font-size:9.5px;font-weight:850;white-space:nowrap}
.bom-import-status.ready{background:#e8faf2;color:#08754c}
.bom-import-status.existing{background:#eef2f6;color:#5d6f82}
.bom-import-status.error{background:#fff0f0;color:#b33a3a}
.bom-import-note{white-space:normal!important;line-height:1.3!important}
.bom-import-note b{display:inline-block;min-width:34px;margin-right:5px;color:#173d5f;font-size:9.5px}
.bom-import-note span{color:#5f7284;font-size:9.7px}
.bom-import-row-existing{background:#f8fafb;color:#667789}
.bom-import-row-error{background:#fff8f8}
.bom-import-row-error .bom-import-note b{color:#b53636}
.bom-import-row-ready:hover{background:#f3fbff}
.bom-import-final-actions{display:grid!important;grid-template-columns:minmax(150px,1fr) auto auto auto!important;gap:8px!important;align-items:center!important;margin:10px 0 8px!important;padding:10px 12px!important}
.bom-import-final-actions .excel-import-selection-summary{display:flex!important;align-items:center!important;gap:8px!important;padding:0!important;border:0!important;background:transparent!important}
.bom-import-final-actions .excel-import-selection-summary span{color:#61778b;font-size:10px;font-weight:750}
.bom-import-final-actions .excel-import-selection-summary b{display:inline-flex;align-items:center;justify-content:center;min-width:30px;height:26px;border-radius:999px;background:#e5f5fd;color:#075b82;font-size:13px}
.bom-import-final-actions .tool-btn,.bom-import-final-actions .btn-main{min-height:34px!important;white-space:nowrap}
@media(max-width:1180px){
  .bom-import-overview{grid-template-columns:1fr}
  .bom-import-list-toolbar{grid-template-columns:1fr 160px!important}
  .bom-import-list-toolbar .import-model-selection-actions{grid-column:1/-1}
}
@media(max-width:760px){
  .bom-import-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .bom-import-list-toolbar{grid-template-columns:1fr!important}
  .bom-import-final-actions{grid-template-columns:1fr!important}
}

/* V8.2.2 — unified plastic formula and Model/BOM table lifecycle columns. */
#modelbom .model-bom-compact-pager{
  display:grid!important;
  grid-template-columns:52px 42px 52px!important;
  gap:5px!important;
  align-items:center!important;
  justify-content:end!important;
  flex-wrap:nowrap!important;
}
#modelbom .model-bom-compact-pager .pager-secondary{
  width:52px!important;
  min-width:52px!important;
  height:30px!important;
  min-height:30px!important;
  padding:0 8px!important;
  border-radius:9px!important;
  font-size:10.5px!important;
  font-weight:700!important;
}
#modelbom .model-bom-compact-pager .model-bom-page-input{
  width:42px!important;
  min-width:42px!important;
  height:30px!important;
  min-height:30px!important;
  padding:0 4px!important;
  border:1px solid #c9dceb!important;
  border-radius:9px!important;
  background:linear-gradient(180deg,#f8fbfe,#eef6fc)!important;
  color:#173a5d!important;
  text-align:center!important;
  font-size:10.8px!important;
  font-weight:750!important;
  box-shadow:none!important;
  cursor:default!important;
}
#modelbom .model-bom-compact-pager .pager-secondary:disabled{opacity:.42;cursor:not-allowed;box-shadow:none!important}

#modelbom .product-master-toolbar{grid-template-columns:minmax(340px,1fr) auto!important}
#modelbom .packing-master-toolbar{grid-template-columns:minmax(330px,1fr) minmax(220px,.7fr) auto!important}
#modelbom .plastic-master-toolbar{grid-template-columns:minmax(330px,1fr) auto!important}
#modelbom .packing-master-toolbar .model-bom-compact-pager,
#modelbom .plastic-master-toolbar .model-bom-compact-pager{justify-self:end!important}

#productBomList #modelTable .table{
  min-width:1180px!important;
  table-layout:fixed!important;
}
#productBomList #modelTable th:nth-child(1),#productBomList #modelTable td:nth-child(1){width:14%}
#productBomList #modelTable th:nth-child(2),#productBomList #modelTable td:nth-child(2){width:14%}
#productBomList #modelTable th:nth-child(3),#productBomList #modelTable td:nth-child(3){width:8%}
#productBomList #modelTable th:nth-child(4),#productBomList #modelTable td:nth-child(4){width:9%}
#productBomList #modelTable th:nth-child(5),#productBomList #modelTable td:nth-child(5){width:20%}
#productBomList #modelTable th:nth-child(6),#productBomList #modelTable td:nth-child(6){width:13%}
#productBomList #modelTable th:nth-child(7),#productBomList #modelTable td:nth-child(7){width:10%}
#productBomList #modelTable th:nth-child(8),#productBomList #modelTable td:nth-child(8){width:12%}

#packingBomList .packing-master-table{
  min-width:1180px!important;
  table-layout:fixed!important;
}
#packingBomList .packing-master-table th:nth-child(1),#packingBomList .packing-master-table td:nth-child(1){width:15%}
#packingBomList .packing-master-table th:nth-child(2),#packingBomList .packing-master-table td:nth-child(2){width:17%}
#packingBomList .packing-master-table th:nth-child(3),#packingBomList .packing-master-table td:nth-child(3){width:11%}
#packingBomList .packing-master-table th:nth-child(4),#packingBomList .packing-master-table td:nth-child(4){width:13%}
#packingBomList .packing-master-table th:nth-child(5),#packingBomList .packing-master-table td:nth-child(5){width:10%}
#packingBomList .packing-master-table th:nth-child(6),#packingBomList .packing-master-table td:nth-child(6){width:13%}
#packingBomList .packing-master-table th:nth-child(7),#packingBomList .packing-master-table td:nth-child(7){width:10%}
#packingBomList .packing-master-table th:nth-child(8),#packingBomList .packing-master-table td:nth-child(8){width:11%}

#plasticBomList .plastic-master-table{
  min-width:1140px!important;
  table-layout:fixed!important;
}
#plasticBomList .plastic-master-table th:nth-child(1),#plasticBomList .plastic-master-table td:nth-child(1){width:14%}
#plasticBomList .plastic-master-table th:nth-child(2),#plasticBomList .plastic-master-table td:nth-child(2){width:20%}
#plasticBomList .plastic-master-table th:nth-child(3),#plasticBomList .plastic-master-table td:nth-child(3){width:10%}
#plasticBomList .plastic-master-table th:nth-child(4),#plasticBomList .plastic-master-table td:nth-child(4){width:8%}
#plasticBomList .plastic-master-table th:nth-child(5),#plasticBomList .plastic-master-table td:nth-child(5){width:14%}
#plasticBomList .plastic-master-table th:nth-child(6),#plasticBomList .plastic-master-table td:nth-child(6){width:13%}
#plasticBomList .plastic-master-table th:nth-child(7),#plasticBomList .plastic-master-table td:nth-child(7){width:10%}
#plasticBomList .plastic-master-table th:nth-child(8),#plasticBomList .plastic-master-table td:nth-child(8){width:11%}

#productBomList #modelTable th:nth-child(n+6),#productBomList #modelTable td:nth-child(n+6),
#packingBomList .packing-master-table th:nth-child(n+4),#packingBomList .packing-master-table td:nth-child(n+4),
#plasticBomList .plastic-master-table th:nth-child(n+3),#plasticBomList .plastic-master-table td:nth-child(n+3){text-align:center!important}
#modelbom .model-bom-approval-date{
  display:inline-block;
  white-space:nowrap;
  color:#405e79;
  font-size:10.7px;
  font-weight:650;
  font-variant-numeric:tabular-nums;
}
#modelbom .bom-version-link{white-space:nowrap}

#formula .plastic-formula-horizontal-wrap,
#plasticBomDetail .plastic-formula-horizontal-wrap{
  overflow-x:auto!important;
  border:1px solid #d2e3ef!important;
  border-radius:14px!important;
  background:linear-gradient(180deg,#ffffff,#f6fbfe)!important;
}
#formula .plastic-formula-horizontal-table,
#plasticBomDetail .plastic-formula-horizontal-table{
  width:100%!important;
  min-width:1040px!important;
  table-layout:fixed!important;
}
#formula .plastic-formula-horizontal-table th,
#formula .plastic-formula-horizontal-table td,
#plasticBomDetail .plastic-formula-horizontal-table th,
#plasticBomDetail .plastic-formula-horizontal-table td{
  width:12.5%!important;
  min-width:120px!important;
  padding:10px 8px!important;
  text-align:center!important;
  vertical-align:middle!important;
}
#formula .plastic-formula-horizontal-table th span,
#plasticBomDetail .plastic-formula-horizontal-table th span{
  display:block!important;
  margin-bottom:4px!important;
  color:#68809a!important;
  font-size:8px!important;
  font-weight:850!important;
  line-height:1.1!important;
  letter-spacing:.045em!important;
}
#formula .plastic-formula-horizontal-table th b,
#plasticBomDetail .plastic-formula-horizontal-table th b{
  display:block!important;
  color:#173a5d!important;
  font-size:10.3px!important;
  line-height:1.2!important;
}
#formula .plastic-formula-horizontal-table .formula-amount-cell .money,
#plasticBomDetail .plastic-formula-horizontal-table .formula-amount-cell .money{
  display:block!important;
  color:#092f57!important;
  font-size:13px!important;
  font-weight:800!important;
  font-variant-numeric:tabular-nums!important;
}
#formula .plastic-formula-horizontal-table .formula-amount-cell small,
#plasticBomDetail .plastic-formula-horizontal-table .formula-amount-cell small{
  display:block!important;
  margin-top:4px!important;
  color:#6a8197!important;
  font-size:8.5px!important;
  font-weight:750!important;
}
#formula .plastic-formula-horizontal-table .plastic-formula-final-cell,
#plasticBomDetail .plastic-formula-horizontal-table .plastic-formula-final-cell{
  background:linear-gradient(180deg,rgba(45,212,191,.16),rgba(34,211,238,.08))!important;
  box-shadow:inset 0 0 0 1px rgba(13,148,136,.20)!important;
}
#formula .plastic-formula-horizontal-table td.plastic-formula-final-cell .money,
#plasticBomDetail .plastic-formula-horizontal-table td.plastic-formula-final-cell .money{color:#087467!important;font-size:14px!important}

html[data-theme=dark] #modelbom .model-bom-compact-pager .model-bom-page-input{background:linear-gradient(180deg,#17314c,#10263e)!important;color:#eef8ff!important;border-color:#335671!important}
html[data-theme=dark] #modelbom .model-bom-approval-date{color:#d5e5f3}
html[data-theme=dark] #formula .plastic-formula-horizontal-wrap,
html[data-theme=dark] #plasticBomDetail .plastic-formula-horizontal-wrap{background:#0f2238!important;border-color:#2e4c68!important}
html[data-theme=dark] #formula .plastic-formula-horizontal-table th b,
html[data-theme=dark] #plasticBomDetail .plastic-formula-horizontal-table th b,
html[data-theme=dark] #formula .plastic-formula-horizontal-table .formula-amount-cell .money,
html[data-theme=dark] #plasticBomDetail .plastic-formula-horizontal-table .formula-amount-cell .money{color:#e9f5ff!important}

@media(max-width:1050px){
  #modelbom .packing-master-toolbar,#modelbom .plastic-master-toolbar{grid-template-columns:1fr!important}
  #modelbom .packing-master-toolbar .model-bom-compact-pager,#modelbom .plastic-master-toolbar .model-bom-compact-pager{justify-self:start!important}
}

/* V8.2.3 — Admin is limited to Pricing operations. User access stays in Sapali Control Center. */
#admin .admin-operations-stack{gap:14px}
#admin .admin-ops-tabs{
  display:grid!important;
  grid-template-columns:minmax(320px,.8fr) minmax(620px,1.2fr);
  align-items:stretch;
  gap:14px;
  padding:12px 14px;
  overflow:visible;
}
#admin .admin-scope-note{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-width:0;
  padding:10px 13px;
  border:1px solid var(--line);
  border-radius:15px;
  background:linear-gradient(135deg,rgba(66,182,255,.08),rgba(78,231,231,.045));
}
#admin .admin-scope-note>div{display:grid;gap:2px;min-width:150px}
#admin .admin-scope-note b{font-size:14px;color:var(--ink)}
#admin .admin-scope-note small{max-width:390px;color:var(--muted);font-size:11px;font-weight:800;line-height:1.35;text-align:right}
#admin .admin-tab-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;min-width:0}
#admin .admin-tab-list .admin-tab{
  min-width:0!important;
  min-height:58px;
  padding:9px 12px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:3px;
  text-align:left;
  line-height:1.15;
}
#admin .admin-tab-list .admin-tab>span{font-size:12.5px;font-weight:950;color:inherit}
#admin .admin-tab-list .admin-tab>small{font-size:10px;font-weight:800;color:var(--muted);white-space:normal}
#admin .admin-tab-list .admin-tab.active>small{color:color-mix(in srgb,var(--accent) 72%,var(--muted))}
#admin .admin-focus-card{overflow:hidden}
#admin .admin-focus-card>.card-head{padding-block:14px}
#admin .admin-head-note{margin:4px 0 0;color:var(--muted);font-size:11.5px;font-weight:750;line-height:1.4}
#admin .admin-health-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}
#admin .admin-health-kpi{
  min-width:0;
  padding:12px 13px;
  border:1px solid var(--line);
  border-radius:14px;
  background:linear-gradient(180deg,rgba(66,182,255,.055),rgba(66,182,255,.018));
}
#admin .admin-health-kpi span{display:block;color:var(--muted);font-size:10px;font-weight:950;text-transform:uppercase;letter-spacing:.55px}
#admin .admin-health-kpi b{display:block;margin-top:5px;color:var(--ink);font-size:20px;font-weight:950;letter-spacing:-.02em}
#admin .admin-health-kpi small{display:block;margin-top:4px;color:var(--muted);font-size:10.5px;font-weight:760;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#admin .admin-health-kpi.ok{border-color:rgba(19,174,113,.25);background:rgba(35,218,143,.065)}
#admin .admin-health-kpi.warn{border-color:rgba(229,154,25,.28);background:rgba(255,190,58,.08)}
#admin .admin-health-kpi.danger{border-color:rgba(222,73,91,.28);background:rgba(255,93,116,.075)}
#admin #conflictTable .table,#admin #monitoringTable .table{min-width:880px}
#admin #conflictTable .table th:nth-child(1){width:9%}
#admin #conflictTable .table th:nth-child(2){width:14%}
#admin #conflictTable .table th:nth-child(3){width:15%}
#admin #conflictTable .table th:nth-child(4){width:36%}
#admin #conflictTable .table th:nth-child(5){width:14%}
#admin #conflictTable .table th:nth-child(6){width:12%}
#admin #monitoringTable .table th:nth-child(1){width:20%}
#admin #monitoringTable .table th:nth-child(2){width:12%}
#admin #monitoringTable .table th:nth-child(3){width:50%}
#admin #monitoringTable .table th:nth-child(4){width:18%}
#admin #conflictTable .table td,#admin #monitoringTable .table td{font-size:11.5px;font-weight:620;line-height:1.35}
#admin .analytics-kpi-row{gap:10px;margin-bottom:12px}
#admin .analytics-kpi{padding:12px 14px;border-radius:15px;box-shadow:none}
#admin .analytics-kpi span{font-size:10.5px;margin-bottom:5px}
#admin .analytics-kpi b{font-size:24px}
#admin .analytics-grid{gap:12px;margin-bottom:12px}
#admin .analytics-card{padding:14px;border-radius:16px;box-shadow:none}
#admin .analytics-card h4{margin-bottom:11px;font-size:14px}
html[data-theme=dark] #admin .admin-scope-note,
html[data-theme=dark] #admin .admin-health-kpi{background:linear-gradient(180deg,rgba(30,72,112,.42),rgba(10,32,57,.52));border-color:rgba(117,212,255,.18)}
html[data-theme=dark] #admin .admin-health-kpi.ok{background:rgba(25,151,103,.13)}
html[data-theme=dark] #admin .admin-health-kpi.warn{background:rgba(207,142,24,.13)}
html[data-theme=dark] #admin .admin-health-kpi.danger{background:rgba(190,53,76,.14)}
@media(max-width:1180px){
  #admin .admin-ops-tabs{grid-template-columns:1fr!important}
  #admin .admin-scope-note small{max-width:none}
}
@media(max-width:760px){
  #admin .admin-scope-note{align-items:flex-start;flex-direction:column}
  #admin .admin-scope-note small{text-align:left}
  #admin .admin-tab-list{grid-template-columns:1fr}
  #admin .admin-health-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
}
#admin .admin-tab-list .admin-tab.active,
#admin .admin-tab-list .admin-tab.active:hover{
  border-color:var(--accent)!important;
  background:rgba(66,182,255,.16)!important;
  color:var(--accent)!important;
  box-shadow:0 0 0 1px rgba(78,231,231,.38),0 5px 14px rgba(66,182,255,.12)!important;
  transform:none!important;
}
#admin .admin-tab-list .admin-tab:not(.active),
#admin .admin-tab-list .admin-tab:not(.active):focus{
  border-color:var(--line)!important;
  background:var(--paper)!important;
  color:var(--ink)!important;
  box-shadow:none!important;
  transform:none!important;
}
#admin .admin-tab-list .admin-tab:not(.active):hover{
  border-color:#8ecbe3!important;
  background:linear-gradient(180deg,#fff 0%,#f1f9fd 100%)!important;
  color:#073b67!important;
}
html[data-theme=dark] #admin .admin-tab-list .admin-tab:not(.active),
html[data-theme=dark] #admin .admin-tab-list .admin-tab:not(.active):focus{
  background:rgba(9,31,56,.66)!important;
  color:var(--ink)!important;
}

/* V8.2.4 — synchronized market pricing administration and MOQ-aware Customer AI. */
#admin .admin-tab-list{grid-template-columns:repeat(4,minmax(0,1fr))}
#admin .market-pricing-admin-body{display:grid;gap:14px}
#admin .market-pricing-flow{display:grid;grid-template-columns:1fr auto 1fr auto 1fr auto 1fr;align-items:center;gap:8px;padding:12px;border:1px solid var(--line);border-radius:16px;background:linear-gradient(90deg,rgba(66,182,255,.07),rgba(64,224,203,.06))}
#admin .market-pricing-flow>div{min-width:0;display:grid;gap:3px;padding:9px 11px;border-radius:12px;background:var(--panel);border:1px solid color-mix(in srgb,var(--line) 80%,transparent)}
#admin .market-pricing-flow b{font-size:11.5px;color:var(--ink)}
#admin .market-pricing-flow span{font-size:9.5px;font-weight:750;color:var(--muted)}
#admin .market-pricing-flow>i{font-style:normal;color:var(--accent);font-weight:950}
#admin .market-pricing-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
#admin .market-pricing-config-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(330px,.9fr);gap:12px}
#admin .market-pricing-settings-card,#admin .market-pricing-preview-card,#admin .market-policy-card{padding:15px;border:1px solid var(--line);border-radius:17px;background:linear-gradient(180deg,rgba(255,255,255,.84),rgba(247,251,255,.82));box-shadow:0 7px 24px rgba(8,44,85,.045)}
#admin .section-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
#admin .section-title-row h4{margin:2px 0 0;font-size:15px;color:var(--ink)}
#admin .section-title-row p{margin:4px 0 0;font-size:10.5px;font-weight:720;color:var(--muted)}
#admin .market-pricing-settings-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
#admin .market-pricing-settings-form label{display:grid;gap:6px}
#admin .market-pricing-settings-form label>span{font-size:10px;font-weight:950;text-transform:uppercase;letter-spacing:.5px;color:var(--muted)}
#admin .market-pricing-settings-form label>div{display:grid;grid-template-columns:1fr auto;align-items:center;border:1px solid var(--line);border-radius:12px;background:var(--panel);overflow:hidden}
#admin .market-pricing-settings-form input{min-width:0;border:0!important;background:transparent!important;padding:11px 12px;font-size:16px;font-weight:900;color:var(--ink);outline:0}
#admin .market-pricing-settings-form em{padding:0 12px;font-style:normal;font-size:10px;font-weight:900;color:var(--muted)}
#admin .market-pricing-settings-form small{font-size:9.5px;font-weight:700;line-height:1.35;color:var(--muted)}
#admin .market-pricing-settings-actions{display:flex;justify-content:flex-end;margin-top:13px}
#admin .market-pricing-preview{display:grid;gap:7px}
#admin .market-preview-row{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:9px;padding:9px 10px;border-radius:11px;background:rgba(66,182,255,.045);border:1px solid color-mix(in srgb,var(--line) 82%,transparent)}
#admin .market-preview-row span{font-size:10.5px;font-weight:800;color:var(--muted)}
#admin .market-preview-row b{font-size:15px;color:var(--ink)}
#admin .market-preview-row em{font-size:9.5px;font-style:normal;font-weight:850;color:var(--muted)}
#admin .market-preview-row.result{border-color:rgba(28,183,129,.25);background:rgba(38,215,149,.065)}
#admin .market-preview-row.vnd{border-color:rgba(118,94,231,.22);background:rgba(118,94,231,.055)}
#admin .market-policy-table-wrap{max-height:365px;overflow:auto;border:1px solid var(--line);border-radius:14px}
#admin .market-policy-table{min-width:1000px;margin:0}
#admin .market-policy-table th{position:sticky;top:0;z-index:2;background:var(--soft);font-size:9.5px;padding:9px 7px}
#admin .market-policy-table td{padding:6px 7px}
#admin .market-policy-table input,#admin .market-policy-table select{width:100%;min-width:80px;border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--ink);padding:7px 8px;font:750 10.5px/1.2 inherit;outline:0}
#admin .market-policy-table td:nth-child(1){width:11%}#admin .market-policy-table td:nth-child(2){width:18%}#admin .market-policy-table td:nth-child(3){width:13%}
#admin .market-policy-table td:nth-child(4),#admin .market-policy-table td:nth-child(5){width:11%}#admin .market-policy-table td:nth-child(6){width:9%}#admin .market-policy-table td:nth-child(7){width:12%}#admin .market-policy-table td:nth-child(8){width:9%}
html[data-theme=dark] #admin .market-pricing-settings-card,html[data-theme=dark] #admin .market-pricing-preview-card,html[data-theme=dark] #admin .market-policy-card{background:linear-gradient(180deg,rgba(16,47,76,.9),rgba(9,31,55,.88));border-color:rgba(117,212,255,.16)}
html[data-theme=dark] #admin .market-pricing-flow>div{background:rgba(8,29,52,.78)}

/* The Price Approved register adds MOQ before the prior approved price. */
#priceApprovedPane .quotation-approved-table th:nth-child(3),#priceApprovedPane .quotation-approved-table td:nth-child(3){width:7%;text-align:center}
#priceApprovedPane .quotation-approved-table th:nth-child(4),#priceApprovedPane .quotation-approved-table td:nth-child(4){width:13%}
#priceApprovedPane .quotation-approved-table td{font-size:11.5px}

/* Customer-facing notes explain MOQ/history decisions even when a price is ready. */
#guestPortal .guest-pricing-note{display:block;max-width:100%;font-size:9.5px;font-weight:700;line-height:1.35;color:var(--muted);white-space:normal}
#guestPortal .guest-market-compact-card small{white-space:normal;line-height:1.25}
#guestPortal .guest-po-col-note{width:26%}
#guestPortal .guest-po-col-moq{width:5.5%}

/* Latest international values remain editable inputs; policy metadata stays compact. */
.fc-control-panel-v811 .fc-material-input-grid label,.fc-control-panel-v811 .fc-fob-input-grid label{align-content:start}
.fc-control-panel-v811 .fc-material-input-grid label>small,.fc-control-panel-v811 .fc-fob-input-grid label>small{display:block;margin-top:4px;font-size:8.7px;font-weight:750;line-height:1.25;color:var(--muted);white-space:normal}
.fc-control-panel-v811 .fc-material-input-grid label>span em,.fc-control-panel-v811 .fc-fob-input-grid label>span em{font-size:8.5px}

@media(max-width:1180px){
  #admin .admin-tab-list{grid-template-columns:repeat(2,minmax(0,1fr))}
  #admin .market-pricing-config-grid{grid-template-columns:1fr}
  #admin .market-pricing-flow{grid-template-columns:1fr 1fr}
  #admin .market-pricing-flow>i{display:none}
}
@media(max-width:760px){
  #admin .market-pricing-summary,#admin .market-pricing-settings-form{grid-template-columns:1fr}
  #admin .market-pricing-flow{grid-template-columns:1fr}
}
#priceApprovedPane .quotation-approved-table{width:100%!important;min-width:0!important;table-layout:fixed!important}
#priceApprovedPane .quotation-approved-table th,#priceApprovedPane .quotation-approved-table td{padding:9px 6px!important;overflow:hidden;text-overflow:ellipsis}
#priceApprovedPane .quotation-approved-table th:nth-child(1),#priceApprovedPane .quotation-approved-table td:nth-child(1){width:14%!important;text-align:left!important}
#priceApprovedPane .quotation-approved-table th:nth-child(2),#priceApprovedPane .quotation-approved-table td:nth-child(2){width:9%!important;text-align:left!important}
#priceApprovedPane .quotation-approved-table th:nth-child(3),#priceApprovedPane .quotation-approved-table td:nth-child(3){width:7%!important}
#priceApprovedPane .quotation-approved-table th:nth-child(4),#priceApprovedPane .quotation-approved-table td:nth-child(4){width:13%!important}
#priceApprovedPane .quotation-approved-table th:nth-child(5),#priceApprovedPane .quotation-approved-table td:nth-child(5){width:11%!important}
#priceApprovedPane .quotation-approved-table th:nth-child(6),#priceApprovedPane .quotation-approved-table td:nth-child(6){width:11%!important}
#priceApprovedPane .quotation-approved-table th:nth-child(7),#priceApprovedPane .quotation-approved-table td:nth-child(7){width:14%!important}
#priceApprovedPane .quotation-approved-table th:nth-child(8),#priceApprovedPane .quotation-approved-table td:nth-child(8){width:9%!important}
#priceApprovedPane .quotation-approved-table th:nth-child(9),#priceApprovedPane .quotation-approved-table td:nth-child(9){width:12%!important}

/* V8.2.5 Admin Pricing Rules: compact view/edit policy */
#admin .admin-ops-tabs{
  display:block!important;
  padding:8px!important;
  border-radius:18px;
}
#admin .admin-tab-list{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:8px!important;
  width:100%;
}
#admin .admin-tab-list .admin-tab{
  min-width:0!important;
  min-height:42px!important;
  padding:9px 12px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:12px!important;
}
#admin .admin-tab-list .admin-tab>span{font-size:12px!important;line-height:1.2!important}
#admin .admin-focus-card>.card-head{padding:13px 16px!important}
#admin .market-pricing-admin-body{display:grid;gap:12px!important;padding:14px 16px 16px!important}
#admin .market-pricing-toolbar{gap:8px;align-items:center}
#admin .market-pricing-toolbar .tool-btn,#admin .market-pricing-toolbar .btn-main{min-width:86px}
#admin .market-pricing-settings-card,#admin .market-policy-card{
  padding:14px!important;
  border-radius:15px!important;
  box-shadow:none!important;
}
#admin .market-pricing-summary{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important;margin:10px 0 12px}
#admin .market-pricing-summary .admin-health-kpi{min-height:76px;padding:10px 12px}
#admin .market-pricing-summary .admin-health-kpi b{font-size:18px}
#admin .market-pricing-settings-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px!important}
#admin .market-setting-value{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  align-items:center;
  gap:10px;
  min-height:48px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--panel);
}
#admin .market-setting-value span{font-size:10px;font-weight:950;text-transform:uppercase;letter-spacing:.5px;color:var(--muted)}
#admin .market-setting-value b{font-size:17px;color:var(--ink);font-weight:950}
#admin .market-setting-value em{font-size:10px;font-style:normal;font-weight:900;color:var(--muted)}
#admin .market-pricing-settings-form label{gap:5px!important}
#admin .market-pricing-settings-form label>div{min-height:48px}
#admin .market-pricing-settings-form input{padding:9px 11px!important;font-size:15px!important}
#admin .market-policy-card .section-title-row{margin-bottom:10px}
#admin .market-policy-table-wrap{max-height:390px!important;overflow:auto!important;border-radius:12px!important}
#admin .market-policy-table{min-width:0!important;width:100%!important;table-layout:fixed}
#admin .market-policy-table th{font-size:9.5px!important;padding:9px 8px!important;white-space:nowrap}
#admin .market-policy-table td{font-size:10.8px!important;padding:9px 8px!important;vertical-align:middle}
#admin .market-policy-table th:nth-child(1),#admin .market-policy-table td:nth-child(1){width:12%}
#admin .market-policy-table th:nth-child(2),#admin .market-policy-table td:nth-child(2){width:23%}
#admin .market-policy-table th:nth-child(3),#admin .market-policy-table td:nth-child(3){width:14%}
#admin .market-policy-table th:nth-child(4),#admin .market-policy-table td:nth-child(4){width:12%}
#admin .market-policy-table th:nth-child(5),#admin .market-policy-table td:nth-child(5){width:11%}
#admin .market-policy-table th:nth-child(6),#admin .market-policy-table td:nth-child(6){width:10%}
#admin .market-policy-table th:nth-child(7),#admin .market-policy-table td:nth-child(7){width:18%}
#admin .market-policy-table.is-viewing td{height:46px}
#admin .market-policy-table.is-viewing code{font:900 10.5px/1.2 inherit;color:var(--ink);background:var(--soft);border-radius:7px;padding:4px 7px}
#admin .market-policy-table .num-cell{text-align:right;font-variant-numeric:tabular-nums;font-weight:850}
#admin .market-policy-table input,#admin .market-policy-table select{
  min-width:0!important;
  width:100%!important;
  padding:7px 8px!important;
  font-size:10.5px!important;
  border-radius:8px!important;
}
#admin .market-policy-table.is-editing td{padding:6px!important}
#admin .market-policy-table.is-editing tr[data-policy-draft="true"]{background:rgba(47,203,218,.07)}
#admin #marketPricingResult:empty{display:none}
#admin #marketPricingResult .action-box{margin-top:0}
html[data-theme=dark] #admin .market-setting-value{background:rgba(8,29,52,.78)}
@media(max-width:980px){
  #admin .admin-tab-list{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #admin .market-pricing-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #admin .market-pricing-settings-form{grid-template-columns:1fr!important}
  #admin .market-policy-table{min-width:900px!important;table-layout:auto}
}
@media(max-width:620px){
  #admin .admin-tab-list{grid-template-columns:1fr!important}
  #admin .market-pricing-summary{grid-template-columns:1fr!important}
}


/* V8.2.6 — domestic material price visibility and phone/tablet responsive shell. */
#admin .market-policy-table{min-width:1420px!important;table-layout:fixed!important}
#admin .market-policy-table th,#admin .market-policy-table td{font-variant-numeric:tabular-nums}
#admin .market-policy-table th:nth-child(1),#admin .market-policy-table td:nth-child(1){width:8%!important}
#admin .market-policy-table th:nth-child(2),#admin .market-policy-table td:nth-child(2){width:15%!important}
#admin .market-policy-table th:nth-child(3),#admin .market-policy-table td:nth-child(3){width:8%!important}
#admin .market-policy-table th:nth-child(4),#admin .market-policy-table td:nth-child(4){width:9%!important}
#admin .market-policy-table th:nth-child(5),#admin .market-policy-table td:nth-child(5){width:9%!important}
#admin .market-policy-table th:nth-child(6),#admin .market-policy-table td:nth-child(6){width:10%!important}
#admin .market-policy-table th:nth-child(7),#admin .market-policy-table td:nth-child(7){width:12%!important}
#admin .market-policy-table th:nth-child(8),#admin .market-policy-table td:nth-child(8){width:10%!important}
#admin .market-policy-table th:nth-child(9),#admin .market-policy-table td:nth-child(9){width:9%!important}
#admin .market-policy-table th:nth-child(10),#admin .market-policy-table td:nth-child(10){width:10%!important}
#admin .market-policy-table .policy-derived{background:color-mix(in srgb,var(--accent) 5%,transparent);color:var(--ink)}
#admin .market-policy-table th[title]{text-decoration:underline dotted color-mix(in srgb,var(--muted) 62%,transparent);text-underline-offset:3px;cursor:help}
#admin .market-policy-table-wrap{scrollbar-gutter:stable;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
html[data-theme=dark] #admin .market-policy-table .policy-derived{background:rgba(61,205,218,.055)}

@media(max-width:900px){
  .top{padding:10px 12px}
  .header{display:flex!important;align-items:flex-start;justify-content:space-between;gap:10px}
  .brand{min-width:0;flex:1 1 auto}
  .brand h1{font-size:19px;line-height:1.15;white-space:normal}
  .brand span{display:none}
  .brand .sapali-return-link{min-height:30px;margin-bottom:6px;padding:0 10px}
  .user-zone{flex:0 0 auto;gap:6px}
  .user-status{min-width:0;max-width:190px;padding:6px 9px}
  .user-status b{display:block;max-width:118px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .tabs{display:flex!important;grid-template-columns:none!important;gap:6px;margin-top:9px;padding:6px;overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
  .tabs .tab{flex:0 0 128px;height:38px;font-size:11.5px;scroll-snap-align:start}
  .page{padding:10px 12px 24px}
  .card,.title-panel,.toolbar-panel{border-radius:15px}
  .card-head{padding:11px 12px;flex-wrap:wrap}
  .card-body{padding:12px}
  .card-head-actions>.action-strip,.card-head-actions>.market-pricing-toolbar{margin-left:auto}
  .table-wrap{max-width:100%;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
  #admin .admin-ops-tabs{padding:6px!important}
  #admin .admin-tab-list{grid-template-columns:repeat(4,minmax(126px,1fr))!important;overflow-x:auto!important;scrollbar-width:thin}
  #admin .admin-tab-list .admin-tab{min-width:126px!important;min-height:38px!important;padding:7px 9px!important}
  #admin .market-pricing-admin-body{padding:10px!important}
  #admin .market-pricing-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #admin .market-pricing-settings-form{grid-template-columns:1fr!important}
  #admin .market-policy-card,#admin .market-pricing-settings-card{padding:10px!important}
  #admin .market-policy-table{min-width:1360px!important;table-layout:fixed!important}
}
@media(max-width:520px){
  .top{padding:8px}
  .header{align-items:center}
  .brand h1{font-size:16.5px}
  .brand .sapali-return-link{font-size:10px;min-height:28px}
  .user-status{max-width:132px;padding:5px 7px}
  .user-status .user-avatar{width:31px;height:31px}
  .user-status b{max-width:74px;font-size:10.5px}
  .user-status small{font-size:9px}
  .icon-menu{width:38px;height:38px}
  .tabs .tab{flex-basis:112px;height:36px;font-size:10.5px}
  .page{padding:8px 7px 22px}
  #admin .admin-tab-list{grid-template-columns:repeat(2,minmax(0,1fr))!important;overflow:visible!important}
  #admin .admin-tab-list .admin-tab{min-width:0!important;font-size:10.5px!important}
  #admin .admin-focus-card>.card-head{padding:10px!important;align-items:flex-start}
  #admin .admin-focus-card>.card-head h3{font-size:14px}
  #admin .market-pricing-toolbar{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin-left:0!important}
  #admin .market-pricing-toolbar .tool-btn,#admin .market-pricing-toolbar .btn-main{min-width:0;width:100%;height:36px;padding:0 8px;font-size:10.5px}
  #admin .market-pricing-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
  #admin .market-pricing-summary .admin-health-kpi{min-height:72px;padding:8px}
  #admin .market-pricing-summary .admin-health-kpi b{font-size:15px}
  #admin .market-pricing-summary .admin-health-kpi small{font-size:8.5px}
  #admin .section-title-row{align-items:center}
  #admin .section-title-row h4{font-size:13px}
  #admin .market-setting-value{grid-template-columns:1fr auto;gap:5px;padding:9px}
  #admin .market-setting-value b{font-size:15px}
  #admin .market-setting-value em{grid-column:2}
  #admin .market-policy-table-wrap{max-height:430px!important}
  #admin .market-policy-table{min-width:1320px!important}
  #sapaliPatchVersion{right:6px!important;bottom:6px!important;font-size:9px!important;padding:4px 7px!important}
}
@media(max-height:500px) and (orientation:landscape){
  .top{padding-top:7px;padding-bottom:7px}
  .brand .sapali-return-link{display:none}
  .brand h1{font-size:17px}
  .tabs{margin-top:6px}
  .tabs .tab{height:34px}
  .page{padding-top:7px}
  #admin .market-pricing-summary .admin-health-kpi{min-height:62px}
  #admin .market-policy-table-wrap{max-height:230px!important}
}

/* V8.2.6 mobile portrait header: keep product identity and account controls on separate rows. */
@media(max-width:520px) and (orientation:portrait){
  .header{display:grid!important;grid-template-columns:1fr!important;gap:7px!important;align-items:start!important}
  .header .brand{grid-column:1;min-width:0;width:100%}
  .header .brand h1{font-size:17px!important;line-height:1.2!important;white-space:normal!important}
  .header .user-zone{grid-column:1;width:100%;justify-content:flex-end!important}
  .header .user-status{max-width:210px}
  .header .user-status b{max-width:130px}
}

/* FC New Price detail synchronization and compact comparison layout */
#calcDetailResult .formula-horizontal-wrap{
  overflow-x:auto!important;
  overflow-y:hidden!important;
}
#calcDetailResult .formula-horizontal-table{
  width:max-content!important;
  min-width:100%!important;
  table-layout:auto!important;
}
#calcDetailResult .formula-horizontal-table th,
#calcDetailResult .formula-horizontal-table td{
  width:auto!important;
  min-width:92px!important;
  max-width:150px!important;
  padding:8px 7px!important;
}
#calcDetailResult .formula-horizontal-table th[data-formula-code="MATERIAL_TOTAL"],
#calcDetailResult .formula-horizontal-table td[data-formula-code="MATERIAL_TOTAL"],
#calcDetailResult .formula-horizontal-table th[data-formula-code="STANDARD_VND"],
#calcDetailResult .formula-horizontal-table td[data-formula-code="STANDARD_VND"],
#calcDetailResult .formula-horizontal-table th[data-formula-code="SUGGESTED_VND"],
#calcDetailResult .formula-horizontal-table td[data-formula-code="SUGGESTED_VND"]{
  min-width:168px!important;
  max-width:190px!important;
}
#calcDetailResult .formula-horizontal-table .formula-fc-cell{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
#calcDetailResult .formula-horizontal-table .formula-fc-main,
#calcDetailResult .formula-horizontal-table .formula-fc-sub,
#calcDetailResult .formula-horizontal-table .formula-fc-delta{
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
.modal.quotation-material-cost-modal .smart-modal-head h3{
  font-size:18px!important;
  line-height:1.25!important;
  letter-spacing:0!important;
}
.quotation-material-cost-modal .material-price-comparison .table{
  min-width:760px!important;
  width:100%!important;
  table-layout:fixed!important;
}
.quotation-material-cost-modal .material-price-comparison .table th:nth-child(1){width:17%!important}
.quotation-material-cost-modal .material-price-comparison .table th:nth-child(2){width:18%!important}
.quotation-material-cost-modal .material-price-comparison .table th:nth-child(3){width:25%!important}
.quotation-material-cost-modal .material-price-comparison .table th:nth-child(4){width:14%!important}
.quotation-material-cost-modal .material-price-comparison .table th:nth-child(5){width:14%!important}
.quotation-material-cost-modal .material-price-comparison .table th:nth-child(6){width:12%!important}
.quotation-material-cost-modal .material-price-comparison .table td{
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
.quotation-material-cost-modal .material-price-comparison .table td:nth-child(n+4){
  text-align:right!important;
}
.quotation-material-cost-modal .material-new-price{
  display:block;
  font-size:13px;
}
.quotation-material-cost-modal .forecast-diff{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:2px;
  font-weight:800;
}
.quotation-material-cost-modal .forecast-diff.up{color:#b42318!important}
.quotation-material-cost-modal .forecast-diff.down{color:#067647!important}
.quotation-material-cost-modal .forecast-diff small{font-size:10px;color:inherit!important}
@media(max-width:900px){
  #calcDetailResult .formula-horizontal-table{min-width:max-content!important}
  .quotation-material-cost-modal .material-price-comparison .table{min-width:760px!important}
}

/* Pallet-to-model traceability */
.packing-usage-link{font-weight:900;text-decoration:underline;text-underline-offset:3px}
.packing-model-usage-section{margin:14px 0;padding:14px;border:1px solid var(--line);border-radius:14px;background:rgba(66,182,255,.045)}
.packing-model-usage-section .model-bom-section-head{margin-bottom:10px}
.packing-model-usage-section .model-bom-section-head h4{margin:2px 0 0;font-size:15px}
.packing-model-usage-section .table{min-width:980px}
.packing-linkage-warning{display:flex;flex-direction:column;gap:5px;margin:14px 0;padding:12px 14px;border:1px solid rgba(245,158,11,.38);border-radius:12px;background:rgba(245,158,11,.08)}
.packing-linkage-warning b{font-size:13px;color:#92400e}
.packing-linkage-warning span{font-size:12px;line-height:1.45;color:var(--muted)}
[data-theme="dark"] .packing-linkage-warning b{color:#fbbf24}
