/* ==========================================================================
   CrTrade Web — Pitch-Black (#000000) Neon Algo Terminal Stylesheet
   ========================================================================== */

:root {
  --bg-pitch: #000000;
  --bg-panel: #050507;
  --bg-card: #08080c;
  --bg-header: #0d0d11;
  --bg-hover: #121218;
  --border-subtle: #1e1e26;
  --border-strong: #2b2b36;

  --text-main: #ffffff;
  --text-muted: #a6aab8;
  --text-dim: #707585;

  --neon-emerald: #00ff9d;
  --neon-cyan: #00e5ff;
  --neon-gold: #ffd600;
  --neon-crimson: #ff2a6d;
  --neon-violet: #c77dff;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-pitch);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

.terminal-shell {
  max-width: 1760px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 36px max(18px, env(safe-area-inset-left));
}

/* Utilities */
.text-emerald { color: var(--neon-emerald) !important; }
.text-cyan { color: var(--neon-cyan) !important; }
.text-gold { color: var(--neon-gold) !important; }
.text-crimson { color: var(--neon-crimson) !important; }
.text-violet { color: var(--neon-violet) !important; }
.text-muted { color: var(--text-muted) !important; }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }

/* Header */
.terminal-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  margin-bottom: 12px;
}

.brand-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  font-size: 20px;
}

.brand-title {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: var(--neon-gold);
  letter-spacing: 0.5px;
}

.brand-subtitle {
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Pills & Badges */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.pill-emerald {
  background: var(--neon-emerald);
  color: #000000;
}

.pill-outline-cyan {
  background: #0e0e14;
  color: var(--neon-cyan);
  border: 1px solid var(--border-strong);
}

.status-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 6px;
  background: #050507;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.status-ok { color: var(--neon-emerald); }
.status-warn { color: var(--neon-gold); }
.status-err { color: var(--neon-crimson); }

/* Buttons */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  background: #101018;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-violet-outline {
  background: rgba(199, 125, 255, 0.14);
  border-color: var(--neon-violet);
  color: var(--neon-violet);
}
.btn-violet-outline:hover { background: rgba(199, 125, 255, 0.25); }

.btn:hover { background: #1a1a26; border-color: #46465a; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-xs { padding: 4px 8px; font-size: 11px; }

.btn-emerald {
  background: rgba(0, 255, 157, 0.14);
  border-color: var(--neon-emerald);
  color: var(--neon-emerald);
}
.btn-emerald:hover { background: rgba(0, 255, 157, 0.24); }

.btn-cyan {
  background: rgba(0, 229, 255, 0.14);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}
.btn-cyan:hover { background: rgba(0, 229, 255, 0.24); }

.btn-gold {
  background: rgba(255, 214, 0, 0.14);
  border-color: var(--neon-gold);
  color: var(--neon-gold);
}
.btn-gold:hover { background: rgba(255, 214, 0, 0.24); }

.btn-crimson {
  background: rgba(255, 42, 109, 0.16);
  border-color: var(--neon-crimson);
  color: var(--neon-crimson);
}
.btn-crimson:hover { background: rgba(255, 42, 109, 0.28); }

.btn-ghost {
  background: #0b0b10;
  color: #e4e7f0;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.nav-tab {
  background: var(--bg-panel);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-tab:hover {
  color: #ffffff;
  border-color: var(--border-strong);
}

.nav-tab.active {
  background: #10141c;
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
}

.tab-count {
  background: #1a1d26;
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-family: var(--font-mono);
}

.nav-spacer { flex: 1; }

.cooldown-banner {
  background: rgba(255, 42, 109, 0.14);
  border: 1px solid var(--neon-crimson);
  color: var(--neon-crimson);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 12px 14px;
}

.kpi-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.45px;
}

.kpi-value {
  margin-top: 5px;
  font-size: 18px;
  font-weight: 900;
  font-family: var(--font-mono);
}

.kpi-sub {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-unit {
  font-size: 11px;
  font-weight: 700;
}

/* Views & Panels */
.view-section { display: none; }
.view-section.active { display: block; }

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-strong);
}

.panel-title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.35px;
}

.panel-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.slots-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.slots-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--neon-cyan);
  white-space: nowrap;
}

