/* ============================================================
   TRADERS' BIBLE — BLOOMBERG TERMINAL DESIGN SYSTEM
   ============================================================ */

/* --- CSS VARIABLES --- */
:root {
  --bg-black: #000000;
  --bg-panel: #0a0a12;
  --bg-header: #0f0f1a;
  --bg-row-alt: #060610;
  --bg-active: #1a3a5c;
  --bg-hover: #111122;
  --border: #1a1a2e;
  --border-input: #333333;
  --text-orange: #ff8c00;
  --text-amber: #ffb347;
  --text-white: #ffffff;
  --text-gray: #a0a0a0;
  --text-dim: #666666;
  --green: #00ff41;
  --red: #ff3333;
  --blue: #4488ff;
  --font: "SF Mono", "Consolas", "Fira Code", "Courier New", monospace;
  --status-h: 32px;
  --fbar-h: 28px;
  --nav-w: 180px;
}

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-black);
  color: var(--text-orange);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--text-white); }

::selection { background: var(--bg-active); color: var(--text-white); }

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-black); }
::-webkit-scrollbar-thumb { background: #222222; }
::-webkit-scrollbar-thumb:hover { background: #444444; }

/* --- TOP STATUS BAR --- */
#status-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--status-h);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 100;
  font-size: 12px;
}
.status-left { display: flex; align-items: center; gap: 8px; }
.status-app-name { color: var(--text-white); font-weight: bold; letter-spacing: 2px; text-transform: uppercase; }
.status-version { color: var(--text-dim); font-size: 10px; }
.status-center { color: var(--text-orange); font-weight: bold; letter-spacing: 1px; }
.status-right { display: flex; align-items: center; gap: 12px; }
#utc-clock { color: var(--text-gray); font-variant-numeric: tabular-nums; }
.status-help { color: var(--text-amber); font-size: 11px; }

/* --- MAIN LAYOUT --- */
#app-container {
  position: fixed;
  top: var(--status-h);
  left: 0;
  right: 0;
  bottom: var(--fbar-h);
  display: flex;
}

/* --- LEFT NAV PANEL --- */
#nav-panel {
  width: var(--nav-w);
  min-width: var(--nav-w);
  background: var(--bg-black);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 4px 0;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--text-gray);
  text-decoration: none;
  border-left: 2px solid transparent;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-orange);
}
.nav-item.active {
  background: var(--bg-active);
  color: var(--text-orange);
  border-left-color: var(--text-orange);
}
.nav-key {
  color: var(--text-amber);
  font-size: 10px;
  min-width: 20px;
}
.nav-code {
  color: var(--text-white);
  font-weight: bold;
  min-width: 36px;
}
.nav-label {
  color: var(--text-gray);
  font-size: 11px;
}
.nav-item.active .nav-label { color: var(--text-orange); }

/* --- BOTTOM FUNCTION BAR --- */
#function-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--fbar-h);
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 4px;
  z-index: 100;
}
.fkey {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  color: var(--text-gray);
  font-size: 11px;
  text-transform: uppercase;
  text-decoration: none;
  border-right: 1px solid var(--border);
}
.fkey:last-child { border-right: none; }
.fkey:hover { color: var(--text-white); background: var(--bg-hover); }
.fkey-label {
  color: var(--text-amber);
  font-size: 10px;
  font-weight: bold;
}

/* --- MAIN PANEL --- */
#main-panel {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  background: var(--bg-black);
}

/* --- VIEWS --- */
.view { display: none; }
.view.active { display: block; }

