@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ─── LIGHT MODE (Default) ─── */
:root,
:root[data-theme="light"] {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --card-hover: #f1f5f9;
    --primary: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --grid: #e2e8f0;
    --crosshair: #64748b;
    --tooltip-bg: rgba(0, 0, 0, 0.9);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

    /* backward-compat aliases */
    --page-bg: var(--bg);
    --card-bg: var(--surface);
    --bg-main: var(--bg);
    --bg-card: var(--surface);
    --bg-table: var(--surface);
    --bg-hover: var(--card-hover);
    --bg-zebra: var(--card-hover);
    --bg-input: var(--surface);
    --border-soft: var(--border);
    --border-medium: var(--border);
    --text-main: var(--text);
    --text-faint: var(--text-muted);
    --accent: var(--primary);
    --accent-hover: var(--primary);
    --accent-light: rgba(59, 130, 246, 0.1);
    --accent-border: var(--border);
    --green: var(--success);
    --green-light: rgba(16, 185, 129, 0.1);
    --green-border: rgba(16, 185, 129, 0.25);
    --red: var(--danger);
    --red-light: rgba(239, 68, 68, 0.1);
    --red-border: rgba(239, 68, 68, 0.25);
    --yellow: var(--warning);
    --yellow-light: rgba(245, 158, 11, 0.1);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 50px;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.10);
    --th-bg: var(--card-hover);
    --th-text: var(--text-secondary);
    --th-border: var(--border);
    --scrollbar-bg: var(--card-hover);
    --scrollbar-thumb: var(--text-muted);
    /* landing page aliases */
    --page: var(--surface);
    --surface2: var(--card-hover);
    --surface3: var(--card-hover);
    --border2: var(--border);
    --text-h: var(--text);
    --text-body: var(--text-secondary);
    --text-sub: var(--text-muted);
    --gold: var(--primary);
    --gold-light: rgba(59, 130, 246, 0.1);
    --gold-border: rgba(59, 130, 246, 0.3);
    --gold-rich: #3b82f6;
    --chart-grid: var(--grid);
    --chart-tick: var(--crosshair);
}

/* ─── DARK MODE ─── */
:root[data-theme="dark"] {
    --bg: #0a0e1a;
    --surface: #111827;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --text-secondary: #cbd5e1;
    --border: rgba(255, 255, 255, 0.08);
    --card-hover: #1a2332;
    --primary: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --grid: rgba(255, 255, 255, 0.08);
    --crosshair: #94a3b8;
    --tooltip-bg: rgba(30, 41, 59, 0.95);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.6);

    /* backward-compat aliases */
    --page-bg: var(--bg);
    --card-bg: var(--surface);
    --bg-main: var(--bg);
    --bg-card: var(--surface);
    --bg-table: var(--surface);
    --bg-hover: var(--card-hover);
    --bg-zebra: var(--card-hover);
    --bg-input: var(--surface);
    --border-soft: var(--border);
    --border-medium: var(--border);
    --text-main: var(--text);
    --text-faint: var(--text-muted);
    --accent: var(--primary);
    --accent-hover: var(--primary);
    --accent-light: rgba(59, 130, 246, 0.12);
    --accent-border: rgba(59, 130, 246, 0.25);
    --green: var(--success);
    --green-light: rgba(16, 185, 129, 0.12);
    --green-border: rgba(16, 185, 129, 0.25);
    --red: var(--danger);
    --red-light: rgba(239, 68, 68, 0.12);
    --red-border: rgba(239, 68, 68, 0.25);
    --yellow: var(--warning);
    --yellow-light: rgba(245, 158, 11, 0.12);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 50px;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --th-bg: var(--card-hover);
    --th-text: var(--text-muted);
    --th-border: var(--border);
    --scrollbar-bg: var(--card-hover);
    --scrollbar-thumb: var(--text-muted);
    /* landing page aliases */
    --page: var(--surface);
    --surface2: var(--card-hover);
    --surface3: var(--card-hover);
    --border2: var(--border);
    --text-h: var(--text);
    --text-body: var(--text-secondary);
    --text-sub: var(--text-muted);
    --gold: var(--primary);
    --gold-light: rgba(59, 130, 246, 0.12);
    --gold-border: rgba(59, 130, 246, 0.3);
    --gold-rich: #60a5fa;
    --chart-grid: var(--grid);
    --chart-tick: var(--crosshair);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.3s ease, color 0.3s ease;
    min-width: 320px;
    overflow-x: hidden;
    font-size: 13px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════════
   SITE NAVBAR (base.html — rollingstraddle style)