.slots-input {
  width: 64px !important;
  min-height: 28px !important;
  padding: 3px 7px !important;
  font-family: var(--font-mono);
  font-weight: 800;
  text-align: center;
}

/* Telegram VIP Section Summary Strip */
.vip-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: #040407;
}

.vip-mini-kpi {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 10px 12px;
}

.vip-mini-val {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 900;
  font-family: var(--font-mono);
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 12px;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.data-table.compact {
  font-size: 11.2px;
}

.data-table thead th {
  background: #0a0a0e;
  color: var(--neon-cyan);
  font-weight: 800;
  font-size: 10.5px;
  letter-spacing: 0.4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.data-table thead tr.th-violet th {
  color: var(--neon-violet);
}

.data-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tbody tr:hover td {
  background: var(--bg-hover);
}

.empty-row {
  text-align: center !important;
  color: var(--text-dim);
  padding: 18px !important;
  white-space: normal !important;
}

/* Inline Badges */
.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 10.5px;
}

.badge-long {
  background: rgba(0, 255, 157, 0.16);
  color: var(--neon-emerald);
  border: 1px solid var(--neon-emerald);
}

.badge-short {
  background: rgba(255, 42, 109, 0.18);
  color: var(--neon-crimson);
  border: 1px solid var(--neon-crimson);
}

.badge-wait {
  background: #121218;
  color: var(--text-muted);
  border: 1px solid #30303c;
}

.badge-mtc {
  background: rgba(0, 229, 255, 0.18);
  color: var(--neon-cyan);
}

.badge-rfd {
  background: rgba(255, 214, 0, 0.2);
  color: var(--neon-gold);
}

.badge-swing {
  background: rgba(199, 125, 255, 0.22);
  color: var(--neon-violet);
  border: 1px solid var(--neon-violet);
}

/* Quick 3-Engine Toggle Strip (v3.8.0) */
.engine-mode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
}

.engine-mode-label {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  margin-right: 4px;
}

.engine-toggle-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  background: #0c0c12;
  color: var(--text-dim);
  border: 1px solid #2b2b36;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.engine-toggle-pill.active-mtc {
  background: rgba(0, 229, 255, 0.15);
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
}

.engine-toggle-pill.active-rfd {
  background: rgba(255, 214, 0, 0.16);
  color: var(--neon-gold);
  border-color: var(--neon-gold);
}

.engine-toggle-pill.active-swing {
  background: rgba(199, 125, 255, 0.2);
  color: var(--neon-violet);
  border-color: var(--neon-violet);
}

.badge-rev-curr {
  background: var(--neon-emerald);
  color: #000000;
  font-weight: 900;
}

.badge-rev-old {
  background: #1d1d26;
  color: var(--neon-violet);
}

.badge-win {
  background: rgba(0, 255, 157, 0.16);
  color: var(--neon-emerald);
}

.badge-loss {
  background: rgba(255, 42, 109, 0.18);
  color: var(--neon-crimson);
}

.badge-active {
  background: rgba(255, 214, 0, 0.16);
  color: var(--neon-gold);
}

.badge-be {
  background: rgba(0, 255, 157, 0.18);
  color: var(--neon-emerald);
  border: 1px solid var(--neon-emerald);
}

.strike-muted {
  color: var(--text-dim);
  text-decoration: line-through;
}

/* Score Bar */
.score-bar-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 105px;
}

.score-bar-track {
  flex: 1;
  height: 7px;
  background: #1a1a22;
  border-radius: 4px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
}

/* Charts */
.charts-grid-3x2 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

.charts-grid-version {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 12px;
  padding: 12px;
}

.chart-card {
  background: #020204;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
}

.chart-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.chart-title {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.35px;
}

.hit-badge {
  background: var(--neon-gold);
  color: #000000;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.target-hint {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.chart-canvas-wrap {
  position: relative;
  height: 235px;
  width: 100%;
}

.chart-card.tall .chart-canvas-wrap {
  height: 280px;
}

/* System Log */
.system-log-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px 13px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.system-log-title {
  color: var(--neon-gold);
  font-weight: 800;
  margin-bottom: 6px;
}

.system-log-entries {
  max-height: 150px;
  overflow-y: auto;
  color: #d8dce8;
}

