/* ==========================================================================
   MULTIPLUS-SCANNER — Flat Minimalist Design System
   ========================================================================== */

:root {
    /* — Semantic colors (strict config synchronization) — */
    --bs-primary: #3b82f6;
    --bs-secondary: #64748b;
    --bs-success: #10b981;
    --bs-danger: #ef4444;
    --bs-warning: #f59e0b;
    --bs-info: #06b6d4;
    --bs-light: #f8fafc;
    --bs-dark: #0f172a;

    /* — Surface palette (Modern Neutral - Soft Slate) — */
    --surface-0: #ffffff;
    --surface-1: #f8fafc;
    --surface-2: #f1f5f9;
    --surface-3: #e2e8f0;
    --bg-main: #f1f5f9;

    /* — Border — */
    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;
    --border-focus: var(--bs-primary);

    /* — Shadows (Premium Depth) — */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.15);

    /* — Accent — */
    --accent-width: 3px;
    --accent-color: var(--bs-primary);

    /* — Radii (Uniform 12px Style) — */
    --radius-xs: 12px;
    --radius-sm: 12px;
    --radius-md: 12px;
    --radius-lg: 12px;

    /* — Typography — */
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 13px;
    --font-size-md: 14px;

    /* — Spacing (Tightened) — */
    --space-1: 3px;
    --space-2: 6px;
    --space-3: 10px;
    --space-4: 14px;
}

/* ==========================================================================
   Toolbar Icon Buttons
   ========================================================================== */
.toolbar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    transition: var(--transition-smooth);
    text-decoration: none !important;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-left: 6px;
    vertical-align: middle;
    cursor: pointer;
}

.toolbar-icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    filter: brightness(1.1);
}

.toolbar-icon-btn:active {
    transform: translateY(0);
}

.toolbar-icon-btn span[uk-icon] {
    color: #fff !important;
}

.toolbar-icon-btn .icon {
    width: 24px;
    height: 24px;
}


/* ==========================================================================
   Base Styles - Flat Minimal Design
   ========================================================================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    padding: 0;
    background-color: var(--surface-1);
    color: #0f172a;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    font-size: var(--font-size-base);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

/* Override system dark mode preference */
@media (prefers-color-scheme: dark) {
    body:not(.dark-mode) {
        background-color: #f8fafc !important;
        color: #0f172a !important;
    }
}

a {
    text-decoration: none;
    color: var(--bs-primary);
    transition: var(--transition-smooth);
}

a:hover {
    text-decoration: none;
    opacity: 0.8;
}

/* ==========================================================================
   Flat Card Components — Zero shadow, accent border pattern
   ========================================================================== */

.header-card,
#scanner-config,
#filter-card,
#token-management {
    background: var(--surface-0) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: none !important;
    transition: var(--transition-smooth);
}

.editor-modal-wide {
    width: 620px !important;
    max-width: 95vw !important;
}

/* Header card: accent top + left untuk hierarki visual */
.header-card {
    padding: 6px 12px !important;
    border-top: var(--accent-width) solid var(--accent-color) !important;
    border-left: var(--accent-width) solid var(--accent-color) !important;
    border-radius: var(--radius-sm) !important;
}

/* Scanner config: accent left tipis */
#scanner-config {
    border-left: var(--accent-width) solid var(--surface-3) !important;
}

/* Hover: hanya border color berubah, NO transform, NO shadow */
.header-card:hover,
#scanner-config:hover,
#filter-card:hover,
.header-card:hover,
#scanner-config:hover,
#filter-card:hover {
    border-color: var(--border-strong) !important;
    background: var(--surface-0) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* ==========================================================================
   Table Styles - Flat Design
   ========================================================================== */
#monitoring-scroll {
    max-height: calc(100vh - 220px);
    background: var(--surface-0) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: none !important;
    overflow: auto;
}


/* Table column widths */
.th-orderbook {
    width: auto !important;
    min-width: 140px;

    color: var(--bs-primary) !important;
}

/* DETAIL column - Sticky for better horizontal navigation */
.th-detail {
    width: 230px !important;
    min-width: 230px !important;
    max-width: 230px !important;
    position: sticky;
    top: 0 !important;
    left: 140px;
    /* Offset by left orderbook width */
    z-index: 12 !important;
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-right: 2px solid var(--border-strong) !important;
}

.td-detail {
    width: 230px !important;
    min-width: 230px !important;
    max-width: 230px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    vertical-align: top !important;
    position: sticky;
    left: 140px;
    z-index: 11;
    background: var(--surface-0);
    border-right: 2px solid var(--border-color) !important;
    box-shadow: 4px 0 8px -4px rgba(0, 0, 0, 0.05);
}

.th-orderbook:first-child {
    position: sticky;
    left: 0;
    z-index: 12;
}

.td-orderbook:first-child {
    position: sticky;
    left: 0;
    z-index: 11;
}

.th-dex {
    width: 115px !important;
    min-width: 115px;
    border-left: 1px solid var(--border-color) !important;
}

.td-dex {
    width: auto !important;
    min-width: 130px;
    white-space: nowrap;
    border-left: 1px solid var(--border-color) !important;
}

.td-orderbook {
    min-width: 100px;
    border-left: 2px solid color-mix(in srgb, var(--theme-accent) 30%, #e2dcd0) !important;
    border-right: 2px solid color-mix(in srgb, var(--theme-accent) 30%, #e2dcd0) !important;
    background: #ffefd9 !important;
}


/* Orderbook scrollable content */
.td-orderbook .orderbook-wrap {
    display: inline-block;
    max-width: clamp(160px, 16vw, 220px);
}

.td-orderbook .orderbook-scroll {
    /* max-height: 110px; */
    /* Dihapus untuk menghilangkan scroll */
    padding: 2px;
    scrollbar-width: thin;
}

.td-orderbook .orderbook-scroll::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.td-orderbook .orderbook-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

#tabel-monitoring {
    min-width: 1640px;
    /* Total: 8 DEX x 115px (920px) + 2 ORDERBOOK x 160px (220px) + 1 DETAIL x 255px (255px) + borders/padding */
    table-layout: auto;
}

.monitor-line {
    display: block;
    white-space: nowrap;
}

.detail-line {
    display: block;
    margin: 3px 2px;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: nowrap;

}

.detail-index-badge {
    min-width: 22px;
    height: 18px;
    padding: 0 5px;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    vertical-align: middle;
    background-color: #000000;
}

.dex-price-link {
    text-decoration: none;
}

.dark-mode .dex-price-link:hover {
    text-decoration: underline;
}

/* DEX status styling */
.dex-slot-empty {
    background-color: #f1f3f6;
    text-align: center;
    vertical-align: middle;
    color: #94a3b8;
    border-radius: var(--radius-sm);
    padding: 4px;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.td-dex strong,
.multi-sub strong {
    display: inline-block;
    white-space: nowrap;
    font-size: 11px;
}

.dex-status {
    display: inline-block;
    max-width: 100%;
}

.dex-status .badge {
    margin: 0 2px;
    padding: 2px 6px;
    line-height: 1;
    font-size: 11px;
    border-radius: 12px;
}

.dex-error {
    background-color: #fee2e2 !important;
    border: 2px solid #fca5a5 !important;
}

.dex-skip {
    background-color: #e6e6e4 !important;
}

.row-hidden {
    display: none !important;
}

/* ==========================================================================
   Form Controls - Rounded & Glass Effect
   ========================================================================== */
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select,
button {
    border-radius: 12px !important;
    transition: var(--transition-smooth);
    background: #ffffff;
    border: 1px solid var(--border-color);
    font-weight: 500;

    /* Compact Sizing */
    min-height: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
    padding: 0 8px !important;
    line-height: 22px !important;
    width: 70px;
    /* Allow utility classes or natural width */
}

/* Fix width for buttons in modals, dialogs, and toasts */
.modal button,
.flat-dialog-box button,
.toast button {
    width: auto !important;
}

/* Settings action buttons - Allow full width for text */
#btn-save-setting,
#btn-cancel-setting {
    width: auto !important;
    min-width: auto !important;
    height: auto !important;
    min-height: auto !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    white-space: nowrap;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: var(--shadow-focus);
}

input[type="checkbox"] {
    border-radius: 12px !important;
    /* Modern Rounded Style */
    accent-color: var(--bs-primary);
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-top: -2px;
}

input[type="radio"] {
    border-radius: 50% !important;
    accent-color: var(--bs-primary);
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-top: -2px;
}

/* --- Input Width Utilities --- */
.w-5ch {
    width: 65px !important;
    min-width: 65px !important;
}

.w-3ch {
    width: 50px !important;
    min-width: 50px !important;
}

.w-2ch {
    width: 40px !important;
    min-width: 40px !important;
}

.w-sc {
    width: 140px !important;
    min-width: 140px !important;
}

.w-auto {
    width: auto !important;
}

.w-full {
    width: 100% !important;
}

/* --- Compact Select --- */
select.form-select-sm {
    /* padding-right: 20px !important; */
    background-position: right 4px center !important;
    background-size: 10px 10px !important;
}

.btn-group {
    gap: 4px;
}

/* ==========================================================================
   Scanner Form Controls - Standardized Layout
   ========================================================================== */
.scanner-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: bold;
    font-size: 14px;
    line-height: 1.4;
}

.scanner-label input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.scanner-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    border-radius: 12px;
    transition: background-color 0.2s ease;
}

.scanner-control:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.scanner-control input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

.scanner-control input[type="checkbox"]:checked {
    accent-color: var(--bs-success);
}

.scanner-control span {
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.scanner-control-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.scanner-control-inline input {
    height: 28px;
    font-size: 13px;
}

/* Auto Volume Level Input - Enhanced style */
#autoVolLevelInput input {
    font-weight: bold;
    text-align: center;
    border-width: 2px;
    transition: all 0.2s ease;
}

#autoVolLevelInput input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Scanner Form - Compact spacing between groups */
#FormScanner {
    gap: 6px !important;
}

/* Reduce spacing specifically between SCANNER and AUTO groups */
#FormScanner .scanner-label+.scanner-label {
    margin-left: -2px;
}

.scanner-actions {
    display: inline-flex;
}

.scanner-actions .btn {
    height: 28px;
    line-height: 28px;
    padding: 0 12px;
    font-size: 13px;
}

/* Force START button green */
#startSCAN {
    background: var(--bs-success) !important;
    border: 1px solid var(--bs-success) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    width: 120px !important;
}

#startSCAN:hover:not(.disabled):not([disabled]) {
    background: #15803d !important;
    border-color: #15803d !important;
    box-shadow: none !important;
}

#stopSCAN {
    background: var(--bs-danger) !important;
    border: 1px solid var(--bs-danger) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    width: auto;
}

#stopSCAN:hover:not(.disabled):not([disabled]) {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
    box-shadow: none !important;
}

.toggle-radio.active {
    background-color: var(--bs-success);
    color: #fff;
    font-weight: 700;
    box-shadow: none;
}

/* ── Sort Pill Toggle (Scanner) ────────────────────────────────── */
.sort-pill-group {
    display: inline-flex;
    align-items: center;
    /* background: rgba(0, 0, 0, 0.06); */
    border-radius: 20px;
    padding: 0px;
    gap: 1px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.sort-pill {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 16px;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    color: #888;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    -webkit-user-select: none;
    user-select: none;
    letter-spacing: 0.02em;
    line-height: 1.5;
    margin: 0;
}

.sort-pill i {
    font-size: 12px;
    transition: transform 0.15s ease;
    pointer-events: none;
}

.sort-pill span {
    pointer-events: none;
}

.sort-pill.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4) !important;
    font-weight: 700;
}

.sort-pill.active i {
    transform: scale(1.15);
}

.sort-pill:not(.active):hover {
    color: #444 !important;
    background: rgba(0, 0, 0, 0.07) !important;
    box-shadow: none !important;
}

body.dark-mode .sort-pill-group {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .sort-pill {
    color: #888;
}

body.dark-mode .sort-pill:not(.active):hover {
    color: #ddd !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .sort-pill.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4) !important;
}

/* ==========================================================================
   Icons & Interactive Elements
   ========================================================================== */
.icon {
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.12s ease;
    opacity: 0.8;
}

.icon:hover {
    transform: scale(1.1);
    transform-origin: center center;
    opacity: 1;
}

.toolbar-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
}

.toolbar-scroll .icon {
    flex: 0 0 auto;
}

/* Chain running indicator */
.chain-link {
    position: relative;
}

#multichain_scanner {
    position: relative;
    display: inline-block;
}

.run-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bs-success);
    border: 2px solid #ffffff;
    box-shadow: none;
    z-index: 2;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

/* ==========================================================================
   Progress Bar - Flat
   ========================================================================== */
#progress-container {
    width: 100%;
    background: var(--surface-3);
    border-radius: 12px;
    margin-top: 8px;
    overflow: hidden;
    box-shadow: none;
}

#progress-bar {
    position: relative;
    height: 10px;
    width: 0%;
    border-radius: 12px;
    background: var(--theme-accent, var(--bs-success));
    background-image: linear-gradient(45deg,
            rgba(255, 255, 255, 0.15) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.15) 75%,
            transparent 75%,
            transparent);
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite;
    box-shadow: none;
    overflow: hidden;
    transition: width 0.3s ease;
}

#progress-text {
    color: white;
    text-align: center;
    line-height: 10px;
    display: block;
    font-weight: 700;
    font-size: 9px;
    letter-spacing: 0.4px;
}

@keyframes progress-bar-stripes {
    0% {
        background-position: 1rem 0;
    }

    100% {
        background-position: 0 0;
    }
}

/* ==========================================================================
   Signal Cards - Glassmorphism
   ========================================================================== */

/* Wrapper tiap card: flex column agar card bisa stretch penuh setinggi baris */
#sinyal-container>div {
    display: flex;
    flex-direction: column;
}

/* Card mengisi penuh wrapper-nya */
#sinyal-container .signal-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Body card mengisi sisa ruang di bawah header */
#sinyal-container .signal-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#sinyal-container .signal-card_content {
    min-height: 20px;
    padding: 6px 4px;
    gap: 2px;
}

.signal-no-data-text {
    color: #e53935 !important;
    font-size: 13px !important;
}

.signal-card {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: none;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.signal-card:hover {
    box-shadow: none;
    border-color: var(--border-strong) !important;
    transform: none;
}

.signal-card-header {
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.signal-card-header .btn {
    color: #ffffff !important;
}

.signal-card-header .signal-label-text {
    font-size: 14px !important;
}

.signal-card-body {
    color: #111827 !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
}

.signal-card__header {
    min-height: 30px;
}

.signal-card__body {
    padding-top: 6px !important;
    padding-bottom: 8px !important;
}

.signal-card__content {
    font-size: 13.5px;
    line-height: 1.35;
    word-break: break-word;
}


/* ==========================================================================
   Modals - covered by Bootstrap compat layer (.modal-content / .modal-header)
   ========================================================================== */

/* Modern scrollbar — global */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 12px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.6);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
}

/* ==========================================================================
   Loading Overlays - REMOVED (Using AppOverlay from overlay-manager.js)
   ========================================================================== */
/* #pageLoadingOverlay - REMOVED: Replaced by AppOverlay.show() */
/* #loadingOverlay - REMOVED: Replaced by AppOverlay.show() */

/* ==========================================================================
   Floating Scroll Button - Flat Design
   ========================================================================== */
#btn-scroll-top {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    background: var(--bs-success);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    z-index: 2000;
    box-shadow: none;
    transition: var(--transition-smooth);
}

#btn-scroll-top:hover {
    background: #059669;
}

/* ==========================================================================
   Onboarding Callouts
   ========================================================================== */
.cta-settings {
    background: #e53935 !important;
    border: 2px solid #b71c1c !important;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2);
    transform: scale(1.35) !important;
    animation: pulse-cta 1.2s infinite;
}

.cta-sync {
    background: #ffebee !important;
    border: 2px solid #e53935 !important;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2);
    transform: scale(1.35) !important;
    animation: pulse-cta 1.2s infinite;
}

/* Icon menu with red blinking background when data is missing */
.icon-alert-missing {
    position: relative;
    animation: blink-red-bg 1.5s ease-in-out infinite !important;
}

.icon-alert-missing::before {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    bottom: -4px;
    left: -4px;
    background: rgba(229, 57, 53, 0.4);
    border-radius: 50%;
    z-index: -1;
    animation: pulse-red-bg 1.5s ease-in-out infinite;
}

@keyframes pulse-cta {
    0% {
        box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(229, 57, 53, 0.35);
    }

    100% {
        box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2);
    }
}

@keyframes blink-red-bg {

    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(229, 57, 53, 0.8));
    }

    50% {
        filter: drop-shadow(0 0 16px rgba(229, 57, 53, 1));
    }
}

@keyframes pulse-red-bg {

    0%,
    100% {
        background: rgba(229, 57, 53, 0.3);
        transform: scale(1);
    }

    50% {
        background: rgba(229, 57, 53, 0.6);
        transform: scale(1.1);
    }
}

.cta-highlight {
    outline: 2px dashed #ff9800;
    outline-offset: 3px;
    border-radius: 12px;
}


.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ==========================================================================
   SYNC MODAL - Compact Styling
   ========================================================================== */
#sync-modal .table td,
#sync-modal .table th {
    font-size: 12px;
    padding: 4px 6px;
}

/* Compact modal header */
#sync-modal .modal-header {
    padding: 10px 16px !important;
}

#sync-modal .modal-header h4 {
    font-size: 18px;
    margin-bottom: 0;
}

#sync-modal .modal-header .text-muted {
    font-size: 11px;
}

/* Compact modal body */
#sync-modal .modal-body {
    padding: 10px 16px !important;
    overflow-y: auto;
}

/* Hide all modal close (X) buttons globally */
.modal .btn-close {
    display: none !important;
}

/* Filter toolbar above table — all controls in ONE horizontal line */
#sync-modal .font-11.d-flex.flex-wrap {
    font-size: 10px !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    overflow-x: auto;
    white-space: nowrap;
}

/* Override global .form-check-label (13px) for sync filter bar */
#sync-modal .font-11 .form-check-label {
    font-size: 10px !important;
    line-height: 1.2;
    margin-bottom: 0;
    white-space: nowrap;
}

#sync-modal .font-11 .form-check-input {
    width: 12px;
    height: 12px;
}

#sync-modal .font-11 .form-check-inline {
    margin-right: 0 !important;
    padding-left: 16px;
}

#sync-modal .font-11 .fw-bold.text-muted {
    font-size: 10px;
    white-space: nowrap;
}

#sync-modal .font-11>.opacity-25 {
    font-size: 10px;
    line-height: 1;
}

/* Compact snapshot info section */
#sync-modal .modal-body>.d-flex.small {
    margin-bottom: 6px !important;
    font-size: 11px;
}

/* Compact cards inside modal */
#sync-modal .card-body {
    padding: 10px 12px;
}

/* Compact headings */
#sync-modal h6 {
    font-size: 12px;
    margin-top: 4px !important;
    margin-bottom: 4px !important;
}

/* Compact filter containers */
#sync-modal #sync-filter-cex,
#sync-modal #sync-filter-pair {
    max-height: 120px;
    gap: 4px;
}

/* Compact DEX config list - 1 DEX per row */
#sync-modal #sync-dex-config {
    max-height: calc(95vh - 340px);
    gap: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#sync-modal .sync-dex-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

#sync-modal .sync-dex-row:hover {
    background-color: #f8fafc;
}

#sync-modal .sync-dex-row:last-child {
    border-bottom: none;
}

/* Filter Harga & Wallet CEX side by side */
#sync-modal .sync-filter-row {
    display: flex;
    flex-direction: row;
    gap: 16px;
    margin-bottom: 8px;
}