/* --- PANEL HEADER (page title) --- */
.panel-header {
  color: var(--text-white);
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 8px 4px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* --- PANELS / CARDS --- */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.panel-title {
  background: var(--bg-header);
  color: var(--text-white);
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.panel-body {
  padding: 10px;
}

/* --- TWO-COLUMN LAYOUT --- */
.view-columns {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 8px;
}
.col-input { min-width: 0; }
.col-output { min-width: 0; }

/* --- DASHBOARD GRID --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.dash-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 12px;
  text-align: center;
}
.card-title {
  color: var(--text-gray);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.card-value {
  color: var(--text-orange);
  font-size: 22px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}
.card-sub {
  color: var(--text-dim);
  font-size: 10px;
  margin-top: 2px;
}

/* --- DATA TABLES --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.data-table th {
  background: var(--bg-header);
  color: var(--text-white);
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 8px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.data-table th:first-child { text-align: left; }
.data-table td {
  padding: 4px 8px;
  text-align: right;
  color: var(--text-orange);
  border-bottom: 1px solid #0d0d1a;
}
.data-table td:first-child { text-align: left; }
.data-table tbody tr:nth-child(even) { background: var(--bg-row-alt); }
.data-table tbody tr:hover { background: var(--bg-active); }

/* --- INPUT FORMS --- */
.input-group {
  margin-bottom: 8px;
}
.input-group label {
  display: block;
  color: var(--text-gray);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.terminal-input {
  display: flex;
  align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-input);
  padding: 0 8px;
  height: 28px;
}
.terminal-input:focus-within {
  border-color: var(--text-orange);
}
.prompt {
  color: var(--text-amber);
  margin-right: 6px;
  font-weight: bold;
}
.terminal-input input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-orange);
  font-family: var(--font);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  caret-color: var(--text-orange);
}
.terminal-input input::placeholder {
  color: var(--text-dim);
}

select {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-input);
  color: var(--text-orange);
  font-family: var(--font);
  font-size: 12px;
  padding: 5px 8px;
  height: 28px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
select:focus { border-color: var(--text-orange); }
select option { background: var(--bg-panel); color: var(--text-orange); }

/* --- BUTTONS --- */
.btn {
  display: inline-block;
  background: var(--bg-header);
  color: var(--text-orange);
  border: 1px solid var(--text-orange);
  padding: 5px 14px;
  font-family: var(--font);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  font-weight: bold;
}
.btn:hover {
  background: var(--text-orange);
  color: var(--bg-black);
}
.btn-primary {
  width: 100%;
  margin-top: 8px;
  padding: 7px 14px;
}
.btn-danger {
  border-color: var(--red);
  color: var(--red);
}
.btn-danger:hover {
  background: var(--red);
  color: var(--bg-black);
}
.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.input-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

