/* ============================================
   UNOCU Design Tokens & Component Styles
   Unit.co-inspired B&W Monochrome — Unified
   ============================================ */

/* --- Theme Variables --- */
:root {
  /* Light mode (default) — All white */
  --bg: #ffffff;
  --bg-surface: #fafafa;
  --bg-surface-2: #f5f5f5;
  --text-primary: #1a1a1a;
  --text-secondary: #6b6b6b;
  --text-muted: #9a9a9a;
  --border: #e5e5e5;
  --border-subtle: #f0f0f0;

  /* Sidebar matches body in light mode */
  --sidebar-bg: #ffffff;
  --sidebar-text: #1a1a1a;
  --sidebar-text-muted: #6b6b6b;
  --sidebar-active: #f5f5f5;
  --sidebar-hover: #fafafa;
  --sidebar-border: #e5e5e5;

  /* Functional colors */
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.08);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.08);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.08);

  /* Spacing (4px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Type scale */
  --text-xs: clamp(0.6875rem, 0.65rem + 0.1vw, 0.75rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.1vw, 0.875rem);
  --text-base: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --text-lg: clamp(1rem, 0.95rem + 0.15vw, 1.125rem);
  --text-xl: clamp(1.25rem, 1.15rem + 0.3vw, 1.5rem);
  --text-2xl: clamp(1.75rem, 1.5rem + 0.6vw, 2.25rem);

  /* Radius */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 200ms;

  /* Sidebar width */
  --sidebar-width: 240px;
  --header-height: 56px;
}

/* --- Dark Mode — All black --- */
[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-surface: #141414;
  --bg-surface-2: #1a1a1a;
  --text-primary: #e5e5e5;
  --text-secondary: #999999;
  --text-muted: #666666;
  --border: #2a2a2a;
  --border-subtle: #1e1e1e;

  /* Sidebar matches body in dark mode */
  --sidebar-bg: #0a0a0a;
  --sidebar-text: #e5e5e5;
  --sidebar-text-muted: #999999;
  --sidebar-active: #1a1a1a;
  --sidebar-hover: #141414;
  --sidebar-border: #2a2a2a;

  --green-bg: rgba(34, 197, 94, 0.12);
  --red-bg: rgba(239, 68, 68, 0.12);
  --blue-bg: rgba(59, 130, 246, 0.12);
}

/* --- Dashboard Layout --- */
.dashboard {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  height: 100dvh;
  background: var(--bg);
  color: var(--text-primary);
}

/* --- Sidebar --- */
.sidebar {
  grid-row: 1 / -1;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--sidebar-border);
  z-index: 100;
  position: relative;
}

.sidebar-logo {
  padding: var(--space-6) var(--space-5);
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo img {
  height: 28px;
  width: auto;
  /* Light mode: dark logo as-is; dark mode: invert to white */
  image-rendering: -webkit-optimize-contrast;
}

[data-theme="dark"] .sidebar-logo img {
  filter: brightness(0) invert(1);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 450;
  color: var(--sidebar-text-muted);
  transition: all var(--duration) var(--ease);
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text);
  font-weight: 500;
}

.nav-item i,
.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: currentColor;
  stroke: currentColor;
}

.nav-badge-institutional {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  line-height: 1.6;
}

.nav-label {
  font-size: var(--text-xs);
  color: var(--sidebar-text-muted);
  padding: var(--space-6) var(--space-4) var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  opacity: 0.5;
}

.nav-label:first-child {
  padding-top: var(--space-4);
}

/* ============================
   User Menu (Perplexity-style)
   ============================ */
.sidebar-user {
  border-top: 1px solid var(--sidebar-border);
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  width: 100%;
  cursor: pointer;
  transition: background var(--duration) var(--ease);
  text-align: left;
}

.user-trigger:hover {
  background: var(--sidebar-hover);
}

.user-trigger-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.user-trigger-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.user-trigger-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--sidebar-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-trigger-email {
  font-size: var(--text-xs);
  color: var(--sidebar-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-trigger-chevron {
  width: 16px;
  height: 16px;
  color: var(--sidebar-text-muted);
  transition: transform var(--duration) var(--ease);
  flex-shrink: 0;
}

.sidebar-user.open .user-trigger-chevron {
  transform: rotate(180deg);
}

/* Popup */
.user-popup {
  position: absolute;
  bottom: 100%;
  left: var(--space-3);
  right: var(--space-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  padding: var(--space-2) 0;
  display: none;
  z-index: 200;
  margin-bottom: var(--space-2);
}

[data-theme="dark"] .user-popup {
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}

.sidebar-user.open .user-popup {
  display: block;
}

.user-popup-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.user-popup-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.user-popup-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.user-popup-email {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.user-popup-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-2) 0;
}

.user-popup-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
  width: 100%;
  text-align: left;
  text-decoration: none;
  background: none;
  border: none;
  font-family: inherit;
}

.user-popup-item:hover {
  background: var(--bg-surface);
}

.user-popup-item i,
.user-popup-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  stroke: currentColor;
  flex-shrink: 0;
}

/* Appearance toggle row */
.appearance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: default;
}

.appearance-row:hover {
  background: transparent;
}

.appearance-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.appearance-label i {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.appearance-toggle {
  display: flex;
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.appearance-option {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  font-weight: 500;
}

.appearance-option.active {
  background: var(--bg);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

[data-theme="dark"] .appearance-option.active {
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* --- Header --- */
.header {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  position: relative;
}

.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.header-icon-btn:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.header-icon-btn i {
  width: 16px;
  height: 16px;
}

.connection-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
  position: relative;
}
.connection-badge:hover {
  border-color: var(--text-muted);
  background: var(--bg-surface-2);
}
.connection-badge.open {
  border-color: var(--green);
}

.connection-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
.connection-dot.disconnected {
  background: var(--text-muted);
}

.connection-chevron {
  width: 12px;
  height: 12px;
  transition: transform var(--duration) var(--ease);
}
.connection-badge.open .connection-chevron {
  transform: rotate(180deg);
}

/* Connection Dropdown */
.connection-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  width: 280px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 200;
  overflow: hidden;
}
.connection-dropdown.active {
  display: block;
}
.connection-dropdown-header {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.connection-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  transition: background var(--duration) var(--ease);
}
.connection-dropdown-item:hover {
  background: var(--bg-surface-2);
}
.connection-dropdown-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.connection-dropdown-item-icon i {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}
.connection-dropdown-item-info {
  flex: 1;
  min-width: 0;
}
.connection-dropdown-item-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}
.connection-dropdown-item-status {
  font-size: var(--text-xs);
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 4px;
}
.connection-dropdown-item-status .mini-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}
.connection-dropdown-empty {
  padding: var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.connection-dropdown-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
}
.connection-dropdown-footer .btn {
  width: 100%;
  justify-content: center;
}

/* --- Main Content --- */
.main {
  grid-column: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6);
}

