/* ==========================================================================
   BenchMark BG Trader - LIGHT theme
   Activated by <html data-theme="light"> (header toggle, saved in localStorage 'bm-theme').
   Loaded last (zz- prefix => after style.css / telerik.css), changes colors only.
   Page background #f0f0f0, texts in the app's green (--theme-primary family).
   ========================================================================== */

html[data-theme="light"],
html[data-theme="light"] body {
    color-scheme: light;

    --theme-primary: #376456;
    --theme-primary-hover: #437a69;
    --theme-primary-active: #2b5044;
    --theme-primary-light: #528f7c;
    --theme-primary-glow: rgba(55, 100, 86, 0.30);
    --theme-primary-subtle: rgba(55, 100, 86, 0.12);

    --bg-page: #f0f0f0;
    --bg-shell: #f0f0f0;
    --bg-header: #e7ebe9;
    --bg-toolbar: #e4e9e6;
    --bg-card: #fafbfa;
    --bg-card-header: #e1e8e4;
    --bg-card-alt: #f3f6f4;
    --bg-card-hover: #e3eee9;
    --bg-card-selected: #d2e5dc;
    --bg-grid-header: #d5e3dc;
    --bg-grid-header-hover: #c3d8cd;

    --bg-input: #ffffff;
    --bg-dropdown: #ffffff;
    --bg-modal: #f7f8f7;
    --bg-overlay: rgba(240, 240, 240, 0.8);

    --border-subtle: rgba(55, 100, 86, 0.14);
    --border-card: #c9d6cf;
    --border-input: #b4c7bd;
    --border-dropdown: #b4c7bd;

    --text-primary: #123226;
    --text-secondary: #245244;
    --text-muted: #3f6b5b;
    --text-dim: #5a8272;

    --accent-green: #0b8a5f;
    --accent-red: #d93636;
    --accent-red-bg: rgba(217, 54, 54, 0.12);

    --scrollbar-thumb: #b4c7bd;
    --scrollbar-track: #f0f0f0;

    --shadow-card: 0 2px 10px -2px rgba(55, 100, 86, 0.18);
    --shadow-dropdown: 0 8px 24px rgba(55, 100, 86, 0.22);
    --shadow-modal: 0 18px 44px -10px rgba(55, 100, 86, 0.35);

    --quote-change-highlight: rgba(250, 204, 21, 0.35);
}

/* ---- Popups / RadWindow surfaces that were hard-coded #13221c ---- */
html[data-theme="light"].popup-html,
html[data-theme="light"] body.popup-body,
html[data-theme="light"]:has(.popup-container),
html[data-theme="light"] body:has(.popup-container),
html[data-theme="light"]:has(.dialog-container),
html[data-theme="light"] body:has(.dialog-container),
html[data-theme="light"]:has(.settings-modal-wrapper),
html[data-theme="light"] body:has(.settings-modal-wrapper),
html[data-theme="light"]:has(.properties-container),
html[data-theme="light"] body:has(.properties-container),
html[data-theme="light"] form.popup-form,
html[data-theme="light"] form#form1.popup-form,
html[data-theme="light"] body.popup-body form,
html[data-theme="light"] form:has(.popup-container),
html[data-theme="light"] form#form1:has(.popup-container),
html[data-theme="light"] form:has(.settings-modal-wrapper),
html[data-theme="light"] form#form1:has(.settings-modal-wrapper),
html[data-theme="light"] form:has(.properties-container),
html[data-theme="light"] form#form1:has(.properties-container),
html[data-theme="light"] form:has(.dialog-container),
html[data-theme="light"] form#form1:has(.dialog-container),
html[data-theme="light"] .popup-container,
html[data-theme="light"] .properties-container,
html[data-theme="light"] .settings-modal-wrapper,
html[data-theme="light"] .dialog-container,
html[data-theme="light"] .RadWindow,
html[data-theme="light"] .RadWindow_Default,
html[data-theme="light"] .RadWindow .rwWindowRow,
html[data-theme="light"] .RadWindow .rwContentRow,
html[data-theme="light"] .RadWindow td.rwWindowContent,
html[data-theme="light"] .RadWindow div.rwWindowContent,
html[data-theme="light"] .RadWindow_Default td.rwWindowContent,
html[data-theme="light"] .RadWindow_Default div.rwWindowContent,
html[data-theme="light"] .RadWindow iframe,
html[data-theme="light"] .RadWindow_Default iframe,
html[data-theme="light"] iframe.rwExternalContent,
html[data-theme="light"] .popup-container .properties-container,
html[data-theme="light"] .popup-container table.properties,
html[data-theme="light"] .properties-container table.properties,
html[data-theme="light"] .properties,
html[data-theme="light"] td.rwWindowContent,
html[data-theme="light"] div.rwWindowContent {
    background-color: #f7f8f7 !important;
    background: #f7f8f7 !important;
    scrollbar-color: var(--scrollbar-thumb) #f7f8f7 !important;
}
html[data-theme="light"] .properties,
html[data-theme="light"] .popup-container,
html[data-theme="light"] .dialog-container,
html[data-theme="light"] .settings-modal-wrapper {
    color: var(--text-primary) !important;
}
html[data-theme="light"] .properties.order,
html[data-theme="light"] .properties.order tr.row {
    background: transparent !important;
    background-color: transparent !important;
}

