/* Range Bot admin panel */
:root {
  --rb-sidebar-w: 240px;
  --rb-sidebar-bg: #0f172a;
  --rb-sidebar-fg: #cbd5e1;
  --rb-sidebar-active: #1e293b;
  --rb-accent: #f0b90b;           /* Binance yellow */
  --rb-profit: #059669;
  --rb-loss: #dc2626;
  --rb-bg: #f5f7fb;
  --rb-card-border: #e5e7eb;
}
[data-bs-theme="dark"] {
  --rb-bg: #0b1120;
  --rb-card-border: #1f2937;
  --rb-profit: #34d399;
  --rb-loss: #f87171;
}

body { background: var(--rb-bg); font-size: .925rem; }
.text-profit { color: var(--rb-profit) !important; }
.text-loss { color: var(--rb-loss) !important; }
.mono, .table td.num, .table th.num { font-variant-numeric: tabular-nums; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }

/* ---------- shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--rb-sidebar-w); background: var(--rb-sidebar-bg); color: var(--rb-sidebar-fg);
  flex-shrink: 0; display: flex; flex-direction: column;
}
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 0; height: 100vh; }
  .env-live .sidebar { top: 32px; height: calc(100vh - 32px); }
}
.sidebar.offcanvas-lg { --bs-offcanvas-width: var(--rb-sidebar-w); --bs-offcanvas-bg: var(--rb-sidebar-bg); }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1rem 1rem .75rem; color: #fff; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--rb-accent); color: #111; font-size: 1.2rem;
}
.sidebar-scroll { overflow-y: auto; padding: 0 .5rem 1rem; flex: 1; }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .5; padding: 1rem .75rem .35rem; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: .6rem; color: var(--rb-sidebar-fg);
  padding: .45rem .75rem; border-radius: 8px; font-size: .9rem;
}
.sidebar .nav-link:hover { background: var(--rb-sidebar-active); color: #fff; }
.sidebar .nav-link.active { background: var(--rb-sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--rb-accent); }
.sidebar .nav-link i { font-size: 1rem; width: 1.1rem; text-align: center; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: .75rem; padding: .75rem 1.25rem;
  background: var(--bs-body-bg); border-bottom: 1px solid var(--rb-card-border);
  position: sticky; top: 0; z-index: 1020;
}
.env-live .topbar { top: 32px; }
.content { padding: 1.25rem; }
@media (max-width: 575.98px) { .content, .topbar { padding-left: 1rem; padding-right: 1rem; } }

.live-stripe {
  position: sticky; top: 0; z-index: 1030; height: 32px; line-height: 32px; text-align: center;
  background: repeating-linear-gradient(45deg, #b91c1c, #b91c1c 12px, #991b1b 12px, #991b1b 24px);
  color: #fff; font-weight: 700; font-size: .8rem; letter-spacing: .08em;
}

/* ---------- cards & stats ---------- */
.card { border-color: var(--rb-card-border); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.card-header { background: transparent; font-weight: 600; border-bottom-color: var(--rb-card-border); }
.card-header .bi { opacity: .7; margin-right: .25rem; }
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color); }
.stat-value { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-sub { font-size: .8rem; color: var(--bs-secondary-color); }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.dot-up { background: var(--rb-profit); }
.dot-down { background: var(--rb-loss); }
.dot-unknown { background: #9ca3af; }
.why-idle { border-left: 4px solid var(--rb-accent); }
.chart-box { position: relative; height: 260px; }
.table-sm td, .table-sm th { padding: .4rem .5rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color); font-weight: 600; white-space: nowrap; }
.table-responsive { border-radius: .5rem; }

/* heatmap */
.heatmap { border-collapse: separate; border-spacing: 2px; font-size: .7rem; }
.heatmap td { width: 28px; height: 22px; text-align: center; border-radius: 3px; }
.heatmap th { font-weight: 500; color: var(--bs-secondary-color); padding: 0 4px; }

/* ---------- auth ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(circle at 20% 20%, rgba(240,185,11,.12), transparent 40%), var(--rb-bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--bs-body-bg); border: 1px solid var(--rb-card-border);
  border-radius: 16px; padding: 2rem; box-shadow: 0 10px 30px rgba(15,23,42,.08); }
.otp-input { letter-spacing: .4em; font-variant-numeric: tabular-nums; max-width: 12rem; }
.auth-card .otp-input { max-width: none; }
.qr-box { background: #fff; padding: 8px; border-radius: 8px; line-height: 0; }
.qr-box svg { width: 180px; height: 180px; }

/* choice cards on control page */
.choice-card { border: 2px solid var(--rb-card-border); border-radius: 12px; padding: 1rem; height: 100%; }
.choice-card.selected { border-color: var(--bs-primary); background: var(--bs-primary-bg-subtle); }
.choice-card.selected.live { border-color: #dc2626; background: rgba(220,38,38,.07); }