/* --- Page Transitions --- */
.page {
  display: none;
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

.page.active {
  display: block;
  opacity: 1;
}

/* --- KPI Cards --- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.kpi-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.kpi-value {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-1);
  font-variant-numeric: tabular-nums;
}

.kpi-delta {
  font-size: var(--text-xs);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
}

.kpi-delta.positive {
  color: var(--green);
  background: var(--green-bg);
}

.kpi-delta.negative {
  color: var(--red);
  background: var(--red-bg);
}

.kpi-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.kpi-period {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 2px;
}

.kpi-breakdown {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* --- Cards / Sections --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* --- Grid layouts --- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

/* --- Tables --- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  font-size: var(--text-sm);
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table th {
  background: var(--bg-surface-2);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--bg-surface-2);
}

.data-table tbody tr {
  transition: background var(--duration) var(--ease);
}

/* Asset cell with icon */
.asset-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

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

.asset-icon-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.asset-name {
  font-weight: 500;
}

.asset-qty {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* P&L colors */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
}

.badge-green { color: var(--green); background: var(--green-bg); }
.badge-red { color: var(--red); background: var(--red-bg); }
.badge-blue { color: var(--blue); background: var(--blue-bg); }
.badge-neutral { color: var(--text-secondary); background: var(--bg-surface-2); }

.platform-badge {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  padding: 2px var(--space-2);
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* --- Expandable Staked Assets --- */
.staked-parent-row {
  cursor: pointer;
}

.staked-parent-row:hover .staked-chevron {
  color: var(--text-primary);
}

.staked-expand-hint {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: var(--space-3);
}

.staked-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.staked-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform var(--duration) var(--ease);
  flex-shrink: 0;
}

.staked-sub-row {
  background: var(--bg-surface-2);
}

.staked-sub-row:hover {
  background: var(--bg-surface-2) !important;
}

.staked-sub-row td {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.staked-sub-cell {
  padding-left: var(--space-6);
  gap: var(--space-2);
}

.sub-row-line {
  width: 12px;
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
}

.staked-expanded {
  background: var(--bg-surface);
}

.staked-expanded td {
  border-bottom-color: transparent;
}

/* --- Chart Containers --- */
.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* --- Activity Feed --- */
.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon.buy { background: var(--green-bg); color: var(--green); }
.activity-icon.sell { background: var(--red-bg); color: var(--red); }
.activity-icon.earn { background: var(--blue-bg); color: var(--blue); }

.activity-icon i { width: 16px; height: 16px; }

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

.activity-title { font-size: var(--text-sm); font-weight: 500; }
.activity-time { font-size: var(--text-xs); color: var(--text-muted); }

.activity-amount {
  font-size: var(--text-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* --- Search Bar --- */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
}

.search-bar i { width: 18px; height: 18px; color: var(--text-muted); }

.search-bar input {
  flex: 1;
  border: none;
  background: none;
  font-size: var(--text-sm);
  outline: none;
  color: var(--text-primary);
}

.search-bar input::placeholder { color: var(--text-muted); }

/* --- Research Cards --- */
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.research-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.research-card:hover { border-color: var(--text-muted); }

.research-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.research-card-asset {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.research-card-ticker {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.rating-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.rating-strong-buy { background: var(--green-bg); color: var(--green); }
.rating-buy { background: rgba(34, 197, 94, 0.06); color: #16a34a; }
.rating-hold { background: rgba(234, 179, 8, 0.08); color: #ca8a04; }
.rating-sell { background: var(--red-bg); color: var(--red); }

.research-card-thesis {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  line-height: 1.5;
}

.research-card-prices {
  display: flex;
  gap: var(--space-6);
  font-size: var(--text-xs);
}

.research-card-prices span { color: var(--text-muted); }
.research-card-prices strong { color: var(--text-primary); font-weight: 600; }

/* --- Asset Detail View (Obtain) --- */
.asset-detail { display: none; }
.asset-detail.active { display: block; }

.asset-detail-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: var(--space-4);
  padding: var(--space-2) 0;
  transition: color var(--duration) var(--ease);
}

.asset-detail-back:hover { color: var(--text-primary); }
.asset-detail-back i { width: 16px; height: 16px; }

.asset-detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.asset-detail-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.metric-item {
  padding: var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.metric-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.metric-value {
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.analysis-text {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 72ch;
}

.analysis-text p { margin-bottom: var(--space-4); }

/* --- Collateral Section --- */
.collateral-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.collateral-item { padding: var(--space-4); }

.collateral-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.collateral-value {
  font-size: var(--text-base);
  font-weight: 600;
}

/* --- Settings Pages --- */
.settings-section {
  margin-bottom: var(--space-8);
}

.settings-section-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.settings-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

.exchange-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.exchange-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.exchange-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.exchange-name { font-size: var(--text-sm); font-weight: 500; }
.exchange-meta { font-size: var(--text-xs); color: var(--text-muted); }

.exchange-status {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.exchange-status.connected { color: var(--green); background: var(--green-bg); }
.exchange-status.disconnected { color: var(--text-muted); background: var(--bg-surface-2); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
  border: none;
}

.btn-primary { background: var(--text-primary); color: var(--bg); }
.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--border); }

.btn-sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.toggle-label { font-size: var(--text-sm); font-weight: 450; }

.toggle-value {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.toggle-switch.active { background: var(--text-primary); }

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--duration) var(--ease);
}

.toggle-switch.active::after { transform: translateX(18px); }

/* Radio group (Personalization) */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.radio-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  font-size: var(--text-sm);
}

.radio-item:hover { background: var(--bg-surface); }

.radio-item.active {
  border-color: var(--text-primary);
  background: var(--bg-surface);
}

.radio-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: all var(--duration) var(--ease);
}

.radio-item.active .radio-dot {
  border-color: var(--text-primary);
  background: var(--text-primary);
  box-shadow: inset 0 0 0 3px var(--bg);
}

/* Help cards */
.help-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.help-card {
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.help-card:hover { border-color: var(--text-muted); }

.help-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}

.help-card-icon i {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.help-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.help-card-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
}

/* Profile fields */
.profile-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.field-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.field-value {
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Subscription card */
.plan-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.plan-info h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.plan-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.plan-feature {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.plan-feature i { width: 14px; height: 14px; color: var(--green); }

.plan-price { text-align: right; }
.plan-price .amount { font-size: var(--text-xl); font-weight: 600; }
.plan-price .period { font-size: var(--text-xs); color: var(--text-muted); }

/* --- Modals --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  width: 480px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.modal-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

.step-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all var(--duration) var(--ease);
}

.step-dot.active {
  background: var(--text-primary);
  width: 24px;
  border-radius: var(--radius-full);
}

.exchange-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.exchange-option {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  font-size: var(--text-sm);
  font-weight: 500;
}

.exchange-option:hover,
.exchange-option.selected {
  border-color: var(--text-primary);
  background: var(--bg-surface-2);
}

.modal-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.modal-input:focus {
  outline: none;
  border-color: var(--text-primary);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-6);
}

.modal-actions-right {
  display: flex;
  gap: var(--space-3);
}

.skip-link {
  font-size: var(--text-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--duration) var(--ease);
  background: none;
  border: none;
}

.skip-link:hover { color: var(--text-primary); }

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}

.success-icon i { width: 28px; height: 28px; color: var(--green); }

.section-note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: var(--space-4) 0;
  text-align: center;
  font-style: italic;
}

.exchange-modal .modal { width: 400px; }

/* =============================================
   Obtain — CoinMarketCap Table & Oddup Detail
   ============================================= */

/* --- Obtain Table (list view) --- */
.obtain-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.obtain-table {
  width: 100%;
  font-size: var(--text-sm);
  border-collapse: collapse;
}

.obtain-table thead th {
  background: var(--bg-surface-2);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.obtain-table thead th.obtain-th-price,
.obtain-table thead th.obtain-th-change,
.obtain-table thead th.obtain-th-dom {
  text-align: right;
}

.obtain-table thead th.obtain-th-rank {
  width: 40px;
  text-align: center;
}

.obtain-table thead th.obtain-th-rating {
  text-align: center;
}

.obtain-row {
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.obtain-row:hover {
  background: var(--bg-surface-2);
}

.obtain-row td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

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

.obtain-td-rank {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
}

.obtain-asset-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.obtain-asset-info {
  display: flex;
  flex-direction: column;
}

.obtain-asset-name {
  font-weight: 500;
  font-size: var(--text-sm);
}

.obtain-asset-ticker {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 400;
}

.obtain-td-price {
  text-align: right;
  font-weight: 500;
}

.obtain-td-change {
  text-align: right;
  font-size: var(--text-xs);
  font-weight: 500;
}

.obtain-td-dom {
  text-align: right;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.obtain-td-rating {
  text-align: center;
}

/* --- Detail View (Oddup-style) --- */

/* Hero Section */
.detail-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.detail-hero-left {
  flex: 1;
  min-width: 0;
}

.detail-hero-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}

.detail-hero-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.detail-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px var(--space-2);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tag-strong-buy { background: var(--green-bg); color: var(--green); }
.tag-buy { background: rgba(34, 197, 94, 0.06); color: #16a34a; }
.tag-hold { background: rgba(234, 179, 8, 0.08); color: #ca8a04; }
.tag-sell { background: var(--red-bg); color: var(--red); }
.tag-trending { background: rgba(249, 115, 22, 0.08); color: #ea580c; }
.tag-neutral { background: var(--bg-surface-2); color: var(--text-secondary); }

.trending-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ea580c;
  display: inline-block;
}

.detail-hero-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 60ch;
}

/* Score Ring */
.detail-hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.score-ring {
  position: relative;
  width: 100px;
  height: 100px;
}

.score-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.score-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 50%);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.score-rating {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-top: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

/* Price Chart Card */
.detail-chart-card {
  background: var(--bg-surface-2);
}

.detail-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.detail-timeframes {
  display: flex;
  gap: 2px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}

.tf-btn {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  background: transparent;
  border: none;
}

.tf-btn:hover {
  color: var(--text-primary);
}

.tf-btn.active {
  background: var(--blue);
  color: #fff;
}

.detail-chart-note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.note-spark {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #ca8a04;
  border-radius: 50%;
}

/* Key Stats Card */
.detail-price-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.detail-big-price {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-5);
}

.detail-stat-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
}

.detail-stat-value {
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 24h Range Bar */
.detail-range {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.detail-range-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.detail-range-bar {
  flex: 1;
  height: 6px;
  background: linear-gradient(to right, var(--green), var(--red));
  border-radius: var(--radius-full);
  position: relative;
}

.detail-range-fill {
  height: 100%;
  background: var(--green);
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.detail-range-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text-primary);
}

/* Market Dominance */
.dominance-bar-wrap {
  margin-bottom: var(--space-3);
}

.dominance-bar {
  display: flex;
  height: 12px;
  border-radius: var(--radius-full);
  overflow: hidden;
  gap: 2px;
}

.dominance-seg {
  height: 100%;
  border-radius: var(--radius-full);
}

.seg-btc { background: #f7931a; }
.seg-eth { background: #627eea; }
.seg-other { background: var(--border); }

.dominance-legend {
  display: flex;
  gap: var(--space-6);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.dom-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.dom-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-btc { background: #f7931a; }
.dot-eth { background: #627eea; }
.dot-other { background: var(--border); }

/* Detail Tabs */
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
}

.detail-tab {
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-3) var(--space-5);
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.detail-tab:hover {
  color: var(--text-primary);
}

.detail-tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.detail-tab-content {
  display: none;
}

.detail-tab-content.active {
  display: block;
}

.detail-note {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-4) 0;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
    --header-height: 52px;
  }

  .dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr var(--header-height) 60px;
  }

  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    grid-row: auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-top: 1px solid var(--sidebar-border);
    z-index: 100;
    padding: 0;
  }

  .sidebar-logo,
  .sidebar-user,
  .nav-label {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    padding: var(--space-2);
    gap: 0;
    width: 100%;
    justify-content: space-around;
  }

  /* On mobile, only show the 5 UNOCU portfolio items */
  .sidebar-nav .nav-item[data-page="account"],
  .sidebar-nav .nav-item[data-page="preferences"],
  .sidebar-nav .nav-item[data-page="personalization"],
  .sidebar-nav .nav-item[data-page="connectors"],
  .sidebar-nav .nav-item[data-page="settings"],
  .sidebar-nav .nav-item[data-page="help"] {
    display: none;
  }

  .nav-item {
    flex-direction: column;
    padding: var(--space-2);
    gap: var(--space-1);
    font-size: 10px;
    min-width: 56px;
    text-align: center;
  }

  .nav-item i { width: 20px; height: 20px; }

  .header {
    grid-column: 1;
    grid-row: 1;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
  }

  .main {
    grid-column: 1;
    grid-row: 1;
    padding: var(--space-4);
    padding-top: calc(var(--header-height) + var(--space-4));
    padding-bottom: 80px;
  }

  .kpi-row { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
  .grid-2 { grid-template-columns: 1fr; }
  .research-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .collateral-grid { grid-template-columns: 1fr 1fr; }
  .profile-fields { grid-template-columns: 1fr; }
  .help-grid { grid-template-columns: 1fr; }

  .plan-card {
    flex-direction: column;
    gap: var(--space-4);
  }

  .plan-price { text-align: left; }

  .chart-container { height: 220px; }
  .connection-badge { display: none; }

  /* Obtain detail responsive */
  .detail-hero { flex-direction: column; }
  .detail-stats-grid { grid-template-columns: 1fr 1fr; }
  .detail-range { flex-direction: column; align-items: stretch; gap: var(--space-2); }
  .detail-range-label { text-align: center; }
  .detail-tabs { overflow-x: auto; }
  .obtain-table-wrap { font-size: var(--text-xs); }

  /* User popup on mobile */
  .user-popup {
    position: fixed;
    bottom: 60px;
    left: var(--space-3);
    right: var(--space-3);
  }
}

@media (max-width: 420px) {
  .kpi-row { grid-template-columns: 1fr; }
}

/* ==================== REPORT OVERLAY ==================== */
.report-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.report-overlay.active {
  display: flex;
}

.report-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.report-toolbar-left {
  display: flex;
  align-items: center;
}

.report-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.report-back {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--duration) var(--ease);
}

.report-back:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

.report-back i {
  width: 16px;
  height: 16px;
}

.report-page {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-8) var(--space-6);
  overscroll-behavior: contain;
}

/* Report content styles */
.report-content {
  max-width: 900px;
  margin: 0 auto;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 2px solid var(--text-primary);
}

.report-logo {
  height: 28px;
}

[data-theme="dark"] .report-logo {
  filter: brightness(0) invert(1);
}

.report-header-right {
  text-align: right;
}

.report-title {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.report-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.report-section {
  margin-bottom: var(--space-8);
}

.report-section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.report-kpi {
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.report-kpi-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.report-kpi-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.report-kpi-delta {
  font-size: var(--text-xs);
  color: var(--green);
  margin-top: var(--space-1);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}

.report-table thead {
  background: var(--bg-surface-2);
}

.report-table th {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.report-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.report-table tbody tr:last-child td {
  border-bottom: none;
}

.report-table .text-green { color: var(--green); }
.report-table .text-red { color: var(--red); }

.report-footer {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.report-disclaimer {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: var(--space-6);
  line-height: 1.5;
  max-width: 600px;
}

/* ==================== PRINT STYLES ==================== */
@media print {
  body {
    background: #fff !important;
    color: #1a1a1a !important;
  }

  .dashboard,
  .report-toolbar {
    display: none !important;
  }

  .report-overlay {
    position: static !important;
    display: block !important;
    background: #fff !important;
  }

  .report-overlay.active {
    display: block !important;
  }

  .report-page {
    padding: 0 !important;
    overflow: visible !important;
  }

  .report-content {
    max-width: 100% !important;
  }

  .report-kpi {
    background: #fff !important;
    border-color: #ddd !important;
  }

  .report-header {
    border-bottom-color: #1a1a1a !important;
  }

  .report-section-title {
    border-bottom-color: #ddd !important;
    color: #666 !important;
  }

  .report-table th {
    background: #f5f5f5 !important;
    border-bottom-color: #ddd !important;
  }

  .report-table td {
    border-bottom-color: #eee !important;
  }

  .report-kpi-label,
  .report-subtitle,
  .report-footer {
    color: #666 !important;
  }

  .report-kpi-value,
  .report-title {
    color: #1a1a1a !important;
  }

  .report-logo {
    filter: none !important;
  }

  .text-green { color: #16a34a !important; }
  .text-red { color: #dc2626 !important; }

  @page {
    margin: 1.5cm;
    size: A4;
  }
}

@media (max-width: 768px) {
  .report-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .report-toolbar {
    padding: var(--space-3) var(--space-4);
  }

  .report-page {
    padding: var(--space-6) var(--space-4);
  }

  .report-toolbar-right .btn span {
    display: none;
  }
}

/* ==================== SHARE REPORT MODAL ==================== */
.share-modal {
  max-width: 480px;
}

.share-preview {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: var(--space-4) 0;
}

.share-preview-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.share-preview-icon i {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.share-preview-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.share-preview-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.share-options {
  margin: var(--space-4) 0;
}

.share-option-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.share-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
}

.share-toggle-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Share Modal Tabs */
.share-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.share-tab {
  padding: var(--space-2) var(--space-4);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  margin-bottom: -1px;
}

.share-tab:hover {
  color: var(--text-primary);
}

.share-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

.share-tab-content {
  display: none;
}

.share-tab-content.active {
  display: block;
}

/* Share Link Result */
.share-link-result {
  margin: var(--space-4) 0;
}

.share-link-copy-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.share-link-input {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  font-family: 'Inter', monospace;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
}

.share-link-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* Embed Code */
.share-embed-result {
  margin: var(--space-4) 0;
}

.share-embed-code {
  width: 100%;
  padding: var(--space-3);
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  resize: none;
  outline: none;
  line-height: 1.5;
}

/* ==================== COLD WALLETS & STAKED ADDRESS ==================== */

select.modal-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: calc(var(--space-4) + 20px);
  cursor: pointer;
}

.wallet-addr {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0;
}

.btn-icon-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: color 0.18s, background 0.18s;
}

.btn-icon-sm:hover {
  background: var(--bg-surface-2);
  color: #ef4444;
}

/* ============================================
   ACCOUNT PAGE — Profile, Subscription, Security
   ============================================ */

/* --- Toast Notification --- */
.toast {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  animation: toastSlideIn 300ms var(--ease);
}

.toast.visible {
  display: flex;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Profile Header --- */
.profile-header-row {
  margin-bottom: var(--space-5);
}

.profile-avatar-area {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.profile-avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-surface-2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.profile-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Avatar loading spinner */
.profile-avatar-lg.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-lg.loading::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  z-index: 1;
  animation: avatarSpin 0.6s linear infinite;
}

@keyframes avatarSpin {
  to { transform: rotate(360deg); }
}

.avatar-btn-group {
  display: flex;
  gap: var(--space-2);
}

.profile-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.field-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* Override modal-input margin-bottom when used as profile field */
.profile-fields .modal-input {
  margin-bottom: 0;
}

/* --- Plan Gate (upgrade prompt) --- */
.plan-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-10) var(--space-6);
  background: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.plan-gate-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  color: var(--text-muted);
}

.plan-gate-title {
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}

.plan-gate-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
  max-width: 40ch;
  line-height: 1.5;
}

/* --- Team Section --- */
.team-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.team-count {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.member-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.member-name {
  font-weight: 500;
  font-size: var(--text-sm);
}

.role-badge {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  text-transform: capitalize;
}

.role-badge.owner {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-weight: 600;
}

/* Role change dropdown */
.role-select {
  appearance: none;
  -webkit-appearance: none;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px var(--space-6) 2px var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  text-transform: capitalize;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--duration) var(--ease);
  font-family: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

.role-select:hover {
  border-color: var(--text-muted);
}

.role-select:focus {
  outline: none;
  border-color: var(--text-primary);
}

/* Team action buttons in table */
.team-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  justify-content: flex-end;
}

.status-badge {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
}

.status-active { color: var(--green); background: var(--green-bg); }
.status-invited { color: var(--blue); background: var(--blue-bg); }
.status-removed { color: var(--text-muted); background: var(--bg-surface-2); }

/* --- Subscription Section --- */
.sub-current {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.sub-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.sub-plan-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}

.sub-plan-price {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.sub-billing-info {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.sub-billing-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sub-billing-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.sub-billing-value {
  font-size: var(--text-sm);
  font-weight: 500;
}

/* Plan comparison columns */
.sub-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.sub-plan-col {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.sub-plan-col-highlighted {
  border-color: var(--text-primary);
  position: relative;
}

.sub-plan-col-highlighted::before {
  content: 'Recommended';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px var(--space-3);
  background: var(--text-primary);
  color: var(--bg);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.sub-col-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.sub-col-title {
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sub-col-price {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sub-col-period {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--text-muted);
}

/* Active plan column */
.sub-plan-col-active {
  background: var(--green-bg);
  border-color: var(--green);
}

/* --- MFA / Security --- */
.toggle-label-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mfa-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--green-bg);
  color: var(--green);
}

/* --- MFA Modal --- */
.mfa-modal {
  width: 440px;
}

.mfa-step {
  min-height: 200px;
}

.mfa-qr-wrap {
  display: flex;
  justify-content: center;
  margin: var(--space-5) 0;
}

.mfa-qr-img {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #fff;
  padding: var(--space-3);
}

.mfa-secret-row {
  margin-top: var(--space-3);
}

.mfa-secret-key {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.mfa-secret-key code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  flex: 1;
  user-select: all;
}

/* 6-Digit Verification Input */
.mfa-code-input {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-8) 0 var(--space-4);
}

.mfa-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color var(--duration) var(--ease);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.mfa-digit:focus {
  outline: none;
  border-color: var(--text-primary);
  background: var(--bg);
}

.mfa-digit-sep {
  width: 12px;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  flex-shrink: 0;
}

.mfa-error {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--red);
  margin-top: var(--space-2);
}

/* --- Plan Gate Overlay (for gated pages) --- */
.plan-gate-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plan-gate-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-10);
  max-width: 440px;
}

.plan-gate-overlay-content .plan-gate-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-5);
}

.plan-gate-overlay-content .plan-gate-title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

/* --- Mobile Responsive (new sections) --- */
@media (max-width: 768px) {
  .sub-features {
    grid-template-columns: 1fr;
  }

  .sub-billing-info {
    flex-direction: column;
    gap: var(--space-3);
  }

  .mfa-digit {
    width: 40px;
    height: 48px;
    font-size: var(--text-lg);
  }

  .mfa-code-input {
    gap: var(--space-1);
  }

  .plan-gate-overlay {
    position: relative;
    min-height: 400px;
  }
}

/* ==================== CONNECTORS PAGE ==================== */

.connector-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.connector-page-header h2 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.connector-page-header p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: var(--space-1) 0 0 0;
}

.connector-plan-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--blue-bg, oklch(0.95 0.02 240));
  border: 1px solid oklch(0.8 0.06 240 / 0.3);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.connector-plan-banner .plan-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  background: var(--blue);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.connector-plan-banner .upgrade-link {
  color: var(--blue);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  margin-left: auto;
}

.connector-plan-banner .upgrade-link:hover {
  text-decoration: underline;
}

.connector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.connector-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.connector-card:hover {
  border-color: var(--border-hover, var(--border));
}

.connector-card.connected {
  border-color: oklch(0.7 0.12 145 / 0.4);
}

.connector-card.disabled {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(0.3);
}

.connector-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.connector-card-header .exchange-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.connector-card-header .exchange-icon i {
  width: 18px;
  height: 18px;
}

.connector-status {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.connector-status.connected {
  color: var(--green);
  background: var(--green-bg);
}

.connector-status.disconnected {
  color: var(--text-muted);
  background: var(--bg-surface-2);
}

.connector-card-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--space-3);
}

.connector-card-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: var(--space-1);
  margin-bottom: var(--space-4);
}

.connector-card-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.connector-card-meta i {
  width: 12px;
  height: 12px;
}

.connector-card-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.connector-card-actions .btn {
  flex: 1;
}

/* Wallet chain selector grid */
.wallet-chain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.wallet-chain-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-surface);
}

