/* =========================================================
   CryptoSmartX Theme System — Pro (data-theme)
   Source of truth: html[data-theme="dark"|"light"]
   ========================================================= */

/* -------------------------
   Base tokens (DARK default)
   ------------------------- */
:root{
  /* Layout */
  --max: 1180px;
  --r: 16px;
  --pill: 999px;

  /* Brand */
  --accent: #00ff88;

  /* Surfaces */
  --bg: #050607;
  --glass1: rgba(8,12,12,.78);
  --glass2: rgba(8,12,12,.58);
  --line: rgba(255,255,255,.10);

  /* Surface aliases (used by legacy overrides) */
  --surface-1: linear-gradient(180deg, var(--glass1), var(--glass2));
  --surface-2: rgba(255,255,255,.04);

  /* Text */
  --csx-text: rgba(255,255,255,.92);
  --csx-muted: rgba(255,255,255,.78);
  --csx-placeholder: rgba(255,255,255,.45);

  /* Shadows */
  --shadow: 0 18px 45px rgba(0,0,0,.42);
  --inner: 0 0 0 1px rgba(255,255,255,.06) inset;

  /* Controls */
  --ctrl-bg: rgba(0,0,0,.18);
  --ctrl-border: rgba(255,255,255,.10);
  --ctrl-border2: rgba(255,255,255,.14);
  --ctrl-hover: rgba(255,255,255,.06);
}

/* -------------------------
   LIGHT MODE tokens (manual)
   ------------------------- */
html[data-theme="light"]{
  color-scheme: light;

  --bg: #f7f8fa;
  --glass1: rgba(255,255,255,.92);
  --glass2: rgba(255,255,255,.80);
  --line: rgba(0,0,0,.10);

  --surface-1: linear-gradient(180deg, var(--glass1), var(--glass2));
  --surface-2: rgba(0,0,0,.03);

  --csx-text: rgba(10,12,14,.92);
  --csx-muted: rgba(10,12,14,.62);
  --csx-placeholder: rgba(10,12,14,.42);

  --shadow: 0 14px 35px rgba(0,0,0,.12);
  --inner: 0 0 0 1px rgba(0,0,0,.06) inset;

  --ctrl-bg: rgba(255,255,255,.70);
  --ctrl-border: rgba(0,0,0,.10);
  --ctrl-border2: rgba(0,0,0,.14);
  --ctrl-hover: rgba(0,0,0,.04);
}

html[data-theme="dark"]{ color-scheme: dark; }

/* -------------------------
   Global baseline
   ------------------------- */
