/* ========== DASHBOARD / APP LAYOUT ========== */

.app-body {
  background: #131316;
  min-height: 100vh;
  display: flex;
}

/* ========== SIDEBAR ========== */
.app-sidebar {
  width: 240px;
  min-width: 240px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-sidebar, 1110);
  background: #15151a;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-sidebar::-webkit-scrollbar {
  width: 4px;
}

.app-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.app-sidebar::-webkit-scrollbar-thumb {
  background: rgba(92, 184, 230, 0.3);
  border-radius: 2px;
}
.app-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(92, 184, 230, 0.5);
}

/* Sidebar Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 24px;
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-logo .logo-mark {
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 17px;
  font-weight: 700;
  color: #e0e0e8;
  letter-spacing: 1.5px;
}

/* Sidebar Sections */
.sidebar-section {
  padding: 0 12px;
  margin-bottom: 4px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  color: #b0b0c0;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 8px 12px 6px;
}

/* Collapsible Section Header */
.sidebar-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
  border-radius: 6px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}

.sidebar-group-header:hover {
  background: rgba(255,255,255,0.02);
}

.sidebar-group-header .sidebar-section-label {
  padding: 0;
  margin: 0;
  pointer-events: none;
}

.sidebar-group-chevron {
  width: 14px;
  height: 14px;
  color: #3a3a4a;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.sidebar-group.collapsed .sidebar-group-chevron {
  transform: rotate(-90deg);
}

/* Collapsible Group Items */
.sidebar-group-items {
  max-height: 800px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  opacity: 1;
}

.sidebar-group.collapsed .sidebar-group-items {
  max-height: 0;
  opacity: 0;
}

/* Sidebar Nav Items */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  margin: 1px 0;
  border-radius: 8px;
  color: #8a8a9a;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border-left: 2px solid transparent;
}

.sidebar-nav-item:hover {
  color: #b8b8c4;
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-nav-item.active {
  color: #5cb8e6;
  background: rgba(92, 184, 230, 0.06);
  border-left-color: #5cb8e6;
}

.sidebar-nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav-item.active svg {
  opacity: 1;
}

/* GB-07: paused / disabled sidebar items (options kill-switch) */
.sidebar-nav-item.sidebar-nav-item-disabled {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}
.sidebar-nav-item-disabled .sidebar-nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(224, 160, 80, 0.18);
  color: #e0a050;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Coin wallet items */
.sidebar-coin-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  margin: 1px 0;
  border-radius: 8px;
  color: #8a8a9a;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border-left: 2px solid transparent;
}

.sidebar-coin-item:hover {
  color: #c8c8d4;
  background: rgba(255,255,255,0.04);
}

.sidebar-coin-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-coin-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-coin-ticker {
  font-size: 11px;
  color: #4a4a5a;
  font-weight: 400;
}

.sidebar-coin-expand {
  width: 14px;
  height: 14px;
  color: #4a4a5a;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.sidebar-coin-item.expanded .sidebar-coin-expand {
  transform: rotate(90deg);
}

/* Coin sub-items (Send, Receive, Trade) */
.sidebar-coin-subitems {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 0;
}

.sidebar-coin-subitems.open {
  max-height: 120px;
  opacity: 1;
}

.sidebar-coin-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 46px;
  color: #6a6a7a;
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  transition: all 0.15s;
  cursor: pointer;
  border-radius: 6px;
}

.sidebar-coin-subitem:hover {
  color: #c8c8d4;
  background: rgba(255,255,255,0.03);
}

.sidebar-coin-subitem svg {
  flex-shrink: 0;
  opacity: 0.5;
}

/* Sidebar Spacer */
.sidebar-spacer {
  flex: 1;
  min-height: 8px;
}

/* Sidebar nav scrollable area */
.sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
}

.sidebar-nav-scroll::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}

/* Sidebar Bottom Section */
.sidebar-bottom {
  padding: 4px 0 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 8px;
  margin-bottom: 4px;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5cb8e6, #4a9cd4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 11px;
  color: #6a6a7a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #e0a050;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.sidebar-logout:hover {
  background: rgba(224, 160, 80, 0.08);
}

.sidebar-logout svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* ========== SLIM TOP BAR ========== */
.app-topbar {
  position: fixed;
  top: 0;
  left: 240px;
  right: 0;
  height: 52px;
  background: #1a1a1f;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: var(--z-topbar, 900);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.topbar-breadcrumb a {
  color: #6a6a7a;
  text-decoration: none;
  transition: color 0.15s;
}

