/**
 * Dashboard layout — FinTech: deep dark, glassmorphism, mesh glow
 */
body.dashboard-page,
body.dashboard-page .dashboard-layout,
body.dashboard-page .dashboard-sidebar,
body.dashboard-page .dashboard-main,
body.dashboard-page .dashboard-sidebar-logo,
body.dashboard-page .dashboard-nav,
body.dashboard-page .dashboard-nav a,
body.dashboard-page .dashboard-sidebar-footer,
body.dashboard-page .dashboard-sidebar-user,
body.dashboard-page .dashboard-sidebar-footer a,
body.dashboard-page .dashboard-header,
body.dashboard-page .dashboard-title,
body.dashboard-page .dashboard-welcome,
body.dashboard-page .dashboard-content {
  font-family: var(--dash-font) !important;
}
body.dashboard-page h1,
body.dashboard-page h2,
body.dashboard-page h3 {
  font-family: var(--dash-font) !important;
}
/* Tabular numbers + monospace for alignment — KPI values use Google Sans (set in components.css) */
body.dashboard-page .live-price-card-price,
body.dashboard-page .live-price-card-change,
body.dashboard-page .dashboard-welcome {
  font-variant-numeric: tabular-nums;
  font-family: var(--dash-font-mono);
}

/* Deep dark base + dot grid (same dots as landing; dashboard uses its own bg color) */
body.dashboard-page {
  background-color: var(--dash-bg);
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: 0 0;
  background-attachment: fixed;
  background-repeat: repeat;
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

/* Hide scrollbars on dashboard — keep scroll behavior (mouse/touch/keyboard) */
body.dashboard-page .dashboard-content,
body.dashboard-page .dashboard-left,
body.dashboard-page .dashboard-nav,
body.dashboard-page .live-signals-list-wrapper {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
body.dashboard-page .dashboard-content::-webkit-scrollbar,
body.dashboard-page .dashboard-left::-webkit-scrollbar,
body.dashboard-page .dashboard-nav::-webkit-scrollbar,
body.dashboard-page .live-signals-list-wrapper::-webkit-scrollbar {
  display: none;
}

body.dashboard-page .container {
  position: relative;
}
body.dashboard-page .container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  max-width: 800px;
  height: 80vh;
  max-height: 800px;
  background: transparent;
}
/* ── Dashboard structure: [ sidebar (fixed) | main (content) ] fills viewport ── */
.dashboard-page .container {
  height: 100%;
  min-height: 0;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.dashboard-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* Sidebar: fixed left, full height — clean rail (TradingView-style polish) */
.dashboard-sidebar {
  width: 232px;
  min-width: 232px;
  flex-shrink: 0;
  background: var(--dash-sidebar-bg);
  border-right: 1px solid var(--dash-sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  height: 100dvh;
  max-height: 100dvh;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  contain: layout style;
}

/* Logo — centered in rail, slightly taller block */
.dashboard-sidebar-logo {
  padding: 20px 14px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  color: var(--dash-text);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.dashboard-sidebar-logo img {
  height: 30px;
  width: auto;
  object-fit: contain;
  animation: temto-logo-shimmer 1s ease-out 0.15s both;
}
.dashboard-sidebar-logo img.dashboard-logo-img {
  height: 30px;
}
.dashboard-sidebar-logo span.dashboard-logo-fallback {
  font-family: var(--dash-font);
  display: none;
}
@keyframes temto-logo-shimmer {
  0% { opacity: 0.7; }
  60% { opacity: 1; }
  100% { opacity: 1; }
}

/* Nav — content-sized; extra viewport space sits above footer (same bg). Scroll if list is long. */
.dashboard-nav {
  flex: 0 1 auto;
  flex-grow: 0;
  max-height: calc(
    100dvh - var(--dash-sidebar-logo-chrome) - var(--dash-sidebar-footer-chrome)
  );
  padding: 6px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.dashboard-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  min-height: 44px;
  box-sizing: border-box;
  border-radius: var(--dash-sidebar-link-radius);
  color: var(--dash-sidebar-item, var(--dash-text-muted));
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: background-color 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.dashboard-nav a:hover {
  background: var(--dash-sidebar-link-bg-hover, var(--dash-sidebar-link-bg));
  color: var(--dash-text);
  transform: none;
  box-shadow: none;
}
.dashboard-nav a:active {
  transform: none;
}
.dashboard-nav a:hover .nav-icon,
.dashboard-nav a:hover img.nav-icon {
  opacity: 1;
  filter: brightness(0) invert(1);
}
.dashboard-nav a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(94, 136, 255, 0.35);
}

/* Active: slim rail + soft fill (no heavy glow) */
.dashboard-nav a.active {
  background: var(--dash-sidebar-link-bg);
  color: var(--dash-sidebar-link);
  box-shadow: none;
  transform: none;
}
.dashboard-nav a.active:active {
  transform: none;
}
.dashboard-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 22px;
  min-height: 22px;
  background: var(--dash-sidebar-link);
  border-radius: 0 1px 1px 0;
  box-shadow: none;
  transition: opacity 0.2s ease;
}
.dashboard-nav a svg,
.dashboard-nav a .nav-icon,
.dashboard-nav a img.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.72;
  object-fit: contain;
  transition: opacity 0.18s ease, filter 0.18s ease;
  filter: brightness(0) invert(1);
}
.dashboard-nav a:hover .nav-icon,
.dashboard-nav a:hover img.nav-icon {
  opacity: 0.95;
}
.dashboard-nav a.active .nav-icon,
.dashboard-nav a.active img.nav-icon {
  opacity: 1;
  filter: var(--dash-nav-icon-active-filter);
}

/* Footer — pinned to bottom of rail so nothing “floats” with a void under Logout */
.dashboard-sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 14px 14px max(20px, env(safe-area-inset-bottom, 0px));
  border-top: none;
  position: relative;
}
.dashboard-sidebar-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 1px;
  background: var(--dash-sidebar-border);
  opacity: 0.85;
}
.dashboard-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 8px;
  min-height: 44px;
  box-sizing: border-box;
  color: var(--dash-text);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s ease;
}
.dashboard-sidebar-user .nav-icon,
.dashboard-sidebar-user img.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  object-fit: contain;
  opacity: 0.95;
  filter: brightness(0) invert(1);
  transition: filter 0.2s ease;
}
.dashboard-sidebar-footer a .nav-icon,
.dashboard-sidebar-footer a img.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  object-fit: contain;
  opacity: 0.95;
  filter: brightness(0) invert(1);
  transition: filter 0.2s ease, opacity 0.2s ease;
}
.dashboard-sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 8px;
  min-height: 44px;
  box-sizing: border-box;
  color: var(--dash-sidebar-item, var(--dash-text-muted));
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}
.dashboard-sidebar-footer a:hover {
  color: var(--dash-text);
  opacity: 1;
  transform: none;
}
.dashboard-sidebar-footer a:hover .nav-icon,
.dashboard-sidebar-footer a:hover img.nav-icon {
  opacity: 1;
  filter: brightness(0) invert(1);
}