/* ---- Hard-coded text colors (light-on-dark in the Dark theme) ---- */
html[data-theme="light"] .properties td.name,
html[data-theme="light"] .properties.order td.name,
html[data-theme="light"] label,
html[data-theme="light"] .settings-label {
    color: var(--text-secondary) !important;
}
html[data-theme="light"] body,
html[data-theme="light"] .popup-container label,
html[data-theme="light"] .popup-container td,
html[data-theme="light"] .popup-container th,
html[data-theme="light"] .popup-container p,
html[data-theme="light"] .popup-container li,
html[data-theme="light"] .popup-container strong,
html[data-theme="light"] .properties td.value,
html[data-theme="light"] .rgMasterTable td,
html[data-theme="light"] .RadGrid td,
html[data-theme="light"] .RadGrid_Default td,
html[data-theme="light"] .rgRow td,
html[data-theme="light"] .rgAltRow td {
    color: var(--text-primary) !important;
}
html[data-theme="light"] .RadGrid th,
html[data-theme="light"] .RadGrid th a,
html[data-theme="light"] .RadGrid_Default th,
html[data-theme="light"] .rgHeader,
html[data-theme="light"] .rgHeader a {
    color: var(--text-primary) !important;
}
html[data-theme="light"] .rgRow td,
html[data-theme="light"] .rgAltRow td {
    border-top-color: rgba(55, 100, 86, 0.08) !important;
    border-bottom-color: rgba(55, 100, 86, 0.14) !important;
    border-left-color: rgba(55, 100, 86, 0.06) !important;
    border-right-color: rgba(55, 100, 86, 0.06) !important;
}
html[data-theme="light"] .rgSelectedRow td,
html[data-theme="light"] .rgHoveredRow td {
    color: #1f3d33 !important;
}

/* Inputs / selects / comboboxes */
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] textarea,
html[data-theme="light"] select,
html[data-theme="light"] .riTextBox,
html[data-theme="light"] .rcbInput,
html[data-theme="light"] .rcbInputCell input,
html[data-theme="light"] .RadInput input,
html[data-theme="light"] .RadComboBox input {
    color: var(--text-primary) !important;
    background-color: #ffffff !important;
    border-color: var(--border-input) !important;
}
html[data-theme="light"] select option,
html[data-theme="light"] select optgroup {
    background: #ffffff !important;
    color: var(--text-primary) !important;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
    color: var(--text-dim) !important;
}
/* dropdown arrow icons were light-grey SVG on dark: swap to green */
html[data-theme="light"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23376456' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
}

/* Combo / menu dropdown lists */
html[data-theme="light"] .rcbList li,
html[data-theme="light"] .rcbItem,
html[data-theme="light"] .rcbHovered,
html[data-theme="light"] .rcbSlide,
html[data-theme="light"] .RadComboBoxDropDown,
html[data-theme="light"] .rmItem .rmLink,
html[data-theme="light"] .rmText,
html[data-theme="light"] .RadMenu .rmLink,
html[data-theme="light"] .RadContextMenu .rmLink {
    color: var(--text-primary) !important;
}
html[data-theme="light"] .rcbHovered,
html[data-theme="light"] .rmFocused .rmLink,
html[data-theme="light"] .rmSelected .rmLink,
html[data-theme="light"] .rmLink:hover {
    color: #1f3d33 !important;
}

/* Buttons: keep white text on solid green/red; neutral buttons get green text */
html[data-theme="light"] input[type="button"],
html[data-theme="light"] input[type="submit"],
html[data-theme="light"] button {
    color: #ffffff;
}