.topbar-breadcrumb a:hover {
  color: #a8a8b8;
}

.topbar-breadcrumb svg {
  color: #4a4a5a;
}

.topbar-breadcrumb span {
  color: #e0e0e8;
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Hamburger toggle (mobile only) */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: #8a8a9a;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.15s;
}

.sidebar-toggle:hover {
  color: #e0e0e8;
  background: rgba(255,255,255,0.04);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: var(--z-sidebar-overlay, 1100);
}

.sidebar-overlay.active {
  display: block;
}

/* Notification bell in topbar */
.app-icon-btn {
  position: relative;
  background: none;
  border: none;
  color: #8a8a9a;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.app-icon-btn:hover {
  color: #e0e0e8;
  background: rgba(255,255,255,0.04);
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: #5cb8e6;
  border-radius: 50%;
  border: 2px solid #1a1a1f;
}

/* ========== APP CONTENT WRAPPER ========== */
.app-content-wrapper {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
  padding-top: 52px;
  transition: margin-left 0.2s ease;
}

/* ========== BUG #15: SIDEBAR COLLAPSED STATE ==========
   Icon-only sidebar (64px) with hover tooltips. body.sidebar-collapsed mirrors
   the .app-sidebar.collapsed class so content margin and topbar offset shift
   without relying on `:has()` selector support. */
.app-sidebar {
  transition: width 0.2s ease;
}
.app-sidebar.collapsed {
  width: 64px;
  min-width: 64px;
}

/* Sidebar header — flex row to host logo + collapse button */
.sidebar-header {
  display: flex;
  align-items: center;
  padding: 0 12px 0 0;
}
.sidebar-header .sidebar-logo {
  flex: 1;
}
.sidebar-collapse-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px;
  color: #8a8a9a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.sidebar-collapse-btn:hover { color: #e0e0e8; }
.sidebar-collapse-btn svg { transition: transform 0.2s ease; }
.app-sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

/* Hide labels and group headers when collapsed.
   NOTE: `.sidebar-collapse-btn` is intentionally NOT in this list — keeping it
   visible (just centered + flipped) so the user can re-expand the sidebar.
   The hidden `.sidebar-logo` is replaced with the collapse button alone in
   the centered header. */
.app-sidebar.collapsed .logo-text,
.app-sidebar.collapsed .sidebar-section-label,
.app-sidebar.collapsed .sidebar-group-chevron,
.app-sidebar.collapsed .sidebar-group-header,
.app-sidebar.collapsed .sidebar-nav-label,
.app-sidebar.collapsed .sidebar-coin-name,
.app-sidebar.collapsed .sidebar-coin-ticker,
.app-sidebar.collapsed .sidebar-coin-expand,
.app-sidebar.collapsed .sidebar-coin-subitems,
.app-sidebar.collapsed .sidebar-user-info,
.app-sidebar.collapsed .sidebar-logout-label,
.app-sidebar.collapsed .sidebar-logo {
  display: none !important;
}

/* Center icons when collapsed */
.app-sidebar.collapsed .sidebar-nav-item,
.app-sidebar.collapsed .sidebar-coin-item,
.app-sidebar.collapsed .sidebar-logout {
  justify-content: center;
  padding: 12px 0;
}
.app-sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 16px 0 12px;
}
.app-sidebar.collapsed .sidebar-collapse-btn {
  margin: 0;
}

/* Active nav highlight stays visible in collapsed mode without left border */
.app-sidebar.collapsed .sidebar-nav-item.active {
  border-left: none;
  background: rgba(92, 184, 230, 0.12);
}

/* Allow tooltips to escape the sidebar overflow boundary when collapsed.
   Sidebar default has `overflow: hidden`; we restore visible-x in collapsed
   mode so the absolutely-positioned tooltip is not clipped. */
.app-sidebar.collapsed {
  overflow: visible;
}
.app-sidebar.collapsed .sidebar-nav-scroll {
  overflow-x: visible;
}

/* Tooltip when collapsed (hover or keyboard focus shows full label) —
   covers both `.sidebar-nav-item` and the `.sidebar-logout` button. */
.app-sidebar.collapsed .sidebar-nav-item,
.app-sidebar.collapsed .sidebar-logout {
  position: relative;
}
.app-sidebar.collapsed .sidebar-nav-item::after,
.app-sidebar.collapsed .sidebar-logout::after {
  content: attr(data-nav-label);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #2a2a35;
  color: #e0e0e8;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 1200;
}
.app-sidebar.collapsed .sidebar-nav-item:hover::after,
.app-sidebar.collapsed .sidebar-nav-item:focus-visible::after,
.app-sidebar.collapsed .sidebar-logout:hover::after,
.app-sidebar.collapsed .sidebar-logout:focus-visible::after {
  opacity: 1;
}

