/* Setup Manager - Premium Styles */
/* Supports: Classic (light/dark) + Gamma (light/dark) themes */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================================
   CLASSIC THEME - Light Mode (Default)
   ============================================ */
:root {
  --bg-primary: linear-gradient(135deg, #fafafa 0%, #f0f4f8 100%);
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-sidebar: rgba(255, 255, 255, 0.9);
  --bg-input: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.04);
  --bg-prices: #f5f5f7;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --border-color: rgba(0, 0, 0, 0.08);
  --accent-blue: #007AFF;
  --accent-purple: #5856D6;
  --accent-green: #34c759;
  --accent-orange: #ff9500;
  --accent-red: #ff3b30;
  --bybit-color: #f7931a;
  --gate-color: #2354e6;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Classic Theme - Dark Mode */
[data-theme="dark"] {
  --bg-primary: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
  --bg-card: rgba(44, 44, 46, 0.95);
  --bg-sidebar: rgba(28, 28, 30, 0.95);
  --bg-input: #3a3a3c;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-prices: #3a3a3c;
  --text-primary: #f5f5f7;
  --text-secondary: #98989d;
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ============================================
   GAMMA THEME - Dark Mode (Default for Gamma)
   ============================================ */
[data-style="gamma"] {
  --bg-primary: linear-gradient(135deg, #1C1D1F 0%, #2a2520 100%);
  --bg-card: rgba(44, 40, 35, 0.95);
  --bg-sidebar: rgba(28, 29, 31, 0.98);
  --bg-input: #3a3630;
  --bg-hover: rgba(132, 72, 45, 0.15);
  --bg-prices: #3a3630;
  --text-primary: #F2D4BA;
  --text-secondary: #BDA189;
  --border-color: rgba(132, 72, 45, 0.3);
  --accent-blue: #D4915C;
  --accent-purple: #BE6841;
  --accent-green: #8FBC5A;
  --accent-orange: #E8A860;
  --accent-red: #C45C3A;
  --bybit-color: #D4915C;
  --gate-color: #8B6E5A;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* Gamma Theme - Light Mode */
[data-style="gamma"][data-theme="light"] {
  --bg-primary: linear-gradient(135deg, #FAF7F2 0%, #F5EDE4 100%);
  --bg-card: rgba(255, 252, 248, 0.95);
  --bg-sidebar: rgba(250, 247, 242, 0.98);
  --bg-input: #FFFCF8;
  --bg-hover: rgba(132, 72, 45, 0.08);
  --bg-prices: #F5EDE4;
  --text-primary: #50352B;
  --text-secondary: #84482D;
  --border-color: rgba(132, 72, 45, 0.15);
  --shadow-sm: 0 2px 8px rgba(80, 53, 43, 0.1);
  --shadow-md: 0 4px 16px rgba(80, 53, 43, 0.12);
  --shadow-lg: 0 8px 32px rgba(80, 53, 43, 0.15);
}

/* Gamma Typography */
[data-style="gamma"] body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-style="gamma"] h1,
[data-style="gamma"] h2,
[data-style="gamma"] h3,
[data-style="gamma"] .setup-ticker,
[data-style="gamma"] .sidebar-logo h1,
[data-style="gamma"] .stat-value,
[data-style="gamma"] .stats-card-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
}

/* ============================================
   BASE STYLES
   ============================================ */
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   LAYOUT
   ============================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-logo {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.sidebar-logo p {
  font-size: 13px;
  color: var(--text-secondary);
}

[data-style="gamma"] .sidebar-logo h1 {
  background: linear-gradient(135deg, #D4915C 0%, #E8A860 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  margin-bottom: 20px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 6px;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

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

.nav-item.active {
  background: rgba(0, 122, 255, 0.12);
  color: var(--accent-blue);
}

[data-style="gamma"] .nav-item.active {
  background: rgba(212, 145, 92, 0.15);
  color: #D4915C;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-blue);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

[data-style="gamma"] .nav-badge {
  background: #D4915C;
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
}

.user-profile:hover {
  background: var(--bg-hover);
}

.user-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
}

[data-style="gamma"] .user-avatar {
  background: linear-gradient(135deg, #84482D 0%, #BE6841 100%);
}

.user-info {
  flex: 1;
}

.user-role {
  font-size: 12px;
  color: var(--text-secondary);
}

.user-email {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* User Menu Dropdown */
.user-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 1000;
  overflow: hidden;
}

.user-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.user-menu-item .menu-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-menu-item .menu-icon svg {
  width: 24px;
  height: 24px;
}

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

.user-menu-item.danger {
  color: var(--accent-red);
}

/* Style Options */
.style-options {
  display: flex;
  gap: 8px;
}

.style-option {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.style-option:hover {
  border-color: var(--text-secondary);
}

.style-option.active {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(0, 122, 255, 0.08);
}

[data-style="gamma"] .style-option.active {
  border-color: #D4915C;
  color: #D4915C;
  background: rgba(212, 145, 92, 0.1);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 12px;
}

.theme-toggle-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #e5e5ea;
  border-radius: 28px;
  transition: 0.3s;
}

.theme-slider::before {
  position: absolute;
  content: "";
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.theme-switch input:checked + .theme-slider {
  background: var(--accent-blue);
}

[data-style="gamma"] .theme-switch input:checked + .theme-slider {
  background: #D4915C;
}

.theme-switch input:checked + .theme-slider::before {
  transform: translateX(24px);
}

.theme-icon-sun,
.theme-icon-moon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-icon-sun {
  left: 7px;
}

.theme-icon-moon {
  right: 7px;
}

.theme-icon-sun svg,
.theme-icon-moon svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: white;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 24px;
  min-height: 100vh;
}

/* ============================================
   LIVE PRICES
   ============================================ */
.live-prices-widget {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  background: var(--bg-prices);
  border-radius: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

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

.live-price-symbol {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.live-price-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 95px;
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  transition: color 0.3s ease, transform 0.15s ease;
}

.live-price-value.price-up {
  color: var(--accent-green) !important;
  animation: priceFlashUp 0.6s ease;
}

.live-price-value.price-down {
  color: var(--accent-red) !important;
  animation: priceFlashDown 0.6s ease;
}

@keyframes priceFlashUp {
  0% { transform: scale(1); }
  25% { transform: scale(1.08); }
  50% { transform: scale(1); }
}

@keyframes priceFlashDown {
  0% { transform: scale(1); }
  25% { transform: scale(0.95); }
  50% { transform: scale(1); }
}

/* ============================================
   DASHBOARD STATS
   ============================================ */
.dashboard-stats {
  margin-bottom: 32px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.stat-item {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

[data-style="gamma"] .stat-item {
  border: 1px solid rgba(132, 72, 45, 0.2);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-value .green { color: var(--accent-green); }
.stat-value .red { color: var(--accent-red); }
.stat-value .bybit { color: var(--bybit-color); }
.stat-value .gate { color: var(--gate-color); }

.stat-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

[data-style="gamma"] .page-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
}

.page-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.page-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

/* ============================================
   SETUP CARDS
   ============================================ */
.setups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.setup-card {
  position: relative;
  background: var(--bg-card);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  cursor: context-menu;
  transition: all 0.3s ease;
}

.setup-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

[data-style="gamma"] .setup-card {
  border: 1px solid rgba(132, 72, 45, 0.2);
}

.setup-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.setup-ticker {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.setup-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-long {
  background: rgba(52, 199, 89, 0.15);
  color: var(--accent-green);
}

.badge-short {
  background: rgba(255, 59, 48, 0.15);
  color: var(--accent-red);
}

[data-style="gamma"] .badge-long {
  background: rgba(143, 188, 90, 0.2);
  color: #8FBC5A;
}

[data-style="gamma"] .badge-short {
  background: rgba(196, 92, 58, 0.2);
  color: #C45C3A;
}

.badge-leverage {
  background: rgba(88, 86, 214, 0.12);
  color: var(--accent-purple);
}

[data-style="gamma"] .badge-leverage {
  background: rgba(232, 168, 96, 0.15);
  color: #E8A860;
}

.badge-market {
  background: rgba(255, 149, 0, 0.12);
  color: var(--accent-orange);
}

.setup-risk {
  font-size: 12px;
  color: var(--text-secondary);
}

.setup-exchange {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}

.exchange-bybit {
  background: rgba(247, 147, 26, 0.12);
  color: var(--bybit-color);
}

.exchange-gate {
  background: rgba(35, 84, 230, 0.12);
  color: var(--gate-color);
}

[data-style="gamma"] .exchange-bybit {
  background: rgba(212, 145, 92, 0.15);
  color: #D4915C;
}

[data-style="gamma"] .exchange-gate {
  background: rgba(139, 110, 90, 0.15);
  color: #8B6E5A;
}

.setup-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

.status-active {
  background: rgba(52, 199, 89, 0.15);
  color: var(--accent-green);
}

.status-limit {
  background: rgba(255, 149, 0, 0.15);
  color: var(--accent-orange);
}

.status-completed {
  background: rgba(52, 199, 89, 0.15);
  color: var(--accent-green);
}

.status-cancelled {
  background: rgba(142, 142, 147, 0.15);
  color: var(--text-secondary);
}

.status-stopped {
  background: rgba(255, 59, 48, 0.15);
  color: var(--accent-red);
}

[data-style="gamma"] .status-active,
[data-style="gamma"] .status-completed {
  background: rgba(143, 188, 90, 0.15);
  color: #8FBC5A;
}

[data-style="gamma"] .status-stopped {
  background: rgba(196, 92, 58, 0.15);
  color: #C45C3A;
}

/* Setup Prices */
.setup-prices {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.price-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.price-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.price-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.price-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-input);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.price-tag.hit,
.price-tag.entry-executed {
  background: rgba(52, 199, 89, 0.1);
  border-color: rgba(52, 199, 89, 0.3);
  color: var(--accent-green);
}

[data-style="gamma"] .price-tag.hit,
[data-style="gamma"] .price-tag.entry-executed {
  background: rgba(143, 188, 90, 0.15);
  border-color: rgba(143, 188, 90, 0.3);
  color: #8FBC5A;
}

.price-tag.stop {
  background: rgba(255, 59, 48, 0.08);
  border-color: rgba(255, 59, 48, 0.2);
}

.price-tag.stop-executed {
  background: rgba(255, 59, 48, 0.15);
  border-color: rgba(255, 59, 48, 0.3);
  color: var(--accent-red);
}

[data-style="gamma"] .price-tag.stop {
  background: rgba(196, 92, 58, 0.08);
  border-color: rgba(196, 92, 58, 0.2);
}

[data-style="gamma"] .price-tag.stop-executed {
  background: rgba(196, 92, 58, 0.15);
  color: #C45C3A;
}

.price-percent {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-green);
}

.price-percent.negative {
  color: var(--accent-red);
}

.price-percent.executed {
  opacity: 0.7;
}

[data-style="gamma"] .price-percent {
  color: #8FBC5A;
}

[data-style="gamma"] .price-percent.negative {
  color: #C45C3A;
}

/* Setup Comment */
.setup-comment {
  margin-top: 14px;
  padding: 12px;
  background: var(--bg-hover);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  border-left: 3px solid var(--accent-blue);
}

[data-style="gamma"] .setup-comment {
  border-left-color: #D4915C;
}

/* Delete Button */
.delete-setup-btn {
  margin-top: 16px;
  padding: 10px 16px;
  width: 100%;
  background: rgba(255, 59, 48, 0.1);
  border: none;
  border-radius: 10px;
  color: var(--accent-red);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.delete-setup-btn:hover {
  background: rgba(255, 59, 48, 0.2);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-hover);
}

.empty-state-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--text-secondary);
  opacity: 0.6;
}

.empty-state-text {
  font-size: 16px;
  color: var(--text-secondary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.45);
}

[data-style="gamma"] .btn-primary {
  background: linear-gradient(135deg, #84482D 0%, #BE6841 100%);
  box-shadow: 0 4px 14px rgba(132, 72, 45, 0.4);
}

[data-style="gamma"] .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(132, 72, 45, 0.5);
}

.btn-block {
  width: 100%;
  margin-bottom: 20px;
}

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

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

.btn-danger {
  background: rgba(255, 59, 48, 0.1);
  color: var(--accent-red);
}

.btn-danger:hover {
  background: rgba(255, 59, 48, 0.2);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

[data-style="gamma"] .form-input:focus,
[data-style="gamma"] .form-select:focus,
[data-style="gamma"] .form-textarea:focus {
  border-color: #D4915C;
  box-shadow: 0 0 0 3px rgba(212, 145, 92, 0.15);
}

.form-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Exchange Toggle */
.exchange-toggle {
  display: flex;
  gap: 12px;
}

.exchange-btn {
  flex: 1;
  padding: 14px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.exchange-btn.bybit.active {
  border-color: var(--bybit-color);
  color: var(--bybit-color);
  background: rgba(247, 147, 26, 0.08);
}

.exchange-btn.gate.active {
  border-color: var(--gate-color);
  color: var(--gate-color);
  background: rgba(35, 84, 230, 0.08);
}

[data-style="gamma"] .exchange-btn.bybit.active {
  border-color: #D4915C;
  color: #D4915C;
  background: rgba(212, 145, 92, 0.1);
}

[data-style="gamma"] .exchange-btn.gate.active {
  border-color: #8B6E5A;
  color: #8B6E5A;
  background: rgba(139, 110, 90, 0.1);
}

/* Direction Toggle */
.direction-toggle {
  display: flex;
  gap: 12px;
}

.direction-btn {
  flex: 1;
  padding: 14px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.direction-btn.long.active {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
}

.direction-btn.short.active {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
}

[data-style="gamma"] .direction-btn.long.active {
  background: #8FBC5A;
  border-color: #8FBC5A;
}

[data-style="gamma"] .direction-btn.short.active {
  background: #C45C3A;
  border-color: #C45C3A;
}

/* Order Type Toggle */
.order-type-toggle {
  display: flex;
  gap: 12px;
}

.order-type-btn {
  flex: 1;
  padding: 16px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.order-type-btn:hover {
  border-color: var(--text-secondary);
}

.order-type-btn.active {
  border-color: var(--accent-blue);
  background: rgba(0, 122, 255, 0.06);
}

[data-style="gamma"] .order-type-btn.active {
  border-color: #D4915C;
  background: rgba(212, 145, 92, 0.1);
}

.order-type-icon {
  font-size: 24px;
}

.order-type-btn span:not(.order-type-icon):not(.order-type-desc) {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.order-type-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Leverage Input */
.leverage-input-wrapper {
  position: relative;
}

.leverage-input-wrapper .form-input {
  padding-right: 36px;
}

.leverage-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-weight: 600;
}

/* Position Size Input */
.position-size-input-wrapper {
  position: relative;
}

.position-size-input-wrapper .form-input {
  padding-left: 30px;
}

.position-size-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-weight: 600;
}

/* Form hint */
.form-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal {
  background: var(--bg-card);
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

[data-style="gamma"] .modal {
  border: 1px solid rgba(132, 72, 45, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

[data-style="gamma"] .modal-header h3 {
  font-family: 'Playfair Display', Georgia, serif;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-input);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 80px);
}

/* ============================================
   STATS PAGE
   ============================================ */
.period-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.period-btn {
  padding: 8px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.period-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

[data-style="gamma"] .period-btn.active {
  background: #D4915C;
  border-color: #D4915C;
}

.custom-dates {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.custom-dates input {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
}

/* Stats Cards */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stats-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

[data-style="gamma"] .stats-card {
  border: 1px solid rgba(132, 72, 45, 0.2);
}

.stats-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stats-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Chart */
.chart-card {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

[data-style="gamma"] .chart-card {
  border: 1px solid rgba(132, 72, 45, 0.2);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-tabs {
  display: flex;
  gap: 8px;
}

.chart-tab {
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-tab.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

[data-style="gamma"] .chart-tab.active {
  background: #D4915C;
  border-color: #D4915C;
}

/* Chart Type Toggle */
.chart-type-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: 8px;
  padding: 4px;
  border: 1px solid var(--border-color);
}

.chart-type-btn {
  padding: 6px 14px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.chart-type-btn.active {
  background: var(--accent-blue);
  color: white;
}

[data-style="gamma"] .chart-type-btn.active {
  background: #D4915C;
}

/* Distribution */
.distribution-card {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

[data-style="gamma"] .distribution-card {
  border: 1px solid rgba(132, 72, 45, 0.2);
}

.distribution-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.distribution-row:last-of-type {
  border-bottom: none;
}

.distribution-legend {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Setup List Item */
.setup-list-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 10px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

.setup-list-ticker {
  font-weight: 600;
  color: var(--text-primary);
}

.setup-list-pnl {
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}

.setup-list-pnl.positive {
  color: var(--accent-green);
}

.setup-list-pnl.negative {
  color: var(--accent-red);
}

/* ============================================
   CONTEXT MENU
   ============================================ */
.context-menu {
  position: fixed;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  min-width: 180px;
  padding: 8px;
  z-index: 1001;
}

.context-menu-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.context-menu-item:hover {
  background: var(--bg-hover);
}

.context-menu-item.danger {
  color: var(--accent-red);
}

.context-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 0;
}

/* ============================================
   PORTFOLIO
   ============================================ */
.portfolio-overview {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  margin-bottom: 32px;
}

.portfolio-balance-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.portfolio-balance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.portfolio-balance-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.portfolio-balance-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.portfolio-balance-sub {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-isolated {
  background: rgba(0, 122, 255, 0.15);
  color: var(--accent-blue);
}

.badge-cross {
  background: rgba(255, 149, 0, 0.15);
  color: var(--accent-orange);
}

.portfolio-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.portfolio-stat-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.portfolio-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.portfolio-stat-value {
  font-size: 24px;
  font-weight: 600;
}

.portfolio-settings {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.portfolio-settings h3 {
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 600;
}

.portfolio-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: end;
}

.portfolio-suggested-size {
  font-size: 24px;
  font-weight: 600;
  color: var(--accent-blue);
  padding: 8px 0;
}

.portfolio-positions {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.portfolio-positions h3 {
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 600;
}

.positions-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.positions-header {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 0.7fr 1fr;
  gap: 16px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.positions-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 0.7fr 1fr;
  gap: 16px;
  padding: 12px 16px;
  align-items: center;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.positions-row:hover {
  background: var(--bg-hover);
}

.position-ticker {
  font-weight: 600;
  color: var(--text-primary);
}

.position-direction.long {
  color: var(--accent-green);
  font-weight: 500;
}

.position-direction.short {
  color: var(--accent-red);
  font-weight: 500;
}

.position-size {
  font-weight: 500;
}

.position-entry {
  color: var(--text-secondary);
}

.position-leverage {
  font-weight: 500;
  color: var(--accent-orange);
}

.portfolio-history {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.portfolio-history h3 {
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 600;
}

.portfolio-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portfolio-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.portfolio-history-item:hover {
  background: var(--bg-hover);
}

.portfolio-history-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portfolio-history-ticker {
  font-weight: 600;
}

.portfolio-history-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.portfolio-history-pnl {
  font-weight: 600;
  font-size: 15px;
}

/* Gamma theme portfolio */
[data-style="gamma"] .portfolio-balance-value,
[data-style="gamma"] .portfolio-stat-value,
[data-style="gamma"] .portfolio-suggested-size {
  font-family: 'Playfair Display', Georgia, serif;
}

[data-style="gamma"] .badge-isolated {
  background: rgba(212, 145, 92, 0.15);
  color: #D4915C;
}

/* Responsive portfolio */
@media (max-width: 1024px) {
  .portfolio-overview {
    grid-template-columns: 1fr;
  }
  
  .portfolio-settings-grid {
    grid-template-columns: 1fr;
  }
  
  .positions-header,
  .positions-row {
    grid-template-columns: 1fr 1fr 1fr;
  }
  
  .positions-header > div:nth-child(4),
  .positions-header > div:nth-child(5),
  .positions-row > div:nth-child(4),
  .positions-row > div:nth-child(5) {
    display: none;
  }
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
#app {
  min-height: 100vh;
  width: 100%;
}

.login-screen,
.login-container {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 24px;
  box-sizing: border-box;
}

.login-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  margin: 0 auto;
}

[data-style="gamma"] .login-card {
  border: 1px solid rgba(132, 72, 45, 0.2);
}

/* Login Header with Logo */
.login-header {
  margin-bottom: 32px;
  text-align: center;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.login-logo h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
}

.login-logo p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

[data-style="gamma"] .login-logo h1 {
  background: linear-gradient(135deg, #D4915C 0%, #E8A860 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-card h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.login-error {
  margin-top: 16px;
  padding: 12px;
  background: rgba(255, 59, 48, 0.1);
  border-radius: 10px;
  color: var(--accent-red);
  font-size: 13px;
}

/* ============================================
   LOADING
   ============================================ */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* ============================================
   UTILITIES
   ============================================ */
.green { color: var(--accent-green) !important; }
.red { color: var(--accent-red) !important; }
.orange { color: var(--accent-orange) !important; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .setups-grid {
    grid-template-columns: 1fr;
  }
  
  .modal {
    max-width: 100%;
    border-radius: 16px;
  }
  
  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .live-prices-widget {
    flex-direction: column;
    gap: 8px;
  }
  
  .direction-toggle,
  .exchange-toggle,
  .order-type-toggle {
    flex-direction: column;
  }
}

/* Telegram Link */
.telegram-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-top: 16px;
  margin-bottom: 12px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.telegram-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: #0088cc;
}

.telegram-link:hover .telegram-icon {
  color: #0088cc;
}

.telegram-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.telegram-icon svg {
  width: 20px;
  height: 20px;
}

[data-style="gamma"] .telegram-link:hover {
  border-color: #D4915C;
}

[data-style="gamma"] .telegram-link:hover .telegram-icon {
  color: #D4915C;
}

/* ============================================
   SVG ICONS & DECORATIVE ELEMENTS
   Добавить в конец styles.css
   ============================================ */

/* Nav Icons */
.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.nav-text {
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Button Icons */
.btn-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 100%;
  height: 100%;
}

/* Menu Icons */
.menu-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  opacity: 0.7;
  flex-shrink: 0;
}

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

/* Login Logo Icon */
.login-logo-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 122, 255, 0.3);
}

.login-logo-icon svg {
  width: 32px;
  height: 32px;
  stroke: white;
}

[data-style="gamma"] .login-logo-icon {
  background: linear-gradient(135deg, #84482D 0%, #BE6841 100%);
  box-shadow: 0 8px 32px rgba(132, 72, 45, 0.4);
}

/* Guest Avatar */
.guest-avatar {
  background: var(--bg-input) !important;
}

.guest-avatar svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
}

/* ============================================
   DECORATIVE ELEMENTS
   ============================================ */

/* Sidebar gradient accent */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  opacity: 0.8;
}

[data-style="gamma"] .sidebar::before {
  background: linear-gradient(90deg, #84482D 0%, #D4915C 50%, #E8A860 100%);
}

/* Card hover glow effect */
.setup-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent 0%, rgba(0, 122, 255, 0.1) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.setup-card {
  position: relative;
}

.setup-card:hover::before {
  opacity: 1;
}

[data-style="gamma"] .setup-card::before {
  background: linear-gradient(135deg, transparent 0%, rgba(212, 145, 92, 0.2) 100%);
}

/* Stats card decorative corner */
.stat-item::after,
.stats-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 122, 255, 0.05) 50%);
  border-radius: 0 16px 0 0;
  pointer-events: none;
}

.stat-item,
.stats-card {
  position: relative;
  overflow: hidden;
}

[data-style="gamma"] .stat-item::after,
[data-style="gamma"] .stats-card::after {
  background: linear-gradient(135deg, transparent 50%, rgba(212, 145, 92, 0.08) 50%);
}

/* Active nav item indicator */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--accent-blue);
  border-radius: 0 3px 3px 0;
}

.nav-item {
  position: relative;
}

[data-style="gamma"] .nav-item.active::before {
  background: #D4915C;
}

/* Badge pulse animation for new items */
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.nav-badge.new {
  animation: badge-pulse 2s ease-in-out infinite;
}

/* Button gradient border on hover */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple), var(--accent-blue));
  background-size: 200% 200%;
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover::before {
  opacity: 1;
  animation: gradient-shift 2s ease infinite;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

[data-style="gamma"] .btn-primary::before {
  background: linear-gradient(45deg, #84482D, #D4915C, #E8A860, #84482D);
  background-size: 200% 200%;
}

/* Modal backdrop pattern */
.modal-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

/* Price tag shine effect */
.price-tag.hit::after,
.price-tag.entry-executed::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shine 2s ease-in-out infinite;
}

.price-tag {
  position: relative;
  overflow: hidden;
}

@keyframes shine {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

/* Floating particles background (optional - for Gamma theme) */
[data-style="gamma"] .main-content::before {
  content: '';
  position: fixed;
  top: 0;
  left: 280px;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(212, 145, 92, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(190, 104, 65, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Focus ring for accessibility */
.btn:focus-visible,
.nav-item:focus-visible,
.form-input:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

[data-style="gamma"] .btn:focus-visible,
[data-style="gamma"] .nav-item:focus-visible,
[data-style="gamma"] .form-input:focus-visible {
  outline-color: #D4915C;
}

/* Entry rows with sizes */
.entries-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entry-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
  align-items: center;
}

.entry-size-wrapper {
  position: relative;
}

.entry-size-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 14px;
  pointer-events: none;
}

.entry-size-input {
  padding-left: 28px !important;
}

/* Disclaimer styles */
.portfolio-disclaimer {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.disclaimer-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.disclaimer-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.disclaimer-text strong {
  color: var(--text-primary);
}

/* Gamma style disclaimer */
[data-style="gamma"] .portfolio-disclaimer {
  background: rgba(212, 145, 92, 0.1);
  border-color: rgba(212, 145, 92, 0.3);
}

[data-style="gamma"] .disclaimer-badge {
  background: rgba(212, 145, 92, 0.2);
  color: #D4915C;
}

/* Responsive entry rows */
@media (max-width: 600px) {
  .entry-row {
    grid-template-columns: 1fr 100px;
    gap: 8px;
  }
}

/* Invite items */
.invite-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.invite-item .btn-sm {
  flex-shrink: 0;
}

/* TP Strategy settings */
.tp-strategy-info {
  margin-bottom: 16px;
}

.tp-strategy-info p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tp-ratio-sum {
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
  margin-top: 8px;
}

.tp-ratio-sum.valid {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
}

.tp-ratio-sum.invalid {
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
}

/* Checkbox styles */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.checkbox-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

[data-style="gamma"] .checkbox-label input[type="checkbox"] {
  accent-color: #D4915C;
}

[data-style="gamma"] .tp-ratio-sum.valid {
  background: rgba(212, 145, 92, 0.15);
  color: #D4915C;
}

/* Portfolio stat sub text */
.portfolio-stat-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.position-margin {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Risk badges with icons */
.setup-risk {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.risk-icon {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.risk-icon svg {
  width: 100%;
  height: 100%;
}

.risk-normal {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
}

.risk-high {
  background: rgba(255, 149, 0, 0.15);
  color: #ff9500;
}

.risk-ludka {
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
}

/* Gamma style risks */
[data-style="gamma"] .risk-normal {
  background: rgba(212, 145, 92, 0.15);
  color: #a8c686;
}

[data-style="gamma"] .risk-high {
  background: rgba(212, 145, 92, 0.2);
  color: #D4915C;
}

[data-style="gamma"] .risk-ludka {
  background: rgba(255, 100, 100, 0.15);
  color: #ff6464;
}

/* Market order entry field */
.market-entry {
  background: rgba(255, 149, 0, 0.1) !important;
  border-color: rgba(255, 149, 0, 0.3) !important;
  color: var(--accent-orange) !important;
  cursor: not-allowed;
}

.market-entry::placeholder {
  color: var(--accent-orange);
  opacity: 0.7;
}

[data-style="gamma"] .market-entry {
  background: rgba(212, 145, 92, 0.15) !important;
  border-color: rgba(212, 145, 92, 0.4) !important;
  color: #D4915C !important;
}

/* Live price on setup card */
.setup-live-price {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.price-flash {
  animation: priceFlash 0.3s ease;
}

@keyframes priceFlash {
  0% { color: var(--accent-blue); }
  100% { color: var(--text-secondary); }
}

[data-style="gamma"] .setup-live-price {
  color: #a8c686;
}

/* PizzINT link cards */
.pizzint-link-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.pizzint-link-card:hover {
  border-color: var(--accent-orange);
  transform: translateX(4px);
}

.pizzint-link-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pizzint-link-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 149, 0, 0.1);
  border-radius: 10px;
}

.pizzint-link-text {
  flex: 1;
}

.pizzint-link-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.pizzint-link-url {
  font-size: 13px;
  color: var(--text-secondary);
}

.pizzint-link-arrow {
  font-size: 20px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.pizzint-link-card:hover .pizzint-link-arrow {
  transform: translateX(4px);
  color: var(--accent-orange);
}

.telegram-card .pizzint-link-icon {
  background: rgba(0, 136, 204, 0.15);
}

.telegram-card:hover {
  border-color: #0088cc;
}

.twitter-card .pizzint-link-icon {
  background: rgba(255, 255, 255, 0.1);
}

.twitter-card:hover {
  border-color: #fff;
}

[data-style="gamma"] .pizzint-link-card:hover {
  border-color: #D4915C;
}

[data-style="gamma"] .pizzint-link-icon {
  background: rgba(212, 145, 92, 0.15);
}