/* Scrollbars */
html[data-theme="light"] ::-webkit-scrollbar-track { background: #f0f0f0 !important; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #b4c7bd !important; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #8fb0a3 !important; }

/* Thin white borders used as separators on dark => green tint on light */
html[data-theme="light"] hr {
    border-color: rgba(55, 100, 86, 0.2) !important;
    background: rgba(55, 100, 86, 0.2) !important;
}

/* ==========================================================================
   Hard-coded dark surfaces / light texts, by component
   ========================================================================== */
/* Header pills, language / scale / theme toggles */
html[data-theme="light"] .language-pill-toggle .language-link,
html[data-theme="light"] .language-pill-toggle .lang-btn { color: var(--text-muted) !important; }
html[data-theme="light"] .language-pill-toggle .language-link.active,
html[data-theme="light"] .language-pill-toggle .language-link:hover,
html[data-theme="light"] .language-pill-toggle .lang-btn.active,
html[data-theme="light"] .language-pill-toggle .lang-btn:hover {
    color: #ffffff !important;
    background: var(--theme-primary) !important;
}
html[data-theme="light"] .lang-sep { color: var(--text-dim) !important; }
html[data-theme="light"] .header-menu-item,
html[data-theme="light"] .language-pill-toggle,
html[data-theme="light"] .user-account-badge,
html[data-theme="light"] .modern-status-pill,
html[data-theme="light"] .modern-time-pill {
    border-color: var(--border-card) !important;
}
html[data-theme="light"] .status-text,
html[data-theme="light"] .user-id,
html[data-theme="light"] .server-time-box,
html[data-theme="light"] .header-menu-item a,
html[data-theme="light"] .header-nav-menu a {
    color: var(--text-secondary) !important;
}
html[data-theme="light"] .modern-header-logo img,
html[data-theme="light"] .header-brand-container img {
    filter: none !important;
}
.login-alert.error, .error {
  color: #994343;
}

/* Tabs / toolbars (RadToolBar, RadTabStrip) */
html[data-theme="light"] .RadToolBar .rtbText,
html[data-theme="light"] .RadTabStrip .rtsTxt,
html[data-theme="light"] .workspace-toolbar .rtbText,
html[data-theme="light"] .RadTabStrip .rtsLink {
    color: var(--text-secondary) !important;
}
html[data-theme="light"] .RadToolBar .rtbSelected .rtbText,
html[data-theme="light"] .RadToolBar .rtbItem.rtbSelected .rtbText,
html[data-theme="light"] .RadTabStrip .rtsSelected .rtsTxt,
html[data-theme="light"] .RadTabStrip .rtsLink.rtsSelected .rtsTxt,
html[data-theme="light"] .RadToolBar a.rtbSelected .rtbText {
    color: #ffffff !important;
}

/* Dock modules: titles, close/min icons, panel info boxes */
html[data-theme="light"] .RadDock em,
html[data-theme="light"] .rdTitleBar em,
html[data-theme="light"] .RadWindow .rwTitleRow em {
    color: var(--text-primary) !important;
}
html[data-theme="light"] .info-box { color: var(--text-secondary) !important; border-top-color: var(--border-card) !important; }
html[data-theme="light"] .info-box span { color: var(--text-primary) !important; }
html[data-theme="light"] .rgWrap,
html[data-theme="light"] .RadGrid .rgInfoPart,
html[data-theme="light"] .RadGrid_Default .rgInfoPart,
html[data-theme="light"] .RadGrid .rgInfoPart *,
html[data-theme="light"] .RadGrid .rgPager td,
html[data-theme="light"] .RadGrid .rgPager span { color: var(--text-secondary) !important; }
html[data-theme="light"] .RadGrid .rgInfoPart strong { color: var(--text-primary) !important; }
html[data-theme="light"] .RadGrid th,
html[data-theme="light"] .RadGrid th a,
html[data-theme="light"] .rgHeader { color: var(--text-primary) !important; }

/* Index boxes (Indices strip) */
html[data-theme="light"] .index-box { background: #ffffff !important; border-color: var(--border-card) !important; }
html[data-theme="light"] .index-box .code-cell, html[data-theme="light"] #code { color: var(--text-primary) !important; }
html[data-theme="light"] .index-box .value-cell, html[data-theme="light"] #value { color: var(--text-secondary) !important; }
html[data-theme="light"] .index-box .change-cell.going-up { color: var(--accent-green) !important; }
html[data-theme="light"] .index-box .change-cell.going-down { color: var(--accent-red) !important; }

/* Chat */
html[data-theme="light"] .chat-container { background: #f7f8f7 !important; }
html[data-theme="light"] .chat-container .RadGrid th.rgHeader {
    background: var(--bg-grid-header) !important;
    border-bottom-color: var(--border-card) !important;
    color: var(--text-primary) !important;
}
html[data-theme="light"] .chat-input-row,
html[data-theme="light"] .chat-container .info-box { background: #e4e9e6 !important; border-top-color: var(--border-card) !important; }
html[data-theme="light"] .chat-empty-text { color: var(--text-muted) !important; }
html[data-theme="light"] .chat-empty-icon { background: rgba(55,100,86,.06) !important; border-color: var(--border-card) !important; }
html[data-theme="light"] .chat-container .RadGrid tr.incoming-message td,
html[data-theme="light"] .chat-container .RadGrid tr.incoming-message {
    background: #ffffff !important; color: var(--text-primary) !important; border-bottom-color: var(--border-card) !important;
}
html[data-theme="light"] .chat-container .RadGrid tr.outgoing-message td,
html[data-theme="light"] .chat-container .RadGrid tr.outgoing-message {
    background: #d2e5dc !important; color: #1f3d33 !important; border-bottom-color: var(--border-card) !important;
}
html[data-theme="light"] .chat-container .RadGrid tr.incoming-message:hover td { background: #eef4f1 !important; }
html[data-theme="light"] .chat-container .RadGrid tr.outgoing-message:hover td { background: #c3dbd0 !important; }
html[data-theme="light"] .chat-container .RadGrid tr.incoming-message td[class*="Date"],
html[data-theme="light"] .chat-container .RadGrid tr.outgoing-message td[class*="Date"] { color: var(--text-muted) !important; }
html[data-theme="light"] .chat-input-row .riTextBox,
html[data-theme="light"] .chat-container .info-box .riTextBox { background: #ffffff !important; color: var(--text-primary) !important; border-color: var(--border-input) !important; }

/* Share type badge (equities blue -> green family keeps readable) */
html[data-theme="light"] .share-type-badge.st-equities { color: #0b7a8f !important; }

/* Pager / numeric pager buttons */
html[data-theme="light"] .RadGrid .rgPager .rgNumPart a,
html[data-theme="light"] .RadGrid .rgPager .rgNumPart a span { color: var(--text-secondary) !important; }
html[data-theme="light"] .RadGrid .rgPager .rgNumPart a.rgCurrentPage span,
html[data-theme="light"] .RadGrid .rgPager .rgNumPart a.rgCurrentPage:hover span { color: #ffffff !important; }

/* Empty grid message row (white row in dark) */
html[data-theme="light"] .rgNoRecords td,
html[data-theme="light"] .rgNoRecords { background: transparent !important; color: var(--text-muted) !important; }

/* ---- Selected tabs / toolbar buttons (green fill, white text) ---- */
html[data-theme="light"] .RadToolBar .rtbChecked .rtbText,
html[data-theme="light"] .RadToolBar .rtbItem.rtbChecked .rtbText,
html[data-theme="light"] .workspace-toolbar .rtbChecked .rtbText,
html[data-theme="light"] .RadToolBar .rtbItem.rtbChecked a,
html[data-theme="light"] .RadTabStrip .rtsLink.rtsSelected,
html[data-theme="light"] .RadTabStrip a.rtsSelected,
html[data-theme="light"] .RadTabStrip .rtsSelected .rtsTxt,
html[data-theme="light"] .RadTabStrip_Default .rtsLink.rtsSelected,
html[data-theme="light"] .RadTabStrip_Dark .rtsLink.rtsSelected {
    color: #ffffff !important;
}
html[data-theme="light"] .RadTabStrip .rtsLink.rtsSelected,
html[data-theme="light"] .RadTabStrip a.rtsSelected,
html[data-theme="light"] .RadTabStrip .rtsSelected,
html[data-theme="light"] .RadTabStrip .rtsLI.rtsSelected .rtsLink,
html[data-theme="light"] .RadTabStrip_Default .rtsLink.rtsSelected,
html[data-theme="light"] .RadTabStrip_Default a.rtsSelected,
html[data-theme="light"] .RadTabStrip_Dark .rtsLink.rtsSelected {
    background: var(--theme-primary) !important;
    border-top-color: var(--theme-primary) !important;
    border-left-color: var(--theme-primary) !important;
    border-right-color: var(--theme-primary) !important;
    border-bottom-color: #10b981 !important;
    box-shadow: 0 -2px 8px rgba(55, 100, 86, 0.25) !important;
}
html[data-theme="light"] .RadTabStrip .rtsLink:not(.rtsSelected) {
    border-color: var(--border-card) !important;
}

/* ---- Combo input (empty message, opacity) ---- */
html[data-theme="light"] .RadComboBox .rcbEmptyMessage,
html[data-theme="light"] .RadComboBox_Default .rcbEmptyMessage,
html[data-theme="light"] .rcbEmptyMessage,
html[data-theme="light"] input.rcbEmptyMessage,
html[data-theme="light"] .RadComboBox .rcbInput,
html[data-theme="light"] .RadComboBox_Default .rcbInput,
html[data-theme="light"] input.rcbInput {
    color: var(--text-secondary) !important;
    opacity: 1 !important;
    background-color: transparent !important;
}
html[data-theme="light"] .RadComboBox .rcbReadOnly .rcbInputCell,
html[data-theme="light"] .RadComboBox .rcbInputCell,
html[data-theme="light"] .RadComboBox_Default .rcbInputCell {
    background-color: #ffffff !important;
    border-color: var(--border-input) !important;
}
html[data-theme="light"] input:disabled,
html[data-theme="light"] input[disabled],
html[data-theme="light"] .riDisabled,
html[data-theme="light"] .RadInput_Default .riDisabled {
    background-color: #e6ebe8 !important;
    color: var(--text-muted) !important;
    opacity: 1 !important;
}

/* ---- Surfaces with hard-coded translucent tints / black shadows ---- */
html[data-theme="light"] .RadDock,
html[data-theme="light"] .RadDock_Default {
    background-color: #fafbfa !important;
    border-color: var(--border-card) !important;
    box-shadow: var(--shadow-card) !important;
}
html[data-theme="light"] .RadWindow,
html[data-theme="light"] .RadWindow_Default {
    box-shadow: var(--shadow-modal) !important;
    border-color: var(--border-card) !important;
}
html[data-theme="light"] .rdTitleBar,
html[data-theme="light"] .rdTop,
html[data-theme="light"] .rwTitlebar,
html[data-theme="light"] .rwTitlebarControls,
html[data-theme="light"] .rwTitleRow {
    background: #d5e3dc  /*#e4e9e6*/ !important;
    background-color: /*#e4e9e6*/ #d5e3dc !important;
}
html[data-theme="light"] .rwTitleRow em { color: var(--text-primary) !important; }
html[data-theme="light"] .RadWindow .rwControlButtons a { filter: brightness(0.45) sepia(0.5) hue-rotate(100deg) saturate(1.5); }
html[data-theme="light"] .rdCommands a { filter: brightness(0.45) sepia(0.5) hue-rotate(100deg) saturate(1.5); }

/* ---- Order / Mass order cards, login role bar, modal overlay, misc ---- */
html[data-theme="light"] .properties.order td.value > table,
html[data-theme="light"] .order-form .order-summary,
html[data-theme="light"] .login-roles-bar {
    background: #ffffff !important;
    border-color: var(--border-card) !important;
    box-shadow: none !important;
}
html[data-theme="light"] .properties.order td.value > table tr:first-child td,
html[data-theme="light"] .properties.order a[id$="_LnkTerms"] { color: var(--text-secondary) !important; }
html[data-theme="light"] .properties.order td.value > table tr:last-child td,
html[data-theme="light"] .properties.order a[id$="_LnkTerms"]:hover { color: var(--text-primary) !important; }
html[data-theme="light"] .properties.order .disabled,
html[data-theme="light"] .properties.order td.name.disabled { color: var(--text-muted) !important; }
html[data-theme="light"] input[type="checkbox"]:hover { background: #e3eee9 !important; box-shadow: 0 0 0 3px rgba(55,100,86,.18) !important; }
html[data-theme="light"] .TelerikModalOverlay { background-color: #f0f0f0 !important; opacity: 0.7 !important; }
html[data-theme="light"] .RadWindow .rwDialogPopup input[type="text"]:focus { background: #ffffff !important; }

/* ---- AI summary popup, order form labels, calendar ---- */
html[data-theme="light"] .portfolio-ai-content,
html[data-theme="light"] .portfolio-ai-content h1,
html[data-theme="light"] .portfolio-ai-content h2,
html[data-theme="light"] .portfolio-ai-content h3,
html[data-theme="light"] .portfolio-ai-content p,
html[data-theme="light"] .portfolio-ai-content li,
html[data-theme="light"] .portfolio-ai-content strong,
html[data-theme="light"] .portfolio-ai-content span { color: var(--text-primary) !important; }
html[data-theme="light"] .portfolio-ai-content hr { border-color: var(--border-card) !important; background: var(--border-card) !important; }
html[data-theme="light"] .order-form .order-label,
html[data-theme="light"] .order-form .order-range-label,
html[data-theme="light"] .order-form .order-total-label { color: var(--text-secondary) !important; }
html[data-theme="light"] .order-form .order-range-value,
html[data-theme="light"] .order-form .order-total-value { color: var(--text-primary) !important; }
html[data-theme="light"] .RadCalendar,
html[data-theme="light"] .RadCalendar_Default { background: #ffffff !important; border-color: var(--border-card) !important; }
html[data-theme="light"] .RadCalendar .rcTitlebar,
html[data-theme="light"] .RadCalendar .rcMain,
html[data-theme="light"] .RadCalendar tr.rcWeek td { background: #e4e9e6 !important; color: var(--text-primary) !important; }
html[data-theme="light"] .RadCalendar .rcTitlebar a,
html[data-theme="light"] .RadCalendar .rcRow td a,
html[data-theme="light"] .RadCalendar a { color: var(--text-primary) !important; }
html[data-theme="light"] .RadCalendar .rcRow td { background: #ffffff !important; }
html[data-theme="light"] .RadCalendar .rcRow td:hover a { background: var(--bg-card-hover) !important; }
html[data-theme="light"] .RadCalendar td.rcSelected a { background: var(--theme-primary) !important; color: #ffffff !important; }
html[data-theme="light"] select {
    background-repeat: no-repeat !important;
    background-position: right 7px center !important;
    background-size: 10px 10px !important;
}

/* ---- Menus inside popups, links ---- */
html[data-theme="light"] .popup-container .rmText,
html[data-theme="light"] .popup-container .RadMenu .rmText,
html[data-theme="light"] .popup-container .RadMenu .rmLink,
html[data-theme="light"] .popup-container a,
html[data-theme="light"] .properties a { color: var(--text-secondary) !important; }
html[data-theme="light"] .popup-container .rmSelected .rmText,
html[data-theme="light"] .popup-container .rmLink:hover .rmText,
html[data-theme="light"] .popup-container .rmFocused .rmText { color: #ffffff !important; }
html[data-theme="light"] td.going-up, html[data-theme="light"] .going-up { color: var(--accent-green) !important; }

/* ---- Select / combo borders & input text/placeholder (v2) ---- */
html[data-theme="light"] input.riTextBox,
html[data-theme="light"] input.riTextBox.riEnabled,
html[data-theme="light"] input.riTextBox.riFocused,
html[data-theme="light"] input.riTextBox.riHover,
html[data-theme="light"] .RadInput input.riTextBox,
html[data-theme="light"] .RadInput_Dark input.riTextBox {
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    background-color: #ffffff !important;
    border: 1px solid var(--border-input) !important;
    box-shadow: none !important;
}
html[data-theme="light"] input.riTextBox.riDisabled,
html[data-theme="light"] input.riTextBox:disabled {
    -webkit-text-fill-color: var(--text-muted) !important;
    background-color: #e6ebe8 !important;
}
html[data-theme="light"] input.riTextBox.riEmpty,
html[data-theme="light"] input.riTextBox.riEmpty:focus {
    color: var(--text-muted) !important;
    -webkit-text-fill-color: var(--text-muted) !important;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: var(--text-muted) !important; opacity: 1 !important; -webkit-text-fill-color: var(--text-muted) !important; }
html[data-theme="light"] input.riTextBox:focus,
html[data-theme="light"] select:focus {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 3px rgba(55,100,86,.18) !important;
}

/* RadComboBox: one clean border on the wrapper, no inner borders / dark shadow */
html[data-theme="light"] .RadComboBox,
html[data-theme="light"] .RadComboBox_Dark,
html[data-theme="light"] .RadComboBox_Default {
    background-color: #ffffff !important;
    border: 1px solid var(--border-input) !important;
    box-shadow: none !important;
    border-radius: 6px !important;
    overflow: hidden;
}
html[data-theme="light"] .RadComboBox:hover,
html[data-theme="light"] .RadComboBox.rcbFocused,
html[data-theme="light"] .RadComboBox_Dark.rcbFocused { border-color: var(--theme-primary) !important; box-shadow: 0 0 0 3px rgba(55,100,86,.15) !important; }
html[data-theme="light"] .RadComboBox .rcbInputCell,
html[data-theme="light"] .RadComboBox .rcbArrowCell,
html[data-theme="light"] .RadComboBox .rcbReadOnly .rcbInputCell,
html[data-theme="light"] .RadComboBox .rcbInputCellLeft,
html[data-theme="light"] .RadComboBox .rcbArrowCellRight,
html[data-theme="light"] .RadComboBox .rcbArrowCellHidden {
    border: 0 !important;
    box-shadow: none !important;
    background-color: #ffffff !important;
}
html[data-theme="light"] .RadComboBox .rcbArrowCell a { filter: brightness(.45) sepia(.5) hue-rotate(100deg) saturate(1.5); }
html[data-theme="light"] .RadComboBoxDropDown,
html[data-theme="light"] .RadComboBoxDropDown_Dark {
    background: #ffffff !important;
    border: 1px solid var(--border-input) !important;
    box-shadow: var(--shadow-dropdown) !important;
}
/* Native selects */
html[data-theme="light"] select {
    border: 1px solid var(--border-input) !important;
    box-shadow: none !important;
    background-color: #ffffff !important;
}
/* Date picker buttons / calendar popup button */
html[data-theme="light"] .RadPicker .rcCalPopup,
html[data-theme="light"] .rcCalPopup { border: 1px solid var(--border-input) !important; }
html[data-theme="light"] .info-box input[type="submit"]:disabled,
html[data-theme="light"] .info-box input[type="button"]:disabled,
html[data-theme="light"] .info-box button:disabled { background: #e1e8e4 !important; color: var(--text-muted) !important; border-color: var(--border-card) !important; opacity: 1 !important; }

/* ---- High-specificity text color for every text input (beats component-specific dark rules) ---- */
html[data-theme="light"] body input[type="text"]:not(#_x),
html[data-theme="light"] body input[type="password"]:not(#_x),
html[data-theme="light"] body input[type="search"]:not(#_x),
html[data-theme="light"] body input.rcbInput:not(#_x),
html[data-theme="light"] body textarea:not(#_x) {
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}
html[data-theme="light"] body input.rcbInput:not(#_x),
html[data-theme="light"] body input.riEmpty:not(#_x),
html[data-theme="light"] body input.rcbEmptyMessage:not(#_x) {
    -webkit-text-fill-color: var(--text-secondary) !important;
    color: var(--text-secondary) !important;
}
html[data-theme="light"] body input:disabled:not(#_x) {
    color: var(--text-muted) !important;
    -webkit-text-fill-color: var(--text-muted) !important;
}
html[data-theme="light"] body input[type="submit"]:disabled:not(#_x),
html[data-theme="light"] body input[type="button"]:disabled:not(#_x),
html[data-theme="light"] body button:disabled:not(#_x) {
    background: #e1e8e4 !important;
    color: var(--text-muted) !important;
    -webkit-text-fill-color: var(--text-muted) !important;
    border: 1px solid var(--border-card) !important;
    opacity: 1 !important;
}

/* ---- Secondary (outline) buttons in filter rows / info boxes ---- */
html[data-theme="light"] body .filter-box input[type="submit"]:not(#_x),
html[data-theme="light"] body .filter-box input[type="button"]:not(#_x),
html[data-theme="light"] body .filter-box button:not(#_x),
html[data-theme="light"] body .info-box input[type="button"]:not(#_x):not(.btn-primary),
html[data-theme="light"] body .chart-controls-bar input[type="button"]:not(#_x) {
    background: #ffffff !important;
    color: var(--theme-primary) !important;
    -webkit-text-fill-color: var(--theme-primary) !important;
    border: 1px solid var(--border-input) !important;
    box-shadow: none !important;
}
html[data-theme="light"] body .filter-box input[type="submit"]:hover:not(#_x),
html[data-theme="light"] body .filter-box input[type="button"]:hover:not(#_x),
html[data-theme="light"] body .filter-box button:hover:not(#_x) {
    background: var(--theme-primary) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-color: var(--theme-primary) !important;
}
html[data-theme="light"] body .filter-box input:disabled:not(#_x),
html[data-theme="light"] body .filter-box button:disabled:not(#_x) {
    background: #e1e8e4 !important;
    color: var(--text-muted) !important;
    -webkit-text-fill-color: var(--text-muted) !important;
}

/* ---- Header: white PNG icons -> green; empty index template box must not show as a white block ---- */
html[data-theme="light"] .header-nav-menu a img,
html[data-theme="light"] .header-menu-item img,
html[data-theme="light"] a[id$="_LnkAnalysis"] img,
html[data-theme="light"] a[id$="_LnkTariff"] img,
html[data-theme="light"] a[id$="_LnkWithdrawal"] img,
html[data-theme="light"] a[id$="_LnkPortfolioAI"] img,
html[data-theme="light"] a[id$="_LnkHome"] img,
html[data-theme="light"] .quick-button img {
    filter: brightness(0) saturate(100%) invert(31%) sepia(18%) saturate(1100%) hue-rotate(112deg) brightness(92%) !important;
}
html[data-theme="light"] .index-box,
html[data-theme="light"] #indexContainer.index-box {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
html[data-theme="light"] a[id$="_LnkAnalysis"],
html[data-theme="light"] a[id$="_LnkTariff"],
html[data-theme="light"] a[id$="_LnkWithdrawal"],
html[data-theme="light"] a[id$="_LnkPortfolioAI"],
html[data-theme="light"] a[id$="_LnkHome"] { opacity: 0.9 !important; }

/* ---- Context menus, combo hover, calendar title, misc labels ---- */
html[data-theme="light"] body .rmText:not(#_x),
html[data-theme="light"] body .rmItem .rmLink .rmText:not(#_x),
html[data-theme="light"] body .RadMenu .rmSlide .rmText:not(#_x) { color: var(--text-primary) !important; }
html[data-theme="light"] .rmSlide, html[data-theme="light"] .rmGroup, html[data-theme="light"] .RadMenu .rmGroup,
html[data-theme="light"] .RadMenu_ContextMenu .rmGroup, html[data-theme="light"] .RadContextMenu .rmGroup {
    background: #ffffff !important; border-color: var(--border-input) !important; box-shadow: var(--shadow-dropdown) !important;
}
html[data-theme="light"] .rmItem .rmLink:hover, html[data-theme="light"] .rmFocused > .rmLink, html[data-theme="light"] .rmExpanded > .rmLink {
    background: var(--bg-card-hover) !important;
}
html[data-theme="light"] body .rmItem .rmLink:hover .rmText:not(#_x),
html[data-theme="light"] body .rmFocused > .rmLink .rmText:not(#_x) { /*color: #1f3d33 !important;*/ 	color: var(--bg-page) !important; }
html[data-theme="light"] .rcbHovered, html[data-theme="light"] li.rcbHovered,
html[data-theme="light"] .rcbList .rcbHovered { background: var(--bg-card-hover) !important; color: #1f3d33 !important; }
html[data-theme="light"] .rcbList .rcbSelected, html[data-theme="light"] li.rcbSelected { background: var(--bg-card-selected) !important; color: #1f3d33 !important; }
html[data-theme="light"] td.rcTitle, html[data-theme="light"] .RadCalendar .rcTitle { color: var(--text-primary) !important; }
html[data-theme="light"] .RadCalendar .rcTitlebar td { color: var(--text-primary) !important; }
html[data-theme="light"] body label:not(#_x), html[data-theme="light"] body .filter-box span:not(#_x),
html[data-theme="light"] body .info-box span:not(#_x) { color: var(--text-secondary) !important; }
html[data-theme="light"] body .info-box span:not(#_x) { color: var(--text-primary) !important; }

/* ---- Login page ---- */
html[data-theme="light"] body span[id$="_LblTitle"]:not(#_x) { color: var(--text-primary) !important; }
html[data-theme="light"] body .login-label:not(#_x),
html[data-theme="light"] body span[id$="_LabelOTP"]:not(#_x),
html[data-theme="light"] body .login-roles-bar ~ * span:not(#_x) { color: var(--text-secondary) !important; }
html[data-theme="light"] body .login-roles-bar label:not(#_x) { color: var(--text-secondary) !important; }
html[data-theme="light"] body .login-roles-bar input[type="radio"]:checked + label:not(#_x),
html[data-theme="light"] body .login-roles-bar .role-radio.is-selected label:not(#_x),
html[data-theme="light"] body .login-roles-bar .role-radio:has(input[type="radio"]:checked) label:not(#_x) { color: #ffffff !important; }
html[data-theme="light"] body a.btn-cancel:not(#_x), html[data-theme="light"] body .btn-cancel:not(#_x) {
    color: var(--text-secondary) !important; background: #ffffff !important; border: 1px solid var(--border-input) !important;
}
html[data-theme="light"] body a:not(#_x):not(#_y):not(.btn-primary):not(.btn-cancel):not(.language-link):not(.rtsLink):not(.rgCurrentPage) { color: var(--text-secondary); }
html[data-theme="light"] body .properties.order a[id$="_LnkTerms"]:not(#_x) { color: var(--text-secondary) !important; text-decoration: underline; }

/* Theme toggle: moon / sun icons */
.theme-pill-toggle .theme-link { display: inline-flex !important; align-items: center; justify-content: center; line-height: 1; }
.theme-pill-toggle .theme-link svg { display: block; }

/* ---- RadToolTip ---- */
html[data-theme="light"] div.RadToolTip table.rtWrapper td.rtWrapperContent {
    background-color: #ffffff !important;
    border-color: var(--border-input) !important;
    color: var(--text-primary) !important;
}

/* ---- Contrast fixes (scan v3) ---- */
html[data-theme="light"] .share-type-badge.st-equities:not(#_x)      { color: #0b6478 !important; background: rgba(14,116,144,.14) !important; border-color: rgba(11,100,120,.45) !important; }
html[data-theme="light"] .share-type-badge.st-reits:not(#_x)         { color: #86198f !important; background: rgba(168,85,247,.14) !important; border-color: rgba(134,25,143,.4) !important; }
html[data-theme="light"] .share-type-badge.st-bonds:not(#_x)         { color: #8a5a00 !important; background: rgba(245,158,11,.18) !important; border-color: rgba(138,90,0,.45) !important; }
html[data-theme="light"] .share-type-badge.st-compensatory:not(#_x)  { color: #0a6b4b !important; background: rgba(16,185,129,.16) !important; border-color: rgba(10,107,75,.45) !important; }
html[data-theme="light"] .share-type-badge.st-funds:not(#_x)         { color: #3730a3 !important; background: rgba(99,102,241,.14) !important; border-color: rgba(55,48,163,.4) !important; }
html[data-theme="light"] .share-type-badge.st-rights:not(#_x)        { color: #be123c !important; background: rgba(244,63,94,.12) !important; border-color: rgba(190,18,60,.4) !important; }
html[data-theme="light"] .share-type-badge.st-other:not(#_x)         { color: #475569 !important; background: rgba(148,163,184,.2) !important; border-color: rgba(71,85,105,.4) !important; }

html[data-theme="light"] .RadGrid .rgRow td.going-up:not(#_x),
html[data-theme="light"] .RadGrid .rgAltRow td.going-up:not(#_x),
html[data-theme="light"] .RadGrid .rgSelectedRow td.going-up:not(#_x),
html[data-theme="light"] .RadGrid td.going-up:not(#_x) { color: #0a7a53 !important; }
html[data-theme="light"] .RadGrid .rgRow td.going-down:not(#_x),
html[data-theme="light"] .RadGrid .rgAltRow td.going-down:not(#_x),
html[data-theme="light"] .RadGrid .rgSelectedRow td.going-down:not(#_x),
html[data-theme="light"] .RadGrid td.going-down:not(#_x) { color: #c42b2b !important; }

html[data-theme="light"] .ce-ticker:not(#_x) { color: #1f6b55 !important; }
html[data-theme="light"] .order-form .order-terms a[id$="_LnkTerms"]:not(#_x),
html[data-theme="light"] .properties.order a[id$="_LnkTerms"]:not(#_x) { color: var(--text-secondary) !important; }
html[data-theme="light"] .order-form .order-terms a[id$="_LnkTerms"]:hover:not(#_x),
html[data-theme="light"] .properties.order a[id$="_LnkTerms"]:hover:not(#_x) { color: var(--text-primary) !important; }
html[data-theme="light"] .ce-month:not(#_x) { color: #1f6b55 !important; }
html[data-theme="light"] .ce-msg-badge:not(#_x) { color: #0a6b4b !important; }
html[data-theme="light"] .index-box .change-cell.going-up:not(#_x) { color: #0a7a53 !important; }
html[data-theme="light"] .index-box .change-cell.going-down:not(#_x) { color: #c42b2b !important; }

/* ---- Hover on unselected tabs / toolbar items (beats telerik.css/style.css white-on-dark hover) ---- */
html[data-theme="light"] .RadTabStrip .rtsLink:not(.rtsSelected):hover:not(#_x),
html[data-theme="light"] .RadTabStrip_Default .rtsLink:not(.rtsSelected):hover:not(#_x),
html[data-theme="light"] .RadTabStrip_Dark .rtsLink:not(.rtsSelected):hover:not(#_x) {
    color: var(--text-primary) !important;
    background: #dbe9e2 !important;
    background-image: none !important;
    border-color: var(--border-input) !important;
    border-bottom: 2px solid transparent !important;
}
html[data-theme="light"] .RadTabStrip .rtsLink:not(.rtsSelected):hover .rtsTxt:not(#_x),
html[data-theme="light"] .RadTabStrip_Default .rtsLink:not(.rtsSelected):hover .rtsTxt:not(#_x),
html[data-theme="light"] .RadTabStrip_Dark .rtsLink:not(.rtsSelected):hover .rtsTxt:not(#_x) {
    color: var(--text-primary) !important;
}
html[data-theme="light"] .workspace-toolbar .rtbItem:not(.rtbChecked):not(.rtbItemChecked):not(.rtbSelected):hover a.rtbWrap:not(#_x),
html[data-theme="light"] .workspace-toolbar .rtbItemHovered:not(.rtbChecked):not(.rtbItemChecked) a.rtbWrap:not(#_x),
html[data-theme="light"] .workspace-toolbar .rtbItem:not(.rtbChecked):not(.rtbItemChecked):not(.rtbSelected):hover .rtbText:not(#_x) {
    color: var(--text-primary) !important;
    background: #dbe9e2 !important;
    background-image: none !important;
    border-color: var(--border-input) !important;
}
html[data-theme="light"] .RadToolBar .rtbItem:not(.rtbChecked):not(.rtbSelected):hover .rtbText:not(#_x) { color: var(--text-primary) !important; background: transparent !important; }


/* ---- Confirmation / message dialog (Dialog.aspx) in Light theme ---- */
html[data-theme="light"] .dialog-container .dialog-text,
html[data-theme="light"] .dialog-container .dialog-text span,
html[data-theme="light"] .dialog-container .dialog-text label {
    color: var(--text-primary) !important;
}
html[data-theme="light"] .dialog-container .dialog-footer {
    border-top-color: var(--border-input) !important;
}
html[data-theme="light"] .dialog-container .dialog-btn-secondary {
    background: #e6efea !important;
    border-color: var(--border-input) !important;
    color: var(--text-primary) !important;
}
html[data-theme="light"] .dialog-container .dialog-btn-secondary:hover {
    background: #dbe9e2 !important;
    color: var(--text-primary) !important;
}
html[data-theme="light"] .dialog-container .dialog-icon-badge {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
}
html[data-theme="light"] .dialog-container .dialog-icon-badge.warning { color: #b45309 !important; }
html[data-theme="light"] .dialog-container .dialog-icon-badge.question { color: #1d4ed8 !important; }
html[data-theme="light"] .dialog-container .dialog-icon-badge.success { color: #0a7a53 !important; }
html[data-theme="light"] .dialog-container .dialog-icon-badge.error { color: #c42b2b !important; }
html[data-theme="light"] .dialog-container .dialog-icon-badge.info { color: #0369a1 !important; }

/* ---- Telerik radprompt / radconfirm / radalert popups in Light theme ---- */
html[data-theme="light"] .RadWindow .rwDialogText,
html[data-theme="light"] .RadWindow_Default .rwDialogText {
    color: var(--text-primary) !important;
}
html[data-theme="light"] .RadWindow .rwDialogPopup input[type="text"],
html[data-theme="light"] .RadWindow .rwDialogPopup input.rwDialogInput,
html[data-theme="light"] .RadWindow_Default .rwDialogPopup input[type="text"],
html[data-theme="light"] .RadWindow_Default .rwDialogPopup input.rwDialogInput {
    color: var(--text-primary) !important;
    background: #ffffff !important;
    border-color: var(--border-input) !important;
}
html[data-theme="light"] .RadWindow .rwDialogPopup a.rwPopupButton:nth-child(2),
html[data-theme="light"] .RadWindow .rwDialogPopup a.rwPopupButton:last-child:not(:first-child),
html[data-theme="light"] .RadWindow_Default .rwDialogPopup a.rwPopupButton:nth-child(2),
html[data-theme="light"] .RadWindow_Default .rwDialogPopup a.rwPopupButton:last-child:not(:first-child) {
    background: #e6efea !important;
    color: var(--text-primary) !important;
    border-color: var(--border-input) !important;
}
html[data-theme="light"] .RadWindow .rwDialogPopup a.rwPopupButton:nth-child(2):hover,
html[data-theme="light"] .RadWindow .rwDialogPopup a.rwPopupButton:last-child:not(:first-child):hover,
html[data-theme="light"] .RadWindow_Default .rwDialogPopup a.rwPopupButton:nth-child(2):hover,
html[data-theme="light"] .RadWindow_Default .rwDialogPopup a.rwPopupButton:last-child:not(:first-child):hover {
    background: #dbe9e2 !important;
    color: var(--text-primary) !important;
}

/* ---- Market depth (popup + dock) buy/sell cells: darker for contrast on light ---- */
html[data-theme="light"] .RadGrid td.buys,
html[data-theme="light"] .RadGrid .rgRow td.buys,
html[data-theme="light"] .RadGrid .rgAltRow td.buys,
html[data-theme="light"] .RadGrid .rgSelectedRow td.buys { color: #0a7a53 !important; }
html[data-theme="light"] .RadGrid td.sells,
html[data-theme="light"] .RadGrid .rgRow td.sells,
html[data-theme="light"] .RadGrid .rgAltRow td.sells,
html[data-theme="light"] .RadGrid .rgSelectedRow td.sells { color: #c42b2b !important; }


.msg-value {  color: var(--text-primary) !important;}
.header-menu-button:hover {
  background: var(--theme-primary-subtle) !important;
  color: var(--text-dim) !important;
  border-color: var(--theme-primary-glow) !important;
}