/* Content margin shifts with collapsed sidebar */
body.sidebar-collapsed .app-content-wrapper {
  margin-left: 64px;
}
body.sidebar-collapsed .app-topbar {
  left: 64px;
}

/* ========== MAIN CONTENT ========== */
.app-main {
  padding: 28px 40px 80px;
}


/* ==================================================================
   DASHBOARD-SPECIFIC STYLES
   ================================================================== */

/* ========== WELCOME / HEADER ========== */
.dash-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.dash-welcome h1 {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: #e0e0e8;
  margin-bottom: 4px;
}

.dash-welcome h1 span {
  color: #5cb8e6;
}

.dash-date {
  font-size: 13px;
  color: #6a6a7a;
}

.dash-welcome-actions {
  display: flex;
  gap: 10px;
}

/* Simple / Pro mode toggle */
.mode-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  color: #6a7280;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.mode-btn:hover {
  color: #e0e0e8;
  border-color: rgba(255,255,255,0.15);
}

.mode-btn.active {
  color: #5cb8e6;
  background: rgba(92, 184, 230, 0.1);
  border-color: rgba(92, 184, 230, 0.25);
}

.btn-sm {
  font-size: 13px;
  padding: 10px 24px;
}

/* ========== DASHBOARD GRID ROWS ========== */
.dash-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dash-row-top {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
  margin-bottom: 16px;
}

/* ========== DASH CARD ========== */
.dash-card {
  background: #0d1117;
  border-radius: 12px;
  padding: 20px 24px;
  border: 1px solid rgba(255,255,255,0.04);
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dash-card-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: #e5e7eb;
  margin: 0;
}

.dash-card-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: #8a8a9a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.dash-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #e0e0e8;
}

.dash-card-label {
  font-size: 12px;
  font-weight: 500;
  color: #6a6a7a;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.dash-card-link {
  font-size: 12px;
  color: #5cb8e6;
  text-decoration: none;
  font-weight: 500;
}

.dash-card-link:hover {
  text-decoration: underline;
}

.dash-badge {
  font-size: 11px;
  font-weight: 600;
  color: #5cb8e6;
  background: rgba(92, 184, 230, 0.1);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* ========== SIDEBAR STACK (right column stacking) ========== */
.dash-sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ========== QUICK ACTIONS (Command Center) ========== */
.quick-actions {
  display: flex;
  gap: 10px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(92, 184, 230, 0.08);
  border: 1px solid rgba(92, 184, 230, 0.15);
  border-radius: 8px;
  color: #5cb8e6;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
}

.quick-action-btn:hover {
  background: rgba(92, 184, 230, 0.14);
  border-color: rgba(92, 184, 230, 0.3);
}

.quick-action-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* ========== NEXT ACTION BANNER ========== */
.next-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(92, 184, 230, 0.06), rgba(224, 160, 80, 0.04));
  border: 1px solid rgba(92, 184, 230, 0.12);
  border-radius: 8px;
  margin-top: 4px;
}

.next-action-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.next-action-text {
  flex: 1;
  font-size: 13px;
  color: #c0c0cc;
  line-height: 1.4;
}

.next-action-text strong {
  color: #e0e0e8;
  font-weight: 600;
}

.next-action-link {
  font-size: 12px;
  color: #5cb8e6;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.next-action-link:hover {
  text-decoration: underline;
}

/* ========== ONBOARDING CHECKLIST ========== */
.onboarding-checklist {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6a7280;
  white-space: nowrap;
}

.onboarding-step.done {
  color: #4ecb71;
}

.onboarding-step.active {
  color: #5cb8e6;
  font-weight: 600;
}

.onboarding-step-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.1);
  color: #6a7280;
}

.onboarding-step.done .onboarding-step-icon {
  background: rgba(78, 203, 113, 0.15);
  border-color: rgba(78, 203, 113, 0.3);
  color: #4ecb71;
}

.onboarding-step.active .onboarding-step-icon {
  background: rgba(92, 184, 230, 0.15);
  border-color: rgba(92, 184, 230, 0.3);
  color: #5cb8e6;
}

