/* ==========================================================================
   INSTAN SIMULASI - MODERN FINANCIAL ARBITRAGE TERMINAL DESIGN SYSTEM
   Professional, High-Density, Legible, Accessible (WCAG AA Compliant)
   Dials: ENERGY: 2 (Balanced) | RHYTHM: 1 (Uniform) | MOTION: 1 (Calm)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS & ROOT VARIABLES
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette - Light Mode */
  --bg-app: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-subtle: #f8fafc;
  --bg-surface-muted: #e2e8f0;

  /* Borders */
  --border-subtle: #e2e8f0;
  --border-default: #cbd5e1;
  --border-strong: #94a3b8;
  --border-contrast: #64748b;

  /* Typography */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverted: #f8fafc;

  /* Brand & Directional Accents */
  --brand-primary: #2563eb;
  --brand-primary-hover: #1d4ed8;
  --brand-primary-subtle: #eff6ff;

  /* Arbitrage Flow Accents */
  --dir-c2d-bg: #eff6ff;
  --dir-c2d-border: #93c5fd;
  --dir-c2d-text: #1d4ed8;
  --dir-c2d-header: #1e3a8a;

  --dir-d2c-bg: #eff6ff;
  --dir-d2c-border: #93c5fd;
  --dir-d2c-text: #1d4ed8;
  --dir-d2c-header: #1e3a8a;

  --detail-col-bg: #f8fafc;
  --detail-col-header: #0f172a;

  /* Financial Colors (Green = Profit/Bid, Red = Loss/Ask) */
  --profit-text: #15803d;
  --profit-bg: #dcfce7;
  --profit-border: #86efac;
  --profit-glow: rgba(22, 163, 74, 0.15);

  --loss-text: #b91c1c;
  --loss-bg: #fee2e2;
  --loss-border: #fca5a5;

  --bid-color: #059669;
  --ask-color: #e11d48;

  /* DEX Aggregator Brands */
  --metax-color: #ea580c;
  --mix-color: #0d9488;
  --lunar-color: #059669;
  --jumper-color: #b49bda;
  --leodex-color: #f59e0b;
  --okutrade-color: #1a6fd4;
  --bungee-color: #ec4899;
  --debridge-color: #36a59e;
  --scrooge-color: #ffaa01;
  --o1x-color: #64748b;

  /* Elevation & Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
}

/* Dark Theme Tokens */
[data-bs-theme="dark"] {
  --bg-app: #090d16;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #1e293b;
  --bg-surface-subtle: #141e33;
  --bg-surface-muted: #334155;

  --border-subtle: #1e293b;
  --border-default: #334155;
  --border-strong: #475569;
  --border-contrast: #64748b;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverted: #0f172a;

  --brand-primary: #3b82f6;
  --brand-primary-hover: #60a5fa;
  --brand-primary-subtle: rgba(59, 130, 246, 0.15);

  --dir-c2d-bg: rgba(30, 58, 138, 0.2);
  --dir-c2d-border: #1e40af;
  --dir-c2d-text: #93c5fd;
  --dir-c2d-header: #020617;

  --dir-d2c-bg: rgba(120, 53, 15, 0.2);
  --dir-d2c-border: #92400e;
  --dir-d2c-text: #fde68a;
  --dir-d2c-header: #020617;

  --detail-col-bg: #0b1120;
  --detail-col-header: #020617;

  --profit-text: #4ade80;
  --profit-bg: rgba(34, 197, 94, 0.16);
  --profit-border: #22c55e;
  --profit-glow: rgba(34, 197, 94, 0.25);

  --loss-text: #f87171;
  --loss-bg: rgba(239, 68, 68, 0.15);
  --loss-border: #ef4444;

  --bid-color: #34d399;
  --ask-color: #fb7185;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   2. BASE RESET & GLOBAL TYPOGRAPHY
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* High contrast & Accessible Cursor States */
a[href],
button,
input[type="checkbox"],
input[type="radio"],
select,
[role="button"],
[role="switch"] {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --------------------------------------------------------------------------
   3. TOP BAR HEADER & TOOLBAR
   -------------------------------------------------------------------------- */
.top-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1040;
  backdrop-filter: blur(10px);
}

.top-bar .container-fluid {
  padding: 6px 14px;
}

/* Brand Section */
.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
  font-size: 14.5px;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  text-decoration: none;
}

.brand-logo-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: var(--radius-xs);
}

.brand-new-gif {
  height: 18px;
  width: auto;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

/* Status Badges */
#sseStatusBadge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

#usdtRateBadge {
  font-size: 10.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

/* Header Controls Groups */
.top-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.header-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

@media (min-width: 992px) {
  .top-bar-row {
    flex-wrap: nowrap !important;
  }

  .header-toolbar {
    flex-wrap: nowrap !important;
  }
}

/* Split Button Start / Stop Scan (AUTO SCAN & MANUAL) */
#scanButtonGroup {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  flex-shrink: 0;
  z-index: 45;
}

#scanButtonGroup:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

#scanButtonGroup:active {
  transform: translateY(0);
}

#btnToggleScan {
  height: 32px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 0 12px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

#btnScanModeSplit {
  height: 32px;
  min-width: 28px;
  padding: 0 8px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.35) !important;
  transition: all 0.15s ease;
}

#scanButtonGroup.is-running #btnToggleScan {
  border-radius: var(--radius-sm) !important;
}

#scanButtonGroup .dropdown-menu {
  z-index: 1060 !important;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.scan-control-dropdown {
  min-width: 460px;
}

/* DEX exclusion filter (submenu START) */
#btnScanModeSplit.has-dex-filter {
  position: relative;
}

#btnScanModeSplit.has-dex-filter::before {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 1px #ffffff;
  z-index: 2;
}

.dex-filter-panel {
  padding: 0 2px;
}

.dex-filter-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: 8px;
  padding: 5px;
  background: #ffffff;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 8px;
}

[data-bs-theme="dark"] .dex-filter-list {
  background: #1e293b;
  border-color: #334155;
}

.dex-filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 5px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1.25;
  user-select: none;
  margin: 0;
}

.dex-filter-item:hover {
  background: rgba(239, 68, 68, 0.07);
}

.dex-filter-item.is-excluded {
  background: rgba(239, 68, 68, 0.12);
}

.dex-filter-item input {
  margin: 0;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.dex-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.dex-filter-name {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dex-filter-unverified {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  flex: 0 0 auto;
}

.dex-filter-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  padding: 8px 0;
}

.scan-mode-item {
  border: 1px solid var(--border-default);
  background-color: var(--bg-surface-subtle, #f8fafc);
  transition: all 0.15s ease;
  cursor: pointer;
  text-align: left;
}

.scan-mode-item:hover {
  background-color: rgba(16, 185, 129, 0.08);
  border-color: #10b981;
}

.scan-mode-item.active {
  background-color: rgba(16, 185, 129, 0.12) !important;
  border-color: #10b981 !important;
  color: inherit !important;
}

/* Sub-Menu Pill Filter PNL+, Status Wallet & Level Orderbook */
.scan-submenu-pill {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 0px 6px;
  margin: 4px 0px;
}

.scan-submenu-pill .form-check {
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-left: 0 !important;
  margin-bottom: 0 !important;
  white-space: nowrap;
}

.scan-submenu-pill .form-check .form-check-input {
  float: none !important;
  margin: 0 !important;
  cursor: pointer;
  width: 1.8em;
  height: 1em;
}

.scan-submenu-divider {
  width: 1px;
  height: 20px;
  background-color: #cbd5e1;
  flex-shrink: 0;
}

[data-bs-theme="dark"] #scanButtonGroup .dropdown-menu {
  background-color: #1e293b;
  border-color: #334155;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .scan-mode-item {
  background-color: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

[data-bs-theme="dark"] .scan-mode-item:hover {
  background-color: #1e293b;
  border-color: #10b981;
}

[data-bs-theme="dark"] .scan-mode-item.active {
  background-color: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
}

[data-bs-theme="dark"] .scan-submenu-pill {
  background: #0f172a;
  border-color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .scan-submenu-divider {
  background-color: #334155;
}

@media (max-width: 576px) {
  .scan-control-dropdown {
    min-width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
  }

  .scan-submenu-pill {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .scan-submenu-divider {
    width: 100% !important;
    height: 1px !important;
    margin: 2px 0 !important;
  }
}

/* Control Group Pills */
.control-group-pill {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 2px 5px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.control-group-pill:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-primary-subtle);
}

.control-group-pill select {
  height: 24px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  background-color: transparent;
  border: none;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 4px;
  padding-right: 17px !important;
  background-position: right 3px center !important;
  background-size: 10px 8px !important;
  cursor: pointer;
  outline: none;
  flex: 0 0 auto;
}

.control-group-pill select:focus {
  outline: none;
}

.control-group-pill select option {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

#selectScanMode {
  width: 82px;
  min-width: 76px;
  font-weight: 700;
}

.table-cex-dropdown-btn {
  height: 24px;
  line-height: 1;
  font-size: 11.5px;
  font-weight: 700;
  padding: 0 6px 0 4px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  max-width: 195px;
}

.table-cex-dropdown-btn:hover {
  color: var(--brand-primary);
  background: rgba(37, 99, 235, 0.05);
}

.table-cex-dropdown-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.table-chain-dropdown-btn {
  height: 24px;
  line-height: 1;
  font-size: 11.5px;
  font-weight: 700;
  padding: 0 6px 0 8px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-left: 1px solid var(--border-default) !important;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  max-width: 195px;
}

.table-chain-dropdown-btn:hover {
  color: var(--brand-primary);
  background: rgba(37, 99, 235, 0.05);
}

.table-chain-dropdown-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cex-multiselect-menu,
.chain-multiselect-menu {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-sm);
  z-index: 1050;
}

.cex-chk-row,
.chain-chk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background-color 0.12s ease;
  user-select: none;
}

.cex-chk-row:hover,
.chain-chk-row:hover {
  background-color: var(--bg-surface-subtle);
}

.cex-chk-row .form-check-input,
.chain-chk-row .form-check-input {
  cursor: pointer;
  margin-top: 0;
}

.filter-dropdown-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 3px;
  flex-shrink: 0;
  margin-right: 5px;
}

.filter-btn-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  vertical-align: -2px;
  border-radius: 2px;
  flex-shrink: 0;
  margin-right: 3px;
}

.header-search-input {
  width: 82px;
  height: 24px;
  font-size: 11.5px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0 5px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-search-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-primary-subtle);
  outline: none;
}

/* ==========================================================================
   TABLE ACTION & FILTER TOOLBAR (Diatas Tabel Sebelah Kiri)
   ========================================================================== */
.table-toolbar {
  position: relative;
  z-index: 40;
  min-height: 38px;
  padding: 2px 0;
}

.signal-toolbar {
  min-height: 38px;
  padding: 2px 0;
}

.table-filter-pill,
.table-search-pill {
  background: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.table-filter-pill:focus-within,
.table-search-pill:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-primary-subtle);
}

.table-search-input {
  width: 150px;
  min-width: 150px;
  height: 24px;
  font-size: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0 8px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, width 0.2s ease;
}

.table-search-input:focus {
  width: 320px;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-primary-subtle);
  outline: none;
}

.table-toolbar-vr {
  width: 1.5px;
  height: 24px;
  background-color: var(--border-default);
  margin: 0 4px;
  opacity: 0.8;
}

.btn-action-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  background-color: #2563eb;
  color: #ffffff !important;
  border: 1px solid #1d4ed8;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-action-add:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(37, 99, 235, 0.25);
}

.btn-action-wallet {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  background-color: #0891b2;
  color: #ffffff !important;
  border: 1px solid #06b6d4;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(8, 145, 178, 0.25);
}