html, body{
  background: var(--bg);
  color: var(--csx-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Optional: disable background images via html.csx-no-bg */
html.csx-no-bg,
html.csx-no-bg body{
  background-image: none !important;
}

/* Muted text contrast fix (Bootstrap) */
.text-muted,
.small.text-muted,
.form-text{
  color: var(--csx-muted) !important;
}

/* Links */
a{
  color: var(--csx-text);
  text-decoration: none;
}
a:hover{ text-decoration: underline; }
html[data-theme="light"] a{ color: rgba(10,12,14,.92); }

/* =========================================================
   Navbar shell
   ========================================================= */
.csx-nav{
  position: sticky;
  top: 0;
  z-index: 1030;

  background: var(--surface-1);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inner);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Mobile: remove the nav bottom line that looks like a stray dash */
@media (max-width: 991.98px){
  .csx-nav{
    border-bottom: 0 !important;
    box-shadow: none !important;
  }
}

/* Center container */
.csx-nav .container{ max-width: var(--max); }

/* Kill bullets anywhere inside header */
.csx-nav ul, .csx-nav ol, .csx-nav li{
  list-style: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
}

/* Brand */
.csx-brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
}
.csx-brand img{
  height:34px;
  width:auto;
  filter: drop-shadow(0 0 10px rgba(0,255,136,.18));
}
.csx-brand span{
  font-family:'Orbitron',sans-serif;
  font-weight:700;
  font-size:1.02rem;
  letter-spacing:1.6px;
  text-transform:uppercase;
  color:var(--csx-text);
  line-height:1;
}

/* Nav links */
.csx-nav .navbar-nav{
  list-style:none;
  padding-left:0;
  margin-bottom:0;
}
.csx-nav .navbar-nav .nav-link{
  font-family:'Orbitron',sans-serif;
  text-transform:uppercase;
  letter-spacing:.9px;
  font-size:.82rem;

  color: var(--csx-text) !important;
  text-decoration:none !important;
  border:0 !important;
  outline:0;

  display:inline-flex;
  align-items:center;
  gap:.4rem;

  padding:.46rem .78rem;
  border-radius: var(--pill);
  white-space: nowrap;

  transition: background .18s ease, box-shadow .18s ease, transform .18s ease, color .18s ease;
}
.csx-nav .navbar-nav .nav-link:hover{
  background: var(--ctrl-hover);
  box-shadow: 0 0 0 1px var(--ctrl-border) inset;
  transform: translateY(-1px);
}
.csx-nav .navbar-nav .nav-link:focus-visible{
  box-shadow: 0 0 0 2px rgba(0,255,136,.35), 0 0 0 1px rgba(0,0,0,.25) inset;
  transform:none;
}
.csx-nav .navbar-nav .nav-link.active,
.csx-nav .navbar-nav .nav-link[aria-current="page"]{
  background: rgba(0,255,136,.10);
  box-shadow: 0 0 0 1px rgba(0,255,136,.16) inset, 0 10px 28px rgba(0,255,136,.06);
  color: var(--accent) !important;
}

/* =========================================================
   Light mode: make active nav + user pill more readable
   ========================================================= */
html[data-theme="light"] .csx-nav .navbar-nav .nav-link{
  color: rgba(10,12,14,.86) !important;
}

html[data-theme="light"] .csx-nav .navbar-nav .nav-link:hover{
  background: rgba(0,0,0,.04);
  box-shadow: 0 0 0 1px rgba(0,0,0,.08) inset;
}

/* focus state (keyboard) */
html[data-theme="light"] .csx-nav .navbar-nav .nav-link:focus-visible{
  box-shadow: 0 0 0 3px rgba(0,255,136,.22), 0 0 0 1px rgba(0,0,0,.10) inset;
  outline: none;
}

html[data-theme="light"] .csx-nav .navbar-nav .nav-link.active,
html[data-theme="light"] .csx-nav .navbar-nav .nav-link[aria-current="page"]{
  background: rgba(0,255,136,.22);
  box-shadow: 0 0 0 1px rgba(0,255,136,.30) inset, 0 10px 22px rgba(0,255,136,.12);
  color: rgba(10,12,14,.92) !important;
}

/* User pill (top right) in light mode */
html[data-theme="light"] .csx-user-btn{
  background: rgba(0,255,136,.16);
  border-color: rgba(0,255,136,.30);
  color: rgba(10,12,14,.92) !important;
}
html[data-theme="light"] .csx-user-btn i{
  color: rgba(0,120,70,.95);
}

/* Small round avatar in user pill */
.csx-avatar{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  flex: 0 0 auto;
}
html[data-theme="light"] .csx-avatar{
  box-shadow: 0 8px 18px rgba(0,0,0,.10);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .csx-nav .navbar-nav .nav-link{ transition:none !important; }
  .csx-nav .navbar-nav .nav-link:hover{ transform:none !important; }
}

/* =========================================================
   AI search
   ========================================================= */
.csx-ai{ max-width: 420px; width: 100%; }
.csx-ai .ai-box{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:.42rem .70rem;
  border-radius: var(--r);
  border: 1px solid var(--ctrl-border);
  background: var(--ctrl-bg);
  box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset;
}
html[data-theme="light"] .csx-ai .ai-box{
  box-shadow: 0 0 0 1px rgba(0,0,0,.04) inset;
}
.csx-ai .ai-box i{ color: rgba(0,255,136,.75); }
.csx-ai input{
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  color: var(--csx-text);
  font-size:.92rem;
}
.csx-ai input::placeholder{ color: var(--csx-placeholder); }
.csx-ai .kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size:.78rem;
  color: var(--csx-muted);
  border:1px solid var(--ctrl-border2);
  padding:.12rem .42rem;
  border-radius:10px;
}

/* =========================================================
   Theme toggle
   ========================================================= */
