:root {
  --bg-dark: hsl(222, 24%, 9%);
  --bg-card: hsl(222, 20%, 14%);
  --bg-card-hover: hsl(222, 20%, 17%);
  --bg-input: hsl(222, 20%, 11%);
  --border-color: hsl(222, 16%, 22%);
  --border-light: hsl(222, 16%, 28%);

  --text-main: hsl(210, 40%, 98%);
  --text-muted: hsl(215, 20%, 65%);
  --text-dim: hsl(215, 15%, 45%);

  --accent-emerald: hsl(152, 76%, 48%);
  --accent-emerald-bg: hsla(152, 76%, 48%, 0.12);
  --accent-cyan: hsl(186, 94%, 48%);
  --accent-cyan-bg: hsla(186, 94%, 48%, 0.12);
  --accent-purple: hsl(265, 89%, 66%);
  --accent-purple-bg: hsla(265, 89%, 66%, 0.12);
  --accent-orange: hsl(32, 95%, 54%);
  --accent-red: hsl(0, 84%, 60%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 28px;
  background: var(--accent-cyan-bg);
  color: var(--accent-cyan);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid hsla(186, 94%, 48%, 0.3);
}

.logo-text h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.live-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-emerald-bg);
  border: 1px solid hsla(152, 76%, 48%, 0.3);
  color: var(--accent-emerald);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.header-right {
  display: flex;
  gap: 24px;
}

.server-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.stat-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, border-color 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
}

.kpi-icon {
  font-size: 26px;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: hsl(222, 20%, 18%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-card.highlight-green .kpi-icon { background: var(--accent-emerald-bg); color: var(--accent-emerald); }
.kpi-card.highlight-cyan .kpi-icon { background: var(--accent-cyan-bg); color: var(--accent-cyan); }
.kpi-card.highlight-purple .kpi-icon { background: var(--accent-purple-bg); color: var(--accent-purple); }

.kpi-content {
  display: flex;
  flex-direction: column;
}

.kpi-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 2px 0;
}

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

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.tab-btn.active {
  color: var(--accent-cyan);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-bottom: 2px solid var(--bg-card);
}

.badge {
  background: hsl(222, 20%, 22%);
  color: var(--text-main);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}

.tab-btn.active .badge {
  background: var(--accent-cyan-bg);
  color: var(--accent-cyan);
}

/* Content Container */
.content-container {
  min-height: 400px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.tab-pane.active {
  display: flex;
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.pane-header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pane-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 800px;
  margin-top: 4px;
}

.search-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  width: 280px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--accent-cyan);
}

/* Table Card */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: hsl(222, 22%, 11%);
  padding: 14px 18px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--bg-card-hover);
}

.token-cell {
  display: flex;
  flex-direction: column;
}

.token-name {
  font-weight: 700;
  color: var(--text-main);
}

.token-ca {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
}

.token-ca:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.btn-copy-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 5px;
  font-size: 11px;
  line-height: 1;
}

.btn-copy-icon:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.launchpad-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.tag-trench { background: hsla(32, 95%, 54%, 0.15); color: var(--accent-orange); }
.tag-stok { background: hsla(186, 94%, 48%, 0.15); color: var(--accent-cyan); }
.tag-pump { background: hsla(152, 76%, 48%, 0.15); color: var(--accent-emerald); }
.tag-moonshot { background: hsla(265, 89%, 66%, 0.15); color: var(--accent-purple); }
.tag-standard { background: hsl(222, 16%, 22%); color: var(--text-muted); }

.fee-gain-pos {
  color: var(--accent-emerald);
  font-weight: 700;
  font-family: var(--font-mono);
}

.score-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 12px;
}

.score-100 { background: var(--accent-emerald-bg); color: var(--accent-emerald); }
.score-high { background: var(--accent-cyan-bg); color: var(--accent-cyan); }
.score-med { background: hsla(32, 95%, 54%, 0.15); color: var(--accent-orange); }

.btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 11px;
}