══════════════════════════════════════════ */
.site-navbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: 52px;
    transition: background 0.2s, border-color 0.2s;
}

.site-navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 16px;
}

.site-brand {
    font-size: 15px;
    font-weight: 800;
    color: #3b82f6;
    text-decoration: none;
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.site-brand:hover {
    color: #2563eb;
}

.site-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.site-nav-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.15s;
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.site-nav-link:hover {
    color: var(--text);
    background: var(--card-hover);
}

/* ── Mobile Navbar Toggler (Hamburger) ── */
.navbar-toggler {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 201;
    /* stay above mobile menu */
}

.navbar-toggler span {
    width: 100%;
    height: 3px;
    background: var(--text-h);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* Toggle Animation to X */
.navbar-toggler.active span:nth-child(1) {
    transform: rotate(45deg);
}

.navbar-toggler.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggler.active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* ── Responsive Navbar Rules ── */
@media (max-width: 768px) {
    .navbar-toggler {
        display: flex;
        margin-left: auto;
    }

    .site-nav-links {
        position: fixed;
        top: 52px;
        right: -100%;
        width: 220px;
        height: calc(100vh - 52px);
        background: var(--surface);
        flex-direction: column;
        align-items: flex-start;
        padding: 24px 16px;
        border-left: 1px solid var(--border);
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease-in-out;
        gap: 12px;
        z-index: 199;
    }

    .site-nav-links.active {
        right: 0;
    }

    .site-nav-link {
        width: 100%;
        padding: 12px;
    }

}

/* ── Theme Toggle Button ── */
.site-theme-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--card-hover);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
}

.site-theme-toggle:hover {
    background: var(--border);
    transform: scale(1.08);
}

/* ══════════════════════════════════════════
   SITE MAIN CONTENT AREA
══════════════════════════════════════════ */
.site-main {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 20px 24px;
}

/* ══════════════════════════════════════════
   SITE FOOTER
══════════════════════════════════════════ */
.site-footer {
    margin-top: auto;
    text-align: center;
    padding: 28px 24px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    line-height: 1.7;
}

.site-footer a {
    color: var(--primary);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* ── Responsive Navbar ── */
@media (max-width: 768px) {
    .site-navbar-inner {
        padding: 0 12px;
        gap: 8px;
    }

    .site-main {
        padding: 12px;
    }
}

/* EXISTING NAVBAR (kept for backward compat) */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 60px;
    display: flex;
    align-items: center;
}

.navbar-container {
    width: 100%;
    max-width: 100%;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: 100%;
}

.navbar-brand {
    font-size: 1.125rem;
    font-weight: 800;
    flex-shrink: 0;
}

.navbar-brand a {
    background: linear-gradient(135deg, #3b82f6, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-right-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link,
.dropdown-toggle {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.8125rem;
    transition: all 0.2s;
    color: var(--text-muted);
    white-space: nowrap;
    cursor: pointer;
    background: transparent;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link:hover,
.dropdown-toggle:hover,
.nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.dropdown {
    position: relative;
}

/* WebSocket Button */
.button.reset_restart_websocket {
    position: relative;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.button.reset_restart_websocket:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.button.reset_restart_websocket:active {
    transform: translateY(0);
}

.signal-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
    animation: pulse 2s infinite;
}

.signal-indicator.red-signal {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.signal-indicator.green-signal {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.button.reset_restart_websocket.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.theme-toggle {
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-size: 1rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    border-radius: 0.5rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-size: 1.125rem;
    transition: all 0.2s;
    color: var(--text);
}

/* MOBILE DROPDOWN */
.mobile-dropdown {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.mobile-dropdown.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.75rem;
}

.mobile-dropdown-content {
    background: var(--card-bg);
    border-radius: 1rem;
    width: calc(100% - 2rem);
    max-width: 25rem;
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    box-shadow: 0 1.25rem 3.75rem rgba(0, 0, 0, 0.4);
}

.mobile-dropdown-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 1;
}

.mobile-dropdown-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

.mobile-close-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--card-hover);
    border: none;
    color: var(--text);
    font-size: 1.25rem;
}

.mobile-dropdown-section {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.mobile-dropdown-section:last-child {
    border-bottom: none;
}

.mobile-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03125rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.mobile-nav-link {
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.15s;
    margin-bottom: 0.25rem;
}

.mobile-nav-link:hover {
    background: var(--card-hover);
    color: var(--primary);
}

/* PAGE CONTENT */
.page-content {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    min-height: calc(100vh - 60px);
}

.dropdown-arrow {
    font-size: 0.625rem;
    transition: transform 0.2s;
}

.dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 0.625rem 1.875rem rgba(0, 0, 0, 0.15);
    min-width: 13.75rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.625rem);
    transition: all 0.2s;
    z-index: 200;
}

.dropdown.open .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 0.625rem 1rem;
    color: var(--text);
    text-decoration: none;
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.15s;
    border-bottom: 1px solid var(--border);
}

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