.btn-action-wallet:hover {
  background-color: #0e7490;
  border-color: #0891b2;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(8, 145, 178, 0.35);
}

.btn-action-wallet:disabled,
.btn-action-wallet.disabled {
  background-color: #0891b2 !important;
  border-color: #06b6d4 !important;
  color: #ffffff !important;
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

.btn-action-wallet:disabled i,
.btn-action-wallet.disabled i {
  color: #ffffff !important;
}

.btn-action-wallet i {
  color: #ffffff !important;
}

.btn-action-add:disabled,
.btn-action-add.disabled {
  background-color: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

.btn-action-add:disabled i,
.btn-action-add.disabled i {
  color: #ffffff !important;
}

.btn-action-csv-import {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  background-color: #7c3aed;
  color: #ffffff !important;
  border: 1px solid #6d28d9;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(124, 58, 237, 0.25);
}

.btn-action-csv-import:hover {
  background-color: #6d28d9;
  border-color: #5b21b6;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(124, 58, 237, 0.35);
}

.btn-action-csv-import:disabled,
.btn-action-csv-import.disabled {
  background-color: #7c3aed !important;
  border-color: #6d28d9 !important;
  color: #ffffff !important;
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

.btn-action-csv-import:disabled i,
.btn-action-csv-import.disabled i {
  color: #ffffff !important;
}

.btn-action-csv-import i {
  color: #ffffff !important;
}

.btn-action-csv-export {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  background-color: #ea580c;
  color: #ffffff !important;
  border: 1px solid #c2410c;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.25);
}

.btn-action-csv-export:hover {
  background-color: #c2410c;
  border-color: #9a3412;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(234, 88, 12, 0.35);
}

.btn-action-csv-export:disabled,
.btn-action-csv-export.disabled {
  background-color: #ea580c !important;
  border-color: #c2410c !important;
  color: #ffffff !important;
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

.btn-action-csv-export:disabled i,
.btn-action-csv-export.disabled i {
  color: #ffffff !important;
}

.btn-action-csv-export i {
  color: #ffffff !important;
}

.btn-action-csv-sample {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  background-color: #059669;
  color: #ffffff !important;
  border: 1px solid #047857;
  text-decoration: none !important;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
}

.btn-action-csv-sample:hover {
  background-color: #047857;
  border-color: #065f46;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(5, 150, 105, 0.35);
}

.btn-action-csv-sample:disabled,
.btn-action-csv-sample.disabled {
  background-color: #059669 !important;
  border-color: #047857 !important;
  color: #ffffff !important;
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

.btn-action-csv-sample:disabled i,
.btn-action-csv-sample.disabled i,
.btn-action-csv-sample i {
  color: #ffffff !important;
}

.sidebar-top-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  flex-shrink: 0;
}

/* Toolbar Atas Tabel Sinyal - Murni Icon Saja (Bukan Button Bericon) */
.sidebar-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  flex-shrink: 0;
  padding: 0 4px;
}

.topbar-icon-action {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 4px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease, filter 0.15s ease;
  line-height: 1;
  text-decoration: none !important;
}

.topbar-icon-action:hover {
  transform: translateY(-2px) scale(1.18);
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.25));
}

.topbar-icon-action:active {
  transform: translateY(0) scale(0.95);
}

.topbar-icon-action:disabled,
.topbar-icon-action.disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  transform: none !important;
  filter: grayscale(1) !important;
}

.topbar-action-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.topbar-action-icon {
  font-size: 20px;
  line-height: 1;
  display: inline-block;
}

.icon-import-action {
  color: #ef252c !important;
  /* Emerald Green */
}

.icon-import-action:hover {
  color: #f3303d !important;
}

.icon-export-action {
  color: #406bec !important;
  /* Vibrant Orange */
}

.icon-export-action:hover {
  color: #406bec !important;
}

/* Action Icons & Toolbar Buttons */
.action-btn-img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

.btn-action-reload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 31px;
  width: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  background-color: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-action-reload:hover {
  background-color: var(--bg-hover, #f1f5f9);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.btn-action-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 31px;
  border-radius: var(--radius-sm);
  background-color: #8b5cf6;
  color: #ffffff !important;
  border: 1px solid #7c3aed;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(139, 92, 246, 0.25);
}

.btn-action-modal:hover {
  background-color: #7c3aed;
  border-color: #6d28d9;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(139, 92, 246, 0.35);
}

.btn-action-modal:disabled,
.btn-action-modal.disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

[data-bs-theme="dark"] .btn-action-reload {
  background-color: #1e293b;
  border-color: #334155;
}

[data-bs-theme="dark"] .btn-action-reload:hover {
  background-color: #334155;
  border-color: #475569;
}

.btn-header-db {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  background-color: var(--bg-surface-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  transition: all 0.15s ease;
}

.btn-header-db:hover {
  background-color: var(--bg-surface);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
}

.btn-header-settings {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  background-color: var(--brand-primary-subtle);
  color: var(--brand-primary);
  border: 1.5px solid var(--brand-primary);
  transition: all 0.15s ease;
}

.btn-header-settings:hover {
  background-color: var(--brand-primary);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.25);
}

[data-bs-theme="dark"] .btn-header-db {
  background-color: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

[data-bs-theme="dark"] .btn-header-settings {
  background-color: rgba(37, 99, 235, 0.15);
  border-color: #3b82f6;
  color: #60a5fa;
}

[data-bs-theme="dark"] .table-filter-pill,
[data-bs-theme="dark"] .table-search-pill {
  background-color: #0f172a;
  border-color: #334155;
}

[data-bs-theme="dark"] .table-search-input {
  background-color: #1e293b;
  border-color: #475569;
  color: #f8fafc;
}

[data-bs-theme="dark"] .table-toolbar-vr {
  background-color: #334155;
}

/* ==========================================================================
   HEADER SWITCHES PILL (PNL+, Wallet CEX, Level Orderbook)
   ========================================================================== */
.header-switches-pill {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.header-switches-divider {
  width: 1px;
  height: 16px;
  background-color: var(--border-default);
  flex-shrink: 0;
}

.header-switches-pill .form-check {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-left: 0 !important;
  margin-bottom: 0 !important;
  white-space: nowrap;
}

.header-switches-pill .form-check .form-check-input {
  float: none !important;
  margin: 0 !important;
  cursor: pointer;
  width: 1.6em;
  height: 0.9em;
}

.header-level-input {
  width: 32px !important;
  height: 22px !important;
  padding: 0 2px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  text-align: center !important;
  border-radius: var(--radius-xs) !important;
  border: 1px solid var(--border-default) !important;
  background-color: var(--bg-surface) !important;
  color: var(--text-primary) !important;
}

.header-min-pnl-input {
  width: 50px !important;
  height: 22px !important;
  padding: 0 4px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  text-align: center !important;
  border-radius: var(--radius-xs) !important;
  border: 1px solid var(--border-default) !important;
  background-color: var(--bg-surface) !important;
  color: #15803d !important;
}

[data-bs-theme="dark"] .header-switches-pill {
  background: #0f172a;
  border-color: #334155;
}

[data-bs-theme="dark"] .header-switches-divider {
  background-color: #334155;
}

[data-bs-theme="dark"] .header-level-input,
[data-bs-theme="dark"] .header-min-pnl-input {
  background-color: #1e293b !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

[data-bs-theme="dark"] .header-min-pnl-input {
  color: #4ade80 !important;
}

/* Switch Form in Pills */
.control-group-pill .form-check {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-left: 0 !important;
  margin-bottom: 0 !important;
  white-space: nowrap;
}

.control-group-pill .form-check .form-check-input {
  float: none !important;
  margin: 0 !important;
  cursor: pointer;
  width: 1.6em;
  height: 0.9em;
}

.control-group-pill input[type="number"] {
  height: 22px;
  width: 28px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-default);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  padding: 0;
}

/* Stats Pill */
#filterStatsPill {
  height: 30px;
  font-size: 11.5px;
  line-height: 1;
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  flex-shrink: 0;
}


/* Menu Dropdown, Audio & Theme Toggle */
#btnHeaderMenu {
  height: 30px;
  font-size: 12px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.header-action-group {
  gap: 6px;
}

#btnOpenPortofolio,
#btnQuickAudioToggle,
#btnToggleTheme,
.header-icon-btn {
  height: 30px;
  width: 30px;
  padding: 0;
  font-size: 13px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
}

.header-icon-btn:hover {
  transform: translateY(-1px);
}

.header-action-img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  display: block;
}

#btnHeaderMenu {
  padding: 0 12px;
  font-weight: 600;
}

.dropdown-menu {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
}

.dropdown-item {
  color: var(--text-primary);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  transition: background-color 0.12s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--bg-surface-subtle);
  color: var(--brand-primary);
}

.dropdown-divider {
  border-top-color: var(--border-subtle);
  margin: 4px 0;
}

/* Scan Table Slim Progress (Tepat Di Atas Tabel) */
.scan-table-progress {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  transition: all 0.2s ease;
}

.scan-progress-vr {
  width: 1px;
  height: 12px;
  background-color: var(--border-default);
  margin: 0 1px;
  opacity: 0.7;
  display: inline-block;
  flex-shrink: 0;
}

.scan-table-progress .progress {
  background-color: var(--border-default);
  border-radius: var(--radius-full);
  overflow: hidden;
}

[data-bs-theme="dark"] .scan-table-progress {
  background: #0f172a;
  border-color: #334155;
}

/* --------------------------------------------------------------------------
   4. MAIN WORKSPACE GRID & LAYOUT (FULL VIEWPORT DESKTOP LOCK)
   -------------------------------------------------------------------------- */
html,
body {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

.top-bar {
  flex-shrink: 0;
}

main.container-fluid {
  padding: 8px 10px 8px 10px !important;
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Split Layout Permanen: Tabel Scanner (Kiri, Scroll X+Y) + Sidebar Sinyal (Kanan, Tetap di Samping di Semua Layar) */
.scanner-main-split {
  flex: 1 1 0%;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  overflow: hidden;
}

.scanner-main-pane {
  flex: 1 1 0%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scanner-signal-pane {
  flex: 0 0 auto;
  width: clamp(185px, 18vw, 255px);
  min-width: 175px;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-toolbar,
.sidebar-top-bar {
  flex-shrink: 0;
}

.scanner-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  flex: 1 1 0%;
  min-height: 0;
  min-width: 0;
  height: 100%;
  max-height: 100% !important;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  position: relative;
}

.scanner-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scanner-wrap::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.45);
  border-radius: 999px;
}

.scanner-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.7);
}

.sidebar-signal-card {
  flex: 1 1 0%;
  min-height: 0;
  max-height: 100% !important;
  height: 100%;
}

/* --------------------------------------------------------------------------
   5. SCANNER DATA TABLE (THE CORE ARBITRAGE GRID)
   -------------------------------------------------------------------------- */