#sync-modal .sync-filter-row>div {
    flex: 1;
}

#sync-modal .sync-filter-row h6 {
    margin-top: 0 !important;
    margin-bottom: 4px !important;
}

/* Labels inside modal - larger font for readability */
#sync-modal label {
    font-size: 13px;
}

/* Compact radio buttons for filters */
#sync-modal input[type="radio"],
#sync-modal input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

/* Compact inputs in DEX config */
#sync-modal input.form-control-sm,
#sync-modal select.form-select-sm {
    height: 24px;
    padding: 2px 6px;
    font-size: 11px;
}

/* Compact table container */
#sync-modal .overflow-auto {
    max-height: 50vh;
}

/* Compact badge */
#sync-modal .badge {
    font-size: 10px;
    padding: 2px 6px;
}

/* Compact non-config section */
#sync-modal #sync-non-config {
    padding: 6px 8px;
}

#sync-modal #sync-non-config h6 {
    font-size: 11px;
}

#sync-modal #sync-non-config .my-1 {
    margin-top: 4px !important;
    margin-bottom: 4px !important;
}

#sync-modal #sync-non-config label {
    font-size: 10px;
}

/* Compact footer */
#sync-modal .modal-footer {
    padding: 8px 16px !important;
}

#sync-modal .modal-footer .btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

/* Compact grid gaps */
#sync-modal .row.g-2 {
    margin-left: -12px;
}

#sync-modal .row.g-2>* {
    padding-left: 12px;
}

/* Compact table */
#sync-table {
    table-layout: fixed;
    /* Enforce alignment */
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#sync-table thead th {
    font-size: 11px;
    padding: 8px 10px;
    background-color: #f0506e !important;
    color: white !important;
    vertical-align: middle;
    border: none;
    white-space: nowrap;
}

/* Specific column widths for sync-table */
#sync-table th:nth-child(1),
#sync-table td:nth-child(1) {
    width: 45px;
    text-align: center;
}

#sync-table th:nth-child(2),
#sync-table td:nth-child(2) {
    width: 40px;
    text-align: center;
}

#sync-table th:nth-child(3),
#sync-table td:nth-child(3) {
    width: 65px;
}

#sync-table th:nth-child(4),
#sync-table td:nth-child(4) {
    width: 100px;
    /* Increased for CEX name + SNAPSHOT badge */
}

#sync-table th:nth-child(5),
#sync-table td:nth-child(5) {
    width: 85px;
}

#sync-table th:nth-child(6),
#sync-table td:nth-child(6) {
    width: 110px;
    /* Increased for WD|DP status */
    text-align: center;
}

#sync-table th:nth-child(7),
#sync-table td:nth-child(7) {
    width: 130px;
    text-align: right;
}

#sync-table tbody td {
    font-size: 11px;
    padding: 6px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    white-space: normal;
    word-break: break-word;
}

/* Striped rows — override Bootstrap default for sync table */
#sync-table>tbody>tr:nth-child(odd) {
    background-color: #ffffff !important;
}

#sync-table>tbody>tr:nth-child(even) {
    background-color: #f8fafc !important;
}

#sync-table>tbody>tr:hover {
    background-color: #eff6ff !important;
}

/* Saved row styling - fixing white text on pink issue */
#sync-table tbody tr.saved-row {
    background-color: #f0fdf4 !important;
    /* Very light green */
    color: #1a1a1a !important;
}

#sync-table tbody tr.saved-row:hover {
    background-color: #dcfce7 !important;
}

#sync-table tbody tr.snapshot-row {
    background-color: #fff !important;
}

#sync-table tbody tr.snapshot-row:hover {
    background-color: #f8fafc !important;
}

/* Sync Table Sorting Support */
#sync-table thead th.sync-sortable {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background-color 0.2s ease;
}

#sync-table thead th.sync-sortable:hover {
    background-color: #e83860 !important;
}

#sync-table .sync-sort-indicator {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.font-11 {
    font-size: 11px;
}

.mono {
    font-family: 'Roboto Mono', monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ==========================================================================
   Bulk Modal Editor (Profil Editor Modal) - 3-Column Grid Layout
   ========================================================================== */

/* Modal dialog: sized to fit columns comfortably */
#bulk-modal-editor .modal-dialog {
    width: min(900px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
}

/* When MetaDEX visible: expand to fit */
#bulk-modal-editor.has-meta-dex-active .modal-dialog {
    width: min(1060px, calc(100vw - 24px));
}

#bulk-modal-editor .modal-header {
    padding: 10px 16px !important;
}

#bulk-modal-editor .modal-title {
    font-size: 15px;
    font-weight: 700;
}

#bulk-modal-editor .text-muted {
    font-size: 11px;
}

#bulk-modal-editor .modal-body {
    padding: 10px 14px !important;
}

#bulk-modal-editor .alert {
    padding: 7px 12px;
    margin-bottom: 10px;
}

#bulk-modal-editor .alert p {
    font-size: 12px;
}

/* ─── 3-column CSS Grid ─────────────────────────────────────────────────── */
/* Default (no META-DEX): 2 columns - filter + dex */
/* ═══════════════════════════════════════════════════════════════════════════
   BME — Bulk Modal Editor (redesigned)
   ══════════════════════════════════════════════════════════════════════════ */
.bme-dialog {
    width: 900px;
    max-width: 98vw;
    border-radius: 12px !important;
}

/* Empty state placeholder spans both DEX columns */
.bme-dex-list .bme-empty-hint {
    grid-column: 1 / -1;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 20px;
}

/* Header */
.bme-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #fdfdfd;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.bme-title {
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: 0.02em;
}

.bme-subtitle {
    font-size: 10px;
    color: #64748b;
    margin-left: 8px;
    background: #e2e8f0;
    padding: 1px 6px;
    border-radius: 12px;
    font-weight: 600;
}

/* Body */
.bme-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Profile top bar */
.bme-profile-top {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.bme-chain-lbl {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 800;
    font-size: 10px;
    cursor: pointer;
    padding: 1px 6px;
    border-radius: 10px;
    transition: all 0.2s;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #475569;
}


.bme-chain-lbl:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.bme-chain-lbl:has(input:checked) {
    background: #fff;
    border-color: var(--active-color, #3b82f6);
    box-shadow: 0 0 0 1px var(--active-color, #3b82f6), 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bme-chain-lbl:focus-visible {
    outline: 2px solid var(--active-color, #3b82f6);
    outline-offset: 2px;
}

.bme-chain-lbl.bme-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
    background: #f1f5f9;
}

.bme-chain-radio-wrap input[type="radio"] {
    margin: 0;
    width: 12px;
    height: 12px;
}

.bme-profile-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bme-profile-select-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 12px;
    border-left: 2px solid #cbd5e1;
    margin-left: auto;
}

.bme-row-label {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}

.bme-select {
    font-size: 11px !important;
    height: 26px !important;
    padding: 0 6px !important;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
}

/* Profile bar */
.bme-profile-bar {
    display: flex;
    gap: 6px;
    align-items: center;
}

.bme-profile-select {
    width: 160px;
    font-size: 13px !important;
    height: 26px !important;
    padding: 0 8px !important;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-weight: 600;
}

.bme-profile-name {
    flex: 1;
    font-size: 13px !important;
    height: 32px !important;
    padding: 0 10px !important;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    outline: none;
    font-weight: 600;
}

.bme-profile-name:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px #dbeafe;
}

.bme-btn {
    font-size: 10px !important;
    font-weight: 700;
    height: 26px !important;
    padding: 0 10px !important;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.bme-btn-save {
    background: #16a34a;
    color: #fff;
}

.bme-btn-save:hover {
    background: #15803d;
}

.bme-btn-delete {
    background: #ef4444;
    color: #fff;
}

.bme-btn-delete:hover {
    background: #dc2626;
}

.bme-btn-apply {
    background: #2563eb;
    color: #fff;
}

.bme-btn-apply:hover {
    background: #1d4ed8;
}

.bme-btn-close {
    font-size: 12px !important;
    height: 32px !important;
    padding: 0 20px !important;
    font-weight: 700;
    border: 1px solid #e2e8f0;
}

/* Global KIRI row */
.bme-kiri-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #eff6ff;
    border-radius: 12px;
    border-left: 3px solid #2563eb;
}

.bme-kiri-input {
    width: 80px;
    font-size: 12px !important;
    height: 26px !important;
    padding: 0 6px !important;
    border: 1px solid #93c5fd;
    border-radius: 12px;
    text-align: center;
    font-weight: 700;
    color: #1e40af;
}

.bme-kiri-hint {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

/* Chain row: horizontal full-width bar */
.bme-chain-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    flex-wrap: wrap;
}

.bme-chain-row-label {
    font-size: 11px;
    font-weight: 800;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Chain cards: horizontal chips */
.bme-chain-cards {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0;
}

.bme-chain-cards .bme-chain-lbl {
    width: auto;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    gap: 5px;
}

.bme-chain-cards .bme-chain-radio-wrap input[type="radio"],
.bme-chain-cards input[type="radio"] {
    width: 12px;
    height: 12px;
}

/* Content row: DEX 2-kolom + MetaDEX 1-kolom */
.bme-content-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

/* DEX panel: takes remaining space, 2-column grid inside */
.bme-dex-panel {
    flex: 1;
    min-width: 0;
    background: #fcfcfc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.bme-meta-panel {
    width: 220px;
    flex-shrink: 0;
    background: #fafaff;
    border: 1px solid #e9d5ff;
    border-radius: 12px;
    overflow: hidden;
}

.bme-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.bme-meta-panel .bme-panel-header {
    background: #f3e8ff;
    border-bottom-color: #e9d5ff;
}

.bme-panel-title {
    font-size: 11px;
    font-weight: 800;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bme-meta-title {
    color: #7c3aed;
}

.bme-all-dex-lbl {
    font-size: 10px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
}

/* DEX list: 2-column grid */
.bme-dex-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 6px;
    max-height: 380px;
    overflow-y: auto;
}

.bme-dex-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.bme-dex-label {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    min-width: 100px;
}

.bme-dex-name {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.bme-dex-fields {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.bme-kiri-lbl {
    font-size: 10px;
    color: #2563eb;
    font-weight: 800;
    white-space: nowrap;
}

.bme-kanan-lbl {
    font-size: 10px;
    color: #d97706;
    font-weight: 800;
    white-space: nowrap;
}

.bme-dex-input {
    width: 48px !important;
    height: 24px !important;
    font-size: 13px !important;
    padding: 0 4px !important;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #cbd5e1;
    font-weight: 700;
}

.bulk-dex-left {
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.bulk-dex-right {
    border: 1px solid #fcd34d;
    color: #92400e;
}

/* MetaDEX grid: vertical list */
.bme-meta-grid {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bme-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e9d5ff;
}

.bme-meta-name {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bme-meta-fields {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 2px;
}

.bme-meta-lbl {
    font-size: 11px;
    font-weight: 800;
}

.bme-meta-input {
    width: 68px !important;
    height: 28px !important;
    font-size: 14px !important;
    padding: 0 6px !important;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #ddd6fe;
    background: #fff;
    color: #5b21b6;
    font-weight: 800;
}

.bme-meta-input {
    width: 46px !important;
    height: 20px !important;
    font-size: 10px !important;
    padding: 0 3px !important;
    border: 1px solid #e9d5ff;
    border-radius: 12px;
    text-align: center;
}

.bme-empty-hint {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    padding: 16px 0;
    margin: 0;
    font-style: italic;
}

/* Footer */
.bme-footer {
    padding: 6px 14px;
    border-top: 1px solid #e2e8f0;
    text-align: right;
    background: #f8fafc;
}

#bulk-dex-inputs .card:last-child {
    margin-bottom: 0 !important;
}

/* ─── Inputs ─────────────────────────────────────────────────────────────── */
#bulk-modal-editor .form-control,
#bulk-modal-editor .form-select {
    height: 26px;
    font-size: 12px;
    padding: 2px 6px;
}

#bulk-modal-editor input[type="checkbox"] {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Narrow number inputs for KIRI/KANAN */
#bulk-dex-inputs input[type="number"],
#bulk-meta-dex-inputs input[type="number"] {
    width: 65px !important;
    text-align: center;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
#bulk-modal-editor .btn {
    padding: 3px 8px !important;
    font-size: 11px !important;
    height: auto !important;
    min-height: 22px !important;
    line-height: 1.4 !important;
}

#bulk-modal-editor .btn-sm {
    padding: 3px 8px;
    font-size: 11px;
}

#bulk-modal-editor .btn [uk-icon] {
    width: 11px !important;
    height: 11px !important;
}

#bulk-modal-editor .modal-footer {
    padding: 8px 14px;
}

#bulk-modal-editor .modal-footer .btn {
    padding: 5px 12px !important;
    font-size: 12px !important;
}

/* ─── Margin utilities ───────────────────────────────────────────────────── */
#bulk-modal-editor .mb-1 {
    margin-bottom: 5px !important;
}

#bulk-modal-editor .mt-1 {
    margin-top: 6px !important;
}

#bulk-modal-editor h6 {
    font-size: 12px;
    margin-bottom: 5px !important;
}

/* ─── Profile select full width ──────────────────────────────────────────── */
#bulk-modal-editor #profile-select {
    width: 100%;
}

/* ─── Filter Scanner Modal Titles & Chips ────────────────────────────────── */
.filter-section-title {
    font-weight: 700;
    color: #090909;
    margin-bottom: 8px;
    font-size: 12px;
    border-bottom: 2px solid #e5e5e5;
    padding-bottom: 4px;
    text-align: center;
}

.metadex-limit-info {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 12px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.dex-limit-info {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 12px;
    background: #dcfce7;
    color: #15803d;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.dark-mode .metadex-limit-info {
    background: rgba(124, 58, 237, 0.18);
    color: #c4b5fd;
}

.dark-mode .dex-limit-info {
    background: rgba(34, 197, 94, 0.16);
    color: #86efac;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 12px;
    cursor: pointer;
    background: white !important;
    border: 2px solid transparent;
    transition: var(--transition-smooth);
}

.filter-chip:hover {
    background: #f1f5f9;
}

.filter-chip input[type="checkbox"] {
    width: 11px;
    height: 11px;
    margin: 0;
}

.filter-chip .chip-label {
    font-weight: 600;
    font-size: 10px;
}

.filter-chip .chip-count {
    font-size: 10px;
    opacity: 0.8;
}

.chip-sub-info {
    font-size: 8.5px;
    color: #888;
    text-align: center;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    margin-top: 1px;
    font-weight: 500;
}

.dark-mode .chip-sub-info {
    color: #aaa;
}

/* ─── Dark mode additions ────────────────────────────────────────────────── */
.dark-mode .bulk-dex-scroll::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark-mode .bulk-section-title {
    color: #f1f5f9 !important;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Override inline colors for specific headers in dark mode */
.dark-mode .bulk-section-title[style*="color"] {
    color: #f8fafc !important;
}

.dark-mode .bulk-field-label {
    color: #cbd5e1;
}

.dark-mode #bulk-modal-editor .alert-primary {
    background: rgba(37, 99, 235, 0.2) !important;
    border: 1px solid rgba(37, 99, 235, 0.4) !important;
    color: #f1f5f9 !important;
}

.dark-mode #bulk-modal-editor .alert-primary strong {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
}

/* ==========================================================================
   DARK MODE — Premium Deep Theme
   ========================================================================== */
body.dark-mode {
    --surface-0: #0b0f19;
    /* Deepest Navy/Black - Body background for ultimate depth */
    --surface-1: #111827;
    /* Slate-900 / Dark Charcoal Blue - Main card/modal background */
    --surface-2: #1f2937;
    /* Slate-800 - Lighter card sections, form inputs, dropdowns, secondary button backgrounds */
    --surface-3: #374151;
    /* Slate-700 - Hovered inputs, active badges, or borders */
    --bg-main: #0b0f19;
    /* Body fallback background */
    --border-color: #1f2937;
    /* Standard border */
    --border-strong: #374151;
    /* High-contrast border */
    --bs-light: #1f2937;
    --bs-dark: #f8fafc;

    /* Highlight states for profit signals */
    --hl-bg: #064e3b;
    /* Deep forest green for ultimate readability in dark mode */
    --hl-border: 2px solid #059669;
    /* Crisp emerald border */
    --hl-sub-bg: rgba(16, 185, 129, 0.18);
    /* Semi-transparent emerald for sub-columns */

    color: #f3f4f6 !important;
    background-color: var(--surface-0) !important;
}

body.dark-mode .text-dark {
    color: #f8fafc !important;
}

body.dark-mode .text-muted {
    color: #94a3b8 !important;
}

body.dark-mode .bg-light {
    background-color: var(--surface-2) !important;
}

body.dark-mode .bg-white {
    background-color: var(--surface-1) !important;
}

body.dark-mode .uk-card {
    background: var(--surface-1) !important;
    border-color: var(--border-color) !important;
}

.dark-mode a {
    color: #60a5fa !important;
}

.dark-mode .card,
.dark-mode .modal-content,
.dark-mode .header-card,
.dark-mode #scanner-config,
.dark-mode #filter-card,
.dark-mode #token-management {
    background-color: var(--surface-1) !important;
    border: 1px solid var(--border-color) !important;
    color: #f3f4f6 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
}

.dark-mode .header-card {
    border-top: 3px solid var(--theme-accent) !important;
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode h6,
.dark-mode .modal-title {
    color: #f8fafc !important;
}

/* --- Crisp Alternating Table Styles (Solves all cell overlap color issues) --- */
.dark-mode #monitoring-scroll {
    background: var(--surface-0) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none;
}

.dark-mode .table thead th {
    background: var(--surface-1) !important;
    border-bottom: 2px solid var(--border-strong) !important;
    color: #e2e8f0 !important;
    letter-spacing: 0.4px;
}

.dark-mode .table tbody tr {
    background-color: transparent !important;
}

.dark-mode .table tbody tr:nth-child(odd) td {
    background-color: var(--surface-0) !important;
}

.dark-mode .table tbody tr:nth-child(even) td {
    background-color: var(--surface-1) !important;
}

.dark-mode .table tbody tr:hover td {
    background-color: var(--surface-2) !important;
}

.dark-mode .table tbody td {
    border-color: var(--border-color) !important;
    color: #f3f4f6 !important;
}

/* Orderbook Column Premium Glow Styles */
.dark-mode .th-orderbook {
    background: color-mix(in srgb, var(--theme-accent) 20%, var(--surface-1)) !important;
    color: #f8fafc !important;
    border-left: 2px solid color-mix(in srgb, var(--theme-accent) 30%, var(--border-strong)) !important;
    border-right: 2px solid color-mix(in srgb, var(--theme-accent) 30%, var(--border-strong)) !important;
}

.dark-mode .td-orderbook {
    background: linear-gradient(to right, color-mix(in srgb, var(--theme-accent) 10%, var(--surface-0)), color-mix(in srgb, var(--theme-accent) 6%, var(--surface-0))) !important;
    border-left: 2px solid color-mix(in srgb, var(--theme-accent) 20%, var(--border-color)) !important;
    border-right: 2px solid color-mix(in srgb, var(--theme-accent) 20%, var(--border-color)) !important;
}

.dark-mode .table>tbody>tr:nth-child(even) .td-orderbook {
    background: linear-gradient(to right, color-mix(in srgb, var(--theme-accent) 10%, var(--surface-1)), color-mix(in srgb, var(--theme-accent) 6%, var(--surface-1))) !important;
}

.dark-mode .table>tbody>tr:hover .td-orderbook {
    background: linear-gradient(to right, color-mix(in srgb, var(--theme-accent) 15%, var(--surface-2)), color-mix(in srgb, var(--theme-accent) 10%, var(--surface-2))) !important;
}