.theme-switch-wrapper{
  display:flex;
  align-items:center;
  gap:10px;
  white-space:nowrap;
}
.theme-switch{ display:inline-block; height:30px; width:54px; position:relative; }
.theme-switch input{ display:none; }
.slider{
  position:absolute;
  inset:0;
  background: var(--ctrl-hover);
  border:1px solid var(--ctrl-border2);
  border-radius:999px;
  cursor:pointer;
  transition:.25s ease;
}
.slider:before{
  content:"";
  position:absolute;
  height:22px; width:22px;
  left:4px; top:50%;
  transform: translateY(-50%);
  border-radius:50%;
  background:#fff;
  transition:.25s ease;
  box-shadow:0 6px 18px rgba(0,0,0,.25);
}
input:checked + .slider{
  background: rgba(0,255,136,.18);
  border-color: rgba(0,255,136,.25);
}
input:checked + .slider:before{
  transform: translateX(24px) translateY(-50%);
}
#themeIcon{ color: var(--csx-muted); line-height:1; }

/* =========================================================
   Dropdown menus / user pill
   ========================================================= */
.csx-user-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:.34rem .62rem;
  border-radius: var(--pill);
  border: 1px solid rgba(0,255,136,.22);
  background: rgba(0,255,136,.08);
  color: var(--csx-text) !important;
  text-decoration:none;
  max-width:220px;
  overflow:hidden;
  white-space:nowrap;
}
.csx-user-btn i{ color: var(--accent); }
.csx-user-btn span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.csx-nav .nav-user-dropdown .dropdown-menu,
.csx-nav .user-pill .dropdown-menu{
  position:absolute !important;
  top: calc(100% + 8px) !important;
  right:0 !important;
  left:auto !important;

  min-width:220px !important;
  max-width: calc(100vw - 40px) !important;

  padding:.5rem !important;
  border-radius:14px !important;
  z-index:3000 !important;
}

/* Only visible when Bootstrap adds .show */
.csx-nav .dropdown-menu{ display:none; }
.csx-nav .dropdown-menu.show{ display:block; }

.user-pill, .nav-user-dropdown, .dropdown{ position:relative !important; }

.dropdown-item{
  color: var(--csx-text);
  border-radius:10px;
  padding:.55rem .75rem;
}
.dropdown-item:hover{ background: rgba(0,255,136,.08); }
.dropdown-divider{
  border-top-color: var(--line);
  margin:.35rem 0;
}

/* Bootstrap toggler icon visibility */
.navbar-toggler{
  border: 1px solid var(--ctrl-border2) !important;
  border-radius:12px;
}
html[data-theme="dark"] .navbar-toggler-icon{
  filter: invert(1) grayscale(1) brightness(2);
}
html[data-theme="light"] .navbar-toggler-icon{
  filter: none;
}

/* Mobile optional */
@media (max-width: 991.98px){
  .csx-ai{ display:none; }
  .theme-switch-wrapper{ padding: .4rem .2rem; }
}

/* =========================================================
   CSX UI Components Pack — Reusable
   ========================================================= */
.csx-container{
  max-width: var(--max);
  margin:0 auto;
  padding: 18px 12px 34px;
}

.csx-card{
  border-radius: calc(var(--r) + 6px);
  background: var(--surface-1);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inner);
  padding: 18px;
}
.csx-card--tight{ padding: 14px; }
.csx-card--spacious{ padding: 22px; }

.csx-card__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding-bottom:12px;
  border-bottom:1px solid var(--line);
  margin-bottom:14px;
}
.csx-card__title{
  margin:0;
  font-weight:800;
  letter-spacing:.2px;
  color: var(--csx-text);
}
.csx-card__subtitle{
  margin:4px 0 0;
  color: var(--csx-muted);
  font-size:.92rem;
}

.csx-section{ margin-top:16px; }
.csx-section__title{
  margin:0 0 8px;
  font-weight:800;
  color: var(--csx-text);
  letter-spacing:.2px;
}
.csx-section__hint{
  margin:0 0 12px;
  color: var(--csx-muted);
  font-size:.92rem;
}

.csx-divider{
  height:1px;
  background: var(--line);
  border:0;
  opacity:1;
  margin:14px 0;
}

.csx-badge{
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  padding:.22rem .58rem;
  border-radius:999px;
  border:1px solid var(--line);
  color: var(--csx-muted);
  background: var(--surface-2);
  font-size:.78rem;
  font-weight:700;
  letter-spacing:.2px;
}
.csx-badge--accent{
  color: var(--accent);
  border-color: rgba(0,255,136,.22);
  background: rgba(0,255,136,.08);
}

.csx-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  border-radius:14px;
  padding:.62rem .90rem;
  border:1px solid transparent;
  font-weight:800;
  letter-spacing:.2px;
  text-decoration:none !important;
  cursor:pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
  user-select:none;
}
.csx-btn:focus-visible{ outline:none; box-shadow: 0 0 0 4px rgba(0,255,136,.14); }