.scanner-table {
  width: 100%;
  min-width: 1240px;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

/* Precise Column Width Allocation via Colgroup */
.scanner-table col.col-w-ob {
  width: 148px;
}

.thead-cols th.col-ob-left,
td.col-ob-left,
.thead-cols th.col-ob-right,
td.col-ob-right {
  width: 148px;
  min-width: 148px;
  max-width: 148px;
}

.scanner-table col.col-w-dex {
  width: 11.67%;
}

.scanner-table col.col-w-detail {
  width: 192px;
}

.thead-cols th.col-detail,
td.col-detail {
  width: 192px;
  min-width: 192px;
  max-width: 192px;
}

/* Sticky Headers */
/* Sticky Headers - Single Uniform Row */
.scanner-table thead th,
.thead-cols th {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 8px 6px;
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
  background-color: #172554 !important;
  color: #f8fafc !important;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border-contrast);
  border-right: 1px solid #334155;
}

.thead-cols th.col-ob-left,
.thead-cols th.col-ob-right,
.thead-cols th.col-detail,
.thead-cols th.col-dex {
  background-color: #30444e !important;
  color: #f8fafc !important;
}

.thead-cols th.col-dex.th-dex-metax {
  color: #fb923c !important;
}

.thead-cols th.col-dex.th-dex-mix {
  color: #2dd4bf !important;
}

.thead-cols th.col-dex.th-dex-lunar {
  color: #34d399 !important;
}

.thead-cols th.col-dex.th-dex-jumper {
  color: var(--jumper-color) !important;
}

.thead-cols th.col-dex.th-dex-leodex {
  color: #fbbf24 !important;
}

.thead-cols th.col-dex.th-dex-bungee {
  color: var(--bungee-color) !important;
}

.thead-cols th.col-dex.th-dex-debridge {
  color: #facc15 !important;
}

.thead-cols th.col-dex.th-dex-scrooge {
  color: #34d399 !important;
}

.thead-cols th.col-dex.th-dex-o1x {
  color: var(--o1x-color) !important;
}

.thead-cols th.col-ob-left {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 25 !important;
  border-right: 2px solid var(--border-contrast) !important;
}

.thead-cols th.col-detail {
  border-left: 2px solid var(--border-contrast) !important;
  border-right: 2px solid var(--border-contrast) !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
  font-size: 14.5px !important;
  letter-spacing: 0.04em;
}

.thead-cols th.col-ob-right {
  position: sticky;
  right: 0;
  top: 0;
  z-index: 25 !important;
  border-left: 2px solid var(--border-contrast) !important;
  border-right: none !important;
}

/* Table Cells & Row Separators */
.scanner-table>tbody>tr>td,
.scanner-table tbody td {
  padding: 4px;
  vertical-align: middle;
  border-bottom: 2px solid var(--border-strong) !important;
  border-right: 1px solid var(--border-subtle);
  transition: background-color 0.12s ease;
}

.scanner-table tbody tr {
  height: 1px;
  background-color: var(--bg-surface);
  border-bottom: 2px solid var(--chain-border, var(--border-strong)) !important;
  border-left: 3px solid var(--chain-border, transparent);
  border-right: 3px solid var(--chain-border, transparent);
  content-visibility: auto;
  contain-intrinsic-size: 0 72px;
  transition: background-color 0.12s ease, border-color 0.15s ease;
}

.scanner-table tbody tr:hover {
  background-color: #e2e8f0 !important;
}

/* Hover baris memakai warna netral umum yang jelas (DETAIL KOIN tetap mempertahankan warnanya) */
.scanner-table tbody tr:hover>td.col-ob-left,
.scanner-table tbody tr:hover>td.col-ob-right,
.scanner-table tbody tr:hover>td.col-dex:not(.dex-td-error):not(.dex-td-delist):not(.dex-td-limited):not(.dex-td-timeout):not(.dex-td-cexerr) {
  background-color: #e2e8f0 !important;
  background-image: none !important;
}

.scanner-table tbody tr:hover>td.col-dex .dex-card:not(.dex-card-profit) {
  background-color: transparent !important;
}

[data-bs-theme="dark"] .scanner-table tbody tr:hover {
  background-color: color-mix(in srgb, #94a3b8 24%, var(--bg-surface)) !important;
}

[data-bs-theme="dark"] .scanner-table tbody tr:hover>td.col-ob-left,
[data-bs-theme="dark"] .scanner-table tbody tr:hover>td.col-ob-right,
[data-bs-theme="dark"] .scanner-table tbody tr:hover>td.col-dex:not(.dex-td-error):not(.dex-td-delist):not(.dex-td-limited):not(.dex-td-timeout):not(.dex-td-cexerr) {
  background-color: color-mix(in srgb, #94a3b8 24%, var(--bg-surface)) !important;
  background-image: none !important;
}

/* Row Chain Border Styling & Overrides */
.scanner-table tbody tr[data-chain],
.scanner-table tbody tr[data-chain]>td {
  border-bottom: 2px solid var(--chain-border, var(--border-strong)) !important;
}

.scanner-table tbody tr[data-chain] td:first-child {
  border-left: 3px solid var(--chain-border, var(--border-subtle)) !important;
}

.scanner-table tbody tr[data-chain] td:last-child {
  border-right: 3px solid var(--chain-border, var(--border-subtle)) !important;
}

/* Distinct Column Zone Boundaries */
td.col-ob-left {
  position: sticky;
  left: 0;
  z-index: 5;
  background-color: var(--bg-surface, #ffffff);
  background-image: linear-gradient(var(--dir-c2d-bg), var(--dir-c2d-bg));
  border-right: 2px solid var(--border-contrast) !important;
  border-bottom: 2px solid var(--chain-border, var(--border-strong)) !important;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.06);
  text-align: center;
  padding: 4px 3px;
}

td.col-detail {
  background-color: color-mix(in srgb, var(--chain-border, var(--brand-primary)) 7%, var(--bg-surface));
  border-left: 2px solid var(--chain-border, var(--border-contrast)) !important;
  border-right: 2px solid var(--chain-border, var(--border-contrast)) !important;
  border-bottom: 2px solid var(--chain-border, var(--border-strong)) !important;
  text-align: center;
  padding: 8px 10px !important;
  overflow: hidden;
  max-width: 0;
}

.scanner-table tbody tr[data-chain]:nth-child(even)>td.col-detail {
  background-color: color-mix(in srgb, var(--chain-border, var(--brand-primary)) 13%, var(--bg-surface));
}

[data-bs-theme="dark"] td.col-detail {
  background-color: color-mix(in srgb, var(--chain-border, var(--brand-primary)) 12%, var(--bg-surface));
}

[data-bs-theme="dark"] .scanner-table tbody tr[data-chain]:nth-child(even)>td.col-detail {
  background-color: color-mix(in srgb, var(--chain-border, var(--brand-primary)) 19%, var(--bg-surface));
}

td.col-ob-right {
  position: sticky;
  right: 0;
  z-index: 5;
  background-color: var(--bg-surface, #ffffff);
  background-image: linear-gradient(var(--dir-d2c-bg), var(--dir-d2c-bg));
  border-left: 2px solid var(--border-contrast) !important;
  border-right: none !important;
  border-bottom: 2px solid var(--chain-border, var(--border-strong)) !important;
  box-shadow: -2px 0 6px rgba(0, 0, 0, 0.06);
  text-align: center;
  padding: 4px 3px;
}

/* Profit Row Highlight */
.row-highlight-pos {
  background-color: var(--profit-bg) !important;
}

.row-highlight-pos:hover {
  background-color: color-mix(in srgb, var(--profit-bg) 85%, var(--chain-border, var(--border-contrast))) !important;
}

/* Live Update Flash Pulse (Pencahayaan Kuning Tipis Saat Scanning) */
.cell-flash,
td.col-dex.dex-td-routes.cell-flash {
  animation: flashPulse 1.1s ease-out !important;
}

@keyframes flashPulse {
  0% {
    background-color: #fef08a;
  }

  100% {
    background-color: var(--bg-surface);
  }
}

[data-bs-theme="dark"] .cell-flash,
[data-bs-theme="dark"] td.col-dex.dex-td-routes.cell-flash {
  animation: flashPulseDark 1.1s ease-out !important;
}

@keyframes flashPulseDark {
  0% {
    background-color: rgba(250, 204, 21, 0.28);
  }

  100% {
    background-color: var(--bg-surface);
  }
}

/* Empty State in Scanner Table */
.table-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 16px;
  color: var(--text-muted);
  gap: 8px;
  text-align: center;
}

.table-empty-state i {
  font-size: 32px;
  color: var(--text-secondary);
  opacity: 0.6;
}

.table-empty-state .empty-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.table-empty-state .empty-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   6. ORDERBOOK CELL STYLING
   -------------------------------------------------------------------------- */
.ob-box {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ob-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5px 5px;
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  line-height: 1.28;
  white-space: nowrap;
  overflow: hidden;
  z-index: 1;
}

.ob-row::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: var(--depth-pct, 0%);
  pointer-events: none;
  z-index: -1;
  opacity: 0.16;
  border-radius: var(--radius-xs);
  transition: width 0.2s ease-out;
}

[data-bs-theme="dark"] .ob-row::before {
  opacity: 0.22;
}

.ob-row-ask {
  color: var(--ask-color);
}

.ob-row-ask::before {
  background-color: var(--ask-color);
}

.ob-row-bid {
  color: var(--bid-color);
}

.ob-row-bid::before {
  background-color: var(--bid-color);
}

/* Row atas (Beli / Asks) = Hijau dengan volume background hijau */
.ob-row-green {
  color: #026143;
}

.ob-row-green::before {
  background-color: #55deb0;
}

[data-bs-theme="dark"] .ob-row-green {
  color: #10b981;
}

[data-bs-theme="dark"] .ob-row-green::before {
  background-color: #10b981;
}

/* Row bawah (Jual / Bids) = Merah dengan volume background merah */
.ob-row-red {
  color: #9b0606;
}

.ob-row-red::before {
  background-color: #f46666;
}

[data-bs-theme="dark"] .ob-row-red {
  color: #ef4444;
}

[data-bs-theme="dark"] .ob-row-red::before {
  background-color: #ef4444;
}

.ob-price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ob-sep {
  opacity: 0.45;
  margin: 0 2px;
}

.ob-vol {
  font-size: 11px;
  opacity: 0.88;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.ob-ask {
  color: var(--ask-color);
  font-weight: 600;
  white-space: nowrap;
}

.ob-bid {
  color: var(--bid-color);
  font-weight: 600;
  white-space: nowrap;
}

.ob-dir {
  color: var(--chain-color, #2563eb);
  font-weight: 800;
  margin: 3px 0;
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-align: center;
}

[data-bs-theme="dark"] .ob-dir {
  color: var(--chain-color, #3b82f6);
}

/* TD Column DEX: height: 1px agar child height: 100% selalu merentang penuh dari atas ke bawah baris di semua browser */
.scanner-table>tbody>tr>td.col-dex,
.scanner-table tbody td.col-dex,
td.col-dex {
  height: 1px;
  padding: 0 !important;
  vertical-align: middle !important;
  border-right: 2px solid #000000 !important;
}

[data-bs-theme="dark"] .scanner-table>tbody>tr>td.col-dex,
[data-bs-theme="dark"] .scanner-table tbody td.col-dex,
[data-bs-theme="dark"] td.col-dex {
  border-right: 2px solid #94a3b8 !important;
}

.thead-cols th.col-dex {
  border-right: 2px solid rgba(203, 213, 225, 0.7) !important;
}

.scanner-table>tbody>tr>td.col-dex.dex-td-routes,
.scanner-table tbody td.col-dex.dex-td-routes,
td.col-dex.dex-td-routes {
  background-color: var(--bg-surface);
  vertical-align: middle !important;
}

/* --------------------------------------------------------------------------
   7. DEX QUOTE CARDS (.dex-split & .dex-card)
   -------------------------------------------------------------------------- */
.dex-split {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  gap: 0;
  align-items: stretch;
}

.dex-card {
  flex: 1 1 0;
  min-width: 0;
  padding: 2px 3px;
  font-size: 11.5px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dex-card:not(:last-child) {
  border-right: 1px solid var(--border-default);
}

/* DEX Cell Wrapper States: Normal, Skipped, Error */
.dex-cell-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  padding: 3px;
  box-sizing: border-box;
}

/* Route Cell Wrapper: Tanpa padding luar agar bg profit full 100% kolom / per-sisi route */
.dex-cell-wrap.dex-cell-routes {
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.dex-cell-wrap.dex-cell-routes .dex-split {
  flex: 1 1 auto;
  height: auto;
}

.dex-mini-status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px 4px;
  border-bottom: 1px dashed var(--border-subtle, rgba(148, 163, 184, 0.25));
  background-color: rgba(148, 163, 184, 0.05);
  width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.dex-ms-pill {
  font-size: 8px;
  font-weight: 700;
  line-height: 1.05;
  padding: 1px 3px;
  border-radius: 3px;
  letter-spacing: 0.02em;
  cursor: help;
  user-select: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.dex-ms-ok {
  color: #000000;
  border-color: #000000;
}

[data-bs-theme="dark"] .dex-ms-ok {
  color: #f1f5f9;
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.32);
}

.dex-ms-limit {
  color: #b45309;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.38);
}

.dex-ms-err {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.34);
}

.dex-ms-skip {
  color: #64748b;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
  opacity: 0.72;
}

.dex-ms-pending {
  color: #2563eb;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.28);
}

[data-bs-theme="dark"] .dex-ms-ok {
  color: #34d399;
  background: rgba(16, 185, 129, 0.16);
}

[data-bs-theme="dark"] .dex-ms-limit {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
}

[data-bs-theme="dark"] .dex-ms-err {
  color: #f87171;
  background: rgba(239, 68, 68, 0.16);
}

[data-bs-theme="dark"] .dex-ms-skip {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
}

[data-bs-theme="dark"] .dex-ms-pending {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.16);
}

.dex-cell-wrap.dex-cell-routes .dex-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 2px;
  line-height: 1.25;
  height: 100%;
  padding: 2px 6px;
  border-radius: 0;
}

.dex-cell-wrap.dex-cell-routes .dex-modal-top {
  width: 100%;
  margin-bottom: 2px !important;
  flex-wrap: wrap;
}

.dex-cell-wrap.dex-cell-routes .dex-card-header {
  width: 100%;
  max-width: 100%;
}

/* Status Skipped (No Route, Chain N/A, EVM Only) - Abu-abu Netral */
.scanner-table>tbody>tr>td.col-dex.dex-td-skipped,
.scanner-table tbody td.col-dex.dex-td-skipped,
td.col-dex.dex-td-skipped {
  background-color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .scanner-table>tbody>tr>td.col-dex.dex-td-skipped,
[data-bs-theme="dark"] .scanner-table tbody td.col-dex.dex-td-skipped,
[data-bs-theme="dark"] td.col-dex.dex-td-skipped {
  background-color: #1e293b !important;
}

/* Status DELIST (Koin Delist / Pair Tidak Ditemukan) - Merah */
.scanner-table>tbody>tr>td.col-dex.dex-td-delist,
.scanner-table>tbody>tr.row-err-delist,
.scanner-table>tbody>tr.row-err-delist>td {
  background-color: #fee2e2 !important;
}

[data-bs-theme="dark"] .scanner-table>tbody>tr>td.col-dex.dex-td-delist,
[data-bs-theme="dark"] .scanner-table>tbody>tr.row-err-delist,
[data-bs-theme="dark"] .scanner-table>tbody>tr.row-err-delist>td {
  background-color: #450a0a !important;
}

/* Status LIMIT 429 (Rate Limit) - Oranye */
.scanner-table>tbody>tr>td.col-dex.dex-td-limited,
.scanner-table>tbody>tr.row-err-limited,
.scanner-table>tbody>tr.row-err-limited>td {
  background-color: #ffedd5 !important;
}

[data-bs-theme="dark"] .scanner-table>tbody>tr>td.col-dex.dex-td-limited,
[data-bs-theme="dark"] .scanner-table>tbody>tr.row-err-limited,
[data-bs-theme="dark"] .scanner-table>tbody>tr.row-err-limited>td {
  background-color: #431407 !important;
}

/* Status TIMEOUT / Abort - Ungu */
.scanner-table>tbody>tr>td.col-dex.dex-td-timeout,
.scanner-table>tbody>tr.row-err-timeout,
.scanner-table>tbody>tr.row-err-timeout>td {
  background-color: #f3e8ff !important;
}

[data-bs-theme="dark"] .scanner-table>tbody>tr>td.col-dex.dex-td-timeout,
[data-bs-theme="dark"] .scanner-table>tbody>tr.row-err-timeout,
[data-bs-theme="dark"] .scanner-table>tbody>tr.row-err-timeout>td {
  background-color: #3b0764 !important;
}

/* Status CEX / Network Error (HTTP 5xx / 403 / 451 / Failed Fetch) - Rose / Magenta */
.scanner-table>tbody>tr>td.col-dex.dex-td-cexerr,
.scanner-table>tbody>tr>td.col-dex.dex-td-error,
.scanner-table>tbody>tr.row-err-cexerr,
.scanner-table>tbody>tr.row-err-cexerr>td,
.scanner-table>tbody>tr.row-highlight-err,
.scanner-table>tbody>tr.row-highlight-err>td {
  background-color: #fce7f3 !important;
}

[data-bs-theme="dark"] .scanner-table>tbody>tr>td.col-dex.dex-td-cexerr,
[data-bs-theme="dark"] .scanner-table>tbody>tr>td.col-dex.dex-td-error,
[data-bs-theme="dark"] .scanner-table>tbody>tr.row-err-cexerr,
[data-bs-theme="dark"] .scanner-table>tbody>tr.row-err-cexerr>td,
[data-bs-theme="dark"] .scanner-table>tbody>tr.row-highlight-err,
[data-bs-theme="dark"] .scanner-table>tbody>tr.row-highlight-err>td {
  background-color: #500724 !important;
}

/* Status WALLET OFF (WD / DP Suspend) - Kuning Amber */
.scanner-table>tbody>tr>td.col-dex.dex-td-walletoff,
.scanner-table>tbody>tr.row-err-walletoff,
.scanner-table>tbody>tr.row-err-walletoff>td {
  background-color: #fef9c3 !important;
}

[data-bs-theme="dark"] .scanner-table>tbody>tr>td.col-dex.dex-td-walletoff,
[data-bs-theme="dark"] .scanner-table>tbody>tr.row-err-walletoff,
[data-bs-theme="dark"] .scanner-table>tbody>tr.row-err-walletoff>td {
  background-color: #422006 !important;
}

/* Status OB KOSONG / Rate N/A - Biru Sky */
.scanner-table>tbody>tr>td.col-dex.dex-td-obna,
.scanner-table>tbody>tr.row-err-obna,
.scanner-table>tbody>tr.row-err-obna>td {
  background-color: #e0f2fe !important;
}

[data-bs-theme="dark"] .scanner-table>tbody>tr>td.col-dex.dex-td-obna,
[data-bs-theme="dark"] .scanner-table>tbody>tr.row-err-obna,
[data-bs-theme="dark"] .scanner-table>tbody>tr.row-err-obna>td {
  background-color: #082f49 !important;
}

/* Accent garis kiri baris untuk membedakan jenis error secara instan */
.scanner-table>tbody>tr.row-err-delist>td:first-child {
  border-left: 3px solid #dc2626 !important;
}

.scanner-table>tbody>tr.row-err-limited>td:first-child {
  border-left: 3px solid #ea580c !important;
}

.scanner-table>tbody>tr.row-err-timeout>td:first-child {
  border-left: 3px solid #9333ea !important;
}

.scanner-table>tbody>tr.row-err-cexerr>td:first-child {
  border-left: 3px solid #db2777 !important;
}

.scanner-table>tbody>tr.row-err-walletoff>td:first-child {
  border-left: 3px solid #ca8a04 !important;
}

.scanner-table>tbody>tr.row-err-obna>td:first-child {
  border-left: 3px solid #0284c7 !important;
}

/* Compact Status Pill Badges (Info Pendek + Tooltip Detail Saat Hover) */
.scan-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
  line-height: 1.2;
}

.scan-badge-delist {
  background-color: #dc2626 !important;
  color: #ffffff !important;
  border: 1px solid #b91c1c;
}

.scan-badge-limited {
  background-color: #ea580c !important;
  color: #ffffff !important;
  border: 1px solid #c2410c;
}

.scan-badge-timeout {
  background-color: #9333ea !important;
  color: #ffffff !important;
  border: 1px solid #7e22ce;
}

.scan-badge-cexerr {
  background-color: #db2777 !important;
  color: #ffffff !important;
  border: 1px solid #be185d;
}

.scan-badge-walletoff {
  background-color: #f59e0b !important;
  color: #1f2937 !important;
  border: 1px solid #d97706;
}

.scan-badge-obna {
  background-color: #0284c7 !important;
  color: #ffffff !important;
  border: 1px solid #0369a1;
}

.scan-badge-noroute {
  background-color: #e2e8f0 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1;
}

[data-bs-theme="dark"] .scan-badge-noroute {
  background-color: #334155 !important;
  color: #cbd5e1 !important;
  border: 1px solid #475569;
}

/* Indikator ringan: DEX sedang cek quote ke server.
   Memakai pseudo-element + class di <body> (body.is-scanning), jadi NOL elemen DOM
   tambahan dan NOL timer/animasi — aman untuk tabel dengan ribuan sel. */
.dex-cell-wrap.dex-cell-waiting .dex-status-inner::after {
  content: "— NO DATA";
  margin-top: 3px;
  padding: 2px 6px;
  border: 1px dashed #cbd5e1;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: #94a3b8;
  white-space: nowrap;
}

body.is-scanning tr.row-scanning .dex-cell-wrap.dex-cell-waiting .dex-status-inner::after {
  content: "⏳ CHECK";
  background-color: #eef2ff;
  border-color: #a5b4fc;
  color: #4338ca;
  font-weight: 700;
}

[data-bs-theme="dark"] .dex-cell-wrap.dex-cell-waiting .dex-status-inner::after {
  border-color: #334155;
  color: #64748b;
}

[data-bs-theme="dark"] body.is-scanning tr.row-scanning .dex-cell-wrap.dex-cell-waiting .dex-status-inner::after {
  background-color: #1e1b4b;
  border-color: #6366f1;
  color: #c7d2fe;
}

/* Semua rute DEX berhasil didapat, tetapi disembunyikan oleh filter START */
.scan-badge-filtered {
  background-color: #fff7ed !important;
  color: #c2410c !important;
  border: 1px solid #fdba74;
}

[data-bs-theme="dark"] .scan-badge-filtered {
  background-color: #431407 !important;
  color: #fdba74 !important;
  border: 1px solid #9a3412;
}

.dex-cell-filtered {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

td.col-dex.dex-td-filtered,
td.col-dex:has(.dex-cell-filtered) {
  vertical-align: middle !important;
}

.dex-cell-wrap.dex-cell-filtered {
  justify-content: center;
  align-items: center;
}

.ob-box-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
}

.dex-status-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Wrapper dalam saat Skipped atau Error: Transparan & tanpa border nested agar warna TD memenuhi 100% sel */
.dex-cell-skipped,
.dex-cell-error {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Vertically center untuk semua sel DEX saat waiting, skipped, atau error */
td.col-dex.dex-td-waiting,
td.col-dex.dex-td-skipped,
td.col-dex.dex-td-error,
td.col-dex.dex-td-delist,
td.col-dex.dex-td-limited,
td.col-dex.dex-td-timeout,
td.col-dex.dex-td-cexerr,
td.col-dex.dex-td-walletoff,
td.col-dex.dex-td-obna,
td.col-dex:has(.dex-cell-waiting),
td.col-dex:has(.dex-cell-skipped),
td.col-dex:has(.dex-cell-error) {
  vertical-align: middle !important;
}

.dex-cell-wrap.dex-cell-waiting,
.dex-cell-wrap.dex-cell-skipped,
.dex-cell-wrap.dex-cell-error {
  justify-content: center;
  align-items: center;
}

.dex-card-error {
  background-color: #fef2f2 !important;
  border: 1px dashed #fca5a5 !important;
  border-radius: var(--radius-xs, 4px);
}

[data-bs-theme="dark"] .dex-card-error {
  background-color: #450a0a !important;
  border: 1px dashed #7f1d1d !important;
}

.venue-title,
.venue-title-mix,
.venue-title-lunar,
.venue-title-jumper,
.venue-title-leodex,
.venue-title-bungee,
.venue-title-okutrade,
.venue-title-debridge,
.venue-title-scrooge,
.venue-title-o1x {
  font-weight: 700;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.venue-title {
  color: var(--metax-color);
}

.venue-title-mix {
  color: var(--mix-color);
}

.venue-title-lunar {
  color: var(--lunar-color);
}

.venue-title-jumper {
  color: var(--jumper-color);
}

.venue-title-leodex {
  color: var(--leodex-color);
}

.venue-title-bungee {
  color: var(--bungee-color);
}

.venue-title-o1x {
  color: var(--o1x-color);
}

.badge-metax {
  background-color: var(--metax-color);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
}

.badge-mix {
  background-color: var(--mix-color);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
}

.badge-lunar {
  background-color: var(--lunar-color);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
}

.badge-jumper {
  background-color: var(--jumper-color);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
}

.badge-leodex {
  background-color: var(--leodex-color);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
}

.badge-okutrade {
  background-color: var(--okutrade-color);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
}

.venue-title-okutrade {
  color: var(--okutrade-color);
}

.text-dex-okutrade {
  color: var(--okutrade-color);
}

.badge-bungee {
  background-color: var(--bungee-color);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
}

.badge-debridge {
  background-color: var(--debridge-color);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
}

.venue-title-debridge {
  color: var(--debridge-color);
}

.badge-scrooge {
  background-color: var(--scrooge-color);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
}

.venue-title-scrooge {
  color: var(--scrooge-color);
}

.badge-o1x {
  background-color: var(--o1x-color);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
}

/* O1X abu-abu: di dark mode dinaikkan agar header & label tetap terbaca */
[data-bs-theme="dark"] {
  --o1x-color: #94a3b8;
}

/* Bungee hitam di light mode; tetap terbaca di dark mode */
[data-bs-theme="dark"] {
  --bungee-color: #e5e7eb;
}

[data-bs-theme="dark"] .badge-bungee {
  color: #111827;
}

.price-up {
  color: var(--profit-text);
  font-weight: 700;
  white-space: nowrap;
}

.price-down {
  color: var(--loss-text);
  font-weight: 700;
  white-space: nowrap;
}

.dex-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 2px;
}

.lightning-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  min-width: 17px;
  border-radius: 50%;
  border: 1.5px solid #22c55e;
  background: #f0fdf4;
  color: #eab308;
  font-size: 10px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  outline: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  user-select: none;
}

.lightning-btn:hover {
  transform: scale(1.18);
  background: #dcfce7;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.lightning-btn:active {
  transform: scale(0.95);
}

[data-bs-theme="dark"] .lightning-btn {
  background: #064e3b;
  border-color: #10b981;
  color: #fbbf24;
}

[data-bs-theme="dark"] .lightning-btn:hover {
  background: #047857;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.fee-wd {
  color: #2563eb;
  font-weight: 600;
  white-space: nowrap;
  font-size: 10.7px;
}

.fee-sw {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  font-size: 10.7px;
}

.fee-bruto-row {
  font-size: 10.7px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #111827;
  white-space: nowrap;
  margin-top: 1px;
  cursor: help;
}

.fee-bruto-val {
  color: #2563eb;
  font-weight: 700;
}

.fee-total-val {
  color: #dc2626;
  font-weight: 700;
}

[data-bs-theme="dark"] .fee-bruto-row {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .fee-bruto-val {
  color: #60a5fa;
}

[data-bs-theme="dark"] .fee-total-val {
  color: #f87171;
}

.dex-pnl-pill {
  margin-top: 3px;
  display: inline-block;
  padding: 1.5px 7px;
  border-radius: 9999px;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.dex-pnl-pill.pnl-pos {
  background-color: #f0fdf4;
  border: 1px solid #86efac;
  color: #16a34a;
}

.dex-pnl-pill.pnl-neg {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

[data-bs-theme="dark"] .dex-pnl-pill.pnl-pos {
  background-color: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

[data-bs-theme="dark"] .dex-pnl-pill.pnl-neg {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Worst-case PNL (minOut) — teks kecil di bawah pill PNL */
.dex-pnl-sub {
  margin-top: 1px;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dex-min-pos {
  color: #15803d;
}

.dex-min-neg {
  color: #b45309;
}

[data-bs-theme="dark"] .dex-min-pos {
  color: #4ade80;
}

[data-bs-theme="dark"] .dex-min-neg {
  color: #fbbf24;
}

/* Badge lingkaran verifikasi: ✓ terverifikasi / ✘ belum atau gagal */
.verify-dot {

  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-left: 1px;
  border: 1px solid;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
  user-select: none;

}

.vd-ok {
  background: #dcfce7;
  color: #15803d;
  border-color: #22c55e;
}

.vd-warn {
  background: #fef3c7;
  color: #b45309;
  border-color: #f59e0b;
}

.vd-fail {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #ef4444;
}

.vd-quote {
  background: #f1f5f9;
  color: #475569;
  border-color: #94a3b8;
}

.vd-pending {
  background: #fef3c7;
  color: #b45309;
  border-color: #f59e0b;
}

.vd-none {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

[data-bs-theme="dark"] .vd-ok {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.5);
}

[data-bs-theme="dark"] .vd-warn {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.5);
}

[data-bs-theme="dark"] .vd-fail {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.5);
}

[data-bs-theme="dark"] .vd-quote {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.45);
}

[data-bs-theme="dark"] .vd-pending {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.5);
}

[data-bs-theme="dark"] .vd-none {
  background: transparent;
  color: #f87171;
  border-color: #7f1d1d;
}

.pnl-pos {
  color: var(--profit-text);
  font-weight: 800;
  background-color: var(--profit-bg);
  border: 1px solid var(--profit-border);
  border-radius: var(--radius-xs);
  padding: 1px 4px;
  margin-top: 1px;
  display: inline-block;
  white-space: nowrap;
  font-size: 10.5px;
}

.pnl-neg {
  color: var(--loss-text);
  font-weight: 700;
  margin-top: 1px;
  white-space: nowrap;
  font-size: 10.5px;
}

/* Profit Route Card Highlight (Full-Height Column / Per-Side Seamless Fill) */
.dex-card-profit {
  background-color: var(--profit-bg) !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.dex-card.dex-card-profit:not(:last-child) {
  border-right-color: var(--profit-border);
}

/* --------------------------------------------------------------------------
   8. DETAIL TOKEN CELL (.detail-token-card)
   -------------------------------------------------------------------------- */
.detail-token-card {
  padding: 2px 4px;
  line-height: 1.24;
  text-align: center;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Row 1: CEX on Chain */
.detail-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12.5px;
}

.detail-cex-name,
.detail-chain-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 48%;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid transparent;
  text-decoration: none !important;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.detail-cex-name:hover,
.detail-chain-name:hover {
  opacity: 0.9;
  transform: translateY(-0.5px);
}

.detail-badge-img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 2px;
}

.detail-cex-name {
  color: color-mix(in srgb, var(--cex-brand, #2563eb) 85%, #000);
  background: color-mix(in srgb, var(--cex-brand, #2563eb) 12%, transparent);
  border-color: color-mix(in srgb, var(--cex-brand, #2563eb) 35%, transparent);
}

.detail-chain-name {
  color: color-mix(in srgb, var(--chain-brand, #0ea5e9) 85%, #000);
  background: color-mix(in srgb, var(--chain-brand, #0ea5e9) 12%, transparent);
  border-color: color-mix(in srgb, var(--chain-brand, #0ea5e9) 35%, transparent);
}

.detail-on {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Row 2: Action Row (#Index, Edit, Trash, Star) */
.detail-action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 1px 0;
}

.detail-index-badge {
  background-color: var(--border-contrast);
  color: #ffffff;
  font-weight: 800;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 20px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-icon {
  font-size: 13px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.action-icon:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* DEX Modal Header (Requirement 2) */
.dex-modal-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-bottom: 2px;
  line-height: 1.25;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: transparent !important;
  border: none !important;
}

.dex-modal-set {
  color: #111827;
  font-weight: 800;
}

[data-bs-theme="dark"] .dex-modal-set {
  color: #f8fafc;
}

/* Label "MODAL" di depan nominal — hanya pada sel yang belum ada hasil scan.
   Hilang otomatis saat quote masuk karena card hasil memakai .dex-modal-top polos. */
.dex-modal-label {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

[data-bs-theme="dark"] .dex-modal-label {
  color: #64748b;
}

.dex-modal-sep {
  color: var(--text-muted);
  opacity: 0.55;
  font-weight: 500;
}

.dex-modal-actual-ok {
  color: #15803d;
  font-weight: 800;
}

[data-bs-theme="dark"] .dex-modal-actual-ok {
  color: #4ade80;
}

.dex-modal-actual-warn {
  color: #ea580c;
  font-weight: 800;
}

[data-bs-theme="dark"] .dex-modal-actual-warn {
  color: #fb923c;
}

.badge-metax-modal {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background-color: rgba(249, 115, 22, 0.12);
  color: #070707;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.badge-lunar-modal {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background-color: rgba(16, 185, 129, 0.12);
  color: #070707;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-jumper-modal {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background-color: rgba(180, 155, 218, 0.22);
  color: #070707;
  border: 1px solid rgba(180, 155, 218, 0.55);
}

.badge-leodex-modal {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background-color: rgba(245, 158, 11, 0.2);
  color: #070707;
  border: 1px solid rgba(245, 158, 11, 0.55);
}

[data-bs-theme="dark"] .badge-leodex-modal {
  color: #fef3c7;
  background-color: rgba(245, 158, 11, 0.25);
}

/* Modal Aktual Sesuai Orderbook (Bersebelahan dengan Modal Setting) */
.badge-actual-modal-warning {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background-color: #fef08a;
  color: #854d0e;
  border: 1px solid #eab308;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.badge-actual-modal-success {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background-color: rgba(16, 185, 129, 0.15);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.45);
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

[data-bs-theme="dark"] .badge-actual-modal-warning {
  background-color: rgba(234, 179, 8, 0.25);
  color: #fde047;
  border-color: #facc15;
}

[data-bs-theme="dark"] .badge-actual-modal-success {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: #10b981;
}

/* Row 3 & 4: Token and Pair Lines (Requirement 3) */
.detail-coin-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  flex-wrap: nowrap;
}

.detail-coin-line>.badge,
.detail-coin-line>.detail-info-icon,
.detail-coin-line>.detail-wallet-hash,
.detail-coin-line>.status-wd-ok,
.detail-coin-line>.status-dp-ok,
.detail-coin-line>.status-wd-bad,
.detail-coin-line>.status-dp-bad {
  flex-shrink: 0;
}

.detail-coin-symbol {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-coin-symbol:hover {
  color: var(--chain-color, var(--brand-primary));
  opacity: 0.85;
  text-decoration: underline;
}

.detail-info-icon {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.75;
  transition: all 0.15s ease;
}

.detail-info-icon:hover {
  color: var(--brand-primary);
  opacity: 1;
  transform: scale(1.18);
}

.detail-cg-icon,
.detail-okx-icon {
  margin-left: 0;
}

.detail-cg-icon:hover svg {
  filter: drop-shadow(0 0 2px rgba(141, 198, 63, 0.8));
}

.detail-okx-icon:hover img {
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.detail-mini-cmc,
.detail-mini-cg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  font-size: 7.5px;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  vertical-align: -1.5px;
}

.detail-mini-cmc {
  background: #175ceb;
}

.detail-mini-cg {
  background: #8DC63F;
}

.agg-pill-btn {
  cursor: pointer;
}

.settings-chain-badges {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.settings-chain-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.03em;
}

.settings-chain-badge.is-evm {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.settings-chain-badge.is-sol {
  background: rgba(139, 92, 246, 0.15);
  color: #6d28d9;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

[data-bs-theme="dark"] .settings-chain-badge.is-evm {
  color: #93c5fd;
}

[data-bs-theme="dark"] .settings-chain-badge.is-sol {
  color: #c4b5fd;
}

/* Locking visual state saat scanning berlangsung:
   - Header Main Menu (#btnHeaderMenu) terkunci sehingga semua submenu tidak dapat diakses
   - Tabel: Hanya icon edit [data-action="edit"] yang dikunci.
   - Icon hapus [data-action="delete"] dan bintang [data-action="fav"] TETAP AKTIF! */
#btnHeaderMenu.disabled,
#btnHeaderMenu:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

.scan-active-locked .action-icon[data-action="edit"] {
  opacity: 0.25 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Koin yang sudah selesai dipindai: gear edit tetap bisa diklik walau scan masih jalan. */
.scan-active-locked tr.coin-scan-done .action-icon[data-action="edit"] {
  opacity: 0.85 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

.scan-active-locked tr.coin-scan-done .action-icon[data-action="edit"]:hover {
  opacity: 1 !important;
  color: #0d6efd !important;
  transform: scale(1.2);
}

/* Dropdown START tetap terbuka saat scan, tetapi semua input di dalamnya terkunci. */
.scan-control-dropdown.scan-inputs-locked input:disabled,
.scan-control-dropdown.scan-inputs-locked select:disabled,
.scan-control-dropdown.scan-inputs-locked textarea:disabled,
.scan-control-dropdown.scan-inputs-locked button:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.scan-active-locked .action-icon[data-action="delete"],
.scan-active-locked .action-icon[data-action="fav"] {
  opacity: 0.85 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

.scan-active-locked .action-icon[data-action="delete"]:hover {
  opacity: 1 !important;
  color: #dc2626 !important;
  transform: scale(1.2);
}

.scan-active-locked .action-icon[data-action="fav"]:hover {
  opacity: 1 !important;
  color: #eab308 !important;
  transform: scale(1.2);
}

#thSortDetail.scan-active-locked {
  cursor: not-allowed !important;
  opacity: 1 !important;
  background-color: #172554 !important;
  pointer-events: none !important;
}

.detail-coin-line .status-wd-ok,
.detail-coin-line .status-dp-ok,
.detail-coin-line .status-wd-bad,
.detail-coin-line .status-dp-bad {
  font-size: 11.5px;
  font-weight: 800;
  padding: 1px 4px;
  line-height: 1.2;
}

.detail-coin-line .detail-wallet-hash {
  color: var(--brand-primary);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  padding: 0 1px;
}

.detail-coin-line .detail-wallet-hash:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.detail-pair-link {
  font-size: 13.5px;
  font-weight: 900;
  color: var(--brand-primary);
  padding: 0 4px;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.detail-pair-link:hover {
  background: var(--brand-primary-subtle);
  color: var(--brand-primary-hover);
}

/* Row 4 & 5: WD/DP and Token Information */
.detail-token-info-row,
.detail-pair-info-row {
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.detail-token-link {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 800;
}

.detail-token-link:hover {
  text-decoration: underline;
}

.status-wd-ok,
.status-dp-ok {
  color: var(--profit-text);
  font-weight: 800;
  padding: 0 3px;
  border-radius: var(--radius-xs);
  background: var(--profit-bg);
  text-decoration: none;
}

.status-wd-bad,
.status-dp-bad {
  color: var(--loss-text);
  font-weight: 800;
  padding: 0 3px;
  border-radius: var(--radius-xs);
  background: var(--loss-bg);
  text-decoration: none;
}

.detail-wallet-hash {
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  padding: 0 2px;
}

.detail-wallet-hash:hover {
  text-decoration: underline;
}

/* Row 6: Aggregator Pills (Baris 1: OKX JMX BNG | Baris 2: OKU DFL DZP) */
.agg-pills-rows {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
}

.agg-pills-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-wrap: nowrap;
}

.agg-pill {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs, 4px);
  text-decoration: none !important;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}


.agg-pill-coklat {
  color: #000000 !important;
  border: 1px solid #92400e;
  background-color: #d6b99a;
}

.agg-pill-coklat:hover {
  background-color: #f9f1ea;
  border-color: #78350f;
  transform: translateY(-1px);
}

.agg-pill-pink {
  color: #831843 !important;
  border: 1px solid #f9a8d4;
  background-color: #fce7f3;
}

.agg-pill-pink:hover {
  background-color: #fbcfe8;
  border-color: #db2777;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   9. SIDEBAR: SINYAL SELISIH (LIVE PROFIT FEED)
   -------------------------------------------------------------------------- */
.sidebar-signal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 86px);
  overflow: hidden;
}

.sidebar-header {
  padding: 8px 12px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border-contrast);
  flex-shrink: 0;
}

.sidebar-header .badge {
  font-size: 11px;
}

.sidebar-header #btnClearSignals,
.sidebar-header #btnSortSignals {
  color: #94a3b8 !important;
  font-size: 13.5px;
  opacity: 0.85;
  transition: all 0.15s ease;
}

.sidebar-header #btnClearSignals:hover,
.sidebar-header #btnSortSignals:hover {
  color: #f8fafc !important;
  opacity: 1;
}

.sidebar-header #btnSortSignals.sort-pnl-active {
  color: #fbbf24 !important;
  opacity: 1;
}

/* Live PNL+ Filter Bar (Header Tabel Sinyal) */
.signal-pnl-filter-bar {
  background: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.signal-pnl-filter-bar.pnl-filter-active {
  background: rgba(16, 185, 129, 0.1);
  border-bottom-color: rgba(16, 185, 129, 0.4);
}

.signal-pnl-filter-bar .form-switch {
  padding-left: 0 !important;
  min-height: auto;
}

.signal-pnl-filter-bar .form-check-input {
  float: none !important;
  margin: 0 !important;
  cursor: pointer;
  width: 1.85em;
  height: 1em;
}

.signal-pnl-input {
  width: 48px !important;
  height: 22px !important;
  padding: 0 3px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-align: center !important;
  border-radius: var(--radius-xs) !important;
  border: 1px solid var(--border-default) !important;
  background-color: var(--bg-surface) !important;
  color: #15803d !important;
}

.signal-pnl-input::placeholder {
  font-weight: 500;
  opacity: 0.55;
}

[data-bs-theme="dark"] .signal-pnl-filter-bar {
  background: #0f172a;
  border-bottom-color: #334155;
}

[data-bs-theme="dark"] .signal-pnl-filter-bar.pnl-filter-active {
  background: rgba(16, 185, 129, 0.14);
  border-bottom-color: rgba(52, 211, 153, 0.45);
}

[data-bs-theme="dark"] .signal-pnl-input {
  background-color: #1e293b !important;
  border-color: #475569 !important;
  color: #4ade80 !important;
}

.signal-list-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden !important;
  min-height: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-surface-subtle);
}

.signal-item {
  flex-shrink: 0 !important;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-left: 3.5px solid var(--profit-border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  max-width: 100%;
}

.btn-signal-lightning {
  border: none;
  background: transparent;
  color: #eab308;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-signal-lightning:hover {
  background: transparent;
  color: #facc15;
  transform: scale(1.25);
  filter: drop-shadow(0 0 6px rgba(234, 179, 8, 0.7));
}

.text-route-cex {
  color: #2563eb;
  font-weight: 700;
}

[data-bs-theme="dark"] .text-route-cex {
  color: #60a5fa;
}

.text-route-dex {
  font-weight: 700;
}

/* Jumper: Ungu */
.text-dex-jumper {
  color: #9333ea;
}

[data-bs-theme="dark"] .text-dex-jumper {
  color: #c084fc;
}

/* Bungee: Pink */
.text-dex-bungee {
  color: #db2777;
}

[data-bs-theme="dark"] .text-dex-bungee {
  color: #f472b6;
}

/* deBridge: Kuning Emas */
.text-dex-debridge {
  color: #ca8a04;
}

[data-bs-theme="dark"] .text-dex-debridge {
  color: #facc15;
}

/* Scrooge: Hijau Emerald */
.text-dex-scrooge {
  color: #059669;
}

[data-bs-theme="dark"] .text-dex-scrooge {
  color: #34d399;
}

/* O1X: Abu-abu */
.text-dex-o1x {
  color: #475569;
}

[data-bs-theme="dark"] .text-dex-o1x {
  color: #cbd5e1;
}

/* MetaMask / MetaX: Orange */
.text-dex-metax,
.text-dex-metamask {
  color: #ea580c;
}

[data-bs-theme="dark"] .text-dex-metax,
[data-bs-theme="dark"] .text-dex-metamask {
  color: #fb923c;
}

/* MIX (Lunar + O1X): Teal */
.text-dex-mix {
  color: #0d9488;
}

[data-bs-theme="dark"] .text-dex-mix {
  color: #2dd4bf;
}

/* Lunar: Ijo (Hijau) */
.text-dex-lunar {
  color: #059669;
}

[data-bs-theme="dark"] .text-dex-lunar {
  color: #34d399;
}

/* LeoDex: Coklat */
.text-dex-leodex {
  color: #9a3412;
}

[data-bs-theme="dark"] .text-dex-leodex {
  color: #ea580c;
}

/* Default Fallback DEX */
.text-dex-default {
  color: #d97706;
}

[data-bs-theme="dark"] .text-dex-default {
  color: #fbbf24;
}

.signal-item:hover {
  border-color: var(--brand-primary);
  border-left-color: var(--profit-text);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.signal-item-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.signal-item-title>span:first-child {
  min-width: 0;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}

.signal-item-title strong {
  color: var(--text-primary);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  min-width: 0;
}

.signal-item-pnl {
  flex-shrink: 0;
  font-weight: 800;
  color: var(--profit-text);
  background: var(--profit-bg);
  border: 1px solid var(--profit-border);
  padding: 1.5px 6px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.signal-dir-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.3px;
}

.sig-c2d {
  background: #2563eb;
  color: #ffffff;
}

.sig-d2c {
  background: #d97706;
  color: #ffffff;
}

.signal-route-box {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default) !important;
  transition: background-color 0.15s ease;
}

.signal-prices-block {
  border-color: var(--border-default) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-bs-theme="dark"] .signal-prices-block {
  background: rgba(0, 0, 0, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .signal-route-box {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.brand-badge {
  color: #ffffff !important;
  background: color-mix(in srgb, var(--brand, #64748b) 85%, #000) !important;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
}

.signal-item-meta {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   10. MODALS DESIGN & REFINEMENTS
   -------------------------------------------------------------------------- */
.modal-content {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background-color: var(--bg-surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 10px 16px;
  background: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border-default);
}

.modal-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.modal-body {
  padding: 16px;
}

.modal-footer {
  padding: 10px 16px;
  background: var(--bg-surface-subtle);
  border-top: 1px solid var(--border-default);
}

.modal .form-control,
.modal .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border-default);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
}

.modal .form-control:focus,
.modal .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-primary-subtle);
}

/* Settings Modal Specifics */
#settingsModal .modal-dialog {
  max-width: 1120px;
}

.settings-section-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.settings-section-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-field-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
}

.settings-num-input {
  font-size: 11.5px !important;
  font-weight: 600;
  padding: 4px 8px !important;
  height: 28px;
}

.btn-pill-group .btn {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 9px;
  line-height: 1.35;
}

.settings-agg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.settings-agg-row:hover {
  border-color: var(--border-default);
  background: var(--bg-surface);
}

.settings-agg-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  margin: 0;
}

.settings-agg-code {
  min-width: 24px;
  text-align: center;
  font-size: 10.5px !important;
  padding: 2px 4px !important;
}

.settings-route-group .btn {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  line-height: 1.35;
}

/* Chain Toggles (2-Col Compact Grid Matching CEX Tiles) */
.settings-chain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.chain-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--brand, var(--brand-primary)) !important;
  border-radius: var(--radius-sm);
  margin-bottom: 0;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}

.chain-toggle-row:hover {
  border-color: var(--brand, var(--brand-primary));
  background: color-mix(in srgb, var(--brand, var(--brand-primary)) 6%, var(--bg-surface));
}

.chain-toggle-row.is-disabled {
  opacity: 0.55;
  background: var(--bg-surface);
}

.chain-toggle-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.chain-toggle-name {
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chain-toggle-wrap {
  flex-shrink: 0;
  padding-left: 2.1em;
  min-height: auto;
}

.chain-toggle-wrap .form-check-input {
  margin-top: 0;
  cursor: pointer;
}

.chain-logo-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

/* CEX Cards in Settings */
.cex-settings-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  margin-bottom: 6px;
  padding: 2px 2px 4px;
  border-bottom: 1px dashed var(--border-default);
}

.cex-card-box {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  border-left: 3.5px solid var(--brand, var(--brand-primary)) !important;
  border-radius: var(--radius-md);
  padding: 8px 10px;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
}

.cex-card-box:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.cex-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.cex-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-weight: 800;
  font-size: 12.5px;
}

.cex-mode-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 5px;
  line-height: 1.1;
}

.cex-logo-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.cex-api-note {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cex-api-inputs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cex-api-inputs .form-control-sm {
  font-size: 11.5px;
  padding: 3px 7px;
}

.cex-public-note {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-xs);
  padding: 4px 7px;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Master-Detail Compact CEX API Settings Layout */
.cex-compact-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 10px;
  margin: 3px 0;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  border-left: 3.5px solid var(--brand, var(--brand-primary)) !important;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.cex-compact-tile:hover {
  border-color: var(--brand, var(--brand-primary));
  background: color-mix(in srgb, var(--brand, var(--brand-primary)) 6%, var(--bg-surface));
}

.cex-compact-tile.is-selected {
  border-color: var(--brand, var(--brand-primary));
  background: color-mix(in srgb, var(--brand, var(--brand-primary)) 12%, var(--bg-surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand, var(--brand-primary)) 45%, transparent);
}

.cex-compact-tile.is-disabled {
  opacity: 0.55;
  cursor: default;
  background: var(--bg-surface);
}

.cex-compact-tile.is-disabled:hover {
  border-color: var(--border-default);
  background: var(--bg-surface);
}

.cex-api-editor-panel.is-empty {
  border-style: dashed;
  border-top-width: 1.5px;
  border-color: var(--border-default);
}

.cex-editor-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.cex-tile-main {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.cex-tile-name {
  font-weight: 800;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cex-tile-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1.5px 5px;
  line-height: 1.1;
  flex-shrink: 0;
}

.cex-tile-switch {
  flex-shrink: 0;
  padding-left: 2.1em;
  min-height: auto;
}

.cex-tile-switch .form-check-input {
  margin-top: 0;
  cursor: pointer;
}

.cex-api-editor-panel {
  background: var(--bg-surface-subtle);
  border: 1.5px solid color-mix(in srgb, var(--brand, var(--brand-primary)) 45%, var(--border-default));
  border-top: 3px solid var(--brand, var(--brand-primary));
  border-radius: var(--radius-md);
  padding: 8px 10px;
  transition: border-color 0.15s ease;
}

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

.cex-editor-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 12px;
}

.btn-xs-clean {
  font-size: 10px;
  font-weight: 600;
  padding: 1.5px 7px;
  line-height: 1.3;
  border-radius: var(--radius-xs);
}

.cex-editor-note {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 4px 7px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.3;
}

.cex-editor-fields {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cex-editor-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cex-editor-field label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0;
}

.cex-editor-field .form-control-sm {
  font-size: 11px;
  padding: 3px 7px;
  height: 27px;
}

/* Single-Tab Remote Scan Lock Banner */
.remote-scan-lock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.14), rgba(234, 88, 12, 0.08));
  border: 1.5px solid rgba(245, 158, 11, 0.55);
  color: #92400e;
  font-size: 12px;
  line-height: 1.3;
  box-shadow: var(--shadow-sm);
}

.remote-scan-lock-banner .remote-lock-icon {
  font-size: 16px;
  color: #d97706;
  flex-shrink: 0;
}

.remote-scan-lock-banner .remote-lock-sub {
  font-size: 11px;
  opacity: 0.9;
}

.remote-scan-lock-banner #btnStopRemoteScan {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

[data-bs-theme="dark"] .remote-scan-lock-banner {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.2), rgba(234, 88, 12, 0.12));
  border-color: rgba(251, 191, 36, 0.5);
  color: #fde68a;
}

[data-bs-theme="dark"] .remote-scan-lock-banner .remote-lock-icon {
  color: #fbbf24;
}

/* Arbitrage Capital Modal (Dropdown CEX & Chain dengan Icon & Warna Brand) */
.arb-modal-header,
.arb-modal-footer {
  background-color: var(--bg-surface-subtle);
}

.arb-target-card {
  background: var(--bg-surface-subtle);
  border-color: var(--border-default) !important;
}

.arb-dd-btn {
  font-weight: 700;
  font-size: 12.5px;
  background-color: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-primary);
  cursor: pointer;
}

.arb-dd-btn.has-brand {
  color: var(--brand, var(--text-primary));
  border-left: 3px solid var(--brand, var(--brand-primary));
}

.arb-dd-menu {
  max-height: 230px;
  overflow-y: auto;
  padding: 4px;
  font-size: 12.5px;
}

.arb-dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 6px;
  font-weight: 700;
  color: var(--brand, var(--text-primary));
}

.arb-dd-item:hover,
.arb-dd-item:focus {
  background-color: color-mix(in srgb, var(--brand, #2563eb) 10%, var(--bg-surface));
  color: var(--brand, var(--text-primary));
}

.arb-dd-item.active {
  background-color: color-mix(in srgb, var(--brand, #2563eb) 16%, var(--bg-surface));
  color: var(--brand, var(--text-primary));
}

.arb-dd-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
}

.arb-dd-bicon {
  font-size: 13px;
  color: var(--brand, var(--brand-primary));
  flex-shrink: 0;
}

.arb-table-head {
  background-color: var(--bg-surface-subtle);
}

.arb-dex-row {
  text-transform: uppercase;
  border-left: 3px solid var(--dex-brand, var(--brand-primary));
}

.arb-dex-name {
  color: var(--dex-brand, var(--text-primary)) !important;
  font-size: 12.5px;
  white-space: nowrap;
}

.arb-dex-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--dex-brand, var(--brand-primary));
  margin-right: 7px;
  vertical-align: middle;
}

[data-bs-theme="dark"] .arb-dd-item:hover,
[data-bs-theme="dark"] .arb-dd-item.active {
  background-color: color-mix(in srgb, var(--brand, #38bdf8) 22%, #0f172a);
}

/* Wallet Update CEX Picker (Tampil Penuh Tanpa Scroll Vertikal) */
.wallet-cex-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: none;
  overflow: visible;
}

.wallet-cex-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--border-default);
  border-left: 3.5px solid var(--brand, var(--brand-primary));
  border-radius: var(--radius-sm);
  background: var(--bg-surface-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 0;
}

.wallet-cex-item-body {
  min-width: 0;
  overflow: hidden;
}

.wallet-cex-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 3px;
}

.wallet-cex-item:hover:not(.is-disabled) {
  border-color: var(--brand-primary);
  background: var(--brand-primary-subtle);
}

.wallet-cex-item.is-disabled {
  opacity: 0.58;
  cursor: not-allowed;
  background: var(--bg-subtle, rgba(0, 0, 0, 0.02));
}

.wallet-cex-item-name {
  display: block;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-cex-item-meta {
  display: block;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-cex-item-meta.is-ready {
  color: var(--profit-text);
  font-weight: 600;
}

.wallet-cex-item-meta.is-missing {
  color: var(--loss-text);
}

/* Wallet Update Status Log & Scrollable Overflow di Sisi Kanan */
.wallet-update-log-box {
  max-height: 200px;
  min-height: 110px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bs-tertiary-bg, #f8fafc);
  border: 1px solid var(--bs-border-color, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  padding: 6px 10px;
  font-size: 11.5px;
}

.wallet-idle-box {
  min-height: 230px;
  background: var(--bs-tertiary-bg, #f8fafc);
  border-color: var(--bs-border-color, #e2e8f0) !important;
  border-radius: var(--radius-sm, 8px);
}

@media (min-width: 768px) {
  .border-end-md {
    border-right: 1px solid var(--bs-border-color, #e2e8f0) !important;
  }
}

.wallet-update-log-box::-webkit-scrollbar {
  width: 5px;
}

.wallet-update-log-box::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 4px;
}

.wallet-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--bs-border-color-translucent, rgba(0, 0, 0, 0.06));
  gap: 8px;
}

.wallet-log-item:last-child {
  border-bottom: none;
}

.wallet-summary-card {
  background: var(--bs-body-bg, #ffffff);
  border: 1px solid var(--bs-border-color, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  padding: 8px 10px;
  margin-top: 6px;
}

/* Wallet Freeze Overlay saat update berlangsung */
.wallet-freeze-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(1.5px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm, 8px);
  transition: all 0.2s ease;
}

[data-bs-theme="dark"] .wallet-freeze-overlay {
  background: rgba(15, 23, 42, 0.85);
}

/* Scanner Table Freeze Overlay saat ganti filter CEX/Chain */
.table-freeze-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
  pointer-events: all;
}

[data-bs-theme="dark"] .table-freeze-overlay {
  background: rgba(15, 23, 42, 0.82);
}

.table-freeze-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: var(--radius-lg, 14px);
  padding: 24px 36px;
  min-width: 340px;
  max-width: 90%;
  pointer-events: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .table-freeze-card {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.25);
}

.table-freeze-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.table-freeze-desc {
  font-size: 13.5px;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   11. RESPONSIVENESS (MOBILE, TABLET, DESKTOP)
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  .scanner-table {
    min-width: 1240px;
  }
}

@media (max-width: 991.98px) {
  .scanner-signal-pane {
    width: clamp(165px, 26vw, 220px);
    min-width: 160px;
  }

  .top-bar .header-toolbar {
    width: auto;
    margin-top: 0;
  }

  .table-toolbar {
    gap: 6px;
  }
}

@media (max-width: 767.98px) {
  main.container-fluid {
    padding: 6px 6px 6px 6px !important;
  }

  .scanner-main-split {
    gap: 6px;
  }

  .scanner-signal-pane {
    width: clamp(145px, 34vw, 185px);
    min-width: 140px;
  }

  .top-bar .container-fluid {
    padding-left: 8px;
    padding-right: 8px;
  }

  .brand-pill {
    font-size: 13px;
  }

  .brand-logo-img {
    width: 18px;
    height: 18px;
  }

  /* Table Toolbar Compact Scrollable Horizontal di Layar Kecil agar tidak memakan tinggi layar */
  .table-toolbar {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 6px !important;
    padding-bottom: 2px;
  }

  .table-toolbar>div {
    flex-shrink: 0;
  }

  .table-search-pill {
    height: 30px;
  }

  .table-search-input {
    width: 105px !important;
    font-size: 12px;
  }

  .table-toolbar-vr {
    display: none;
  }

  .scanner-table {
    min-width: 1180px;
  }

  .scanner-table thead th {
    font-size: 10px;
    padding: 6px 4px;
  }

  /* Sidebar Action Toolbar Mobile */
  .sidebar-top-bar {
    flex-wrap: nowrap;
    gap: 2px;
    overflow-x: auto;
  }

  .wallet-cex-list {
    grid-template-columns: 1fr;
  }
}

/* Mobile Scroll Hint & Floating Signals Button */
.mobile-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface-subtle);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  margin-bottom: 6px;
  text-align: center;
}

/* Header Signal Quick Button */
.btn-header-signal {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 700;
  height: 30px;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-header-signal:hover {
  background-color: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #10b981;
  transform: translateY(-1px);
}

.btn-header-signal:active {
  transform: translateY(0);
}

.btn-header-signal.has-signals {
  background-color: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

[data-bs-theme="dark"] .btn-header-signal {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

[data-bs-theme="dark"] .btn-header-signal:hover {
  background-color: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}

[data-bs-theme="dark"] .btn-header-signal.has-signals {
  background-color: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #34d399;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* Sidebar sinyal sekarang selalu berada di sisi kanan pada semua ukuran layar */
.btn-header-signal {
  display: none !important;
}

@keyframes pulseSignalCard {
  0% {
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.7);
  }

  50% {
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.7);
  }

  100% {
    box-shadow: 0 0 0 rgba(16, 185, 129, 0);
  }
}

.signal-card-highlight {
  animation: pulseSignalCard 1.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   FORM EDITOR KOIN MODAL (Mockup & Referensi Gambar 2)
   ========================================================================== */
/* ==========================================================================
   FORM EDITOR KOIN MODAL - CLEAN & CONSISTENT DESIGN
   ========================================================================== */
.form-editor-modal {
  border-top: 4px solid var(--accent-orange, #ea580c) !important;
  border-radius: var(--radius-md, 8px) !important;
  overflow: hidden;
}

.section-step-block {
  position: relative;
}

.section-step-header {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.section-step-number {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-xs, 4px);
  background-color: var(--brand-primary, #2563eb);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-step-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  letter-spacing: 0.02em;
}

.section-step-card {
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
}

/* Network & Exchanger Selects - Clean, Konsisten, Border Halus */
.network-pill-select,
.exchanger-pill-select {
  border: 1px solid var(--border-default, #cbd5e1) !important;
  border-radius: var(--radius-sm, 6px) !important;
  font-weight: 700 !important;
  color: var(--text-primary, #0f172a) !important;
  padding: 4px 24px 4px 10px !important;
  background-color: var(--bg-surface, #ffffff) !important;
  background-position: right 8px center;
  font-size: 12px !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.network-pill-select:focus,
.exchanger-pill-select:focus {
  border-color: var(--brand-primary, #2563eb) !important;
  box-shadow: 0 0 0 2px var(--brand-primary-subtle, rgba(37, 99, 235, 0.15)) !important;
}

/* Pembungkus Kolom Token & Pair - Tanpa Border Box Pemisah */
.coin-group-card {
  border: none !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Input Form Editor - Input Jelas dengan Border Standar dan Radius Halus (6px) */
.pill-input {
  border-radius: var(--radius-sm, 6px) !important;
  border: 1px solid var(--border-default, #cbd5e1) !important;
  background-color: var(--bg-surface, #ffffff) !important;
  padding: 5px 10px !important;
  font-size: 12px !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pill-input:focus {
  border-color: var(--brand-primary, #2563eb) !important;
  box-shadow: 0 0 0 2px var(--brand-primary-subtle, rgba(37, 99, 235, 0.15)) !important;
  outline: none !important;
}

/* Input modal arbitrase di dalam tabel - Jelas terlihat sebagai inputan (bukan teks biasa) */
.modal-table-input {
  border: 1px solid var(--border-default, #cbd5e1) !important;
  border-radius: var(--radius-xs, 4px) !important;
  background-color: var(--bg-surface, #ffffff) !important;
  padding: 4px 6px !important;
  font-size: 12px !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal-table-input:hover {
  border-color: #94a3b8 !important;
}

.modal-table-input:focus {
  background-color: #ffffff !important;
  border-color: var(--brand-primary, #2563eb) !important;
  box-shadow: 0 0 0 2px var(--brand-primary-subtle, rgba(37, 99, 235, 0.15)) !important;
  outline: none !important;
}

.quick-pair-btn {
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 1px 8px !important;
  border-radius: var(--radius-xs, 4px) !important;
  border: 1px solid var(--border-default, #cbd5e1) !important;
  color: var(--text-secondary, #334155) !important;
  background-color: var(--bg-surface, #ffffff) !important;
  transition: all 0.15s ease;
}

.quick-pair-btn:hover {
  background-color: var(--brand-primary, #2563eb) !important;
  border-color: var(--brand-primary, #2563eb) !important;
  color: #ffffff !important;
}

/* Dark mode overrides for modal */
[data-bs-theme="dark"] .form-editor-modal {
  background-color: #1e293b !important;
}

[data-bs-theme="dark"] .section-step-card {
  background-color: transparent !important;
  border: none !important;
}

[data-bs-theme="dark"] .coin-group-card {
  background-color: transparent !important;
  border: none !important;
}

[data-bs-theme="dark"] .section-step-title {
  color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .pill-input {
  background-color: #1e293b !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

[data-bs-theme="dark"] .network-pill-select,
[data-bs-theme="dark"] .exchanger-pill-select {
  background-color: #1e293b !important;
  color: #60a5fa !important;
  border-color: #475569 !important;
}

[data-bs-theme="dark"] .modal-table-input {
  background-color: #1e293b !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

[data-bs-theme="dark"] .modal-table-input:hover {
  background-color: #334155 !important;
  border-color: #64748b !important;
}

[data-bs-theme="dark"] .modal-table-input:focus {
  background-color: #0f172a !important;
  border-color: #3b82f6 !important;
}

/* ==========================================================================
   HEADER STAR ALL FILTER BUTTON (Abaikan CEX & Chain)
   ========================================================================== */
.dataset-mode-btn {
  border: none !important;
  color: var(--text-secondary, #64748b) !important;
  background: transparent !important;
  cursor: pointer;
}

.dataset-mode-btn:hover {
  color: var(--text-primary, #0f172a) !important;
}

.dataset-mode-btn.active {
  background: #ffffff !important;
  color: var(--text-primary, #0f172a) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

[data-bs-theme="dark"] .dataset-mode-btn.active {
  background: #334155 !important;
  color: #f8fafc !important;
}

.btn-filter-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 26px;
  min-width: 28px;
  padding: 0 7px;
  border-radius: var(--radius-full);
  border: 1.5px solid #cbd5e1;
  background-color: #ffffff;
  color: #94a3b8;
  font-size: 13px;
  transition: all 0.18s ease;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-filter-star:hover {
  background-color: #fef9c3;
  border-color: #eab308;
  color: #ca8a04;
  transform: scale(1.08);
}

.btn-filter-star.active {
  background-color: #fef08a !important;
  border-color: #eab308 !important;
  color: #ca8a04 !important;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.45);
}

.star-filter-badge {
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
}

[data-bs-theme="dark"] .dataset-mode-btn {
  border: none !important;
  color: var(--text-secondary, #64748b) !important;
  background: transparent !important;
  cursor: pointer;
}

.dataset-mode-btn:hover {
  color: var(--text-primary, #0f172a) !important;
}

.dataset-mode-btn.active {
  background: #ffffff !important;
  color: var(--text-primary, #0f172a) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

[data-bs-theme="dark"] .dataset-mode-btn.active {
  background: #334155 !important;
  color: #f8fafc !important;
}

.btn-filter-star {
  background-color: #1e293b;
  color: #64748b;
  border-color: #334155;
}

[data-bs-theme="dark"] .btn-filter-star:hover {
  background-color: rgba(234, 179, 8, 0.2);
  color: #facc15;
}

[data-bs-theme="dark"] .btn-filter-star.active {
  background-color: rgba(234, 179, 8, 0.25) !important;
  border-color: #facc15 !important;
  color: #fde047 !important;
}

/* ============================================================
   Statistik Koin Modal Styles (Pie Charts per CEX / Network)
   ============================================================ */
.stats-head-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.btn-stats-toggle {
  border: none !important;
  background: transparent !important;
  color: var(--bs-secondary-color) !important;
  padding: 5px 12px !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  font-size: 11.5px !important;
  transition: all 0.18s ease !important;
}

.btn-stats-toggle.active {
  background: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35) !important;
}

.stats-grid-wrap {
  min-height: 280px;
  max-height: 72vh;
  overflow-y: auto;
  padding: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.stats-grid.stats-grid-3col {
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}

.stats-card-favorite {
  border: 1.5px solid #f59e0b !important;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.04) 0%, rgba(245, 158, 11, 0.01) 100%) !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12) !important;
}

[data-bs-theme="dark"] .stats-card-favorite {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, rgba(30, 41, 59, 0.8) 100%) !important;
  border-color: #d97706 !important;
}

.stats-card {
  background: var(--bs-body-bg, #ffffff);
  border: 1px solid var(--bs-border-color, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stats-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.stats-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--bs-border-color, #e2e8f0);
}

.stats-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.stats-card-body {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.stats-card-body svg {
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.stats-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  flex: 1;
  min-width: 120px;
}

.stats-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.stats-swatch {
  width: 9px;
  height: 9px;
  border-radius: 2.5px;
  flex-shrink: 0;
}

.stats-empty {
  color: var(--bs-secondary-color);
  font-size: 13px;
  padding: 40px 20px;
  text-align: center;
  grid-column: 1 / -1;
}

/* Mini icon 6 DEX terdaftar di samping nama Meta-Aggregator pada Pengaturan */
.settings-agg-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.settings-core-dex-icons {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  flex-wrap: wrap;
}

.settings-core-dex-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  height: 15px;
  border-radius: 3px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  border: 1px solid transparent;
  user-select: none;
}

.settings-core-dex-pill.is-native {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
}

[data-bs-theme="dark"] .settings-core-dex-pill.is-native {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35);
}

.settings-core-dex-pill.is-missing {
  background: transparent;
  color: var(--bs-secondary-color);
  border-color: var(--bs-border-color);
  border-style: dashed;
  opacity: 0.45;
}

/* Mini icon 6 DEX di header kolom tabel Meta-Aggregator */
.th-dex-inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1.15;
}

.th-core-dex-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.th-core-dex-img {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #ffffff;
  flex-shrink: 0;
}

.settings-core-dex-img {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  border: 1px solid rgba(16, 185, 129, 0.5);
  background: #ffffff;
  flex-shrink: 0;
}

.settings-core-dex-img.is-missing {
  opacity: 0.28;
  filter: grayscale(100%);
  border-color: var(--bs-border-color);
}

.th-sol-sep,
.settings-sol-sep {
  display: inline-block;
  width: 1px;
  height: 11px;
  background: rgba(148, 163, 184, 0.45);
  margin: 0 1.5px;
}

.th-core-dex-dflow,
.settings-core-dex-dflow,
.th-core-dex-titan,
.settings-core-dex-titan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
  background: #7c3aed;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.th-core-dex-titan,
.settings-core-dex-titan {
  background: #0ea5e9;
}

.settings-core-dex-dflow,
.settings-core-dex-titan {
  width: 15px;
  height: 15px;
}

.th-core-dex-pill {
  display: inline-flex;
  align-items: center;
  padding: 0 3px;
  height: 13px;
  border-radius: 2.5px;
  font-size: 7.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.th-core-dex-pill.is-native {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.45);
}

.th-core-dex-pill.is-missing {
  background: transparent;
  color: rgba(255, 255, 255, 0.42);
  border-color: rgba(255, 255, 255, 0.22);
  border-style: dashed;
}

/* Skip layout/paint untuk baris tabel di luar viewport saat scroll panjang */
.scanner-table tbody tr {
  content-visibility: auto;
  contain-intrinsic-size: 130px;
}