.wallet-chain-option:hover {
  border-color: var(--text-muted);
  background: var(--bg-surface-2);
}

.wallet-chain-option .chain-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wallet-chain-option .chain-icon i {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
}

/* Selected chain badge in step 2 */
.wallet-selected-chain {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-surface-2);
  margin-bottom: var(--space-4);
}

.wallet-selected-chain .chain-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wallet-selected-chain .chain-icon i {
  width: 12px;
  height: 12px;
}

/* Wallet card connected state */
.connector-card .wallet-address-display {
  font-family: var(--font-mono, 'SF Mono', 'Menlo', monospace);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Wallet empty state */
.wallet-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-4);
  color: var(--text-muted);
  text-align: center;
}

.wallet-empty-state p {
  font-size: var(--text-sm);
  max-width: 360px;
}

/* Connect modal field toggle for password visibility */
.field-input-wrap {
  position: relative;
}

.field-input-wrap .modal-input {
  padding-right: 40px;
}

.field-toggle-password {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.field-toggle-password:hover {
  color: var(--text-primary);
}

.field-toggle-password i {
  width: 16px;
  height: 16px;
}

/* Connect modal exchange description */
.connect-modal-exchange-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.connect-modal-exchange-header .exchange-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.connect-modal-exchange-header .exchange-icon i {
  width: 20px;
  height: 20px;
}

.connect-modal-exchange-header .exchange-details {
  flex: 1;
}

.connect-modal-exchange-header .exchange-details h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.connect-modal-exchange-header .exchange-details p {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin: var(--space-1) 0 0 0;
}

.connector-field-group {
  margin-bottom: var(--space-4);
}

.connector-field-group:last-of-type {
  margin-bottom: var(--space-5);
}

.connector-error {
  font-size: var(--text-xs);
  color: var(--red);
  margin-bottom: var(--space-3);
  display: none;
}

.connector-error.visible {
  display: block;
}

/* Test Connection */
.test-connection-area {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-4) 0;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}