.system-log-entries > div {
  padding: 3px 0;
  border-bottom: 1px dashed #20202a;
}

/* Filters & Inputs */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.input-dark {
  background: #0a0a0f;
  color: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12px;
  font-family: var(--font-sans);
}

.input-dark:focus {
  outline: none;
  border-color: var(--neon-cyan);
}

/* Analytics Summary & Release Catalog */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  padding: 12px;
}

.catalog-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 10px 12px;
}

.catalog-item.current {
  border-color: var(--neon-emerald);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 680px;
  background: #07070b;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-strong);
}

.modal-header .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.settings-form {
  padding: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-weight: 600;
  padding: 6px 8px;
  background: #0d0d14;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.modal-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-hint {
  font-size: 11px;
  color: var(--text-dim);
}

/* Toast */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #0e1018;
  color: #ffffff;
  border: 1px solid var(--neon-cyan);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  z-index: 1200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
   Admin Panel & AI Improvements Page Components
   ========================================================================== */

.panel-body {
  padding: 14px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 12px;
}

.info-callout {
  background: #0a0c14;
  border: 1px solid #202a3c;
  border-left: 3px solid var(--neon-cyan);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #d6dbe8;
  line-height: 1.5;
}

.info-callout code {
  background: #141824;
  color: var(--neon-gold);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.alert-banner {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
}

.alert-err {
  background: rgba(255, 42, 109, 0.14);
  border: 1px solid var(--neon-crimson);
  color: #ff8fb1;
}

.alert-ok {
  background: rgba(0, 255, 157, 0.14);
  border: 1px solid var(--neon-emerald);
  color: var(--neon-emerald);
}

.otp-box {
  margin-top: 16px;
  padding: 14px;
  background: #07100c;
  border: 1px solid var(--neon-emerald);
  border-radius: 8px;
}

.otp-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.4px;
}

.listener-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.group-search-row {
  margin-bottom: 10px;
}

.group-search-row .input-dark {
  width: 100%;
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.group-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 229, 255, 0.14);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.chip-remove {
  appearance: none;
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  font-size: 11px;
  padding: 0 2px;
}

.groups-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 2px;
}

.group-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: #08080e;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  cursor: pointer;
}

.group-item.selected {
  border-color: var(--neon-emerald);
  background: rgba(0, 255, 157, 0.06);
}

.group-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.group-name {
  font-weight: 700;
  color: #ffffff;
  font-size: 12.5px;
}

.group-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
}

.empty-box {
  background: #07070b;
  border: 1px dashed #2a2a38;
  border-radius: 8px;
  padding: 18px 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.sim-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  align-items: start;
}

.sim-inputs textarea.input-dark {
  width: 100%;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12px;
}

.sim-result-box {
  background: #08080e;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 145px;
}

/* AI Improvements Page Cards */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.improvements-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.imp-card {
  background: #08080e;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 14px;
}

.imp-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.imp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.imp-title {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
}

.imp-evidence {
  margin: 0 0 12px;
  font-size: 12px;
  color: #c8cddc;
  line-height: 1.5;
}

.imp-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.imp-rule-box {
  background: #050508;
  border: 1px solid #222230;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 12px;
  color: #dde1ee;
}

.imp-rule-proposed {
  border-color: rgba(0, 255, 157, 0.35);
}

.imp-rule-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.imp-prompt-details {
  margin-bottom: 10px;
  background: #040407;
  border: 1px solid #1e1e2a;
  border-radius: 7px;
  padding: 8px 10px;
}

.imp-prompt-details summary {
  cursor: pointer;
  color: var(--neon-cyan);
  font-size: 11.5px;
  font-weight: 700;
}

.imp-prompt-pre {
  margin: 8px 0 0;
  padding: 10px;
  background: #000000;
  border: 1px solid #242433;
  border-radius: 6px;
  color: #e6ebff;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.imp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.feature-card {
  background: #08080e;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 11px 12px;
}

.feature-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

/* Upgrade column truncation on desktop only */
.upgrade-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile Bottom Navigation (hidden on desktop) */
.mobile-bottom-nav {
  display: none;
}

