:root {
  --bg-deep: #0a0e1a;
  --bg-card: rgba(18, 24, 42, 0.72);
  --accent: #00d4ff;
  --accent2: #7c3aed;
  --text: #e8f1ff;
  --muted: #8b9bb4;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --glass-border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body.theme-dark {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(0, 212, 255, 0.15), transparent),
    radial-gradient(900px 500px at 90% 0%, rgba(124, 58, 237, 0.2), transparent),
    var(--bg-deep);
}
body.theme-dark.compact-mode {
  font-size: 0.92rem;
}
body.theme-dark.compact-mode .glass-card {
  border-radius: 12px;
}
body.theme-dark.compact-mode .p-4 { padding: 1rem !important; }
body.theme-dark.compact-mode .p-3 { padding: 0.75rem !important; }

body.theme-dark.light-terminal {
  --bg-deep: #eef3ff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --text: #0b1730;
  --muted: #4a5f84;
  --glass-border: rgba(5, 24, 59, 0.14);
}
body.theme-dark.light-terminal .exchange-topbar,
body.theme-dark.light-terminal .market-strip {
  background: rgba(244, 248, 255, 0.9);
}
body.theme-dark.light-terminal .table-darkish {
  --bs-table-color: #0f223f;
}
body.theme-dark.light-terminal .table-darkish thead th {
  background: rgba(232, 240, 255, 0.92);
}

.exchange-topbar {
  position: sticky;
  top: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(6, 10, 20, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.exchange-topbar__left,
.exchange-topbar__right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.exchange-topbar__search {
  width: min(38vw, 420px);
}
.exchange-topbar__search .form-control {
  height: 32px;
  border-radius: 8px;
  font-size: 0.82rem;
}
.exchange-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}
.exchange-topbar__title {
  font-weight: 600;
  letter-spacing: 0.01em;
}
.exchange-topbar__page,
.exchange-topbar__sep {
  color: var(--muted);
  font-size: 0.9rem;
}
.exchange-pill {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 212, 255, 0.35);
  background: rgba(0, 212, 255, 0.08);
  color: #d8f7ff;
  font-size: 0.75rem;
}
.exchange-clock {
  font-variant-numeric: tabular-nums;
}

.market-strip {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 12, 24, 0.88);
  overflow: hidden;
}
.market-strip__track {
  display: flex;
  gap: 1.25rem;
  padding: 0.35rem 1rem;
  white-space: nowrap;
  animation: market-scroll 26s linear infinite;
}
.mkt {
  font-size: 0.78rem;
  color: #d8e6ff;
}
.mkt.up { color: #22c55e; }
.mkt.down { color: #ef4444; }
@keyframes market-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-35%); }
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar {
  min-height: 100vh;
  border-right: 1px solid var(--glass-border);
  background: rgba(10, 14, 26, 0.85);
  position: sticky;
  top: 79px;
  max-height: calc(100vh - 79px);
  overflow: auto;
}

.sidebar .nav-link {
  color: var(--muted);
  border-radius: 10px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}

.nav-user__icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.65rem;
  letter-spacing: 0.02em;
  font-weight: 600;
  color: #d7e3ff;
  margin-right: 0.15rem;
  flex: 0 0 26px;
}

.nav-user__label {
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: var(--text);
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.28);
  transform: translateX(1px);
}

.sidebar-footnote {
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: rgba(124, 58, 237, 0.08);
}

.stat-tile h3 {
  font-size: 1.75rem;
  font-weight: 700;
}

.badge-status-pending {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}
.badge-status-approved,
.badge-status-completed {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}
.badge-status-rejected {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.table-darkish {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--glass-border);
}
.table-darkish thead th {
  color: #bcd1ff;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  position: sticky;
  top: 0;
  background: rgba(8, 14, 28, 0.94);
  z-index: 2;
}
.table-darkish tbody tr:hover {
  background: rgba(0, 212, 255, 0.06);
}

.btn-gradient {
  background: linear-gradient(90deg, #00d4ff, #7c3aed);
  border: none;
  color: #fff;
}
.btn-gradient:hover {
  filter: brightness(1.08);
  color: #fff;
}
.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.28);
}
.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.45);
}