.dropdown-item:hover {
    background: var(--card-hover);
    color: var(--primary);
    padding-left: 1.125rem;
}

.traffic-box {

    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
}

.circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
    cursor: help;
}

.green {
    background: var(--green);
    box-shadow: 0 0 6px rgba(22, 163, 74, 0.4);
}

.red {
    background: var(--red);
    box-shadow: 0 0 6px rgba(220, 38, 38, 0.4);
}

.tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-soft);
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 100;
}

.circle:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.no-jobs {
    font-size: 11px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   PNL METRIC CARDS
   ═══════════════════════════════════════════════════════════════ */

.pnl-metrics {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pnl-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 14px 18px;
    min-width: 140px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.pnl-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.pnl-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.pnl-value {
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════════════════════════
   PNL STYLING CLASSES
   ═══════════════════════════════════════════════════════════════ */

.pnl-positive {
    color: var(--green) !important;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pnl-positive-bg {
    color: var(--green) !important;
    background: var(--green-light) !important;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pnl-negative {
    color: var(--red) !important;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pnl-negative-bg {
    color: var(--red) !important;
    background: var(--red-light) !important;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pnl-neutral {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Websocket status classes */
.ws-connected {
    background-color: var(--green-light) !important;
    border-color: var(--green-border) !important;
    color: var(--green) !important;
}

.ws-disconnected {
    background-color: var(--red-light) !important;
    border-color: var(--red-border) !important;
    color: var(--red) !important;
}

/* ═══════════════════════════════════════════════════════════════
   CONFIG PAGE HEADER & LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.page-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 14px 20px;
    box-shadow: var(--shadow-sm);
}

.section-gap {
    height: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.button,
.button-websocket,
.ohlc-button,
.modify-button,
.username_broker {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.button:hover,
.button-websocket:hover,
.ohlc-button:hover,
.modify-button:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
    box-shadow: var(--shadow-sm);
}

.start {
    background: var(--green-light);
    border-color: var(--green-border);
    color: var(--green);
    font-weight: 600;
}

.start:hover {
    background: var(--green);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.stop {
    background: var(--red-light);
    border-color: var(--red-border);
    color: var(--red);
    font-weight: 600;
}

.stop:hover {
    background: var(--red);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.button.update {
    background: var(--accent-light);
    border-color: var(--accent-border);
    color: var(--accent);
    font-weight: 600;
}

.button.update:hover {
    background: var(--accent);
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════
   FORM CONTROLS
   ═══════════════════════════════════════════════════════════════ */

.controls,
.algo-controls .controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
    align-items: center;
}

.algo-controls {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.algo-controls h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

input,
select {
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    color: var(--text-main);
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   TABLE SECTION
   ═══════════════════════════════════════════════════════════════ */

.table-wrapper {
    background: var(--bg-table);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow-x: auto;
    overflow-y: scroll;
    max-height: 500px;
    box-shadow: var(--shadow);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    font-size: 12.5px;
}

/* ─── Table Header ─── */
th {
    background: var(--th-bg);
    color: var(--th-text);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 2px solid var(--th-border);
    text-align: left;
    white-space: nowrap;
}

/* Sticky header shadow indicator */
th::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 6px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.04), transparent);
    pointer-events: none;
}

/* ─── Table Body ─── */
td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    overflow-y: auto;
    overflow-x: auto;
    color: var(--text-secondary);
    transition: background 0.15s ease;
}

/* Zebra striping */
tbody tr:nth-child(even) {
    background: var(--bg-zebra);
}

/* Row hover */
tbody tr:hover {
    background: var(--bg-hover);
}

/* Right-align numeric columns */
td:nth-child(n+3),
td.numeric {
    text-align: right;
}

/* Keep text columns left aligned */
td:first-child,
td:nth-child(2),
td.text-left {
    text-align: left;
}

th:nth-child(n+3),
th.numeric {
    text-align: right;
}

th:first-child,
th:nth-child(2),
th.text-left {
    text-align: left;
}

/* Center tables that need it (configuration tables) */
.stocks-table td,
.stocks-table th {
    text-align: center;
}

/* Compact inputs inside tables */
table input[type="number"],
table input[type="text"] {
    width: 60px;
    padding: 5px 6px;
    font-size: 11px;
    height: 28px;
    text-align: center;
}

table select {
    min-width: 90px;
    font-size: 11px;
    padding: 5px 6px;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.dashboard {
    display: flex;
    flex-direction: column;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
}

.dashboard .pnl-summary {
    flex: 1;
}

.dashboard .algo-ohlc {
    flex: 1;
}

.dashboard .orderbook-summary {
    flex: 1;
}

.dashboard h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
    padding: 0 4px;
}

.dashboard .pnl-summary,
.dashboard .algo-ohlc,
.dashboard .orderbook-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.dashboard .orderbook-summary h5 {
    font-size: 13px;
    color: var(--accent);
    background: var(--accent-light);
    padding: 8px 14px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-soft);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    margin: 0 0 0 0;
}

.dashboard .table-wrapper {
    margin-bottom: 8px;
    max-height: 350px;
    overflow-y: auto;
}

/* Compact PNL Summary table — fewer columns, tighter fit */
.dashboard .pnl-summary table {
    min-width: unset;
    width: 100%;
    font-size: 12px;
}

.dashboard .pnl-summary th {
    padding: 6px 8px;
    font-size: 10px;
}

.dashboard .pnl-summary td {
    padding: 5px 8px;
    font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   ALL DATA / INSTRUMENTS SECTION
   ═══════════════════════════════════════════════════════════════ */

.all_data {
    margin-top: 16px;
}

.all_data h4,
.stocks h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   FILTERS
   ═══════════════════════════════════════════════════════════════ */

.filters,
.filter {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filters label,
.filter label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

footer {
    width: 100%;
    font-size: 11px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px 24px;
    text-align: center;
    color: var(--text-muted);
    margin-top: auto;
    box-shadow: var(--shadow-xs);
    line-height: 1.6;
}

footer a {
    color: var(--accent);
    font-weight: 600;
}

footer a:hover {
    color: var(--accent-hover);
}

/* ═══════════════════════════════════════════════════════════════
   TABLES & RESPONSIVE WRAPPERS
   ═══════════════════════════════════════════════════════════════ */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    position: relative;
    /* Force DataTables internal head clones to line up */
}

/* Ensure dataTables wrapper behaves */
.dataTables_wrapper {
    width: 100%;
    position: relative;
    clear: both;
}

/* DataTables Scroll Header Alignment Fix */
.dataTables_scrollHeadInner {
    box-sizing: content-box !important;
    padding-right: 0 !important;
}

.dataTables_scrollHeadInner table.dataTable {
    margin: 0 !important;
}

/* Fix Duplicate DataTables Header Bug completely */
.dataTables_scrollHead {
    display: none !important;
}



/* ═══════════════════════════════════════════════════════════════
   CUSTOM SCROLLBARS
   ═══════════════════════════════════════════════════════════════ */

.table-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--scrollbar-bg);
    border-radius: 3px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   SECTION SPACING & UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.section-gap {
    margin-top: 24px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .dashboard .pnl-summary {
        grid-column: 1 / -1;
    }

    .dashboard .algo-ohlc {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 12px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 14px;
        gap: 10px;
    }

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

    .pnl-metrics {
        flex-direction: column;
    }

    .pnl-card {
        min-width: auto;
        width: 100%;
    }

    table {
        min-width: 700px;
        font-size: 11px;
    }

    .filters,
    .filter {
        flex-direction: column;
        align-items: stretch;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .action-buttons .button,
    .action-buttons .button-websocket {
        width: 100%;
        text-align: center;
    }
}



/* --- Landing Page Redesign --- */

/* Theme tokens are now defined in :root / :root[data-theme] above */

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Landing page body override — compact & no outer padding */
body.landing-page {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    min-height: 100vh;
    padding: 12px 12px 32px;
    transition: background 0.2s, color 0.2s;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

/* ══ STICKY NAV BAR ══ */
.page .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-brand {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-h);
    letter-spacing: -0.02em;
}

.nav-brand span {
    color: var(--gold-rich);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Dropdown CSS ── */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropbtn {
    background: transparent;
    color: var(--text-body);
    border: 1px solid var(--border);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.nav-dropbtn:hover {
    background: var(--surface2);
    color: var(--text-h);
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    margin-top: 8px;
    background-color: var(--page);
    min-width: 170px;
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    border: 1px solid var(--border);
    z-index: 200;
    overflow: hidden;
}

.nav-dropdown-content a {
    color: var(--text-body);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: background 0.2s, color 0.2s;
    border-bottom: 1px solid var(--border);
}

.nav-dropdown-content a:last-child {
    border-bottom: none;
}

.nav-dropdown-content a:hover {
    background-color: var(--surface2);
    color: var(--text-h);
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

.nav-dropdown:focus-within .nav-dropdown-content {
    display: block;
}

/* ══════════════════════════════════════════
   THEME TOGGLE
══════════════════════════════════════════ */
.theme-toggle {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 4px;
    display: flex;
    gap: 2px;
}

.theme-toggle button {
    background: transparent;
    border: none;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border-radius: 30px;
    cursor: pointer;
    color: var(--text-sub);
    transition: all 0.18s;
    letter-spacing: 0.2px;
}

.theme-toggle button.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.35);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

/* ══════════════════════════════════════════
   HERO SECTION
══════════════════════════════════════════ */
.hero {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    padding: 24px 28px 20px;
    border-bottom: 1px solid var(--border);
    align-items: start;
}

.hero-kicker {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--gold-rich);
    font-family: 'IBM Plex Mono', monospace;
    margin-bottom: 8px;
}

.hero-title {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 36px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 14px;
}

.hero-title .gold {
    color: var(--gold-rich);
}

.hero-deck {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 520px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.hero-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
    padding: 5px 12px;
    border-radius: 6px;
    background: var(--surface3);
    border: 1px solid var(--border);
    color: var(--text-sub);
    letter-spacing: 0.2px;
}

.tag.live {
    background: var(--green-light);
    border-color: var(--green-border);
    color: var(--green);
}

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    flex-shrink: 0;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* ── Hero Total Panel ── */
.hero-total {
    background: var(--card-hover);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 18px 16px;
    display: flex;
    flex-direction: column;
}

.total-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    margin-bottom: 8px;
}

.total-number {
    font-family: 'Source Serif 4', serif;
    font-size: 52px;
    font-weight: 900;
    line-height: 1;
    color: var(--green);
    letter-spacing: -2px;
    margin-bottom: 4px;
}

.total-number .plus {
    font-size: 28px;
    color: var(--green);
    letter-spacing: 0;
}

.total-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    margin-bottom: 20px;
    letter-spacing: 0.3px;
}

.total-mini-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.mini-stat {
    background: var(--surface);
    padding: 12px 10px;
    text-align: center;
}

.mini-stat-val {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.mini-stat-val.g {
    color: var(--green);
}

.mini-stat-val.r {
    color: var(--red);
}

.mini-stat-lbl {
    font-size: 9.5px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

/* ══════════════════════════════════════════
   STATS BAND
══════════════════════════════════════════ */
.stats-band-wrap {
    padding: 14px 28px;
    border-bottom: 1px solid var(--border);
}

.stats-band {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--card-hover);
    border-radius: 10px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.stat-item {
    text-align: center;
    padding: 18px 12px;
    border-right: 1px solid var(--border);
}

.stat-item:last-child {
    border-right: none;
}

.stat-val {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.4px;
    font-family: 'Source Serif 4', serif;
}

.stat-val.g {
    color: var(--green);
}

.stat-val.r {
    color: var(--red);
}

.stat-val.go {
    color: var(--gold-rich);
}

.stat-lbl {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: 'IBM Plex Mono', monospace;
    margin-top: 4px;
}

/* ══════════════════════════════════════════
   VERSUS SECTION
══════════════════════════════════════════ */
.versus-section {
    display: grid;
    grid-template-columns: 1fr 44px 1fr;
    border-bottom: 1px solid var(--border);
    background: var(--card-hover);
}

.versus-col {
    padding: 16px 22px;
}

.versus-header {
    margin-bottom: 10px;
}

.versus-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    font-family: 'IBM Plex Mono', monospace;
    padding: 4px 12px;
    border-radius: 30px;
}

.versus-badge.bad {
    background: var(--red-light);
    color: var(--red);
    border: 1px solid var(--red-border);
}

.versus-badge.good {
    background: var(--green-light);
    color: var(--green);
    border: 1px solid var(--green-border);
}

.versus-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.versus-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.versus-row:last-child {
    border-bottom: none;
}

.v-icon {
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 1px;
}

.v-icon.bad {
    color: var(--red);
}

.v-icon.good {
    color: var(--green);
}

.versus-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 28px 0;
}

.versus-divider-line {
    flex: 1;
    width: 1px;
    background: var(--border);
}

.versus-vs-pill {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    background: var(--card-hover);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 8px;
    margin: 10px 0;
}

/* ══════════════════════════════════════════
   MAIN CONTENT GRID & CHARTS
══════════════════════════════════════════ */
.main-content {
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sec-label {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.sec-label-text {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    white-space: nowrap;
}

.sec-label-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* New 4-Chart Grid */
.charts-grid-custom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.chart-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 20px 16px;
    min-width: 0;
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-hd {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.chart-hd-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-h);
    letter-spacing: -0.2px;
}

.chart-hd-sub {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    margin-top: 2px;
}

.chart-legend {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
}

.legend-pip {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.legend-pip.g {
    background: var(--green);
}

.legend-pip.r {
    background: var(--red);
}

.legend-pip.go {
    background: var(--gold-rich);
    border-radius: 50%;
}

.chart-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    /* Base height for side-by-side */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.chart-card.full-width .chart-wrap {
    height: 240px;
    /* Taller for full-width charts */
}

.chart-inner {
    position: relative;
    height: 100%;
}

canvas {
    display: block;
}

/* ══════════════════════════════════════════
   BOTTOM GRID: Highlights + CTA
══════════════════════════════════════════ */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

.highlights-title {
    font-family: 'Source Serif 4', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-h);
    letter-spacing: -0.4px;
    margin-bottom: 16px;
}

.highlights-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.4;
}

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

.check-badge {
    width: 22px;
    height: 22px;
    background: var(--green-light);
    border: 1px solid var(--green-border);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
    color: var(--green);
    flex-shrink: 0;
}

/* ══════════════════════════════════════════
   CTA CARD (HIGHLIGHT WHATSAPP)
══════════════════════════════════════════ */
.cta-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.cta-card-top {
    background: var(--green-light);
    border-bottom: 1px solid var(--green-border);
    padding: 10px 22px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.cta-card-top-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--green);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-family: 'IBM Plex Mono', monospace;
}

.cta-body {
    padding: 24px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cta-h {
    font-family: 'Source Serif 4', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-h);
    letter-spacing: -0.4px;
    line-height: 1.2;
    margin-bottom: 8px;
}

.cta-desc {
    font-size: 13.5px;
    color: var(--text-sub);
    line-height: 1.65;
    margin-bottom: 20px;
}

.cta-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}

.price-big {
    font-family: 'Source Serif 4', serif;
    font-size: 52px;
    font-weight: 900;
    color: var(--green);
    letter-spacing: -2px;
    line-height: 1;
}

.price-label {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.3px;
}

.price-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 18px;
}

.cta-btn {
    background: var(--gold-rich);
    color: #fff;
    border: none;
    padding: 15px 22px;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    letter-spacing: 0.1px;
    margin-bottom: 16px;
    display: block;
    width: 100%;
    transition: opacity 0.15s;
    text-decoration: none;
}

.cta-btn:hover {
    opacity: 0.9;
}

.then-unlock {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--gold-light);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    margin-bottom: 16px;
}