/* Theme row — same visual language as footer links (not a primary CTA button) */
body.dashboard-page .dashboard-sidebar-footer .sidebar-theme-toggle {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px 0 8px;
  min-height: 44px;
  box-sizing: border-box;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--dash-sidebar-item, var(--dash-text-muted));
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: color 0.18s ease, opacity 0.18s ease;
}
body.dashboard-page .dashboard-sidebar-footer .sidebar-theme-toggle:hover {
  color: var(--dash-text);
  opacity: 1;
}
body.dashboard-page .dashboard-sidebar-footer .sidebar-theme-toggle .theme-icon-sun,
body.dashboard-page .dashboard-sidebar-footer .sidebar-theme-toggle .theme-icon-moon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.72;
  stroke: currentColor;
  transition: opacity 0.18s ease;
}
body.dashboard-page .dashboard-sidebar-footer .sidebar-theme-toggle:hover .theme-icon-sun,
body.dashboard-page .dashboard-sidebar-footer .sidebar-theme-toggle:hover .theme-icon-moon {
  opacity: 0.95;
}

/* Smooth page feel on full navigation (MPA) */
@keyframes dash-main-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Main content: fills space right of sidebar; scroll happens inside .dashboard-content */
.dashboard-main {
  flex: 1;
  min-width: 0;
  margin-left: 232px;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: var(--dash-pad);
  background: transparent;
  position: relative;
}
body.dashboard-page .dashboard-main {
  animation: dash-main-enter 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  body.dashboard-page .dashboard-main {
    animation: none;
  }
}
.dashboard-main::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 60%;
  height: 80%;
  pointer-events: none;
  z-index: 0;
  background: transparent;
}
.dashboard-main::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 50%;
  height: 60%;
  pointer-events: none;
  z-index: 0;
  background: transparent;
}
.dashboard-main > * {
  position: relative;
  z-index: 1;
}
.dashboard-main a {
  color: var(--dash-link);
}
.dashboard-main a:hover {
  color: var(--dash-accent);
  opacity: 0.95;
}

