/* Project PRISM Phase 2AR.3 — Unified iridescent Glass UI + accessible chat.
   FRONTEND ONLY, Glass theme only. Procurement approvals, role enforcement,
   checklist-state colors, raw record fields, and API behavior remain unchanged.
   Loaded last to fix the layered inheritance of the previous Glass themes. */

/* Tokens are presentation hints only; do not alter official semantic colors. */
html.prismThemeGlass{
 --prism-ink-bright:#f4f9ff;--prism-ink-soft:#dcecff;
 --prism-ink-on-light:#15364f;--prism-glass-rim:97 206 255;
}
/* The Glass sidebar previously replaced the institution/long-form name via
   ::after; fix that generated text as well as Classic's literal HTML text. */
html.prismThemeGlass #app .side .brand::after{content:none!important}
html.prismThemeGlass #app .side .brandSub{
 display:flex!important;align-items:center!important;gap:10px!important;
 min-height:74px!important;height:auto!important;overflow:visible!important;
 padding:9px 5px 12px!important;margin-bottom:9px!important;
}
html.prismThemeGlass #app .side .brandSub::after{
 content:"SDO Lanao del Norte\A Procurement Records, Information,\A and Status Management"!important;
 display:block!important;flex:1 1 auto!important;min-width:0!important;
 white-space:pre-line!important;overflow-wrap:anywhere!important;
 font:750 11.3px/1.4 Inter,'Segoe UI',sans-serif!important;
 letter-spacing:0!important;color:#f4faff!important;
 text-shadow:0 1px 4px #000c,0 0 7px #7ac1ff83!important;
}
/* A brighter outer frame on the existing dark dashboard-style major cards.
   Keep the dark glass from Phase 2AR.2, and use each page's accent. */