.csx-btn--primary{
  background: rgba(0,255,136,.16);
  border-color: rgba(0,255,136,.32);
  color: var(--csx-text);
  box-shadow: 0 10px 28px rgba(0,255,136,.08);
}
.csx-btn--primary:hover{ background: rgba(0,255,136,.22); border-color: rgba(0,255,136,.40); transform: translateY(-1px); }
.csx-btn--primary:active{ transform: translateY(0); }

.csx-btn--ghost{
  background: transparent;
  border-color: rgba(255,255,255,.18);
  color: var(--csx-text);
}
.csx-btn--ghost:hover{ background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.26); transform: translateY(-1px); }
html[data-theme="light"] .csx-btn--ghost{
  border-color: rgba(0,0,0,.18);
  color: rgba(10,12,14,.92);
}

.csx-btn--sm{
  padding: .40rem .65rem;
  font-weight: 800;
  font-size: .86rem;
  border-radius: 12px;
}

html[data-theme="light"] .csx-btn--ghost:hover{ background: rgba(0,0,0,.04); }

.csx-progress{
  height:10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  overflow:hidden;
}
html[data-theme="light"] .csx-progress{ background: rgba(0,0,0,.04); }
.csx-progress__bar{
  height:100%;
  width:0;
  background: rgba(0,255,136,.72);
  box-shadow: 0 10px 22px rgba(0,255,136,.10);
}

.csx-label{
  display:block;
  font-weight:700;
  letter-spacing:.2px;
  color: var(--csx-text);
  margin-bottom:6px;
}
.csx-help{
  margin-top:6px;
  color: var(--csx-muted);
  font-size:.86rem;
}

.csx-input,
.csx-select,
.csx-textarea{
  width:100%;
  border-radius:14px;
  padding:.62rem .78rem;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  color: var(--csx-text);
  box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset;
  outline:none;
  transition: box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.csx-input::placeholder,
.csx-textarea::placeholder{ color: var(--csx-placeholder); }
.csx-input:focus,
.csx-select:focus,
.csx-textarea:focus{
  background: rgba(0,0,0,.22);
  border-color: rgba(0,255,136,.30);
  box-shadow: 0 0 0 4px rgba(0,255,136,.12), 0 0 0 1px rgba(0,255,136,.18) inset;
}
html[data-theme="light"] .csx-input,
html[data-theme="light"] .csx-select,
html[data-theme="light"] .csx-textarea{
  background: rgba(255,255,255,.78);
  border-color: rgba(0,0,0,.12);
  color: rgba(10,12,14,.92);
  box-shadow: 0 0 0 1px rgba(0,0,0,.04) inset;
}
html[data-theme="light"] .csx-input:focus,
html[data-theme="light"] .csx-select:focus,
html[data-theme="light"] .csx-textarea:focus{
  background: rgba(255,255,255,.92);
  border-color: rgba(0,255,136,.40);
  box-shadow: 0 0 0 4px rgba(0,255,136,.14), 0 0 0 1px rgba(0,255,136,.18) inset;
}

.csx-alert{
  border-radius:14px;
  border:1px solid var(--line);
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
  padding:.75rem .85rem;
}
html[data-theme="light"] .csx-alert{ box-shadow: 0 10px 26px rgba(0,0,0,.10); }

.csx-alert--danger{ background: rgba(220,53,69,.12); border-color: rgba(220,53,69,.25); color: var(--csx-text); }
.csx-alert--success{ background: rgba(25,135,84,.12); border-color: rgba(25,135,84,.22); color: var(--csx-text); }
.csx-alert--warning{ background: rgba(255,193,7,.14); border-color: rgba(255,193,7,.22); color: var(--csx-text); }
.csx-alert--info{ background: rgba(13,202,240,.12); border-color: rgba(13,202,240,.22); color: var(--csx-text); }

/* Utilities */
.csx-row{ display:flex; gap:12px; }
.csx-row > *{ flex:1; }
@media (max-width: 768px){ .csx-row{ flex-direction:column; } }

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .csx-btn{ transition:none; }
  .csx-btn:hover{ transform:none; }
}

/* =========================================================
   Legacy Bootstrap “dark” mapping (transition helper)
   ========================================================= */