.theme-dark .form-control,
.theme-dark .form-select,
.theme-dark textarea {
  border-color: rgba(255, 255, 255, 0.14) !important;
  background: rgba(10, 16, 30, 0.86) !important;
  color: #e7f0ff !important;
}
.theme-dark .form-control:focus,
.theme-dark .form-select:focus,
.theme-dark textarea:focus {
  border-color: rgba(0, 212, 255, 0.62) !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 212, 255, 0.15) !important;
}

.theme-dark .alert {
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}

.tx-summary-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  border: 1px solid rgba(0, 212, 255, 0.32);
  background: rgba(0, 212, 255, 0.08);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}
.tx-summary-pill strong {
  font-size: 0.95rem;
}
.tx-filter-bar {
  border-color: rgba(255, 255, 255, 0.12);
}
.kpi-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, rgba(13, 21, 38, 0.92), rgba(10, 16, 30, 0.9));
}
.kpi-label {
  color: #9ab0d6;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kpi-value {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 0.2rem;
  font-variant-numeric: tabular-nums;
}
.exchange-chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;
}
.allocation-wrap {
  height: 210px;
}
.announcement-item:last-child {
  border-bottom: 0 !important;
}

.wallet-table td,
.wallet-table th {
  vertical-align: middle;
}
.wallet-table-premium th,
.wallet-table-premium td {
  white-space: nowrap;
}
.wallet-table-premium td:first-child,
.wallet-table-premium th:first-child {
  min-width: 210px;
}
.wallet-table-premium td:nth-child(2),
.wallet-table-premium th:nth-child(2) {
  min-width: 130px;
}
.wallet-table-premium td:nth-child(5),
.wallet-table-premium th:nth-child(5) {
  min-width: 160px;
}

.table-responsive {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 212, 255, 0.45) rgba(255, 255, 255, 0.08);
}
.table-responsive::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}
.table-responsive::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}
.table-responsive::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.85), rgba(124, 58, 237, 0.75));
  border-radius: 999px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(0, 212, 255, 1), rgba(124, 58, 237, 0.9));
}

#dashboardLeftCol,
#dashboardRightCol {
  transition: min-height 0.25s ease;
}
.orderbook-table td,
.orderbook-table th {
  font-size: 0.74rem;
}
.orderbook-table tbody tr {
  position: relative;
}
.orderbook-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}
.depth-cell {
  position: relative;
  overflow: hidden;
}
.depth-cell > span {
  position: relative;
  z-index: 1;
}
.depth-cell::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--depth-width, 0%);
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.04));
  z-index: 0;
}
.depth-cell.ask::before {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.04));
}

.live-flash {
  animation: liveFlash 0.6s ease;
}
@keyframes liveFlash {
  0% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.45); }
  100% { box-shadow: 0 0 0 12px rgba(0, 212, 255, 0); }
}
.order-ticket-form .form-range {
  accent-color: #00d4ff;
}
.order-estimate {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.order-side-btn.active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.risk-pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}
.risk-low {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
}
.risk-medium {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
}
.risk-high {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
}
.chart-range-btn.active,
.chart-range-btn:active {
  background: rgba(0, 212, 255, 0.16);
  border-color: rgba(0, 212, 255, 0.55);
  color: #dff9ff;
}
.form-label-mini {
  margin-bottom: 0.3rem;
  color: #a9b9d8;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.loader-overlay.show {
  display: flex;
}
.spinner-ring {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* —— Landing (index) —— */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 14, 26, 0.78);
  border-bottom: 1px solid var(--glass-border);
}
.landing-nav .nav-link {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
}
.landing-nav .nav-link:hover {
  color: var(--accent);
}
.landing-brand {
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  background: linear-gradient(105deg, #e0f7ff 0%, #00d4ff 35%, #a78bfa 70%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing-hero {
  padding-top: clamp(2.5rem, 8vw, 5rem);
  padding-bottom: clamp(3rem, 10vw, 6rem);
  position: relative;
  overflow: hidden;
}
.landing-hero::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -15%;
  width: min(90vw, 520px);
  height: min(90vw, 520px);
  background: radial-gradient(circle, rgba(0, 212, 255, 0.12) 0%, transparent 65%);
  pointer-events: none;
}
.landing-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.landing-kicker span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.65;
    transform: scale(0.92);
  }
}
.landing-title {
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: #f0f7ff;
}
.landing-title em {
  font-style: normal;
  background: linear-gradient(90deg, #00e5ff, #818cf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing-lead {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  max-width: 34rem;
  line-height: 1.65;
  margin-bottom: 1.75rem;
}
.landing-hero-svg {
  position: relative;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 0 48px rgba(0, 212, 255, 0.15)) drop-shadow(0 24px 64px rgba(0, 0, 0, 0.45));
  animation: float-hero 7s ease-in-out infinite;
}
@keyframes float-hero {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}
.landing-stat {
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
}
.landing-stat strong {
  display: block;
  font-family: "Outfit", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}
