
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: #0a0a0a;
  color: #33ff33;
  font-family: "Courier New", Courier, monospace;
  min-height: 100vh;
}

/* ===== NAVIGATION BAR ===== */
.nav-bar {
  background: #0d0d0d;
  border-bottom: 2px solid #33ff33;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
}
.nav-btn {
  flex: 1;
  padding: 14px 10px;
  background: #111;
  border: none;
  border-right: 1px solid #33ff33;
  color: #33ff33;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
  white-space: nowrap;
}
.nav-btn:last-child { border-right: none; }
.nav-btn:hover { background: #1a1a1a; }
.nav-btn.active {
  background: #1a3a1a;
  font-weight: bold;
  text-decoration: underline;
}
.nav-status {
  display: block;
  font-size: 11px;
  margin-top: 2px;
}
.nav-status.on { color: #33ff33; }
.nav-status.off { color: #ff3333; }

/* ===== PAGE CONTAINER ===== */
.page {
  display: none;
  padding: 10px 15px;
  max-width: 1400px;
  margin: 0 auto;
}
.page.active { display: block; }

/* ===== TERMINAL FRAME ===== */
.terminal-frame {
  border: 2px solid #33ff33;
  padding: 15px 12px 12px;
  position: relative;
  margin-top: 12px; /* space for the top label */
}
.terminal-frame::before {
  content: attr(data-title);
  position: absolute;
  top: -11px;
  left: 20px;
  background: #0a0a0a;
  padding: 0 6px;
  font-size: 12px;
  white-space: nowrap;
  color: #33ff33;
  font-weight: bold;
}

/* ===== CONTROLS ===== */
.control-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #33ff33;
  margin-bottom: 10px;
  background: #0d0d0d;
  font-size: 11px;
}
.status-badge {
  padding: 4px 12px;
  font-weight: bold;
  font-size: 11px;
  white-space: nowrap;
}
.badge-connected { background: #1a3a1a; color: #33ff33; border: 1px solid #33ff33; }
.badge-disconnected { background: #3a1a1a; color: #ff3333; border: 1px solid #ff3333; }
.badge-connecting { background: #3a3a1a; color: #ffff33; border: 1px solid #ffff33; }

button, input, select, textarea {
  background: #111;
  border: 1px solid #33ff33;
  color: #33ff33;
  font-family: inherit;
  padding: 4px 8px;
  font-size: 11px;
  margin: 0;
  vertical-align: middle;
}
/* ===== CUSTOM DATE PICKER ===== */
.date-picker-wrap { display: inline-flex; align-items: center; gap: 0; }
.date-picker-wrap input { width: 95px; cursor: default; }
.cal-open-btn { padding: 4px 6px; margin: 0 0 0 2px; font-size: 11px; cursor: pointer; border-left: none; }
.cal-popup {
  display: none;
  position: fixed;
  z-index: 9999;
  background: #0a0a0a;
  border: 2px solid #33ff33;
  padding: 8px;
  min-width: 210px;
  box-shadow: 0 0 16px #33ff3333;
  font-size: 11px;
}
.cal-popup.open { display: block; }
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cal-header button { padding: 2px 7px; margin: 0; font-size: 12px; font-weight: bold; }
.cal-month-label { font-weight: bold; letter-spacing: 0.05em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-day-hdr { font-size: 9px; color: #999; padding: 2px 0; }
.cal-day {
  padding: 4px 2px;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 10px;
}
.cal-day:hover { border-color: #33ff33; background: #1a3a1a; }
.cal-day.empty { cursor: default; }
.cal-day.empty:hover { border-color: transparent; background: transparent; }
.cal-day.today { color: #ffff33; font-weight: bold; }
.cal-day.selected { background: #33ff33; color: #000; font-weight: bold; border-color: #33ff33; }
button { cursor: pointer; white-space: nowrap; }
button:hover:not(:disabled) { background: #33ff33; color: #000; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.loading { animation: pulse 0.8s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
input:focus, select:focus, textarea:focus { outline: none; border-color: #66ff66; }

/* ===== SECTIONS ===== */
.section { margin: 8px 0; }
.section-header {
  border: 1px solid #33ff33;
  padding: 5px 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #111;
  user-select: none;
  font-size: 11px;
}
.section-header:hover { background: #1a1a1a; }
.toggle-icon { font-size: 14px; transition: transform 0.2s; }
.section-header.collapsed .toggle-icon { transform: rotate(-90deg); }
.section-body {
  border: 1px solid #33ff33;
  border-top: none;
  padding: 8px;
}
.section-body.hidden { display: none; }

/* ===== GRID LAYOUTS ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.panel {
  border: 1px solid #33ff33;
  padding: 6px;
  min-height: 120px;
  overflow: hidden;
}
.panel-title {
  text-align: center;
  font-weight: bold;
  border-bottom: 1px dashed #33ff33;
  padding-bottom: 3px;
  margin-bottom: 5px;
  font-size: 11px;
}

/* ===== BALANCE ===== */
.balance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px; }
.balance-card {
  border: 1px dashed #33ff33;
  padding: 8px;
  text-align: center;
}
.bal-label { font-size: 9px; color: #999; }
.bal-value { font-size: 16px; font-weight: bold; margin-top: 3px; }
.positive { color: #33ff33; }
.negative { color: #ff3333; }

/* ===== FORM ===== */
.form-grid { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.form-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.form-row label { font-size: 10px; min-width: 80px; }

/* ===== TABLE ===== */
.table-wrap { max-height: 350px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 10px; }
table th, table td { border: 1px solid #33ff33; padding: 5px 8px; text-align: center; white-space: nowrap; }
table th { background: #1a1a1a; position: sticky; top: 0; z-index: 1; letter-spacing: 0.03em; }
.action-btns button { font-size: 9px; padding: 2px 4px; min-width: 28px; margin: 1px; }

/* ===== ALERT CONSOLE ===== */
.alert-console {
  width: 100%;
  height: 100px;
  background: #000;
  border: 1px solid #33ff33;
  color: #33ff33;
  font-family: inherit;
  font-size: 10px;
  padding: 4px;
  resize: vertical;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===== API RESPONSE ===== */
.response-box {
  background: #000;
  border: 1px dashed #33ff33;
  padding: 6px;
  font-size: 9px;
  max-height: 80px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #33ff33; }

/* ===== CONSOLE PAGE ===== */
.console-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #33ff33;
  margin-bottom: 10px;
  background: #0d0d0d;
  font-size: 12px;
}
.console-toolbar input { width: 200px; }
.console-section { margin-bottom: 14px; }
.console-section-title {
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.08em;
  border-bottom: 1px dashed #33ff33;
  padding-bottom: 4px;
  margin-bottom: 6px;
}
.signal-true  { color: #33ff33; font-weight: bold; }
.signal-false { color: #555; }
.val-bullish  { color: #33ff33; font-weight: bold; }
.val-bearish  { color: #ff3333; font-weight: bold; }
.val-neutral  { color: #ffff33; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .nav-btn { font-size: 12px; padding: 10px 5px; }
}
