/* CapitalBot — Dark Trading Dashboard */

:root {
  --bg-card: #1a1d21;
  --bg-dark: #12141a;
  --border: rgba(255,255,255,0.07);
}

body {
  background-color: #0f1117;
  color: #e2e8f0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Cards ─────────────────────────────────────────── */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border) !important;
  border-radius: 10px;
}

.card-title {
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ── Stat Cards ─────────────────────────────────────── */
.stat-card .card-body {
  padding: 1rem 1.25rem;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
}

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
  background-color: #0d0f14 !important;
  border-bottom: 1px solid var(--border) !important;
}

.navbar-brand {
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.nav-link {
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem !important;
  border-radius: 6px;
  transition: background 0.15s;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255,193,7,0.12);
  color: #ffc107 !important;
}

/* ── Tables ─────────────────────────────────────────── */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: #e2e8f0;
  --bs-table-hover-bg: rgba(255,255,255,0.04);
  font-size: 0.82rem;
}

.table thead th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  border-bottom: 1px solid var(--border);
  background: #111318;
  font-weight: 600;
}

.table td, .table th {
  border-color: var(--border);
  vertical-align: middle;
}

.table-dark {
  --bs-table-bg: #111318;
}

/* ── Badges ─────────────────────────────────────────── */
.badge {
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn-warning {
  color: #000;
}

.btn-sm {
  font-size: 0.75rem;
}

/* ── Forms ─────────────────────────────────────────── */
.form-control, .form-select {
  background-color: #1e2028;
  border-color: rgba(255,255,255,0.1);
  color: #e2e8f0;
  font-size: 0.85rem;
}

.form-control:focus, .form-select:focus {
  background-color: #1e2028;
  border-color: #ffc107;
  color: #e2e8f0;
  box-shadow: 0 0 0 0.2rem rgba(255,193,7,0.15);
}

.form-label {
  color: #9ca3af;
  font-weight: 500;
}

.form-text {
  color: #6b7280;
  font-size: 0.72rem;
}

.input-group-text {
  background-color: #16181f;
  border-color: rgba(255,255,255,0.1);
  color: #9ca3af;
}

/* ── Alerts ─────────────────────────────────────────── */
.alert {
  font-size: 0.85rem;
  border-radius: 8px;
}

/* ── Calendar cards ─────────────────────────────────── */
.border-start.border-danger.border-3 {
  border-left-width: 3px !important;
}

/* ── Progress bars ──────────────────────────────────── */
.progress {
  background-color: rgba(255,255,255,0.08);
  border-radius: 99px;
}

/* ── Login page ─────────────────────────────────────── */
body.d-flex .card {
  border: 1px solid rgba(255,193,7,0.2) !important;
}

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0f1117; }
::-webkit-scrollbar-thumb { background: #2d3148; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3d4160; }

/* ── Refresh button spin ────────────────────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.spin {
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

/* ── Responsive tweaks ──────────────────────────────── */
@media (max-width: 768px) {
  .stat-value { font-size: 1.4rem; }
  .container-fluid { padding: 0.5rem; }
}

/* ── Viewer additions ───────────────────────────────── */
.idle-badge { font-size: .72rem; color: #9ca3af; border: 1px solid var(--border); border-radius: 99px; padding: .15rem .55rem; white-space: nowrap; }
.idle-badge.warn { color: #ffc107; border-color: rgba(255,193,7,.5); }
#idleBanner { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 2000; max-width: 94vw; display: none; }
.rank-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.rank-bar > span { display: block; height: 100%; }
.table-responsive { -webkit-overflow-scrolling: touch; }
.stale-note { font-size: .72rem; }
@media (max-width: 768px) {
  .navbar .btn { min-height: 38px; }
  .table { font-size: .76rem; }
}

/* ── Screener pieces ────────────────────────────────── */
.sbar { position: relative; display: inline-block; width: 90px; height: 8px; border-radius: 5px; background: rgba(255,255,255,.1); vertical-align: middle; margin-right: 6px; overflow: hidden; }
.sbar .mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: #9ca3af; opacity: .6; }
.sbar b { position: absolute; top: 0; bottom: 0; }
.sbar b.g { background: #198754; } .sbar b.r { background: #dc3545; }
.periods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0 8px; }
.periods div { background: rgba(255,255,255,.05); border-radius: 8px; padding: 5px 2px; text-align: center; font-size: .8rem; font-weight: 650; }
.periods small { display: block; color: #9ca3af; font-size: .58rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.pair-list li { margin: 3px 0; font-size: .82rem; }
.help-col { position: sticky; top: 12px; }
@media (max-width: 991px) { .help-col { position: static; } }
