/* R126 V2 Theme Consistency Sweep — opacity-restored visual-only release candidate.
   Approved scope: unify buttons, highlights, status/detail accents, language states,
   reports visuals and Create controls to the current Lilac Prism identity.
   No business logic, database, Worker, PDF/share, numbering or security behavior changed. */
:root{
  --prism-cyan:#34bfd9;
  --prism-blue:#4f75de;
  --prism-violet:#7f6cff;
  --prism-lilac:#a56fff;
  --prism-pink:#e384c2;
  --prism-peach:#f2a16b;
  --prism-partial:#90a7eb;
  --prism-unpaid:#efc084;
  --prism-overdue:#de8897;
  --prism-grad:linear-gradient(95deg,#34bfd9 0%,#4f75de 28%,#7f6cff 52%,#e384c2 78%,#f2a16b 100%);
  /* Locked R118/R120 primary-button treatment: preserve the approved 50% Prism opacity. */
  --prism-primary-50:linear-gradient(95deg,rgba(52,191,217,.50) 0%,rgba(79,117,222,.50) 34%,rgba(117,73,216,.50) 61%,rgba(198,79,140,.50) 82%,rgba(239,174,103,.50) 100%);
  --prism-paid-soft:linear-gradient(95deg,rgba(127,108,255,.18) 0%,rgba(165,111,255,.18) 35%,rgba(227,132,194,.17) 72%,rgba(242,161,107,.17) 100%);
  --prism-soft:linear-gradient(95deg,rgba(52,191,217,.10) 0%,rgba(79,117,222,.09) 28%,rgba(127,108,255,.10) 52%,rgba(227,132,194,.09) 78%,rgba(242,161,107,.09) 100%);
  --prism-soft-strong:linear-gradient(95deg,rgba(52,191,217,.15) 0%,rgba(79,117,222,.14) 28%,rgba(127,108,255,.15) 52%,rgba(227,132,194,.14) 78%,rgba(242,161,107,.13) 100%);
  --prism-violet-ink:#6655d3;
}

/* 1. PRIMARY ACTIONS — preserve the previously approved R118/R120 Prism opacity/emphasis everywhere.
   Do not convert these buttons to a fully opaque gradient. */
.btn.primary,#loginBtn,
#saveSettingsBtn,#settingsSaveBtn,#saveBtn,#saleSaveBtn,#expenseSaveBtn,
#savePaymentBtn,#collectionReminderSave,#nativeShareBtn,#r111DialogConfirm,#draftGuardKeepBtn{
  color:#fff!important;
  background:var(--prism-primary-50)!important;
  border:2px solid rgba(84,76,190,.46)!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.34),0 7px 18px rgba(108,103,226,.13)!important;
}
.btn.primary:hover,#loginBtn:hover,
#saveSettingsBtn:hover,#settingsSaveBtn:hover,#saveBtn:hover,#saleSaveBtn:hover,#expenseSaveBtn:hover,
#savePaymentBtn:hover,#collectionReminderSave:hover,#nativeShareBtn:hover,#r111DialogConfirm:hover,#draftGuardKeepBtn:hover{
  border-color:rgba(84,76,190,.60)!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.38),0 9px 22px rgba(108,103,226,.17)!important;
}

/* 2. SECONDARY ACTIONS — stay light/simple, but no longer visually disconnected from theme. */
.btn:not(.primary):not(.danger),.icon-btn,
.r125-doc-share,.invoice-actions-trigger,.single-logo-upload-btn,
.logo-file-button,.r111-file-button,.single-add,.r111-trans-action button{
  color:#5361c9!important;
  border:1px solid transparent!important;
  background:linear-gradient(#fff,#fff) padding-box,
             linear-gradient(95deg,rgba(52,191,217,.50),rgba(127,108,255,.48),rgba(227,132,194,.42),rgba(242,161,107,.42)) border-box!important;
  box-shadow:0 3px 10px rgba(100,91,201,.045)!important;
}
.btn:not(.primary):not(.danger):hover,.icon-btn:hover,
.r125-doc-share:hover,.invoice-actions-trigger:hover,.single-logo-upload-btn:hover,
.logo-file-button:hover,.r111-file-button:hover,.single-add:hover,.r111-trans-action button:hover{
  background:var(--prism-soft),#fff!important;
  color:#5d4dcc!important;
}
.btn.danger,.invoice-action-item.danger,#itemsWrap .remove-item,.r111-remove-item{
  color:#b95878!important;
  border-color:rgba(222,136,151,.42)!important;
  background:#fff8fa!important;
}