/* --- SUMMARY GRID --- */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}
.summary-item {
  background: var(--bg-panel);
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.summary-label {
  color: var(--text-gray);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.summary-value {
  color: var(--text-orange);
  font-size: 14px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

/* --- VALUE COLORS --- */
.val-profit, .val-green { color: var(--green) !important; }
.val-loss, .val-red { color: var(--red) !important; }
.val-amber { color: var(--text-amber) !important; }
.val-blue { color: var(--blue) !important; }
.val-white { color: var(--text-white) !important; }
.val-neutral { color: var(--text-orange) !important; }

/* --- CHART CONTAINER --- */
.chart-container {
  padding: 8px;
}
.chart-container canvas {
  width: 100%;
  height: 250px;
  display: block;
}

/* --- EDUCATION HUB --- */
.edu-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.edu-tab {
  font-size: 11px;
  padding: 4px 12px;
}
.edu-tab.active {
  background: var(--text-orange);
  color: var(--bg-black);
}
.edu-content {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 12px;
  min-height: 400px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}
.edu-section {
  margin-bottom: 16px;
}
.edu-section-title {
  color: var(--text-white);
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.edu-concept {
  margin-bottom: 12px;
  padding: 8px;
  border-left: 2px solid var(--text-orange);
}
.edu-concept-name {
  color: var(--text-orange);
  font-weight: bold;
  font-size: 12px;
  margin-bottom: 4px;
}
.edu-concept-body {
  color: var(--text-gray);
  font-size: 12px;
  line-height: 1.5;
}
.edu-formula {
  display: block;
  background: var(--bg-header);
  color: var(--green);
  padding: 6px 10px;
  margin: 6px 0;
  border: 1px solid var(--border);
  font-size: 12px;
}
.edu-note {
  color: var(--text-amber);
  font-size: 11px;
  font-style: italic;
  margin-top: 4px;
}
.edu-link {
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
}

/* --- STATUS MESSAGES --- */
.status-msg {
  margin-top: 8px;
  font-size: 11px;
  min-height: 16px;
}
.status-ok { color: var(--green); }
.status-err { color: var(--red); }

/* --- BLINKING CURSOR --- */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.terminal-input input:focus {
  animation: none; /* browser native caret */
}

/* --- DATA FLASH --- */
@keyframes data-flash {
  0% { color: var(--text-white); }
  100% { color: var(--text-orange); }
}
.flash {
  animation: data-flash 200ms ease-out;
}

/* --- LOADING --- */
.loading::after {
  content: "LOADING...";
  color: var(--text-amber);
  animation: blink 1s step-end infinite;
}

/* --- FREE ROLL ENTRY ROW --- */
.fr-entry-row {
  display: grid;
  grid-template-columns: 1fr 1fr 30px;
  gap: 4px;
  margin-bottom: 4px;
  align-items: end;
}
.fr-entry-row .terminal-input { height: 26px; }
.fr-remove-btn {
  background: none;
  border: 1px solid var(--red);
  color: var(--red);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  height: 26px;
  width: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fr-remove-btn:hover { background: var(--red); color: var(--bg-black); }

/* --- TRADE HISTORY TAGS --- */
.trade-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.trade-tag {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
}
.trade-tag.win { border-color: var(--green); color: var(--green); }
.trade-tag.loss { border-color: var(--red); color: var(--red); }
.trade-tag-remove {
  cursor: pointer;
  color: var(--text-dim);
  font-size: 10px;
}
.trade-tag-remove:hover { color: var(--text-white); }

/* ===================================
   GMX CONNECT BAR
   =================================== */
#gmx-connect-bar {
  position: fixed;
  top: 32px;
  left: 0;
  right: 0;
  height: 32px;
  background: #0d0d1a;
  border-bottom: 1px solid #2a2a4e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 100;
  font-size: 12px;
}

.gmx-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.gmx-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gmx-label {
  color: var(--text-white);
  font-weight: bold;
  font-size: 11px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.gmx-prompt {
  color: var(--text-amber);
  font-weight: bold;
}

#gmx-wallet-input {
  background: transparent;
  border: 1px solid var(--border-input);
  color: var(--text-orange);
  font-family: var(--font);
  font-size: 12px;
  padding: 2px 8px;
  height: 24px;
  width: 320px;
  outline: none;
  caret-color: var(--text-orange);
}
#gmx-wallet-input:focus {
  border-color: var(--text-orange);
}
#gmx-wallet-input::placeholder {
  color: var(--text-dim);
  font-size: 11px;
}
#gmx-wallet-input.gmx-connected {
  color: var(--green);
  border-color: var(--border);
}

.gmx-connect-btn {
  padding: 2px 10px !important;
  font-size: 10px !important;
  height: 24px;
  letter-spacing: 0.5px;
}

.gmx-or-separator {
  color: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  user-select: none;
}

.gmx-chain {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.5px;
}

/* Status indicator dots */
.gmx-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  display: inline-block;
}
.gmx-status-indicator.gmx-live {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: gmx-pulse 2s ease-in-out infinite;
}
.gmx-status-indicator.gmx-connecting {
  background: var(--text-amber);
  animation: gmx-pulse 0.8s ease-in-out infinite;
}
.gmx-status-indicator.gmx-error {
  background: var(--red);
}