.test-connection-result {
  flex: 1;
}

.test-success {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--green);
  font-size: var(--text-sm);
  font-weight: 500;
}

.test-failure {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--red);
  font-size: var(--text-sm);
  font-weight: 500;
}

.test-passed {
  background: var(--green) !important;
  color: #fff !important;
  border-color: var(--green) !important;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
}

#saveConnectionBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Confirm disconnect modal */
.disconnect-warning {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

@media (max-width: 640px) {
  .connector-grid {
    grid-template-columns: 1fr;
  }

  .connector-plan-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .connector-plan-banner .upgrade-link {
    margin-left: 0;
  }
}

/* ==================== INTEGRATIONS PAGE ==================== */

.integration-how-it-works {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.integration-how-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
}

.integration-how-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.integration-how-icon i {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.integration-how-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.integration-how-text strong {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.integration-how-text span {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.integration-how-divider {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.integration-how-divider i {
  width: 16px;
  height: 16px;
}

.integration-mapping-section {
  margin-bottom: var(--space-8);
}

.integration-mapping-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
}

.integration-mapping-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.integration-mapping-card {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.integration-mapping-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: var(--space-3);
}

.integration-mapping-icon i {
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
}

.integration-mapping-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.integration-mapping-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

.integration-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
  margin-top: var(--space-2);
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.integration-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.integration-card:hover {
  border-color: var(--text-tertiary);
}

.integration-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.integration-card-logo {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-primary);
  overflow: hidden;
  flex-shrink: 0;
}

.integration-card-logo svg {
  width: 22px;
  height: 22px;
}

.integration-card-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
}

.integration-card-badge.connected {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.3);
  color: #22c55e;
}

.integration-card-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.integration-card-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: var(--space-3);
  flex: 1;
}