.landing-stat span {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.landing-section-title {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}
.landing-feature {
  height: 100%;
  padding: 1.5rem;
  border-radius: 16px;
  background: rgba(18, 24, 42, 0.55);
  border: 1px solid var(--glass-border);
  transition: border-color 0.2s, transform 0.2s;
}
.landing-feature:hover {
  border-color: rgba(0, 212, 255, 0.35);
  transform: translateY(-3px);
}
.landing-feature svg {
  width: 44px;
  height: 44px;
  margin-bottom: 1rem;
}
.landing-feature h3 {
  font-family: "Outfit", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.landing-feature p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}
.market-overview-card .landing-section-title {
  font-size: 1.35rem;
}
.market-overview-card .table-darkish td,
.market-overview-card .table-darkish th {
  white-space: nowrap;
}
.landing-cta-band {
  margin: 3rem 0 4rem;
  padding: clamp(2rem, 5vw, 3rem);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(124, 58, 237, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}
.landing-footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--glass-border);
  color: var(--muted);
  font-size: 0.85rem;
}
.landing-footer a {
  color: var(--muted);
  text-decoration: none;
}
.landing-footer a:hover {
  color: var(--accent);
}

/* —— Login page —— */
body.login-page {
  min-height: 100vh;
  position: relative;
}
.login-page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% 20%, rgba(124, 58, 237, 0.22), transparent),
    radial-gradient(ellipse 60% 45% at 15% 80%, rgba(0, 212, 255, 0.12), transparent),
    var(--bg-deep);
  pointer-events: none;
}
.login-page .container {
  z-index: 1;
}
.login-art-wrap {
  position: relative;
  max-width: min(100%, 400px);
}
.login-art-img {
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 40px rgba(0, 212, 255, 0.2)) drop-shadow(0 20px 50px rgba(0, 0, 0, 0.45));
  animation: login-float 8s ease-in-out infinite;
}
@keyframes login-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.01);
  }
}
.login-art-glow {
  position: absolute;
  inset: 10% 5% 15%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.15) 0%, transparent 70%);
  z-index: 0;
  animation: login-glow-pulse 5s ease-in-out infinite;
}
@keyframes login-glow-pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}
.login-form-card {
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.login-brand-title {
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  background: linear-gradient(105deg, #e0f7ff, #00d4ff, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-brand-sub {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.login-heading {
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f0f7ff;
}
.login-policy {
  line-height: 1.55;
}
.login-input:focus {
  border-color: rgba(0, 212, 255, 0.55) !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 212, 255, 0.12);
}

/* —— Public content pages —— */
.public-main h1,
.public-main h2 {
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 700;
}
.public-main h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 1.25rem;
  color: #f0f7ff;
}
.public-main .lead {
  color: var(--muted);
}
.public-main section {
  margin-bottom: 2rem;
}
.public-main .glass-card {
  padding: 1.5rem;
}

/* —— In-app (user) pages —— */
.theme-dark .col-lg-10 > h1,
.theme-dark .col-lg-10 > .h3 {
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Staff console sign-in (distinct accent from member login) */
.admin-login-art .login-art-glow {
  background: radial-gradient(
    circle at 50% 45%,
    rgba(124, 58, 237, 0.45) 0%,
    rgba(0, 212, 255, 0.12) 42%,
    transparent 72%
  );
}

@media (max-width: 991.98px) {
  .exchange-topbar {
    position: static;
  }
  .exchange-topbar__search {
    display: none;
  }
  .market-strip__track {
    animation: none;
    overflow-x: auto;
  }
  .sidebar {
    position: static;
    min-height: auto;
    max-height: none;
    top: auto;
    margin-bottom: 1rem;
  }
}