/* Inputs & Form Controls */
.dark-mode .form-control,
.dark-mode .form-select,
.dark-mode input:not([type="checkbox"]):not([type="radio"]),
.dark-mode textarea,
.dark-mode select {
    background-color: var(--surface-2) !important;
    border: 1px solid var(--border-strong) !important;
    color: #f9fafb !important;
    height: 26px;
    border-radius: 12px;
}

.dark-mode input:focus,
.dark-mode textarea:focus,
.dark-mode select:focus,
.dark-mode .form-control:focus,
.dark-mode .form-select:focus {
    border-color: var(--theme-accent) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent) 25%, transparent 75%) !important;
}

.dark-mode select option {
    background: var(--surface-1) !important;
    color: #f9fafb !important;
}

/* Buttons */
.dark-mode .btn-secondary,
.dark-mode .btn-outline-secondary {
    background-color: var(--surface-2) !important;
    color: #cbd5e1 !important;
    border: 1px solid var(--border-strong) !important;
    box-shadow: none;
}

.dark-mode .btn-secondary:hover,
.dark-mode .btn-outline-secondary:hover {
    background-color: var(--surface-3) !important;
    border-color: var(--border-strong) !important;
    color: #f9fafb !important;
    box-shadow: none;
}

.dark-mode .btn-primary {
    background: #2563eb !important;
    border-color: #2563eb !important;
    box-shadow: none;
}

.dark-mode .btn-primary:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
}

/* Signal Cards & Items */
.dark-mode .signal-card {
    background-color: var(--surface-1) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none;
}

.dark-mode .signal-card-body {
    background-color: var(--surface-0) !important;
    color: #f3f4f6 !important;
}

.dark-mode .signal-card-header {
    border-bottom: 1px solid var(--border-color) !important;
    background-color: var(--surface-1) !important;
}

.dark-mode .signal-item .text-success {
    color: #4ade80 !important;
}

.dark-mode .signal-item .text-danger {
    color: #f87171 !important;
}

.dark-mode .signal-item .text-muted {
    color: #94a3b8 !important;
}

.dark-mode .signal-highlight {
    color: #ffffff !important;
    background-color: var(--hl-bg) !important;
    border: 1px solid #059669;
    border-radius: 4px;
    padding: 1px 6px;
    display: inline-block;
}

/* Filter components */
.dark-mode .filter-section-title {
    color: #ffffff !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.dark-mode .filter-chip {
    background: var(--surface-2) !important;
    border-color: transparent;
}

.dark-mode .filter-chip:hover {
    background: var(--surface-3) !important;
}

.dark-mode .filter-chip span[style*="color:#555"] {
    color: #cbd5e1 !important;
}

.dark-mode .filter-chip[style*="background:#f8f8f8"],
.dark-mode .filter-chip[style*="background:white"] {
    background: var(--surface-2) !important;
}

/* Global Text Colors */
.dark-mode .text-primary {
    color: #60a5fa !important;
}

.dark-mode .text-success {
    color: #4ade80 !important;
}

.dark-mode .text-danger {
    color: #f87171 !important;
}

.dark-mode .text-warning {
    color: #fbbf24 !important;
}

.dark-mode .text-info {
    color: #22d3ee !important;
}

.dark-mode .text-muted {
    color: #94a3b8 !important;
}

.dark-mode .text-secondary {
    color: #cbd5e1 !important;
}

/* Badges & Special Tags */
.dark-mode .badge {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    color: #cbd5e1;
}

.dark-mode .badge.bg-warning {
    background-color: #d97706 !important;
    color: #fff !important;
}

.dark-mode .badge.bg-danger {
    background-color: #dc2626 !important;
    color: #fff !important;
}

.dark-mode .badge.bg-secondary {
    background-color: #6b7280 !important;
    color: #fff !important;
}

.dark-mode .dex-error {
    background-color: #5a1515 !important;
    border-left: 2px solid rgba(248, 113, 113, 0.5) !important;
}

.dark-mode .dex-skip {
    background-color: #46401e !important;
    border-left: 2px solid rgba(234, 179, 8, 0.4) !important;
    color: #fbbf24;
}

.dark-mode .dex-slot-empty {
    background-color: var(--surface-2);
    color: #64748b;
}

.dark-mode .scanner-control:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.dark-mode .scanner-label {
    color: #e2e8f0;
}

.dark-mode .dex-cell-highlight {
    background-color: var(--hl-bg) !important;
    border: var(--hl-border) !important;
    color: #ffffff !important;
    font-weight: 700;
}

.dark-mode #progress-container {
    background: var(--surface-2);
    box-shadow: none;
}

.dark-mode #progress-bar {
    background: var(--theme-accent);
    box-shadow: none;
}

.dark-mode .buy {
    color: #4ade80;
}

.dark-mode .sell {
    color: #f87171;
}

.dark-mode #infoAPP {
    color: #fbbf24 !important;
}

.dark-mode .page-header-bg {
    background-color: var(--surface-1) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.dark-mode .toggle-radio.active {
    background-color: var(--theme-accent) !important;
    color: #fff;
    box-shadow: none;
}

.dark-mode .run-dot {
    border-color: #0d0f12;
    box-shadow: none;
}

.dark-mode .modal-header {
    background: var(--surface-1);
    border-bottom: 1px solid var(--border-color);
}

.dark-mode .td-orderbook .orderbook-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
}

.dark-mode label {
    color: #cbd5e1;
}

.dark-mode .nav-link {
    color: #94a3b8;
}

.dark-mode .nav-link:hover {
    color: #f1f5f9;
}

.dark-mode .nav-link.active {
    color: #60a5fa;
    border-bottom: 2px solid #60a5fa;
}

.dark-mode hr {
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .modal-footer {
    background: var(--surface-1);
    border-top: 1px solid var(--border-color);
}

.dark-mode .btn-close {
    filter: invert(1) grayscale(1) brightness(1.5) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.dark-mode .btn-close:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
#judul {
    font-size: clamp(16px, 2.2vw, 20px) !important;
}

@media (max-width: 1600px) {
    .td-orderbook {
        width: 96px;
        max-width: 106px;
    }

    .th-detail,
    .td-detail {
        width: 240px !important;
        min-width: 240px !important;
        max-width: 240px !important;
    }
}

@media (max-width: 1366px) {
    .td-orderbook {
        width: 92px;
        max-width: 100px;
        font-size: 11.5px;
    }

    .th-detail,
    .td-detail {
        width: 215px !important;
        min-width: 215px !important;
        max-width: 215px !important;
        font-size: 11.5px;
    }

    #tabel-monitoring td {
        font-size: 12px;
    }
}

@media (max-width: 960px) {
    .table tbody td {
        font-size: 11px;
        padding: 6px 8px;
    }

    .table thead th {
        font-size: 11px;
    }

    .signal-card__content {
        font-size: 12.5px;
    }

    .signal-card__body {
        padding: 6px 8px !important;
    }

    .container,
    .container-fluid {
        padding-left: 6px;
        padding-right: 6px;
    }

    #iframe-container iframe {
        height: 60vh;
    }

    .header-card {
        padding: 6px 10px !important;
    }

    #tabel-monitoring thead th:nth-child(1),
    #tabel-monitoring tbody td:nth-child(1),
    #tabel-monitoring thead th:nth-child(11),
    #tabel-monitoring tbody td:nth-child(11) {
        display: table-cell !important;
    }
}

@media (max-width: 640px) {
    .table tbody td {
        font-size: 10.5px;
        padding: 5px 6px;
    }

    #progress-bar {
        height: 14px;
    }

    #progress-text {
        line-height: 14px;
        font-size: 10px;
    }

    .signal-card__content {
        font-size: 12px;
    }

    .signal-card__header {
        padding: 6px 8px !important;
    }
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
#toast-container.toast-top-right {
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    bottom: auto !important;
    transform: none;
}

/* History badge */
.hist-badge-fail {
    background-color: #b3261e !important;
    color: #fff !important;
    margin-left: 6px;
}

.dark-mode .hist-badge-fail {
    background-color: #d32f2f !important;
}

.hist-meta-detail {
    font-size: 0.72rem;
    opacity: 0.72;
    line-height: 1.4;
}

.dark-mode .hist-meta-detail {
    opacity: 0.58;
}

/* ==========================================================================
   Compact Filter Styles - Checkbox Inline Version
   ========================================================================== */
.filter-compact-container {
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-groups-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

/* Filter Group Sections */
.filter-groups-inline>div {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Filter Section Label (CHAIN, CEX, DEX, PAIR) */
.filter-groups-inline>div>span:first-child,
.filter-groups-inline>div>b:first-child {
    font-size: 11px;
    font-weight: bold;
    line-height: 1.4;
    margin-right: 2px;
    white-space: nowrap;
    vertical-align: middle;
}

/* Separator */
.filter-groups-inline .text-muted {
    color: #999;
    font-size: 14px;
    line-height: 1.4;
    margin: 0 4px;
    vertical-align: middle;
}

/* Checkbox Label - More Compact */
.filter-groups-inline label {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    vertical-align: middle;
}

.filter-groups-inline label:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--bs-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* Checkbox input */
.filter-groups-inline label input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    cursor: pointer;
    vertical-align: middle;
}

/* Label text and count */
.filter-groups-inline label span {
    font-weight: 600;
    line-height: 1.4;
    vertical-align: middle;
}

/* Checked state - Colors are now applied dynamically via JavaScript (Opsi 4) */
.filter-groups-inline label:has(input:checked) {
    /* Background and border colors are set by JS from config */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    /* font-weight: 700; */
}

.filter-groups-inline label:has(input:checked):hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

/* Summary Section - Applied to JavaScript-injected elements */
#filter-right-group {
    padding: 4px 12px;
    background: rgba(13, 110, 253, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(13, 110, 253, 0.2);
    white-space: nowrap;
}

#filter-summary {
    color: var(--bs-primary) !important;
    font-size: 12px !important;
    font-weight: bold !important;
}

/* Dark mode adjustments */
body.dark-mode .filter-groups-inline label {
    background: #252840;
    border-color: rgba(255, 255, 255, 0.15);
    color: #e5e7eb;
}

body.dark-mode .filter-groups-inline label:hover {
    background: #2e3254;
    border-color: #60a5fa;
}

body.dark-mode .filter-groups-inline label:has(input:checked) {
    /* Colors are set by JS from config */
    box-shadow: none;
}

body.dark-mode #filter-right-group {
    background: #172554;
    border-color: #2563eb;
}

body.dark-mode #filter-summary {
    color: #60a5fa !important;
}

/* Responsive adjustments */
@media (max-width: 960px) {
    .filter-compact-container {
        gap: 8px;
        padding: 5px 8px;
    }

    .filter-groups-inline {
        gap: 6px;
    }

    .filter-groups-inline label {
        padding: 2px 6px;
        font-size: 10px;
    }

    .filter-groups-inline label input[type="checkbox"] {
        width: 12px;
        height: 12px;
    }

    .filter-groups-inline>div>span:first-child,
    .filter-groups-inline>div>b:first-child {
        font-size: 10px;
    }
}

@media (max-width: 640px) {
    .filter-summary-inline {
        flex: 1 1 100%;
        margin-left: 0;
        margin-top: 6px;
        text-align: center;
    }

    .filter-groups-inline label {
        font-size: 9px;
        padding: 2px 5px;
    }
}

/* ==========================================================================
   Additional Refinements
   ========================================================================== */
#infoAPP {
    display: inline-block;
    vertical-align: middle;
    line-height: 1.4;
    white-space: nowrap;
    font-size: 17px;
}

#infoAPP span {
    vertical-align: middle;
    line-height: inherit;
}

#sinyal-container .no-signal-placeholder {
    border: 0;
    background: transparent;
}

#tabel-monitoring thead tr {
    border-bottom: 1px solid black;
}

.dex-link-small {
    font-size: 0.9em;
}

/* Colored summary chips (CEX/chain/DEX labels in filter display area) */
.dyn-chip {
    display: inline-block;
    color: #fff;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    margin: 2px;
}

/* Hover-style clickable links (copy/open actions) */
.hover-link {
    cursor: pointer;
    color: inherit;
}

/* Multi-tab quick-open button */
.multi-tab-btn {
    display: inline-block;
    cursor: pointer;
    margin-right: 3px;
    font-size: 11px;
    vertical-align: middle;
    -webkit-user-select: none;
    user-select: none;
    border: 1px solid #0a0;
    border-radius: 12px;
    padding: 0 3px;
    background: #e8fde8;
    color: #080;
    line-height: 1.4;
}

/* Unified panel borders */
#menu-app,
#filter-card,
#scanner-config,
#monitoring-scroll,
.signal-card {
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode #menu-app,
body.dark-mode #filter-card,
body.dark-mode #scanner-config,
body.dark-mode #monitoring-scroll,
body.dark-mode .signal-card {
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* ==========================================================================
   Update Wallet Exchanger Section
   ========================================================================== */
#update-wallet-section {
    max-height: 85vh;
    overflow-y: auto;
}

.wallet-cex-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.wallet-cex-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.wallet-cex-card.selected {
    border: 2px solid var(--bs-primary);
    background: rgba(13, 110, 253, 0.05);
}

.wallet-cex-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.wallet-cex-header:hover {
    background: rgba(0, 0, 0, 0.05);
}

.wallet-cex-name {
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallet-cex-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.wallet-cex-grid-item {
    display: flex;
}

.wallet-cex-grid-item>.wallet-cex-card {
    width: 100%;
}

.wallet-cex-table-wrapper {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    margin-top: 8px;
}

.wallet-cex-table {
    width: 100%;
    font-size: 12px;
    margin: 0;
}

.wallet-cex-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
    /* Background color akan diset oleh inline style dari JavaScript menggunakan warna chain */
}

.wallet-cex-table thead th {
    background: inherit !important;
    color: inherit !important;
    border-color: rgba(255, 255, 255, 0.25);
}

.wallet-cex-table th {
    padding: 6px 8px;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.wallet-cex-table td {
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.wallet-cex-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.03);
}

.wallet-status-badge {
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    display: inline-block;
}

.wallet-status-on {
    background: #d4edda;
    color: #155724;
}

.wallet-status-off {
    background: #f8d7da;
    color: #721c24;
}

.wallet-status-loading {
    background: #fff3cd;
    color: #856404;
}

/* Dark mode adjustments */
body.dark-mode .wallet-cex-card {
    background: #424450;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .wallet-cex-card.selected {
    background: #172554;
    border-color: var(--bs-primary);
}

body.dark-mode .wallet-cex-header {
    background: #252840;
}

body.dark-mode .wallet-cex-header:hover {
    background: #2e3252;
}

body.dark-mode .wallet-cex-table-wrapper {
    border-color: rgba(255, 255, 255, 0.1);
}


body.dark-mode .wallet-cex-table th,
body.dark-mode .wallet-cex-table td {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .wallet-cex-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}


/* ==========================================================================
   DATABASE VIEWER - Refactored Styles
   ========================================================================== */
/* ==========================================================================
   DATABASE VIEWER - Premium Horizontal Header
   ========================================================================== */
.db-viewer-premium-header {
    padding: 12px 14px;
    background: var(--surface-0);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    box-shadow: none;
    border: 1px solid var(--border-color);
}

.db-header-main {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(270px, auto) minmax(620px, 1.8fr);
    align-items: center;
    gap: 12px;
}

.db-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.db-header-icon {
    width: 44px;
    height: 44px;
    background: var(--theme-accent, #65a30d);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 19px;
    box-shadow: var(--shadow-sm);
    flex: 0 0 auto;
}

.db-header-title {
    min-width: 0;
}

.db-header-title h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #1f2937;
    letter-spacing: 0;
    line-height: 1.1;
}

.db-header-title p {
    margin: 0;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0;
}

.db-header-meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.db-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    max-width: 260px;
    padding: 3px 8px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
}

.db-meta-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.db-header-center {
    display: flex;
    align-items: center;
    align-self: stretch;
    min-width: 0;
    background: var(--surface-1);
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.db-header-status-row {
    display: contents;
}

.db-stats-row {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: flex-start;
    gap: 4px;
}

.db-header-info {
    display: grid;
    gap: 4px;
    font-size: 11px;
    line-height: 1.35;
    text-align: left;
    width: 100%;
    min-height: 24px;
}

/* Legacy fallback */
.db-compact-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

/* New stat pill with icon */
.db-stat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 124px;
    padding: 4px 8px;
}

.db-stat-icon {
    width: 32px;
    height: 32px;
    background: #ecfdf5;
    color: #15803d;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 15px;
    flex-shrink: 0;
}

.db-stat-icon-records {
    background: #eff6ff;
    color: #2563eb;
}

.db-stat-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.db-stat-val {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
    letter-spacing: 0;
}

.db-stat-lbl {
    font-size: 9px;
    color: #64748b;
    font-weight: 700;
    margin-top: 1px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.db-stat-divider {
    width: 1px;
    height: 32px;
    background: #e2e8f0;
    margin: 0 6px;
}

/* ── Toolbar card — seragam dengan stats pill ── */
.db-toolbar-card {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
}

.db-toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.db-toolbar-sep {
    width: 1px;
    height: 34px;
    background: #e2e8f0;
    margin: 0 2px;
}

.db-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    min-width: 96px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

.db-action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.15s;
    border-radius: inherit;
}

.db-action-btn:hover::before {
    opacity: 0.07;
}

.db-action-btn i {
    font-size: 15px;
    line-height: 1;
}

.db-action-btn:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