.bg-dark{
  background: var(--surface-1) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow), var(--inner);
}
.text-light,
.text-white{
  color: var(--csx-text) !important;
}
.border-secondary{
  border-color: var(--line) !important;
}
.card{
  background: var(--surface-1) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow), var(--inner);
  border-radius: 18px;
}
.csx-platform-status{
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 1.2rem;
}
/* -----------------------------
   Market Monitor: dark / glass fix (PRO)
   Supports: .dark, .theme-dark, [data-theme="dark"], [data-bs-theme="dark"]
------------------------------ */

/* Theme markers (apply once, reuse everywhere) */
:root{
  --csx-glass-bg: rgba(255,255,255,0.04);
  --csx-glass-bg-2: rgba(255,255,255,0.03);
  --csx-glass-border: rgba(255,255,255,0.08);
  --csx-text: rgba(255,255,255,0.92);
  --csx-text-soft: rgba(255,255,255,0.90);
  --csx-muted: rgba(255,255,255,0.70);
  --csx-input-bg: rgba(0,0,0,0.35);
  --csx-input-border: rgba(255,255,255,0.10);
}

.csx-user-btn.dropdown-toggle::after{
  margin-left: 6px;
}

.csx-user-btn{
  padding: 6px 10px;
  border-radius: 999px;
}

/* Helper selector: any “dark mode” marker */
body.dark,
html.dark,
body.theme-dark,
html.theme-dark,
body[data-theme="dark"],
html[data-theme="dark"],
body[data-bs-theme="dark"],
html[data-bs-theme="dark"] {}