html.prismThemeGlass #app :is(#appPage,#minePage,#draftPage,#inboxPage,#sourcingPage,#documentsPage)>.card,
html.prismThemeGlass #app #opsCaseCard{
 position:relative;
 border:2px solid transparent!important;
 background:
  linear-gradient(170deg,#ffffff32,transparent 18%) padding-box,
  radial-gradient(ellipse at 1% 0%,rgb(var(--prism-pane-glow,97 206 255)/.24),transparent 55%) padding-box,
  linear-gradient(145deg,#304563f4,#172944fa 48%,#201f41f8) padding-box,
  linear-gradient(120deg,#f8ffff 0%,rgb(var(--prism-pane-glow,97 206 255)/.97) 24%,#abb4ff 56%,#f5baff 80%,#eaffff) border-box!important;
 box-shadow:inset 0 2px 2px #ffffffa9,inset 0 -5px 9px #03071a99,
  0 17px 37px #020923b8,0 0 23px rgb(var(--prism-pane-glow,97 206 255)/.35)!important;
}
html.prismThemeGlass #app #appPage>.card{--prism-pane-glow:41 230 176}
html.prismThemeGlass #app #minePage>.card{--prism-pane-glow:92 180 255}
html.prismThemeGlass #app #draftPage>.card{--prism-pane-glow:255 188 93}
html.prismThemeGlass #app #inboxPage>.card{--prism-pane-glow:185 134 255}
html.prismThemeGlass #app #sourcingPage>.card{--prism-pane-glow:253 112 184}
html.prismThemeGlass #app #documentsPage>.card{--prism-pane-glow:73 226 221}

/* Nested working sections: optical rims and luminous reflections, but mostly
   opaque light inset so dense text, monetary amounts and forms stay legible. */
html.prismThemeGlass #app :is(.prismOpsBlock,.phase2LineEntry,.prismIntakeSection,.appBudgetPanel,
 .sourceSection,.sourceCard,.sourceBulkAssist,.prismSourceWorkflowGuide,.prismAbstractHubCard,
 .prismUnifiedExplanation,.prismAbstractAllocations,.prismAbstractSchedules){
 --prism-rim:81 178 246;
 color:#173950!important;
 border:2px solid transparent!important;border-radius:19px!important;
 background:
  linear-gradient(178deg,#ffffffde,transparent 14%) padding-box,
  radial-gradient(ellipse at 0% 0%,rgb(var(--prism-rim)/.16),transparent 62%) padding-box,
  linear-gradient(148deg,#f7fbfffa,#e7f3fff2 61%,#f8f0fffa) padding-box,
  linear-gradient(126deg,#ffffff,rgb(var(--prism-rim)/.95) 20%,#abb5f9 57%,rgb(var(--prism-rim)/.80) 83%,#fff) border-box!important;
 box-shadow:inset 0 2px 2px #ffffffed,inset 0 -3px 8px #8cadd045,
  0 9px 23px #020c2988,0 0 14px rgb(var(--prism-rim)/.26)!important;
 backdrop-filter:blur(14px) saturate(135%);-webkit-backdrop-filter:blur(14px) saturate(135%);
}
html.prismThemeGlass #app .sourceSection:nth-of-type(4n+1),
html.prismThemeGlass #app .prismAbstractHubCard:nth-child(3n+1){--prism-rim:69 221 192}
html.prismThemeGlass #app .sourceSection:nth-of-type(4n+2),
html.prismThemeGlass #app .prismAbstractHubCard:nth-child(3n+2){--prism-rim:170 118 249}
html.prismThemeGlass #app .sourceSection:nth-of-type(4n+3),
html.prismThemeGlass #app .prismAbstractHubCard:nth-child(3n+3){--prism-rim:255 153 201}
html.prismThemeGlass #app .sourceSection:nth-of-type(4n),
html.prismThemeGlass #app .appBudgetPanel{--prism-rim:255 194 97}
html.prismThemeGlass #app .prismOpsBlock:nth-of-type(4n+1){--prism-rim:128 145 255}
html.prismThemeGlass #app .prismOpsBlock:nth-of-type(4n+2){--prism-rim:65 225 204}
html.prismThemeGlass #app .prismOpsBlock:nth-of-type(4n+3){--prism-rim:254 168 116}
html.prismThemeGlass #app :is(.prismOpsBlock,.sourceSection,.sourceCard,.sourceBulkAssist,
 .prismAbstractHubCard,.appBudgetPanel) :is(h3,h4,strong,.sourceField,.phase2DraftField),
html.prismThemeGlass #app .prismAbstractHubCard :is(strong,small){color:#143b55!important}
html.prismThemeGlass #app :is(.sourceSection,.sourceCard,.prismOpsBlock,.prismAbstractHubCard)
 :is(.sourceMini,.sourceNotice,.sub,.phase2Muted){color:#365671!important}

/* Every editable field has dark typed text and an accessible placeholder;
   fix select/option colors separately for native OS dropdown lists. */
html.prismThemeGlass #app :is(#appPage,#minePage,#draftPage,#inboxPage,#sourcingPage,#documentsPage)
 :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea),
html.prismThemeGlass :is(.prismSourceQuoteDialog,.prismAbstractWorkspaceDialog,.prismSettingsDialog)
 :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
 color:#14334c!important;background:#f8fcff!important;
 border:1px solid #94bdd8!important;border-radius:11px!important;
 box-shadow:inset 0 2px 3px #8aaed820!important;
 color-scheme:light!important;
}
html.prismThemeGlass #app :is(#appPage,#minePage,#draftPage,#inboxPage,#sourcingPage,#documentsPage)
 :is(input,textarea)::placeholder{color:#536c84!important;opacity:1!important}
html.prismThemeGlass #app :is(#appPage,#minePage,#draftPage,#inboxPage,#sourcingPage,#documentsPage)
 :is(select option,select optgroup),
html.prismThemeGlass :is(.prismSourceQuoteDialog,.prismAbstractWorkspaceDialog,.prismSettingsDialog)
 :is(select option,select optgroup){background:#f8fcff!important;color:#12344e!important}
html.prismThemeGlass #app :is(#appPage,#minePage,#draftPage,#inboxPage,#sourcingPage,#documentsPage)
 :is(input,textarea,select):disabled{background:#e0eaf2!important;color:#435b71!important;opacity:1!important}

/* Glossy buttons, including controls inside nested panels.
   No override of checklist status, allocation colors, or input checkmarks. */
html.prismThemeGlass #app :is(#appPage,#minePage,#draftPage,#inboxPage,#sourcingPage,#documentsPage)
 :is(button.btn,.sourceTabBar button,.prismUnifiedTabs button,.prismAbstractDialogTabs button,
 .prismAbstractHubCard button,.phase2ButtonBar button){
 border:1px solid #d0efffba!important;border-radius:13px!important;
 background:
  linear-gradient(178deg,#ffffff82,transparent 34%),
  linear-gradient(126deg,#146f9c,#1b477e 55%,#653f91)!important;
 color:#fff!important;text-shadow:0 1px 2px #09152a!important;
 box-shadow:inset 0 2px 2px #ffffffa5,inset 0 -3px 5px #07152a99,
  0 5px 12px #061a4180,0 0 7px #6aa6ed44!important;
}
html.prismThemeGlass #app :is(#appPage,#minePage,#draftPage,#inboxPage,#sourcingPage,#documentsPage)
 :is(button.btn, .sourceTabBar button,.prismUnifiedTabs button):disabled{
 color:#41556b!important;background:#d8e5f0!important;border-color:#bacddd!important;
 text-shadow:none!important;box-shadow:inset 0 1px 2px #fff8!important;opacity:1!important;
}
/* Keep active tabs visually distinct from available, but inactive, tabs. */
html.prismThemeGlass #app :is(.sourceTabBar,.prismUnifiedTabs) button:is(.active,.isActive){
 background:linear-gradient(165deg,#ffffff75,transparent 35%),linear-gradient(125deg,#0ba5c5,#3967bb,#9255d4)!important;
 box-shadow:inset 0 2px 2px #fffb,0 4px 14px #4a9dedaa,0 0 11px #9d81ef99!important;
}
html.prismThemeGlass #app :is(.tableArea,.sourceTableWrap,.prismAbstractScroll){
 color:#173751!important;background:#f6faff!important;border:1px solid #aed8f1!important;
 border-radius:15px!important;box-shadow:inset 0 2px 2px white,0 8px 20px #030d2580!important;
}
html.prismThemeGlass #app :is(.tableArea,.sourceTableWrap,.prismAbstractScroll)
 :is(td,th){color:#173950}
/* Do not recolor semantic condition chips, award-allocation or checklist cells. */

/* Large sourcing popups: polished outer frame, light content for data review,
   dark metallic headers only where their foreground is explicitly corrected. */
html.prismThemeGlass :is(.prismSourceQuoteDialog,.prismAbstractWorkspaceDialog,.prismSettingsDialog){
 border:2px solid #b7e7ff!important;
 border-radius:25px!important;
 background:linear-gradient(152deg,#fafdfff9,#e9f4fffb 58%,#f9f2fffb)!important;
 color:#19394e!important;
 box-shadow:inset 0 2px 2px #fff,0 27px 83px #02081dc9,0 0 32px #9cc3ff8f!important;
}
html.prismThemeGlass :is(.prismSourceQuoteDialog,.prismAbstractWorkspaceDialog) .prismSourceModalHead{
 border-bottom:2px solid #bfd9fba6!important;
 background:linear-gradient(178deg,#ffffff80,transparent 24%),
 linear-gradient(115deg,#224d75,#23436c 54%,#60477e)!important;
 box-shadow:inset 0 2px 2px #fff8,0 4px 12px #0a234469!important;
}
html.prismThemeGlass :is(.prismSourceQuoteDialog,.prismAbstractWorkspaceDialog)
 .prismSourceModalHead :is(h2,p,.prismSourceModalRfq){color:#f0f8ff!important;text-shadow:0 1px 2px #00162cc9!important}
html.prismThemeGlass :is(.prismSourceQuoteDialog,.prismAbstractWorkspaceDialog)
 .prismSourceModalX{background:#eaf6ff!important;color:#153754!important;border-color:#c1deff!important}
html.prismThemeGlass .prismAbstractDialogTabs{
 background:linear-gradient(100deg,#dcecff,#edf4ff)!important;border-bottom-color:#b7d4ed!important;
}
html.prismThemeGlass .prismAbstractDialogTabs button:not(.active){color:#16435e!important;background:#f9fdff!important;border-color:#b5c9e6!important}
html.prismThemeGlass .prismAbstractDialogTabs button.active{color:white!important;background:linear-gradient(110deg,#177da5,#6d4ec8)!important}
html.prismThemeGlass .prismSourceModalActions{
 background:linear-gradient(125deg,#e6f3ff,#f4eaff)!important;border-top-color:#c1d6f0!important;
}
html.prismThemeGlass .prismSourceModalActions .btn{
 color:#fff!important;border-color:#c4e8ff!important;
 background:linear-gradient(145deg,#ffffff5a,transparent 35%),linear-gradient(110deg,#197b9b,#5a4caf)!important;
 box-shadow:inset 0 2px 2px #fff9,0 6px 12px #35599855!important;
}
html.prismThemeGlass .prismAccountPanel{
 border:1px solid #b9d4ee!important;border-radius:18px;
 background:linear-gradient(145deg,#f8fcff,#e9f2ff)!important;
 box-shadow:inset 0 2px 2px #fff,0 7px 19px #0c2d4b25;
}

/* PRISM Messages: intentionally LIGHT high-contrast inputs inside dark glass.
   The earlier Phase 2AR.2 select's dark background caused unreadable OS options. */
html.prismThemeGlass .prismChatPanel{
 border:2px solid transparent!important;
 background:
  linear-gradient(178deg,#ffffff46,transparent 18%) padding-box,
  linear-gradient(149deg,#375e82f8,#182d51fc 31%,#1b2449fb 75%,#513b6bf7) padding-box,
  linear-gradient(127deg,#eaffff,#7ce0fb 26%,#ad97f8 55%,#e7a8ff 82%,#f8ffff) border-box!important;
 box-shadow:inset 0 2px 3px #fff9,inset 0 -4px 8px #080c32a8,
  0 16px 46px #010b26d4,0 0 19px #5bbdff8f!important;
}
html.prismThemeGlass .prismChatHeader{
 background:linear-gradient(177deg,#ffffff4b,transparent 25%),
  linear-gradient(116deg,#0b7895,#1a6da4 55%,#7853ae)!important;
 color:#fff!important;
}
html.prismThemeGlass .prismChatHeader :is(strong,small){color:#fff!important;text-shadow:0 1px 2px #091d46!important}
html.prismThemeGlass .prismChatControls button{
 color:#f8fdff!important;background:#ffffff25!important;border:1px solid #ddf1ff9f!important;
 box-shadow:inset 0 1px 2px #fff7!important;
}
html.prismThemeGlass .prismChatPick{
 background:linear-gradient(120deg,#243958,#222c54)!important;
 border-color:#a5d9ff64!important;
}
html.prismThemeGlass .prismChatPick label{color:#d6f8ff!important;font-size:12px!important}
html.prismThemeGlass .prismChatPick select,
html.prismThemeGlass #prismChatThread{
 color:#123951!important;-webkit-text-fill-color:#123951!important;
 background:#f3faff!important;border:1px solid #b8e3f5!important;
 box-shadow:inset 0 2px 3px #a9cfdf4b,0 1px 4px #111b3580!important;
 color-scheme:light!important;opacity:1!important;
 font-weight:700!important;
}
html.prismThemeGlass #prismChatThread :is(option,optgroup){
 background:#f4fbff!important;color:#12344e!important;-webkit-text-fill-color:#12344e!important;
 font-weight:650!important;
}
html.prismThemeGlass #prismChatThread option:checked{
 background:#b7ddff!important;color:#0b2b4f!important;-webkit-text-fill-color:#0b2b4f!important;
}
html.prismThemeGlass #prismChatThread:disabled{opacity:.82!important;background:#dbe9f2!important;color:#334d67!important}
html.prismThemeGlass #prismChatRefresh{
 color:#f4faff!important;background:#375d81!important;border:1px solid #b1ddff!important;
}
html.prismThemeGlass .prismChatMessages{
 background:linear-gradient(174deg,#263e59,#1a2c4c 58%,#22264b)!important;
 scrollbar-color:#9fbad4 #21324b;
}
html.prismThemeGlass .prismChatPlaceholder{
 color:#e0eaff!important;font-weight:550!important;font-size:13px!important;
 text-shadow:0 1px 1px #04132d!important;
}
html.prismThemeGlass .prismChatMsg{color:#effaff!important;border-color:#8caecd9e!important}
html.prismThemeGlass .prismChatMsg.own{background:#1a5a69f5!important;border-color:#8debe4c2!important}
html.prismThemeGlass .prismChatMsg :is(.body,.meta){color:#edf8ff!important}
html.prismThemeGlass .prismChatMsg .who{color:#a9ffff!important}
html.prismThemeGlass .prismChatMsg .meta{color:#d9eafd!important}
html.prismThemeGlass .prismChatMsg .retry{color:#ffd6dd!important}
html.prismThemeGlass .prismChatMsg.error{background:#583148f7!important;border-color:#ffafb9!important}
html.prismThemeGlass .prismChatMsg .unsend{color:#ffd8e6!important}
html.prismThemeGlass .prismChatMsg .discard{color:#c6eeff!important}
html.prismThemeGlass .prismChatAttachment{
 color:#14354d!important;background:#eefbff!important;border-color:#a8e8f6!important;
}
html.prismThemeGlass .prismChatAttachment :is(.name,.attachmentSize){color:#17415a!important}
html.prismThemeGlass .prismChatAttachment button{
 color:#04577a!important;background:#d8f5fd!important;border-color:#94dce9!important;
}
html.prismThemeGlass .prismChatStatus{
 color:#e1f4ff!important;background:#182c4a!important;border-top:1px solid #8cb8e255!important;
}
html.prismThemeGlass .prismChatStatus.error{color:#ffbbc7!important}
html.prismThemeGlass .prismChatComposer{
 background:linear-gradient(120deg,#1c3353,#1d2a49)!important;border-top-color:#a7cffa72!important;
}
html.prismThemeGlass .prismChatComposer textarea,
html.prismThemeGlass #prismChatInput{
 color:#173b55!important;-webkit-text-fill-color:#173b55!important;
 background:#f3fbff!important;border:1px solid #a8d9ea!important;
 box-shadow:inset 0 2px 3px #a9c5d348!important;
 opacity:1!important;
}
html.prismThemeGlass #prismChatInput::placeholder{color:#4e667c!important;opacity:1!important}
html.prismThemeGlass #prismChatInput:disabled{background:#e5f1f8!important;color:#35566b!important;-webkit-text-fill-color:#35566b!important}
html.prismThemeGlass .prismChatComposer #prismChatAttach{
 color:#f8ffff!important;background:linear-gradient(165deg,#65b2c9,#166c88 65%,#475bac)!important;
 border-color:#bfe7ff!important;box-shadow:inset 0 2px 2px #fffa,0 4px 10px #020e238c!important;
}
html.prismThemeGlass .prismChatComposer #prismChatSend{
 color:#fff!important;background:linear-gradient(125deg,#098ca9,#2873bc,#634eb8)!important;
 border:1px solid #b9e4ff!important;box-shadow:inset 0 2px 2px #fffa,0 5px 13px #091a3594!important;
}
html.prismThemeGlass .prismChatComposer #prismChatSend:disabled{
 color:#43566d!important;background:#d4e1ef!important;border-color:#b6cbdc!important;
 text-shadow:none!important;box-shadow:inset 0 1px 3px #fff!important;opacity:1!important;
}
/* The unsend popup is already custom and centered, keep it above chat's z-index. */
html.prismThemeGlass .prismDlgBackdrop{z-index:2147483000!important}
html.prismThemeGlass .prismDlg .prismDlgButton{font-weight:820!important}
html.prismThemeGlass .prismDlg .prismDlgDescription{color:#e7f3ff!important}
html.prismThemeGlass .prismDlg .prismDlgHelp{color:#e0edff!important}

@media(max-width:720px){
 html.prismThemeGlass #app .side .brandSub{min-height:65px!important}
 html.prismThemeGlass #app .side .brandSub::after{font-size:10.6px!important}
 html.prismThemeGlass #app :is(.prismOpsBlock,.sourceSection,.sourceCard,.appBudgetPanel,
  .prismAbstractHubCard){border-radius:15px!important}
 html.prismThemeGlass .prismChatPanel{width:min(400px,calc(100vw - 18px))}
}
@media(prefers-reduced-motion:reduce){
 html.prismThemeGlass :is(.prismChatPanel,.prismDlg,.sourceSection,.prismOpsBlock){animation:none!important;transition:none!important}
}

/* Phase 2AR.3a — PRISM secure-action popup header contrast fix.
   Light silver glass header must use dark text in Glass mode.
   Scoped ONLY to the dialog heading; no dashboard or other theme changes. */
html.prismThemeGlass .prismDlg .prismDlgHead .prismDlgTitle {
  color: #17304d !important;
  text-shadow: none !important;
}
html.prismThemeGlass .prismDlg .prismDlgHead .prismDlgEyebrow {
  color: #245a7b !important;
  text-shadow: none !important;
}