.db-action-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.db-btn-backup {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.db-btn-restore {
    background: #fce7f3;
    color: #be185d;
    border-color: #fbcfe8;
}

.db-btn-refresh {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

.db-btn-close {
    background: #dcfce7;
    color: #15803d;
    border-color: #bbf7d0;
}

.db-backup-panel {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) auto;
    align-items: center;
    align-self: stretch;
    gap: 12px;
    min-width: 0;
    padding: 8px 10px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.db-backup-info {
    display: grid;
    align-content: center;
    gap: 4px;
    min-width: 0;
}

.db-panel-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.db-history-row,
.db-history-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    color: #475569;
}

.db-history-empty {
    justify-content: flex-start;
    color: #94a3b8;
    font-style: italic;
}

.db-history-kind {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    font-weight: 800;
    text-transform: uppercase;
}

.db-history-detail {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

.db-history-backup .db-history-kind {
    color: #1d4ed8;
}

.db-history-restore .db-history-kind {
    color: #047857;
}

.db-history-restore.has-fail .db-history-kind {
    color: #dc2626;
}

/* Dark Mode Adjustments */
body.dark-mode .db-viewer-premium-header {
    background: var(--surface-0);
    border-color: var(--border-color);
}

body.dark-mode .db-header-info {
    color: #94a3b8;
}

body.dark-mode .db-meta-chip,
body.dark-mode .db-header-center,
body.dark-mode .db-backup-panel {
    background: var(--surface-1);
    border-color: var(--border-color);
}

body.dark-mode .db-meta-chip,
body.dark-mode .db-panel-label,
body.dark-mode .db-history-row {
    color: #cbd5e1;
}

body.dark-mode .db-history-backup .db-history-kind {
    color: #93c5fd;
}

body.dark-mode .db-history-restore .db-history-kind {
    color: #86efac;
}

body.dark-mode .db-history-restore.has-fail .db-history-kind {
    color: #fca5a5;
}

body.dark-mode .db-toolbar-sep {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .db-btn-backup {
    background: rgba(29, 78, 216, .2);
    color: #93c5fd;
    border-color: rgba(29, 78, 216, .35);
}

body.dark-mode .db-btn-restore {
    background: rgba(190, 24, 93, .2);
    color: #f9a8d4;
    border-color: rgba(190, 24, 93, .35);
}

body.dark-mode .db-btn-refresh {
    background: rgba(180, 83, 9, .2);
    color: #fcd34d;
    border-color: rgba(180, 83, 9, .35);
}

body.dark-mode .db-btn-close {
    background: rgba(21, 128, 61, .2);
    color: #86efac;
    border-color: rgba(21, 128, 61, .35);
}

body.dark-mode .db-header-title h2 {
    color: #f1f5f9;
}

body.dark-mode .db-compact-stat .val,
body.dark-mode .db-stat-val {
    color: #f8fafc;
}

body.dark-mode .db-stat-lbl {
    color: #94a3b8;
}

body.dark-mode .db-stat-icon {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

body.dark-mode .db-stat-icon-records {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
}

body.dark-mode .db-stat-divider {
    background: #334155;
}

@media (max-width: 1240px) {
    .db-header-main {
        grid-template-columns: minmax(250px, 1fr) minmax(270px, auto);
    }

    .db-backup-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .db-viewer-premium-header {
        padding: 10px;
    }

    .db-header-left {
        align-items: flex-start;
    }

    .db-header-main {
        grid-template-columns: 1fr;
    }

    .db-header-center,
    .db-backup-panel {
        align-self: auto;
    }

    .db-header-icon {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    .db-header-title h2 {
        font-size: 16px;
    }

    .db-toolbar-card {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .db-toolbar-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .db-toolbar-sep {
        display: none;
    }

    .db-action-btn {
        width: 100%;
        min-width: 0;
    }

    .db-stats-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .db-stat-divider {
        display: none;
    }

    .db-stat-pill {
        min-width: 0;
        padding: 8px;
        background: var(--surface-0);
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }

    .db-backup-panel {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .db-history-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .db-history-detail {
        text-align: left;
        white-space: normal;
    }
}

.db-table-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.08);
    /* New: Add accent color from chain */
    border-left: 4px solid var(--card-accent-color, #667eea);
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.db-table-card.expanded {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.db-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.02);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.expanded .db-table-header {
    border-bottom-color: rgba(0, 0, 0, 0.1);
    background: transparent;
}

.db-table-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--card-accent-color, #333);
}

.db-table-title strong {
    text-transform: uppercase;
}

.db-table-title strong.multichain-highlight {
    color: #16a34a;
}

.db-table-card.expanded .db-table-title strong.multichain-highlight {
    color: #22c55e;
}

body.dark-mode .db-table-title strong.multichain-highlight {
    color: #4ade80;
}

body.dark-mode .db-table-card.expanded .db-table-title strong.multichain-highlight {
    color: #86efac;
}

.db-table-title .badge {
    background-color: var(--card-accent-color, #1e87f0);
}

.db-table-content {
    padding: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.db-table-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 12px;
    align-items: center;
}

.db-table-summary .summary-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.15s;
}

.db-table-summary .summary-item strong {
    color: #1e293b;
    font-size: 12px;
}

.db-table-summary .summary-item.stat-koin {
    border-color: #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
}

.db-table-summary .summary-item.stat-koin strong {
    color: #3730a3;
}

.db-table-summary .summary-item.stat-cex {
    border-color: #fde68a;
    background: #fefce8;
    color: #854d0e;
}

.db-table-summary .summary-item.stat-cex strong {
    color: #713f12;
}

.db-table-summary .summary-item.stat-sc {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.db-table-summary .summary-item.stat-sc strong {
    color: #14532d;
}

.db-table-summary .summary-item.stat-wd {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.db-table-summary .summary-item.stat-depo {
    border-color: #bae6fd;
    background: #f0f9ff;
    color: #0369a1;
}

.db-table-summary .summary-item.stat-info {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #64748b;
}

.db-data-table {
    font-size: 12px;
}

.db-data-table thead th {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background 0.15s;
}

.db-data-table thead th:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.db-data-table .sort-indicator {
    display: inline-flex;
    align-items: center;
    margin-left: 3px;
    vertical-align: middle;
    line-height: 1;
}

/* ── Sort icon states ──────────────────────────────────────────── */
.sort-icon-idle {
    font-size: 10px;
    opacity: 0.28;
    color: inherit;
    transition: opacity 0.18s;
}

.sort-icon-active {
    font-size: 11px;
    opacity: 1;
    color: #fff;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.55));
    animation: sort-pop 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sort-pop {
    0% {
        transform: scale(0.5) translateY(2px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Hover reveals the idle icon */
.db-data-table thead th:hover .sort-icon-idle,
.db-koin-table thead th:hover .sort-icon-idle {
    opacity: 0.75;
}

/* ── Premium Koin Table ─────────────────────────────────────── */
.db-koin-table {
    font-size: 11.5px;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    table-layout: auto;
}

.db-koin-table thead th {
    position: relative;
    background: linear-gradient(175deg,
            color-mix(in srgb, var(--card-accent-color, #667eea) 82%, #fff 18%) 0%,
            var(--card-accent-color, #667eea) 55%,
            color-mix(in srgb, var(--card-accent-color, #667eea) 88%, #000 12%) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 7px 8px;
    border: none;
    border-bottom: 2px solid rgba(0, 0, 0, 0.18);
    white-space: nowrap;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    vertical-align: middle;
    transition: background 0.15s, box-shadow 0.15s;
}

.db-koin-table thead th.koin-th-group {
    background: linear-gradient(175deg,
            color-mix(in srgb, var(--card-accent-color, #667eea) 65%, #000 35%) 0%,
            color-mix(in srgb, var(--card-accent-color, #667eea) 72%, #000 28%) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    border-bottom: none;
    cursor: default;
}

.db-koin-table thead th.koin-th-sub {
    background: linear-gradient(175deg,
            color-mix(in srgb, var(--card-accent-color, #667eea) 52%, #000 48%) 0%,
            color-mix(in srgb, var(--card-accent-color, #667eea) 58%, #000 42%) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    font-size: 9.5px;
    padding: 5px 4px;
}

.db-koin-table thead th:hover {
    background: linear-gradient(175deg,
            color-mix(in srgb, var(--card-accent-color, #667eea) 90%, #fff 10%) 0%,
            color-mix(in srgb, var(--card-accent-color, #667eea) 78%, #fff 22%) 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

/* Active sorted column — koin table */
.db-koin-table thead th.sort-col-active {
    background: linear-gradient(175deg,
            color-mix(in srgb, var(--card-accent-color, #667eea) 60%, #fff 40%) 0%,
            color-mix(in srgb, var(--card-accent-color, #667eea) 48%, #fff 52%) 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
}

.db-koin-table thead th.sort-col-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 2px 2px 0 0;
    background: rgba(255, 255, 255, 0.7);
    animation: sort-bar-in 0.2s ease forwards;
}

@keyframes sort-bar-in {
    from {
        opacity: 0;
        transform: scaleX(0.3);
    }

    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* Striped rows */
.db-koin-table tbody tr {
    transition: background 0.12s;
}

.db-koin-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.db-koin-table tbody tr:nth-child(even) {
    background: #f5f7ff;
}

.db-koin-table tbody tr:hover {
    background: color-mix(in srgb, var(--card-accent-color, #667eea) 10%, #fff 90%) !important;
}

/* Group border */
.db-koin-table tbody tr.koin-group-start td {
    border-top: 2px solid rgba(0, 0, 0, 0.12);
}

.db-koin-table tbody tr.koin-group-inner td {
    border-top: 1px dashed #e0e0e0;
}

/* Cells */
.db-koin-table td {
    padding: 5px 7px;
    vertical-align: middle;
}

.koin-no {
    color: #999;
    font-size: 11px;
}

.koin-symbol-in {
    font-weight: 700;
    color: #1a1a2e;
    font-size: 12px;
}

.koin-symbol-out {
    color: #555;
    font-size: 12px;
}

.koin-sc code.koin-sc-in {
    color: #c0398c;
    font-size: 11.5px;
    word-break: break-all;
}

.koin-sc code.koin-sc-out {
    color: #1a6fd4;
    font-size: 11.5px;
    word-break: break-all;
}

.koin-des {
    color: #444;
    font-weight: 600;
    font-size: 11px;
}

/* CEX chip badges */
.koin-cex-cell {
    white-space: normal;
}

.koin-cex-chip {
    display: inline-block;
    background: var(--card-accent-color, #667eea);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 10px;
    margin: 1px 2px 1px 0;
    line-height: 1.4;
}

/* Wallet cell icons */
.koin-wallet {
    font-size: 13px;
}

.koin-wallet .status-open-sm {
    color: #16a34a;
    font-size: 13px;
}

.koin-wallet .status-closed-sm {
    color: #dc2626;
    font-size: 13px;
}

/* Status badge */
.koin-status-badge {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.koin-badge-aktif {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.koin-badge-nonaktif {
    background: #fef9c3;
    color: #92400e;
    border: 1px solid #fde047;
}

/* Dark mode */
/* Thead db-koin-table selalu pakai warna chain — tidak mengikuti dark mode */
body.dark-mode .db-koin-table thead th {
    background: linear-gradient(175deg,
            color-mix(in srgb, var(--card-accent-color, #667eea) 82%, #fff 18%) 0%,
            var(--card-accent-color, #667eea) 55%,
            color-mix(in srgb, var(--card-accent-color, #667eea) 88%, #000 12%) 100%) !important;
    color: #fff !important;
    border-bottom: 2px solid rgba(0, 0, 0, 0.25) !important;
}

body.dark-mode .db-koin-table thead th.koin-th-group {
    background: linear-gradient(175deg,
            color-mix(in srgb, var(--card-accent-color, #667eea) 65%, #000 35%) 0%,
            color-mix(in srgb, var(--card-accent-color, #667eea) 72%, #000 28%) 100%) !important;
}

body.dark-mode .db-koin-table thead th.koin-th-sub {
    background: linear-gradient(175deg,
            color-mix(in srgb, var(--card-accent-color, #667eea) 52%, #000 48%) 0%,
            color-mix(in srgb, var(--card-accent-color, #667eea) 58%, #000 42%) 100%) !important;
}

body.dark-mode .db-koin-table thead th:hover {
    background: linear-gradient(175deg,
            color-mix(in srgb, var(--card-accent-color, #667eea) 90%, #fff 10%) 0%,
            color-mix(in srgb, var(--card-accent-color, #667eea) 78%, #fff 22%) 100%) !important;
}

body.dark-mode .db-koin-table tbody tr:nth-child(odd) {
    background: var(--surface-0) !important;
}

body.dark-mode .db-koin-table tbody tr:nth-child(even) {
    background: var(--surface-1) !important;
}

body.dark-mode .db-koin-table tbody tr:hover {
    background: var(--surface-2) !important;
}

body.dark-mode .koin-symbol-in {
    color: #f8fafc;
}

body.dark-mode .koin-symbol-out {
    color: #94a3b8;
}

body.dark-mode .koin-sc code.koin-sc-in {
    color: #f472b6;
}

body.dark-mode .koin-sc code.koin-sc-out {
    color: #60a5fa;
}

body.dark-mode .koin-des {
    color: #cbd5e1;
}

body.dark-mode .db-koin-table tbody tr.koin-group-inner td {
    border-top-color: var(--border-color);
}

/* Dark Mode for Database Viewer */
body.dark-mode .db-viewer-header {
    border-bottom-color: var(--border-color);
}

body.dark-mode .db-viewer-header p {
    color: #94a3b8;
}

body.dark-mode .db-stat-item .label {
    color: #94a3b8;
}

body.dark-mode .db-stat-item .value {
    color: #f8fafc;
}

body.dark-mode .db-toolbar {
    background: var(--surface-2);
}

body.dark-mode .db-table-card {
    background: var(--surface-1);
    border-color: var(--border-color);
    border-left-color: var(--card-accent-color, #667eea);
}

body.dark-mode .expanded .db-table-header {
    border-bottom-color: var(--border-color);
}

body.dark-mode .db-table-content {
    border-top-color: var(--border-color);
}

body.dark-mode .db-table-summary {
    background: var(--surface-2);
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .db-table-summary .summary-item {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

body.dark-mode .db-table-summary .summary-item strong {
    color: #f1f5f9;
}

body.dark-mode .db-table-summary .summary-item.stat-koin {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

body.dark-mode .db-table-summary .summary-item.stat-koin strong {
    color: #c7d2fe;
}

body.dark-mode .db-table-summary .summary-item.stat-cex {
    background: rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.25);
    color: #fde68a;
}

body.dark-mode .db-table-summary .summary-item.stat-cex strong {
    color: #fef08a;
}

body.dark-mode .db-table-summary .summary-item.stat-sc {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
    color: #86efac;
}

body.dark-mode .db-table-summary .summary-item.stat-sc strong {
    color: #bbf7d0;
}

body.dark-mode .db-table-summary .summary-item.stat-wd {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
}

body.dark-mode .db-table-summary .summary-item.stat-depo {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

body.dark-mode .db-table-summary .summary-item.stat-info {
    background: rgba(100, 116, 139, 0.12);
    border-color: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

body.dark-mode .db-table-title {
    color: var(--card-accent-color, #f8fafc);
}

body.dark-mode .db-table-title .badge {
    background-color: var(--card-accent-color, #3b82f6);
}

/* ==========================================================================
   DZAP Multi-DEX Styling
   ========================================================================== */

/* DZAP badge color */
.bg-dzap {
    background-color: #ff6b35 !important;
    color: white !important;
}

/* LIFI badge color (JUMPER MetaDex) */
.bg-lifi {
    background-color: #bf0cff !important;
    color: white !important;
}

/* LIFI DEX standalone badge color (via Temple API) */
.bg-lifidex {
    background-color: #e44be8 !important;
    color: white !important;
}

/* Rango: definitive di bawah — duplikat dihapus */

/* Relay badge color */
.bg-relay {
    background-color: #6c5ce7 !important;
    color: white !important;
}

/* Rubic: definitive di bawah — duplikat dihapus */

/* Jupiter badge color (Solana DEX) */
.bg-jupiter {
    background-color: #c7f284 !important;
    color: #1a1a1a !important;
}

/* Kamino badge color (Solana Multi-DEX Aggregator) */
.bg-kamino {
    background-color: #7c3aed !important;
    color: white !important;
}

/* Meta-Aggregator Badges */
.bg-rubic {
    background-color: #7c3aed !important;
    color: white !important;
}

.bg-rango {
    background-color: #00d4aa !important;
    color: white !important;
}

/* CTRL (XDEFI) badge color */
.bg-ctrlfi {
    background-color: #808080 !important;
    color: white !important;
}

/* Zerion badge color */
.bg-zerion {
    background-color: #0052ff !important;
    color: white !important;
}

/* LBank CEX badge color */
.bg-lbank {
    background-color: #3461ff !important;
    color: white !important;
}

/* Sushi badge color */
.bg-sushi {
    background-color: #fa52a0 !important;
    color: white !important;
}

/* Wowmax badge color */
.bg-womax {
    background-color: #ff7a00 !important;
    color: white !important;
}

/* Velora badge color */
.bg-velora {
    background-color: #1c64f2 !important;
    color: white !important;
}

/* Warning button style */
.btn-warning {
    background-color: var(--bs-warning) !important;
    color: #fff !important;
    border: 1px solid var(--bs-warning) !important;
}

.btn-warning:hover,
.btn-warning:focus {
    background-color: #d97706 !important;
    border-color: #d97706 !important;
    color: #fff !important;
}

/* Solana chain badge color */
.bg-solana {
    background-color: #d483f4 !important;
    color: #1a1a1a !important;
}

/* META-DEX cell dengan sub-kolom horizontal (LIFI, RANGO, METAX, dll) */
.td-dex-multi {
    min-width: 230px !important;
    width: auto !important;
    /* biarkan konten menentukan lebar */
    padding: 4px !important;
}

/* Setiap sub-kolom META-DEX — lebar minimal sama dengan DEX biasa (115px) */
.multi-sub {
    min-width: 110px;
    white-space: nowrap;
}

.dzap-header {
    font-weight: bold;
    font-size: 0.85em;
    margin-bottom: 4px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 2px;
    text-align: center;
}

.dzap-subcols {
    display: flex;
    justify-content: space-around;
    gap: 4px;
    align-items: stretch;
}

.dzap-sub {
    flex: 1;
    min-width: 70px;
    padding: 3px;
    text-align: center;
    font-size: 0.8em;
    border-right: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.dzap-sub:last-child {
    border-right: none;
}

.dzap-sub:hover {
    background-color: rgba(255, 107, 53, 0.1);
}

.sub-dex-name {
    font-size: 0.75em;
    font-weight: bold;
    margin-bottom: 2px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-dex-status {
    font-size: 0.85em;
    line-height: 1.2;
}

/* Dark mode support for DZAP */
body.dark-mode .dzap-header {
    border-bottom-color: #444;
    color: #eee;
}

body.dark-mode .dzap-sub {
    border-right-color: #444;
}

body.dark-mode .dzap-sub:hover {
    background-color: rgba(255, 107, 53, 0.2);
}

body.dark-mode .sub-dex-name {
    color: #ddd;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .td-dex-multi {
        min-width: 180px !important;
        width: auto !important;
    }

    .multi-sub {
        min-width: 90px;
    }

    .dzap-sub {
        min-width: 60px;
        font-size: 0.75em;
    }
}


/* ==========================================================================
   Scanner Filter Modal - Compact Styling
   ========================================================================== */
#scanner-filter-modal .modal-dialog {
    box-shadow: none;
}

#modal-filter-sections label {
    font-size: 11px !important;
    margin: 0px 2px;
    border-radius: 12px;
}

#modal-filter-sections label span {
    font-size: 12px !important;
}



#modal-filter-sections>div {
    gap: 6px !important;
    margin-bottom: 10px;
}

/* ── Dark mode overrides for JS-generated inline styles ──────────────────── */

/* Section titles: color:#333 hardcoded di JS → invisible on dark bg */
.dark-mode #modal-filter-sections>div>div:first-child {
    color: #93c5fd !important;
    border-bottom-color: rgba(255, 255, 255, 0.15) !important;
}

/* META-DEX title uses color:#7c3aed (purple) — brighten agar terbaca */
.dark-mode #modal-filter-sections>div>div:first-child[style*="7c3aed"] {
    color: #c4b5fd !important;
}

/* Chip labels: background:white hardcoded di JS → putih di dark mode */
.dark-mode #modal-filter-sections label.fc-chain,
.dark-mode #modal-filter-sections label.fc-cex,
.dark-mode #modal-filter-sections label.fc-dex,
.dark-mode #modal-filter-sections label.sc-cex,
.dark-mode #modal-filter-sections label.sc-pair,
.dark-mode #modal-filter-sections label.sc-dex {
    background: #252840 !important;
    border-width: 2px;
    border-style: solid;
}

/* Chip label count "[n]": color:#555 borderline di dark */
.dark-mode #modal-filter-sections label span:last-child {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

#modal-summary-bar span {
    font-size: 13px;
}

/* ==========================================================================
   Calculator Icon - Always Accessible
   ========================================================================== */

#openCalculatorModal {
    pointer-events: all !important;
    cursor: pointer !important;
    z-index: 100 !important;
    opacity: 1 !important;
}

/* Prevent icon from being dimmed during scan */
#openCalculatorModal.icon {
    opacity: 1 !important;
    filter: none !important;
}

/* Override any global dimming during scan */
.header-card #openCalculatorModal {
    pointer-events: all !important;
    opacity: 1 !important;
}

/* ==========================================================================
   Calculator Modal Styles (Premium Grid Concept)
   ========================================================================== */
#calculator-modal .modal-content {
    background: #ffffff;
    border: none;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2) !important;
    border-radius: 28px !important;
}

body.dark-mode #calculator-modal .modal-content {
    background: #1e293b;
}

#calculator-modal .modal-body {
    padding: 30px !important;
}

.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.calc-input-group {
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 18px;
    padding: 12px 15px;
    transition: all 0.2s ease;
}

body.dark-mode .calc-input-group {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.08);
}

.calc-input-group:focus-within {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

body.dark-mode .calc-input-group:focus-within {
    background: #1e293b;
}

.calc-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calc-field {
    width: 100%;
    border: none;
    background: transparent !important;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    padding: 0;
    outline: none;
}

body.dark-mode .calc-field {
    color: #f1f5f9;
}

.calc-coin-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* Coin Colors */
.icon-usdt {
    background: rgba(38, 161, 123, 0.15);
    color: #26a17b;
}

.icon-idr {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.icon-btc {
    background: rgba(247, 147, 26, 0.15);
    color: #f7931a;
}

.icon-eth {
    background: rgba(98, 126, 234, 0.15);
    color: #627eea;
}

.icon-bnb {
    background: rgba(243, 186, 47, 0.15);
    color: #f3ba2f;
}

.icon-sol {
    background: rgba(20, 241, 149, 0.15);
    color: #14f195;
}

.icon-custom {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.custom-token-section {
    grid-column: span 2;
    background: rgba(139, 92, 246, 0.05);
    border: 1px dashed rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    padding: 15px;
    margin-top: 5px;
}


/* ==========================================================================
   GLOBAL FORM FIX: Uniform Compact Mode
   Enforcing border-radius: 12px globally and compact sizes.
   ========================================================================== */


#bulk-modal-editor .bme-dex-input,
#bulk-modal-editor .bme-meta-input {
    width: 50px !important;
    text-align: center;
    padding: 0 6px !important;
}

/* Cards and containers with 12px rounded corners */
.card,
.filter-box,
.modal-content,
.header-card,
#scanner-config,
#filter-card {
    border-radius: 12px !important;
}

/* Table container rounded */
#monitoring-scroll {
    border-radius: 12px !important;
}

/* ==========================================================================
   Snapshot Status Styles
   ========================================================================== */

/* Status Bar Base */
.sync-status-bar {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    transition: all 0.3s ease;
}

/* Before Snapshot - Gray */
.sync-status-before {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

/* Processing Snapshot - Yellow/Orange */
.sync-status-processing {
    background: #fef3c7 !important;
    color: #92400e !important;
}

/* After Snapshot Success - Green */
.sync-status-success {
    background: #dcfce7 !important;
    color: #166534 !important;
    animation: pulse-success 0.5s ease-out;
}

/* Pulse animation for success (opacity-only = Composite, GPU-safe) */
@keyframes pulse-success {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.75;
    }
}

/* Snapshot button processing state */
#refresh-snapshot-btn.processing {
    opacity: 0.8;
    cursor: not-allowed;
}

#refresh-snapshot-btn:not(.processing) {
    opacity: 1;
    cursor: pointer;
}

/* ==========================================================================
   CEX Settings - Toggle Switch
   ========================================================================== */
/* Pink toggle for MANY CEX filter */
.manycex-toggle.form-check-input:checked {
    background-color: #eb73a7;
    border-color: #eb73a7;
}

.manychain-toggle.form-check-input:checked {
    background-color: #0ea5e9;
    border-color: #0ea5e9;
}

.manycex-toggle.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(235, 115, 167, 0.25);
}

/* ==========================================================================
   RPC CARDS - CEX Style (matching API Key Exchanger design)
   ========================================================================== */

.rpc-card-cex-style {
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 12px;
    border-left-width: 3px;
    border-left-style: solid;
    transition: all 0.2s ease;
}

.rpc-default-label {
    font-size: 10px;
    color: #64748b;
    margin: 0 0 3px 0;
}

.rpc-default-label span {
    color: #0052ff;
    font-weight: 500;
}

/* ==========================================================================
   CEX TOOLBAR ICONS - Icon-based (like chain icons)
   ========================================================================== */

/* CEX Mode Variables */
:root {
    --cex-primary: #1448ce;
    /* Default: MEXC blue */
    --cex-primary-rgb: 20, 72, 206;
    /* RGB for alpha values */
}

/* CEX Mode Background */
body.cex-mode {
    /* More dominant color: primary to dark variant of primary */
    background: linear-gradient(135deg, var(--cex-primary) 20%, #1a1a1a 100%) !important;
    transition: background 0.6s ease;
}

body.cex-mode .card,
body.cex-mode .header-card,
body.cex-mode #scanner-config {
    background: rgba(255, 255, 255, 0.98) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Toolbar Visibility in CEX Mode */
/* User requested multichain menu to remain visible */
body.cex-mode .toolbar-left a,
body.cex-mode .toolbar-right a {
    display: inline-flex !important;
    /* Force show all items */
}

/* Optional: Highlight active CEX mode in toolbar if needed */
body.cex-mode .toolbar-container {
    border-bottom: 2px solid var(--cex-primary, #ccc);
}

/* CEX icon links - identical styling to chain icons */
.cex-link {
    position: relative;
}

/* ==========================================================================
   UNIFIED CEX MODE STYLES (Referenced by cex-mode-manager.js)
   ========================================================================== */
body.cex-mode-active {
    background-color: var(--cex-bg, #f9fafb) !important;
    background-image: none !important;
    /* Override gradients */
    transition: background-color 0.4s ease;
}

/* Scanner Export/Import icons — tersembunyi by default, tampil hanya di CEX mode */
.scanner-cex-btn {
    display: none !important;
}

body.cex-mode-active .scanner-cex-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* Override inline styles neon pada Import/Export — konsisten dengan palet app */
#scannerImportBtn {
    background: var(--bs-danger) !important;
    border: 1px solid #000 !important;
    color: #fff !important;
    font-size: 13px !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.3) !important;
    transition: opacity 0.15s ease, transform 0.15s ease !important;
}

#scannerImportBtn:hover {
    opacity: 0.9;
    transform: scale(1.08);
}

#scannerExportBtn {
    background: var(--bs-primary) !important;
    border: 1px solid #000 !important;
    color: #fff !important;
    font-size: 13px !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3) !important;
    transition: opacity 0.15s ease, transform 0.15s ease !important;
}

#scannerExportBtn:hover {
    opacity: 0.9;
    transform: scale(1.08);
}

/* Header customization in CEX mode */
body.cex-mode-active .header-card {
    border-top: 3px solid var(--cex-primary, #2563eb) !important;
    background: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   UNIFIED TOOLBAR ICON STYLING
   Applied to: Chain icons, CEX icons, Multichain icon
   ========================================================================== */

/* Base styling for all toolbar icon containers */
.chain-link,
.cex-icon-btn,
#multichain_scanner,
#multicex_scanner {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    border-radius: 50%;
    padding: 2px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    opacity: 1;
}

/* All toolbar icon images */
.chain-link img,
.cex-icon-btn img,
#multichain_scanner img,
#multicex_scanner img {
    border-radius: 50%;
    display: block;
    width: 24px;
    height: 24px;
}

/* Hover effect — seragam untuk semua icon toolbar */
.chain-link:hover,
.cex-icon-btn:hover,
#multichain_scanner:hover,
#multicex_scanner:hover {
    transform: scale(1.1);
}

/* Active state — unified for chain, CEX, multichain */
.chain-link.active,
.cex-icon-btn.active,
#multichain_scanner.active-mode,
#multicex_scanner.active-mode {
    opacity: 1;
    border: 2px solid var(--icon-color, #2563eb);
    box-shadow: 0 0 0 2px var(--icon-shadow, rgba(37, 99, 235, 0.25));
}

/* CEX Mode Badge */
.cex-mode-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    background-color: var(--cex-primary);
    margin-left: 8px;
}

/* ==========================================================================
   COMPACT LAYOUT OVERRIDES — rapatkan margin & padding global
   ========================================================================== */

/* Header card — lebih ramping */
.header-card {
    padding: 5px 10px !important;
}

/* Scanner config card */
#scanner-config {
    padding: 6px 8px !important;
}

/* Progress bar margin */
#progress-container {
    margin-top: 4px !important;
}

/* Scanner button compact */
.scanner-actions .btn {
    height: 26px !important;
    line-height: 26px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 0 14px !important;
    letter-spacing: 0.4px;
}

#monitoring-scroll {
    margin-top: 4px !important;
}

/* ── Filter Section Boxes — warna bg tipis per kategori ── */
.filter-box {
    border-radius: 12px !important;
    padding: 3px 1px;
    margin: 0px 4px;
    border: 1px solid transparent;
}

.filter-box-chain {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.filter-box-cex {
    background: #fff7ed;
    border-color: #fed7aa;
}

.filter-box-dex {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.filter-box-metadex {
    background: #faf5ff;
    border-color: #e9d5ff;
}

.filter-metadex-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.filter-metadex-row .filter-chip {
    flex: 0 0 auto;
    min-width: 150px;
    max-width: 190px;
    white-space: nowrap;
}

.filter-metadex-row .chip-label,
.filter-metadex-row .chip-count {
    white-space: nowrap;
}

.filter-box-pair {
    background: #f8f9fa;
    border-color: #d1d5db;
}

/* dark mode */
.dark-mode .filter-box-chain {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.2);
}

.dark-mode .filter-box-cex {
    background: rgba(251, 146, 60, 0.08);
    border-color: rgba(251, 146, 60, 0.2);
}

.dark-mode .filter-box-dex {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
}

.dark-mode .filter-box-metadex {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.2);
}

.dark-mode .filter-box-pair {
    background: rgba(100, 116, 139, 0.08);
    border-color: rgba(100, 116, 139, 0.2);
}

/* ── Filter Scanner Modal — ukuran & overflow ── */
#scanner-filter-modal .modal-dialog {
    max-width: min(950px, 98vw) !important;
    min-width: 0 !important;
    width: 98vw !important;
    overflow-x: hidden !important;
}

#scanner-filter-modal .modal-body {
    max-height: 80vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 8px 10px !important;
}

#modal-filter-sections {
    overflow-x: hidden;
}

/* ── Filter chip & title: font lebih kecil ── */
.filter-section-title {
    font-size: 11px !important;
    margin-bottom: 6px !important;
    padding-bottom: 3px !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    border-bottom: 1px solid #e5e7eb;
    color: #1e293b;
    text-align: center;
}

/* Ringkasan CEX→Chain→Pair + Profil Widget */
.filter-summary-ring {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    padding: 5px 10px !important;
    /* background: #e4f2ff; */
    border-radius: 10px;
    border: 2px solid #d8841d !important;
    /* border-bottom: 1px solid #e2e8f0 !important; */
    text-align: left !important;
    opacity: 1 !important;
}

/* Profil Filter Widget — komponen di sisi kanan filter-summary-ring */
.fp-select {
    height: 24px !important;
    font-size: 10px !important;
    padding: 0 6px !important;
    border-radius: 6px !important;
    min-width: 120px;
    max-width: 180px;
    border: 1px solid #cbd5e1 !important;
    background: #fff !important;
    color: #1e293b !important;
}

.fp-input {
    height: 24px !important;
    font-size: 10px !important;
    padding: 0 8px !important;
    border-radius: 6px !important;
    min-width: 110px;
    max-width: 160px;
    border: 1px solid #cbd5e1 !important;
    background: #fff !important;
    color: #1e293b !important;
}

.fp-btn {
    height: 24px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    border-radius: 6px !important;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.fp-divider {
    width: 1px;
    height: 20px;
    background: #cbd5e1;
    flex-shrink: 0;
    margin: 0 2px;
}


.fsr-label {
    font-size: 13px;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.06em;
    white-space: nowrap;
    margin-right: 2px;
}

.fsr-arrow {
    font-size: 11px;
    color: #cbd5e1;
    font-weight: 700;
}

.fsr-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.fsr-badge b {
    font-weight: 900;
    font-size: 10px;
}

.fsr-cex {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.fsr-chain {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.fsr-pair {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

body.dark-mode .filter-summary-ring {
    background: #1e293b;
    border-color: #334155 !important;
}

/* Dark mode: profil widget */
body.dark-mode .fp-select,
body.dark-mode .fp-input {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #f9fafb !important;
}

body.dark-mode .fp-divider {
    background: #374151;
}


body.dark-mode .fsr-cex {
    background: #451a03;
    color: #fbbf24;
    border-color: #92400e;
}

body.dark-mode .fsr-chain {
    background: #1e3a5f;
    color: #93c5fd;
    border-color: #1e40af;
}

body.dark-mode .fsr-pair {
    background: #052e16;
    color: #86efac;
    border-color: #166534;
}

/*
.filter-chip {
    padding: 2px 5px !important;
    height: 22px !important;
    font-size: 11px !important;
} */

.filter-chip .chip-label {
    font-size: 9px !important;
}

.filter-chip .chip-count {
    font-size: 8px !important;
}

/* Pair chips — lebih besar dari filter chip biasa */
.fc-row-pair-lbl,
.fc-row-chain-pair-lbl,
.cex-card-pair-lbl {
    padding: 4px 8px !important;
    height: 28px !important;
    font-size: 12px !important;
}

.fc-row-pair-lbl .chip-label,
.fc-row-chain-pair-lbl .chip-label,
.cex-card-pair-lbl .chip-label {
    font-size: 11px !important;
}

.fc-row-pair-lbl .chip-count,
.fc-row-chain-pair-lbl .chip-count,
.cex-card-pair-lbl .chip-count {
    font-size: 10px !important;
}

.filter-chip input[type="checkbox"] {
    width: 9px !important;
    height: 9px !important;
}

/* ===== CEX Chain Cards (filter modal 3-column grid layout) ===== */
.cex-chain-cards-section {
    border-color: #0d0d0d;
    padding: 6px 8px !important;
}

.cex-grid-header {
    display: flex;
    gap: 6px;
    padding: 2px 4px 4px;
    font-size: 11px;
    font-weight: 700;
    color: #0b0b0b;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 4px;
    text-align: center;
    background-color: aliceblue;
}

.cex-chain-rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cex-chain-row {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 0px 6px;
    border-radius: 12px;
    transition: background 0.1s, border-left-color 0.1s;
}

.cex-col-chain {
    width: 150px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    min-height: 40px;
}

.cex-col-pairs {
    flex: 1.5;
    min-width: 0;
    display: flex;
    align-items: center;
    min-height: 40px;
    flex-wrap: wrap;
    gap: 4px;
}

.cex-col-profile {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 40px;
}

/* Pair wrapper — memastikan pair chip & profil inline seragam tinggi */
.fc-row-pair-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.flex-150 {
    width: 150px !important;
    flex-shrink: 0;
}

.flex-160 {
    width: 200px !important;
    flex-shrink: 0;
}

/* Profil select yang muncul inline di dalam kolom pair */
.cex-prof-inline {
    margin-top: 2px;
}

.cex-prof-inline select {
    font-size: 12px !important;
    height: 32px !important;
    padding: 4px 8px !important;
    border: 1px solid #ddd !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #555;
    cursor: pointer;
    min-width: 120px;
    max-width: 220px;
}

.cex-card-chain-lbl {
    font-weight: 700;
    font-size: 11px !important;
    white-space: nowrap;
}

.cex-chain-profile-select {
    width: 100%;
    font-size: 12px !important;
    height: 32px !important;
    padding: 4px 8px !important;
    border: 1px solid #ddd !important;
    border-radius: 12px !important;
    background: #fff !important;
    cursor: pointer;
    outline: none;
}

.cex-chain-profile-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6 !important;
    color: #aaa !important;
}

/* Wrapper-level block — more reliable than pointer-events on native <select> */
.profile-sel-wrap {
    position: relative;
}

.profile-sel-wrap.is-disabled {
    pointer-events: none !important;
    opacity: 0.4;
}

.profile-sel-wrap.is-disabled select {
    background: #f3f4f6 !important;
    color: #aaa !important;
    cursor: not-allowed;
}

/* Editor Profil button in filter modal summary bar */
.modal-profil-editor-btn {
    height: 24px !important;
    line-height: 22px !important;
    padding: 0 8px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    border: 1px solid #c7d2fe !important;
    background: #eef2ff !important;
    color: #4338ca !important;
    white-space: nowrap;
    cursor: pointer;
    letter-spacing: 0.02em;
}

.modal-profil-editor-btn:hover {
    background: #e0e7ff !important;
    border-color: #818cf8 !important;
}

/* ===== Per-Chain Filter (Single Chain Mode) — 3-column layout ===== */
.sc-cex-rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Header 3-kolom: EXCHANGER | PAIR | PROFIL MODAL */
.sc-cex-grid-header {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 6px;
}

/* Row 2-kolom untuk Per-Chain CEX (exchanger | pair & profil) */
.sc-cex-3col-row {
    display: grid !important;
    grid-template-columns: 110px 1fr;
    gap: 6px;
    align-items: flex-start;
}

/* Kolom exchanger */
.sc-col-cex {
    flex-shrink: 0;
    padding-top: 2px;
}

/* Kolom pair — flex wrap untuk multiple pair */
.sc-col-pairs {
    min-width: 0;
    padding-top: 1px;
}

/* Kolom profil modal */
.sc-col-profile {
    width: 148px;
    flex-shrink: 0;
}

/* Area pair chips per-CEX — wrap agar banyak pair tetap rapi */
.sc-cex-pairs-area {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    align-items: center;
}

/* Item pasangan pair chip + override profil — horizontal inline */
.sc-cex-pair-item {
    display: flex;
    flex-direction: row;
    gap: 4px;
    align-items: center;
    flex-wrap: nowrap;
}

.sc-cex-pair-item select {
    font-size: 11px !important;
    height: 18px !important;
    padding: 0 2px !important;
    width: 106px;
    border: 1px solid #ddd;
    border-radius: 12px;
    color: #777;
    background: #fafafa;
}

/* Hint disabled */
.sc-cex-pairs-hint {
    font-size: 9px;
    color: #94a3b8;
    font-style: italic;
    padding-top: 3px;
}

/* Row disabled visual (chain/cex tidak dicentang) */
.cex-chain-row.is-row-disabled .sc-col-pairs,
.cex-chain-row.is-row-disabled .sc-col-profile,
.cex-chain-row.is-row-disabled .cex-col-pairs,
.cex-chain-row.is-row-disabled .cex-col-profile {
    opacity: 0.4;
    pointer-events: none;
}

/* Hint panah di kolom pair/profil saat chain belum dipilih */
.cex-row-disabled-hint {
    font-size: 9px;
    color: #94a3b8;
    font-style: italic;
    line-height: 2;
}

/* DEX wrapper (per-chain — full width, stacked) */
.sc-dex-meta-row {
    display: block;
}

.cex-profile-detail {
    display: none;
    margin-top: 3px;
    padding: 3px 5px;
    background: #eef4ff;
    border-radius: 12px;
    font-size: 9px;
    line-height: 1.5;
}

.cex-pd-item {
    display: inline-block;
    margin-right: 6px;
    white-space: nowrap;
    font-size: 9px;
    color: #334155;
}

.cex-pairs-hint {
    font-size: 11px;
    color: #aaa;
    font-style: italic;
    line-height: 1.8;
    display: flex;
    align-items: center;
    min-height: 28px;
    padding: 0 4px;
}

.cex-chain-pairs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

/* Dark mode */
.dark-mode .cex-chain-cards-section {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(100, 116, 139, 0.3);
}

.dark-mode .cex-grid-header {
    color: #64748b;
    border-bottom-color: rgba(100, 116, 139, 0.25);
}

.dark-mode .cex-chain-row {
    color: #e2e8f0;
}

.dark-mode .cex-chain-profile-select {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

.dark-mode .cex-profile-detail {
    background: rgba(30, 58, 138, 0.25);
}

.dark-mode .cex-pd-item {
    color: #93c5fd;
}

.dark-mode .cex-pairs-hint {
    color: #64748b;
}

/* ===== Sync Modal: WD / DP Checkbox Filter Labels ===== */
.sync-wallet-label {
    transition: opacity 0.15s;
    -webkit-user-select: none;
    user-select: none;
}

/* ===== Sync Modal: Clear/Batal Button ===== */
.sync-clear-btn {
    border: 1px solid #ddd;
    background: none;
    padding: 1px 7px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    border-radius: 12px;
    color: #bbb;
    line-height: 1.6;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.sync-clear-btn:hover {
    color: #f44336;
    border-color: #f44336;
    background: #fff5f5;
}

.sync-clear-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

/* ==========================================================================
   TOOLBAR DROPDOWN STYLING
   ========================================================================== */

/* ==========================================================================
   TOOLBAR DROPDOWN STYLING (PREMIUM REFACTOR)
   ========================================================================== */

.toolbar-btn-dropdown {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    /* Perfect Pill */
    padding: 0 8px 0 14px;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    height: 30px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.toolbar-btn-dropdown:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.toolbar-btn-dropdown.active {
    background: color-mix(in srgb, var(--active-color, #2563eb) 8%, white);
    border-color: var(--active-color, #2563eb);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--active-color, #2563eb) 15%, transparent);
}

.toolbar-label {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.toolbar-btn-dropdown.active .toolbar-label {
    color: var(--active-color, #2563eb);
}

.toolbar-btn-dropdown .bi-chevron-down {
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.toolbar-btn-dropdown:hover .bi-chevron-down {
    color: #64748b;
}

.toolbar-btn-dropdown.show .bi-chevron-down {
    transform: rotate(180deg);
}

.toolbar-btn-dropdown img.icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 12px;
}

/* Glassmorphism Dropdown Menu */
.chain-dropdown-menu {
    min-width: 200px;
    padding: 8px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5) !important;
    margin-top: 8px !important;
    animation: dropdownFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chain-dropdown-menu li {
    margin-bottom: 2px;
}

.chain-dropdown-menu li:last-child {
    margin-bottom: 0;
}

.chain-item,
.cex-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 6px 10px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    text-decoration: none !important;
    border-left: 3px solid transparent !important;
}

.chain-item:hover,
.cex-item:hover {
    background: color-mix(in srgb, var(--item-color, #f1f5f9) 10%, white) !important;
    color: var(--item-color, #1e293b) !important;
    padding-left: 16px !important;
    /* Subtle shift on hover */
    border-left-color: var(--item-color, transparent) !important;
}

.chain-dropdown-menu li.active .chain-item,
.chain-dropdown-menu li.active .cex-item {
    background: color-mix(in srgb, var(--item-color, #2563eb) 12%, white) !important;
    color: var(--item-color, #1d4ed8) !important;
    border-left-color: var(--item-color) !important;
}

.chain-item img,
.cex-item img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.chain-item:hover img,
.cex-item:hover img {
    transform: scale(1.1) rotate(5deg);
}

/* Dark Mode Support for Dropdowns */
body.dark-mode .toolbar-btn-dropdown {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.dark-mode .toolbar-btn-dropdown:hover {
    background: #334155;
    border-color: #475569;
}

body.dark-mode .toolbar-label {
    color: #e2e8f0;
}

body.dark-mode .chain-dropdown-menu {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2) !important;
}

body.dark-mode .chain-item,
body.dark-mode .cex-item {
    color: #cbd5e1 !important;
}

body.dark-mode .chain-item:hover,
body.dark-mode .cex-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* CEX Card Style for Per-Chain Mode - COMPACT */
.sc-cex-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 4px 6px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.sc-cex-card.active {
    border-color: var(--bs-primary);
    background: #f0f9ff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sc-cex-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    padding-bottom: 2px;
    border-bottom: 1px solid #f1f5f9;
}

.sc-cex-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.sc-cex-card-pair-item {
    display: flex;
    align-items: center;
    gap: 3px;
    background: #fff;
    padding: 1px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

/* ==========================================================================
   BOOTSTRAP 5 COMPATIBILITY LAYER
   Maps Bootstrap 5 classes to match existing custom UIKit-based styles.
   Bootstrap 5 compatibility overrides.
   ========================================================================== */

/* ── App Container ── */
.app-container {
    max-width: 100%;
    padding-left: 4px;
    padding-right: 4px;
}

/* ── Section Heading ── */
.section-heading {
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0;
    padding: 2px 0;
}

/* ── Bootstrap Cards ── */
.card {
    background: var(--surface-0) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: none !important;
    transition: var(--transition-smooth);
}

.card-body {
    padding: 8px 10px !important;
}

.card-hover:hover {
    border-color: var(--border-strong) !important;
    background: var(--surface-0) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* ── Bootstrap Modal Overrides ── */
.modal-content {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05) !important;
}

.modal-header {
    background: var(--surface-1) !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-radius: 12px 8px 0 0 !important;
    padding: 6px 10px !important;
}

.modal-body {
    padding: 8px 10px !important;
}

.modal-footer {
    padding: 6px 10px !important;
    border-top: 1px solid var(--border-color) !important;
}

/* Modal close button */
.btn-close {
    width: 28px !important;
    height: 28px !important;
    padding: 5px !important;
    background: rgba(0, 0, 0, 0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3E%3C/svg%3E") center/12px no-repeat !important;
    border-radius: 50% !important;
    transition: var(--transition-smooth) !important;
    opacity: 0.7;
}

.btn-close:hover {
    background-color: rgba(0, 0, 0, 0.1) !important;
    transform: rotate(90deg);
    opacity: 1;
}

/* ── Bootstrap Table Overrides ── */
.table {
    table-layout: auto;
    width: 100%;
}

.table>thead>tr>th {
    border-bottom: 2px solid var(--border-strong) !important;
    font-weight: 700 !important;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 5px 7px !important;
    font-size: 12px !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff !important;
    border-right: 1px solid var(--border-color);
}

.table>tbody>tr>td {
    font-size: 11px !important;
    padding: 4px 6px !important;
    vertical-align: middle !important;
    transition: background-color 0.1s ease;
    border-bottom: 1px solid var(--border-color) !important;
}

.table>tbody>tr {
    background-color: var(--surface-0);
    transition: background-color 0.1s ease;
}

.table>tbody>tr:nth-child(even) {
    background-color: var(--surface-2);
}

.table>tbody>tr:hover {
    background-color: #eff6ff;
    --bs-table-bg-state: transparent;
}

/* ── Bootstrap Button Overrides ── */
.btn {
    border-radius: 12px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    transition: var(--transition-smooth) !important;
    line-height: 1 !important;
}

.btn-sm {
    height: 26px !important;
    padding: 0 12px !important;
    font-size: 11px !important;
    border-radius: 12px !important;
    line-height: 24px !important;
}

.btn-xs {
    height: 22px !important;
    padding: 0 8px !important;
    font-size: 10px !important;
    border-radius: 12px !important;
    line-height: 20px !important;
    font-weight: 600 !important;
}

.btn-primary {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.btn-primary:hover {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}

.btn-secondary {
    background-color: var(--bs-secondary) !important;
    border-color: var(--bs-secondary) !important;
}

.btn-success {
    background-color: var(--bs-success) !important;
    border-color: var(--bs-success) !important;
}

.btn-danger {
    background-color: var(--bs-danger) !important;
    border-color: var(--bs-danger) !important;
}

.btn-warning {
    background-color: var(--bs-warning) !important;
    border-color: var(--bs-warning) !important;
    color: #1f2937 !important;
}

/* ── Bootstrap Form Controls Override ── */
.form-control,
.form-select {
    border-radius: 12px !important;
    transition: var(--transition-smooth);
    background: #ffffff;
    border: 1px solid var(--border-color) !important;
    font-weight: 500;
    font-size: 13px !important;
    padding: 0 10px !important;
    line-height: 24px !important;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--bs-primary) !important;
    box-shadow: var(--shadow-focus) !important;
}

.form-control-sm,
.form-select-sm {
    height: 26px !important;
    padding: 2px 8px !important;
    font-size: 11px !important;
    border-radius: 12px !important;
    min-height: 26px !important;
}


/* ── Chain / CEX Dropdown Menu Width ── */
.chain-dropdown-menu {
    min-width: 220px;
}


/* ── Toolbar Dropdown — Bootstrap nav aliases ── */
.toolbar-dropdown .dropdown-menu {
    min-width: 218px;
    padding: 8px !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #f3f4f6 !important;
}

.toolbar-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #4b5563 !important;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.toolbar-dropdown .dropdown-item:hover,
.toolbar-dropdown .dropdown-item:focus {
    background: #f9fafb !important;
    color: #111827 !important;
}

.toolbar-dropdown .dropdown-item.active,
.toolbar-dropdown .dropdown-item:active {
    background: var(--item-active-bg, #eff6ff) !important;
    color: var(--item-active-color, #1d4ed8) !important;
    font-weight: 700 !important;
}

.toolbar-dropdown .dropdown-item img {
    border-radius: 12px;
    width: 20px;
    height: 20px;
}

/* ── Specific Modals Bootstrap Overrides ── */
#sync-modal .modal-content {
    max-width: 90vw;
}

#sync-modal .modal-header {
    padding: 10px 16px !important;
}

#sync-modal .modal-body {
    padding: 10px 16px !important;
    max-height: 90vh;
    overflow-y: auto;
}

#sync-modal .modal-footer {
    padding: 8px 16px !important;
}

#scanner-filter-modal .modal-content {
    max-width: min(1200px, 98vw) !important;
    min-width: 0 !important;
    width: 98vw !important;
    overflow-x: hidden !important;
}

#scanner-filter-modal .modal-body {
    max-height: 80vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 8px 10px !important;
}


/* ── Dark Mode: Bootstrap Classes ── */
.dark-mode .modal-content {
    background: #1a1d2e !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0;
}

.dark-mode .modal-header {
    background: #262a3d !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0;
}

.dark-mode .modal-footer {
    background: #424450 !important;
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

.dark-mode .modal-body {
    background: #1a1d2e !important;
    color: #e2e8f0;
}

.dark-mode .card {
    background: #1a1d2e !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0;
}

.dark-mode .card-body {
    background: #1a1d2e !important;
    color: #e2e8f0;
}

.dark-mode .form-control,
.dark-mode .form-select {
    background: #1a1d2e !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
}

.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.dark-mode .table>thead>tr>th {
    background: #262a3d !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark-mode .table>tbody>tr {
    background-color: #1a1d2e !important;
    color: #e2e8f0;
}

.dark-mode .table>tbody>tr:nth-child(even) {
    background-color: #1e2235;
}

.dark-mode .table>tbody>tr:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.dark-mode .table>tbody>tr>td {
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}


/* ── Bootstrap form-check compact ── */
.form-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-left: 0;
    margin-bottom: 0;
}

.form-check-input {
    margin-top: 0 !important;
    flex-shrink: 0;
    accent-color: var(--bs-primary);
}

.form-check-label {
    font-size: 13px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

/* ── CEX mode: Bootstrap card ── */
body.cex-mode .card,
body.cex-mode .modal-content {
    background: rgba(255, 255, 255, 0.98) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}


/* ==========================================================================
   UTILITY CLASSES — Pengganti inline style duplikat di seluruh proyek
   Naming: selaras Bootstrap (lowercase, hyphen), tanpa prefix tambahan.
   ========================================================================== */

/* ── Visibility (JS toggle: tetap pakai .style.display untuk state mgmt) ── */
.hidden {
    display: none !important;
}

/* ── Icon sizes ── */
.icon-sm {
    width: 18px;
    height: 18px;
    border-radius: 12px;
    object-fit: contain;
}

.icon-round {
    border-radius: 50%;
    object-fit: contain;
}

.icon-cex {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    margin-right: 6px;
}

.icon-toolbar {
    width: 20px;
    height: 20px;
}

.icon-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 12px;
}

/* ── Typography sizes ── */
.fs-9 {
    font-size: 9px !important;
}

.fs-10 {
    font-size: 10px !important;
}

.fs-11 {
    font-size: 11px !important;
}

.fs-12 {
    font-size: 12px !important;
}

.fs-13 {
    font-size: 13px !important;
}

.fs-14 {
    font-size: 14px !important;
}

/* ── Input widths ── */
.input-w-50 {
    width: 50px;
}

.input-w-60 {
    width: 60px;
}

.input-w-65 {
    width: 65px;
}

.input-w-70 {
    width: 70px;
}

.input-w-80 {
    width: 80px;
}

.input-w-150 {
    width: 150px;
}

.input-center {
    text-align: center;
}

.input-sm-60 {
    width: 60px;
    text-align: center;
}

.input-sm-70 {
    width: 70px;
    text-align: center;
}

/* ── Table column widths ── */
.col-w-20 {
    width: 20px;
}

.col-w-30 {
    width: 30px;
}

.col-w-32 {
    width: 32px;
}

.col-w-40 {
    width: 40px;
}

.col-w-50 {
    width: 50px;
}

.col-w-60 {
    width: 60px;
}

.col-w-80 {
    width: 80px;
}

.col-w-90 {
    width: 90px;
}

.col-w-100 {
    width: 100px;
}

.col-w-120 {
    width: 120px;
}

.col-w-140 {
    width: 140px;
}

.col-w-160 {
    width: 160px;
}

/* ── Flex helpers (tambahan dari Bootstrap) ── */
.flex-col-gap-4 {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.flex-col-gap-6 {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.flex-wrap-gap-4 {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

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

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

.flex-wrap-gap-10 {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ── Label inline block ── */
.label-inline-50 {
    min-width: 50px;
    display: inline-block;
}

.label-inline-60 {
    min-width: 60px;
    display: inline-block;
}

.label-inline-64 {
    min-width: 64px;
    display: inline-block;
}

/* ── Status indicator spans (WD/Depo open/closed) ── */
.status-open {
    color: #28a745;
    font-size: 14px;
}

.status-closed {
    color: #dc3545;
    font-size: 14px;
}

.status-open-sm {
    color: #28a745;
    font-size: 10px;
}

.status-closed-sm {
    color: #dc3545;
    font-size: 10px;
}

/* ── Colored summary label (warna dinamis via CSS var) ── */
.summary-label {
    color: var(--dyn-color, inherit);
    margin: 2px;
    font-weight: bolder;
}

.dyn-chip-bg {
    background: var(--dyn-bg, #666);
}

/* ── Badge variants ── */
.badge-solana {
    background: #6b21a8 !important;
    font-size: 10px;
}

.badge-solana-sm {
    background: #6b21a8 !important;
    font-size: 9px;
}

.badge-evm-sm {
    background: #0ea5e9 !important;
    font-size: 9px;
}

.badge-all-sm {
    background: #6b21a8 !important;
    font-size: 9px;
}

/* ── Transform ── */
.scale-80 {
    transform: scale(0.8);
}

/* ── Text helpers ── */
.text-nowrap {
    white-space: nowrap;
}

.text-uppercase {
    text-transform: uppercase;
}

.word-break-all {
    word-break: break-all;
}

/* ── Cursor ── */
.cursor-pointer {
    cursor: pointer;
}

/* ── Border accent (warna dinamis via CSS var) ── */
.border-left-dyn {
    border-left: 4px solid var(--dyn-color, #666);
}

.border-left-3-dyn {
    border-left: 3px solid var(--dyn-color, #666);
}

/* ── Progress status ── */
.progress-status {
    font-size: 12px;
    font-weight: bold;
    color: green;
}

/* ── Monitoring scroll container ── */
.monitoring-scroll {
    max-height: calc(100vh - 220px);
}

/* ── Scanner form ── */
.scanner-form-gap {
    gap: 6px;
}

/* ── Monitoring thead ── */
.thead-scanner {
    background: #5c9514;
}

/* ── RPC card ── */
.rpc-label-sm {
    font-size: 0.72rem;
    opacity: 0.8;
}

.rpc-url-color {
    color: #0052ff;
    word-break: break-all;
}

.wallet-input-sm {
    font-size: 0.78rem;
    margin-top: 3px;
}

/* ── Settings sticky header ── */
.sticky-header-card {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
}

/* ── Autorun unit label ── */
.autorun-unit {
    font-size: 10px;
    color: #16a34a;
    font-weight: 600;
}

/* ── AutoVol level input ── */
.autovol-input {
    width: 50px;
    border: 2px solid #2563eb;
}

.autorun-input {
    width: 60px;
    border: 2px solid #16a34a;
}

/* ── Search input in toolbar ── */
.search-input-sm {
    width: 150px;
    margin-left: 7px;
    font-size: 12px;
}

/* ── Modal heading bar ── */
.modal-heading-bar {
    border-radius: 12px;
    padding: 4px;
}

.modal-heading-bar h4 {
    color: white;
    letter-spacing: 1px;
}


/* ── Filter sync panel ── */
.sync-filter-wrap {
    max-height: 50px;
    overflow: auto;
}

.sync-table-wrap {
    max-height: 58vh;
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 12px;
}

.sync-dex-wrap {
    max-height: 58vh;
    padding-right: 2px;
}

/* ── Sync toolbar filter bar ── */
.sync-filter-bar {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 12px;
}

/* ── Sticky thead ── */
.thead-sticky {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ── History modal scroll ── */
.history-scroll {
    max-height: 60vh;
    border: 1px solid #ddd;
    border-radius: 12px;
}

/* ── Import card border ── */
.card-border-success {
    border: 2px solid #28a745;
}

.card-border-danger {
    border: 2px solid #dc3545;
}

/* ── Scanner filter modal scroll ── */
.filter-modal-body {
    max-height: 50vh;
    overflow-y: auto;
}

.filter-modal-fs {
    font-size: 11px;
}

/* ── Token management ── */
.token-mgmt-card {
    border: 1px solid black;
}

.manager-scroll {
    max-height: 100vh;
}

/* ── Iframe section ── */
.iframe-section {
    height: 85vh;
}

.iframe-full {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
}

/* ── Select bg ── */
.select-light-bg {
    background: #f8f8f8;
}

/* ── DEX/Meta filter box override ── */
.filter-box-no-border {
    padding: 2px 0;
    border: none;
}

/* ── dex-chip with dynamic background ── */
.dyn-chip {
    background: var(--dyn-bg, #666);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* ── scanner empty placeholder ── */
.scanner-empty-ph {
    margin-top: 16px;
}

/* ── flat-dialog overlay root ── */
#flat-dialog-root {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

/* ── flat-dialog box ── */
.flat-dialog-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);
    min-width: 340px;
    max-width: min(540px, 95vw);
    padding: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transform: scale(0.94) translateY(-8px);
    transition: transform 0.2s cubic-bezier(.34, 1.56, .64, 1), opacity 0.15s ease;
    opacity: 0;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.flat-dialog-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.flat-dialog-header-icon {
    flex-shrink: 0;
}

.flat-dialog-header-title {
    font-weight: 700;
    font-size: 15px;
    color: #111827;
    letter-spacing: -0.01em;
}

.flat-dialog-body {
    padding: 20px 20px 8px;
    display: flex;
    align-items: flex-start;
}

.flat-dialog-body-icon {
    flex-shrink: 0;
    margin-right: 12px;
    padding-top: 2px;
}

.flat-dialog-body-inner {
    flex: 1;
}

.flat-dialog-content {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.flat-dialog-details {
    padding: 6px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #f3f4f6;
    font-size: 12px;
    color: #4b5563;
    line-height: 1.5;
}

.flat-dialog-input-wrap {
    padding: 4px 16px 8px;
}

.flat-dialog-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 7px 10px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.12s, box-shadow 0.12s;
}

.flat-dialog-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.flat-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 18px;
}

.flat-dialog-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, opacity 0.12s;
    letter-spacing: 0.3px;
    line-height: 1.4;
    white-space: nowrap;
}

.flat-dialog-btn:hover {
    opacity: 0.85;
}

.flat-dialog-btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.flat-dialog-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}

.flat-dialog-btn-danger {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.flat-dialog-btn-success {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}

/* =====================================================
   UTILITY CLASSES — Migrated from inline styles
   ===================================================== */

/* --- Cursor --- */
.cursor-pointer {
    cursor: pointer;
}

/* --- Font sizes --- */
.fs-10 {
    font-size: 10px;
}

.fs-11 {
    font-size: 11px;
}

.fs-12 {
    font-size: 12px;
}

.fs-13 {
    font-size: 13px;
}

.fs-14 {
    font-size: 14px;
}

/* --- Text --- */
.text-nowrap {
    white-space: nowrap;
}

/* --- Flex layout helpers --- */
.flex-col-gap-4 {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.flex-col-gap-6 {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* --- Input widths (centered text) --- */
.input-sm-50 {
    width: 50px;
    text-align: center;
}

.input-sm-60 {
    width: 60px;
    text-align: center;
}

.input-sm-70 {
    width: 70px;
    text-align: center;
}

.input-w-65 {
    width: 65px;
}

.input-w-80 {
    width: 80px;
}

/* --- Column widths --- */
.col-w-20 {
    width: 20px;
}

.col-w-30 {
    width: 30px;
}

.col-w-32 {
    width: 32px;
}

.col-w-40 {
    width: 40px;
}

.col-w-50 {
    width: 50px;
}

.col-w-60 {
    width: 60px;
}

.col-w-80 {
    width: 80px;
}

.col-w-90 {
    width: 90px;
}

.col-w-100 {
    width: 100px;
}

.col-w-120 {
    width: 120px;
}

.col-w-160 {
    width: 160px;
}

/* --- Label inline blocks --- */
.label-inline-50 {
    min-width: 50px;
    display: inline-block;
}

.label-inline-60 {
    min-width: 60px;
    display: inline-block;
}

.label-inline-64 {
    min-width: 64px;
    display: inline-block;
}

/* --- Summary label (stats) --- */
.summary-label {
    margin: 2px;
    font-weight: bolder;
}

/* --- Status indicators --- */
.status-open {
    color: #28a745;
    font-size: 14px;
}

.status-closed {
    color: #dc3545;
    font-size: 14px;
}

.status-open-sm {
    color: #28a745;
    font-size: 10px;
}

.status-closed-sm {
    color: #dc3545;
    font-size: 10px;
}

/* --- Icon styles --- */
.icon-round {
    border-radius: 50%;
    object-fit: contain;
}

.icon-sm {
    border-radius: 12px;
    object-fit: contain;
}

.icon-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 12px;
}

/* --- Badge variants --- */
.badge-solana {
    background: #6b21a8;
    font-size: 10px;
}

.badge-evm-sm {
    background: #0ea5e9;
    font-size: 9px;
}

.badge-all-sm {
    background: #6b21a8;
    font-size: 9px;
}

/* --- Dynamic border (via CSS variable --dyn-color) --- */
.border-left-dyn {
    border-left: 4px solid var(--dyn-color, #333);
}

.border-left-3-dyn {
    border-left: 3px solid var(--dyn-color, #333);
}

/* --- Scanner form --- */
.scanner-form-gap {
    gap: 6px;
}

.autovol-input {
    width: 50px;
    border: 2px solid #2563eb;
}

.autorun-input {
    width: 60px;
    border: 2px solid #16a34a;
}

.autorun-unit {
    font-size: 10px;
    color: #16a34a;
    font-weight: 600;
}

/* --- Search input --- */
.search-input-sm {
    width: 150px;
    margin-left: 7px;
    font-size: 12px;
}

/* --- Progress status --- */
.progress-status {
    font-size: 12px;
    font-weight: bold;
    color: green;
}

/* --- Monitoring table scroll --- */
.monitoring-scroll {
    max-height: calc(100vh - 220px);
}

/* --- Table heads --- */
.thead-scanner {
    background: #5c9514;
}

.thead-sticky {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* --- Cards & Sections --- */
.sticky-header-card {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
}

.token-mgmt-card {
    border: 1px solid black;
}

.manager-scroll {
    max-height: 100vh;
}

.card-border-success {
    border: 2px solid #28a745;
}

.card-border-danger {
    border: 2px solid #dc3545;
}

/* --- Iframe section --- */
.iframe-section {
    height: 85vh;
}

.iframe-full {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
}

/* --- Modal heading bar --- */
.modal-heading-bar {
    border-radius: 12px;
    padding: 4px;
}

.modal-heading-bar h4 {
    color: white;
    letter-spacing: 1px;
}

/* --- Select light bg --- */
.select-light-bg {
    background: #f8f8f8;
}

/* --- Filter box no border --- */
.filter-box-no-border {
    padding: 2px 0;
    border: none;
}

/* --- Section heading small --- */
.section-heading-sm {
    font-size: 13px;
}

/* --- Sync section --- */
.sync-filter-wrap {
    max-height: 50px;
    overflow: auto;
}

.sync-filter-bar {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 12px;
}

.sync-table-wrap {
    max-height: 58vh;
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 12px;
}

/* --- History scroll --- */
.history-scroll {
    max-height: 60vh;
    border: 1px solid #ddd;
    border-radius: 12px;
}

/* --- Filter modal --- */
.filter-modal-body {
    max-height: 50vh;
    overflow-y: auto;
}

.filter-modal-fs {
    font-size: 11px;
}

/* --- RPC labels --- */
.rpc-label-sm {
    font-size: 0.72rem;
    opacity: 0.8;
}

.rpc-url-color {
    color: #0052ff;
    word-break: break-all;
}

/* --- Wallet input small --- */
.wallet-input-sm {
    font-size: 0.78rem;
    margin-top: 3px;
}

/* --- Scanner empty placeholder --- */
.scanner-empty-ph {
    margin-top: 16px;
}

/* --- Modal Filter Specifics --- */
.modal-badge-group {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 0;
    /* Removed margin to align with flex container */
}

.modal-badge-info {
    font-weight: 700;
    color: #475569;
    background: #f8fafc;
    padding: 3px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    letter-spacing: 0.01em;
    font-size: 10.5px;
}

.modal-badge-accent {
    font-weight: 700;
    color: white;
    padding: 3px 10px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    letter-spacing: 0.01em;
    font-size: 10.5px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* --- Empty States --- */
.empty-state-box {
    padding: 24px 16px;
    text-align: center;
}

.empty-state-title {
    font-size: 13px;
    font-weight: 700;
    color: #e74c3c;
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 12px;
    color: #666;
}

/* --- Filter Modal Layout --- */
.filter-section-row {
    margin-bottom: 15px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.filter-inner-row {
    background: #ffffff;
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    justify-content: space-between;
    /* Added to push items to opposite sides */
}

.filter-nested-group {
    gap: 8px;
    display: flex;
    align-items: center;
}

/* --- Misc Utils --- */
.scale-80 {
    transform: scale(0.8);
}

.ls-02 {
    letter-spacing: 0.02em;
}

.flex-160 {
    flex: 0 0 160px;
}

.flex-150 {
    flex: 0 0 150px;
}

/* --- Filter Toggles (Many Chain/CEX) --- */
/* ── Premium UI Design System ── */
.premium-editor-modal,
.premium-sync-modal {
    border-radius: 20px !important;
    overflow: hidden;
    background: #f8fafc;
    max-height: 95vh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

.premium-modal-header {
    padding: 20px 24px 15px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.premium-modal-title {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    margin: 0;
    letter-spacing: -0.01em;
}

.premium-modal-title i {
    color: #3b82f6;
    font-size: 18px;
}

.premium-modal-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.premium-modal-footer {
    padding: 15px 24px 20px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0 !important;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Rounded Pill Button for Footer (Tutup Style) */
.btn-premium-pill {
    border-radius: 20px;
    padding: 6px 20px;
    font-weight: 700;
    font-size: 12px;
    transition: all 0.2s ease;
}

/* Custom scroll area for sync table */
.sync-table-wrap {
    height: calc(95vh - 380px);
    min-height: 450px;
    overflow-y: auto;
    overflow-x: auto;
    background: #fff;
    border-radius: 0 0 16px 16px;
    border: 1px solid #e2e8f0;
    border-top: none;
}

#sync-table {
    min-width: 620px;
    /* Cegah tabel collapse di layar sempit */
}

/* ── Form Editor Koin — Standardized 12px design system ── */
#FormEditKoinModal .modal-body {
    font-size: 12px;
}

.ed-label {
    font-size: 13px;
    font-weight: 700;
    color: #0a0a0a;
    display: block;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.ed-input {
    font-size: 12px !important;
    padding: 5px 8px !important;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    height: 32px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ed-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

#mgrChain {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    line-height: 1;
    vertical-align: middle;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Desimal input — only 2 digits, fixed narrow width */
.ed-input-des {
    width: 65px !important;
    flex-shrink: 0;
}

/* DEX modal number input — consistent across DEX and MetaDEX */
.ed-input-num {
    width: 70px !important;
    flex-shrink: 0;
    font-size: 11px !important;
    padding: 3px 6px !important;
    height: 28px !important;
}

/* Form editor specific overrides */
#FormEditKoinModal .form-check-label {
    font-size: 12px !important;
}

#FormEditKoinModal .config-card-title {
    font-size: 13px;
}

#FormEditKoinModal .premium-section-box {
    padding: 10px;
}

#FormEditKoinModal .premium-config-card {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
}

.premium-modal-title {
    color: #5c9514;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
}

.premium-label {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    display: block;
}

.premium-input {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    transition: all 0.2s ease;
    background: #ffffff !important;
}

.premium-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.premium-section-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px;
}

.premium-config-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 15px;
}

.config-card-title {
    color: #3b82f6;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.config-card-title.meta-title {
    color: #8b5cf6;
}

/* ── Form Editor CEX Coin Badge ── */
.cex-badge-coin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 20px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.cex-badge-coin:hover {
    background: #e2e8f0;
}

.cex-badge-coin input {
    margin: 0 !important;
    width: 14px;
    height: 14px;
}

/* Ensure DEX items take full width in grid columns */
#FormEditKoinModal .dex-item-row {
    width: 100%;
}

/* Meta-DEX items must NOT take full width — they flow horizontally */
#metadex-checkbox-koin .dex-item-row {
    width: auto !important;
    flex-shrink: 0;
}

/* --- Buttons --- */
.premium-btn-simpan,
.premium-btn-save {
    background: #3b82f6 !important;
    color: white !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    border: none !important;
    padding: 8px 20px !important;
}

.premium-btn-hapus,
.premium-btn-cancel {
    background: #ef4444 !important;
    color: white !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    border: none !important;
    padding: 8px 20px !important;
}

.premium-btn-batal {
    background: #e2e8f0 !important;
    color: #475569 !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    border: none !important;
    padding: 8px 20px !important;
}

/* --- Grids --- */
.premium-dex-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.dex-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px !important;
}

.cex-badge-sm {
    font-size: 9px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 4px;
    display: block;
    width: fit-content;
}

.status-badge-dipilih {
    color: #5c9514;
}

.status-badge-snapshot {
    color: #f59e0b;
}

.h-40 {
    height: 40px;
}

.font-13 {
    font-size: 13px !important;
}

.font-10 {
    font-size: 10px !important;
}

.w-25 {
    width: 25% !important;
}

.chain-toggle-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
}

.chain-toggle-btn:hover {
    background: #e9ecef;
}

.chain-toggle-btn.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.chain-toggle-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.fs-9 {
    font-size: 9px;
}

.w-5ch {
    width: 6ch !important;
}

/* ── Filter toggle ── */
.filter-toggle-btn {
    cursor: pointer;
    gap: 6px;
    background: #fff;
    padding: 3px 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.filter-toggle-btn.is-disabled {
    cursor: not-allowed;
    background: #f3f4f6;
    opacity: 0.45;
    pointer-events: none;
    box-shadow: none;
}

.filter-toggle-btn:hover:not(.is-disabled) {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* --- Saldo.html Styles & Utilities --- */
.saldo-container {
    max-width: 100%;
    padding: 8px;
    font-size: 12.5px;
}

.icon-20 {
    width: 20px;
    height: 20px;
}

.icon-22 {
    width: 22px;
    height: 22px;
}

.icon-23 {
    width: 23px;
    height: 23px;
}

.fs-11 {
    font-size: 11px !important;
}

.ws-nowrap {
    white-space: nowrap !important;
}

.tt-uppercase {
    text-transform: uppercase !important;
}

/* Status Colors for JS */
.status-loading {
    font-size: 11px;
    color: #6b7280;
}

.status-nokey {
    font-size: 11px;
    color: #6b7280;
}

.status-time-err {
    font-size: 11px;
    font-weight: 600;
    color: #d97706;
}

body {
    color: #1f2937;
    background: #f3f4f6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.uk-container {
    max-width: 100%;
    padding: 8px;
    font-size: 12.5px;
}

.main-header {
    background: #fff;
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid #bbf7d0;
    border-top: 3px solid #16a34a;
    text-align: center;
}

.main-header h3 {
    margin: 0;
    font-weight: 800;
    color: #166534;
    font-size: 1.08rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    line-height: 1.2;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.summary-card {
    background: #fff;
    border: 1px solid #bbf7d0;
    padding: 10px;
    text-align: center;
}

.summary-card .card-title {
    font-size: 0.64rem;
    color: #16a34a;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.summary-card .card-value {
    font-size: 1.08rem;
    font-weight: 700;
    color: #166534;
    margin: 0;
    line-height: 1.2;
}

.summary-card .card-value-idr {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 4px;
}

.summary-card.positive .card-value {
    color: #28a745;
}

.summary-card.negative .card-value {
    color: #dc3545;
}

.summary-card .card-value-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
}

.summary-card .card-value-input-group .uk-input {
    flex: 1;
    min-width: 70px;
    text-align: right;
    font-size: 0.95rem;
    font-weight: 700;
    height: 30px;
    padding: 3px 6px;
}

@media(max-width:1200px) {
    .summary-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media(max-width:768px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:480px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
}

/* Table */
.table-glass {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #bbf7d0;
}

.table-glass thead th {
    background: #f0fdf4;
    color: #166534;
    font-weight: 600;
    letter-spacing: .03em;
    padding: 7px 8px;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.68rem;
    border-bottom: 1px solid #d1d5db;
}

.table-glass tbody td {
    padding: 6px 8px;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.78rem;
    vertical-align: middle;
}

.table-glass tbody td:first-child {
    white-space: nowrap;
}

.table-glass tbody tr:hover {
    background: #f0fdf4;
}

.table-glass .table-total-row th {
    padding: 8px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #166534;
    background: #f0fdf4;
    border-top: 1px solid #bbf7d0;
}

/* CEX / Chain Colors */
.text-cex-binance {
    color: #f0b90b !important;
    font-weight: 700;
}

.text-cex-gate {
    color: #e51b7b !important;
    font-weight: 700;
}

.text-cex-bitget {
    color: #00f0ff !important;
    font-weight: 700;
}

.text-cex-kucoin {
    color: #23af91 !important;
    font-weight: 700;
}

.text-cex-bybit {
    color: #f7a600 !important;
    font-weight: 700;
}

.text-cex-indodax {
    color: #3d5afe !important;
    font-weight: 700;
}

.text-cex-mexc {
    color: #00b897 !important;
    font-weight: 700;
}

.text-cex-htx {
    color: #008cd6 !important;
    font-weight: 700;
}

.text-cex-okx {
    color: #000 !important;
    font-weight: 700;
}

.text-chain-ethereum {
    color: #627eea !important;
    font-weight: 700;
}

.text-chain-bsc {
    color: #f0b90b !important;
    font-weight: 700;
}

.text-chain-polygon {
    color: #9c6bf0 !important;
    font-weight: 700;
}

.text-chain-base {
    color: #0052ff !important;
    font-weight: 700;
}

.text-chain-arbitrum {
    color: #28a0f0 !important;
    font-weight: 700;
}

.text-chain-solana {
    color: #9945ff !important;
    font-weight: 700;
}

.text-chain-avax {
    color: #e84142 !important;
    font-weight: 700;
}

#assetTableCexs tbody tr,
#assetTableWallet tbody tr {
    transition: background-color .15s ease;
}

.row-cex-binance {
    background: rgba(240, 185, 11, .08);
}

.row-cex-gate {
    background: rgba(229, 27, 123, .06);
}

.row-cex-bitget {
    background: rgba(0, 240, 255, .06);
}

.row-cex-kucoin {
    background: rgba(35, 175, 145, .08);
}

.row-cex-bybit {
    background: rgba(247, 166, 0, .08);
}

.row-cex-indodax {
    background: rgba(61, 90, 254, .06);
}

.row-cex-mexc {
    background: rgba(0, 184, 151, .08);
}

.row-cex-htx {
    background: rgba(0, 140, 214, .06);
}

.row-cex-okx {
    background: rgba(17, 24, 39, .04);
}

.row-chain-ethereum {
    background: rgba(98, 126, 234, .06);
}

.row-chain-bsc {
    background: rgba(240, 185, 11, .08);
}

.row-chain-polygon {
    background: rgba(156, 107, 240, .08);
}

.row-chain-base {
    background: rgba(0, 82, 255, .06);
}

.row-chain-arbitrum {
    background: rgba(40, 160, 240, .06);
}

.row-chain-solana {
    background: rgba(153, 69, 255, .06);
}

.row-chain-avax {
    background: rgba(232, 65, 66, .06);
}

.asset-line {
    padding: 4px 0;
    border-bottom: 1px dashed #d1d5db;
    font-size: 12px;
}

.asset-line:last-of-type {
    border-bottom: none;
}

.error {
    background: #fee2e2;
}

img:hover {
    transition: opacity .15s ease;
    opacity: .92;
}

/* Info pills */
.info-pills-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.info-pill-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 8px 9px;
    text-align: center;
}

.info-pill-card .pill-label {
    font-size: 0.62rem;
    color: #16a34a;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 3px;
    display: block;
}

.info-pill-card .pill-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: #166534;
    display: block;
}

.info-pill-card.positive .pill-value {
    color: #16a34a;
}

.info-pill-card.negative .pill-value {
    color: #dc3545;
}

/* Buttons */
.uk-button {
    letter-spacing: .02em;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
    font-size: 0.72rem;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 12px;
    box-shadow: none !important;
    text-transform: uppercase;
}

.uk-button:hover {
    transform: none;
}

.uk-button-primary {
    background: #16a34a;
    color: #fff;
    border: 1px solid #16a34a;
}

.uk-button-primary:hover {
    background: #15803d;
}

.uk-button-secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.uk-button-secondary:hover {
    background: #f3f4f6;
}

/* icon-link */
.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    transition: background-color .15s ease, border-color .15s ease;
    cursor: pointer;
    padding: 0;
}

.icon-link img {
    width: 16px;
    height: 16px;
}

.icon-link:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: none;
    box-shadow: none;
}

.icon-link-dark {
    background: #6a94ef;
    border-color: #111827;
}

.icon-link-dark:hover {
    background: #1f2937;
    border-color: #1f2937;
}

.icon-link-success {
    background: #f0fdf4;
    border-color: #86efac;
}

.icon-link-danger {
    background: #fef2f2;
    border-color: #fca5a5;
}

.icon-link-warn {
    background: #fff7ed;
    border-color: #fdba74;
}

/* Card */
.uk-card.uk-card-default {
    padding: 10px;
    background: #fff;
    border: 1px solid #bbf7d0;
    box-shadow: none;
}

.uk-grid {
    margin: 0 !important;
}

.uk-grid>* {
    padding-left: 4px !important;
    padding-right: 4px !important;
}

.uk-margin-small-top {
    margin-top: 6px !important;
}

.uk-margin-small-bottom {
    margin-bottom: 6px !important;
}

/* Wallet token row */
.token-card {
    background: #fff;
    border: 1px solid #bbf7d0;
    margin-bottom: 6px;
    overflow: hidden;
}

.token-card-header {
    padding: 7px 8px;
    background: #f0fdf4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border-bottom: 1px solid #bbf7d0;
}

.token-card-header:hover {
    background: #dcfce7;
}

.chain-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 5px;
    border: 1px solid currentColor;
    font-size: 10px;
    font-weight: 700;
}

.val-usd {
    color: #28a745;
    font-weight: 600;
}

.val-zero {
    color: #aaa;
}

/* Loading Overlay */
.balance-check-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, .72);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn .3s ease;
}

.balance-check-overlay.active {
    display: flex;
}

.overlay-content {
    background: #111827;
    padding: 24px 28px;
    text-align: center;
    max-width: 430px;
    animation: slideUp .4s ease;
    border: 1px solid rgba(255, 255, 255, .12);
}

.overlay-spinner {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border: 5px solid rgba(255, 255, 255, .1);
    border-top-color: #fff;
    border-right-color: rgba(255, 255, 255, .6);
    animation: spin 1s linear infinite;
}

.overlay-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.overlay-message {
    font-size: 12px;
    color: rgba(255, 255, 255, .75);
    margin-bottom: 12px;
    line-height: 1.45;
}

.overlay-progress {
    background: rgba(255, 255, 255, .1);
    height: 6px;
    overflow: hidden;
    margin-top: 12px;
}

.overlay-progress-bar {
    height: 100%;
    background: #4ade80;
    transition: width .3s ease;
}

.overlay-details {
    font-size: 12px;
    color: rgba(255, 255, 255, .55);
    margin-top: 12px;
    font-family: monospace;
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(28px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

/* Calculator Modal */
#calculator-modal .uk-modal-dialog {
    border-radius: 12px;
    overflow: hidden;
}

#calculator-modal .uk-modal-body {
    padding: 14px;
    background: #f9fafb;
}

#calculator-modal .uk-form-label {
    font-weight: 600;
    color: #495057;
    min-width: 60px;
    display: inline-block;
}

#calculator-modal .uk-input {
    border: 1px solid #ced4da;
    border-radius: 12px !important;
    transition: all .2s ease;
    font-size: .9rem;
}

#calculator-modal .uk-input:focus {
    border-color: #111827;
    box-shadow: none;
    outline: none;
}

/* Status bar */
.status-bar {
    padding: 5px 8px;
    margin-bottom: 6px;
    font-size: 11.5px;
    display: none;
}

.status-bar.show {
    display: block;
}

.status-info {
    background: rgba(66, 153, 225, .1);
    border: 1px solid rgba(66, 153, 225, .3);
    color: #3182ce;
}

.status-error {
    background: rgba(252, 129, 129, .1);
    border: 1px solid rgba(252, 129, 129, .3);
    color: #c53030;
}

.status-success {
    background: rgba(72, 187, 120, .1);
    border: 1px solid rgba(72, 187, 120, .3);
    color: #276749;
}

.snapshot-panel {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 8px 10px;
    margin: 8px 0;
    font-size: 0.76rem;
}

.snapshot-panel .snapshot-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.snapshot-panel .snapshot-row:last-child {
    margin-bottom: 0;
}

.action-toolbar {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.uk-input,
.uk-select,
.uk-textarea {
    border-radius: 12px !important;
    box-shadow: none !important;
    min-height: 30px;
    border-color: #d1d5db;
    font-size: 0.8rem;
}

.uk-input:focus,
.uk-select:focus,
.uk-textarea:focus {
    border-color: #111827;
}

/* === Rounded Theme === */
.main-header {
    border-radius: 12px;
}

.summary-card {
    border-radius: 12px;
}

.table-glass {
    border-radius: 12px;
    overflow: hidden;
}

.info-pill-card {
    border-radius: 12px;
}

.uk-card.uk-card-default {
    border-radius: 12px;
}

.token-card {
    border-radius: 12px;
}

.token-card-header {
    border-radius: 12px 10px 0 0;
}

.chain-badge {
    border-radius: 999px;
}

.overlay-content {
    border-radius: 12px;
}

.overlay-spinner {
    border-radius: 50%;
    text-transform: uppercase;
    letter-spacing: .04em;
    display: block;
    margin-bottom: 3px;
}

#rekap-pnl-modal .uk-input {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #111827;
    border-radius: 0;
    font-size: 0.8rem;
    height: 30px;
    padding: 4px 8px;
    width: 100%;
}

#rekap-pnl-modal .uk-input:focus {
    border-color: #111827;
    outline: none;
    box-shadow: none;
}

#rekap-pnl-modal #rekapFilterBtn {
    background: #111827;
    border: 1px solid #111827;
    color: #fff;
    border-radius: 0;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0 12px;
    height: 30px;
    letter-spacing: .03em;
    white-space: nowrap;
}

#rekap-pnl-modal #rekapFilterBtn:hover {
    background: #1f2937;
}

#rekap-pnl-modal #rekapResetBtn {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    border-radius: 0;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0 12px;
    height: 30px;
    white-space: nowrap;
}

#rekap-pnl-modal #rekapResetBtn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

#rekap-pnl-modal .table-rekap {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #d1d5db;
}

#rekap-pnl-modal .table-rekap thead th {
    background: #f3f4f6;
    color: #374151;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 7px 8px;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.68rem;
}

#rekap-pnl-modal .table-rekap tbody td {
    padding: 6px 8px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.78rem;
    color: #111827;
    vertical-align: middle;
}

#rekap-pnl-modal .table-rekap tbody tr:nth-child(even) {
    background: #fafafa;
}

#rekap-pnl-modal .table-rekap tbody tr:hover {
    background: #f3f4f6;
}

#rekap-pnl-modal #rekapSummary {
    font-size: 0.78rem;
    margin-top: 8px;
    text-align: right;
    color: #374151;
    padding-top: 6px;
    border-top: 1px solid #e5e7eb;
    font-weight: 600;
}

/* Additional Utilities */
.modal-640 {
    max-width: 640px !important;
}

.p-0 {
    padding: 0 !important;
}

.px-12 {
    padding-left: 12px !important;
    padding-right: 12px !important;
}

.pb-12 {
    padding-bottom: 12px !important;
}

.gap-6 {
    gap: 6px !important;
}

/* UI.js specific classes */
.fs-9 {
    font-size: 9px !important;
}

.dex-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 8px;
    column-gap: 20px;
}

.input-check-sm {
    width: 14px;
    height: 14px;
    border-radius: 12px;
}

.w-70 {
    width: 70px !important;
}

/* Wallet Exchanger Utilities */
.wallet-chain-banner {
    padding: 6px 10px;
    font-weight: bold;
    font-size: 12px;
}

.wallet-chain-banner-mt {
    margin-top: 10px;
    border-radius: 12px 4px 0 0;
}

.wallet-td-sc {
    max-width: 130px;
}

.th-30 {
    width: 30px;
}

.th-70 {
    width: 70px;
}

.th-80 {
    width: 80px;
}

.th-130 {
    width: 130px;
}

/* === Segmented Control (Pill UI) === */
.segmented-control {
    display: flex;
    position: relative;
    background: var(--surface-2);
    border-radius: 12px;
    padding: 2px;
    width: 100%;
    max-width: 180px;
    height: 32px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label {
    flex: 1;
    text-align: center;
    line-height: 28px;
    font-size: 12px;
    font-weight: 600;
    color: var(--bs-secondary);
    cursor: pointer;
    z-index: 2;
    transition: color 0.2s ease;
    margin: 0;
}

.segmented-control input[type="radio"]:checked+label {
    color: #fff;
}

.segmented-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(33.33% - 4px);
    height: calc(100% - 4px);
    background: var(--bs-primary);
    border-radius: 10px;
    transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    z-index: 1;
}

/* Slider logic for 3 items (6, 5, 4) */
#kg6:checked~.segmented-slider {
    transform: translateX(0);
}

#kg5:checked~.segmented-slider {
    transform: translateX(100%);
}

#kg4:checked~.segmented-slider {
    transform: translateX(200%);
}

/* === Setting Module Card (Universal) === */
.card-setting-module {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.card-setting-module:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

/* === Setting Card Title === */
.judul {
    font-size: 13px !important;
    letter-spacing: 0.3px;
}

body.dark-mode .card-setting-module {
    background: rgba(30, 41, 59, 0.6);
    border-color: #334155;
}

.rpc-card-cex-style {
    composes: card-setting-module;
    /* Mental note: use standard class in JS */
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.form-label.text-uppercase {
    letter-spacing: 0.5px;
    font-size: 11px;
    color: var(--bs-secondary) !important;
}

/* === DEX Delay 2-Column Grid === */
.dex-delay-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
}

.dex-delay-grid-2col .card {
    margin-bottom: 0 !important;
}

/* === Wallet Address in RPC card - full width === */
#rpc-settings-group .wallet-input,
#rpc-settings-group .wallet-input-sm {
    width: 100% !important;
    font-size: 0.72rem;
}

#rpc-settings-group .rpc-card-cex-style {
    padding: 8px 10px;
}

#rpc-settings-group .rpc-label-sm {
    font-size: 0.68rem;
    word-break: break-all;
}

/* ============================================================ */
/* MODERN PREMIUM TOAST SYSTEM                                 */
/* ============================================================ */
.modern-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.modern-toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 450px;
    padding: 16px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(120%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
}

body.dark-mode .modern-toast {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    color: #f1f5f9;
}

.modern-toast.show {
    transform: translateX(0);
}

.modern-toast .toast-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
}

.modern-toast-content {
    flex-grow: 1;
}

.modern-toast-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-toast-message {
    font-size: 0.85rem;
    line-height: 1.4;
    opacity: 0.9;
}

.modern-toast-close {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    font-size: 1.2rem;
}

.modern-toast-close:hover {
    opacity: 1;
}

/* Variants */
.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* Progress Bar Anim */
@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

.modern-toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: 0.5;
    transform: scaleX(1);
    transform-origin: left;
}

.modern-toast.show::after {
    animation: toastProgress var(--toast-duration, 3000ms) linear forwards;
}

.toast-success::after {
    color: #10b981;
}

.toast-error::after {
    color: #ef4444;
}

.toast-warning::after {
    color: #f59e0b;
}

.toast-info::after {
    color: #3b82f6;
}

/* Sync Table Sorting Enhancements */
.sync-sortable {
    cursor: pointer !important;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.sync-sortable:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.sync-sort-indicator {
    display: inline-block;
    min-width: 14px;
    margin-left: 4px;
    font-size: 10px;
    vertical-align: middle;
}

.sync-sortable i {
    font-size: 12px;
    vertical-align: baseline;
}

/* ── Lazy DEX Link trigger button ── */
.btn-lazy-dex {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9.5px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    border: 1px dashed #6c757d88;
    color: #6c757d;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-lazy-dex:hover {
    border-color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
    color: #495057;
}

.dark-mode .btn-lazy-dex {
    border-color: rgba(255, 255, 255, 0.22);
    color: #999;
}

.dark-mode .btn-lazy-dex:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ccc;
}

/* ── Lazy DEX Links — expanded 2-row result ── */
.dex-links-expanded {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-start;
    vertical-align: middle;
}

.dex-links-row {
    display: flex;
    gap: 3px;
    align-items: center;
}

.dex-link-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    border: 1px solid currentColor;
    text-decoration: none !important;
    opacity: 0.75;
    white-space: nowrap;
    line-height: 1.6;
    transition: opacity 0.12s, background 0.12s;
}

.dex-link-badge:hover {
    opacity: 1;
    background: rgba(128, 128, 128, 0.12);
    text-decoration: none !important;
}

/* ── Render Overlay ─────────────────────────────────────────────────────── */
#render-overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    background: rgba(0, 0, 0, 0.52);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeInRenderOverlay 0.15s ease;
}

@keyframes fadeInRenderOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#render-overlay .ro-box {
    background: var(--surface-1, #ffffff);
    border-radius: 14px;
    padding: 28px 36px;
    min-width: 300px;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#render-overlay .ro-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary, #212529);
}

#render-overlay .ro-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted, #6c757d);
    margin-bottom: 16px;
}

#render-overlay .ro-bar-wrap {
    width: 100%;
    background: var(--surface-3, #e9ecef);
    border-radius: 12px;
    overflow: hidden;
    height: 10px;
    margin-bottom: 8px;
}

#render-overlay .ro-bar {
    height: 10px;
    border-radius: 12px;
    background: var(--theme-accent, #198754);
    background-image: linear-gradient(45deg,
            rgba(255, 255, 255, 0.18) 25%, transparent 25%,
            transparent 50%, rgba(255, 255, 255, 0.18) 50%,
            rgba(255, 255, 255, 0.18) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite;
    transition: width 0.25s ease;
    width: 0%;
}

#render-overlay .ro-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #6c757d);
    margin-bottom: 2px;
}

#render-overlay .ro-hint {
    font-size: 0.68rem;
    color: var(--text-muted, #adb5bd);
    margin-top: 10px;
    opacity: 0.8;
}

.dark-mode #render-overlay .ro-box {
    background: var(--surface-1, #1e1e2e);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.dark-mode #render-overlay .ro-title {
    color: #e0e0e0;
}

.dark-mode #render-overlay .ro-subtitle,
.dark-mode #render-overlay .ro-count,
.dark-mode #render-overlay .ro-hint {
    color: #9e9e9e;
}

/* Attention Indicator Pulse */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.96);
    }
}

/* ==========================================================================
   MODE-BASED STYLING (FAVORIT & MULTIALL)
   Scanner Table Column Overrides for Detail Info and Orderbook
   ========================================================================== */

/* --- 1. Favorit Mode (Nuansa Ijo - Green Theme) --- */
body.theme-favorit {
    --detail-th-bg: #d5e8c4 !important;
    --detail-td-bg-odd: #e2f0d5 !important;
    --detail-td-bg-even: #d5e8c4 !important;
    --detail-border: #9ec77d !important;

    --orderbook-th-bg: #e6f2db !important;
    --orderbook-td-bg-odd: #f2f9eb !important;
    --orderbook-td-bg-even: #e6f3db !important;
    --orderbook-border: #b6d59c !important;
}

body.theme-favorit.dark-mode {
    --detail-th-bg: #0a1a10 !important;
    --detail-td-bg-odd: #051009 !important;
    --detail-td-bg-even: #08170e !important;
    --detail-border: #133820 !important;

    --orderbook-th-bg: #121e16 !important;
    --orderbook-td-bg-odd: #0d1711 !important;
    --orderbook-td-bg-even: #14221a !important;
    --orderbook-border: #1f3c2b !important;
}

/* --- 2. MultiAll Mode (Nuansa Coklat - Chocolate/Amber Theme) --- */
body.theme-multiall {
    --detail-th-bg: #e7d5c3 !important;
    --detail-td-bg-odd: #eedfcf !important;
    --detail-td-bg-even: #e7d5c3 !important;
    --detail-border: #bfa285 !important;

    --orderbook-th-bg: #f5ebe1 !important;
    --orderbook-td-bg-odd: #faf3eb !important;
    --orderbook-td-bg-even: #f3e4d3 !important;
    --orderbook-border: #dfc5ab !important;
}

body.theme-multiall.dark-mode {
    --detail-th-bg: #1d1109 !important;
    --detail-td-bg-odd: #120904 !important;
    --detail-td-bg-even: #190f07 !important;
    --detail-border: #3a1e0b !important;

    --orderbook-th-bg: #24180f !important;
    --orderbook-td-bg-odd: #19110a !important;
    --orderbook-td-bg-even: #281b10 !important;
    --orderbook-border: #442f1f !important;
}

/* --- 3. Dynamic Column Application & Sticky Overrides --- */

/* Detail Info Column */
.th-detail {
    background: var(--detail-th-bg) !important;
    border-right: 2px solid var(--detail-border) !important;
    color: var(--bs-dark) !important;
    transition: background-color 0.2s ease;
}

body.dark-mode .th-detail {
    color: #f8fafc !important;
}

.td-detail {
    border-right: 2px solid var(--detail-border) !important;
    transition: background-color 0.2s ease;
}

body.dark-mode .td-detail {
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.8) !important;
}

.table tbody tr:nth-child(odd) td.td-detail {
    background-color: var(--detail-td-bg-odd) !important;
}

.table tbody tr:nth-child(even) td.td-detail {
    background-color: var(--detail-td-bg-even) !important;
}

/* Hover Overrides for Detail column */
.table tbody tr:hover td.td-detail {
    background-color: var(--surface-2) !important;
}

/* Orderbook Column */
.th-orderbook {
    background: var(--orderbook-th-bg) !important;
    border-left: 2px solid var(--orderbook-border) !important;
    border-right: 2px solid var(--orderbook-border) !important;
    color: var(--bs-dark) !important;
    transition: background-color 0.2s ease;
}

body.dark-mode .th-orderbook {
    color: #f8fafc !important;
}

.td-orderbook {
    border-left: 2px solid var(--orderbook-border) !important;
    border-right: 2px solid var(--orderbook-border) !important;
    transition: background-color 0.2s ease;
}

.table tbody tr:nth-child(odd) td.td-orderbook {
    background: var(--orderbook-td-bg-odd) !important;
}

.table tbody tr:nth-child(even) td.td-orderbook {
    background: var(--orderbook-td-bg-even) !important;
}

/* Hover Overrides for Orderbook column */
.table tbody tr:hover td.td-orderbook {
    background: var(--surface-2) !important;
    background-color: var(--surface-2) !important;
}

body.dark-mode .table tbody tr:hover td.td-orderbook {
    background: linear-gradient(to right, color-mix(in srgb, var(--theme-accent) 15%, var(--surface-2)), color-mix(in srgb, var(--theme-accent) 10%, var(--surface-2))) !important;
}

/* =============================================================================
   SCAN BLOCK ALERT OVERLAY
   ============================================================================= */
.sba-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: sba-fadein 0.2s ease;
}

@keyframes sba-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.sba-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    padding: 28px 32px 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: sba-slidein 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-top: 5px solid #f59e0b;
}

@keyframes sba-slidein {
    from { transform: scale(0.88) translateY(-16px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

.sba-icon-row {
    margin-bottom: 8px;
}

.sba-icon {
    font-size: 2.4rem;
    line-height: 1;
}

.sba-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #b45309;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.sba-body {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 14px;
    text-align: left;
}

.sba-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.82rem;
}

.sba-info-row + .sba-info-row {
    border-top: 1px solid #fde68a;
}

.sba-label {
    color: #92400e;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.sba-value {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.85rem;
}

.sba-desc {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 18px;
    line-height: 1.5;
}

.sba-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.sba-countdown-bar {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.sba-countdown-fill {
    height: 100%;
    width: 100%;
    background: #f59e0b;
    border-radius: 2px;
    transition: width linear;
}

.sba-btn {
    background: #f59e0b;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 9px 28px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.15s;
}

.sba-btn:hover {
    background: #d97706;
}

/* Dark mode */
body.dark-mode .sba-card {
    background: #1e293b;
    border-top-color: #f59e0b;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

body.dark-mode .sba-title {
    color: #fbbf24;
}

body.dark-mode .sba-body {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
}

body.dark-mode .sba-info-row + .sba-info-row {
    border-top-color: rgba(245, 158, 11, 0.2);
}

body.dark-mode .sba-label {
    color: #fbbf24;
}

body.dark-mode .sba-value {
    color: #f1f5f9;
}

body.dark-mode .sba-desc {
    color: #94a3b8;
}

body.dark-mode .sba-countdown-bar {
    background: #334155;
}