.integration-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.integration-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.integration-card-actions {
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.integration-card-actions .btn {
  flex: 1;
}

.integration-coming-soon {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  padding: var(--space-4) 0;
}

.integration-coming-soon a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 768px) {
  .integration-how-it-works {
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
  }
  .integration-how-divider {
    transform: rotate(90deg);
  }
  .integration-mapping-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .integration-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== RESEARCH CONTENT EDITOR ==================== */

.research-editor-modal {
  max-width: 640px;
  width: 100%;
}

.research-editor-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  max-height: 60vh;
  overflow-y: auto;
}

.editor-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.editor-row {
  display: flex;
  gap: var(--space-3);
}

.editor-textarea {
  resize: vertical;
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
  min-height: 72px;
}

.editor-textarea-lg {
  min-height: 160px;
}

.editor-hint {
  font-size: 11px;
  color: var(--text-tertiary);
}

.cms-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cms-last-updated {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .editor-row {
    flex-direction: column;
  }
  .research-editor-modal {
    max-width: 100%;
    margin: var(--space-3);
  }
}

/* ==================== COLD WALLETS (Settings) ==================== */

.settings-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.wallet-plan-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-xs);
  margin-bottom: var(--space-5);
}

.wallet-plan-info .plan-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  background: var(--blue);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.wallet-plan-info .upgrade-link {
  color: var(--blue);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  margin-left: auto;
}