.onboarding-progress {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.onboarding-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #5cb8e6, #4ecb71);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ========== ACCOUNT SNAPSHOT ========== */
.snapshot-total {
  margin-bottom: 16px;
}

.snapshot-label {
  font-size: 11px;
  color: #6a7280;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.snapshot-value {
  font-size: 32px;
  font-weight: 700;
  color: #e0e0e8;
  letter-spacing: -0.5px;
  line-height: 1;
}

.snapshot-value .cents {
  font-size: 20px;
  color: #8a8a9a;
}

.snapshot-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 6px;
}

.snapshot-change.positive { color: #4ecb71; }
.snapshot-change.negative { color: #e65c5c; }

.snapshot-timeframe {
  color: #6a7280;
  font-weight: 400;
  margin-left: 6px;
}

/* Snapshot Breakdown Grid */
.snapshot-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.snapshot-metric {
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.03);
}

.metric-label {
  font-size: 11px;
  color: #6a7280;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 16px;
  font-weight: 600;
  color: #e0e0e8;
  font-variant-numeric: tabular-nums;
}

.metric-sub {
  font-size: 11px;
  color: #6a7280;
  margin-top: 2px;
}

/* Snapshot Chart — empty state while historical data is not yet implemented */
.snapshot-chart {
  margin-top: 16px;
}

.snapshot-chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.06);
  border-radius: 10px;
  text-align: center;
}

.snapshot-chart-empty-icon {
  opacity: 0.8;
  margin-bottom: 2px;
}

.snapshot-chart-empty-title {
  font-size: 12px;
  font-weight: 600;
  color: #8a8a9a;
}

.snapshot-chart-empty-sub {
  font-size: 11px;
  color: #8a8a9a;
  max-width: 240px;
  line-height: 1.45;
}

/* ========== POSITIONS TABS ========== */
.positions-tabs {
  display: flex;
  gap: 4px;
}

.pos-tab {
  background: none;
  border: none;
  color: #6a6a7a;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.3px;
}

.pos-tab:hover {
  color: #e0e0e8;
  background: rgba(255,255,255,0.04);
}

.pos-tab.active {
  color: #5cb8e6;
  background: rgba(92, 184, 230, 0.15);
}

.positions-panel {
  display: none;
}

.positions-panel.active {
  display: block;
}

.positions-scroll {
  overflow-x: auto;
}

.positions-scroll::-webkit-scrollbar {
  height: 4px;
}

.positions-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.positions-scroll::-webkit-scrollbar-thumb {
  background: rgba(92, 184, 230, 0.3);
  border-radius: 2px;
}
.positions-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(92, 184, 230, 0.5);
}

.positions-header,
.position-row {
  display: flex;
  align-items: center;
  min-width: 820px;
}

.positions-header {
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 10px;
  margin-bottom: 2px;
}

.positions-header .pcol {
  font-size: 11px;
  font-weight: 600;
  color: #4a4a5a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.position-row {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.15s;
  cursor: pointer;
}

.position-row:last-child {
  border-bottom: none;
}

.position-row:hover {
  background: rgba(255,255,255,0.015);
}