/* Card shell */
body.dark .csx-market-card,
html.dark .csx-market-card,
body.theme-dark .csx-market-card,
html.theme-dark .csx-market-card,
body[data-theme="dark"] .csx-market-card,
html[data-theme="dark"] .csx-market-card,
body[data-bs-theme="dark"] .csx-market-card,
html[data-bs-theme="dark"] .csx-market-card {
  background: var(--csx-glass-bg);
  border: 1px solid var(--csx-glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Header */
body.dark .csx-card-header,
html.dark .csx-card-header,
body.theme-dark .csx-card-header,
html.theme-dark .csx-card-header,
body[data-theme="dark"] .csx-card-header,
html[data-theme="dark"] .csx-card-header,
body[data-bs-theme="dark"] .csx-card-header,
html[data-bs-theme="dark"] .csx-card-header {
  background: var(--csx-glass-bg-2);
  border-bottom: 1px solid var(--csx-glass-border);
  color: var(--csx-text);
}

/* Small text in header/toolbars */
body.dark .csx-market-card .text-muted,
html.dark .csx-market-card .text-muted,
body.theme-dark .csx-market-card .text-muted,
html.theme-dark .csx-market-card .text-muted,
body[data-theme="dark"] .csx-market-card .text-muted,
html[data-theme="dark"] .csx-market-card .text-muted,
body[data-bs-theme="dark"] .csx-market-card .text-muted,
html[data-bs-theme="dark"] .csx-market-card .text-muted {
  color: var(--csx-muted) !important;
}

/* Table base */
body.dark .csx-market-card .table,
html.dark .csx-market-card .table,
body.theme-dark .csx-market-card .table,
html.theme-dark .csx-market-card .table,
body[data-theme="dark"] .csx-market-card .table,
html[data-theme="dark"] .csx-market-card .table,
body[data-bs-theme="dark"] .csx-market-card .table,
html[data-bs-theme="dark"] .csx-market-card .table {
  color: var(--csx-text-soft);
  margin-bottom: 0; /* cleaner inside card */
}

/* Table header */
body.dark .csx-market-card .table thead th,
html.dark .csx-market-card .table thead th,
body.theme-dark .csx-market-card .table thead th,
html.theme-dark .csx-market-card .table thead th,
body[data-theme="dark"] .csx-market-card .table thead th,
html[data-theme="dark"] .csx-market-card .table thead th,
body[data-bs-theme="dark"] .csx-market-card .table thead th,
html[data-bs-theme="dark"] .csx-market-card .table thead th {
  background: rgba(255,255,255,0.04);
  color: var(--csx-text-soft);
  border-color: var(--csx-glass-border);
}

/* Table cells + borders */
body.dark .csx-market-card .table td,
html.dark .csx-market-card .table td,
body.theme-dark .csx-market-card .table td,
html.theme-dark .csx-market-card .table td,
body[data-theme="dark"] .csx-market-card .table td,
html[data-theme="dark"] .csx-market-card .table td,
body[data-bs-theme="dark"] .csx-market-card .table td,
html[data-bs-theme="dark"] .csx-market-card .table td {
  border-color: var(--csx-glass-border);
}

/* Row hover (subtle) */
body.dark .csx-market-card .table tbody tr:hover,
html.dark .csx-market-card .table tbody tr:hover,
body.theme-dark .csx-market-card .table tbody tr:hover,
html.theme-dark .csx-market-card .table tbody tr:hover,
body[data-theme="dark"] .csx-market-card .table tbody tr:hover,
html[data-theme="dark"] .csx-market-card .table tbody tr:hover,
body[data-bs-theme="dark"] .csx-market-card .table tbody tr:hover,
html[data-bs-theme="dark"] .csx-market-card .table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

/* Inputs in toolbar */
body.dark .csx-market-card .form-control,
body.dark .csx-market-card .form-select,
html.dark .csx-market-card .form-control,
html.dark .csx-market-card .form-select,
body.theme-dark .csx-market-card .form-control,
body.theme-dark .csx-market-card .form-select,
html.theme-dark .csx-market-card .form-control,
html.theme-dark .csx-market-card .form-select,
body[data-theme="dark"] .csx-market-card .form-control,
body[data-theme="dark"] .csx-market-card .form-select,
html[data-theme="dark"] .csx-market-card .form-control,
html[data-theme="dark"] .csx-market-card .form-select,
body[data-bs-theme="dark"] .csx-market-card .form-control,
body[data-bs-theme="dark"] .csx-market-card .form-select,
html[data-bs-theme="dark"] .csx-market-card .form-control,
html[data-bs-theme="dark"] .csx-market-card .form-select {
  background: var(--csx-input-bg);
  border: 1px solid var(--csx-input-border);
  color: var(--csx-text);
}

/* Placeholders */
body.dark .csx-market-card .form-control::placeholder,
html.dark .csx-market-card .form-control::placeholder,
body.theme-dark .csx-market-card .form-control::placeholder,
html.theme-dark .csx-market-card .form-control::placeholder,
body[data-theme="dark"] .csx-market-card .form-control::placeholder,
html[data-theme="dark"] .csx-market-card .form-control::placeholder,
body[data-bs-theme="dark"] .csx-market-card .form-control::placeholder,
html[data-bs-theme="dark"] .csx-market-card .form-control::placeholder {
  color: rgba(255,255,255,0.55);
}

/* Hard override: Bootstrap card bg can force white; pin Market Monitor card to glass */
html[data-theme="dark"] .csx-market-card.card {
  background-color: rgba(255,255,255,0.04) !important;
}

html[data-theme="dark"] .csx-card-header {
  background-color: rgba(255,255,255,0.03) !important;
}

/* Dark table backgrounds: prevent bright/white table fill in dark mode */
html[data-theme="dark"] .csx-market-card .table,
html[data-theme="dark"] .csx-market-card .table > :not(caption) > * > * {
  background-color: transparent !important;
}

/* -------------------------------------------------
   FIX: Force readable text color in dark table
-------------------------------------------------- */
html[data-theme="dark"] .csx-market-card .table,
html[data-theme="dark"] .csx-market-card .table td,
html[data-theme="dark"] .csx-market-card .table th,
html[data-theme="dark"] .csx-market-card .table tbody td {
  color: rgba(255,255,255,0.92) !important;
}

/* Header: a bit brighter */
html[data-theme="dark"] .csx-market-card .table thead th {
  color: rgba(255,255,255,0.95) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

/* Links inside table: keep them visibly clickable */
html[data-theme="dark"] .csx-market-card .table a {
  color: rgba(140, 255, 210, 0.95) !important; /* subtle CSX-green */
  text-decoration: none;
}
html[data-theme="dark"] .csx-market-card .table a:hover {
  text-decoration: underline;
}

/* Muted values */
html[data-theme="dark"] .csx-market-card .text-muted {
  color: rgba(255,255,255,0.65) !important;
}

/* Optional zebra striping (subtle glass) */
html[data-theme="dark"] .csx-market-card .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255,255,255,0.02) !important;
}

/* Optional hover */
html[data-theme="dark"] .csx-market-card .table-hover > tbody > tr:hover > * {
  background-color: rgba(255,255,255,0.03) !important;
}

/* -----------------------------
   Footer polish (compact + clean)
------------------------------ */

/* Try to target your site footer safely */
footer,
.site-footer,
.csx-footer,
#footer {
  padding-top: 18px !important;
  padding-bottom: 18px !important;
}