/* 3. ACTIVE NAV / TABS / SEGMENTS / FILTER PILLS — same Prism language. */
.nav button.active,
.document-tab.active,.r111-type-pill.active,.r111-create-type.active,
.segmented button.active{
  background:var(--prism-soft-strong)!important;
  color:#25345d!important;
  box-shadow:inset 0 0 0 1px rgba(127,108,255,.09)!important;
}
.nav button.active:before{background:linear-gradient(180deg,var(--prism-cyan),var(--prism-violet),var(--prism-pink),var(--prism-peach))!important}
.document-tab.active,.r111-type-pill.active,.r111-create-type.active,.segmented button.active{
  border-color:rgba(127,108,255,.18)!important;
}

/* 4. MOBILE NAV — same active identity as desktop. */
.mobile-nav button.active{color:var(--prism-violet)!important;position:relative}
.mobile-nav button.active span{color:var(--prism-violet)!important}
.mobile-nav button.active:before{content:"";position:absolute;left:24%;right:24%;top:-7px;height:2px;border-radius:99px;background:var(--prism-grad)}

/* 5. LANGUAGE — EN/BM selected state uses Prism, desktop + mobile sheet. */
.side-foot .r123-language-code-btn{
  border:1px solid transparent!important;
  background:linear-gradient(#fff,#fff) padding-box,var(--prism-grad) border-box!important;
}
#r123LangCode,.r123-mobile-language-value{
  color:transparent!important;
  background-image:var(--prism-grad)!important;
  -webkit-background-clip:text!important;background-clip:text!important;
}
.r123-language-menu button.active,.r123-language-menu button:hover,
.r123-language-sheet-card button.active{
  background:var(--prism-soft)!important;
  color:#6451c9!important;
}
.r123-language-menu button.active .r126-lang-label,
.r123-language-menu button:hover .r126-lang-label,
.r123-language-sheet-card button.active>span:first-child{
  color:transparent!important;
  background-image:var(--prism-grad)!important;
  -webkit-background-clip:text!important;background-clip:text!important;
}
.r123-language-check{color:#7f6cff!important}

/* 6. SYSTEM / CLOUD STATUS — use Prism cyan instead of unrelated green. */
.cloud,.cloud-note{
  background:linear-gradient(135deg,rgba(52,191,217,.10),rgba(79,117,222,.06))!important;
  color:#247f9a!important;border-color:rgba(52,191,217,.20)!important;
}
.cloud .dot,.dot{background:linear-gradient(180deg,var(--prism-cyan),var(--prism-blue))!important;box-shadow:0 0 0 3px rgba(52,191,217,.08)}

/* 7. INVOICE / DOCUMENT STATUS — semantic meaning preserved, colours taken from current Dashboard palette. */
.status,.badge,.quotation-status,.r111-trans-status{border:1px solid transparent!important}
.status.paid,.badge.paid,.badge.accepted,.badge.converted,.r111-trans-status.completed,.r111-trans-status.paid{
  color:#6654cf!important;background:var(--prism-paid-soft)!important;border-color:rgba(127,108,255,.22)!important;
}
.status.partially_paid,.badge.partial,.badge.partially_paid{
  background:rgba(144,167,235,.18)!important;color:#526ebd!important;border-color:rgba(144,167,235,.30)!important;
}
.status.unpaid,.badge.unpaid{
  background:rgba(239,192,132,.22)!important;color:#9b6a2d!important;border-color:rgba(239,192,132,.34)!important;
}
.status.overdue,.status.cancelled,.badge.overdue,.badge.rejected,.badge.cancelled,
.quotation-status.expired,.quotation-status.rejected{
  background:rgba(222,136,151,.18)!important;color:#a95168!important;border-color:rgba(222,136,151,.30)!important;
}
.status.draft,.badge.draft,.quotation-status.draft{
  background:rgba(165,111,255,.10)!important;color:#7654b4!important;border-color:rgba(165,111,255,.18)!important;
}
.badge.sent,.quotation-status.sent{background:rgba(79,117,222,.11)!important;color:#5268bd!important;border-color:rgba(79,117,222,.18)!important}
.quotation-status.accepted,.quotation-status.converted{color:#6654cf!important;background:var(--prism-paid-soft)!important;border-color:rgba(127,108,255,.22)!important}

/* 8. PAYMENT COLLECTION / reminder states — all remain semantic but within Prism family. */
.r123-collection-tag{background:rgba(127,108,255,.08)!important;color:#6759b6!important;border-color:rgba(127,108,255,.18)!important}
.r123-collection-tag.no-date,.r123-collection-tag.due-soon,.due-tag{background:rgba(239,192,132,.18)!important;color:#986624!important;border-color:rgba(239,192,132,.30)!important}
.r123-collection-tag.overdue,.due-tag.over{background:rgba(222,136,151,.17)!important;color:#a54f65!important;border-color:rgba(222,136,151,.28)!important}
.r123-detected-head span{background:var(--prism-soft)!important;color:#6957c4!important}
.r123-date-human.valid{color:#526ebd!important}

/* 9. REPORTS — line chart + donut now share the same Prism identity as Dashboard. */
#reports .chart-shell .preview-chart-line{stroke:url(#reportPrismStroke)!important}
#reports .chart-shell .preview-chart-area{fill:url(#reportPrismArea)!important}
#reports .kpis .card:first-child,#dashboard .kpis .card:first-child,.r111-cash-kpi:first-child{
  background:linear-gradient(135deg,rgba(52,191,217,.06),rgba(127,108,255,.055) 48%,rgba(227,132,194,.035) 78%,#fff 100%)!important;
}

/* 10. CREATE — remove the plain-looking controls that BAE flagged. */
.r112-create-doc-actions .btn,
#previewCurrentBtn,#saveDraftBtn,#bottomPreviewBtn,#settingsPreviewBtn,
#loadItemBtn,#salePreviewBtn{
  color:#5361c9!important;
}
#saveDraftBtn{
  background:var(--prism-soft)!important;
  border-color:rgba(127,108,255,.18)!important;
  color:#6654cf!important;
}
.segmented{border-color:rgba(127,108,255,.15)!important;background:#fff!important}
.single-chip,.r111-chip{
  background:var(--prism-soft)!important;color:#6654cf!important;border-color:rgba(127,108,255,.18)!important;
}
.single-total-row.grand,.r111-summary-row.total{
  background:linear-gradient(90deg,transparent 0%,rgba(52,191,217,.08) 10%,rgba(127,108,255,.11) 44%,rgba(227,132,194,.08) 73%,rgba(242,161,107,.08) 90%,transparent 100%)!important;
}
.single-total-row.balance{color:#6654cf!important}
.r111-paid-note{background:var(--prism-soft)!important;color:#6654cf!important}

/* 11. Settings / file controls / switches. */
.simple-switch input:checked+span{background:var(--prism-grad)!important}
.share-option-note,.item-library-price,.r111-more summary{color:#6654cf!important}

/* 12. Focus/selection consistency. */
input:focus,select:focus,textarea:focus{
  border-color:#8878ef!important;
  box-shadow:0 0 0 3px rgba(127,108,255,.09)!important;
}
::selection{background:rgba(127,108,255,.18)}

/* 13. Invoice action menu icon accents. */
.invoice-action-symbol{
  color:var(--prism-violet)!important;
  border-color:rgba(127,108,255,.18)!important;
  background:var(--prism-soft)!important;
}
.invoice-action-item:hover,.invoice-action-item:focus-visible{background:var(--prism-soft)!important}

/* Desktop/tablet language popover: clear the entire account utility stack, not only the email line. */
@media (min-width:801px){
  #r123DesktopLanguage .r123-language-menu{left:calc(100% + 100px)!important}
}

/* Audit correction: interactive library choice keeps neutral base but Prism hover/focus accent. */
.item-library-choice:hover,.item-library-choice:focus-visible{
  background:var(--prism-soft)!important;
  border-color:rgba(127,108,255,.24)!important;
}
