/* R6.17.7.7 — BOM quick-add closure
 * High-frequency path: choose → configure current product relation → choose/create supplier/workshop → save.
 * Loaded after R6.17.7.5 builder styles so it can narrow the workflow without changing master-data APIs.
 */
.r61777-builder{width:min(98vw,1940px)!important;height:min(96vh,1100px)!important}
.r61777-builder>header{padding:14px 20px 11px!important}
.r61777-builder>header h2{font-size:20px!important}
.r61777-builder>header p{font-size:12px!important}
.r61777-builder .r610-tabs{padding:6px 16px!important}

/* Two business steps only: configure in-place, then save. */
.r61777-builder-steps{grid-template-columns:repeat(2,minmax(0,1fr))!important;padding:8px 24px 9px!important}
.r61777-builder-steps>div:not(:last-child)::after{left:58px!important;right:58px!important;top:17px!important;width:auto!important;transform:none!important}
.r61777-builder-steps b{width:32px!important;height:32px!important;flex-basis:32px!important;border-radius:10px!important}
.r61777-builder-steps strong{font-size:12px!important}
.r61777-builder-steps small{font-size:10px!important}

/* Existing material: category/list remain fast, selected item becomes the right-side working panel. */
.r61777-select-shell{min-width:0}
.r61777-select-shell .r610-toolbar{padding:9px 14px!important}
.r61777-select-shell .r61775-part-toolbar{grid-template-columns:minmax(420px,1fr) auto auto auto auto!important;gap:7px!important}
.r61777-select-shell .r610-pick-layout{grid-template-columns:minmax(210px,16%) minmax(560px,1fr) minmax(390px,32%)!important;min-width:0!important}
.r61777-select-shell .r610-pick-layout.no-detail{grid-template-columns:minmax(210px,17%) minmax(650px,1fr) minmax(300px,25%)!important}
.r61777-select-shell .r610-detail{display:block!important;padding:12px!important;background:#fbfcff;overflow:auto!important}
.r61777-config-aside:empty{padding:0!important}
.r61777-select-shell .r610-list>header{padding:9px 13px!important}
.r61777-select-shell .r610-list>header h3{font-size:14px!important}
.r61777-select-shell .r610-list>header p{font-size:11px!important}
.r61777-select-shell .r610-part{min-height:56px!important}
.r61777-select-shell .r610-part.checked{box-shadow:inset 3px 0 0 #6366f1}

/* Quick config panel. */
.r61777-quick-config{display:flex;flex-direction:column;gap:11px;border:1px solid #dbe5f1;border-radius:14px;background:#fff;padding:14px;box-shadow:0 7px 22px rgba(15,23,42,.05)}
.r61777-quick-config>header{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;padding-bottom:10px;border-bottom:1px solid #edf1f6}
.r61777-quick-config>header span{display:block;color:#4f46e5;font-size:10px;font-weight:800;letter-spacing:.02em}
.r61777-quick-config>header h3{margin:3px 0 2px;font-size:15px;line-height:1.35;color:#172033}
.r61777-quick-config>header p{margin:0;color:#64748b;font-size:11px;line-height:1.45}
.r61777-quick-config>header>button{flex:0 0 29px;width:29px;height:29px;border:0;border-radius:8px;background:#f1f5f9;color:#64748b;cursor:pointer;font-size:17px}
.r61777-quick-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 10px}
.r61777-quick-grid label{display:grid;gap:5px;min-width:0;color:#475569;font-size:11px;font-weight:700}
.r61777-quick-grid label.wide{grid-column:1/-1}
.r61777-quick-grid input,.r61777-quick-grid select,.r61777-quick-grid textarea{width:100%;box-sizing:border-box;border:1px solid #dbe2ea;border-radius:9px;background:#fff;min-height:38px;padding:8px 10px;color:#172033;font:inherit;font-weight:500}
.r61777-quick-grid input[readonly]{background:#f8fafc;color:#64748b}
.r61777-quick-grid textarea{resize:vertical;min-height:66px;line-height:1.5}
.r61777-unit-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;align-items:center}
.r61777-unit-row .btn{white-space:nowrap;min-height:38px;padding:7px 9px;font-size:11px}
.r61777-quick-config>footer{display:flex;justify-content:flex-end;gap:8px;padding-top:2px}
.r61777-quick-config>footer .btn-primary{min-width:112px}
.r61777-after-save-note{display:block;padding:9px 10px;border-radius:9px;background:#f8fafc;color:#64748b;font-size:10px;line-height:1.45}

/* Inline supplier/workshop creation: local to the current BOM task. */
.r61777-unit-create{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:11px;border:1px solid #c7d2fe;border-radius:12px;background:#f8f9ff}
.r61777-unit-create>header{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;padding-bottom:7px;border-bottom:1px solid #e0e7ff}
.r61777-unit-create>header strong{font-size:12px;color:#3730a3}
.r61777-unit-create>header button{border:0;background:transparent;color:#64748b;font-size:17px;cursor:pointer}
.r61777-unit-create label{display:grid;gap:4px;font-size:10px;font-weight:700;color:#475569}
.r61777-unit-create label.wide{grid-column:1/-1}
.r61777-unit-create input,.r61777-unit-create select{width:100%;box-sizing:border-box;min-height:35px;border:1px solid #d8def0;border-radius:8px;background:#fff;padding:7px 8px}
.r61777-unit-create>footer{grid-column:1/-1;display:flex;justify-content:flex-end;gap:7px}

/* Process: selecting one process opens one side panel; category management remains secondary. */
.r61777-process-shell{overflow:hidden!important}
.r61777-process-shell>.r610-toolbar{padding:9px 14px!important}
.r61777-process-layout{display:grid;grid-template-columns:minmax(0,1fr);min-height:0;flex:1;overflow:hidden}
.r61777-process-layout.has-quick{grid-template-columns:minmax(640px,1fr) minmax(390px,31%)}
.r61777-process-layout>.r61775-process-groups{min-width:0;overflow:auto;padding:8px 12px 16px!important}
.r61777-process-layout.has-quick .r61775-process-group .r610-process-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
.r61777-process-quick{min-width:0;overflow:auto;border-left:1px solid #e2e8f0;background:#fbfcff;padding:12px}
.r61777-process-quick .r61777-quick-config{position:sticky;top:0}
.r61777-process-shell .r61775-process-category-form{max-width:980px}
.r61777-legacy-copy{display:none!important}

/* New material: master + current-product relation in one screen. */
.r61777-new-one-screen{display:grid;grid-template-columns:minmax(620px,1.15fr) minmax(420px,.85fr);gap:0;min-height:0;flex:1;overflow:auto;background:#fbfcff}
.r61777-new-one-screen>form{display:contents}
.r61777-new-master{max-width:none!important;width:auto!important;margin:14px 8px 14px 16px!important;padding:17px 18px!important;border:1px solid #e2e8f0!important;border-radius:14px!important;background:#fff!important}
.r61777-new-relation{align-self:start;margin:14px 16px 14px 8px;padding:17px 18px;border:1px solid #cbd5ff;border-radius:14px;background:#fff;box-shadow:0 8px 24px rgba(79,70,229,.05)}
.r61777-new-relation>header,.r61777-new-master>header{margin-bottom:12px}
.r61777-new-relation>header span{font-size:10px;color:#4f46e5;font-weight:800}
.r61777-new-relation>header h3{margin:3px 0;font-size:16px}
.r61777-new-relation>header p{margin:0;color:#64748b;font-size:11px}
.r61777-new-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px}
.r61777-new-grid>.wide,.r61777-new-grid label.wide{grid-column:1/-1}
.r61777-new-grid label{display:grid;gap:5px;font-size:11px;font-weight:700;color:#475569;min-width:0}
.r61777-new-grid input,.r61777-new-grid select,.r61777-new-grid textarea{width:100%;box-sizing:border-box;min-height:39px;border:1px solid #dbe2ea;border-radius:9px;background:#fff;padding:8px 10px}
.r61777-new-grid textarea{resize:vertical;min-height:62px}
.r61777-new-relation .r61777-unit-create{margin-top:10px}
.r61777-new-actions{grid-column:1/-1;position:sticky;bottom:0;z-index:7;display:flex;justify-content:flex-end;gap:8px;padding:10px 16px;border-top:1px solid #e2e8f0;background:rgba(255,255,255,.97);backdrop-filter:blur(8px)}
.r61777-new-actions .btn-primary{min-width:120px}

/* The global footer is supporting status only; actions live beside the data the user is editing. */
.r61777-builder>footer{padding:9px 16px!important;min-height:47px}
.r61777-builder>footer strong{font-size:12px}
.r61777-builder>footer span{font-size:10px!important;margin-top:1px!important}
.r61777-builder>footer .btn{min-height:34px}

@media(max-width:1400px){
 .r61777-select-shell .r610-pick-layout{grid-template-columns:210px minmax(500px,1fr) minmax(340px,31%)!important}
 .r61777-select-shell .r61775-part-toolbar{grid-template-columns:minmax(320px,1fr) auto auto auto!important}
 .r61777-select-shell .r61775-selected-count{display:none}
 .r61777-process-layout.has-quick{grid-template-columns:minmax(580px,1fr) 360px}
 .r61777-process-layout.has-quick .r61775-process-group .r610-process-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .r61777-new-one-screen{grid-template-columns:minmax(560px,1fr) 390px}
}
@media(max-width:1120px){
 .r61777-select-shell .r610-pick-layout,.r61777-select-shell .r610-pick-layout.no-detail{grid-template-columns:200px minmax(0,1fr)!important}
 .r61777-select-shell .r610-detail{position:absolute;right:14px;top:142px;bottom:64px;width:min(390px,42vw);z-index:12;border:1px solid #dbe5f1;border-radius:14px;box-shadow:0 18px 50px rgba(15,23,42,.18)}
 .r61777-select-shell .r610-pick-layout.no-detail .r610-detail{display:none!important}
 .r61777-process-layout.has-quick{grid-template-columns:1fr}
 .r61777-process-quick{position:absolute;right:14px;top:144px;bottom:64px;width:min(390px,42vw);z-index:12;border:1px solid #dbe5f1;border-radius:14px;box-shadow:0 18px 50px rgba(15,23,42,.18)}
 .r61777-new-one-screen{grid-template-columns:1fr}
 .r61777-new-master,.r61777-new-relation{margin:12px 14px!important}
}
@media(max-width:820px){
 .r61777-builder-steps{grid-template-columns:1fr!important;gap:4px}.r61777-builder-steps>div:not(.active){display:none}.r61777-builder-steps>div::after{display:none!important}
 .r61777-select-shell .r61775-part-toolbar{grid-template-columns:1fr 1fr!important}
 .r61777-select-shell .r61775-part-toolbar input{grid-column:1/-1}
 .r61777-select-shell .r610-pick-layout,.r61777-select-shell .r610-pick-layout.no-detail{grid-template-columns:1fr!important}
 .r61777-select-shell .r610-pick-layout>aside:first-child{display:none}
 .r61777-select-shell .r610-detail,.r61777-process-quick{left:8px;right:8px;top:118px;bottom:54px;width:auto}
 .r61777-quick-grid,.r61777-unit-create,.r61777-new-grid{grid-template-columns:1fr}
 .r61777-quick-grid label.wide,.r61777-unit-create label.wide,.r61777-new-grid>.wide,.r61777-new-grid label.wide{grid-column:auto}
 .r61777-unit-row{grid-template-columns:1fr}
 .r61777-process-layout.has-quick .r61775-process-group .r610-process-grid{grid-template-columns:1fr!important}
}
