/*
 * Brownfly IMS — company theme readability and icon contrast patch
 * Applies only to signed-in application screens. Exact company swatches remain
 * unchanged; ink, secondary text, neutral controls, and notification icons are
 * forced to accessible dark colors on pastel/yellow theme surfaces.
 */
@media screen {
  body.brownfly:not(.login-page),
  body.akinito:not(.login-page),
  body.single:not(.login-page) {
    --ui-ink: #111827;
    --ui-body-ink: #1f2937;
    --ui-muted-ink: #374151;
    --ui-subtle-ink: #475569;
    --primary-contrast: #111827;
    --primary-contrast-rgb: 17, 24, 39;
    color: var(--ui-body-ink) !important;
  }

  /* General content text: headings, descriptions, labels and helper copy. */
  body.brownfly:not(.login-page) .content,
  body.akinito:not(.login-page) .content,
  body.single:not(.login-page) .content {
    color: var(--ui-body-ink) !important;
  }
  body.brownfly:not(.login-page) .content :is(h1,h2,h3,h4,h5,h6,p,label,legend,dt,dd,small,.form-label,.field-label,.form-hint,.form-text,.help-text,.field-help,.page-description,.section-description,.card-title,.dashboard-section-title,.table-header h3,.modal-header h3),
  body.akinito:not(.login-page) .content :is(h1,h2,h3,h4,h5,h6,p,label,legend,dt,dd,small,.form-label,.field-label,.form-hint,.form-text,.help-text,.field-help,.page-description,.section-description,.card-title,.dashboard-section-title,.table-header h3,.modal-header h3),
  body.single:not(.login-page) .content :is(h1,h2,h3,h4,h5,h6,p,label,legend,dt,dd,small,.form-label,.field-label,.form-hint,.form-text,.help-text,.field-help,.page-description,.section-description,.card-title,.dashboard-section-title,.table-header h3,.modal-header h3) {
    color: var(--ui-body-ink) !important;
    opacity: 1 !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) .content :is(.text-muted,.muted,.subtext,.secondary-text,.hint,.help,.description-muted),
  body.akinito:not(.login-page) .content :is(.text-muted,.muted,.subtext,.secondary-text,.hint,.help,.description-muted),
  body.single:not(.login-page) .content :is(.text-muted,.muted,.subtext,.secondary-text,.hint,.help,.description-muted) {
    color: var(--ui-muted-ink) !important;
    opacity: 1 !important;
  }

  /* Sidebar: keep the exact company background swatch, use dark readable ink. */
  body.brownfly:not(.login-page) .sidebar,
  body.akinito:not(.login-page) .sidebar,
  body.single:not(.login-page) .sidebar {
    color: var(--ui-ink) !important;
  }
  body.brownfly:not(.login-page) .sidebar :is(h1,h2,h3,h4,h5,h6,p,label,span,a,i,svg,strong,small),
  body.akinito:not(.login-page) .sidebar :is(h1,h2,h3,h4,h5,h6,p,label,span,a,i,svg,strong,small),
  body.single:not(.login-page) .sidebar :is(h1,h2,h3,h4,h5,h6,p,label,span,a,i,svg,strong,small) {
    color: var(--ui-ink) !important;
    opacity: 1 !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) .sidebar-menu a:is(:hover,.active),
  body.akinito:not(.login-page) .sidebar-menu a:is(:hover,.active),
  body.single:not(.login-page) .sidebar-menu a:is(:hover,.active),
  body.brownfly:not(.login-page) .bes-sidebar-submenu a:is(:hover,.active),
  body.akinito:not(.login-page) .bes-sidebar-submenu a:is(:hover,.active),
  body.single:not(.login-page) .bes-sidebar-submenu a:is(:hover,.active) {
    color: var(--ui-ink) !important;
    background: rgba(17,24,39,.10) !important;
  }
  body.brownfly:not(.login-page) .sidebar-menu a i,
  body.akinito:not(.login-page) .sidebar-menu a i,
  body.single:not(.login-page) .sidebar-menu a i,
  body.brownfly:not(.login-page) .bes-sidebar-submenu a i,
  body.akinito:not(.login-page) .bes-sidebar-submenu a i,
  body.single:not(.login-page) .bes-sidebar-submenu a i {
    color: var(--ui-ink) !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .company-switcher select,
  body.akinito:not(.login-page) .company-switcher select,
  body.single:not(.login-page) .company-switcher select {
    color: var(--ui-ink) !important;
    background: rgba(255,255,255,.92) !important;
    border: 1px solid rgba(17,24,39,.34) !important;
  }
  body.brownfly:not(.login-page) .company-switcher select option,
  body.akinito:not(.login-page) .company-switcher select option,
  body.single:not(.login-page) .company-switcher select option {
    color: #111827 !important;
    background: #fff !important;
  }

  /* Top bar and profile: includes notification bell, date/time and user icons. */
  body.brownfly:not(.login-page) .topbar,
  body.akinito:not(.login-page) .topbar,
  body.single:not(.login-page) .topbar {
    color: var(--ui-body-ink) !important;
  }
  body.brownfly:not(.login-page) .topbar :is(.datetime h4,.datetime p,.profile-info h4,.profile-info p,.approval-level-label),
  body.akinito:not(.login-page) .topbar :is(.datetime h4,.datetime p,.profile-info h4,.profile-info p,.approval-level-label),
  body.single:not(.login-page) .topbar :is(.datetime h4,.datetime p,.profile-info h4,.profile-info p,.approval-level-label) {
    color: var(--ui-body-ink) !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .topbar :is(.datetime i,.profile-info i,.profile-avatar i),
  body.akinito:not(.login-page) .topbar :is(.datetime i,.profile-info i,.profile-avatar i),
  body.single:not(.login-page) .topbar :is(.datetime i,.profile-info i,.profile-avatar i) {
    color: var(--ui-ink) !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .topbar .profile-avatar,
  body.akinito:not(.login-page) .topbar .profile-avatar,
  body.single:not(.login-page) .topbar .profile-avatar {
    color: var(--ui-ink) !important;
    background: rgba(255,255,255,.88) !important;
    border-color: rgba(17,24,39,.24) !important;
  }

  /* Notification bell button — the previous var(--primary) made the icon too pale. */
  body.brownfly:not(.login-page) .topbar-inbox-link,
  body.akinito:not(.login-page) .topbar-inbox-link,
  body.single:not(.login-page) .topbar-inbox-link {
    color: #111827 !important;
    background: #ffffff !important;
    border: 1px solid #9ca3af !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .topbar-inbox-link > i,
  body.akinito:not(.login-page) .topbar-inbox-link > i,
  body.single:not(.login-page) .topbar-inbox-link > i {
    color: #111827 !important;
    opacity: 1 !important;
    filter: none !important;
  }
  body.brownfly:not(.login-page) .topbar-inbox-link:hover,
  body.akinito:not(.login-page) .topbar-inbox-link:hover,
  body.single:not(.login-page) .topbar-inbox-link:hover {
    color: #111827 !important;
    background: #f3f4f6 !important;
    border-color: #4b5563 !important;
  }
  body.brownfly:not(.login-page) .topbar-inbox-count,
  body.akinito:not(.login-page) .topbar-inbox-count,
  body.single:not(.login-page) .topbar-inbox-count {
    color: #ffffff !important;
    background: #c11236 !important;
    border-color: #ffffff !important;
  }

  /* Notification preview popover and full inbox page. */
  body.brownfly:not(.login-page) .topbar-inbox-popover,
  body.akinito:not(.login-page) .topbar-inbox-popover,
  body.single:not(.login-page) .topbar-inbox-popover {
    color: #1f2937 !important;
    background: #ffffff !important;
  }
  body.brownfly:not(.login-page) .topbar-inbox-popover :is(h3,.topbar-inbox-preview-title,.topbar-inbox-preview-title-text),
  body.akinito:not(.login-page) .topbar-inbox-popover :is(h3,.topbar-inbox-preview-title,.topbar-inbox-preview-title-text),
  body.single:not(.login-page) .topbar-inbox-popover :is(h3,.topbar-inbox-preview-title,.topbar-inbox-preview-title-text) {
    color: #111827 !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .topbar-inbox-popover :is(p,.topbar-inbox-preview-message,.topbar-inbox-preview-meta,.topbar-inbox-preview-state),
  body.akinito:not(.login-page) .topbar-inbox-popover :is(p,.topbar-inbox-preview-message,.topbar-inbox-preview-meta,.topbar-inbox-preview-state),
  body.single:not(.login-page) .topbar-inbox-popover :is(p,.topbar-inbox-preview-message,.topbar-inbox-preview-meta,.topbar-inbox-preview-state) {
    color: #374151 !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .topbar-inbox-popover :is(i,.topbar-inbox-preview-icon),
  body.akinito:not(.login-page) .topbar-inbox-popover :is(i,.topbar-inbox-preview-icon),
  body.single:not(.login-page) .topbar-inbox-popover :is(i,.topbar-inbox-preview-icon) {
    color: #1f2937 !important;
  }
  body.brownfly:not(.login-page) .topbar-inbox-view-all,
  body.akinito:not(.login-page) .topbar-inbox-view-all,
  body.single:not(.login-page) .topbar-inbox-view-all,
  body.brownfly:not(.login-page) .topbar-inbox-popover-foot a,
  body.akinito:not(.login-page) .topbar-inbox-popover-foot a,
  body.single:not(.login-page) .topbar-inbox-popover-foot a {
    color: #1f2937 !important;
  }

  body.brownfly:not(.login-page) .inbox-page :is(.inbox-head h1,.inbox-shell-head h2,.inbox-copy h3,.inbox-stat strong,.inbox-empty h3),
  body.akinito:not(.login-page) .inbox-page :is(.inbox-head h1,.inbox-shell-head h2,.inbox-copy h3,.inbox-stat strong,.inbox-empty h3),
  body.single:not(.login-page) .inbox-page :is(.inbox-head h1,.inbox-shell-head h2,.inbox-copy h3,.inbox-stat strong,.inbox-empty h3) {
    color: #111827 !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .inbox-page :is(.inbox-head p,.inbox-stat span,.inbox-copy p,.inbox-meta,.inbox-context,.inbox-empty p,.inbox-pagination),
  body.akinito:not(.login-page) .inbox-page :is(.inbox-head p,.inbox-stat span,.inbox-copy p,.inbox-meta,.inbox-context,.inbox-empty p,.inbox-pagination),
  body.single:not(.login-page) .inbox-page :is(.inbox-head p,.inbox-stat span,.inbox-copy p,.inbox-meta,.inbox-context,.inbox-empty p,.inbox-pagination) {
    color: #374151 !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .inbox-page :is(.inbox-head h1 i,.inbox-item-icon i,.inbox-empty i,.inbox-meta i,.inbox-action i),
  body.akinito:not(.login-page) .inbox-page :is(.inbox-head h1 i,.inbox-item-icon i,.inbox-empty i,.inbox-meta i,.inbox-action i),
  body.single:not(.login-page) .inbox-page :is(.inbox-head h1 i,.inbox-item-icon i,.inbox-empty i,.inbox-meta i,.inbox-action i) {
    color: #1f2937 !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .inbox-page .inbox-action,
  body.akinito:not(.login-page) .inbox-page .inbox-action,
  body.single:not(.login-page) .inbox-page .inbox-action {
    color: #1f2937 !important;
  }
  body.brownfly:not(.login-page) .inbox-page .inbox-button.primary,
  body.akinito:not(.login-page) .inbox-page .inbox-button.primary,
  body.single:not(.login-page) .inbox-page .inbox-button.primary {
    color: #111827 !important;
    background: var(--primary) !important;
    border-color: rgba(17,24,39,.35) !important;
  }
  body.brownfly:not(.login-page) .inbox-page .inbox-button.primary *,
  body.akinito:not(.login-page) .inbox-page .inbox-button.primary *,
  body.single:not(.login-page) .inbox-page .inbox-button.primary * {
    color: inherit !important;
  }

  /* Table headers on the pastel/yellow brand surfaces must use dark ink. */
  body.brownfly:not(.login-page) .content :is(.table-card,.table-wrapper,.table-responsive,.log-table-wrap,.po-log-wrap,.inbox-shell) table thead th,
  body.akinito:not(.login-page) .content :is(.table-card,.table-wrapper,.table-responsive,.log-table-wrap,.po-log-wrap,.inbox-shell) table thead th,
  body.single:not(.login-page) .content :is(.table-card,.table-wrapper,.table-responsive,.log-table-wrap,.po-log-wrap,.inbox-shell) table thead th {
    color: #111827 !important;
    text-shadow: none !important;
  }

  /* Primary company-colored buttons must not retain white text/icons. */
  body.brownfly:not(.login-page) .content :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active),
  body.akinito:not(.login-page) .content :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active),
  body.single:not(.login-page) .content :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active) {
    color: #111827 !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) .content :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active) *,
  body.akinito:not(.login-page) .content :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active) *,
  body.single:not(.login-page) .content :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active) * {
    color: inherit !important;
    text-shadow: none !important;
  }

  /* Headings, labels, neutral icons, and links across form/card components. */
  body.brownfly:not(.login-page) .content :is(.page-header h1,.page-header h2,.table-header h3,.modal-header h3,.section-title,.card-header h3,.form-section-title),
  body.akinito:not(.login-page) .content :is(.page-header h1,.page-header h2,.table-header h3,.modal-header h3,.section-title,.card-header h3,.form-section-title),
  body.single:not(.login-page) .content :is(.page-header h1,.page-header h2,.table-header h3,.modal-header h3,.section-title,.card-header h3,.form-section-title) {
    color: #111827 !important;
  }
  body.brownfly:not(.login-page) .content :is(.page-header i,.table-header i,.dashboard-icon i,.card-icon i,.stat-icon i,.profile-avatar i),
  body.akinito:not(.login-page) .content :is(.page-header i,.table-header i,.dashboard-icon i,.card-icon i,.stat-icon i,.profile-avatar i),
  body.single:not(.login-page) .content :is(.page-header i,.table-header i,.dashboard-icon i,.card-icon i,.stat-icon i,.profile-avatar i) {
    color: #1f2937 !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .content a:not(.btn):not(.inbox-button):not(.inbox-item):not(.text-success):not(.text-danger),
  body.akinito:not(.login-page) .content a:not(.btn):not(.inbox-button):not(.inbox-item):not(.text-success):not(.text-danger),
  body.single:not(.login-page) .content a:not(.btn):not(.inbox-button):not(.inbox-item):not(.text-success):not(.text-danger) {
    color: #334155;
  }

  /* Form controls, placeholders, dropdowns and option lists. */
  body.brownfly:not(.login-page) .content :is(input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),select,textarea),
  body.akinito:not(.login-page) .content :is(input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),select,textarea),
  body.single:not(.login-page) .content :is(input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),select,textarea) {
    color: #111827 !important;
    background-color: #ffffff;
  }
  body.brownfly:not(.login-page) .content :is(input,textarea)::placeholder,
  body.akinito:not(.login-page) .content :is(input,textarea)::placeholder,
  body.single:not(.login-page) .content :is(input,textarea)::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .content select option,
  body.akinito:not(.login-page) .content select option,
  body.single:not(.login-page) .content select option {
    color: #111827 !important;
    background: #ffffff !important;
  }

  /* Preserve semantic state colors on badges/alerts and white text on dark buttons. */
  body.brownfly:not(.login-page) .content :is(.btn-danger,.btn-success,.btn-warning,.btn-info,.text-success,.text-danger,.text-warning,.text-info,.badge-success,.badge-danger,.badge-warning,.badge-info,.status-approved,.status-rejected,.status-pending),
  body.akinito:not(.login-page) .content :is(.btn-danger,.btn-success,.btn-warning,.btn-info,.text-success,.text-danger,.text-warning,.text-info,.badge-success,.badge-danger,.badge-warning,.badge-info,.status-approved,.status-rejected,.status-pending),
  body.single:not(.login-page) .content :is(.btn-danger,.btn-success,.btn-warning,.btn-info,.text-success,.text-danger,.text-warning,.text-info,.badge-success,.badge-danger,.badge-warning,.badge-info,.status-approved,.status-rejected,.status-pending) {
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) .swal2-popup,
  body.akinito:not(.login-page) .swal2-popup,
  body.single:not(.login-page) .swal2-popup {
    color: #1f2937 !important;
  }
  body.brownfly:not(.login-page) .swal2-title,
  body.akinito:not(.login-page) .swal2-title,
  body.single:not(.login-page) .swal2-title {
    color: #111827 !important;
  }
}

/* Additional legacy selectors discovered in the original dashboard and inventory styles. */
@media screen {
  body.brownfly:not(.login-page) :is(.dashboard-info h2,.chart-card h3,.activity-card h3,.activity-content h4,.stat-box h2,.price,.stock-number,.category-badge,.stock-quantity,.supplier-view-icon,.supplier-contact-icon,.supplier-table .email-link,.supplier-table .phone-link,.category-info h3,.product-view-category,.product-detail-price,.product-price,.product-detail-stock,.current-stock,.product-table .product-uom,.product-table .product-price,.product-card-icon,.product-info-icon,.stock-out-grid .stock-card-header > i,.stock-in-card .card-icon),
  body.akinito:not(.login-page) :is(.dashboard-info h2,.chart-card h3,.activity-card h3,.activity-content h4,.stat-box h2,.price,.stock-number,.category-badge,.stock-quantity,.supplier-view-icon,.supplier-contact-icon,.supplier-table .email-link,.supplier-table .phone-link,.category-info h3,.product-view-category,.product-detail-price,.product-price,.product-detail-stock,.current-stock,.product-table .product-uom,.product-table .product-price,.product-card-icon,.product-info-icon,.stock-out-grid .stock-card-header > i,.stock-in-card .card-icon),
  body.single:not(.login-page) :is(.dashboard-info h2,.chart-card h3,.activity-card h3,.activity-content h4,.stat-box h2,.price,.stock-number,.category-badge,.stock-quantity,.supplier-view-icon,.supplier-contact-icon,.supplier-table .email-link,.supplier-table .phone-link,.category-info h3,.product-view-category,.product-detail-price,.product-price,.product-detail-stock,.current-stock,.product-table .product-uom,.product-table .product-price,.product-card-icon,.product-info-icon,.stock-out-grid .stock-card-header > i,.stock-in-card .card-icon) {
    color: #1f2937 !important;
    opacity: 1 !important;
    text-shadow: none !important;
  }

  /* Legacy buttons and utility icons sit outside .content on some pages. */
  body.brownfly:not(.login-page) :is(.menu-toggle,.sidebar-mobile-toggle,.top-icon),
  body.akinito:not(.login-page) :is(.menu-toggle,.sidebar-mobile-toggle,.top-icon),
  body.single:not(.login-page) :is(.menu-toggle,.sidebar-mobile-toggle,.top-icon) {
    color: #111827 !important;
  }
  body.brownfly:not(.login-page) :is(.menu-toggle,.sidebar-mobile-toggle,.top-icon) i,
  body.akinito:not(.login-page) :is(.menu-toggle,.sidebar-mobile-toggle,.top-icon) i,
  body.single:not(.login-page) :is(.menu-toggle,.sidebar-mobile-toggle,.top-icon) i {
    color: #111827 !important;
  }

  /* Hovered dashboard action cards keep their text/icons dark on the light swatch. */
  body.brownfly:not(.login-page) .content .action-card:hover :is(h1,h2,h3,h4,h5,h6,p,span,strong,i),
  body.akinito:not(.login-page) .content .action-card:hover :is(h1,h2,h3,h4,h5,h6,p,span,strong,i),
  body.single:not(.login-page) .content .action-card:hover :is(h1,h2,h3,h4,h5,h6,p,span,strong,i) {
    color: #111827 !important;
    opacity: 1 !important;
  }

  /* Every operational table header gets strong ink on the selected swatch. */
  body.brownfly:not(.login-page) .content table:not(.bes-document-table):not(.quotation-document-table) thead th,
  body.akinito:not(.login-page) .content table:not(.bes-document-table):not(.quotation-document-table) thead th,
  body.single:not(.login-page) .content table:not(.bes-document-table):not(.quotation-document-table) thead th {
    color: #111827 !important;
    text-shadow: none !important;
  }

  /* Keep semantic states distinct, but do not use white on the yellow warning button. */
  body.brownfly:not(.login-page) .content .btn-warning,
  body.akinito:not(.login-page) .content .btn-warning,
  body.single:not(.login-page) .content .btn-warning {
    color: #111827 !important;
  }
  body.brownfly:not(.login-page) .content .btn-warning *,
  body.akinito:not(.login-page) .content .btn-warning *,
  body.single:not(.login-page) .content .btn-warning * {
    color: inherit !important;
  }

  /* BES format chooser is rendered outside .content, so give it its own
     high-contrast palette that is identical in every company workspace. */
  body.brownfly:not(.login-page) .pr-bes-modal-card,
  body.akinito:not(.login-page) .pr-bes-modal-card,
  body.single:not(.login-page) .pr-bes-modal-card {
    color: #1f2937 !important;
    background: #ffffff !important;
  }
  body.brownfly:not(.login-page) .pr-bes-modal-card :is(.pr-kicker,h2,h3,p,strong),
  body.akinito:not(.login-page) .pr-bes-modal-card :is(.pr-kicker,h2,h3,p,strong),
  body.single:not(.login-page) .pr-bes-modal-card :is(.pr-kicker,h2,h3,p,strong) {
    color: #1f2937 !important;
    opacity: 1 !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) .pr-bes-option,
  body.akinito:not(.login-page) .pr-bes-option,
  body.single:not(.login-page) .pr-bes-option {
    color: #1f2937 !important;
    background: #fbfcfa !important;
    border-color: #cbd5c7 !important;
  }
  body.brownfly:not(.login-page) .pr-bes-option strong,
  body.akinito:not(.login-page) .pr-bes-option strong,
  body.single:not(.login-page) .pr-bes-option strong {
    color: #1f2937 !important;
  }
  body.brownfly:not(.login-page) .pr-bes-option-icon,
  body.akinito:not(.login-page) .pr-bes-option-icon,
  body.single:not(.login-page) .pr-bes-option-icon {
    color: #244b2b !important;
    background: #eaf2e5 !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .pr-bes-option-icon i,
  body.akinito:not(.login-page) .pr-bes-option-icon i,
  body.single:not(.login-page) .pr-bes-option-icon i {
    color: #244b2b !important;
    opacity: 1 !important;
    filter: none !important;
  }
  body.brownfly:not(.login-page) .pr-bes-option:has(input:checked),
  body.akinito:not(.login-page) .pr-bes-option:has(input:checked),
  body.single:not(.login-page) .pr-bes-option:has(input:checked) {
    background: #f0f6ed !important;
    border-color: #52794a !important;
  }
  body.brownfly:not(.login-page) .pr-bes-option input,
  body.akinito:not(.login-page) .pr-bes-option input,
  body.single:not(.login-page) .pr-bes-option input {
    accent-color: #315c32 !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .pr-bes-modal-card .pr-btn-light,
  body.akinito:not(.login-page) .pr-bes-modal-card .pr-btn-light,
  body.single:not(.login-page) .pr-bes-modal-card .pr-btn-light {
    color: #1f2937 !important;
    background: #ffffff !important;
    border: 1px solid #aeb9aa !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .pr-bes-modal-card .pr-btn-primary,
  body.akinito:not(.login-page) .pr-bes-modal-card .pr-btn-primary,
  body.single:not(.login-page) .pr-bes-modal-card .pr-btn-primary {
    color: #ffffff !important;
    background: #315c32 !important;
    border: 1px solid #264d28 !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .pr-bes-modal-card .pr-btn:disabled,
  body.akinito:not(.login-page) .pr-bes-modal-card .pr-btn:disabled,
  body.single:not(.login-page) .pr-bes-modal-card .pr-btn:disabled {
    color: #374151 !important;
    background: #e5e7eb !important;
    border-color: #cbd5e1 !important;
    opacity: 1 !important;
  }
  body.brownfly:not(.login-page) .pr-bes-modal-card .pr-btn i,
  body.akinito:not(.login-page) .pr-bes-modal-card .pr-btn i,
  body.single:not(.login-page) .pr-bes-modal-card .pr-btn i {
    color: inherit !important;
    opacity: 1 !important;
  }

}

/*
 * Global SweetAlert2 readability override.
 * Applies to every SweetAlert on every company theme and login screen,
 * including confirmations, warnings, validation dialogs and success notices.
 * Keep dialog/button backgrounds defined by each alert; standardize all text ink.
 */
.swal2-container .swal2-popup,
.swal2-popup {
  color: #111827 !important;
  background-color: #ffffff !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

.swal2-container .swal2-popup :is(
  .swal2-title,
  .swal2-html-container,
  .swal2-content,
  .swal2-footer,
  .swal2-validation-message,
  .swal2-input-label,
  label,
  p,
  li,
  strong,
  b,
  small,
  span,
  a,
  code,
  pre,
  output
),
.swal2-popup :is(
  .swal2-title,
  .swal2-html-container,
  .swal2-content,
  .swal2-footer,
  .swal2-validation-message,
  .swal2-input-label,
  label,
  p,
  li,
  strong,
  b,
  small,
  span,
  a,
  code,
  pre,
  output
) {
  color: #111827 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* SweetAlert action labels must remain readable on company-colored buttons. */
.swal2-container .swal2-popup :is(.swal2-styled, .swal2-confirm, .swal2-cancel, .swal2-deny),
.swal2-popup :is(.swal2-styled, .swal2-confirm, .swal2-cancel, .swal2-deny) {
  color: #111827 !important;
  text-shadow: none !important;
  opacity: 1 !important;
  font-weight: 700 !important;
}

/* Inputs, dropdowns and textareas inside SweetAlert dialogs. */
.swal2-container .swal2-popup :is(.swal2-input, .swal2-file, .swal2-textarea, .swal2-select),
.swal2-popup :is(.swal2-input, .swal2-file, .swal2-textarea, .swal2-select) {
  color: #111827 !important;
  background-color: #ffffff !important;
  border-color: #9ca3af !important;
  opacity: 1 !important;
}

.swal2-container .swal2-popup :is(.swal2-input, .swal2-textarea)::placeholder,
.swal2-popup :is(.swal2-input, .swal2-textarea)::placeholder {
  color: #6b7280 !important;
  opacity: 1 !important;
}

.swal2-container .swal2-popup .swal2-validation-message,
.swal2-popup .swal2-validation-message {
  color: #111827 !important;
  background: #f3f4f6 !important;
}


/* BES currency reference icon: use a dark glyph on each company's existing primary-color tile. */
.bes-form .bes-rate-panel-icon {
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
  opacity: 1 !important;
}
.bes-form .bes-rate-panel-icon > i,
.bes-form .bes-rate-panel-icon .bx {
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}


/* Print / Save PDF actions: dark readable labels and printer icons on every company theme. */
body.brownfly:not(.login-page) .content .quotation-print-pdf-btn,
body.akinito:not(.login-page) .content .quotation-print-pdf-btn,
body.single:not(.login-page) .content .quotation-print-pdf-btn,
body.brownfly:not(.login-page) .content .ps-print-pdf-btn,
body.akinito:not(.login-page) .content .ps-print-pdf-btn,
body.single:not(.login-page) .content .ps-print-pdf-btn {
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
  opacity: 1 !important;
  text-shadow: none !important;
  font-weight: 800 !important;
}
body.brownfly:not(.login-page) .content :is(.quotation-print-pdf-btn, .ps-print-pdf-btn) :is(i, svg),
body.akinito:not(.login-page) .content :is(.quotation-print-pdf-btn, .ps-print-pdf-btn) :is(i, svg),
body.single:not(.login-page) .content :is(.quotation-print-pdf-btn, .ps-print-pdf-btn) :is(i, svg) {
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
  fill: currentColor !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Final application-wide contrast pass (2026-11-13).
   The three official company primary swatches are light, so labels and icons
   placed on those fills must use dark ink rather than white. Dark semantic
   surfaces (danger alerts, dark-green approval/export headers and print sheets)
   are intentionally left unchanged. */
@media screen {
  :is(body.brownfly, body.akinito, body.single):not(.login-page) .content :is(
    .btn-primary, .btn-add, .bes-btn-primary, .po-btn-primary, .pr-btn-primary,
    .um-btn-primary, .client-primary-btn, .stock-submit, .btn-edit-product,
    .currency-save-btn, .us-primary-button, .us-picture-upload-button,
    .quotation-btn-primary, .quote-action, .quote-action.primary,
    .pagination a.active, .nav-tabs .nav-link.active,
    .tab-button.active, .filter-tab.active, .delivery-type-button.active,
    .pr-deadline-legend-link.active .pr-deadline-count,
    .bes-choice-icon, .bes-step > span, .bes-rate-panel-icon,
    .pr-bes-option-icon, .pr-company-badge, .pr-btn-light,
    .po-eyebrow, .pr-page .page-header h1, .pr-card-heading h2,
    .pr-log-heading h2, .pr-items-heading h3, .pr-stats strong,
    .bes-section-title, .bes-item-title, .bes-vendor h4,
    .bes-document-title, .bes-document-item h3, .bes-type-pill,
    .bes-setup-tags > span, .bes-item-count, .bes-vendor-summary span,
    .bes-vendor-summary strong, .bes-rate-panel-heading strong,
    .bes-discount-editor-heading h2, .bes-discount-field label,
    .um-heading-stat strong, .stock-number, .category-badge,
    .product-view-category, .product-detail-price, .product-price,
    .current-stock, .sidebar-mobile-toggle, .menu-toggle, .top-icon,
    .action-card:hover, .action-card:hover i, .action-buttons .edit:hover,
    .btn-edit:hover
  ) {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    text-shadow: none !important;
    opacity: 1 !important;
  }

  :is(body.brownfly, body.akinito, body.single):not(.login-page) .content :is(
    .btn-primary, .btn-add, .bes-btn-primary, .po-btn-primary, .pr-btn-primary,
    .um-btn-primary, .client-primary-btn, .stock-submit, .btn-edit-product,
    .currency-save-btn, .us-primary-button, .us-picture-upload-button,
    .quotation-btn-primary, .quote-action, .quote-action.primary,
    .pagination a.active, .nav-tabs .nav-link.active,
    .tab-button.active, .filter-tab.active, .delivery-type-button.active,
    .pr-bes-option-icon, .sidebar-mobile-toggle, .menu-toggle, .top-icon
  ) :is(i, svg, span, strong) {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    fill: currentColor !important;
    text-shadow: none !important;
  }

  /* Quotation history: the BES status "Quoted" was using the pale company
     primary color on a pale status surface. Keep all quotation UI labels dark. */
  :is(body.brownfly, body.akinito, body.single).quotation-history-page .content :is(
    .page-header h1, .quote-history-head h2, .quote-history-head p,
    .quote-table th, .quote-table td, .quote-number, .quote-sub,
    .quote-pill, .quote-action, .quote-empty, .quote-search button
  ) {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    text-shadow: none !important;
    opacity: 1 !important;
  }

  :is(body.brownfly, body.akinito, body.single).quotation-history-page .content :is(
    .quote-pill, .quote-action, .quote-search button
  ) :is(i, svg, span, strong) {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    fill: currentColor !important;
  }

  /* Quotation editor: dark text on the light company-colored section accents. */
  :is(body.brownfly, body.akinito, body.single).quotation-editor-page .content :is(
    .quotation-intro-card h2, .quotation-section-head h2,
    .quotation-item-price, .quotation-actions .quotation-btn-primary
  ) {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    text-shadow: none !important;
  }

  /* The user-settings avatar and upload controls sit on light company swatches. */
  :is(body.brownfly, body.akinito, body.single):not(.login-page) .content .us-avatar {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    background: var(--soft) !important;
    border: 1px solid rgba(17,24,39,.18) !important;
  }
  :is(body.brownfly, body.akinito, body.single):not(.login-page) .content :is(
    .us-primary-button, .us-picture-upload-button
  ) {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    background: var(--primary) !important;
    border-color: var(--secondary) !important;
  }
  :is(body.brownfly, body.akinito, body.single):not(.login-page) .content :is(
    .us-primary-button, .us-picture-upload-button
  ) * {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
  }

  /* Tables with a company-primary header use dark ink for legibility. */
  :is(body.brownfly, body.akinito, body.single):not(.login-page) .content :is(
    .table-wrapper table thead th, .po-table thead th,
    .quote-table thead th, .um-table thead th,
    .currency-settings-table thead th, .stock-history-table thead th,
    .bes-table thead th, .bes-doc-table thead th,
    .bes-markup-table thead th, .pr-log-table thead th,
    .pr-item-table thead th
  ) {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    text-shadow: none !important;
  }
}
