/* V16: complete dark surfaces in the terminal dialogs, including payment history. */
html[data-theme="dark"] .page-dashboard dialog.modal{background:var(--bfx-ui-surface)!important;color:var(--bfx-ui-ink)!important;border-color:var(--bfx-ui-line)!important;color-scheme:dark}
html[data-theme="dark"] .page-dashboard :is(.savexa-payment-grid>section,.savexa-document-card,.savexa-account-card,.savexa-accounts-open-card,.savexa-password-info,.savexa-profile-grid>span,.savexa-withdraw-summary article,.savexa-account-note,.savexa-history-row,.savexa-method-card span,.savexa-gateway-option span){background:var(--bfx-ui-soft)!important;color:var(--bfx-ui-ink)!important;border-color:var(--bfx-ui-line)!important}
html[data-theme="dark"] .page-dashboard :is(.savexa-method-card.is-selected span,.savexa-gateway-option.is-selected span,.savexa-account-card.is-active){background:var(--bfx-ui-active)!important;border-color:var(--bfx-ui-accent)!important;color:var(--bfx-ui-ink)!important}
html[data-theme="dark"] .page-dashboard :is(.savexa-payment-modal,.savexa-profile-modal,.savexa-accounts-modal,.savexa-documents-modal,.savexa-statement-modal) :is(h2,h3,label){color:var(--bfx-ui-ink)!important}
html[data-theme="dark"] .page-dashboard :is(.savexa-payment-modal,.savexa-profile-modal,.savexa-accounts-modal,.savexa-documents-modal,.savexa-statement-modal) :is(small,.savexa-account-meta,.savexa-profile-form .password button){color:var(--bfx-ui-muted)!important}
html[data-theme="dark"] .page-dashboard dialog.modal :is(input:not([type=checkbox]):not([type=radio]),select,textarea){background:var(--bfx-ui-soft)!important;color:var(--bfx-ui-ink)!important;border-color:var(--bfx-ui-line)!important}
html[data-theme="dark"] .page-dashboard .savexa-amount-presets button{background:var(--bfx-ui-soft)!important;color:var(--bfx-ui-ink)!important;border:1px solid var(--bfx-ui-line)!important}
html[data-theme="dark"] .page-dashboard .savexa-document-status{background:#42381b!important;color:#ffe096!important}
html[data-theme="dark"] .page-dashboard .savexa-document-status.is-complete{background:#123d30!important;color:#86edbf!important}
html[data-theme="dark"] .page-dashboard .savexa-modal-tabs button{color:var(--bfx-ui-muted)!important}
html[data-theme="dark"] .page-dashboard .savexa-modal-tabs button.active{color:var(--bfx-ui-accent)!important}
.bfx-open-summary{display:flex;flex:0 0 auto;align-items:center;justify-content:space-between;gap:12px;padding:7px 12px;border-bottom:1px solid var(--bfx-ui-line);background:var(--bfx-ui-soft);color:var(--bfx-ui-ink);font-size:12px}
.bfx-open-summary small{margin-left:7px;color:var(--bfx-ui-muted);font-size:10px}.bfx-open-summary strong{font-size:16px;font-variant-numeric:tabular-nums}
.positions-panel:not(:has([data-position-pane="open"].active)) .bfx-open-summary{display:none}
.page-dashboard .terminal-top .bfx-top-pnl{display:block!important;flex:0 0 auto;min-width:85px;border:1px solid var(--bfx-ui-line);border-radius:8px;background:var(--bfx-ui-soft);color:var(--bfx-ui-ink);padding:6px 9px!important}
.page-dashboard .terminal-top .bfx-top-pnl small{color:var(--bfx-ui-muted)!important}.page-dashboard .terminal-top .bfx-top-pnl b{font-size:14px;font-variant-numeric:tabular-nums}
.bfx-tools-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.bfx-lead-tools .com-card{padding:22px;background:var(--bfx-ui-surface);color:var(--bfx-ui-ink)}
.bfx-lead-tools h3{margin:0 0 10px}.bfx-lead-tools p{font-size:13px;line-height:1.6;color:var(--bfx-ui-muted)}
.bfx-template-columns{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:18px 0}.bfx-template-columns label,.bfx-template-sample{display:flex;gap:9px;align-items:center;font-size:13px;min-height:34px}
.bfx-template-columns input,.bfx-template-sample input{width:17px!important;height:17px!important;min-height:17px!important;margin:0!important;accent-color:#e95f0a}
.bfx-template-presets,.bfx-password-tools{display:flex;flex-wrap:wrap;gap:8px}.bfx-field-guide{display:grid;grid-template-columns:1fr 1fr;gap:5px 25px}
[data-lead-import]>label{display:grid;gap:7px;margin:16px 0;font-size:13px}[data-lead-import] :is(input,textarea,select){max-width:100%;width:100%;padding:10px;border:1px solid var(--bfx-ui-line);border-radius:8px;background:var(--bfx-ui-soft);color:var(--bfx-ui-ink);font:inherit}
.bfx-asset-categories{display:flex;gap:7px;overflow-x:auto;padding:7px 0 12px;flex-shrink:0;scrollbar-width:thin}
.bfx-asset-categories button{flex:0 0 auto;min-height:40px;padding:8px 13px;border:1px solid var(--bfx-ui-line);border-radius:20px;background:var(--bfx-ui-soft);color:var(--bfx-ui-ink);font:600 12px system-ui}
.bfx-asset-categories button[aria-pressed="true"]{background:var(--bfx-ui-active);color:var(--bfx-ui-accent);border-color:var(--bfx-ui-accent)}
.bfx-asset-count,.bfx-asset-empty{font-size:12px;color:var(--bfx-ui-muted);margin:3px 0 12px}
.bfx-asset-group{border:1px solid var(--bfx-ui-line);border-radius:12px;margin-bottom:10px;background:var(--bfx-ui-surface);overflow:hidden}
.bfx-asset-group>summary{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:13px;font-size:13px;font-weight:700;color:var(--bfx-ui-ink);background:var(--bfx-ui-soft);cursor:pointer;list-style:none}
.bfx-asset-group>summary:after{content:'+'}.bfx-asset-group[open]>summary:after{content:'−'}.bfx-asset-group>summary>span{margin-left:auto;color:var(--bfx-ui-muted);font-size:11px}
#symbolsSheet :is([data-asset-group],[data-symbol-search-text],[data-remote-symbol-results],[data-asset-empty])[hidden]{display:none!important}
#symbolsSheet .bfx-asset-group>div>button{margin:0;border-radius:0;border-width:0 0 1px;background:var(--bfx-ui-surface);color:var(--bfx-ui-ink)}
#symbolsSheet .bfx-asset-group>div>button small{color:var(--bfx-ui-muted)}
@media(max-width:900px){.bfx-tools-grid,.bfx-field-guide{grid-template-columns:1fr}.bfx-lead-tools .com-card{padding:15px}}
@media(max-width:360px){.bfx-template-columns{grid-template-columns:1fr}.bfx-open-summary small{display:none}}
.page-dashboard .savexa-history-row>span{display:grid!important;gap:5px;min-width:0}.page-dashboard .savexa-history-row>span small{overflow-wrap:anywhere}.page-dashboard .savexa-history-row>strong{flex:0 0 auto}
/* The CRM shell owns its palette independently of the trading terminal theme. */
body.page-admin .bfx-lead-tools{--bfx-ui-surface:var(--crm-surface);--bfx-ui-soft:var(--crm-bg);--bfx-ui-ink:var(--crm-ink);--bfx-ui-muted:var(--crm-muted);--bfx-ui-line:var(--crm-border);color:var(--crm-ink)}
body.page-admin .bfx-lead-tools :is(h2,h3,label){color:var(--crm-ink)!important}
body.page-admin .bfx-lead-tools p{color:var(--crm-muted)!important}
body.page-admin .bfx-lead-tools .bfx-tools-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
body.page-admin .bfx-lead-tools .btn{max-width:100%;white-space:normal!important}
html[data-theme] body.page-admin:has(.bfx-lead-tools) .admin-main{box-sizing:border-box!important;margin-left:224px!important;width:calc(100% - 224px)!important;padding:24px 28px 48px!important}
@media(max-width:1000px){body.page-admin .bfx-lead-tools .bfx-tools-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:900px){html[data-theme] body.page-admin:has(.bfx-lead-tools) .admin-main{margin-left:0!important;width:100%!important;padding:16px!important}}
#symbolsSheet .bfx-asset-group>div{display:grid;grid-template-columns:minmax(0,1fr)}
#symbolsSheet .bfx-asset-group>div>button{display:grid!important;grid-template-columns:34px minmax(0,1fr) auto!important;align-items:center;gap:10px;width:100%!important;min-height:62px;padding:10px 12px!important;text-align:left;border-style:solid;border-color:var(--bfx-ui-line);font:inherit}
#symbolsSheet .bfx-asset-group>div>button>div{display:grid;gap:3px;min-width:0}
#symbolsSheet .bfx-asset-group>div>button b{display:block;font-size:13px}
#symbolsSheet .bfx-asset-group>div>button small{display:block;font-size:11px;line-height:1.4;white-space:normal}
#symbolsSheet .bfx-asset-group>div>button strong{font-size:11px;text-align:right;font-variant-numeric:tabular-nums}
#symbolsSheet .mobile-search{background:var(--bfx-ui-soft)!important;color:var(--bfx-ui-ink)!important;border-color:var(--bfx-ui-line)!important}
#symbolsSheet .mobile-search input{background:transparent!important;color:var(--bfx-ui-ink)!important;border:0!important;box-shadow:none!important}
html[data-theme="dark"] .page-dashboard .savexa-modal-tabs button{border-bottom-color:var(--bfx-ui-line)!important}
html[data-theme="dark"] .page-dashboard .savexa-modal-tabs button.active{border-bottom-color:var(--bfx-ui-accent)!important}