/* Reduce heavy spacing inside footer columns */
footer .container,
.site-footer .container,
.csx-footer .container,
#footer .container {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Typography cleanup */
footer p,
footer li,
footer small,
.site-footer p,
.site-footer li,
.site-footer small,
.csx-footer p,
.csx-footer li,
.csx-footer small,
#footer p,
#footer li,
#footer small {
  margin-bottom: 6px !important;
  line-height: 1.35;
  opacity: 0.92;
}

/* Links in footer: subtle but clear */
footer a,
.site-footer a,
.csx-footer a,
#footer a {
  text-decoration: none;
  opacity: 0.92;
}
footer a:hover,
.site-footer a:hover,
.csx-footer a:hover,
#footer a:hover {
  text-decoration: underline;
  opacity: 1;
}

/* Footer cards/buttons: less bulky */
footer .btn,
.site-footer .btn,
.csx-footer .btn,
#footer .btn {
  padding: 8px 12px !important;
  border-radius: 12px !important;
}

/* Make room for WS pill on bottom-right */
html[data-theme="dark"] body {
  padding-bottom: 56px;
}

/* -----------------------------
   Footer icon consistency (Quick Links)
------------------------------ */

/* Target the Quick Links area safely */
html[data-theme="dark"] .footer a i,
html[data-theme="dark"] .footer a svg,
html[data-theme="dark"] .footer a img,
html[data-theme="dark"] footer a i,
html[data-theme="dark"] footer a svg,
html[data-theme="dark"] footer a img {
  /* CSX accent */
  color: rgba(140, 255, 210, 0.95) !important;
  fill: rgba(140, 255, 210, 0.95) !important;
  opacity: 1 !important;
  filter: none !important;
}

/* Make sure icons don't get overridden by link hover states */
html[data-theme="dark"] footer a:hover i,
html[data-theme="dark"] footer a:hover svg,
html[data-theme="dark"] footer a:hover img {
  color: rgba(140, 255, 210, 1) !important;
  fill: rgba(140, 255, 210, 1) !important;
}

/* -----------------------------
   Footer: icon accent everywhere
------------------------------ */
html[data-theme="dark"] footer i,
html[data-theme="dark"] footer svg,
html[data-theme="dark"] footer .fa,
html[data-theme="dark"] footer [class*="fa-"] {
  color: rgba(140, 255, 210, 0.95) !important;
  fill: rgba(140, 255, 210, 0.95) !important;
  opacity: 1 !important;
}

/* If some icons are inside muted text, keep text muted but icons colored */
html[data-theme="dark"] footer .text-muted i,
html[data-theme="dark"] footer .text-muted svg {
  color: rgba(140, 255, 210, 0.95) !important;
  fill: rgba(140, 255, 210, 0.95) !important;
}

/* -----------------------------
   WS pill: subtle glass (PRO)
------------------------------ */
#wsStatus{
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(0,0,0,0.55) !important;
  border: 1px solid rgba(255,255,255,0.12);
}
.csx-user-btn{
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px;
  text-decoration: none;
}
.csx-user-name{ line-height: 1; }
.csx-avatar{ display:block; border-radius:999px; object-fit:cover; }
.csx-user-btn.dropdown-toggle::after{
  margin-left: 6px;
}

.csx-user-btn{
  padding: 6px 10px;
  border-radius: 999px;
}
/* Profile card head: keep completeness badge aligned (fix overlap) */
.csx-card__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.csx-card__head .csx-badge{
  margin-left:auto;
  white-space:nowrap;
  flex:0 0 auto;
}
/* -------------------------------------------------
   Home widgets: list rows (Platform News + Snapshot)
-------------------------------------------------- */
.csx-home__list { display:block; }

.csx-home__row { padding: .55rem 0; }
.csx-home__row--border { border-bottom: 1px solid rgba(255,255,255,.06); }

.csx-home__rowTitle { font-weight: 900; }
.csx-home__rowDesc  { font-size: .92rem; color: var(--csx-muted, rgba(255,255,255,.72)); }
.csx-home__rowMeta  { font-size: .82rem; color: var(--csx-muted, rgba(255,255,255,.60)); margin-top: 2px; }

.csx-home__snapshotTitle { font-weight: 900; margin-bottom: .25rem; }