.wallet-plan-info .upgrade-link:hover {
  text-decoration: underline;
}

.wallet-asset-group {
  margin-bottom: var(--space-5);
}

.wallet-asset-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.wallet-asset-header .asset-symbol {
  font-weight: 700;
}

.wallet-asset-header .asset-name {
  color: var(--text-muted);
  font-weight: 400;
}

.wallet-table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.wallet-table-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  padding: var(--space-2) var(--space-4);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wallet-table-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  padding: var(--space-3) var(--space-4);
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  transition: background var(--duration) var(--ease);
}

.wallet-table-row:last-child { border-bottom: none; }
.wallet-table-row:hover { background: var(--bg-surface); }

.wallet-address-cell {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.wallet-address-link {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: var(--text-xs);
  color: var(--text-primary);
  text-decoration: none;
}

.wallet-address-link:hover { color: var(--blue); }

.wallet-chain-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  color: var(--text-muted);
  font-weight: 500;
}

.wallet-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.wallet-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wallet-remove-btn:hover { color: var(--red); background: var(--red-bg); }

/* Blockchain select grid in modal */
.blockchain-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  max-height: 240px;
  overflow-y: auto;
}

.blockchain-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 500;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}

.blockchain-option:hover { background: var(--bg-surface); }
.blockchain-option.selected {
  border-color: var(--text-primary);
  background: var(--bg-surface-2);
}

.blockchain-option i { width: 14px; height: 14px; }

.wallet-error {
  font-size: var(--text-xs);
  color: var(--red);
  margin-bottom: var(--space-3);
  display: none;
}
.wallet-error.visible { display: block; }

.wallet-empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-4);
  color: var(--text-muted);
}

.wallet-empty-state i {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-3);
  opacity: 0.4;
}

.wallet-empty-state p {
  font-size: var(--text-sm);
  max-width: 300px;
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 640px) {
  .blockchain-select-grid { grid-template-columns: repeat(2, 1fr); }
  .wallet-table-header,
  .wallet-table-row { grid-template-columns: 1fr 1fr auto; }
  .wallet-table-header > *:nth-child(2),
  .wallet-table-row > *:nth-child(2) { display: none; }
  .settings-section-header { flex-direction: column; gap: var(--space-2); }
}

/* --- Billing Management --- */
.billing-section {
  margin-bottom: var(--space-5);
}

.billing-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.billing-section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.billing-card-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2);
  transition: border-color var(--duration) var(--ease);
}

.billing-card-item.is-default {
  border-color: var(--green);
}

.billing-card-brand {
  width: 40px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.billing-card-details {
  flex: 1;
  min-width: 0;
}

.billing-card-number {
  font-size: var(--text-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.billing-card-expiry {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.billing-card-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.billing-card-default-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--green-bg);
  color: var(--green);
}

.billing-card-actions {
  display: flex;
  gap: var(--space-1);
}

.billing-card-actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
}

.billing-card-actions button:hover {
  color: var(--text-primary);
  background: var(--bg-surface-2);
}

.billing-card-actions button.delete-btn:hover {
  color: var(--red);
  background: var(--red-bg);
}

.billing-empty {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.billing-card-form {
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
}

.card-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.card-form-field.card-form-full {
  grid-column: 1 / -1;
}

.card-input-wrap {
  position: relative;
}

.card-input-wrap .modal-input {
  padding-right: 48px;
}

.card-brand-icon {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.card-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.billing-error {
  font-size: var(--text-xs);
  color: var(--red);
  display: none;
  margin-top: var(--space-2);
}

.billing-error.visible {
  display: block;
}

.billing-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}

.billing-history-item:last-child {
  border-bottom: none;
}

.billing-history-desc {
  font-weight: 500;
}

.billing-history-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.billing-history-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.billing-history-status {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.billing-history-status.paid {
  background: var(--green-bg);
  color: var(--green);
}

.billing-history-status.upcoming {
  background: var(--blue-bg);
  color: var(--blue);
}

/* ============================================
   WIDGET DASHBOARD — GridStack Styles
   ============================================ */

/* --- Dashboard Header --- */
.widget-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.page-section-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}
.widget-actions {
  display: flex;
  gap: var(--space-2);
}

/* --- GridStack Overrides --- */
.grid-stack {
  min-height: 200px;
}
.grid-stack-item-content {
  border-radius: 10px;
  overflow: hidden;
}
.grid-stack-placeholder > .placeholder-content {
  border: 2px dashed var(--border) !important;
  border-radius: 10px !important;
  background: transparent !important;
}
.grid-stack > .grid-stack-item > .grid-stack-item-content {
  inset: 4px !important;
}

/* --- Widget Card --- */
.widget-card {
  background: var(--card-bg, var(--bg));
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 180ms ease;
}
.widget-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
[data-theme="dark"] .widget-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: move;
  min-height: 38px;
  flex-shrink: 0;
}
.widget-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.widget-controls {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 180ms ease;
}
.widget-card:hover .widget-controls {
  opacity: 1;
}
.widget-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  transition: background 180ms ease, color 180ms ease;
}
.widget-btn:hover {
  background: var(--hover-bg, rgba(0,0,0,0.05));
  color: var(--text-primary);
}
[data-theme="dark"] .widget-btn:hover {
  background: rgba(255,255,255,0.08);
}
.widget-body {
  flex: 1;
  overflow: auto;
  padding: 12px 14px;
  position: relative;
  min-height: 0;
}