/* Responsive Breakpoints */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split-grid { grid-template-columns: 1fr; }
  .charts-grid-3x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts-grid-version { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  body {
    font-size: 13px;
  }

  .terminal-shell {
    padding: max(10px, env(safe-area-inset-top)) 10px calc(82px + env(safe-area-inset-bottom)) 10px;
  }

  /* Compact Mobile Header */
  .terminal-header {
    padding: 12px;
    gap: 10px;
    border-radius: 10px;
  }

  .brand-title {
    font-size: 14px;
    line-height: 1.3;
  }

  .brand-title-row .pill-outline-cyan {
    display: none;
  }

  .brand-subtitle {
    font-size: 10.5px;
    line-height: 1.4;
    word-break: break-word;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .status-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px;
    width: 100%;
  }

  .status-pill {
    text-align: center;
    font-size: 9.8px;
    padding: 6px 7px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .btn-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
  }

  .btn-group .btn {
    min-height: 40px;
    font-size: 12px;
    padding: 8px 10px;
    touch-action: manipulation;
  }

  /* Hide desktop Settings button on mobile since it is in Bottom Nav */
  #btn-open-settings {
    display: none;
  }

  /* Desktop top nav tabs hidden on mobile — replaced by sticky Bottom Nav */
  .nav-tabs {
    margin-bottom: 10px;
  }

  .nav-tabs .nav-tab,
  .nav-tabs .nav-spacer {
    display: none;
  }

  .cooldown-banner {
    width: 100%;
    text-align: center;
    font-size: 11px;
    padding: 7px 10px;
  }

  /* Mobile KPI Strip: 2x2 + 1 full-width hero card */
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }

  .kpi-card {
    padding: 10px 11px;
  }

  .kpi-card:last-child {
    grid-column: 1 / -1;
  }

  .kpi-label {
    font-size: 9.5px;
  }

  .kpi-value {
    font-size: 15px;
    word-break: break-word;
  }

  .kpi-sub {
    display: block;
    margin-top: 2px;
    font-size: 10.5px;
  }

  .panel {
    margin-bottom: 10px;
    border-radius: 10px;
  }

  .panel-header {
    padding: 10px 12px;
    gap: 6px;
  }

  .panel-title {
    font-size: 11.5px;
    line-height: 1.35;
  }

  /* Responsive Card-View Tables for Android & iPhone */
  .table-wrap {
    overflow-x: visible;
    padding: 8px;
  }

  .data-table.responsive-cards,
  .data-table.responsive-cards tbody,
  .data-table.responsive-cards tr,
  .data-table.responsive-cards td {
    display: block;
    width: 100%;
  }

  .data-table.responsive-cards thead {
    display: none;
  }

  .data-table.responsive-cards tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    background: #08080e;
    border: 1px solid #22222d;
    border-radius: 9px;
    padding: 10px 11px;
    margin-bottom: 9px;
  }

  .data-table.responsive-cards tbody tr:last-child {
    margin-bottom: 0;
  }

  .data-table.responsive-cards tbody tr:hover td {
    background: transparent;
  }

  .data-table.responsive-cards tbody td {
    padding: 0;
    border-bottom: none;
    white-space: normal;
    word-break: break-word;
    font-size: 12px;
  }

  .data-table.responsive-cards tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.45px;
    color: var(--text-dim);
    margin-bottom: 2px;
    text-transform: uppercase;
  }

  .data-table.responsive-cards tbody td.card-primary {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 7px;
    margin-bottom: 2px;
    border-bottom: 1px solid #1e1e28;
    font-size: 13.5px;
  }

  .data-table.responsive-cards tbody td.card-primary::before {
    margin-bottom: 0;
    font-size: 9.5px;
    color: var(--neon-cyan);
  }

  .data-table.responsive-cards tbody td.card-wide,
  .data-table.responsive-cards tbody td.card-action {
    grid-column: 1 / -1;
  }

  .data-table.responsive-cards tbody td.card-action::before {
    display: none;
  }

  .data-table.responsive-cards tbody td.card-action .btn {
    width: 100%;
    min-height: 38px;
    font-size: 12px;
  }

  .data-table.responsive-cards tbody td.empty-row {
    grid-column: 1 / -1;
    padding: 14px 8px !important;
  }

  .data-table.responsive-cards tbody td.empty-row::before {
    display: none;
  }

  .upgrade-cell {
    max-width: none;
    overflow: visible;
    text-overflow: unset;
  }

  /* Charts on Mobile */
  .charts-grid-3x2,
  .charts-grid-version {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .chart-card {
    padding: 10px;
  }

  .chart-card-head {
    flex-wrap: wrap;
    gap: 5px;
  }

  .chart-canvas-wrap {
    height: 215px;
  }

  .chart-card.tall .chart-canvas-wrap {
    height: 245px;
  }

  /* Filter Bar & Inputs (16px prevents iOS Safari auto-zoom) */
  .filter-bar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .filter-bar #filter-pair,
  .filter-bar #btn-apply-log-filter {
    grid-column: 1 / -1;
  }

  .input-dark {
    width: 100%;
    min-height: 42px;
    font-size: 16px;
    padding: 8px 10px;
  }

  #btn-apply-log-filter {
    min-height: 42px;
    font-size: 13px;
  }

  .summary-strip,
  .vip-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .vip-mini-val {
    font-size: 13.5px;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  /* Bottom-Sheet Settings Modal on Mobile */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    max-width: 100%;
    max-height: 88dvh;
    display: flex;
    flex-direction: column;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
  }

  .settings-form {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .checkbox-field {
    min-height: 44px;
    font-size: 13px;
  }

  .checkbox-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-footer .btn {
    min-height: 44px;
    font-size: 14px;
  }

  /* Sticky Native-Style Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 950;
    background: rgba(6, 6, 10, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #242430;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mobile-nav-item {
    appearance: none;
    text-decoration: none;
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    padding: 4px 2px;
    border-radius: 8px;
    cursor: pointer;
    touch-action: manipulation;
    font-family: var(--font-sans);
  }

  .admin-grid,
  .sim-grid,
  .imp-compare-grid {
    grid-template-columns: 1fr;
  }

  .page-nav-bar {
    display: none;
  }

  .listener-toolbar,
  .action-bar,
  .imp-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .listener-toolbar .btn,
  .action-bar .btn,
  .imp-actions .btn {
    min-height: 42px;
    font-size: 12.5px;
  }

  .mobile-nav-icon {
    font-size: 16px;
    line-height: 1;
  }

  .mobile-nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2px;
  }

  .mobile-nav-item.active {
    color: var(--neon-cyan);
    background: rgba(0, 229, 255, 0.1);
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    text-align: center;
  }
}

@media (max-width: 390px) {
  .kpi-value {
    font-size: 13.5px;
  }

  .data-table.responsive-cards tbody tr {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   AI Live-Readiness Monitor & Alert Strip
   ========================================================================== */
.readiness-card {
  background: linear-gradient(180deg, #070a12 0%, #050508 100%);
  border: 1px solid #1b2a3c;
  border-left: 3px solid var(--neon-cyan);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.readiness-card.readiness-ready {
  border-color: var(--neon-emerald);
  border-left: 4px solid var(--neon-emerald);
  background: linear-gradient(180deg, rgba(0, 255, 157, 0.12) 0%, #050a08 100%);
  box-shadow: 0 0 18px rgba(0, 255, 157, 0.22);
}

.readiness-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.readiness-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.readiness-headline {
  font-size: 12px;
  font-weight: 700;
  color: #e6edf7;
}

.readiness-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.readiness-tier-pills {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.readiness-progress-track {
  width: 100%;
  height: 6px;
  background: #101521;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #1b2234;
}

.readiness-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-violet));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.readiness-progress-fill.ready {
  background: linear-gradient(90deg, var(--neon-emerald), #6dffbe);
}

.readiness-gates-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gate-pill {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: #0a0c12;
  color: #d0d7e2;
}

.gate-pill.gate-pass {
  border-color: rgba(0, 255, 157, 0.45);
  background: rgba(0, 255, 157, 0.08);
  color: #b7ffdf;
}

.gate-pill.gate-pending {
  border-color: rgba(255, 215, 0, 0.35);
  background: rgba(255, 215, 0, 0.06);
  color: #ffe89a;
}

.gate-target {
  color: var(--text-muted);
  font-size: 10px;
}

@media (max-width: 780px) {
  .readiness-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .readiness-actions {
    width: 100%;
  }

  .gate-pill {
    font-size: 10.5px;
    padding: 3px 6px;
  }
}


/* ==========================================================================
   Isolated @CoinSonarV2 Standalone Model Lab (Admin Panel Section 5)
   ========================================================================== */
.coinsonar-panel {
  border-color: rgba(255, 214, 0, 0.35);
}

.cs-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.cs-kpi {
  background: #080a10;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 9px 11px;
}

.cs-kpi-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cs-kpi-val {
  font-size: 13.5px;
  font-weight: 800;
}

.cs-blueprint-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 10px;
}

.cs-box {
  background: #07090f;
  border: 1px solid #1d2332;
  border-radius: 8px;
  padding: 11px 13px;
}

.cs-box-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.35px;
  margin-bottom: 8px;
}

.cs-matrix-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 210px;
  overflow-y: auto;
}

.cs-matrix-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  padding: 4px 7px;
  border-radius: 5px;
  background: #0b0e17;
  border: 1px solid #161c2b;
}