.unlock-icon {
    font-size: 16px;
}

.unlock-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--gold-rich);
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.3px;
}

.contact-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-item {
    font-size: 12px;
    color: var(--text-sub);
    font-family: 'IBM Plex Mono', monospace;
    display: flex;
    align-items: center;
    gap: 6px;
}

.contact-item .wa-highlight {
    background: var(--green-light);
    color: var(--green);
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 30px;
    border: 1px solid var(--green-border);
    font-size: 13px;
    letter-spacing: 0.3px;
    display: inline-block;
}

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.page-footer {
    border-top: 1px solid var(--border);
    padding: 18px 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface2);
    gap: 20px;
}

.footer-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 600px;
    font-family: 'IBM Plex Mono', monospace;
}

.footer-brand {
    text-align: right;
    flex-shrink: 0;
}

.footer-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-sub);
    letter-spacing: -0.2px;
}

.footer-url {
    font-size: 10.5px;
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
    margin-top: 3px;
}

@media (max-width: 900px) {
    .versus-section {
        grid-template-columns: 1fr;
    }

    .versus-divider {
        flex-direction: row;
        padding: 0 24px;
        height: 40px;
    }

    .versus-divider-line {
        flex: 1;
        height: 1px;
        width: auto;
    }

    .versus-vs-pill {
        margin: 0 10px;
    }

    .versus-col {
        padding: 20px 24px;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 28px 24px 24px;
    }

    .hero-total {
        max-width: 100%;
    }

    .hero-title {
        font-size: 32px;
    }

    .stats-band-wrap {
        padding: 16px 24px;
    }

    .stats-band {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-item:nth-child(3) {
        border-right: none;
    }

    .stat-item:nth-child(4),
    .stat-item:nth-child(5) {
        border-top: 1px solid var(--border);
    }

    .main-content {
        padding: 24px;
        gap: 24px;
    }

    .charts-grid-custom {
        grid-template-columns: 1fr;
    }

    .bottom-grid {
        display: flex;
        flex-direction: column-reverse;
        gap: 32px;
    }

    .page-footer {
        padding: 16px 24px;
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-brand {
        text-align: left;
    }
}

@media (max-width: 560px) {
    .chart-inner {
        min-width: 700px;
    }

    .hero-title {
        font-size: 26px;
    }

    .total-number {
        font-size: 52px;
    }

    .stats-band {
        grid-template-columns: 1fr 1fr;
    }

    .stat-item:nth-child(4) {
        border-right: 1px solid var(--border);
    }

    .stat-item:nth-child(5) {
        grid-column: span 2;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 63.9375rem) {
    .desktop-nav {
        display: none !important;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

@media (max-width: 47.9375rem) {
    html {
        font-size: 14px;
    }

    .navbar-brand {
        font-size: 1rem;
    }
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 0.375rem;
    height: 0.375rem;
}

::-webkit-scrollbar-track {
    background: var(--card-hover);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 0.1875rem;
}

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

/* ========== LOADING SPINNER OVERLAY ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(12, 16, 23, 0.75);
    /* dark mode overlay */
    backdrop-filter: blur(3px);
    z-index: 999999;
    display: none;
    /* hidden by default, toggled via display:flex in JS */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    pointer-events: all;
    user-select: none;
}

[data-theme="light"] .loading-overlay {
    background: rgba(244, 245, 248, 0.85);
    /* light mode overlay */
}

.loading-spinner {
    width: 50px;
    height: 50px;
    background-image: url('../favicon.ico');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: spin-pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    filter: drop-shadow(0 0 10px rgba(9, 107, 216, 0.4));
}

@keyframes spin-pulse {
    0% {
        transform: scale(0.8) rotate(0deg);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1) rotate(180deg);
        opacity: 1;
    }

    100% {
        transform: scale(0.8) rotate(360deg);
        opacity: 0.8;
    }
}

.loading-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.5px;
    animation: pulse-text 1.5s infinite;
}

@keyframes pulse-text {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.desktop-nav .dropdown:last-child .dropdown-menu {
    left: auto !important;
    right: 0 !important;
}

.reset_restart_websocket {
    visibility: hidden;
}

.ws-wrapper {
    width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
}