/* ── TradeBot — Dark Trading Theme ───────────────────────── */
:root {
  --bg:        #0b0e11;
  --bg-card:   #1e2329;
  --bg-input:  #2b3139;
  --border:    #2b3139;
  --accent:    #f0b90b;
  --accent-h:  #d4a300;
  --green:     #0ecb81;
  --red:       #f6465d;
  --text:      #eaecef;
  --muted:     #848e9c;
  --radius:    8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }

/* ── Layout ──────────────────────────────────────────────────── */
.nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-right: auto;
}
.nav-logo span { color: var(--text); }
#nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav a {
  color: var(--muted);
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all .2s;
}
.nav a:hover, .nav a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.nav-user { color: var(--muted); font-size: 13px; }
.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

.container { max-width: 1280px; margin: 0 auto; padding: 24px; }
.page-title { font-size: 20px; font-weight: 600; margin-bottom: 24px; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-title {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.card-value {
  font-size: 24px;
  font-weight: 700;
}
.card-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Grid ────────────────────────────────────────────────────── */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  border: none;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-h); }
.btn-success { background: var(--green); color: #000; }
.btn-success:hover { background: #0ab873; }
.btn-danger  { background: var(--red);   color: #fff; }
.btn-danger:hover  { background: #e03a52; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
input:focus, select:focus {
  border-color: var(--accent);
}
input::placeholder { color: var(--muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
tr:hover td { background: rgba(255,255,255,.02); }
tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green  { background: rgba(14,203,129,.15); color: var(--green); }
.badge-red    { background: rgba(246,70,93,.15);   color: var(--red); }
.badge-yellow { background: rgba(240,185,11,.15);  color: var(--accent); }
.badge-gray   { background: var(--bg-input);        color: var(--muted); }

/* ── Colors utils ────────────────────────────────────────────── */
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--muted); }

/* ── Bot Status Panel ────────────────────────────────────────── */
.bot-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.bot-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--muted);
}
.dot.running { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.stopped { background: var(--red); }
.bot-actions { display: flex; gap: 10px; }

/* ── Risk selector ───────────────────────────────────────────── */
.risk-selector { display: flex; gap: 8px; }
.risk-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
}
.risk-btn.active-low    { background: rgba(14,203,129,.15); border-color: var(--green); color: var(--green); }
.risk-btn.active-medium { background: rgba(240,185,11,.15);  border-color: var(--accent); color: var(--accent); }
.risk-btn.active-high   { background: rgba(246,70,93,.15);   border-color: var(--red); color: var(--red); }

/* ── Progress bar (weight) ───────────────────────────────────── */
.weight-bar { background: var(--bg-input); border-radius: 2px; height: 4px; }
.weight-fill { background: var(--accent); border-radius: 2px; height: 4px; }

/* ── Auth pages ──────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
}
.auth-logo {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}
.auth-logo span { color: var(--text); }
.auth-sub { text-align: center; color: var(--muted); margin-bottom: 28px; font-size: 13px; }
.auth-footer { text-align: center; margin-top: 20px; color: var(--muted); font-size: 13px; }
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
  display: none;
}
.alert.show { display: block; }
.alert-error  { background: rgba(246,70,93,.15);   border: 1px solid rgba(246,70,93,.3); color: var(--red); }
.alert-success{ background: rgba(14,203,129,.15);  border: 1px solid rgba(14,203,129,.3); color: var(--green); }

/* ── Landing ─────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
}
.hero h1 {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}
.hero h1 span { color: var(--accent); }
.hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 32px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 900px;
  margin: 60px auto 0;
}
.section { padding: 60px 24px; max-width: 1200px; margin: 0 auto; }
.section-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}
.section-sub {
  text-align: center;
  color: var(--muted);
  margin-bottom: 40px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.feature-icon { font-size: 28px; margin-bottom: 12px; }
.feature-card h3 { font-size: 16px; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 13px; }

.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}
.pricing-card.featured {
  border-color: var(--accent);
  position: relative;
}
.pricing-badge {
  position: absolute;
  top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 20px;
}
.plan-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.plan-price { font-size: 36px; font-weight: 800; color: var(--accent); }
.plan-price span { font-size: 16px; color: var(--muted); font-weight: 400; }
.plan-features { list-style: none; margin: 20px 0; text-align: left; }
.plan-features li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.plan-features li::before { content: "✓  "; color: var(--green); font-weight: 700; }

/* ── Exchange cards ──────────────────────────────────────────── */
.exchange-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.exchange-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.exchange-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.exchange-name { font-size: 16px; font-weight: 600; }

/* ── Loader ──────────────────────────────────────────────────── */
.loader {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--muted);
  gap: 12px;
}

/* ── Pagination ──────────────────────────────────────────────── */
.pagination { display: flex; gap: 8px; margin-top: 16px; }
.page-btn {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
}
.page-btn:hover, .page-btn.active { background: var(--accent); border-color: var(--accent); color: #000; }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 20px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  transition: all .2s;
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Chart container ─────────────────────────────────────────── */
.chart-container { position: relative; height: 280px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-4, .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .features-grid, .pricing-grid { grid-template-columns: 1fr; }
  .exchange-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}
@media (max-width: 600px) {
  .nav { gap: 16px; }
  .grid-4, .hero-stats, .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
  .form-row { grid-template-columns: 1fr; }
  .auth-box { padding: 24px; }
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-input); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