@media (max-width: 900px) {
  .cs-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cs-blueprint-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   Docker & Container Performance Monitoring Dashboard (Admin Panel Section 6)
   ========================================================================== */
.docker-panel {
  border-color: rgba(0, 229, 255, 0.35);
}

.ubuntu-panel {
  border-color: rgba(255, 214, 0, 0.35);
}

.binance-api-panel {
  border-color: rgba(255, 214, 0, 0.45);
  margin-bottom: 16px;
}

.bn-profiles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.bn-profile-card {
  background: #070a12;
  border: 1px solid #1b2538;
  border-radius: 9px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.bn-profile-card.bn-live-card {
  border-color: rgba(255, 42, 109, 0.4);
  background: linear-gradient(180deg, rgba(255, 42, 109, 0.06) 0%, #070a12 100%);
}

.bn-profile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bn-live-confirm-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid #ff2a6d;
  background: rgba(255, 42, 109, 0.1);
}

@media (max-width: 860px) {
  .bn-profiles-grid {
    grid-template-columns: 1fr;
  }
}

.dk-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dk-kpi-card {
  background: linear-gradient(180deg, #080c15 0%, #05070c 100%);
  border: 1px solid #1b2538;
  border-radius: 9px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dk-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.dk-kpi-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.45px;
  color: var(--text-muted);
}

.dk-kpi-val {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
}

.dk-kpi-sub {
  font-size: 11px;
  color: #8c9db5;
  line-height: 1.4;
}

.dk-meter-track {
  width: 100%;
  height: 6px;
  background: #0e1422;
  border: 1px solid #1a2438;
  border-radius: 999px;
  overflow: hidden;
}

.dk-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-emerald));
  transition: width 0.35s ease;
}