/* --- KPI Stat Widgets (h=1) — No header, compact --- */
.widget-kpi-stat {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 16px;
  position: relative;
  overflow: hidden;
}
.widget-kpi-stat .kpi-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.widget-kpi-stat .kpi-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.widget-kpi-stat .kpi-delta {
  font-size: 11px;
  margin-top: 1px;
}
.widget-kpi-stat .kpi-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 0;
}
.widget-kpi-stat .kpi-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: 1px;
}
.widget-kpi-stat .kpi-meta-row .kpi-delta {
  margin-top: 0;
}
.widget-kpi-stat .kpi-meta-row .kpi-subtitle {
  margin-top: 0;
}
.widget-kpi-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 180ms ease, background 180ms ease;
}
.widget-card:hover .widget-kpi-remove {
  opacity: 1;
}
.widget-kpi-remove:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text-primary);
}
[data-theme="dark"] .widget-kpi-remove:hover {
  background: rgba(255,255,255,0.08);
}

/* --- Widget Body Variants --- */
.widget-body .chart-container {
  height: 100%;
  position: relative;
}
.widget-body .chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}
.widget-body .table-wrap {
  border: none;
  background: none;
}
.widget-body .data-table {
  font-size: 13px;
}
.widget-body .activity-list {
  padding: 0;
}

/* --- Add Widget Panel --- */
.widget-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9000;
  display: none;
  justify-content: flex-end;
  transition: opacity 180ms ease;
}
.widget-panel-overlay.active {
  display: flex;
}
.widget-panel {
  width: 360px;
  max-width: 90vw;
  background: var(--bg);
  border-left: 1px solid var(--border);
  height: 100%;
  display: flex;
  flex-direction: column;
  animation: widgetPanelSlideIn 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes widgetPanelSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.widget-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.widget-panel-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.widget-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.widget-panel-category {
  margin-bottom: 20px;
}
.widget-panel-category-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.widget-panel-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}
.widget-panel-card:hover {
  background: var(--hover-bg, rgba(0,0,0,0.02));
  border-color: var(--text-muted);
}
[data-theme="dark"] .widget-panel-card:hover {
  background: rgba(255,255,255,0.04);
}
.widget-panel-card-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--green-bg, rgba(34, 197, 94, 0.1));
  color: var(--green);
  flex-shrink: 0;
}
.widget-panel-card-info {
  flex: 1;
  min-width: 0;
}
.widget-panel-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.widget-panel-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.widget-panel-card-add {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 180ms ease;
}
.widget-panel-card-add:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* Active widget state (already on dashboard) */
.widget-panel-card-added {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.widget-panel-card-added:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.widget-panel-card-active {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.04);
}

[data-theme="dark"] .widget-panel-card-active {
  background: rgba(34, 197, 94, 0.08);
}

/* --- Dragging State --- */
.grid-stack-item.ui-draggable-dragging > .grid-stack-item-content > .widget-card {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  opacity: 0.95;
}
[data-theme="dark"] .grid-stack-item.ui-draggable-dragging > .grid-stack-item-content > .widget-card {
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* --- Widget table scroll --- */
.widget-body .table-wrap {
  overflow: auto;
  max-height: 100%;
}

/* ==================== NEW WIDGETS — Batch 2 ==================== */

/* Timeframe toggle bar */
.widget-timeframe-bar {
  display: flex;
  gap: 4px;
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
}

.widget-timeframe-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: 'Inter', system-ui, sans-serif;
}

.widget-timeframe-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.widget-timeframe-btn.active {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}