@keyframes gmx-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.gmx-status-text {
  color: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.gmx-status-text.gmx-text-live {
  color: var(--green);
}
.gmx-status-text.gmx-text-connecting {
  color: var(--text-amber);
}
.gmx-status-text.gmx-text-error {
  color: var(--red);
}

.gmx-position-count {
  color: var(--text-orange);
  font-size: 11px;
  font-weight: bold;
}

.gmx-disconnect-btn {
  background: none;
  border: 1px solid var(--red);
  color: var(--red);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.gmx-disconnect-btn:hover {
  background: var(--red);
  color: var(--bg-black);
}

/* GMX Live Badge */
.gmx-live-badge {
  float: right;
  color: var(--green);
  font-size: 10px;
  font-weight: bold;
  animation: gmx-pulse 2s ease-in-out infinite;
}

/* GMX Load from GMX button */
.gmx-load-btn {
  background: var(--bg-header) !important;
  color: var(--green) !important;
  border-color: var(--green) !important;
}
.gmx-load-btn:hover {
  background: var(--green) !important;
  color: var(--bg-black) !important;
}

/* GMX source tag on entries */
.gmx-tag {
  display: inline-block;
  background: var(--bg-header);
  color: var(--green);
  font-size: 9px;
  padding: 1px 4px;
  border: 1px solid var(--green);
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

/* Adjust main layout to account for GMX bar */
#app-container {
  top: 64px !important;
}

/* ===================================
   GMX POSITION SELECTOR (per-tool)
   =================================== */
.gmx-position-selector {
  background: #0d0d1a;
  border: 1px solid var(--text-amber);
  padding: 6px 10px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gmx-selector-label {
  color: var(--text-amber);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  white-space: nowrap;
  text-transform: uppercase;
}
.gmx-position-selector select {
  flex: 1;
  background: var(--bg-panel);
  border: 1px solid var(--text-amber);
  color: var(--green);
  font-family: var(--font);
  font-size: 12px;
  padding: 3px 8px;
  height: 26px;
}
.gmx-position-selector select:focus {
  border-color: var(--green);
}
.gmx-position-selector select option {
  background: var(--bg-panel);
  color: var(--text-orange);
}

/* ===================================
   RESPONSIVE
   =================================== */

/* TABLET */
@media (max-width: 1023px) {
  :root { --nav-w: 52px; }
  .nav-label { display: none; }
  .nav-code { font-size: 10px; min-width: 0; }
  .nav-key { display: none; }
  .nav-item { padding: 8px 6px; justify-content: center; }
  .view-columns { grid-template-columns: 280px 1fr; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  #gmx-wallet-input { width: 220px; }
  .gmx-chain { display: none; }
}

/* MOBILE */
@media (max-width: 767px) {
  :root { --nav-w: 0px; --fbar-h: 48px; }
  #nav-panel { display: none; }
  .view-columns { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid { grid-template-columns: 1fr; }

  #function-bar {
    height: var(--fbar-h);
    flex-wrap: wrap;
    overflow-x: auto;
    padding: 2px;
    justify-content: center;
  }
  .fkey {
    flex-direction: column;
    padding: 2px 8px;
    font-size: 9px;
    border-right: none;
    border: 1px solid var(--border);
  }

  .status-help { display: none; }
  .status-version { display: none; }

  .panel-header { font-size: 12px; letter-spacing: 1px; }

  #gmx-connect-bar {
    height: auto;
    flex-direction: column;
    padding: 4px 8px;
    gap: 4px;
  }
  .gmx-bar-left { width: 100%; flex-wrap: wrap; }
  .gmx-bar-right { width: 100%; justify-content: flex-start; }
  #gmx-wallet-input { width: 100%; flex: 1; min-width: 0; }
  .gmx-label { font-size: 10px; }
  .gmx-or-separator { font-size: 9px; }
  #app-container { top: calc(var(--status-h) + 56px); }

  .bot-layout { flex-direction: column; }
  .bot-cards-panel { width: 100%; max-width: 100%; flex-direction: row; flex-wrap: wrap; }
  .bot-card { min-width: calc(50% - 4px); }
  .bot-detail-panel { width: 100%; }
}

/* ============================================================
   STRATEGY BOTS — F9 STYLES
   ============================================================ */

/* Wallet address display */
.wallet-address {
  color: var(--text-amber);
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 0 8px;
}

/* Nav divider */
.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 12px;
}

/* Emergency bar */
.bot-emergency-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: rgba(255, 51, 51, 0.1);
  border: 1px solid var(--red);
  border-radius: 2px;
  margin-bottom: 8px;
}
.emergency-label {
  color: var(--red);
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 1px;
}
.emergency-count {
  color: var(--text-amber);
  font-size: 12px;
}
.emergency-stop-btn {
  margin-left: auto;
  background: var(--red) !important;
  color: #000 !important;
  font-weight: bold;
  border: none !important;
  padding: 4px 16px;
  cursor: pointer;
}

/* Wallet warning */
.bot-wallet-warning {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 140, 0, 0.08);
  border: 1px solid var(--text-orange);
  border-radius: 2px;
  margin-bottom: 12px;
}
.warning-icon {
  font-size: 24px;
  color: var(--text-orange);
}
.warning-text {
  color: var(--text-gray);
  font-size: 12px;
  line-height: 1.5;
}
.warning-text strong {
  color: var(--text-orange);
}

/* Bot layout */
.bot-layout {
  display: flex;
  gap: 8px;
  height: 100%;
  overflow: hidden;
}

/* Strategy cards panel */
.bot-cards-panel {
  width: 260px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding-right: 4px;
}
.bot-cards-panel .panel-title {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-bottom: 4px;
  padding: 4px 8px;
}

/* Strategy card */
.bot-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.bot-card:hover {
  border-color: var(--text-dim);
  background: var(--bg-hover);
}
.bot-card-selected {
  border-color: var(--text-orange) !important;
  background: rgba(255, 140, 0, 0.05) !important;
}