.dk-meter-fill.warn {
  background: linear-gradient(90deg, #ffb300, var(--neon-gold));
}

.dk-meter-fill.crit {
  background: linear-gradient(90deg, #ff2a6d, #ff6b8b);
}

.dk-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dk-chart-card {
  background: #060911;
  border: 1px solid #1a2436;
  border-radius: 9px;
  padding: 10px 12px;
}

.dk-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.dk-chart-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.dk-chart-meta {
  font-size: 10.5px;
  color: #8c9db5;
}

.dk-sparkline-wrap {
  width: 100%;
  height: 92px;
}

.dk-sparkline-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dk-posture-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #070a12;
  border: 1px solid #182234;
  margin-bottom: 12px;
}

.dk-chip {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #223047;
  background: #0c1220;
  color: #cdd8e8;
}

.dk-chip.ok {
  border-color: rgba(0, 255, 157, 0.45);
  background: rgba(0, 255, 157, 0.08);
  color: #a9ffd8;
}

.dk-chip.warn {
  border-color: rgba(255, 214, 0, 0.45);
  background: rgba(255, 214, 0, 0.08);
  color: #ffe996;
}

.dk-chip.crit {
  border-color: rgba(255, 42, 109, 0.55);
  background: rgba(255, 42, 109, 0.12);
  color: #ff9cb8;
}

@media (max-width: 960px) {
  .dk-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dk-charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .dk-kpi-grid {
    grid-template-columns: 1fr;
  }
}