.btn-primary {
  background: var(--accent-cyan);
  color: hsl(222, 24%, 9%);
}

.btn-primary:hover {
  background: hsl(186, 94%, 55%);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Learning & Settings Grids */
.learning-grid, .settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
}

.card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.card-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.multiplier-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.multiplier-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* Enhanced PnL History Card Design */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 760px;
  overflow-y: auto;
  padding-right: 4px;
}

.pnl-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s, border-color 0.15s;
}

.pnl-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
}

.pnl-card.pnl-win {
  border-left: 5px solid var(--accent-emerald);
}

.pnl-card.pnl-loss {
  border-left: 5px solid var(--accent-red);
}

.pnl-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.pnl-token-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pnl-symbol {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.pnl-badge {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.pnl-headline-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.pnl-sol-val {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.pnl-usd-val {
  font-size: 12px;
  font-weight: 600;
}

/* Action Bar with CA Copy and Direct Links */
.pnl-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;
  background: hsla(222, 20%, 14%, 0.9);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.ca-copy-box {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.ca-copy-box:hover .ca-text {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.btn-copy-action {
  background: hsl(222, 20%, 20%);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.btn-copy-action:hover {
  background: var(--accent-cyan-bg);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.pnl-links-group {
  display: flex;
  gap: 8px;
}

.pnl-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.pnl-metric-box {
  background: hsla(222, 20%, 14%, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-lbl {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.metric-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* Preset & Forms */
.preset-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preset-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-cyan);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 640px;
  padding: 24px;
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
}

.modal-close:hover { color: var(--text-main); }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--accent-cyan);
  color: var(--text-main);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
  .app-layout { padding: 16px; }
  .header-right { display: none; }
  .pane-header { flex-direction: column; align-items: stretch; }
  .search-input { width: 100%; }
  .pnl-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .pnl-action-bar { flex-direction: column; align-items: stretch; }
}

/* ═══════════════════════════════════════════════════════════
   💸 BOT ƏMƏLİYYATLARI BÖLMƏSİ
   ═══════════════════════════════════════════════════════════ */

.ops-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.ops-card {
  background: var(--panel, #16181d);
  border: 1px solid var(--border, #262a33);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ops-card.ops-net {
  border-color: #3a4152;
  background: linear-gradient(135deg, #16181d 0%, #1b1f27 100%);
}

.ops-k {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #8b93a5);
}

.ops-v {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text, #e8eaf0);
}

.ops-v.ops-fee, td.ops-fee { color: #4ade80; }
.net-pos { color: #4ade80; }
.net-neg { color: #f87171; }

.ops-loading {
  padding: 20px;
  color: var(--muted, #8b93a5);
  text-align: center;
}

.ops-st {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.st-ok   { background: rgba(74, 222, 128, 0.14); color: #4ade80; }
.st-bad  { background: rgba(248, 113, 113, 0.14); color: #f87171; }
.st-wait { background: rgba(250, 204, 21, 0.14);  color: #facc15; }
.st-dry  { background: rgba(148, 163, 184, 0.14); color: #94a3b8; }

.ops-open {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.ops-sub {
  font-size: 0.7rem;
  color: var(--muted, #8b93a5);
  font-family: ui-monospace, monospace;
  margin-top: 3px;
}

.ops-note { font-size: 0.72rem; margin-top: 5px; }
.ops-note.ok  { color: #4ade80; }
.ops-note.bad { color: #fbbf24; }

.ops-err {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 3px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-links a {
  color: #60a5fa;
  text-decoration: none;
  font-size: 0.8rem;
}
.ops-links a:hover { text-decoration: underline; }

.ops-alert {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fbbf24;
  border-radius: 8px;
  padding: 11px 14px;
  margin-bottom: 14px;
  font-size: 0.86rem;
}

@media (max-width: 640px) {
  .ops-summary { grid-template-columns: repeat(2, 1fr); }
  .ops-v { font-size: 1.05rem; }
}

.ops-closed {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.ops-speed {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  color: #38bdf8;
  cursor: help;
}
