    :root {
        --bg-primary: #f8fafc;
        --bg-secondary: #ffffff;
        --bg-tertiary: #f1f5f9;
        --text-primary: #0f172a;
        --text-secondary: #475569;
        --text-tertiary: #94a3b8;
        --border-color: #e2e8f0;
        --glass-bg: rgba(255, 255, 255, 0.85);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
        --sidebar-width: 260px;
        --sidebar-collapsed: 80px;
        --header-height: 72px;
        --green: #10b981;
        --red: #ef4444;
    }

    html.dark {
        --bg-primary: #0a0e1a;
        --bg-secondary: #111827;
        --bg-tertiary: #1a2035;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --text-tertiary: #64748b;
        --border-color: rgba(255, 255, 255, 0.08);
        --glass-bg: rgba(17, 24, 39, 0.85);
    }

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    html {
        scroll-behavior: smooth;
        -webkit-text-size-adjust: 100%;
    }

    body {
        font-family: 'Inter', sans-serif;
        background-color: var(--bg-primary);
        color: var(--text-primary);
        overflow-x: hidden;
        line-height: 1.5;
        -webkit-font-smoothing: antialiased;
    }

    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    ::-webkit-scrollbar-track {
        background: transparent;
    }

    ::-webkit-scrollbar-thumb {
        background: var(--text-tertiary);
        border-radius: 10px;
    }

    .crypto-card {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 16px;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .sidebar {
        width: var(--sidebar-width);
        transition: width 0.3s ease, transform 0.3s ease;
        z-index: 60;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
    }

    .sidebar.collapsed {
        width: var(--sidebar-collapsed);
    }

    .sidebar.collapsed .sidebar-label,
    .sidebar.collapsed .sidebar-logo-text,
    .sidebar.collapsed .sidebar-badge,
    .sidebar.collapsed .sidebar-section-title,
    .sidebar.collapsed .sidebar-pro-card {
        display: none;
    }

    .sidebar.collapsed .sidebar-item {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .sidebar-item {
        display: flex;
        align-items: center;
        padding: 10px 16px;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.2s ease;
        color: var(--text-secondary);
        position: relative;
        margin: 2px 0;
        gap: 12px;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
    }

    .sidebar-item:hover {
        background: rgba(59, 130, 246, 0.08);
        color: var(--text-primary);
    }

    .sidebar-item.active {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
        color: #3b82f6;
        font-weight: 600;
    }

    .sidebar-item.active::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 24px;
        background: linear-gradient(180deg, #3b82f6, #8b5cf6);
        border-radius: 0 4px 4px 0;
    }

    @media (max-width: 1023px) {
        .sidebar {
            width: 280px !important;
            transform: translateX(-100%);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        }

        .sidebar.mobile-open {
            transform: translateX(0);
        }

        .sidebar.collapsed {
            width: 280px !important;
        }

        .sidebar.collapsed .sidebar-label,
        .sidebar.collapsed .sidebar-logo-text,
        .sidebar.collapsed .sidebar-badge,
        .sidebar.collapsed .sidebar-section-title,
        .sidebar.collapsed .sidebar-pro-card {
            display: block;
        }

        .sidebar.collapsed .sidebar-item {
            justify-content: flex-start;
            padding-left: 16px;
            padding-right: 16px;
        }

        .main-content {
            margin-left: 0 !important;
        }
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 55;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    .main-header {
        height: var(--header-height);
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-color);
        z-index: 40;
        position: sticky;
        top: 0;
    }

    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 10px 20px;
        border-radius: 12px;
        font-weight: 600;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.3s ease;
        border: none;
        outline: none;
        position: relative;
        overflow: hidden;
        white-space: nowrap;
    }

    .btn-primary {
        background: linear-gradient(135deg, #3b82f6, #2563eb);
        color: white;
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
    }

    .btn-primary:hover {
        transform: translateY(-1px);
    }

    .btn-ghost {
        background: transparent;
        color: var(--text-secondary);
        border: 1px solid var(--border-color);
    }

    .btn-ghost:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .btn-green {
        background: linear-gradient(135deg, #10b981, #059669);
        color: white;
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    }

    .btn-red {
        background: linear-gradient(135deg, #ef4444, #dc2626);
        color: white;
        box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    }

    .ripple {
        position: absolute;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.35);
        transform: scale(0);
        animation: ripple-animation 0.6s linear;
        pointer-events: none;
    }

    @keyframes ripple-animation {
        to {
            transform: scale(4);
            opacity: 0;
        }
    }

    .badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        line-height: 1;
    }

    .badge-green {
        background: rgba(16, 185, 129, 0.12);
        color: #10b981;
    }

    .badge-red {
        background: rgba(239, 68, 68, 0.12);
        color: #ef4444;
    }

    .dropdown-menu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        min-width: 200px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        box-shadow: var(--shadow-xl);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px) scale(0.95);
        transition: all 0.2s ease;
        z-index: 100;
        padding: 6px;
    }

    .dropdown-menu.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

    .dropdown-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s ease;
        color: var(--text-secondary);
        font-size: 13px;
        font-weight: 500;
    }

    .dropdown-item:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .notification-panel {
        position: fixed;
        top: 0;
        right: -400px;
        width: 380px;
        max-width: 100vw;
        height: 100vh;
        background: var(--bg-secondary);
        border-left: 1px solid var(--border-color);
        z-index: 200;
        transition: right 0.3s ease;
        overflow-y: auto;
    }

    .notification-panel.open {
        right: 0;
    }

    .notification-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 199;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .notification-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    .search-modal,
    .modal-backdrop {
        position: fixed;
        inset: 0;
        z-index: 300;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding-top: 12vh;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .modal-backdrop {
        align-items: center;
        padding: 16px;
        z-index: 250;
    }

    .search-modal.show,
    .modal-backdrop.show {
        opacity: 1;
        visibility: visible;
    }

    .search-modal-overlay,
    .modal-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(8px);
    }

    .search-modal-content,
    .modal-content {
        position: relative;
        width: 90%;
        max-width: 600px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 16px;
        box-shadow: var(--shadow-xl);
        transform: translateY(-20px) scale(0.95);
        transition: all 0.3s ease;
        overflow: hidden;
    }

    .modal-content {
        max-width: 480px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .search-modal.show .search-modal-content,
    .modal-backdrop.show .modal-content {
        transform: translateY(0) scale(1);
    }

    .tab-btn {
        padding: 6px 12px;
        border-radius: 8px;
        font-size: 12px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        color: var(--text-secondary);
        background: transparent;
        border: none;
        white-space: nowrap;
    }

    .tab-btn.active {
        background: linear-gradient(135deg, #3b82f6, #2563eb);
        color: white;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    }

    .tab-btn:not(.active):hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .tab-content {
        display: none;
        animation: fadeIn 0.3s ease;
    }

    .tab-content.active {
        display: block;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(4px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .data-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    .data-table thead th {
        background: var(--bg-tertiary);
        padding: 10px 12px;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-tertiary);
        text-align: left;
        white-space: nowrap;
    }

    .data-table thead th:first-child {
        border-radius: 8px 0 0 8px;
    }

    .data-table thead th:last-child {
        border-radius: 0 8px 8px 0;
    }

    .data-table tbody tr {
        transition: all 0.2s ease;
    }

    .data-table tbody tr:hover {
        background: var(--bg-tertiary);
    }

    .data-table tbody td {
        padding: 10px 12px;
        font-size: 12px;
        border-bottom: 1px solid var(--border-color);
        white-space: nowrap;
    }

    .theme-switch {
        width: 46px;
        height: 26px;
        border-radius: 13px;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        cursor: pointer;
        position: relative;
        transition: all 0.3s ease;
        flex-shrink: 0;
    }

    .theme-switch-thumb {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: linear-gradient(135deg, #3b82f6, #8b5cf6);
        position: absolute;
        top: 2px;
        left: 2px;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    html.dark .theme-switch-thumb {
        left: 22px;
    }

    .ticker-bar {
        overflow: hidden;
        white-space: nowrap;
    }

    .ticker-content {
        display: inline-flex;
        animation: ticker 40s linear infinite;
    }

    @keyframes ticker {
        from {
            transform: translateX(0);
        }

        to {
            transform: translateX(-50%);
        }
    }

    @media (max-width: 768px) {
        .notification-panel {
            width: 100vw;
            right: -100vw;
        }

        :root {
            --header-height: 60px;
        }
    }

    body.no-scroll {
        overflow: hidden;
    }

    html.dark .apexcharts-tooltip {
        background: #1e293b !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
        color: #f1f5f9 !important;
    }

    html.dark .apexcharts-tooltip .apexcharts-tooltip-title {
        background: #0f172a !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }

    .apexcharts-menu {
        background: var(--bg-secondary) !important;
        border-color: var(--border-color) !important;
    }

    .crypto-logo {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        object-fit: contain;
        background: white;
        padding: 2px;
        flex-shrink: 0;
    }

    html.dark .crypto-logo {
        background: rgba(255, 255, 255, 0.9);
    }

    .crypto-logo-sm {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        object-fit: contain;
        flex-shrink: 0;
    }

    .crypto-logo-md {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        object-fit: contain;
        background: white;
        padding: 1.5px;
        flex-shrink: 0;
    }

    html.dark .crypto-logo-md {
        background: rgba(255, 255, 255, 0.9);
    }

    .crypto-logo-lg {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: contain;
        background: white;
        padding: 3px;
        flex-shrink: 0;
    }

    html.dark .crypto-logo-lg {
        background: rgba(255, 255, 255, 0.9);
    }

    /* ===== TRADING SPECIFIC ===== */
    .order-type-btn {
        padding: 6px 10px;
        border-radius: 8px;
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        color: var(--text-secondary);
        background: transparent;
        border: none;
        white-space: nowrap;
    }

    .order-type-btn.active {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .side-tab {
        padding: 10px;
        border-radius: 10px;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s ease;
        text-align: center;
        border: none;
    }

    .side-tab.buy-active {
        background: linear-gradient(135deg, #10b981, #059669);
        color: white;
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    }

    .side-tab.sell-active {
        background: linear-gradient(135deg, #ef4444, #dc2626);
        color: white;
        box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    }

    .side-tab:not(.buy-active):not(.sell-active) {
        background: var(--bg-tertiary);
        color: var(--text-secondary);
    }

    .input-group {
        position: relative;
        display: flex;
        align-items: center;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        transition: all 0.2s ease;
    }

    .input-group:focus-within {
        border-color: #3b82f6;
    }

    .input-group input {
        flex: 1;
        padding: 9px 12px;
        background: transparent;
        border: none;
        font-size: 13px;
        font-weight: 500;
        color: var(--text-primary);
        outline: none;
        min-width: 0;
        font-family: 'JetBrains Mono', monospace, 'Inter';
    }

    .input-group .prefix,
    .input-group .suffix {
        padding: 0 12px;
        font-size: 11px;
        font-weight: 600;
        color: var(--text-tertiary);
        flex-shrink: 0;
    }

    .percent-btn {
        flex: 1;
        padding: 5px 6px;
        border-radius: 6px;
        font-size: 10px;
        font-weight: 600;
        background: var(--bg-tertiary);
        color: var(--text-secondary);
        border: 1px solid transparent;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .percent-btn:hover {
        border-color: var(--border-color);
        color: var(--text-primary);
    }

    .percent-btn.active {
        background: rgba(59, 130, 246, 0.12);
        color: #3b82f6;
        border-color: rgba(59, 130, 246, 0.3);
    }

    .slider {
        -webkit-appearance: none;
        width: 100%;
        height: 4px;
        border-radius: 2px;
        background: var(--bg-tertiary);
        outline: none;
    }

    .slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: linear-gradient(135deg, #3b82f6, #8b5cf6);
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
    }

    .slider::-moz-range-thumb {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: linear-gradient(135deg, #3b82f6, #8b5cf6);
        cursor: pointer;
        border: none;
    }

    /* ORDER BOOK */
    .orderbook-row {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        padding: 3px 12px;
        font-size: 11px;
        font-family: 'JetBrains Mono', monospace, 'Inter';
        position: relative;
        cursor: pointer;
        transition: background 0.1s ease;
    }

    .orderbook-row:hover {
        background: var(--bg-tertiary);
    }

    .orderbook-row .depth-bar {
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        opacity: 0.15;
        z-index: 0;
        transition: width 0.3s ease;
    }

    .orderbook-row>* {
        position: relative;
        z-index: 1;
    }

    .orderbook-price-buy {
        color: var(--green);
    }

    .orderbook-price-sell {
        color: var(--red);
    }

    /* MARKETS SIDEBAR */
    .market-row {
        display: grid;
        grid-template-columns: 1.4fr 1fr 0.8fr;
        gap: 4px;
        align-items: center;
        padding: 6px 10px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.15s ease;
    }

    .market-row:hover {
        background: var(--bg-tertiary);
    }

    .market-row.active {
        background: rgba(59, 130, 246, 0.1);
    }

    /* TIMEFRAME BUTTON */
    .tf-btn {
        padding: 4px 9px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        color: var(--text-secondary);
        background: transparent;
        border: none;
    }

    .tf-btn.active {
        background: rgba(59, 130, 246, 0.15);
        color: #3b82f6;
    }

    .tf-btn:not(.active):hover {
        color: var(--text-primary);
        background: var(--bg-tertiary);
    }

    .chart-tool {
        padding: 5px;
        border-radius: 6px;
        cursor: pointer;
        color: var(--text-tertiary);
        transition: all 0.2s ease;
        border: none;
        background: transparent;
    }

    .chart-tool:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .chart-tool.active {
        background: rgba(59, 130, 246, 0.15);
        color: #3b82f6;
    }

    .filled-bar {
        height: 3px;
        border-radius: 2px;
        background: var(--bg-tertiary);
        overflow: hidden;
    }

    .filled-bar-fill {
        height: 100%;
        border-radius: 2px;
        transition: width 0.5s ease;
    }

    .price-tag {
        font-family: 'JetBrains Mono', monospace, 'Inter';
    }

    .search-input-wrapper {
        position: relative;
    }

    .search-input-wrapper input {
        width: 100%;
        padding: 7px 10px 7px 32px;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 12px;
        color: var(--text-primary);
        outline: none;
        transition: all 0.2s ease;
    }

    .search-input-wrapper input:focus {
        border-color: #3b82f6;
    }

    .search-input-wrapper svg {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-tertiary);
    }

    .spread-pill {
        padding: 2px 8px;
        border-radius: 999px;
        background: var(--bg-tertiary);
        font-size: 10px;
        font-weight: 600;
        color: var(--text-secondary);
    }

    /* CHART CONTAINER FIX */
    #mainTradingChart {
        width: 100%;
        min-height: 380px;
    }

    #volumeSubChart {
        width: 100%;
        min-height: 80px;
    }

    .apexcharts-canvas {
        background: transparent !important;
    }

    @media (max-width: 480px) {
        .crypto-card {
            border-radius: 12px;
        }

        .btn {
            padding: 8px 14px;
            font-size: 12px;
        }
    }

.main-content{
    flex: 1;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.main-wrapper{
    display: flex;
    width: 100%;
    min-width: 0;
}

@media (min-width:1024px){
    .main-content{
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }
}
