/* ==========================================================================
   POLYSCOPE24 — DARK FINTECH THEME (FINANCESOLUTION PALETTE)
   Active when <html class="dark">
   ========================================================================== */

/* ==========================================================================
   1. THEME SWITCHER BUTTON STYLES (Light & Dark)
   ========================================================================== */
.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border-subtle, #E2E8F0);
  background: var(--bg-elevated, #FFFFFF);
  color: var(--text-secondary, #475569);
  flex-shrink: 0;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.theme-toggle-btn:hover {
  color: #0052FF;
  border-color: #0052FF;
  transform: scale(1.05);
}

.theme-toggle-btn svg {
  display: block;
  transition: transform 0.3s ease;
}

/* Light Mode: Show Moon Icon (click to turn Dark) */
html.light .theme-toggle-btn .sun-icon {
  display: none !important;
}
html.light .theme-toggle-btn .moon-icon {
  display: block !important;
}

/* Dark Mode: Show Sun Icon (click to turn Light) */
html.dark .theme-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #38BDF8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html.dark .theme-toggle-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

html.dark .theme-toggle-btn .sun-icon {
  display: block !important;
  color: #FBBF24;
}

html.dark .theme-toggle-btn .moon-icon {
  display: none !important;
}

/* Mobile drawer theme toggle alignment */
.mobile-drawer-footer .theme-toggle-btn,
.cab-sidebar-footer .theme-toggle-btn {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

/* ==========================================================================
   2. DARK THEME CSS VARIABLES OVERRIDE
   ========================================================================== */
html.dark {
  color-scheme: dark;

  --bg-main: #050811;
  --bg-secondary: #090e1f;
  --bg-elevated: #0d162d;
  --bg-elevated-hover: #131e3d;
  --bg-card: rgba(13, 22, 45, 0.72);
  --bg-card-border: rgba(255, 255, 255, 0.07);
  --bg-card-border-hover: rgba(56, 189, 248, 0.35);

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --color-blue: #38BDF8;
  --color-blue-hover: #0EA5E9;
  --color-cyan: #38BDF8;
  --color-violet: #818CF8;

  --color-positive: #10B981;
  --color-positive-subtle: rgba(16, 185, 129, 0.15);
  --color-negative: #F43F5E;
  --color-negative-subtle: rgba(244, 63, 94, 0.15);
  --color-warning: #F59E0B;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --grad-accent: linear-gradient(135deg, #0284C7 0%, #2563EB 55%, #0D9488 100%);
  --grad-surface: linear-gradient(180deg, rgba(13, 22, 45, 0.8) 0%, rgba(9, 14, 31, 0.8) 100%);

  /* Cabinet Theme Tokens */
  --cab-bg: #050811;
  --cab-surface: rgba(13, 22, 45, 0.72);
  --cab-border: rgba(255, 255, 255, 0.07);
  --cab-border-hover: rgba(56, 189, 248, 0.35);
}

/* ==========================================================================
   3. GLOBAL DARK BODY & AMBIENT GLOW (ZERO GRIDS)
   ========================================================================== */
html.dark,
html.dark body {
  background-color: #050811 !important;
  color: #F8FAFC !important;
}

html.dark body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(14, 165, 233, 0.16) 0%, transparent 65%),
    radial-gradient(circle at 90% 25%, rgba(59, 130, 246, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 10% 45%, rgba(16, 185, 129, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse 70% 50% at 50% 95%, rgba(99, 102, 241, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

html.dark .orbital-background-canvas {
  opacity: 0.12;
  filter: invert(1) hue-rotate(180deg);
}

/* Dark Scrollbars */
html.dark ::-webkit-scrollbar-track {
  background: #050811;
}
html.dark ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
}
html.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.5);
}

/* ==========================================================================
   4. LANDING PAGE DARK OVERRIDES
   ========================================================================== */

/* Navbar */
html.dark .navbar {
  background: rgba(8, 14, 30, 0.88) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45) !important;
}

html.dark .brand-name {
  color: #FFFFFF !important;
}

html.dark .brand-24 {
  color: #38BDF8 !important;
}

html.dark .nav-item {
  color: #94A3B8 !important;
}

html.dark .nav-item:hover,
html.dark .nav-item.active {
  color: #FFFFFF !important;
}

html.dark .mobile-drawer {
  background: rgba(5, 8, 17, 0.98) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .mobile-nav-item {
  color: #CBD5E1 !important;
}

html.dark .mobile-nav-item:hover {
  color: #38BDF8 !important;
}

/* Buttons */
html.dark .btn-primary {
  background: linear-gradient(135deg, #0284C7 0%, #2563EB 55%, #0D9488 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.28) !important;
}

html.dark .btn-primary:hover {
  background: linear-gradient(135deg, #0EA5E9 0%, #3B82F6 55%, #10B981 100%) !important;
  box-shadow: 0 6px 24px rgba(14, 165, 233, 0.45) !important;
}

html.dark .btn-secondary {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #F8FAFC !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(8px) !important;
}

html.dark .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

html.dark .btn-ghost {
  color: #94A3B8 !important;
  border-color: transparent !important;
}

html.dark .btn-ghost:hover {
  color: #FFFFFF !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

html.dark .btn-outline {
  background: rgba(255, 255, 255, 0.03) !important;
  color: #F8FAFC !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

html.dark .btn-outline:hover {
  background: rgba(56, 189, 248, 0.1) !important;
  border-color: #38BDF8 !important;
  color: #38BDF8 !important;
}

/* Hero Section */
html.dark .hero-title {
  color: #FFFFFF !important;
}

html.dark .hero-title-accent {
  background: linear-gradient(135deg, #38BDF8 0%, #60A5FA 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

html.dark .hero-lead {
  color: #94A3B8 !important;
}

html.dark .hero-trust-bar {
  color: #64748B !important;
}

html.dark .trust-item {
  color: #94A3B8 !important;
}

html.dark .hero-metrics-strip {
  background: rgba(13, 22, 45, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(16px) !important;
}

html.dark .metric-cell:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .metric-label {
  color: #64748B !important;
}

html.dark .metric-val {
  color: #FFFFFF !important;
}

html.dark .metric-sub {
  color: #94A3B8 !important;
}

/* Hero Terminal Card */
html.dark .modern-hero-terminal,
html.dark .terminal-card {
  background: rgba(10, 17, 36, 0.85) !important;
  border: 1px solid rgba(56, 189, 248, 0.22) !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 35px rgba(14, 165, 233, 0.1) !important;
  backdrop-filter: blur(20px) !important;
}

html.dark .terminal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: transparent !important;
}

html.dark .terminal-title {
  color: #94A3B8 !important;
}

html.dark .terminal-trader-bar {
  background: rgba(255, 255, 255, 0.025) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: 14px !important;
}

html.dark .trader-handle {
  color: #FFFFFF !important;
}

html.dark .trader-focus-sub {
  color: #94A3B8 !important;
}

html.dark .profit-alignment-ribbon {
  background: rgba(16, 185, 129, 0.06) !important;
  border: 1px solid rgba(16, 185, 129, 0.2) !important;
  border-radius: 12px !important;
}

html.dark .ribbon-label {
  color: #94A3B8 !important;
}

html.dark .tf-btn {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #94A3B8 !important;
}

html.dark .tf-btn.active {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: #38BDF8 !important;
  color: #38BDF8 !important;
}

html.dark .feed-card {
  background: rgba(255, 255, 255, 0.025) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: 10px !important;
  color: #FFFFFF !important;
}

html.dark .feed-market {
  color: #FFFFFF !important;
}

html.dark .feed-stake {
  color: #94A3B8 !important;
}

html.dark .terminal-footer-guarantee {
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  color: #64748B !important;
}

html.dark .interactive-chart-svg line {
  stroke: rgba(255, 255, 255, 0.06) !important;
}

/* Ecosystem & Feature Cards */
html.dark .ecosystem-card,
html.dark .process-step-card,
html.dark .profit-card,
html.dark .referral-card,
html.dark .referral-banner-card,
html.dark .telegram-mockup-card,
html.dark .final-cta-card,
html.dark .modal-card,
html.dark .auth-modal-clean {
  background: rgba(13, 22, 45, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
  color: #F8FAFC !important;
}

html.dark .ecosystem-card:hover,
html.dark .process-step-card:hover,
html.dark .profit-card:hover,
html.dark .referral-card:hover {
  border-color: rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.55), 0 0 20px rgba(14, 165, 233, 0.1) !important;
}

html.dark .eco-card-top h3,
html.dark .profit-card-title,
html.dark .referral-card-title {
  color: #FFFFFF !important;
}

html.dark .eco-card-body p,
html.dark .profit-card-desc,
html.dark .referral-card-desc {
  color: #94A3B8 !important;
}

/* FAQ */
html.dark .faq-item {
  background: rgba(13, 22, 45, 0.65) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
}

html.dark .faq-question {
  color: #FFFFFF !important;
}

html.dark .faq-answer {
  color: #94A3B8 !important;
}

/* Footer */
html.dark .site-footer {
  background: rgba(4, 7, 15, 0.95) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #94A3B8 !important;
}

html.dark .footer-col-title {
  color: #FFFFFF !important;
}

html.dark .footer-links a {
  color: #94A3B8 !important;
}

html.dark .footer-links a:hover {
  color: #38BDF8 !important;
}

/* Modals */
html.dark .modal-backdrop {
  background: rgba(3, 6, 15, 0.85) !important;
  backdrop-filter: blur(14px) !important;
}

html.dark .auth-modal-title {
  color: #FFFFFF !important;
}

html.dark input,
html.dark select,
html.dark textarea {
  background: rgba(3, 6, 15, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #FFFFFF !important;
}

html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  border-color: #38BDF8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
  outline: none !important;
}

html.dark .auth-subtab-btn {
  background: rgba(255, 255, 255, 0.03) !important;
  color: #94A3B8 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .auth-subtab-btn.active {
  background: rgba(56, 189, 248, 0.12) !important;
  border-color: #38BDF8 !important;
  color: #38BDF8 !important;
}

/* ==========================================================================
   5. CABINET DARK OVERRIDES
   ========================================================================== */

/* Cabinet Header */
html.dark .cab-header {
  background: rgba(7, 12, 29, 0.92) !important;
  backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
}

html.dark .cab-header-balance {
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .cab-bal-label {
  color: #94A3B8 !important;
}

html.dark .cab-bal-val {
  color: #38BDF8 !important;
}

html.dark .cab-deposit-btn {
  background: linear-gradient(135deg, #0284C7 0%, #2563EB 55%, #0D9488 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

html.dark .cab-user-pill {
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #F8FAFC !important;
}

html.dark .cab-user-avatar {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6) !important;
  color: #FFFFFF !important;
}

html.dark .cab-header-btn {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #94A3B8 !important;
}

html.dark .cab-header-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
}

/* Cabinet Sidebar */
html.dark .cab-sidebar {
  background: rgba(7, 12, 29, 0.8) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.07) !important;
}

html.dark .cab-nav-heading {
  color: #64748B !important;
}

html.dark .cab-nav-btn {
  color: #94A3B8 !important;
  border: 1px solid transparent !important;
}

html.dark .cab-nav-btn:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #FFFFFF !important;
}

html.dark .cab-nav-btn.active {
  background: rgba(56, 189, 248, 0.1) !important;
  color: #38BDF8 !important;
  border-color: rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.1) !important;
}

html.dark .cab-badge {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
}

html.dark .cab-trust-box {
  background: rgba(16, 185, 129, 0.06) !important;
  border: 1px solid rgba(16, 185, 129, 0.18) !important;
}

html.dark .cab-trust-title {
  color: #34D399 !important;
}

html.dark .cab-trust-desc {
  color: #94A3B8 !important;
}

/* Cabinet Cards */
html.dark .cab-card,
html.dark .cab-stat-card,
html.dark .cab-wallet-box,
html.dark .cab-summary-box,
html.dark .cab-table-card,
html.dark .cab-settings-form-card,
html.dark .cab-withdraw-card,
html.dark .cab-withdraw-history-card,
html.dark .deposit-amount-card,
html.dark .cab-referral-hero-card {
  background: rgba(13, 22, 45, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  backdrop-filter: blur(20px) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
  color: #F8FAFC !important;
}

html.dark .cab-card:hover,
html.dark .cab-stat-card:hover {
  border-color: rgba(56, 189, 248, 0.35) !important;
}

html.dark .cab-welcome-card {
  background: linear-gradient(135deg, rgba(9, 15, 34, 0.9) 0%, rgba(13, 23, 49, 0.9) 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4) !important;
}

html.dark .cab-page-title {
  color: #FFFFFF !important;
}

html.dark .cab-page-desc {
  color: #94A3B8 !important;
}

html.dark .stat-label {
  color: #64748B !important;
}

html.dark .stat-val {
  color: #FFFFFF !important;
}

html.dark .card-title {
  color: #FFFFFF !important;
}

html.dark .card-subtitle {
  color: #94A3B8 !important;
}

/* Wallet address bar */
html.dark .wallet-address-bar {
  background: rgba(3, 6, 15, 0.75) !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
  color: #38BDF8 !important;
}

html.dark .strat-lbl {
  color: #94A3B8 !important;
}

html.dark .strat-val {
  color: #FFFFFF !important;
}

/* Cabinet Tables */
html.dark table.cab-table th {
  background: rgba(8, 14, 30, 0.85) !important;
  color: #64748B !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  white-space: nowrap !important;
}

html.dark table.cab-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
  color: #F8FAFC !important;
  white-space: nowrap !important;
}

html.dark table.cab-table td.cell-market,
html.dark table.cab-table td.cell-wrap {
  white-space: normal !important;
  min-width: 240px !important;
}

html.dark table.cab-table tr:hover td {
  background: rgba(56, 189, 248, 0.03) !important;
}

/* Status Badges */
html.dark .badge-pill,
html.dark .trade-status-badge {
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
}

html.dark .badge-success,
html.dark .status-won {
  background: rgba(16, 185, 129, 0.14) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  color: #34D399 !important;
}

html.dark .badge-warning,
html.dark .status-in-progress {
  background: rgba(245, 158, 11, 0.14) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  color: #FBBF24 !important;
}

html.dark .badge-danger,
html.dark .status-lost {
  background: rgba(244, 63, 94, 0.14) !important;
  border: 1px solid rgba(244, 63, 94, 0.35) !important;
  color: #FB7185 !important;
}

html.dark .badge-primary {
  background: rgba(56, 189, 248, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  color: #38BDF8 !important;
}

/* Cabinet Form Controls */
html.dark .cab-label {
  color: #94A3B8 !important;
}

html.dark .cab-input,
html.dark .cab-select {
  background: rgba(3, 6, 15, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #FFFFFF !important;
}

html.dark .cab-input:focus,
html.dark .cab-select:focus {
  border-color: #38BDF8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
  outline: none !important;
}

html.dark .preset-chip-btn,
html.dark .pct-btn,
html.dark .tier-filter-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94A3B8 !important;
}

html.dark .preset-chip-btn.active,
html.dark .pct-btn.active,
html.dark .tier-filter-btn.active {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: #38BDF8 !important;
  color: #38BDF8 !important;
}

/* Trader Tier Filter Bar */
html.dark .trader-tier-filter-bar {
  background: rgba(13, 22, 45, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Mobile Bottom Navigation */
html.dark .cab-mobile-bottom-nav {
  background: rgba(7, 12, 29, 0.95) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .cab-bottom-nav-item {
  color: #94A3B8 !important;
}

html.dark .cab-bottom-nav-item.active {
  color: #38BDF8 !important;
}



/* ==========================================================================
   COMPREHENSIVE DARK THEME OVERRIDES (ALL SECTIONS & CABINET TABS)
   Eliminates all remaining white blocks across Landing and Cabinet.
   ========================================================================== */

/* 1. LANDING: EDITORIAL TRUST STRIP */
html.dark .trust-strip-section {
  background: #050811 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

html.dark .strip-item {
  color: #F8FAFC !important;
}

html.dark .strip-icon-box {
  background: rgba(56, 189, 248, 0.12) !important;
  color: #38BDF8 !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
}

html.dark .strip-heading {
  color: #F8FAFC !important;
}

html.dark .strip-desc {
  color: #94A3B8 !important;
}

html.dark .strip-separator {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* 2. LANDING: HERO TERMINAL & CHART */
html.dark .terminal-card {
  background: #090e1f !important;
  border-color: rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 30px rgba(56, 189, 248, 0.08) !important;
}

html.dark .terminal-header {
  background: #070b18 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .terminal-trader-bar {
  background: #090e1f !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .profit-alignment-ribbon {
  background: #070b18 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .ribbon-divider {
  background: rgba(255, 255, 255, 0.08) !important;
}

html.dark .terminal-chart-wrapper {
  background: #090e1f !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .live-positions-feed {
  background: #090e1f !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .feed-card {
  background: rgba(13, 22, 45, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .feed-card:hover {
  background: rgba(19, 30, 61, 0.9) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}

html.dark .feed-market {
  color: #F8FAFC !important;
}

html.dark .terminal-footer-guarantee {
  background: #070b18 !important;
  color: #94A3B8 !important;
}

html.dark .terminal-profile-strip {
  background: #090e1f !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .terminal-timeframes {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .tf-btn {
  background: transparent !important;
  color: #94A3B8 !important;
}

html.dark .tf-btn.active,
html.dark .tf-btn:hover {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: #38BDF8 !important;
  color: #38BDF8 !important;
}

html.dark .terminal-stats-grid {
  background: #070b18 !important;
}

html.dark .terminal-positions-section {
  background: #090e1f !important;
}

html.dark .terminal-guard-footer {
  background: #070b18 !important;
}

html.dark .hero-metrics-strip {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 3. CABINET: DEPOSIT & WALLET TAB (Screenshot 2 Fix) */
html.dark .crypto-card-btn {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #F8FAFC !important;
}

html.dark .crypto-card-btn:hover {
  background: #131e3d !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  transform: translateY(-2px);
}

html.dark .crypto-card-btn.active {
  background: rgba(56, 189, 248, 0.12) !important;
  border-color: #38BDF8 !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25) !important;
}

html.dark .crypto-symbol,
html.dark .crypto-card-btn .crypto-name {
  color: #F8FAFC !important;
}

html.dark .crypto-card-btn .crypto-rate {
  color: #94A3B8 !important;
}

html.dark .network-pill-btn {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #94A3B8 !important;
}

html.dark .network-pill-btn:hover {
  background: #131e3d !important;
  color: #FFFFFF !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}

html.dark .network-pill-btn.active {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: #38BDF8 !important;
  color: #38BDF8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2) !important;
}

html.dark .deposit-amount-card {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .deposit-inputs-grid {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .credit-preview-box {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .credit-preview-box .credit-label {
  color: #94A3B8 !important;
}

html.dark .credit-preview-box .credit-val {
  color: #10B981 !important;
}

html.dark .credit-preview-box .credit-note {
  color: #64748B !important;
}

html.dark .deposit-full-address {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #F8FAFC !important;
}

html.dark .deposit-network-chip {
  background: rgba(56, 189, 248, 0.12) !important;
  color: #38BDF8 !important;
}

html.dark .invoice-main-card {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .invoice-body-grid {
  background: transparent !important;
}

html.dark .invoice-qr-box {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .qr-code-frame {
  background: #FFFFFF !important;
  padding: 10px;
  border-radius: 8px;
}

html.dark .invoice-requisite-card {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .scanner-mini-card {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .fee-rule-card {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 4. CABINET: RISK & COPY SETTINGS TAB (Screenshot 3 Fix) */
html.dark .settings-master-toggle-box {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #94A3B8 !important;
}

html.dark .settings-toggle-text {
  color: #94A3B8 !important;
}

html.dark .trader-mode-tabs {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .trader-mode-tab-btn {
  background: transparent !important;
  color: #94A3B8 !important;
}

html.dark .trader-mode-tab-btn.active {
  background: #0d162d !important;
  color: #38BDF8 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* 5. CABINET: CURATED TRADERS TAB (Screenshot 4 Fix) */
html.dark .trader-metrics-grid-4 {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .trader-metrics-grid-4 .stat-box {
  background: transparent !important;
}

html.dark .trader-metrics-grid-4 .stat-val {
  color: #F8FAFC !important;
}

html.dark .trader-metrics-grid-4 .stat-sub {
  color: #64748B !important;
}

html.dark .tier-count-pill {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #94A3B8 !important;
}

html.dark .trader-card-full {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .trader-category-pill {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #94A3B8 !important;
}

html.dark .trader-sub-meta .wallet-badge {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #94A3B8 !important;
}

/* 6. CABINET: WITHDRAW FUNDS TAB (Screenshot 5 Fix) */
html.dark .withdraw-req-card {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #94A3B8 !important;
}

html.dark .withdraw-avail-strip {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .withdraw-avail-strip .strip-label,
html.dark .withdraw-avail-strip span {
  color: #94A3B8 !important;
}

html.dark .withdraw-avail-strip .strip-val {
  color: #38BDF8 !important;
}

html.dark .withdraw-fee-summary {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .withdraw-fee-summary .fee-label,
html.dark .withdraw-fee-summary span {
  color: #94A3B8 !important;
}

html.dark .withdraw-fee-summary .fee-val {
  color: #F8FAFC !important;
}

/* 7. CABINET: REFERRAL PROGRAM TAB */
html.dark .referral-input {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #F8FAFC !important;
}

html.dark .tier-progress-box {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .tier-progress-track {
  background: rgba(255, 255, 255, 0.08) !important;
}

html.dark .tier-card {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 8. LANDING: PROCESS STEPS & HOW IT WORKS */
html.dark .process-step-card {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .step-num {
  background: #131e3d !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  color: #38BDF8 !important;
}

html.dark .process-step-card:hover .step-num {
  background: #38BDF8 !important;
  color: #050811 !important;
}

html.dark .step-detail-box {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 9. LANDING: SHOWCASE, DISCOVERY, SECTIONS */
html.dark .showcase-panel {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .showcase-chart-area,
html.dark .sidebar-metrics-list {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .discovery-controls-card {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .search-input,
html.dark .custom-select {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #F8FAFC !important;
}

html.dark .view-switch-group {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .view-btn.active {
  background: #0d162d !important;
  color: #38BDF8 !important;
}

html.dark .trader-card {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .trader-sparkline-wrap,
html.dark .trader-card-stats {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .card-category-chip,
html.dark .cat-pill {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #94A3B8 !important;
}

html.dark .traders-table-container {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .traders-data-table th {
  background: #090e1f !important;
  color: #94A3B8 !important;
}

html.dark .traders-data-table tr:hover td {
  background: rgba(56, 189, 248, 0.04) !important;
}

html.dark .risk-controls-panel,
html.dark .risk-display-panel {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .sandbox-stat-card,
html.dark .stress-test-box {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 10. LANDING: PROFIT SHARING, TELEGRAM, REFERRALS, FAQ, FOOTER */
html.dark .profit-sharing-section {
  background: #050811 !important;
}

html.dark .profit-card {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .profit-card.featured {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, #0d162d 100%) !important;
  border-color: #38BDF8 !important;
}

html.dark .profit-badge {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38BDF8 !important;
}

html.dark .payout-comparison-box {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .comparison-column.loss-scenario {
  background: rgba(13, 22, 45, 0.8) !important;
}

html.dark .loss-scenario .scenario-tag {
  background: rgba(244, 63, 94, 0.15) !important;
  color: #FB7185 !important;
}

html.dark .telegram-section {
  background: #050811 !important;
}

html.dark .telegram-mockup-card {
  background: #090e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .tg-msg-bubble {
  background: #0d162d !important;
  color: #F8FAFC !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .tg-kb-btn {
  background: #131e3d !important;
  color: #38BDF8 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .tg-kb-btn:hover {
  background: rgba(56, 189, 248, 0.2) !important;
  color: #FFFFFF !important;
}

html.dark .tg-avatar {
  background: #0d162d !important;
}

html.dark .referral-section {
  background: #050811 !important;
}

html.dark .referral-card {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .referral-step-num {
  background: #131e3d !important;
  color: #38BDF8 !important;
}

html.dark .faq-item {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #F8FAFC !important;
}

html.dark .faq-question {
  color: #F8FAFC !important;
}

html.dark .faq-answer {
  color: #94A3B8 !important;
}

html.dark .site-footer {
  background: #03050a !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .legal-box,
html.dark .legal-content-card,
html.dark .legal-meta-row {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #F8FAFC !important;
}

html.dark .legal-table th {
  background: #090e1f !important;
}

html.dark .empty-state-card {
  background: #0d162d !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .btn-secondary {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #F8FAFC !important;
}

html.dark .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #FFFFFF !important;
}

html.dark .toast {
  background: #0d162d !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  color: #F8FAFC !important;
}

/* Brand icon background fix in case any wrapper had white */
.brand-icon-wrapper,
.brand-logo-img {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Cookie Banner Dark Overrides */
html.dark .cookie-banner {
  background: #0d162d !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6) !important;
}

html.dark .cookie-banner-icon {
  background: rgba(56, 189, 248, 0.12) !important;
}

html.dark .cookie-title {
  color: #F8FAFC !important;
}

html.dark .cookie-desc {
  color: #94A3B8 !important;
}

/* Wide toggle button label controls */
html.dark .theme-label-light {
  display: none !important;
}
html.dark .theme-label-dark {
  display: inline !important;
}
html.light .theme-label-dark {
  display: none !important;
}
html.light .theme-label-light {
  display: inline !important;
}


/* ==========================================================================
   SMOOTH LOGO TRANSITION (DARK <-> LIGHT)
   ========================================================================== */
.brand-icon-wrapper {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.brand-icon-wrapper .brand-logo-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

/* In Dark Mode */
html.dark .brand-icon-wrapper .logo-dark {
  opacity: 1 !important;
  transform: scale(1) rotate(0deg) !important;
  pointer-events: auto !important;
}
html.dark .brand-icon-wrapper .logo-light {
  opacity: 0 !important;
  transform: scale(0.82) rotate(-8deg) !important;
  pointer-events: none !important;
}

/* In Light Mode */
html.light .brand-icon-wrapper .logo-light {
  opacity: 1 !important;
  transform: scale(1) rotate(0deg) !important;
  pointer-events: auto !important;
}
html.light .brand-icon-wrapper .logo-dark {
  opacity: 0 !important;
  transform: scale(0.82) rotate(8deg) !important;
  pointer-events: none !important;
}

/* ==========================================================================
   TARGETED FIXES FOR REPORTED WHITE ELEMENTS
   ========================================================================== */

/* 1. Profit-Sharing Winning Scenario Card (Screenshot 1 Fix) */
html.dark .comparison-column.win-scenario {
  background: rgba(16, 185, 129, 0.08) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

html.dark .win-scenario .scenario-tag {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34D399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

html.dark .win-scenario .scenario-amount {
  color: #34D399 !important;
}

html.dark .win-scenario .scenario-split-row {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08) !important;
}

html.dark .win-scenario .scenario-split-row span {
  color: #F8FAFC !important;
}

html.dark .win-scenario .scenario-split-row .text-secondary {
  color: #94A3B8 !important;
}

/* 2. Landing Footer Audit Index Chip (Screenshot 2 Fix) */
html.dark .footer-status-chip {
  background: rgba(56, 189, 248, 0.1) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  color: #38BDF8 !important;
}

html.dark .footer-status-chip .status-dot {
  background: #38BDF8 !important;
  box-shadow: 0 0 8px #38BDF8 !important;
}

/* 3. Cabinet Badges & Status Pills (Screenshot 3 Fix) */
html.dark .cab-status-pill {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #F8FAFC !important;
}

html.dark .stat-pill-sm {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94A3B8 !important;
}

html.dark .badge-pill.badge-neutral,
html.dark #strategyActiveBadge:not(.badge-success) {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #94A3B8 !important;
}

html.dark #overviewFeePaid {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94A3B8 !important;
}

/* ==========================================================================
   MULTI-TRADER ALLOCATIONS, MODALS & PROFIT SIMULATOR (DARK THEME)
   ========================================================================== */
html.dark .alloc-banner-card,
html.dark .alloc-trader-card {
  background: #0d162d !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
}

html.dark .alloc-progress-track {
  background: #090e1f !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark .alloc-card-budget-bar {
  background: #090e1f !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark .alloc-mini-field input,
html.dark .alloc-mini-field select {
  background: #090e1f !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #F8FAFC !important;
}

html.dark .alloc-card-actions {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark .btn-share-row {
  background: rgba(56, 189, 248, 0.12) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  color: #38BDF8 !important;
}

html.dark .btn-share-row:hover {
  background: #0052FF !important;
  color: #FFFFFF !important;
}

html.dark .cab-modal-box {
  background: #0d162d !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html.dark .cab-modal-header {
  background: #090e1f !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark .cab-modal-title {
  color: #F8FAFC !important;
}

html.dark .share-theme-pills {
  background: #090e1f !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html.dark .share-theme-pill-btn {
  color: #94A3B8 !important;
}

html.dark .share-theme-pill-btn.active {
  background: #0052FF !important;
  color: #FFFFFF !important;
}

html.dark .sim-period-btn {
  background: #090e1f !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #94A3B8 !important;
}

html.dark .sim-period-btn.active {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: #38BDF8 !important;
  color: #38BDF8 !important;
}

html.dark .sim-res-card {
  background: #090e1f !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark .sim-res-card.highlight {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
}

html.dark .sim-res-val {
  color: #F8FAFC !important;
}

html.dark .sim-res-card.highlight .sim-res-val {
  color: #34D399 !important;
}

html.dark .floating-support-btn {
  background: linear-gradient(135deg, #0052FF 0%, #0EA5E9 100%) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 10px 30px rgba(0, 82, 255, 0.45), 0 0 18px rgba(56, 189, 248, 0.25) !important;
}