/* Two-column: 12-column responsive — left 8 cols, right 4 cols on large */
.dashboard-content {
  max-width: none;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--dash-gap);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
}
.dashboard-content > .dashboard-header {
  grid-column: 1 / -1;
  flex-shrink: 0;
  margin-bottom: var(--dash-gap);
  padding-top: 16px;
}
.dashboard-content > .dashboard-kpi-grid {
  grid-column: 1 / -1;
  flex-shrink: 0;
  margin-bottom: 16px;
}
.dashboard-content > .dashboard-columns {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--dash-gap);
  align-items: start;
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}
.dashboard-left {
  grid-column: span 8;
  min-height: auto;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: var(--dash-gap);
}
.dashboard-right {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  min-height: auto;
  overflow: visible;
  position: relative;
}
/* Left column: movers stack naturally, then Connections — no stretch gap */
.dashboard-left .movers-root {
  flex: 0 0 auto;
  min-height: auto;
}
.dashboard-left .connections-wrap {
  flex-shrink: 0;
  margin-bottom: 0;
}
.dashboard-left .connections-wrap .connections-card {
  margin-bottom: 0;
}
.dashboard-right {
  display: flex;
  flex-direction: column;
  min-height: auto;
  overflow: visible;
  position: relative;
}
.dashboard-right .live-signals-wrap {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: auto;
  margin-bottom: 0;
  overflow: visible;
}
/* Connections: natural height, page scrolls */
.dashboard-right .connections-wrap {
  flex: 0 0 auto;
  min-height: auto;
  display: flex;
  flex-direction: column;
}
.dashboard-right .connections-wrap .connections-card {
  flex: 0 0 auto;
  min-height: auto;
  display: flex;
  flex-direction: column;
}
.dashboard-right .connections-wrap .connections-grid {
  flex: 0 0 auto;
}
/* Right sidebar: single-column connections so cards use full width */
.dashboard-right .connections-wrap .connections-grid {
  grid-template-columns: 1fr;
}
.dashboard-right .connections-wrap .connections-grid .connection-card:nth-child(5) {
  grid-column: 1;
}
.dashboard-right .connections-wrap .expandable-section {
  flex: 0 0 auto;
}
.live-signals-list-wrapper {
  overflow: visible;
  flex: 0 0 auto;
  min-height: auto;
  margin-top: 16px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--dash-gap);
  padding: 0;
  flex-wrap: wrap;
  gap: var(--dash-gap-sm);
}
.dashboard-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--dash-title-color);
  margin: 0;
  padding-top: 10px;
  letter-spacing: -0.02em;
  font-family: var(--dash-font-display);
}
.dashboard-title-gradient {
  background: linear-gradient(135deg, var(--dash-title-gradient-start) 0%, var(--dash-title-gradient-mid) 50%, var(--dash-title-gradient-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dashboard-welcome {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dash-text-muted);
  font-size: 14px;
  font-weight: 500;
}
.dashboard-welcome .welcome-icon,
.dashboard-welcome img.welcome-icon {
  width: 22px;
  height: 22px;
  opacity: 1;
  object-fit: contain;
  flex-shrink: 0;
}
.dashboard-welcome .welcome-icon.spin-on-load {
  animation: polaris-spin 1s ease-in-out forwards;
}
@keyframes polaris-spin {
  from { transform: rotate(0deg); opacity: 0.6; }
  to { transform: rotate(360deg); opacity: 1; }
}
.dashboard-welcome .welcome-typed {
  min-height: 1.2em;
}
.dashboard-welcome .welcome-typed::after {
  content: '|';
  animation: cursor-blink 0.8s step-end infinite;
  color: var(--dash-text-muted);
}
.dashboard-welcome .welcome-typed.done::after {
  display: none;
}
@keyframes cursor-blink {
  50% { opacity: 0; }
}

/* === Dashboard page: hide top navbar/strategy-bar, full-width container, flash alignment === */
body.dashboard-page .navbar,
body.dashboard-page .strategy-bar {
  display: none !important;
}
body.dashboard-page .container {
  max-width: none;
  padding: 0;
  margin: 0;
}
body.dashboard-page .container > .flash {
  margin-left: 232px;
}
@media (max-width: 768px) {
  body.dashboard-page .container > .flash {
    margin-left: 56px;
  }
}
@media (max-width: 480px) {
  body.dashboard-page .container > .flash {
    margin-left: 0;
    padding-left: 52px;
    box-sizing: border-box;
  }
}

/* XLM (Stellar) logo is black — add light background so it’s visible on dark theme */
.sig-logo[data-coin="XLM"],
.sig-logo[data-coin-mobile="XLM"],
.live-price-card-logo[data-coin="XLM"] {
  background: rgba(255, 255, 255, 0.95) !important;
  padding: 2px;
  box-sizing: border-box;
}
.sig-logo[data-coin="XLM"] img,
.sig-logo[data-coin-mobile="XLM"] img,
.live-price-card-logo[data-coin="XLM"] img {
  border-radius: 50%;
}
