/* Persistent light/dark theme controls and the final contrast layer.
   Loaded after vendor CSS so component text cannot fall back to light-only
   Bootstrap or DataTables colors. */
.ro-theme-toggle {
  align-items: center !important;
  background: rgba(255, 255, 255, .14) !important;
  border: 1px solid rgba(255, 255, 255, .32) !important;
  border-radius: 9px !important;
  color: #fff !important;
  display: inline-flex !important;
  gap: 7px !important;
  min-height: 34px !important;
  padding: 7px 10px !important;
  white-space: nowrap;
}

html[data-theme="dark"] .sales-month-dropdown>summary,
html[data-theme="dark"] .sales-month-dropdown-menu{background:#182233;border-color:#42516a;color:#edf3fb}
html[data-theme="dark"] .sales-month-quarter-label{background:#223047}
html[data-theme="dark"] .sales-month-quarter-label strong{color:#edf3fb}
html[data-theme="dark"] .sales-month-quarter-label small{color:#aebcd0}
html[data-theme="dark"] .analytics-filter-form .sales-month-option{color:#e4ebf5}
html[data-theme="dark"] .sales-month-option:hover{background:#253249}
html[data-theme="dark"] .sales-month-option.is-selected{background:#1d3b67;color:#fff}
html[data-theme="dark"] .analytics-filter-form .sales-month-clear{background:#182233;border-color:#52627b;color:#e4ebf5}
html[data-theme="dark"] .sales-month-range-error{color:#ffd1cc}
.ro-theme-toggle:hover {
  background: rgba(255, 255, 255, .24) !important;
  color: #fff !important;
  transform: none !important;
}
.ro-theme-toggle:focus-visible {
  outline: 3px solid rgba(147, 197, 253, .75) !important;
  outline-offset: 2px !important;
}
.login-theme-toggle {
  background: #fff !important;
  border-color: #ced9e8 !important;
  color: #17345d !important;
  position: fixed;
  right: 156px;
  top: 18px;
  z-index: 21;
}
.login-theme-toggle:hover { background: #edf4ff !important; color: #17345d !important; }

/* Account-menu placement keeps the app bar compact at laptop widths. */
.ro-user-dropdown .ro-user-dropdown-theme {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #26384c !important;
  display: flex !important;
  justify-content: flex-start !important;
  min-height: 0 !important;
  padding: 10px 11px !important;
  width: 100% !important;
}
.ro-user-dropdown .ro-user-dropdown-theme:hover { background: #eef4fc !important; color: #26384c !important; }
.ro-user-dropdown .ro-user-dropdown-theme [data-theme-label] { display: inline !important; }
.ro-user-dropdown .ro-user-dropdown-theme [data-theme-icon] { color: #d97706 !important; width: 16px; text-align: center; }
.ro-user-dropdown form button { justify-content: flex-start !important; }

/* Dashboard launchers use standalone colored glyphs instead of nested square
   tiles. The glow is confined to the glyph, keeping the grid visually calm. */
.ro-home-app { --home-icon-color: #60a5fa; }
.ro-home-app.app-blue { --home-icon-color: #60a5fa; }
.ro-home-app.app-green { --home-icon-color: #67d391; }
.ro-home-app.app-teal { --home-icon-color: #5bc6b1; }
.ro-home-app.app-orange { --home-icon-color: #f08068; }
.ro-home-app.app-purple { --home-icon-color: #c56cf0; }
.ro-home-app.app-red { --home-icon-color: #f0717f; }
.ro-home-app.app-slate { --home-icon-color: #b5bdca; }
.ro-home-app.app-pink { --home-icon-color: #e879ad; }
.ro-home-app.app-indigo { --home-icon-color: #8795ff; }
.ro-home-app.app-cyan { --home-icon-color: #4ccbd3; }
.ro-section-grid .ro-home-app,
.ro-section-grid .ro-home-app:hover {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.ro-section-grid .ro-home-icon,
.ro-section-grid .ro-home-app:hover .ro-home-icon {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  font-size: 36px !important;
  height: 86px !important;
  width: 86px !important;
}
main .ro-home-app .ro-home-icon i {
  color: var(--home-icon-color) !important;
  filter: none;
  transition: filter .18s ease, transform .18s ease;
}
.ro-section-grid .app-notification {
  background: #e41e3f !important;
  border: 0 !important;
  border-radius: 7px !important;
  box-shadow: 0 3px 9px rgba(15, 23, 42, .32) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  height: 26px !important;
  line-height: 1 !important;
  min-width: 26px !important;
  padding: 0 7px !important;
  right: 6px !important;
  top: 8px !important;
  width: auto !important;
}
.ro-section-grid .app-notification-split {
  background: #fff !important;
  height: 28px !important;
  min-width: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  right: -3px !important;
  top: 7px !important;
}
.ro-section-grid .app-notification-split > span {
  gap: 4px !important;
  min-width: 35px !important;
  padding: 0 7px !important;
}
.ro-section-grid .app-notification-split i { font-size: 9px !important; }
.ro-inbox-link { overflow: visible !important; }
.ro-nav-notification-wrap {
  align-items: center;
  display: inline-flex !important;
  flex: 0 0 auto;
  justify-content: center;
  position: relative;
  gap: 4px;
}
.ro-nav-notification-wrap > i { font-size: 15px !important; }
.ro-nav-notification-wrap .ro-inbox-count {
  align-items: center !important;
  background: #e41e3f !important;
  border: 0 !important;
  border-radius: 7px !important;
  box-shadow: 0 3px 9px rgba(15, 23, 42, .32) !important;
  color: #fff !important;
  display: inline-flex !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  height: 18px !important;
  justify-content: center !important;
  line-height: 1 !important;
  min-width: 18px !important;
  padding: 0 5px !important;
  pointer-events: none;
  position: static !important;
  width: auto !important;
  z-index: 2;
}
.ro-home-app:hover .ro-home-icon { transform: translateY(-3px) scale(1.06); }
main .ro-home-app:hover .ro-home-icon i {
  filter: drop-shadow(0 0 7px currentColor) drop-shadow(0 0 15px currentColor);
  transform: scale(1.08);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000;
  --panel: rgba(10, 10, 10, .97);
  --panel-solid: #0a0a0a;
  --text: #f2f2f2;
  --muted: #ababab;
  --border: rgba(255, 255, 255, .16);
  --border-strong: rgba(255, 255, 255, .26);
  --accent: #60a5fa;
  --accent-dark: #93c5fd;
  --bg-primary: #000;
  --bg-secondary: #0a0a0a;
  --bg-hover: #181818;
  --text-primary: #f2f2f2;
  --text-secondary: #c5c5c5;
  --text-muted: #9d9d9d;
  --border-color: rgba(255, 255, 255, .18);
  --mac-bg-app: #000;
  --mac-bg-window: #0a0a0a;
  --mac-bg-control: #111;
  --mac-bg-control-hov: #1b1b1b;
  --mac-bg-elevated: #0d0d0d;
  --mac-bg-titlebar: rgba(0, 0, 0, .94);
  --mac-text: #f2f2f2;
  --mac-text-secondary: #c5c5c5;
  --mac-text-muted: #9d9d9d;
  --mac-divider: rgba(255, 255, 255, .16);
  --mac-divider-strong: rgba(255, 255, 255, .26);
  --dark-canvas: #000;
  --dark-surface: #0a0a0a;
  --dark-surface-2: #111;
  --dark-surface-3: #181818;
  --dark-border: #333;
  --dark-text: #f2f2f2;
  --dark-muted: #ababab;
  --dark-link: #8fc2ff;
  --dark-blue-soft: #142f55;
  --dark-green-soft: #12392e;
  --dark-amber-soft: #433114;
  --dark-red-soft: #472126;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  background: #000 !important;
  color: var(--dark-text) !important;
}
html[data-theme="dark"] body {
  background-image: none !important;
}
html[data-theme="dark"] main { color: var(--dark-text) !important; }
html[data-theme="dark"] .content {
  background: #000 !important;
}
html[data-theme="dark"] main a:not(.button):not(.crud-action):not(.ro-home-app):not(.tender-folder):not(.tender-kpi-card):not(.task-card) { color: var(--dark-link); }
html[data-theme="dark"] main :is(h1, h2, h3, h4, h5, h6) { color: #f4f7fb !important; }
html[data-theme="dark"] main :is(p, li, dd, dt, label) { color: var(--dark-text) !important; }
html[data-theme="dark"] main :is(small, .text-muted, .text-secondary, .helptext, .form-text) { color: var(--dark-muted) !important; }
html[data-theme="dark"] ::selection { background: #2563a8; color: #fff; }

/* App chrome */
html[data-theme="dark"] .ro-app-bar {
  background: linear-gradient(180deg, #122749, #0d1d37) !important;
  border-bottom-color: #304766 !important;
}
html[data-theme="dark"] .ro-user-banner {
  background: #111b2c !important;
  border-bottom-color: var(--dark-border) !important;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .22) !important;
}
html[data-theme="dark"] .ro-user-banner-name,
html[data-theme="dark"] .ro-user-banner-role,
html[data-theme="dark"] .breadcrumb-current { color: var(--dark-text) !important; }
html[data-theme="dark"] .ro-user-banner-name i,
html[data-theme="dark"] .breadcrumb-bar a { color: var(--dark-link) !important; }
html[data-theme="dark"] .ro-user-banner-sep,
html[data-theme="dark"] .breadcrumb-bar,
html[data-theme="dark"] .breadcrumb-sep { color: var(--dark-muted) !important; }
html[data-theme="dark"] .ro-user-dropdown {
  background: #162238 !important;
  border-color: var(--dark-border) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .48) !important;
}
html[data-theme="dark"] .ro-user-dropdown :is(a, button) { color: var(--dark-text) !important; }
html[data-theme="dark"] .ro-user-dropdown :is(a, button):hover { background: #20314d !important; }
html[data-theme="dark"] .ro-user-dropdown .ro-user-dropdown-theme { color: var(--dark-text) !important; }
html[data-theme="dark"] .ro-app-bar .ro-logout {
  background: rgba(255, 255, 255, .14) !important;
  border-color: rgba(255, 255, 255, .28) !important;
  color: #fff !important;
}
html[data-theme="dark"] .ro-app-bar .ro-logout:hover { background: rgba(255, 255, 255, .23) !important; color: #fff !important; }
html[data-theme="dark"] .ro-language-switcher { border-color: rgba(255, 255, 255, .32) !important; }
html[data-theme="dark"] .ro-language-switcher select { color: #fff !important; }
html[data-theme="dark"] .ro-language-switcher option { background: #111b2c; color: var(--dark-text); }

/* Shared surfaces */
html[data-theme="dark"] :is(
  .topbar, .panel, .form-panel, .table-panel, .messages, .mac-window,
  .ro-app-section, .ro-home-app, .workflow-task-row, .workflow-address,
  .workflow-action-box, .workflow-batch-item, .detail-card, .detail-card-item, .detail-metric-grid > div,
  .record-actions-dropdown, .checkbox-dropdown-menu, .fiscal-month-menu,
  .category-type-card, .district-map-selector, .analytics-panel, .analytics-section,
  .activity-performance-board, .activity-record-detail, .bld-details-inner
) {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .24) !important;
}
html[data-theme="dark"] :is(.topbar, .page-titlebar) { border-bottom-color: var(--dark-border) !important; }
html[data-theme="dark"] .page-titlebar h1,
html[data-theme="dark"] .ro-home-hero h1,
html[data-theme="dark"] .ro-section-head h2,
html[data-theme="dark"] .ro-home-app strong { color: #f4f7fb !important; }
html[data-theme="dark"] .ro-home-hero p,
html[data-theme="dark"] .ro-section-head small,
html[data-theme="dark"] .ro-home-app small { color: var(--dark-muted) !important; }
html[data-theme="dark"] .ro-section-head span { color: #8fc2ff !important; }
html[data-theme="dark"] .ro-home-app:hover { background: #182842 !important; border-color: #5683bd !important; }
html[data-theme="dark"] .ro-home-icon { box-shadow: 0 8px 20px rgba(0, 0, 0, .28) !important; }
html[data-theme="dark"] .workflow-batch-list { border-color: var(--dark-border) !important; }
html[data-theme="dark"] .workflow-batch-select-all { background: #182842 !important; border-color: #456b9a !important; color: #d8e9ff !important; }
html[data-theme="dark"] :is(.workflow-batch-head p, .workflow-batch-item small, .workflow-batch-footer > span) { color: var(--dark-muted) !important; }
html[data-theme="dark"] .workflow-batch-materials > span { background: #14243a !important; border-color: #355577 !important; color: #c7e1ff !important; }
html[data-theme="dark"] .workflow-batch-materials b { color: #fff !important; }
html[data-theme="dark"] .pop-approval-edit { background: linear-gradient(145deg,#111d2f,#14243a) !important; border-color: #355577 !important; }
html[data-theme="dark"] .pop-approval-edit-head p { color: var(--dark-muted) !important; }
html[data-theme="dark"] .pop-approval-edit-table [data-pop-line-available] { color: #8ce3bf !important; }
html[data-theme="dark"] .pop-approval-edit-footer > span { color: #ffc47d !important; }
html[data-theme="dark"] .pop-checker-edit-note { background: #14243a !important; border-color: #355577 !important; color: #c7e1ff !important; }
html[data-theme="dark"] .birthday-alert { background: linear-gradient(100deg, #3b2d12, #533d12 48%, #3b2d12) !important; border-color: #82631f !important; }
html[data-theme="dark"] .birthday-wish,
html[data-theme="dark"] .birthday-wish small { color: #ffe6a6 !important; }

/* Forms and controls */
html[data-theme="dark"] :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select, textarea, .form-control, .form-select, .dropdown-search-input,
  .fiscal-month-button, .checkbox-dropdown-summary
) {
  background: #0e1828 !important;
  border-color: #41516a !important;
  color: var(--dark-text) !important;
  caret-color: #93c5fd;
}
html[data-theme="dark"] :is(input, textarea)::placeholder { color: #8494aa !important; opacity: 1; }
html[data-theme="dark"] :is(input, select, textarea):focus {
  background: #111e31 !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, .22) !important;
  color: #fff !important;
}
html[data-theme="dark"] :is(input, select, textarea):disabled,
html[data-theme="dark"] :is(input, select, textarea)[readonly] { background: #182235 !important; color: #95a3b7 !important; opacity: 1; }
html[data-theme="dark"] select option { background: #111b2c; color: var(--dark-text); }
html[data-theme="dark"] input[type="file"]::file-selector-button { background: #20314d; border: 0; color: #e8eef8; }
html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"] { accent-color: #60a5fa; }
html[data-theme="dark"] .date-picker-button { background: #20314d !important; border-color: #41516a !important; color: #bcd8ff !important; }
html[data-theme="dark"] .date-picker-wrap {
  background: #0e1828 !important;
  border-color: #41516a !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 2px 8px rgba(0,0,0,.22) !important;
}
html[data-theme="dark"] .date-picker-wrap:focus-within {
  background: #111e31 !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(96,165,250,.22) !important;
}
html[data-theme="dark"] .date-picker-wrap .date-input { background: transparent !important; }
html[data-theme="dark"] .native-date-input { color-scheme: dark; }
html[data-theme="dark"] .audit-collapsible > summary {
  background: #20314d;
  border-color: #53657f;
  color: #d8e8ff;
}
html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] button.secondary,
html[data-theme="dark"] .btn-secondary {
  background: #20314d !important;
  border-color: #53657f !important;
  color: #f1f5f9 !important;
}
html[data-theme="dark"] :is(.button.secondary, button.secondary, .btn-secondary):hover { background: #2a3d5c !important; color: #fff !important; }
html[data-theme="dark"] .button.warning { background: #4b2b18 !important; border-color: #a85e2e !important; color: #ffbd8a !important; }
html[data-theme="dark"] .errorlist,
html[data-theme="dark"] .invalid-feedback { color: #ff9ba4 !important; }

/* Tables, lists and DataTables */
html[data-theme="dark"] :is(.table-responsive, .table-wrap, .dt-scroll-body, .dt-scroll-head, .lb-attendance-wrap) {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] main table { --bs-table-bg: transparent; --bs-table-color: var(--dark-text); color: var(--dark-text) !important; }
html[data-theme="dark"] main table :is(th, td) { border-color: #33435b !important; color: var(--dark-text) !important; }
html[data-theme="dark"] main table th,
html[data-theme="dark"] .dt-scroll-head table th { background: #19263a !important; color: #c7d5e8 !important; }
html[data-theme="dark"] main table tbody tr { background: var(--dark-surface) !important; }
html[data-theme="dark"] main table tbody tr:nth-child(even) { background: #131f32 !important; }
html[data-theme="dark"] main table tbody tr:hover { background: #1b2c46 !important; }
html[data-theme="dark"] .dt-container :is(.dt-info, .dt-length, .dt-search, .dt-paging) { color: var(--dark-muted) !important; }
html[data-theme="dark"] .dt-container .dt-search label {
  color: #c7d5e8 !important;
}
html[data-theme="dark"] .dt-container .dt-search input[type="search"],
html[data-theme="dark"] main input[type="search"] {
  background: #0e1828 !important;
  border: 1px solid #52627b !important;
  color: #f4f7fb !important;
  color-scheme: dark;
  caret-color: #93c5fd !important;
  -webkit-text-fill-color: #f4f7fb !important;
}
html[data-theme="dark"] .dt-container .dt-search input[type="search"]::placeholder,
html[data-theme="dark"] main input[type="search"]::placeholder {
  color: #93a4ba !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .dt-container .dt-search input[type="search"]:focus,
html[data-theme="dark"] main input[type="search"]:focus {
  background: #111e31 !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, .24) !important;
  outline: 0 !important;
}
html[data-theme="dark"] .dt-container .dt-length select {
  background: #0e1828 !important;
  border-color: #52627b !important;
  color: #f4f7fb !important;
  color-scheme: dark;
}
html[data-theme="dark"] .dt-container .dt-paging-button { background: #162238 !important; border-color: #3b4c65 !important; color: #d9e5f5 !important; }
html[data-theme="dark"] .dt-container .dt-paging-button.current { background: #2864ad !important; border-color: #60a5fa !important; color: #fff !important; }
html[data-theme="dark"] .record-actions-dropdown .crud-delete { background: var(--dark-red-soft) !important; color: #ff9ba4 !important; }

/* Semantic feedback: dark surfaces with readable foregrounds. */
html[data-theme="dark"] :is(.alert-info, .status-info, .status-in_progress) { background: var(--dark-blue-soft) !important; border-color: #315e91 !important; color: #b9d9ff !important; }
html[data-theme="dark"] :is(.alert-success, .status-approved, .status-completed, .status-submitted) { background: var(--dark-green-soft) !important; border-color: #2d6b57 !important; color: #9be8c8 !important; }
html[data-theme="dark"] :is(.alert-warning, .status-pending, .workflow-count-chip, .workflow-waiting, .status-awaiting_review) { background: var(--dark-amber-soft) !important; border-color: #80612b !important; color: #ffda8a !important; }
html[data-theme="dark"] :is(.alert-danger, .status-rejected, .status-cancelled, .status-returned, .form-errors) { background: var(--dark-red-soft) !important; border-color: #89414a !important; color: #ffabb2 !important; }
html[data-theme="dark"] .messages > div { background: var(--dark-blue-soft) !important; border-color: #315e91 !important; color: #c7e0ff !important; }

/* Tender Analysis and Tender Entry (their page CSS is inline and light-only). */
html[data-theme="dark"] .tender-shell { --ink: var(--dark-text); --blue: #8fc2ff; color: var(--dark-text) !important; }
html[data-theme="dark"] .tender-shell :is(p, small, label, td) { color: var(--dark-text) !important; }
html[data-theme="dark"] :is(
  .tender-hero, .tender-folder-hero, .tender-folder, .tender-list-panel, .tender-form-panel,
  .tender-detail-panel, .tender-kpi-card, .tender-status-card, .tender-stage-card,
  .tender-detail-item, .tender-action-card, .tender-lifecycle-check,
  .tender-trash-summary > div, .tender-dialog, .tender-dialog-actions
) {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .24) !important;
}
html[data-theme="dark"] .tender-hero { background: linear-gradient(125deg, #111b2c, #142947 64%, #352b18) !important; }
html[data-theme="dark"] .tender-folder-hero {
  background: linear-gradient(125deg, #111b2c, #142947) !important;
}
html[data-theme="dark"] .tender-folder-hero.trash {
  background: linear-gradient(125deg, #111b2c, #2d1c22) !important;
  border-color: #724149 !important;
}
html[data-theme="dark"] .tender-folder-hero h2 { color: #f4f7fb !important; }
html[data-theme="dark"] .tender-folder-hero p { color: #b9c7da !important; }
html[data-theme="dark"] .tender-folder-hero-icon {
  background: #203b61 !important;
  color: #9dccff !important;
}
html[data-theme="dark"] .tender-folder-hero.trash .tender-folder-hero-icon {
  background: #512a32 !important;
  color: #ffb5be !important;
}
html[data-theme="dark"] .tender-hero h2,
html[data-theme="dark"] .tender-folder strong,
html[data-theme="dark"] .tender-kpi-card > strong,
html[data-theme="dark"] .tender-section-title h3 { color: #f4f7fb !important; }
html[data-theme="dark"] .tender-folder::before { background: var(--dark-surface) !important; border-color: var(--dark-border) !important; }
html[data-theme="dark"] .tender-trash-folder { background: linear-gradient(135deg, #111b2c, #2d1c22) !important; border-color: #724149 !important; }
html[data-theme="dark"] .tender-recycle-card { background: linear-gradient(145deg, #111b2c, #153126) !important; border-color: #386c57 !important; }
html[data-theme="dark"] .tender-recycle-card header > i { background: #173e34 !important; color: #9be8c8 !important; }
html[data-theme="dark"] .tender-recycle-breakdown > span { background: #17283a !important; color: #b9c8d9 !important; }
html[data-theme="dark"] .tender-recycle-breakdown b { color: #9be8c8 !important; }
html[data-theme="dark"] .tender-entry-tabs { background: #0e1828 !important; border-color: var(--dark-border) !important; }
html[data-theme="dark"] .tender-entry-tabs a { color: var(--dark-muted) !important; }
html[data-theme="dark"] .tender-entry-tabs a.is-active { background: #20314d !important; border-color: #4777b5 !important; color: #fff !important; }
html[data-theme="dark"] .tender-form-intro {
  background: var(--dark-blue-soft) !important;
  border: 1px solid #315e91 !important;
}
html[data-theme="dark"] .tender-form-intro :is(strong, p, small) { color: #c7e0ff !important; }
html[data-theme="dark"] :is(.tender-split-links a, .tender-triple-links a, .tender-mini-links a, .tender-history-row, .tender-product-chips span) { background: #172941 !important; border-color: #385477 !important; color: #c9def8 !important; }
html[data-theme="dark"] .tender-kpi-card.due { background: linear-gradient(145deg, #2d1c22, #472126) !important; border-color: #d05a62 !important; }
html[data-theme="dark"] .tender-kpi-card.due :is(strong, small, em, a) { color: #ffc0c5 !important; }
html[data-theme="dark"] .tender-alert { background: #3b2023 !important; border-color: #a84b53 !important; }
html[data-theme="dark"] .tender-ticker-item.urgent { background: #493035 !important; color: #f8e9e9 !important; }
html[data-theme="dark"] .tender-ticker-item.warning { background: #4a3d24 !important; color: #f8edce !important; }
html[data-theme="dark"] .tender-ticker-item.notice { background: #39412a !important; color: #eef2d3 !important; }
html[data-theme="dark"] .tender-due-split-links a { background: #251d25 !important; border-color: #74414a !important; }
html[data-theme="dark"] .tender-due-split-links .verified :is(b, span) { color: #8ee2bd !important; }
html[data-theme="dark"] .tender-due-split-links .not-verified :is(b, span) { color: #ffabb2 !important; }
html[data-theme="dark"] .tender-progress-step { background: #1a273b !important; color: #c2d0e2 !important; }
html[data-theme="dark"] .tender-progress-step.current { background: var(--dark-blue-soft) !important; color: #b9d9ff !important; }
html[data-theme="dark"] .tender-progress-step.done { background: var(--dark-green-soft) !important; color: #9be8c8 !important; }
html[data-theme="dark"] .tender-progress-step.returned { background: var(--dark-red-soft) !important; color: #ffabb2 !important; }
html[data-theme="dark"] .tender-progress-step span { background: #0e1828 !important; }
html[data-theme="dark"] .tender-table :is(th:last-child, td:last-child),
html[data-theme="dark"] .tender-table tbody :is(tr, td) { background: var(--dark-surface) !important; border-color: var(--dark-border) !important; }
html[data-theme="dark"] .tender-table tbody td[data-label="Tender No."],
html[data-theme="dark"] .tender-table tbody td[data-label="Action"] { background: #162238 !important; }
html[data-theme="dark"] .tender-table tbody td::before { color: #a9b7ca !important; }

/* Task dashboard and audit trail. tasks.css is linked within page content. */
html[data-theme="dark"] :is(.task-hero, .task-section, .task-form-panel, .task-card, .task-person, .task-empty) {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .24) !important;
}
html[data-theme="dark"] .task-hero { background: linear-gradient(135deg, #142947, #111b2c) !important; }
html[data-theme="dark"] :is(.task-hero h2, .task-section-head h3, .task-card h4) { color: #f4f7fb !important; }
html[data-theme="dark"] :is(.task-hero p, .task-card p, .task-person p, .task-audit p, .task-person small, .task-audit small, .task-meta) { color: var(--dark-muted) !important; }
html[data-theme="dark"] .task-meta { border-color: var(--dark-border) !important; }
html[data-theme="dark"] .task-criticality { background: #26364d !important; color: #d5e0ef !important; }
html[data-theme="dark"] .task-status.status-in_progress { background: var(--dark-blue-soft) !important; color: #b9d9ff !important; }
html[data-theme="dark"] .task-status.status-awaiting_review { background: var(--dark-amber-soft) !important; color: #ffda8a !important; }
html[data-theme="dark"] .task-status.status-returned { background: var(--dark-red-soft) !important; color: #ffabb2 !important; }
html[data-theme="dark"] .task-status.status-completed,
html[data-theme="dark"] .task-status.status-submitted { background: var(--dark-green-soft) !important; color: #9be8c8 !important; }
html[data-theme="dark"] .task-assignee-stack span { border-color: var(--dark-surface) !important; }
html[data-theme="dark"] .task-audit article > span { background: var(--dark-blue-soft) !important; color: #93c5fd !important; }
html[data-theme="dark"] main .task-card-link { color: var(--dark-text) !important; }
html[data-theme="dark"] :is(.task-assignee-table-wrap, .task-assignee-table tbody tr) { background: var(--dark-surface-2) !important; border-color: var(--dark-border) !important; }
html[data-theme="dark"] .task-assignee-table tbody tr:has(input:checked) { background: var(--dark-blue-soft) !important; }
html[data-theme="dark"] .task-assignee-table label { color: var(--dark-text) !important; }
html[data-theme="dark"] .managed-task-actions { border-color: var(--dark-border) !important; }
html[data-theme="dark"] .task-open-button { background: #1b2a40 !important; border-color: #40516a !important; color: var(--dark-text) !important; }

/* Sales Analytics: the template intentionally uses light-theme !important
   colors, so every tab needs a more specific dark-theme contract. */
html[data-theme="dark"] .sales-analytics-dashboard {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .sales-analytics-dashboard :is(
  p, small, .panel:not(.analytics-hero) label, .tile-kicker, .section-label,
  .section-sub, .segment-metric-label, .segment-context, .segment-board-key,
  .bld-hover-hint, .leaderboard-legend, .month-chart-legend,
  .month-tooltip span, .month-tooltip th, .bld-total-number > span,
  .bld-bar-row > span, .progress-label > span, .bld-compare-grid span,
  .mt-seg-title, .mt-totals span, .customer-identity small,
  .customer-comparison-values small, .segment-board-empty, .customer-empty
) { color: var(--dark-muted) !important; }
html[data-theme="dark"] .sales-analytics-dashboard :is(
  .tile-head h2, .segment-board-head h2, .segment-lane-identity h3,
  .segment-metric > strong, .bld-leaderboard-head h2, .bld-identity h2,
  .bld-detail-head h3, .bld-compare-grid strong, .month-chart-head h2,
  .customer-analytics-head h2, .customer-identity strong,
  .customer-comparison-values strong, .customer-growth-ring span
) { color: var(--dark-text) !important; }
html[data-theme="dark"] .sales-analytics-dashboard .analytics-hero h2 { color: #fff !important; }
html[data-theme="dark"] .sales-analytics-dashboard .analytics-hero :is(p, .eyebrow) { color: #e4efff !important; }
html[data-theme="dark"] .sales-analytics-dashboard :is(.section-value, .section-pct) { color: #9be8c8 !important; }
html[data-theme="dark"] .sales-analytics-dashboard .segment-aop-progress :is(span, strong, b) { color: #c4b5fd !important; }
html[data-theme="dark"] .sales-analytics-dashboard .segment-aop-ring-card {
  background: #201d3b !important;
  border-color: #51478a !important;
}
html[data-theme="dark"] .sales-analytics-dashboard .segment-aop-ring-card :is(strong, span) { color: #ddd6fe !important; }
html[data-theme="dark"] .sales-analytics-dashboard .segment-aop-ring-card p { color: #b9addd !important; }
html[data-theme="dark"] .sales-analytics-dashboard .segment-aop-ring {
  background: conic-gradient(#c084fc var(--aop-progress), #40365f 0) !important;
  box-shadow: 0 0 0 1px #8066bd, 0 0 18px rgba(192, 132, 252, .28);
}
html[data-theme="dark"] .sales-analytics-dashboard .segment-aop-ring::before {
  background: #12101f !important;
  box-shadow: inset 0 0 0 1px #6f5aa2 !important;
}
html[data-theme="dark"] .sales-analytics-dashboard .segment-aop-ring > span {
  color: #f5f0ff !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .75);
}
html[data-theme="dark"] .sales-analytics-dashboard :is(
  .analytics-total-card, .analytics-tile, .segment-performance-board,
  .segment-lanes, .segment-lane, .bld-sales-card, .bld-details, .bld-details-inner,
  .month-chart-card, .month-tooltip, .tile-section, .bld-total-number,
  .bld-compare-grid > div, .bld-segment-chip, .customer-sales-panel
) {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .sales-analytics-dashboard .segment-lanes {
  background: #0f1a2b !important;
}
html[data-theme="dark"] .sales-analytics-dashboard .segment-packshot {
  background: #e8edf5 !important;
  border-color: #6f8099 !important;
}
html[data-theme="dark"] .sales-analytics-dashboard :is(
  .segment-board-head, .bld-detail-head, .analytics-tab-switcher,
  .sales-area-color-strip, .month-tooltip .mt-totals > div
) {
  background: var(--dark-surface-2) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .sales-analytics-dashboard .segment-lane:hover,
html[data-theme="dark"] .sales-analytics-dashboard .bld-card-trigger:hover {
  background: var(--dark-surface-3) !important;
}
html[data-theme="dark"] .sales-analytics-dashboard :is(
  .segment-metric, .segment-aop-progress, .bld-details .bld-compare-grid,
  .bld-details .bld-segment-breakdown, .month-tooltip .mt-seg td,
  .customer-sales-table th, .customer-sales-table td
) { border-color: var(--dark-border) !important; }
html[data-theme="dark"] .sales-analytics-dashboard :is(
  .segment-meter, .progress-track, .bld-bar-track
) { background: #2a3a51 !important; }
html[data-theme="dark"] .sales-analytics-dashboard .customer-growth-ring::after { background: var(--dark-surface) !important; }
html[data-theme="dark"] .sales-analytics-dashboard .mc-axis-label { fill: #c7d5e8 !important; }
html[data-theme="dark"] .sales-analytics-dashboard .mc-grid { stroke: #33435b !important; }
html[data-theme="dark"] .sales-analytics-dashboard .analytics-tab-switcher a { color: #b9c7da !important; }
html[data-theme="dark"] .sales-analytics-dashboard .analytics-tab-switcher a.is-active {
  background: linear-gradient(135deg, #2864ad, #087f9d) !important;
  color: #fff !important;
}
html[data-theme="dark"] .sales-analytics-dashboard .bld-full-year-progress {
  background: var(--dark-surface-2) !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .sales-analytics-dashboard .bld-full-year-progress :is(span, small) { color: var(--dark-muted) !important; }
html[data-theme="dark"] .sales-analytics-dashboard .bld-full-year-progress strong { color: var(--dark-text) !important; }
html[data-theme="dark"] .sales-analytics-dashboard .bld-achievement-ring::before { background: var(--dark-surface) !important; }
html[data-theme="dark"] .sales-analytics-dashboard .bld-achievement-ring > span { color: #b9d9ff !important; }

/* Activity dashboards, activity records and their responsive summaries. */
html[data-theme="dark"] :is(
  .activity-pulse-hero, .activity-performance-board, .activity-performance-row,
  .activity-summary-card, .activity-record-detail, .activity-detail-section,
  .activity-detail-item, .activity-report-link
) {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
}
html[data-theme="dark"] :is(.activity-board-head, .activity-pulse-hero) {
  background: linear-gradient(135deg, #142947, #111b2c) !important;
  border-color: #315e91 !important;
}
html[data-theme="dark"] :is(
  .activity-pulse-hero h2, .activity-board-head h2, .activity-row-identity h3,
  .activity-row-metric > strong, .activity-year-ring-layout strong,
  .activity-record-heading h2, .activity-detail-section > header h3,
  .activity-detail-item dd, .activity-report-link strong,
  .activity-summary-card .asc-head h3, .asc-metrics strong
) { color: var(--dark-text) !important; }
html[data-theme="dark"] :is(
  .activity-pulse-hero p, .activity-board-head p, .activity-board-key,
  .activity-row-metric > span, .activity-row-metric > strong small,
  .activity-row-metric > b.aop-status, .activity-board-empty,
  .activity-year-ring-layout strong small, .activity-record-heading span,
  .activity-record-heading p, .activity-detail-item dt,
  .activity-report-link small, .activity-empty-state, .asc-metrics span,
  .asc-metrics small
) { color: var(--dark-muted) !important; }
html[data-theme="dark"] :is(
  .activity-performance-row:hover, .activity-row-metric.all-time,
  .activity-summary-card .asc-metrics > div
) { background: var(--dark-surface-2) !important; }
html[data-theme="dark"] :is(
  .activity-performance-row, .activity-row-metric, .activity-board-head,
  .activity-detail-section, .activity-detail-item, .activity-report-link
) { border-color: var(--dark-border) !important; }
html[data-theme="dark"] :is(.activity-row-progress, .activity-year-ring) { background-color: #2a3a51 !important; }
html[data-theme="dark"] .activity-year-ring::before { background: var(--dark-surface) !important; }
html[data-theme="dark"] .activity-filter-form label { color: var(--dark-muted) !important; }

/* Activity record detail has light-only hero and section-header backgrounds in
   macos.css. Scope the overrides to this page so light text never sits on the
   original white surfaces. */
html[data-theme="dark"] .activity-record-detail .activity-record-hero {
  background: linear-gradient(125deg, #151515 0%, #0d0d0d 68%, #121820 100%) !important;
  border-color: #353535 !important;
  border-top-color: #4f8fe8 !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .42) !important;
}
html[data-theme="dark"] .activity-record-detail .activity-detail-section {
  background: #0a0a0a !important;
  border-color: #333 !important;
  box-shadow: 0 9px 24px rgba(0, 0, 0, .32) !important;
}
html[data-theme="dark"] .activity-record-detail .activity-detail-section > header {
  background: #151515 !important;
  border-bottom-color: #333 !important;
  color: #f2f2f2 !important;
}
html[data-theme="dark"] .activity-record-detail .activity-detail-section > header h3,
html[data-theme="dark"] .activity-record-detail .activity-record-heading h2 {
  color: #f2f2f2 !important;
}
html[data-theme="dark"] .activity-record-detail .activity-record-heading :is(span, p),
html[data-theme="dark"] .activity-record-detail .activity-detail-item dt,
html[data-theme="dark"] .activity-record-detail .activity-empty-state {
  color: #aaa !important;
}
html[data-theme="dark"] .activity-record-detail .activity-detail-item {
  background: #0a0a0a !important;
  border-color: #303030 !important;
}
html[data-theme="dark"] .activity-record-detail .activity-detail-item dd {
  color: #f0f0f0 !important;
}
html[data-theme="dark"] .activity-record-detail .activity-gallery a {
  background: #111 !important;
  border-color: #383838 !important;
  color: #b9d9ff !important;
}
html[data-theme="dark"] main .activity-entry-form h2,
html[data-theme="dark"] main .activity-entry-form h3,
html[data-theme="dark"] main .activity-entry-form label,
html[data-theme="dark"] main .activity-records-panel h2 {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] main .activity-entry-tabs {
  border-bottom-color: var(--dark-border) !important;
}
html[data-theme="dark"] main .activity-entry-tabs button {
  color: var(--dark-muted) !important;
}
html[data-theme="dark"] main .activity-entry-tabs button.is-active {
  border-color: #60a5fa !important;
  color: #9dccff !important;
}
html[data-theme="dark"] main .activity-entry-form :is(.lbu-context, .lbu-activity-box, .lbu-entry, .lbu-report-group) {
  background: var(--dark-surface-2) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
}
html[data-theme="dark"] main .activity-records-panel :is(
  .lbu-report-date, .lbu-report-buddy, .lbu-report-meta
) { color: var(--dark-text) !important; }
html[data-theme="dark"] .activity-dashboard-tabs {
  background: var(--dark-surface-2) !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .activity-dashboard-tabs a { color: #b9c7da !important; }
html[data-theme="dark"] .activity-dashboard-tabs a.is-active {
  background: #2864ad !important;
  color: #fff !important;
}
html[data-theme="dark"] .activity-performance-board .tile-kicker { color: var(--dark-muted) !important; }
html[data-theme="dark"] .activity-year-ring > span,
html[data-theme="dark"] .activity-year-ring-layout b { color: #9be8c8 !important; }
html[data-theme="dark"] .analytics-hero h2 { color: #fff !important; }
html[data-theme="dark"] .analytics-hero :is(p, .eyebrow) { color: #e4efff !important; }
html[data-theme="dark"] .lb-progress-cell { background: var(--dark-surface-2) !important; }
html[data-theme="dark"] .lb-total-row td { background: var(--dark-blue-soft) !important; }
html[data-theme="dark"] .lb-progress-cell > small { color: var(--dark-muted) !important; }
html[data-theme="dark"] .lb-target-progress { background: #2a3a51 !important; }
html[data-theme="dark"] .dt-container label { color: var(--dark-muted) !important; }
html[data-theme="dark"] .dt-container .dt-paging-button.disabled {
  color: #8494aa !important;
  opacity: .72 !important;
}

/* Lube Buddy attendance report: the page carries light-only header, summary,
   gallery and dialog styles inside its template, so it needs a complete scoped
   surface and foreground treatment. */
html[data-theme="dark"] .lb-submission-report .activity-record-hero {
  background: linear-gradient(125deg, #142947, #111b2c 68%, #172946) !important;
  border-color: #315e91 !important;
  border-top-color: #60a5fa !important;
  color: var(--dark-text) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .3) !important;
}
html[data-theme="dark"] .lb-submission-report .activity-detail-section > header {
  background: #19263a !important;
  border-bottom-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .lb-submission-report .activity-detail-section > header h3,
html[data-theme="dark"] .lb-submission-report .activity-record-heading h2,
html[data-theme="dark"] .lb-submission-report .lb-activity-summary strong,
html[data-theme="dark"] .lb-submission-report .lb-report-notes {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .lb-submission-report :is(
  .activity-record-heading > span, .activity-record-heading p,
  .lb-activity-summary span
) { color: var(--dark-muted) !important; }
html[data-theme="dark"] .lb-submission-report .lb-activity-summary {
  background: var(--dark-surface) !important;
  border-bottom-color: var(--dark-border) !important;
}
html[data-theme="dark"] .lb-submission-report .lb-report-status {
  background: var(--dark-green-soft) !important;
  color: #9be8c8 !important;
}
html[data-theme="dark"] .lb-submission-report .lb-return-note {
  background: var(--dark-amber-soft) !important;
  border-color: #80612b !important;
  color: #ffda8a !important;
}
html[data-theme="dark"] .lb-submission-report .activity-gallery a {
  background: var(--dark-surface-2) !important;
  border-color: var(--dark-border) !important;
  color: #b9d9ff !important;
}
html[data-theme="dark"] .lb-submission-report .lb-reject-dialog {
  background: var(--dark-surface-2) !important;
  border: 1px solid var(--dark-border) !important;
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .lb-submission-report .lb-reject-dialog :is(h3, label, strong) {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .lb-submission-report .lb-reject-dialog p {
  color: var(--dark-muted) !important;
}

/* Newsletter: Market Intelligence, export generation/history, and access
   controls share this contract so their light form helpers never leak navy. */
html[data-theme="dark"] .newsletter-module {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .newsletter-module :is(
  .panel, .table-wrap, .highlight-list li
) {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .newsletter-module :is(
  h2, p, label, .highlight-list li span, .access-check span,
  .pagination span, .toolbar
) { color: var(--dark-text) !important; }
html[data-theme="dark"] .newsletter-module :is(.muted-count, .text-muted) { color: var(--dark-muted) !important; }
html[data-theme="dark"] .newsletter-module .status {
  background: var(--dark-green-soft) !important;
  color: #9be8c8 !important;
}
html[data-theme="dark"] .newsletter-export .activity-report-total {
  background: var(--dark-surface-2) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .24) !important;
}
html[data-theme="dark"] .newsletter-export .activity-report-total span {
  color: var(--dark-muted) !important;
}
html[data-theme="dark"] .newsletter-export .activity-report-total strong {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .newsletter-export .activity-report-filter :is(
  input:not([type="checkbox"]):not([type="radio"]), select
) {
  background: #080808 !important;
  border-color: #383838 !important;
  color: var(--dark-text) !important;
  color-scheme: dark;
  -webkit-text-fill-color: var(--dark-text) !important;
}
html[data-theme="dark"] .newsletter-export .activity-report-filter option {
  background: #0a0a0a !important;
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .newsletter-export .activity-multiselect-dropdown > summary,
html[data-theme="dark"] .newsletter-export .activity-multiselect-menu {
  background: var(--dark-surface-2) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .newsletter-export .activity-multiselect-option {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .newsletter-export .activity-multiselect-option:hover,
html[data-theme="dark"] .newsletter-export .activity-multiselect-option.is-selected {
  background: var(--dark-blue-soft) !important;
  color: #b9d9ff !important;
}
html[data-theme="dark"] .newsletter-export .activity-multiselect-all {
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .newsletter-export .activity-multiselect-clear {
  color: #9dccff !important;
}
html[data-theme="dark"] .access-fieldset { border-color: var(--dark-border) !important; }
html[data-theme="dark"] .access-fieldset legend { color: var(--dark-muted) !important; }

/* Shared tab bars that otherwise retain a white light-theme surface. */
html[data-theme="dark"] main :is(.dashboard-tabs, .tab-switcher, .lb-top-tabs) {
  background: var(--dark-surface-2) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
}
html[data-theme="dark"] main :is(.dashboard-tabs, .tab-switcher, .lb-top-tabs) :is(a, button) {
  background: transparent !important;
  border-color: transparent !important;
  color: var(--dark-muted) !important;
}
html[data-theme="dark"] main :is(.dashboard-tabs, .tab-switcher, .lb-top-tabs) :is(a, button):hover {
  background: var(--dark-surface-3) !important;
  color: var(--dark-text) !important;
}
html[data-theme="dark"] main :is(.dashboard-tabs, .tab-switcher, .lb-top-tabs) :is(.is-active, [aria-selected="true"]) {
  background: var(--dark-blue-soft) !important;
  border-color: #4d79ad !important;
  color: #b9d9ff !important;
}

/* Lube Buddy workflows and analytics pages with embedded CSS. */
html[data-theme="dark"] :is(
  .lb-box, .lb-entry, .lbu-context, .lbu-activity-box, .lbu-entry,
  .lbu-report-group, .lb-submission-card, .lb-geo-card, .lb-loader-card,
  .lb-picker summary, .lb-picker-menu, .lb-station-tabs button,
  .lb-hours-output, .lb-offline-status, .lb-report-card
) {
  background: var(--dark-surface-2) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
}
html[data-theme="dark"] :is(.lb-picker-menu label, .lb-geo-copy strong, .lb-hours-output) { color: var(--dark-text) !important; }
html[data-theme="dark"] :is(.lb-geo-copy small, .lb-offline-status small, .lb-retained-files) { color: var(--dark-muted) !important; }
html[data-theme="dark"] .lb-station-tabs button.is-active { background: var(--dark-blue-soft) !important; border-color: #4d79ad !important; color: #b9d9ff !important; }
html[data-theme="dark"] .lb-draft-note,
html[data-theme="dark"] .lb-network { background: var(--dark-amber-soft) !important; border-color: #80612b !important; color: #ffda8a !important; }
html[data-theme="dark"] .lb-network.is-online { background: var(--dark-green-soft) !important; border-color: #2d6b57 !important; color: #9be8c8 !important; }
html[data-theme="dark"] .lb-growth-ring::after,
html[data-theme="dark"] .customer-growth-ring::after,
html[data-theme="dark"] .activity-year-ring::before { background: var(--dark-surface) !important; }
html[data-theme="dark"] :is(.customer-identity strong, .customer-comparison-values strong, .customer-growth-ring span, .customer-empty) { color: var(--dark-text) !important; }
html[data-theme="dark"] :is(.customer-identity small, .customer-comparison-values small) { color: var(--dark-muted) !important; }
html[data-theme="dark"] .customer-growth-ring { background-color: #2a3a51 !important; }
html[data-theme="dark"] main svg text { fill: #c7d5e8 !important; }
html[data-theme="dark"] main canvas { filter: brightness(.92) contrast(1.08); }

/* Keep dashboard launchers borderless after the general dark-surface rules. */
html[data-theme="dark"] .ro-section-grid .ro-home-app,
html[data-theme="dark"] .ro-section-grid .ro-home-app:hover {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .ro-section-grid .ro-home-icon,
html[data-theme="dark"] .ro-section-grid .ro-home-app:hover .ro-home-icon {
  background: transparent !important;
  box-shadow: none !important;
}

/* Login is outside base.html and needs its own complete surface treatment. */
html[data-theme="dark"] .login-page { background: #0b1220 !important; color: var(--dark-text) !important; }
html[data-theme="dark"] .login-card { background: rgba(17, 27, 44, .96) !important; border-color: var(--dark-border) !important; box-shadow: 0 24px 70px rgba(0, 0, 0, .5) !important; }
html[data-theme="dark"] .login-card :is(h2, label) { color: var(--dark-text) !important; }
html[data-theme="dark"] .login-card-subtitle,
html[data-theme="dark"] .login-options { color: var(--dark-muted) !important; }
html[data-theme="dark"] .login-language-switcher,
html[data-theme="dark"] .login-theme-toggle { background: #162238 !important; border-color: #41516a !important; color: var(--dark-text) !important; }
html[data-theme="dark"] .login-language-switcher select { color: var(--dark-text) !important; }

/* Change-password screen has intentionally strong light-mode component rules,
   so every nested surface and control receives an explicit dark counterpart. */
html[data-theme="dark"] .password-change-panel {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .password-card-head {
  background:
    linear-gradient(135deg, rgba(47, 111, 214, .18), rgba(35, 174, 137, .12)),
    #142033 !important;
  border-bottom-color: var(--dark-border) !important;
}
html[data-theme="dark"] .password-card-head h2,
html[data-theme="dark"] .password-rules-title,
html[data-theme="dark"] .password-meter-top strong {
  color: #f4f7fb !important;
}
html[data-theme="dark"] .password-card-head p,
html[data-theme="dark"] .password-meter-top span,
html[data-theme="dark"] .password-submit-note,
html[data-theme="dark"] .password-match-hint {
  color: var(--dark-muted) !important;
}
html[data-theme="dark"] .password-kicker { color: #8fc2ff !important; }
html[data-theme="dark"] .password-field-block label { color: #d9e5f5 !important; }
html[data-theme="dark"] .password-input-shell {
  background: #0e1828 !important;
  border-color: #52627b !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 2px 8px rgba(0, 0, 0, .2) !important;
}
html[data-theme="dark"] .password-input-shell input {
  background: transparent !important;
  color: #f4f7fb !important;
  -webkit-text-fill-color: #f4f7fb !important;
}
html[data-theme="dark"] .password-input-shell input:-webkit-autofill,
html[data-theme="dark"] .password-input-shell input:-webkit-autofill:hover,
html[data-theme="dark"] .password-input-shell input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0e1828 inset !important;
  -webkit-text-fill-color: #f4f7fb !important;
  caret-color: #93c5fd !important;
}
html[data-theme="dark"] .password-toggle {
  background: #162238 !important;
  border-left-color: #41516a !important;
  color: #b9cbe2 !important;
}
html[data-theme="dark"] .password-toggle:hover {
  background: #20314d !important;
  color: #9dccff !important;
}
html[data-theme="dark"] .password-meter,
html[data-theme="dark"] .password-rules-panel {
  background: #162238 !important;
  border-color: var(--dark-border) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22) !important;
}
html[data-theme="dark"] .password-meter-track { background: #2a3a51 !important; }
html[data-theme="dark"] .password-rule-list li {
  background: #111b2c !important;
  border-color: #31415a !important;
  color: #b9c7da !important;
}
html[data-theme="dark"] .password-rule-list li i { color: #64748b !important; }
html[data-theme="dark"] .password-rule-list li.is-valid {
  background: #12392e !important;
  border-color: #2d6b57 !important;
  color: #9be8c8 !important;
}
html[data-theme="dark"] .password-rule-list li.is-invalid { color: #b9c7da !important; }
html[data-theme="dark"] .password-submit-row {
  border-top-color: var(--dark-border) !important;
}

/* A slim progress cue keeps AJAX navigation visible without flashing or
   replacing the application chrome. */
html.app-is-navigating [data-app-shell] {
  cursor: progress;
}
.app-navigation-loader {
  align-items: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, .94);
  border: 1px solid #d2dcea;
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .2);
  color: #17345d;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 9px;
  left: 50%;
  padding: 8px 14px 8px 9px;
  pointer-events: none;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
}
.app-navigation-loader[hidden] { display: none !important; }
.app-navigation-loader-icon {
  align-items: center;
  background: #edf4ff;
  border-radius: 50%;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}
.app-navigation-loader img {
  animation: app-loader-pulse .8s ease-in-out infinite alternate;
  height: 22px;
  object-fit: contain;
  width: 22px;
}
html[data-theme="dark"] .app-navigation-loader {
  background: rgba(17, 27, 44, .96);
  border-color: #41516a;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .46);
  color: #eef4fc;
}
html[data-theme="dark"] .app-navigation-loader-icon { background: #20314d; }
@keyframes app-loader-pulse {
  from { opacity: .62; transform: scale(.84); }
  to { opacity: 1; transform: scale(1.08); }
}

@media (max-width: 1180px) {
  .ro-theme-toggle [data-theme-label] { display: none; }
  .ro-theme-toggle { width: 36px; justify-content: center !important; padding-inline: 0 !important; }
}
@media (max-width: 650px) {
  .login-theme-toggle { left: 18px; right: auto; }
  html[data-theme="dark"] .tender-table tbody tr:nth-child(even) { background: var(--dark-surface) !important; }
}
@media (prefers-reduced-motion: reduce) {
  .ro-theme-toggle { transition: none !important; }
  .app-navigation-loader img { animation: none !important; }
}

/* Task filters, severity badges and pagination in dark mode. */
html[data-theme="dark"] .task-filter-bar {
  background: #162238 !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .task-filter-bar label > span { color: #b8c6d9 !important; }
html[data-theme="dark"] .task-filter-bar :is(input, select) {
  background: #0f1929 !important;
  border-color: #41516a !important;
  color: #eef4fc !important;
  color-scheme: dark;
}
html[data-theme="dark"] .task-filter-bar option { background: #162238; color: #eef4fc; }
html[data-theme="dark"] .task-criticality.severity-low { background: #173e34 !important; color: #9be8c8 !important; }
html[data-theme="dark"] .task-criticality.severity-normal { background: #203b61 !important; color: #b9d9ff !important; }
html[data-theme="dark"] .task-criticality.severity-high { background: #4b381d !important; color: #ffd28a !important; }
html[data-theme="dark"] .task-criticality.severity-critical { background: #512a32 !important; color: #ffb5be !important; }
html[data-theme="dark"] .task-pagination { color: var(--dark-muted) !important; }
html[data-theme="dark"] .task-pagination a,
html[data-theme="dark"] .task-page-current,
html[data-theme="dark"] .task-page-ellipsis {
  background: #162238 !important;
  border-color: var(--dark-border) !important;
  color: #b9d9ff !important;
}
html[data-theme="dark"] .task-pagination a:hover { background: #203b61 !important; border-color: #4d79ad !important; }
html[data-theme="dark"] .task-page-current { background: #315fa7 !important; border-color: #5b8bd0 !important; color: #fff !important; }
html[data-theme="dark"] .task-page-ellipsis { background: transparent !important; border-color: transparent !important; color: var(--dark-muted) !important; }

/* Final neutral-black palette. Keep semantic accent colours for statuses and
   primary actions, but remove the blue cast from the app chrome and surfaces. */
html[data-theme="dark"] .ro-app-bar {
  background: linear-gradient(180deg, #090909, #030303) !important;
  border-bottom-color: #2b2b2b !important;
}
html[data-theme="dark"] .ro-user-banner,
html[data-theme="dark"] .ro-user-dropdown { background: #0a0a0a !important; }
html[data-theme="dark"] .ro-user-dropdown :is(a, button):hover { background: #1a1a1a !important; }

html[data-theme="dark"] :is(
  .topbar, .panel, .form-panel, .table-panel, .messages, .mac-window,
  .ro-app-section, .ro-home-app, .workflow-task-row, .workflow-address,
  .workflow-action-box, .workflow-batch-item, .detail-card, .detail-card-item, .detail-metric-grid > div,
  .record-actions-dropdown, .checkbox-dropdown-menu, .fiscal-month-menu,
  .category-type-card, .district-map-selector, .analytics-panel, .analytics-section,
  .activity-performance-board, .activity-record-detail, .bld-details-inner,
  .task-section, .task-form-panel, .task-filter-bar, .task-card,
  .tender-hero, .tender-folder-hero, .tender-folder, .tender-list-panel,
  .tender-form-panel, .tender-detail-panel, .tender-kpi-card, .tender-status-card,
  .tender-stage-card, .tender-detail-item, .tender-action-card, .tender-lifecycle-check,
  .password-card-head, .password-meter, .password-rules-panel
) {
  background-color: var(--dark-surface) !important;
  background-image: none !important;
  border-color: var(--dark-border) !important;
}

html[data-theme="dark"] :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select, textarea, .form-control, .form-select, .dropdown-search-input,
  .fiscal-month-button, .checkbox-dropdown-summary, .password-input-shell
) { background: #080808 !important; border-color: #383838 !important; }
html[data-theme="dark"] :is(input, select, textarea):focus { background: #101010 !important; }
html[data-theme="dark"] :is(input, select, textarea):disabled,
html[data-theme="dark"] :is(input, select, textarea)[readonly] { background: #151515 !important; }
html[data-theme="dark"] select option { background: #0a0a0a; }

html[data-theme="dark"] main table :is(th, td) { border-color: #303030 !important; }
html[data-theme="dark"] main table th,
html[data-theme="dark"] .dt-scroll-head table th { background: #151515 !important; color: #d4d4d4 !important; }
html[data-theme="dark"] main table tbody tr { background: #090909 !important; }
html[data-theme="dark"] main table tbody tr:nth-child(even) { background: #0d0d0d !important; }
html[data-theme="dark"] main table tbody tr:hover { background: #181818 !important; }
html[data-theme="dark"] .dt-container .dt-paging-button { background: #151515 !important; border-color: #3a3a3a !important; }

html[data-theme="dark"] .app-horizontal-scroll::-webkit-scrollbar-track { background: #0b0b0b; }
html[data-theme="dark"] .app-horizontal-scroll::-webkit-scrollbar-thumb {
  background: #686868;
  border-color: #0b0b0b;
}
html[data-theme="dark"] .app-horizontal-scroll::-webkit-scrollbar-thumb:hover { background: #8a8a8a; }
html[data-theme="dark"] .app-horizontal-scroll:focus-visible { outline-color: rgba(235, 235, 235, .48); }
html[data-theme="dark"] .excel-export-button {
  background: linear-gradient(180deg, #218b5a, #176a45) !important;
  border-color: #399b70 !important;
  color: #fff !important;
}
html[data-theme="dark"] .excel-export-button:hover,
html[data-theme="dark"] .excel-export-button:focus-visible {
  background: linear-gradient(180deg, #2aa66d, #1d8054) !important;
  border-color: #55bd8b !important;
  color: #fff !important;
}
html[data-theme="dark"] .excel-export-button i { color: #fff !important; }

/* The light gear remains visible against black table rows in dark mode. */
html[data-theme="dark"] .record-actions-menu > summary,
html[data-theme="dark"] .record-actions-menu > summary .fa-gear {
  color: #f3f3f3 !important;
}
html[data-theme="dark"] .record-actions-menu > summary .fa-gear {
  filter: drop-shadow(0 1px 1px #000);
  text-shadow: 0 1px 0 #000, 0 0 7px rgba(255, 255, 255, .22) !important;
}

/* Master record detail pages. These components use deliberately bright
   profile/document surfaces in light mode, so they need explicit dark
   surfaces instead of inheriting white text over light backgrounds. */
html[data-theme="dark"] .master-detail-panel .identity-card {
  background: #0d0d0d !important;
  border-color: #333 !important;
  border-left-color: #4f8fe8 !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .38) !important;
}
html[data-theme="dark"] .master-detail-panel .identity-card::after {
  color: #969696 !important;
}
html[data-theme="dark"] .master-detail-panel .identity-card h2 {
  color: #f4f4f4 !important;
}
html[data-theme="dark"] .master-detail-panel .identity-card p {
  color: #bdbdbd !important;
}
html[data-theme="dark"] .master-detail-panel .identity-card p a {
  color: #8fc2ff !important;
}
html[data-theme="dark"] .master-detail-panel .identity-avatar {
  border-color: #292929 !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .55) !important;
}

html[data-theme="dark"] .master-detail-panel .bld-document-section {
  background: #0d0d0d !important;
  border-color: #333 !important;
}
html[data-theme="dark"] .master-detail-panel .bld-document-heading p {
  color: #ababab !important;
}
html[data-theme="dark"] .master-detail-panel .bld-document-card,
html[data-theme="dark"] .master-detail-panel .bld-document-card.is-empty {
  background: #111 !important;
  border-color: #383838 !important;
  color: #f2f2f2 !important;
}
html[data-theme="dark"] .master-detail-panel .bld-document-card.is-empty {
  background: #0a0a0a !important;
}
html[data-theme="dark"] .master-detail-panel .bld-document-icon {
  background: #17263d !important;
  color: #8fc2ff !important;
}
html[data-theme="dark"] .master-detail-panel .bld-document-copy small {
  color: #bdbdbd !important;
}
html[data-theme="dark"] .master-detail-panel .bld-document-copy strong {
  color: #f2f2f2 !important;
}

html[data-theme="dark"] .master-detail-panel .detail-card-item dt,
html[data-theme="dark"] .master-detail-panel .detail-card-item.is-contact dt {
  color: #a8a8a8 !important;
}
html[data-theme="dark"] .master-detail-panel .detail-card-item dd {
  color: #f2f2f2 !important;
}
html[data-theme="dark"] .master-detail-panel .detail-card-item.is-contact dd,
html[data-theme="dark"] .master-detail-panel .detail-card-item.is-contact a {
  color: #8fc2ff !important;
}

html[data-theme="dark"] .master-detail-panel .sales-area-detail-hero {
  background: color-mix(in srgb, var(--sales-area-color) 15%, #0a0a0a) !important;
  border-color: color-mix(in srgb, var(--sales-area-color) 42%, #383838) !important;
}
html[data-theme="dark"] .master-detail-panel .sales-area-detail-hero h2,
html[data-theme="dark"] .master-detail-panel .sales-area-base-card strong,
html[data-theme="dark"] .master-detail-panel .detail-metric-grid strong,
html[data-theme="dark"] .master-detail-panel .detail-chip-section h2 {
  color: #f2f2f2 !important;
}
html[data-theme="dark"] .master-detail-panel .sales-area-detail-hero p,
html[data-theme="dark"] .master-detail-panel .sales-area-base-card small,
html[data-theme="dark"] .master-detail-panel .detail-metric-grid small {
  color: #b5b5b5 !important;
}
html[data-theme="dark"] .master-detail-panel .sales-area-base-card,
html[data-theme="dark"] .master-detail-panel .detail-metric-grid > div {
  background: #111 !important;
  border-color: #383838 !important;
}
html[data-theme="dark"] .master-detail-panel .detail-chip {
  background: #151515 !important;
  border-color: #3a3a3a !important;
  color: #e8e8e8 !important;
}
html[data-theme="dark"] .master-detail-panel .detail-chip.is-base {
  background: color-mix(in srgb, var(--sales-area-color) 24%, #111) !important;
  border-color: var(--sales-area-color) !important;
}
html[data-theme="dark"] .master-detail-panel .sales-area-color-dot {
  border-color: #242424 !important;
}

html[data-theme="dark"] .birthday-floating-alert > summary {
  border-color: #262626 !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .68) !important;
}
html[data-theme="dark"] .birthday-floating-panel {
  background: #090909 !important;
  border-color: #383838 !important;
  box-shadow: 0 24px 58px rgba(0, 0, 0, .78) !important;
}
html[data-theme="dark"] .birthday-floating-panel > header {
  background: #111 !important;
  border-color: #343434 !important;
}
html[data-theme="dark"] .birthday-floating-panel header h2,
html[data-theme="dark"] .birthday-person-copy strong,
html[data-theme="dark"] .birthday-floating-empty strong { color: #f4f4f4 !important; }
html[data-theme="dark"] .birthday-floating-panel header p,
html[data-theme="dark"] .birthday-person-copy small,
html[data-theme="dark"] .birthday-floating-item time small,
html[data-theme="dark"] .birthday-floating-empty { color: #b8b8b8 !important; }
html[data-theme="dark"] .birthday-floating-item { border-color: #2d2d2d !important; }
html[data-theme="dark"] .birthday-floating-item.is-today { background: #17130b !important; }
html[data-theme="dark"] .birthday-person-icon { background: #241a0c !important; color: #ffb64f !important; }
html[data-theme="dark"] .birthday-floating-panel header button { color: #dedede !important; }
html[data-theme="dark"] .birthday-floating-panel header button:hover { background: #242424 !important; }
html[data-theme="dark"] .contract-expiry-floating-panel > header { background: #111 !important; }
html[data-theme="dark"] .contract-expiry-item.is-critical { background: #21100f !important; }
html[data-theme="dark"] .contract-expiry-item.is-warning { background: #1c170e !important; }
html[data-theme="dark"] .contract-expiry-icon { background: #291310 !important; color: #ff8b80 !important; }
html[data-theme="dark"] .contract-expiry-open { color: #ff8b80 !important; }
html[data-theme="dark"] .contract-expiry-open:hover { background: #2d1513 !important; }

/* Newsletter activity multi-select: keep every interactive surface legible in dark mode. */
html[data-theme="dark"] body .newsletter-export .activity-multiselect-dropdown > summary,
html[data-theme="dark"] body .newsletter-export .activity-multiselect-menu {
  background-color: #0d0d0d !important;
  background-image: none !important;
  border-color: #444 !important;
  color: #f2f2f2 !important;
}
html[data-theme="dark"] body .newsletter-export .activity-multiselect-dropdown[open] > summary {
  border-color: #6da8f5 !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, .2) !important;
}
html[data-theme="dark"] body .newsletter-export .activity-multiselect-dropdown > summary :is(span, i),
html[data-theme="dark"] body .newsletter-export .activity-multiselect-option,
html[data-theme="dark"] body .newsletter-export .activity-multiselect-option span {
  color: #f2f2f2 !important;
}
html[data-theme="dark"] body .newsletter-export .activity-multiselect-option:hover,
html[data-theme="dark"] body .newsletter-export .activity-multiselect-option.is-selected {
  background-color: #19355b !important;
  background-image: none !important;
  color: #d7e9ff !important;
}
html[data-theme="dark"] body .newsletter-export .activity-multiselect-all {
  border-color: #444 !important;
}
html[data-theme="dark"] body .newsletter-export .activity-multiselect-option input[type="checkbox"] {
  background-color: #090909 !important;
  border-color: #686868 !important;
  color-scheme: dark;
}
html[data-theme="dark"] body .newsletter-export .activity-multiselect-option input[type="checkbox"]:checked {
  background-color: #22c55e !important;
  border-color: #22c55e !important;
}
html[data-theme="dark"] body .newsletter-export .activity-multiselect-clear {
  align-items: center !important;
  background: #181818 !important;
  border: 1px solid #484848 !important;
  color: #b9d9ff !important;
  display: inline-flex !important;
  justify-content: center !important;
}
html[data-theme="dark"] body .newsletter-export .activity-multiselect-clear:hover {
  background: #242424 !important;
  border-color: #6b6b6b !important;
  color: #e1eeff !important;
}
html[data-theme="dark"] body .newsletter-export .activity-multiselect-menu {
  scrollbar-color: #666 #171717;
}

html[data-theme="dark"] .passkey-hero{background:#0a0a0a!important;border-color:#333!important}.passkey-hero p{color:#b8b8b8!important}html[data-theme="dark"] .passkey-security-note{background:#111!important;border-color:#383838!important}html[data-theme="dark"] .passkey-security-note small{color:#aaa!important}html[data-theme="dark"] .passkey-device-icon{background:#15243a!important;color:#9bc7ff!important}html[data-theme="dark"] .passkey-device-copy small{color:#aaa!important}html[data-theme="dark"] .passkey-count{background:#17263d!important;color:#9bc7ff!important}html[data-theme="dark"] .passkey-status.is-working{background:#122640;color:#aed1ff}html[data-theme="dark"] .passkey-status.is-success{background:#102a20;color:#98e1bd}html[data-theme="dark"] .passkey-status.is-error{background:#351817;color:#ffb9b3}html[data-theme="dark"] .passkey-empty,html[data-theme="dark"] .passkey-recovery{color:#aaa!important}

/* POP issue/edit and File Note controls. These components have deliberately
   strong light-theme declarations in macos.css, so their dark equivalents
   must be equally explicit and live in this final contrast layer. */
html[data-theme="dark"] .pop-slip-form .workflow-status-banner.workflow-status-pending {
  background: #201708 !important;
  border-color: #79591f !important;
  color: #ffd58a !important;
}
html[data-theme="dark"] .pop-slip-form .workflow-status-banner.workflow-status-pending :is(i, strong, span) {
  color: inherit !important;
}
html[data-theme="dark"] .pop-slip-view .workflow-status-banner.workflow-status-pending {
  background: #201708 !important;
  border-color: #79591f !important;
  color: #ffd58a !important;
}
html[data-theme="dark"] .pop-slip-view .workflow-status-banner.workflow-status-approved {
  background: #102c21 !important;
  border-color: #285f49 !important;
  color: #91dfb8 !important;
}
html[data-theme="dark"] .pop-slip-view .workflow-status-banner.workflow-status-rejected {
  background: #351716 !important;
  border-color: #753333 !important;
  color: #ffaaa5 !important;
}
html[data-theme="dark"] .pop-slip-view .workflow-status-banner :is(i, strong, span) {
  color: inherit !important;
}
html[data-theme="dark"] .pop-slip-view .pop-slip-view-head span {
  color: #a9b3c2 !important;
}
html[data-theme="dark"] .pop-slip-view .pop-slip-view-head h2 {
  color: #f4f4f4 !important;
}
html[data-theme="dark"] .pop-slip-view .pop-slip-view-head p {
  color: #c6cbd3 !important;
}
html[data-theme="dark"] .pop-slip-view .detail-metric-grid > div {
  background: #111 !important;
  border-color: #383838 !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .pop-slip-view .detail-metric-grid small {
  color: #aeb7c4 !important;
}
html[data-theme="dark"] .pop-slip-view .detail-metric-grid strong {
  color: #f2f2f2 !important;
}
html[data-theme="dark"] .pop-slip-view .detail-metric-grid strong a {
  color: #9bc7ff !important;
}
html[data-theme="dark"] .pop-slip-form :is(.pop-slip-title span, .pop-lines-head span) {
  color: #a9b3c2 !important;
}
html[data-theme="dark"] .pop-ro-address {
  background: #101820 !important;
  border-color: #34485c !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .pop-ro-address-label { color: #9fb0c5 !important; }
html[data-theme="dark"] .pop-ro-address-value { color: #edf3fb !important; }
html[data-theme="dark"] :is(.pop-receiver-address, .pop-slip-footer) {
  background: #101010 !important;
  border-color: #383838 !important;
  color: #ededed !important;
}
html[data-theme="dark"] .pop-slip-view .pop-receiver-address small {
  color: #aeb7c4 !important;
}
html[data-theme="dark"] .pop-slip-view :is(.pop-receiver-address p, .pop-slip-footer span, .pop-slip-footer strong) {
  color: #ededed !important;
}
html[data-theme="dark"] .pop-slip-view .pop-line-table thead th {
  background: #171717 !important;
  border-color: #3a3a3a !important;
  color: #d7dbe2 !important;
}
html[data-theme="dark"] .pop-slip-view .pop-line-table tbody td {
  background: #090909 !important;
  border-color: #333 !important;
  color: #f1f1f1 !important;
}
html[data-theme="dark"] .unit-pill {
  background: #142945 !important;
  border-color: #345f91 !important;
  color: #b9d9ff !important;
}
html[data-theme="dark"] .icon-button {
  background: #151515 !important;
  border-color: #444 !important;
  color: #c9c9c9 !important;
}
html[data-theme="dark"] .icon-button:hover {
  background: #351716 !important;
  border-color: #7f3434 !important;
  color: #ffaaa5 !important;
}

html[data-theme="dark"] :is(.select-dropdown-button, .checkbox-dropdown-button) {
  background: #0d0d0d !important;
  background-image: none !important;
  border-color: #444 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04) !important;
  color: #f2f2f2 !important;
}
html[data-theme="dark"] :is(.select-dropdown.open .select-dropdown-button, .checkbox-dropdown.open .checkbox-dropdown-button) {
  background: #111 !important;
  border-color: #6da8f5 !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, .20) !important;
}
html[data-theme="dark"] :is(.select-dropdown-button, .checkbox-dropdown-button) i {
  color: #aeb9c8 !important;
}
html[data-theme="dark"] .checkbox-dropdown-button .checkbox-dropdown-placeholder {
  color: #aab4c3 !important;
}
html[data-theme="dark"] .checkbox-dropdown-button .checkbox-dropdown-tag {
  background: #173457 !important;
  background-image: none !important;
  border-color: #3f6f9f !important;
  color: #c7e1ff !important;
}
html[data-theme="dark"] .checkbox-dropdown-button .checkbox-dropdown-tag.is-muted {
  background: #202020 !important;
  border-color: #484848 !important;
  color: #c5c5c5 !important;
}
html[data-theme="dark"] :is(.select-dropdown-menu, .checkbox-dropdown-menu) {
  background: #0b0b0b !important;
  border-color: #444 !important;
  box-shadow: 0 20px 44px rgba(0, 0, 0, .72) !important;
}
html[data-theme="dark"] :is(.select-search-input, .checkbox-search-input, .panel .dropdown-search-input, .form-panel .dropdown-search-input) {
  background: #080808 !important;
  background-image: none !important;
  border-color: #444 !important;
  color: #f2f2f2 !important;
}
html[data-theme="dark"] :is(.select-search-input, .checkbox-search-input, .dropdown-search-input)::placeholder {
  color: #949eac !important;
}
html[data-theme="dark"] .checkbox-multiselect-panel {
  background: #0b0b0b !important;
  border-color: #3b3b3b !important;
  scrollbar-color: #666 #151515;
}
html[data-theme="dark"] :is(
  .checkbox-multiselect-panel label,
  .checkbox-option,
  .select-dropdown-option
) {
  background: #141414 !important;
  border-color: #383838 !important;
  color: #e8e8e8 !important;
  box-shadow: none !important;
}
html[data-theme="dark"] :is(
  .checkbox-multiselect-panel label:hover,
  .checkbox-option:hover,
  .select-dropdown-option:hover
) {
  background: #1a2c44 !important;
  border-color: #527baa !important;
  color: #d8eaff !important;
}
html[data-theme="dark"] :is(
  .checkbox-multiselect-panel label:has(input:checked),
  .checkbox-option:has(input:checked),
  .select-dropdown-option.is-selected
) {
  background: #18375d !important;
  border-color: #6194ce !important;
  color: #e1efff !important;
}
html[data-theme="dark"] .checkbox-multiselect-panel label:has(input:disabled) {
  background: #101010 !important;
  color: #858585 !important;
  opacity: .72;
}
html[data-theme="dark"] .checkbox-multiselect-panel input[type="checkbox"] {
  color-scheme: dark;
}

html[data-theme="dark"] .ro-map-toolbar,html[data-theme="dark"] .ro-map-viewport{background:#080808!important;border-color:#333!important}html[data-theme="dark"] .ro-map-kpis>div,html[data-theme="dark"] .ro-map-warehouse-choice{background:#111!important;border-color:#383838!important}html[data-theme="dark"] .ro-map-kpis span,html[data-theme="dark"] .ro-map-toolbar-copy p,html[data-theme="dark"] .ro-map-icon-legend>span,html[data-theme="dark"] .ro-map-sales-legend span,html[data-theme="dark"] .ro-map-footnote,html[data-theme="dark"] .ro-map-warehouse-choice small,html[data-theme="dark"] .ro-map-distance-row small{color:#aaa!important}html[data-theme="dark"] .ro-map-warehouse-choice:hover,html[data-theme="dark"] .ro-map-warehouse-choice.is-selected,html[data-theme="dark"] .ro-map-distance-row:hover{background:#1a1a1a!important;border-color:#666!important}html[data-theme="dark"] .ro-map-district{fill:#151515;stroke:#3a3a3a}html[data-theme="dark"] .ro-map-district.is-ro-scope{fill:#242424}html[data-theme="dark"] .ro-map-district.is-sales-area{fill-opacity:.55}html[data-theme="dark"] .ro-map-bld-marker .ro-map-kind{fill:#fff;stroke:#111}html[data-theme="dark"] .ro-map-filter-form select,html[data-theme="dark"] .ro-map-form-field :is(input,select){background:#080808!important;border-color:#383838!important;color:#f2f2f2!important}
html[data-theme="dark"] .ro-map-warehouse-choice{background:#111!important;border-color:#424242!important;color:#f5f5f5!important}html[data-theme="dark"] .ro-map-warehouse-choice strong{color:#fff!important}html[data-theme="dark"] .ro-map-warehouse-choice small{color:#c5c5c5!important}html[data-theme="dark"] .ro-map-warehouse-choice:hover{background:#191919!important;border-color:#686868!important}html[data-theme="dark"] .ro-map-warehouse-choice.is-selected{background:#2359a8!important;border-color:#72a5f2!important}html[data-theme="dark"] .ro-map-warehouse-choice.is-selected strong{color:#fff!important}html[data-theme="dark"] .ro-map-warehouse-choice.is-selected small{color:#e8f1ff!important}html[data-theme="dark"] .ro-map-form-field textarea{background:#080808!important;border-color:#383838!important;color:#f2f2f2!important}html[data-theme="dark"] .ro-map-officer-kind{fill:#fff;stroke:#111}html[data-theme="dark"] .ro-map-office-complex-marker :is(.ro-map-office-roof,.ro-map-office-body){stroke:#0b0b0b}html[data-theme="dark"] .ro-map-information-card{background:#111!important;border-color:#333!important}
html[data-theme="dark"] .ro-map-pin-face{fill:rgba(255,255,255,.16)}html[data-theme="dark"] .ro-map-distance-label,html[data-theme="dark"] .ro-map-outside-direction{stroke:#080808}html[data-theme="dark"] .ro-map-distance-label{fill:#ff8f87}html[data-theme="dark"] .ro-map-pin-leader{stroke:#777}html[data-theme="dark"] .ro-map-floating-card{background:#090909!important;border-color:#3a3a3a!important;box-shadow:0 20px 50px rgba(0,0,0,.7)!important}html[data-theme="dark"] .ro-map-floating-card header small,html[data-theme="dark"] .ro-map-contact-grid dt,html[data-theme="dark"] .ro-map-performance-card>span,html[data-theme="dark"] .ro-map-performance-card>small{color:#aaa!important}html[data-theme="dark"] .ro-map-contact-grid dd{color:#eee!important}html[data-theme="dark"] .ro-map-performance-card{background:#111!important;border-color:#383838!important}html[data-theme="dark"] .ro-map-performance-card>strong{color:#b9d6ff!important}html[data-theme="dark"] .ro-map-floating-card header button{color:#ccc!important}html[data-theme="dark"] .ro-map-floating-card header button:hover{background:#222!important}html[data-theme="dark"] .ro-map-card-avatar{border-color:#222!important}

/* POP inventory master and transaction ledger */
html[data-theme="dark"] .pop-master-overview,html[data-theme="dark"] .pop-ledger-hero{background:linear-gradient(135deg,#0d2448,#173966 58%,#24549a)!important;border-color:#365e94!important;box-shadow:0 18px 42px rgba(0,0,0,.45)!important}html[data-theme="dark"] .pop-master-kpis>div,html[data-theme="dark"] .pop-master-health span{background:rgba(0,0,0,.28)!important;border-color:rgba(255,255,255,.18)!important}html[data-theme="dark"] .pop-material-placeholder{background:#132640!important;border-color:#294e7d!important;color:#96c1ff!important}html[data-theme="dark"] .pop-material-name small,html[data-theme="dark"] .pop-ledger-heading p,html[data-theme="dark"] .pop-ledger-table td small{color:#aaa!important}html[data-theme="dark"] .pop-stock-status.is-healthy{background:#102d22!important;color:#8fe0b9!important}html[data-theme="dark"] .pop-stock-status.is-low{background:#34260d!important;color:#ffd37d!important}html[data-theme="dark"] .pop-stock-status.is-out{background:#351716!important;color:#ffaaa5!important}html[data-theme="dark"] .pop-stock-meter,html[data-theme="dark"] .pop-qty-visual>span{background:#303030!important}html[data-theme="dark"] .pop-delete-locked{background:#202020!important;color:#8e949c!important}html[data-theme="dark"] .pop-material-form-head{border-color:#343434!important}html[data-theme="dark"] .pop-material-form-head p{color:#aaa!important}html[data-theme="dark"] .pop-material-edit-note{background:#111d2d!important;border-color:#294d78!important;color:#b7d5fb!important}html[data-theme="dark"] .pop-material-linked-note{color:#aaa!important}html[data-theme="dark"] .pop-ledger-kpis article,html[data-theme="dark"] .pop-ledger-filter,html[data-theme="dark"] .pop-ledger-results>div{background:#101010!important;border-color:#343434!important;box-shadow:none!important}html[data-theme="dark"] .pop-ledger-kpis small,html[data-theme="dark"] .pop-ledger-kpis em,html[data-theme="dark"] .pop-ledger-results small{color:#aaa!important}html[data-theme="dark"] .pop-ledger-kpis .is-opening{background:#142745!important;color:#9ac4ff!important}html[data-theme="dark"] .pop-ledger-kpis .is-issued{background:#34200f!important;color:#ffc080!important}html[data-theme="dark"] .pop-ledger-kpis .is-available{background:#102b20!important;color:#8cdcb5!important}html[data-theme="dark"] .pop-ledger-kpis .is-usage{background:#251b3d!important;color:#c6aaff!important}html[data-theme="dark"] .pop-ledger-filter-field :is(input,select){background:#080808!important;border-color:#424242!important;color:#f2f2f2!important;color-scheme:dark}html[data-theme="dark"] .pop-source-badge.is-slip{background:#102c21!important;color:#94dfba!important}html[data-theme="dark"] .pop-source-badge.is-legacy{background:#251b3c!important;color:#c9b0ff!important}html[data-theme="dark"] .pop-balance-chip{background:#142746!important;color:#acd0ff!important}html[data-theme="dark"] .pop-ledger-legacy{background:#222!important;color:#bbb!important}html[data-theme="dark"] .pop-ledger-empty strong{color:#eee!important}