.bot-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.bot-card-name {
  color: var(--text-white);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.5px;
  flex: 1;
}
.bot-card-category {
  color: var(--text-dim);
  font-size: 9px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.bot-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
  font-size: 10px;
  color: var(--text-dim);
}
.bot-card-stats em {
  font-style: normal;
  color: var(--text-gray);
}

/* Bot status dots */
.bot-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  background: #333;
}
.bot-idle { background: #444; }
.bot-monitoring {
  background: var(--blue);
  box-shadow: 0 0 6px var(--blue);
  animation: botPulse 2s ease-in-out infinite;
}
.bot-executing {
  background: var(--text-orange);
  box-shadow: 0 0 8px var(--text-orange);
  animation: botPulse 0.5s ease-in-out infinite;
}
.bot-paused {
  background: var(--text-amber);
}
.bot-error {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}
.bot-cooldown {
  background: #666;
  animation: botPulse 1s ease-in-out infinite;
}

@keyframes botPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Detail panel */
.bot-detail-panel {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}

.bot-detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-dim);
}
.placeholder-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.3;
}
.placeholder-text {
  font-size: 12px;
  letter-spacing: 1px;
}

.bot-detail-description {
  color: var(--text-gray);
  font-size: 11px;
  line-height: 1.6;
  padding: 4px 0;
}

/* Bot controls */
.bot-controls {
  display: flex;
  gap: 8px;
  padding: 4px 0;
}
.btn-bot-start {
  background: var(--green) !important;
  color: #000 !important;
  font-weight: bold;
  border: none !important;
}
.btn-bot-start:hover { opacity: 0.85; }
.btn-bot-pause {
  background: var(--text-amber) !important;
  color: #000 !important;
  font-weight: bold;
  border: none !important;
}
.btn-bot-pause:hover { opacity: 0.85; }
.btn-bot-stop {
  background: var(--red) !important;
  color: #000 !important;
  font-weight: bold;
  border: none !important;
}
.btn-bot-stop:hover { opacity: 0.85; }

/* Execution log */
.bot-exec-log {
  background: #000;
  border: 1px solid var(--border);
  padding: 8px;
  max-height: 300px;
  overflow-y: auto;
  font-family: var(--font);
  font-size: 11px;
  line-height: 1.5;
}
.log-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-info { color: var(--text-gray); }
.log-signal { color: var(--text-orange); }
.log-success { color: var(--green); }
.log-warn { color: var(--text-amber); }
.log-error { color: var(--red); }
.log-dim { color: var(--text-dim); }

/* ===================================
   TESTNET BANNER & NETWORK SWITCHER
   =================================== */

/* Testnet warning banner — amber bar fixed below status bar, above wallet bar */
.testnet-banner {
  position: fixed;
  top: 32px;  /* below status bar */
  left: 0;
  right: 0;
  height: 28px;
  background: linear-gradient(90deg, #6b4c00, #8b6914, #6b4c00);
  border-bottom: 1px solid #c99a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 1px;
  color: #ffd700;
  z-index: 1001;
  font-weight: bold;
}
.testnet-banner-icon {
  font-size: 13px;
}
.testnet-banner-text {
  color: #ffe066;
}
.testnet-banner-faucet {
  font-size: 10px;
  font-weight: normal;
  color: #c99a2e;
  letter-spacing: 0;
}
.testnet-banner-faucet a {
  color: #ffd700;
  text-decoration: underline;
}
.testnet-banner-faucet a:hover {
  color: #fff;
}

/* Shift wallet bar and content when testnet banner is visible */
body.testnet-active #gmx-connect-bar {
  top: 60px;  /* 32px status + 28px testnet banner */
}
body.testnet-active #app-container {
  top: calc(var(--status-h) + var(--gmx-bar-h) + 28px);
}

/* Network switcher inline buttons */
.network-switcher {
  display: flex;
  gap: 2px;
  margin-right: 8px;
}
.net-switch-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 9px;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.net-switch-btn:hover {
  color: var(--text-gray);
  border-color: var(--text-gray);
}
.net-switch-btn.active {
  background: var(--green);
  color: #000;
  border-color: var(--green);
  font-weight: bold;
}
.net-switch-btn[data-chain-id="421614"].active {
  background: #c99a2e;
  border-color: #c99a2e;
  color: #000;
}

/* Chain badge testnet variant */
.gmx-chain.testnet {
  color: #ffd700;
  font-weight: bold;
  text-shadow: 0 0 4px rgba(255, 215, 0, 0.3);
}
