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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #131722;
    color: #d1d4dc;
    overflow: hidden;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    background-color: #1a1d29;
    border-bottom: 1px solid #2a2e39;
    padding: 0 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #fff;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #ff6b00, #ff9500);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

.header-nav {
    display: flex;
    gap: 8px;
}

.nav-item {
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #868993;
    transition: all 0.2s;
}

.nav-item.active {
    background-color: #2a2e39;
    color: #fff;
}

.header-center {
    display: flex;
    align-items: center;
}

.instrument-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #2a2e39;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.pair {
    font-weight: 600;
    color: #fff;
}

.separator {
    color: #5a5e6b;
}

.add-btn {
    width: 20px;
    height: 20px;
    border: none;
    background-color: #ff6b00;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.account-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 11px;
}

.account-label {
    color: #868993;
}

.account-type {
    color: #fff;
    font-weight: 600;
}

.balance {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.deposit-btn {
    padding: 8px 16px;
    background-color: #ff6b00;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

.header-icons {
    display: flex;
    gap: 12px;
}

.icon {
    cursor: pointer;
    font-size: 16px;
}

/* Main Container */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: #1a1d29;
    border-right: 1px solid #2a2e39;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid #2a2e39;
    font-weight: 600;
    color: #fff;
}

.sidebar-toggle, .search-btn {
    background: none;
    border: none;
    color: #868993;
    cursor: pointer;
    font-size: 16px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
}

.favorites-section {
    padding: 8px 0;
}

.section-title {
    padding: 8px 12px;
    font-size: 11px;
    color: #868993;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.instrument-list {
    display: flex;
    flex-direction: column;
}

.instrument-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
}

.instrument-item:hover {
    background-color: #252836;
}

.instrument-item.active {
    background-color: #252836;
    border-left-color: #ff6b00;
}

.instrument-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crypto-icon, .metal-icon, .oil-icon, .forex-icon, .index-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 14px;
}

.crypto-icon {
    background-color: #f7931a;
    color: #fff;
}

.instrument-name {
    font-weight: 600;
    color: #fff;
    font-size: 13px;
}

.instrument-type {
    font-size: 10px;
    color: #868993;
    background-color: #2a2e39;
    padding: 2px 6px;
    border-radius: 3px;
}

.instrument-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.price {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.change {
    font-size: 11px;
    font-weight: 600;
}

.change.positive {
    color: #22c55e;
}

.change.negative {
    color: #ef4444;
}

/* Chart Area */
.chart-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #131722;
    min-width: 0;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid #2a2e39;
}

.chart-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crypto-icon-large {
    width: 36px;
    height: 36px;
    background-color: #f7931a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.title-info {
    display: flex;
    flex-direction: column;
}

.title-main {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.title-sub {
    font-size: 11px;
    color: #868993;
}

.chart-price {
    display: flex;
    gap: 16px;
    font-size: 12px;
}

.chart-price span {
    color: #868993;
}

.chart-price .positive {
    color: #22c55e;
}

.chart-tools {
    display: flex;
    gap: 8px;
}

.tool-btn {
    background: none;
    border: 1px solid #2a2e39;
    color: #868993;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid #2a2e39;
}

.timeframes {
    display: flex;
    gap: 4px;
}

.tf-btn {
    padding: 4px 10px;
    border: none;
    background: none;
    color: #868993;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
}

.tf-btn.active {
    background-color: #2a2e39;
    color: #fff;
}

.chart-types {
    display: flex;
    gap: 4px;
}

.type-btn {
    padding: 4px 10px;
    border: none;
    background: none;
    color: #868993;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
}

.type-btn.active {
    background-color: #2a2e39;
    color: #fff;
}

.ind-btn {
    padding: 4px 12px;
    border: 1px solid #2a2e39;
    background: none;
    color: #868993;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
}

#chart-container {
    flex: 1;
    min-height: 0;
    position: relative;
}

/* Order Panel */
.order-panel {
    width: 300px;
    background-color: #1a1d29;
    border-left: 1px solid #2a2e39;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 12px;
    border-bottom: 1px solid #2a2e39;
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.panel-subtitle {
    font-size: 11px;
    color: #868993;
}

.panel-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-type {
    display: flex;
    gap: 8px;
}

.order-type-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid #2a2e39;
    background: none;
    color: #868993;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.order-type-btn.active {
    background-color: #2a2e39;
    color: #fff;
}

.volume-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.volume-section label {
    font-size: 12px;
    color: #868993;
}

.volume-input {
    display: flex;
    align-items: center;
    border: 1px solid #2a2e39;
    border-radius: 4px;
    overflow: hidden;
}

.vol-btn {
    width: 36px;
    height: 40px;
    border: none;
    background-color: #2a2e39;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
}

.vol-input {
    flex: 1;
    height: 40px;
    border: none;
    background-color: #1a1d29;
    color: #fff;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    outline: none;
}

.price-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-box {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.price-box.sell {
    background-color: #ef4444;
}

.price-box.buy {
    background-color: #3b82f6;
}

.price-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.price-value {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.order-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    color: #868993;
}

.detail-row {
    display: flex;
    justify-content: space-between;
}

/* Positions Panel */
.positions-panel {
    background-color: #1a1d29;
    border-top: 1px solid #2a2e39;
    min-height: 180px;
    max-height: 240px;
    display: flex;
    flex-direction: column;
}

.positions-tabs {
    display: flex;
    padding: 8px 16px;
    gap: 8px;
    border-bottom: 1px solid #2a2e39;
}

.pos-tab {
    padding: 8px 16px;
    border: none;
    background: none;
    color: #868993;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}

.pos-tab.active {
    color: #fff;
    border-bottom-color: #ff6b00;
}

.badge {
    background-color: #ff6b00;
    color: #fff;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    margin-left: 4px;
}

.positions-table {
    flex: 1;
    overflow-y: auto;
    font-size: 12px;
}

.table-header {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    padding: 10px 16px;
    color: #868993;
    border-bottom: 1px solid #2a2e39;
    font-weight: 600;
}

.table-row {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    padding: 12px 16px;
    border-bottom: 1px solid #2a2e39;
    align-items: center;
}

.table-row span {
    color: #d1d4dc;
}

.table-row .symbol {
    font-weight: 700;
    color: #fff;
}

.table-row .type.sell {
    color: #ef4444;
}

.table-row .type.buy {
    color: #22c55e;
}

.table-row .profit {
    color: #22c55e;
    font-weight: 600;
}

.positions-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid #2a2e39;
    font-size: 12px;
    color: #868993;
}

.close-all-btn {
    padding: 6px 12px;
    border: 1px solid #ef4444;
    background: none;
    color: #ef4444;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
}

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

::-webkit-scrollbar-track {
    background: #1a1d29;
}

::-webkit-scrollbar-thumb {
    background: #2a2e39;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3e4b;
}


/* TradeMax demo */
.demo-badge { font-size: 9px; font-weight: 700; letter-spacing: 1px; color: #f59e0b; border: 1px solid #f59e0b; border-radius: 3px; padding: 1px 5px; margin-left: 6px; }
.demo-strip { background: #1a1207; color: #f59e0b; font-size: 11px; text-align: center; padding: 5px 10px; border-top: 1px solid #33220055; letter-spacing: .3px; }

.logo-icon-img { width: 24px; height: 24px; border-radius: 6px; display: block; }
