/* Project PRISM Phase 2D / standalone sourcing workspace; inherits PRISM look. */
.sourceTabBar{display:flex;gap:9px;flex-wrap:wrap;margin:12px 0 18px;border-bottom:1px solid #c9dced;padding-bottom:12px}
.sourceTabBar button{background:#e5f2ff;color:#174d78;border:1px solid #bbd8f2;border-radius:9px;padding:12px 15px;font-weight:800;cursor:pointer}
.sourceTabBar button.active{background:#087bbd;color:#fff;border-color:#087bbd}
.sourceSection{border:1px solid #c8ddeb;background:#f5faff;border-radius:13px;padding:20px;margin:12px 0 20px}
.sourceSection h3{font-size:21px;margin:0 0 8px;color:#173e62}
.sourceGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:13px 0}
.sourceGrid.thirds{grid-template-columns:repeat(3,minmax(0,1fr))}
.sourceField{display:grid;gap:5px;min-width:0;color:#244c6e;font-size:13px;font-weight:700}
.sourceField input,.sourceField select,.sourceField textarea{display:block;width:100%;padding:11px;border:1px solid #bad2e8;border-radius:8px;background:#fff;font-size:14px;min-width:0;color:#163a56}
.sourceActions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end;margin-top:14px}
.sourceTableWrap{overflow:auto;max-width:100%;border:1px solid #cce0f0;border-radius:10px;background:#fff;margin:13px 0}
.sourceTable{border-collapse:collapse;width:100%;font-size:13px}
.sourceTable th,.sourceTable td{padding:11px;border-bottom:1px solid #dfebf5;text-align:left;vertical-align:top;min-width:70px}
.sourceTable th{background:#e4f0fb;font-size:12px;text-transform:uppercase;color:#274b69;white-space:nowrap}
.sourceTable td input,.sourceTable td select{width:100%;min-width:80px;padding:8px;border:1px solid #c6d9ea;border-radius:7px;font-size:13px}
.sourceTag{display:inline-flex;padding:5px 9px;border-radius:7px;font-size:12px;font-weight:800;background:#e1f0ff;color:#155583}
.sourceTag.low{background:#d7f6e5;color:#086439}.sourceTag.tie{background:#fff2c2;color:#815002}
.sourceWarn{border-left:4px solid #cf8c13;background:#fff4db;padding:12px 14px;border-radius:9px;color:#694300;line-height:1.55}
.sourceError{border-left:4px solid #bd343e;background:#fff1f1;padding:12px 14px;border-radius:9px;color:#912b34}
.sourceGood{border-left:4px solid #178d5d;background:#e5faef;padding:12px 14px;border-radius:9px;color:#155d41}
.sourceCard{padding:13px 15px;border:1px solid #c8ddeb;border-radius:10px;background:#fff;margin:10px 0;display:grid;gap:8px}
.sourceMini{font-size:12px;color:#58718b;line-height:1.5}
.sourceNotice{color:#245377;font-size:13px;line-height:1.6}
.sourceMono{font-family:ui-monospace,SFMono-Regular,monospace;font-size:12px;overflow-wrap:anywhere}
.sourceControls{display:flex;flex-wrap:wrap;align-items:center;gap:9px}
.sourceControls select{flex:1;min-width:220px;padding:12px;border:1px solid #bfd4e9;border-radius:9px}
.sourceDisabled{opacity:.54;pointer-events:none}
.sourceCount{font-size:12px;font-weight:800;border-radius:30px;color:#fff;background:#1974bb;padding:6px 12px}
@media(max-width:780px){.sourceGrid,.sourceGrid.thirds{grid-template-columns:1fr}.sourceSection{padding:12px}.sourceTable{font-size:12px}}

/* Phase 2W: operational next step is prominent but not an approval gate. */
.prismNextOperational{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px;margin:10px 0;border-radius:10px;background:#e3f8f4;border:1px solid #93d4ca;color:#125a60}
.prismNextOperational strong{font-size:14px}
.prismNextOperational .sourceMini{flex:1;min-width:160px}
.prismNextOperational button{font-size:12px}

/* Phase 2Y — review-first bulk assessment assistance. */
.sourceBulkAssist{border:1px solid #97cfc5;background:#e9f9f6;border-radius:12px;padding:16px;margin-top:14px}
.sourceBulkAssist h4{font-size:16px;margin:0 0 7px;color:#11585b}
.sourceBulkAssist .sourceMini{color:#305d61}
.sourceBulkAssistStatusError{color:#a32132!important;font-weight:700}
.sourceBulkReviewChanged{background:#fff5dc}
.sourceBulkReviewLocked{background:#f0f2f5;opacity:.7}
@media(max-width:780px){.sourceBulkAssist{padding:12px}}

/* Phase 2Z — original Apps Script-inspired consolidated Abstract and compact quotation popup */
.prismSourceToolbar{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}
.prismSourceToolbar h3{margin:0 0 4px}.prismSourceToolbar p{margin:0}
.prismSourceRfqPicker{max-width:700px}
.prismSourceQuoteDialog{border:1px solid #b7d5df;border-radius:18px;width:min(1120px,96vw);max-width:96vw;max-height:90dvh;padding:0;color:#143c58;background:#f6fbff;box-shadow:0 24px 80px #00283a5e;overflow:hidden}
.prismSourceQuoteDialog::backdrop{background:rgba(1,30,43,.65);backdrop-filter:blur(4px)}
.prismSourceModalHead{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:18px 22px;background:linear-gradient(110deg,#d8faf2,#e5f3ff);border-bottom:1px solid #bcd8e5}
.prismSourceModalHead h2{font-size:22px;margin:0 0 6px;color:#0b555c}.prismSourceModalHead p{font-size:13px;margin:0;color:#325873}
.prismSourceModalRfq{font-size:13px;font-weight:800;margin-top:8px}
.prismSourceModalX{background:#fff;border:1px solid #b9d6e0;border-radius:10px;width:36px;height:36px;cursor:pointer;color:#174d65;font-weight:800;font-size:17px}
.prismSourceModalBody{padding:20px 22px;overflow-y:auto;max-height:calc(90dvh - 183px);overscroll-behavior:contain}
.prismSourceModalBody .sourceGrid{margin:14px 0}
.prismSourceModalActions{display:flex;gap:9px;flex-wrap:wrap;align-items:center;justify-content:flex-end;border-top:1px solid #c8dce5;padding:13px 20px;background:#eef8fa}
.prismQuoteModalTable{min-width:680px}
.prismAbstractLegend{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.prismAbstractLegend span{padding:6px 10px;font-size:12px;font-weight:750;border-radius:8px;border:1px solid #c5d6e2}
.prismAbstractLegendLow{background:#daf6e7;color:#135d3f}.prismAbstractLegendTie{background:#fff1c7;color:#785219}.prismAbstractLegendProposed{background:#f0e6ff;color:#513177}
.prismAbstractSummary{display:flex;flex-wrap:wrap;gap:9px;align-items:center;justify-content:space-between;background:#e1f2f5;padding:13px 15px;border-radius:10px;color:#134e5a}
.prismAbstractScroll{overflow-x:auto;border:1px solid #bad7e4;background:#fff;border-radius:12px;margin:14px 0;max-width:100%;scrollbar-color:#66a9b9 #e9f4f6}
.prismAbstractTable{width:100%;min-width:920px;border-collapse:separate;border-spacing:0;font-size:13px;color:#173e5b}
.prismAbstractTable th,.prismAbstractTable td{border-right:1px solid #e0ebf2;border-bottom:1px solid #e0ebf2;vertical-align:top;padding:10px 12px;min-width:145px;overflow-wrap:anywhere}
.prismAbstractTable thead th{background:#d9e9f3;color:#174762;text-align:left;font-size:12px;position:sticky;top:0;z-index:2}
.prismAbstractTable thead th strong{display:block;font-size:14px}.prismAbstractTable small{display:block;font-weight:500;color:#426780;margin-top:5px;font-size:11px}
.prismAbstractTable thead th:first-child,.prismAbstractTable tbody td:first-child,.prismAbstractTable tbody th:first-child{position:sticky;left:0;background:#ecf4fa;z-index:1;min-width:115px}
.prismAbstractTable tbody tr:nth-child(even){background:#f6fbfe}
.prismAbstractTable tbody .prismAbstractLow{background:#d9f7e5;font-weight:800}.prismAbstractTable tbody .prismAbstractTie{background:#fff0c6;font-weight:800}
.prismAbstractTable tbody .prismAbstractLate{background:#ffecee;color:#8b3442}
.prismAbstractMissing{font-weight:700;color:#a24250}
.prismAbstractProposed{display:inline-block;border-radius:6px;padding:4px 8px;font-size:10px;font-weight:850;margin-top:6px;letter-spacing:.02em;background:#55358e;color:#fff;border:1px solid #55358e}
/* Phase 2AD: price-rank and proposed-supplier colors must never mean the same thing. */
.prismAbstractTable tbody td.prismAbstractSelected{outline:1px solid #c0b4e4;outline-offset:-1px;font-weight:750}
.prismAbstractTable small.prismAbstractPriceMark{display:inline-flex;width:max-content;max-width:100%;align-items:center;gap:4px;border-radius:6px;padding:3px 7px;margin-top:6px;font-size:10px;font-weight:850;line-height:1.45;letter-spacing:.01em}
.prismAbstractTable small.prismAbstractPriceMarkLow{background:#c5f0d8;color:#15583a;border:1px solid #72bc95}
.prismAbstractTable small.prismAbstractPriceMarkTie{background:#ffefc4;color:#805116;border:1px solid #d4ac57}
.prismAbstractTotals th{font-weight:800;background:#dcecf6!important}
.prismAbstractAllocations,.prismAbstractSchedules{border:1px solid #c8dfea;border-radius:12px;background:#fff;padding:15px;margin:14px 0}
.prismAbstractAllocations h4,.prismAbstractSchedules h4{font-size:17px;margin:0 0 5px;color:#134b62}
.prismAbstractPickRow{display:grid;grid-template-columns:minmax(140px,1.1fr) minmax(260px,2fr) auto;gap:10px;align-items:center;padding:10px 12px;margin:9px 0;border:1px solid #dae6ee;border-radius:9px;border-left:5px solid #adcbd9}
.prismAbstractPickDetail{display:grid;gap:4px}.prismAbstractPickRow select{width:100%;min-width:0;padding:10px;border:1px solid #aacbd5;border-radius:8px;background:white;color:#17445b}
.prismAbstractPickRow .btn{font-size:12px;min-height:40px}

/* Phase 2AB: distinguish confirmed database proposals from unsaved local selections. */
.prismAbstractSaveSummary{margin:8px 0 12px;padding:9px 12px;border:1px solid #b6dbe5;background:#eefafc;border-radius:8px;color:#174963;font-size:13px;font-weight:700}
.prismScopeStatus{display:inline-flex;width:max-content;max-width:100%;align-items:center;border-radius:100px;padding:4px 10px;font-size:11px;font-weight:800;letter-spacing:.01em}
.prismScopeStatusNew{color:#5b6b77;background:#eaf0f4}
.prismScopeStatusSaved{color:#136644;background:#d4f4e3}
.prismScopeStatusDirty{color:#814709;background:#ffedcd}
.prismScopeStatusReview{color:#275886;background:#d9eafe}
.prismScopeRowUnsaved{outline:2px dashed #d99d42;outline-offset:0}
.prismAbstractPickRow .btn:disabled{cursor:default}
.prismAbstractPickRow .btn.prismScopeSavedButton:disabled{opacity:1;border-color:#a5cebc;background:#e3f5e9;color:#185b41}
.prismAbstractPickRow .btn.prismScopeReviewButton:disabled{opacity:1;border-color:#a9c6dd;background:#e4effa;color:#275886}

.prismAbstractSupplierSchedule{padding:12px;border:1px solid #c9dfe9;border-radius:10px;margin:9px 0;background:#f7fbff}
.prismAbstractSupplierHeading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}
.prismAbstractSupplierSchedule ul{margin:8px 0 0 18px;font-size:13px;padding:0}
@media(max-width:780px){.prismSourceModalBody{padding:12px;max-height:calc(90dvh - 205px)}.prismSourceModalHead{padding:13px}.prismSourceModalHead h2{font-size:18px}.prismSourceModalActions{justify-content:stretch}.prismSourceModalActions .btn{flex:1}.prismAbstractPickRow{grid-template-columns:1fr}}

.prismAbstractSupplierHeading .btn{font-size:11px;padding:7px 11px}
#prismSourcePrintRoot{display:none}
@media print{
 body.prismSourcePrinting > :not(#prismSourcePrintRoot){display:none!important}
 body.prismSourcePrinting #prismSourcePrintRoot{display:block!important;position:static;background:white;color:black;padding:20px;font:12px Arial,sans-serif}
 body.prismSourcePrinting #prismSourcePrintRoot h1{font-size:19px}
 body.prismSourcePrinting #prismSourcePrintRoot table{width:100%;border-collapse:collapse}
 body.prismSourcePrinting #prismSourcePrintRoot th,body.prismSourcePrinting #prismSourcePrintRoot td{border:1px solid #444;padding:8px;text-align:left}
}

/* Phase 2AC — make the lowest recorded quotation visible without opening
   the proposed-supplier dropdown; star text is also in native option labels. */
.prismScopeLowest{display:inline-block;width:fit-content;max-width:100%;font-size:11px;font-weight:800;line-height:1.45;color:#12643f;background:#d8f5e4;border:1px solid #95d6b1;padding:4px 8px;border-radius:7px;overflow-wrap:anywhere}
.prismScopeLowestTie{color:#775006;background:#fff0bf;border-color:#e2c46b}

/* Phase 2AE: optional scoped rationale/review is collapsed below its own proposal row. */
.prismScopeExtra{grid-column:1/-1;border-top:1px solid #c5d8e5;margin-top:1px;padding:7px 0 1px;color:#163e58}
.prismScopeExtraSummary{cursor:pointer;font-size:12px;font-weight:750;color:#235980;line-height:1.5;max-width:max-content}
.prismScopeExtraSummary:hover{text-decoration:underline}
.prismScopeExtraBody{padding:10px 0 3px;display:grid;gap:8px}
.prismScopeExtraBody textarea{display:block;width:100%;min-height:62px;margin-top:6px;border:1px solid #b4d0dc;border-radius:8px;padding:10px;font:inherit;background:#fff;color:#17435a;resize:vertical}
.prismScopeExtraBody .sourceActions{justify-content:flex-start;margin:0}
.prismScopeExtraBody .sourceMini{margin:0}

/* Phase 2AF — single responsive Abstract workspace dialog, three views, no long page scroll. */
.prismAbstractHub{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;margin:18px 0}
.prismAbstractHubCard{border:1px solid #bad8e4;background:#fff;border-radius:12px;padding:16px;display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-direction:column}
.prismAbstractHubCard strong{display:block;font-size:16px;color:#134960;margin-bottom:7px}
.prismAbstractHubCard small{display:block;color:#496980;font-size:12px;line-height:1.55}
.prismAbstractHubCard button{margin-top:auto;font-size:13px}
.prismAbstractWorkspaceDialog{width:min(1500px,98vw);max-width:98vw;height:min(900px,95dvh);max-height:95dvh;border:1px solid #a5cad9;border-radius:18px;padding:0;background:#f5faff;color:#163c59;box-shadow:0 25px 100px rgba(0,35,52,.52);overflow:hidden}
.prismAbstractWorkspaceDialog::backdrop{background:rgba(1,24,39,.70);backdrop-filter:blur(5px)}
.prismAbstractWorkspaceDialog[open]{display:flex;flex-direction:column}
.prismAbstractWorkspaceDialog .prismAbstractDialogHeader{flex:none}
.prismAbstractDialogTabs{display:flex;gap:8px;flex:none;flex-wrap:wrap;padding:10px 20px;border-bottom:1px solid #c3dae4;background:#ebf5fa}
.prismAbstractDialogTabs button{border:1px solid #a9cbde;border-radius:8px;padding:10px 14px;background:white;color:#15516b;cursor:pointer;font-weight:800;font-size:13px}
.prismAbstractDialogTabs button.active{background:#087db2;color:white;border-color:#087db2}
.prismAbstractDialogBody{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:18px 22px}
.prismAbstractDialogBody > section{min-height:50px}
.prismAbstractDialogBody .prismAbstractScroll{max-height:65dvh;overflow:auto}
.prismAbstractDialogBody .prismAbstractTable thead th{top:0}
.prismAbstractDialogBody .prismAbstractAllocations,.prismAbstractDialogBody .prismAbstractSchedules{margin:0;padding:12px}
.prismAbstractDialogFooter{flex:none;position:relative;justify-content:space-between}
.prismAbstractDialogFooter .sourceMini{max-width:75%;line-height:1.4}
.prismAbstractDialogTabs button:focus-visible,.prismAbstractHubCard button:focus-visible{outline:3px solid #0b88c7;outline-offset:2px}
@media(max-width:920px){.prismAbstractHub{grid-template-columns:1fr}.prismAbstractHubCard{flex-direction:row;align-items:center}.prismAbstractWorkspaceDialog{width:98vw;height:94dvh}.prismAbstractDialogBody{padding:10px}.prismAbstractDialogTabs{padding:8px}.prismAbstractDialogTabs button{font-size:11px;padding:8px}.prismAbstractPickRow{grid-template-columns:1fr}}
@media(max-width:600px){.prismAbstractHubCard{flex-direction:column;align-items:stretch}.prismAbstractDialogHeader h2{font-size:17px}.prismAbstractDialogFooter .sourceMini{display:none}.prismAbstractWorkspaceDialog{max-width:99vw}}