/* Position columns */
.pcol {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.pcol-inst { width: 160px; }
.pcol-type { width: 75px; font-size: 11px; line-height: 1.3; }
.pcol-side { width: 70px; }
.pcol-size { width: 95px; font-size: 13px; color: #a8a8b8; }
.pcol-entry { width: 95px; font-size: 13px; color: #6a6a7a; }
.pcol-mark { width: 95px; font-size: 13px; color: #e0e0e8; font-weight: 500; }
.pcol-liq { width: 95px; font-size: 13px; color: #6a6a7a; }
.pcol-lev { width: 60px; }
.pcol-pnl { flex: 1; text-align: right; min-width: 120px; }
.pcol-strike { width: 85px; font-size: 13px; color: #a8a8b8; }
.pcol-iv { width: 65px; font-size: 13px; color: #a8a8b8; }
.pcol-delta { width: 65px; font-size: 13px; color: #a8a8b8; }
.pcol-expiry { width: 60px; text-align: right; font-size: 12px; color: #6a6a7a; }

/* Instrument cell */
.inst-name {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e8;
  letter-spacing: 0.2px;
}

.inst-exchange {
  font-size: 11px;
  color: #4a4a5a;
  margin-top: 2px;
}

/* Side tags */
.side-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.side-tag.long {
  color: #4ecb71;
  background: rgba(78, 203, 113, 0.1);
}

.side-tag.short {
  color: #e65c5c;
  background: rgba(230, 92, 92, 0.1);
}

/* Leverage tag */
.lev-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #e6a85c;
  background: rgba(230, 168, 92, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Type tags (Call/Put) */
.type-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

.type-tag.call {
  color: #4ecb71;
  background: rgba(78, 203, 113, 0.1);
}

.type-tag.put {
  color: #e65c5c;
  background: rgba(230, 92, 92, 0.1);
}

/* PnL values */
.pnl-val {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pnl-val.positive { color: #4ecb71; }
.pnl-val.negative { color: #e65c5c; }

.pnl-roe {
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
}

.pnl-roe.positive { color: rgba(78, 203, 113, 0.7); }
.pnl-roe.negative { color: rgba(230, 92, 92, 0.7); }

/* Positions summary footer */
.positions-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.positions-count {
  font-size: 12px;
  color: #4a4a5a;
}

.positions-total {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #6a6a7a;
}

.positions-total .pnl-val {
  font-size: 14px;
}

/* Empty state for positions */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
}

.empty-state-icon {
  font-size: 28px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state-text {
  font-size: 13px;
  color: #6a7280;
  margin-bottom: 12px;
  line-height: 1.5;
}

.empty-state-actions {
  display: flex;
  gap: 8px;
}

.empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #5cb8e6;
  background: rgba(92, 184, 230, 0.08);
  border: 1px solid rgba(92, 184, 230, 0.15);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.empty-cta:hover {
  background: rgba(92, 184, 230, 0.14);
  border-color: rgba(92, 184, 230, 0.3);
}

/* ========== MARKET TICKERS ========== */
.market-tickers {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.market-tickers::-webkit-scrollbar {
  height: 3px;
}

.market-tickers::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
}

.market-ticker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.03);
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 0;
}

.market-ticker-name {
  font-size: 12px;
  font-weight: 600;
  color: #e0e0e8;
}

/* Bug #20 fix: fixed-width price to prevent layout shift on price updates */
.market-ticker-price {
  font-size: 12px;
  color: #a8a8b8;
  font-variant-numeric: tabular-nums;
  min-width: 75px;
  text-align: right;
}

.market-ticker-change {
  font-size: 11px;
  font-weight: 600;
}

.market-ticker-change.positive { color: #4ecb71; }
.market-ticker-change.negative { color: #e65c5c; }

/* ========== AI SHORTCUTS ========== */
.ai-shortcuts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-shortcut-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 8px;
  color: #c0c0cc;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.ai-shortcut-btn:hover {
  background: rgba(92, 184, 230, 0.06);
  border-color: rgba(92, 184, 230, 0.12);
  color: #e0e0e8;
}

.ai-shortcut-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* ========== FEATURE CARDS ========== */
.feature-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.feature-card:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(92, 184, 230, 0.15);
  box-shadow: 0 0 0 1px rgba(92, 184, 230, 0.08);
}

.feature-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: rgba(92, 184, 230, 0.08);
}

.feature-card-body {
  flex: 1;
  min-width: 0;
}

.feature-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e8;
  margin-bottom: 2px;
}

.feature-card-desc {
  font-size: 12px;
  color: #6a7280;
  line-height: 1.4;
}

/* ========== HOLDINGS LIST ========== */
.holdings-list {
  display: flex;
  flex-direction: column;
}

.holding-row {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.holding-row:last-child {
  border-bottom: none;
}

.holding-asset {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 140px;
}

.holding-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.holding-icon.btc { background: linear-gradient(135deg, #f7931a, #e8830e); }
.holding-icon.eth { background: linear-gradient(135deg, #627eea, #4c6bdf); }
.holding-icon.sol { background: linear-gradient(135deg, #9945ff, #14f195); }
.holding-icon.usdc { background: linear-gradient(135deg, #2775ca, #1a5fb4); }

.holding-name {
  font-size: 14px;
  font-weight: 500;
  color: #e0e0e8;
}

.holding-ticker {
  font-size: 12px;
  color: #6a6a7a;
  margin-top: 1px;
}

.holding-mid {
  flex: 1;
  padding: 0 16px;
}

.spark-chart {
  width: 80px;
  height: 30px;
  display: block;
}

.holding-values {
  text-align: right;
  min-width: 100px;
}

.holding-amount {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e8;
  font-variant-numeric: tabular-nums;
}

.holding-change {
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}

.holding-change.positive { color: #4ecb71; }
.holding-change.negative { color: #e65c5c; }
.holding-change.neutral { color: #6a6a7a; }

/* ========== FUNDING ACTIONS ========== */
.funding-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.funding-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}

.funding-btn.deposit {
  background: rgba(78, 203, 113, 0.08);
  border-color: rgba(78, 203, 113, 0.15);
  color: #4ecb71;
}

.funding-btn.deposit:hover {
  background: rgba(78, 203, 113, 0.14);
}

.funding-btn.withdraw {
  background: rgba(224, 160, 80, 0.08);
  border-color: rgba(224, 160, 80, 0.15);
  color: #e0a050;
}

.funding-btn.withdraw:hover {
  background: rgba(224, 160, 80, 0.14);
}

.funding-btn.buy {
  background: rgba(92, 184, 230, 0.08);
  border-color: rgba(92, 184, 230, 0.15);
  color: #5cb8e6;
}

.funding-btn.buy:hover {
  background: rgba(92, 184, 230, 0.14);
}

.funding-btn.convert {
  background: rgba(168, 130, 230, 0.08);
  border-color: rgba(168, 130, 230, 0.15);
  color: #a882e6;
}

.funding-btn.convert:hover {
  background: rgba(168, 130, 230, 0.14);
}

.funding-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* ========== DEBIT CARD WIDGET ========== */
.dash-debit-card {
  padding: 16px 20px;
}

.debit-card-visual {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.debit-card-chip {
  width: 44px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2a2a36, #3a3a46);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.debit-card-info {
  flex: 1;
}

.debit-card-number {
  font-size: 13px;
  font-weight: 500;
  color: #a8a8b8;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.debit-card-name {
  font-size: 11px;
  color: #6a7280;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.debit-card-balance {
  margin-bottom: 12px;
}

.debit-card-balance-label {
  font-size: 11px;
  color: #6a7280;
  margin-bottom: 2px;
}

.debit-card-balance-value {
  font-size: 20px;
  font-weight: 700;
  color: #e0e0e8;
  font-variant-numeric: tabular-nums;
}

.debit-card-txns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.debit-card-txn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.debit-card-txn-name {
  color: #a8a8b8;
}

.debit-card-txn-amount {
  color: #e0e0e8;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ========== INSIGHTS GRID ========== */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.insight-card {
  padding: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.insight-card:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(92, 184, 230, 0.12);
}

.insight-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.insight-tag.market {
  color: #5cb8e6;
  background: rgba(92, 184, 230, 0.1);
}

.insight-tag.strategy {
  color: #e0a050;
  background: rgba(224, 160, 80, 0.1);
}

.insight-tag.education {
  color: #a882e6;
  background: rgba(168, 130, 230, 0.1);
}

.insight-title {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e8;
  margin-bottom: 4px;
  line-height: 1.4;
}

.insight-desc {
  font-size: 12px;
  color: #6a7280;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.insight-meta {
  font-size: 11px;
  color: #4a4a5a;
}

/* ========== ACTIVITY LIST ========== */
.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.activity-row:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.activity-icon.deposit {
  background: rgba(78, 203, 113, 0.1);
  color: #4ecb71;
}

.activity-icon.trade {
  background: rgba(92, 184, 230, 0.1);
  color: #5cb8e6;
}

.activity-icon.card-tx {
  background: rgba(168, 168, 184, 0.08);
  color: #8a8a9a;
}

.activity-icon.withdrawal {
  background: rgba(224, 160, 80, 0.1);
  color: #e0a050;
}

.activity-info {
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-size: 13px;
  font-weight: 500;
  color: #e0e0e8;
}

.activity-desc {
  font-size: 11px;
  color: #6a6a7a;
  margin-top: 1px;
}

.activity-values {
  text-align: right;
  flex-shrink: 0;
}

.activity-amount {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e8;
  font-variant-numeric: tabular-nums;
}

.activity-amount.positive { color: #4ecb71; }
.activity-amount.negative { color: #e65c5c; }

.activity-time {
  font-size: 11px;
  color: #6a6a7a;
  margin-top: 2px;
}

/* ========== AFFILIATE SUMMARY ========== */
.affiliate-summary {
  display: flex;
  gap: 16px;
}

.affiliate-stat {
  flex: 1;
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.03);
}

.affiliate-stat-label {
  font-size: 11px;
  color: #6a7280;
  margin-bottom: 4px;
}

.affiliate-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #e0e0e8;
  font-variant-numeric: tabular-nums;
}

.affiliate-stat-sub {
  font-size: 11px;
  color: #6a7280;
  margin-top: 2px;
}

/* ========== TIER BADGE ========== */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 8px;
}
.tier-badge svg {
  flex-shrink: 0;
}
.tier-silver {
  color: #c0c0c0;
  background: rgba(192, 192, 192, 0.1);
  border: 1px solid rgba(192, 192, 192, 0.25);
}
.tier-silver svg {
  stroke: #c0c0c0;
  fill: rgba(192, 192, 192, 0.15);
}
.tier-gold {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.25);
}
.tier-gold svg {
  stroke: #ffd700;
  fill: rgba(255, 215, 0, 0.15);
}
.tier-platinum {
  color: #e5e4e2;
  background: linear-gradient(135deg, rgba(180, 200, 220, 0.15), rgba(220, 220, 230, 0.1));
  border: 1px solid rgba(220, 220, 230, 0.3);
  text-shadow: 0 0 8px rgba(200, 210, 230, 0.3);
}
.tier-platinum svg {
  stroke: #e5e4e2;
  fill: rgba(200, 210, 230, 0.2);
}

/* ========== VERIFICATION BANNER ========== */
.dash-verify-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg, rgba(92, 184, 230, 0.06), rgba(92, 184, 230, 0.02));
  border-color: rgba(92, 184, 230, 0.12);
}

.verify-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.verify-content svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.verify-title {
  font-size: 15px;
  font-weight: 600;
  color: #e0e0e8;
  margin-bottom: 4px;
}

.verify-desc {
  font-size: 13px;
  color: #8a8a9a;
  line-height: 1.5;
}

/* ========== UTILITY CLASSES ========== */
.val-positive { color: #4ecb71; }
.val-negative { color: #e65c5c; }

/* ========== LEGACY MARKET TICKER (top bar) ========== */
.market-ticker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 32px;
  height: 40px;
  background: rgba(26, 26, 31, 0.8);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  overflow: hidden;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  white-space: nowrap;
}

.ticker-symbol {
  font-size: 11px;
  font-weight: 700;
  color: #8a8a9a;
  letter-spacing: 0.5px;
}

.ticker-price {
  font-size: 12px;
  font-weight: 500;
  color: #e0e0e8;
  /* Bug #38 fix: fixed width + tabular digits to prevent layout shift on price updates */
  min-width: 80px;
  display: inline-block;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ticker-change {
  font-size: 11px;
  font-weight: 600;
}

.ticker-change.positive { color: #4ecb71; }
.ticker-change.negative { color: #e65c5c; }

.ticker-divider {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}

/* ========== CHART AREA (compact) ========== */
.dash-chart-compact {
  margin-bottom: 20px;
  padding: 16px 24px;
}

.dash-chart-compact .perf-chart {
  min-height: 80px;
  max-height: 100px;
}

.chart-timeframes {
  display: flex;
  gap: 4px;
}

.tf-btn {
  background: none;
  border: none;
  color: #6a6a7a;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.3px;
}

.tf-btn:hover {
  color: #e0e0e8;
  background: rgba(255,255,255,0.04);
}

.tf-btn.active {
  color: #5cb8e6;
  background: rgba(92, 184, 230, 0.1);
}

.chart-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.perf-chart {
  flex: 1;
  width: 100%;
  min-height: 80px;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #4a4a5a;
  padding-top: 8px;
}


/* ==================================================================
   RESPONSIVE
   ================================================================== */

@media (max-width: 1024px) {
  /* Sidebar collapse */
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: var(--z-sidebar, 1110);
  }
  .app-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: flex;
  }
  /* BUG #15: collapsed-state has no effect on mobile (sidebar hides via translateX). */
  .app-sidebar.collapsed {
    width: 240px;
    min-width: 240px;
  }
  body.sidebar-collapsed .app-content-wrapper { margin-left: 0; }
  body.sidebar-collapsed .app-topbar { left: 0; }
  .sidebar-collapse-btn { display: none !important; }
  .app-topbar {
    left: 0;
  }
  .app-content-wrapper {
    margin-left: 0;
  }
  .app-main {
    padding: 24px 24px 60px;
  }

  /* Dashboard grid → single column */
  .dash-row,
  .dash-row-top {
    grid-template-columns: 1fr;
  }

  .dash-welcome {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .dash-verify-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .market-ticker {
    padding: 0 16px;
    justify-content: flex-start;
  }

  .positions-scroll {
    margin: 0 -20px;
    padding: 0 20px;
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .onboarding-checklist {
    flex-wrap: wrap;
    gap: 10px;
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }

  .snapshot-breakdown {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .app-main {
    padding: 20px 16px 60px;
  }
  .app-topbar {
    padding: 0 16px;
  }
  .market-ticker {
    height: 36px;
  }
  .ticker-item {
    padding: 0 12px;
  }

  .snapshot-value {
    font-size: 26px;
  }

  .snapshot-breakdown {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .funding-actions {
    grid-template-columns: 1fr;
  }

  .affiliate-summary {
    flex-direction: column;
  }

  .onboarding-checklist {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========== MENU TILES (unified-format sidebar-item tiles) ========== */
.menu-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.menu-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  background: linear-gradient(180deg, #1c1c22 0%, #17171c 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  text-decoration: none;
  color: #e0e0e8;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  min-height: 280px;
}

.menu-card:hover {
  border-color: rgba(92, 184, 230, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.menu-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.menu-card-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(92, 184, 230, 0.1);
  border: 1px solid rgba(92, 184, 230, 0.2);
  border-radius: 11px;
  color: #5cb8e6;
}

.menu-card-icon svg {
  width: 22px;
  height: 22px;
}

.menu-card-title-wrap {
  flex: 1;
  min-width: 0;
}

.menu-card-title {
  font-size: 17px;
  font-weight: 600;
  color: #e0e0e8;
  line-height: 1.2;
}

.menu-card-subtitle {
  font-size: 11px;
  color: #8a8a9a;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.menu-card-status {
  font-size: 11px;
  font-weight: 500;
  color: #8a8a9a;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  white-space: nowrap;
}

.menu-card-primary {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-card-primary-label {
  font-size: 11px;
  color: #8a8a9a;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.menu-card-primary-value {
  font-size: 28px;
  font-weight: 700;
  color: #f0f0f5;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.menu-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-card-body-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  gap: 10px;
  min-width: 0;
}

.menu-card-body-row .row-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #c0c0cc;
  font-size: 13px;
}

.menu-card-body-row .row-right {
  font-size: 13px;
  font-weight: 500;
  color: #e0e0e8;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.menu-card-body-row .row-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(92, 184, 230, 0.12);
  color: #5cb8e6;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.menu-card-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.menu-card-meta.meta-2 {
  grid-template-columns: 1fr 1fr;
}

.menu-card-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.menu-card-meta-item .meta-label {
  font-size: 10px;
  color: #8a8a9a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.menu-card-meta-item .meta-value {
  font-size: 14px;
  font-weight: 500;
  color: #c0c0cc;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.menu-card-actions.multi {
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.menu-card-cta {
  font-size: 13px;
  font-weight: 600;
  color: #5cb8e6;
}

.menu-card-arrow {
  color: #5cb8e6;
  transition: transform 0.15s ease;
}

.menu-card:hover .menu-card-arrow {
  transform: translateX(3px);
}

/* Multi-link CTAs inside a single card */
.menu-card-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #c0c0cc;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.menu-card-cta-link:hover {
  background: rgba(92, 184, 230, 0.08);
  border-color: rgba(92, 184, 230, 0.3);
  color: #5cb8e6;
}

.menu-card-cta-link.primary {
  background: rgba(92, 184, 230, 0.1);
  border-color: rgba(92, 184, 230, 0.3);
  color: #5cb8e6;
}

.menu-card-cta-link.primary:hover {
  background: rgba(92, 184, 230, 0.18);
  border-color: rgba(92, 184, 230, 0.5);
}

.menu-card-cta-link.ghost {
  background: transparent;
  border-color: transparent;
  color: #8a8a9a;
}

.menu-card-cta-link.ghost:hover {
  color: #5cb8e6;
  background: rgba(92, 184, 230, 0.06);
}

/* Body rows that are themselves links (Account card) */
.menu-card-body-row.linkable {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.menu-card-body-row.linkable:hover {
  background: rgba(92, 184, 230, 0.06);
}

/* Responsive */
@media (max-width: 820px) {
  .menu-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .menu-card {
    min-height: 240px;
    padding: 20px;
  }
  .menu-card-primary-value {
    font-size: 24px;
  }
}

/* BUG #38: prevent layout shift on the market list as prices tick.
   Tabular-nums keeps every digit the same width, and min-width on the
   price / change columns stops the row from reflowing when the digit
   count changes (e.g. $9,998 → $10,002). */
.mover-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: inherit; }
.mover-row:hover { background: rgba(92, 184, 230, 0.06); }
.mover-info { flex: 1; min-width: 0; }
.mover-price {
  font-variant-numeric: tabular-nums;
  min-width: 88px;
  text-align: right;
  font-weight: 600;
  color: #e5e7eb;
}
.mover-change {
  font-variant-numeric: tabular-nums;
  min-width: 64px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
}
.mover-change.positive { color: #5cb8e6; }
.mover-change.negative { color: #e0a050; }