/* Performance table */
/* Performance controls */
.perf-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0 var(--space-3) 0;
}
.perf-view-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-md);
  padding: 2px;
}
.perf-view-tab {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.perf-view-tab:hover {
  color: var(--text-primary);
}
.perf-view-tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.perf-table-wrap {
  overflow: auto;
  max-height: 100%;
}

.perf-table th {
  font-size: 11px;
  white-space: nowrap;
}

.perf-table td {
  font-size: 12px;
  white-space: nowrap;
}

.perf-quarter-row {
  font-weight: 500;
}

.perf-latest {
  background: rgba(34, 197, 94, 0.04);
}

[data-theme="dark"] .perf-latest {
  background: rgba(34, 197, 94, 0.06);
}

.perf-month-row {
  font-weight: 400;
}

.perf-month-row td {
  color: var(--text-secondary);
  font-size: 12px;
}

.perf-period {
  display: flex;
  align-items: center;
  gap: 8px;
}

.perf-quarter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.perf-latest .perf-quarter-badge {
  border-color: #22c55e;
  color: #22c55e;
}

.perf-year {
  font-weight: 600;
  font-size: 14px;
}

.perf-month-name {
  padding-left: 36px;
  font-weight: 500;
  color: var(--text-primary);
}

.perf-toggle {
  opacity: 0.5;
  transition: opacity 0.18s ease;
}

.perf-toggle:hover {
  opacity: 1;
}

/* ============================================
   Preferences & Personalization
   ============================================ */

/* Toggle info block (label + description) */
.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.toggle-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

/* Preferences select dropdown (matches modal-input) */
.pref-select {
  padding: var(--space-2) var(--space-4);
  padding-right: calc(var(--space-4) + 20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  font-size: var(--text-sm);
  color: var(--text-primary);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  cursor: pointer;
  min-width: 160px;
  font-family: inherit;
  transition: border-color var(--duration) var(--ease);
}

.pref-select:focus {
  outline: none;
  border-color: var(--text-primary);
}

/* Saved indicator */
.pref-saved-indicator {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 450;
  color: var(--green);
  margin-left: var(--space-3);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.pref-saved-indicator.visible {
  opacity: 1;
}

/* Section title flex layout for saved indicator */
.settings-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Privacy mode blur */
.privacy-mode .kpi-value,
.privacy-mode .asset-qty,
.privacy-mode td:nth-child(n+2):not(:last-child) {
  filter: blur(8px);
  user-select: none;
}

/* ==================== NOTIFICATION CENTER ==================== */

.notification-bell {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.notification-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 199;
}

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

.notification-panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: 380px;
  max-height: calc(100vh - var(--header-height) - 24px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 0 var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.notification-panel.active {
  transform: translateX(0);
  opacity: 1;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.notification-panel-header h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.notification-panel-actions {
  display: flex;
  gap: var(--space-1);
}

.notification-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.notification-action-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.notification-panel-filters {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.notification-filter {
  padding: var(--space-1) var(--space-3);
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.notification-filter:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.notification-filter.active {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}

.notification-list {
  flex: 1;
  overflow-y: auto;
  max-height: 480px;
}

.notification-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.notification-item:hover {
  background: var(--bg-surface);
}

.notification-item.unread {
  background: var(--bg-surface);
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #22c55e;
}

.notification-item {
  position: relative;
}

.notification-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.notification-icon.staking_rewards {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.notification-icon.interest_payouts {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.notification-icon.price_alerts {
  background: rgba(234, 179, 8, 0.12);
  color: #eab308;
}

.notification-icon.weekly_reports {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.notification-icon.security_alerts {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-content-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  line-height: 1.3;
}

.notification-content-message {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-time {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-5);
  color: var(--text-muted);
  gap: var(--space-3);
}

.notification-empty p {
  font-size: 13px;
  margin: 0;
}

/* Mobile notification panel */
@media (max-width: 768px) {
  .notification-panel {
    width: 100%;
    max-height: 60vh;
    top: auto;
    bottom: 60px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 1px solid var(--border);
  }
}

/* ==================== SESSION TIMEOUT BANNER ==================== */

.session-timeout-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--bg);
  border: 1px solid #eab308;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 13px;
  color: var(--text-primary);
}

.session-timeout-banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.session-timeout-banner i {
  color: #eab308;
  flex-shrink: 0;
}

.session-timeout-banner span {
  white-space: nowrap;
}

.session-timeout-banner .btn {
  margin-left: var(--space-2);
  white-space: nowrap;
  background: var(--text-primary);
  color: var(--bg);
  border: none;
  font-weight: 600;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin {
  animation: spin 1s linear infinite;
}

/* ==================== PRICE ALERTS ==================== */

.price-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.price-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.price-alert-item:last-child {
  border-bottom: none;
}

.price-alert-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.price-alert-coin {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-alert-symbol {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.price-alert-condition {
  font-size: 13px;
  color: var(--text-secondary);
}

.price-alert-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.price-alert-status {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.price-alert-status.active {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.price-alert-status.inactive {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.price-alert-triggered {
  color: var(--text-secondary);
}

.price-alert-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.icon-btn.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-small:hover {
  background: var(--hover);
  border-color: var(--text-secondary);
}

#price-alerts-section .settings-section-title {
  display: flex;
  align-items: center;
}

/* =============================================
   UTILIZE — TRADERS DASHBOARD STYLES
   ============================================= */

/* KPI win-rate card layout */
.td-winrate-card .kpi-label {
  margin-bottom: var(--space-2);
}

.td-winrate-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.td-winrate-chart-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.td-winrate-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-primary);
  pointer-events: none;
}

.td-winrate-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Trade Overview Grid */
.trade-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-1);
}

.trade-overview-stat {
  padding: var(--space-4) var(--space-5);
  border-right: 1px solid var(--border-subtle);
}

.trade-overview-stat:last-child {
  border-right: none;
}

.trade-overview-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.trade-overview-value {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}

.trade-overview-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Charts side-by-side */
.td-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 800px) {
  .td-charts-grid {
    grid-template-columns: 1fr;
  }
  .trade-overview-grid {
    grid-template-columns: 1fr;
  }
  .trade-overview-stat {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .trade-overview-stat:last-child {
    border-bottom: none;
  }
}

/* Chart legend */
.td-chart-legend {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.td-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* PnL Toggle */
.pnl-toggle-group {
  display: flex;
  gap: 2px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.pnl-toggle-btn {
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-family: inherit;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.pnl-toggle-btn.active {
  background: var(--bg);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.pnl-toggle-btn:hover:not(.active) {
  color: var(--text-secondary);
}

/* PnL Calendar */
.pnl-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-4) 0 var(--space-4) 0;
}

.pnl-cal-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.pnl-cal-summary {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.pnl-cal-sum-item {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.pnl-cal-sum-item strong {
  font-weight: 600;
}

.pnl-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding-bottom: var(--space-2);
}

.pnl-cal-dow {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-1) 0 var(--space-2);
  font-weight: 500;
}

.pnl-calendar-day {
  min-height: 60px;
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  transition: border-color var(--duration) var(--ease);
}

.pnl-calendar-day:hover {
  border-color: var(--border);
}

.pnl-day-empty {
  background: transparent;
  border-color: transparent;
}

.pnl-day-profit {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.20);
}

.pnl-day-loss {
  background: rgba(239, 68, 68, 0.07);
  border-color: rgba(239, 68, 68, 0.18);
}

.pnl-day-neutral {
  background: var(--bg-surface);
}

.pnl-day-num {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1;
}

.pnl-day-val {
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.2;
}

.pnl-day-profit .pnl-day-val {
  color: var(--green);
}

.pnl-day-loss .pnl-day-val {
  color: var(--red);
}

/* Trade Stats Grid */
.trade-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  padding: var(--space-2) 0 var(--space-4) 0;
}

@media (max-width: 700px) {
  .trade-stats-grid {
    grid-template-columns: 1fr;
  }
}

.trade-stat-item {
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.trade-stat-top {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.trade-stat-ring-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.trade-stat-ring-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-primary);
  pointer-events: none;
}

.trade-stat-detail {
  flex: 1;
}

.trade-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
}

.trade-stat-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.trade-stat-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.trade-stats-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-2) 0 var(--space-4) 0;
}

/* Long / Short breakdown */
.trade-ls-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: var(--space-6);
  padding-bottom: var(--space-2);
}

@media (max-width: 700px) {
  .trade-ls-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

.trade-ls-divider {
  background: var(--border-subtle);
  width: 1px;
}

.trade-ls-header {
  margin-bottom: var(--space-4);
}

.trade-ls-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

@media (max-width: 900px) {
  .trade-ls-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.trade-ls-stat {
  /* stat cell */
}

.trade-ls-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.trade-ls-value {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Position side badge */
.position-side-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.badge-long {
  background: var(--green-bg);
  color: var(--green);
}

.badge-short {
  background: var(--red-bg);
  color: var(--red);
}

/* Order Tabs */
.order-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: 0 calc(-1 * var(--space-5));
  padding: 0 var(--space-5);
}

.order-tab {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-family: inherit;
  font-weight: 500;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: -1px;
}

.order-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

.order-tab:hover:not(.active) {
  color: var(--text-secondary);
}

.order-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.order-tab.active .order-tab-count {
  background: var(--text-primary);
  color: var(--bg);
}

/* Cancel button in orders table */
.td-cancel-btn {
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-family: inherit;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--red);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}

.td-cancel-btn:hover {
  background: var(--red-bg);
  border-color: var(--red);
}

/* Count badge in card header */
.td-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

/* Responsive: mobile calendar */
@media (max-width: 600px) {
  .pnl-calendar {
    gap: 2px;
  }
  .pnl-calendar-day {
    min-height: 44px;
    padding: 3px;
  }
  .pnl-day-num {
    font-size: 10px;
  }
  .pnl-day-val {
    font-size: 9px;
  }
  .pnl-cal-dow {
    font-size: 10px;
  }
}

/* Utilize Live/Demo data badge */
.utilize-data-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.utilize-data-badge.demo {
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.utilize-data-badge.live {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.utilize-data-badge.loading {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

