/* ============================================
   MicroTrader Pro — Main Styles
   Color Scheme: Dark Trading (#0A0E17)
   ============================================ */

:root {
    --bg-primary: #0A0E17;
    --bg-secondary: #0F1520;
    --bg-tertiary: #141C2B;
    --bg-panel: #111927;
    --bg-hover: #1A2332;
    --bg-input: #0D1219;
    --border-primary: #1E2A3A;
    --border-secondary: #2A3A4E;
    --border-accent: #3A4F6A;
    --text-primary: #E8ECF1;
    --text-secondary: #8899AA;
    --text-muted: #556677;
    --green: #00E676;
    --green-dim: #00C853;
    --green-bg: rgba(0, 230, 118, 0.08);
    --green-bg-strong: rgba(0, 230, 118, 0.15);
    --red: #FF5252;
    --red-dim: #E53935;
    --red-bg: rgba(255, 82, 82, 0.08);
    --red-bg-strong: rgba(255, 82, 82, 0.15);
    --blue: #448AFF;
    --blue-dim: #2979FF;
    --blue-bg: rgba(68, 138, 255, 0.1);
    --yellow: #FFD740;
    --yellow-bg: rgba(255, 215, 64, 0.1);
    --purple: #B388FF;
    --orange: #FFAB40;
    --cyan: #18FFFF;
    --font-main: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --transition: all 0.2s ease;
}

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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-secondary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-accent); }

.hidden { display: none !important; }

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 10000;
    background-image: 
        radial-gradient(ellipse at 20% 80%, rgba(68,138,255,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0,230,118,0.04) 0%, transparent 50%);
}

.login-container {
    width: 420px;
    max-width: 95vw;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo i {
    font-size: 48px;
    color: var(--blue);
    margin-bottom: 12px;
    display: block;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.login-logo p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.broker-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.broker-tab {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.broker-tab:hover { border-color: var(--border-secondary); }
.broker-tab.active {
    background: var(--blue-bg);
    border-color: var(--blue);
    color: var(--blue);
}

.broker-login { display: none; }
.broker-login.active { display: block; }

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(68,138,255,0.15);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
}

.btn-connect {
    width: 100%;
    padding: 12px;
    background: var(--blue);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-connect:hover { background: var(--blue-dim); }
.btn-connect:disabled { opacity: 0.5; cursor: not-allowed; }

.login-status {
    margin-top: 16px;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    text-align: center;
    display: none;
}

.login-status.error {
    display: block;
    background: var(--red-bg-strong);
    color: var(--red);
    border: 1px solid rgba(255,82,82,0.3);
}

.login-status.success {
    display: block;
    background: var(--green-bg-strong);
    color: var(--green);
    border: 1px solid rgba(0,230,118,0.3);
}

.login-status.loading {
    display: block;
    background: var(--blue-bg);
    color: var(--blue);
    border: 1px solid rgba(68,138,255,0.3);
}

.login-status.warn {
    display: block;
    background: rgba(255,171,64,0.12);
    color: #FFAB40;
    border: 1px solid rgba(255,171,64,0.3);
}

/* ============================================
   TOP BAR
   ============================================ */
.top-bar {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    gap: 12px;
    z-index: 100;
}

.top-bar-left,
.top-bar-center,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-left { flex: 1; }
.top-bar-center { flex: 0 0 auto; }
.top-bar-right { flex: 1; justify-content: flex-end; }

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.logo-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--blue);
    font-weight: 700;
    font-size: 14px;
    margin-right: 8px;
}

.logo-mini i { font-size: 18px; }

.instrument-selector { position: relative; }

.btn-instrument {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    font-family: var(--font-mono);
}

.btn-instrument:hover { border-color: var(--border-secondary); }

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    width: 240px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    z-index: 1000;
    overflow: hidden;
}

.dropdown input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: none;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.dropdown-list {
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    transition: var(--transition);
    font-family: var(--font-mono);
    font-size: 12px;
}

.dropdown-item:hover { background: var(--bg-hover); }

.dropdown-item .pair { font-weight: 600; color: var(--text-primary); }
.dropdown-item .spread-info { color: var(--text-muted); }

.timeframe-selector {
    display: flex;
    gap: 2px;
    align-items: center;
}

.tf-btn {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-mono);
}

.tf-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.tf-btn.active {
    background: var(--blue-bg);
    color: var(--blue);
    border-color: rgba(68,138,255,0.3);
}

/* Price Display */
.price-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
}

.price {
    font-size: 16px;
    font-weight: 700;
    transition: color 0.3s;
}

.price.bid { color: var(--red); }
.price.ask { color: var(--green); }
.price.flash-up { color: var(--green) !important; text-shadow: 0 0 8px var(--green); }
.price.flash-down { color: var(--red) !important; text-shadow: 0 0 8px var(--red); }

.price-spread {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 10px;
}

/* Regime Badge */
.regime-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.regime-efficient { background: var(--green-bg-strong); color: var(--green); }
.regime-inefficient { background: var(--red-bg-strong); color: var(--red); }
.regime-transition { background: var(--yellow-bg); color: var(--yellow); }
.regime-unknown { background: var(--bg-tertiary); color: var(--text-muted); }

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.broker-label {
    font-weight: 600;
    color: var(--blue);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.offline { background: var(--red); box-shadow: 0 0 6px var(--red); }
.status-dot.connecting { background: var(--yellow); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.ping { color: var(--text-muted); font-family: var(--font-mono); font-size: 10px; }

.account-info {
    display: flex;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 13px;
}

.balance { color: var(--text-primary); font-weight: 600; }
.pnl { font-weight: 600; }
.pnl.positive { color: var(--green); }
.pnl.negative { color: var(--red); }

/* ============================================
   MAIN LAYOUT
   ============================================ */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.main-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

/* Sidebars */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-right {
    border-right: none;
    border-left: 1px solid var(--border-primary);
}

.sidebar-section {
    border-bottom: 1px solid var(--border-primary);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-tertiary);
}

.section-header h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-header h3 i {
    color: var(--blue);
    font-size: 11px;
}

.btn-collapse {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 10px;
    transition: var(--transition);
}

.btn-collapse:hover { color: var(--text-primary); }
.btn-collapse.collapsed i { transform: rotate(180deg); }

.panel-body {
    padding: 8px;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.panel-body.collapsed {
    max-height: 0;
    padding: 0 8px;
}

/* ============================================
   BOTTOM PANEL
   ============================================ */
.bottom-panel {
    height: 180px;
    min-height: 120px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
}

.bottom-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-primary);
    padding: 0 8px;
}

.btab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.btab:hover { color: var(--text-primary); }
.btab.active { color: var(--blue); border-bottom-color: var(--blue); }

.tab-badge {
    background: var(--bg-tertiary);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-family: var(--font-mono);
}

.bottom-content {
    flex: 1;
    overflow: auto;
}

.tab-content {
    display: none;
    padding: 4px;
}

.tab-content.active { display: block; }

.positions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-family: var(--font-mono);
}

.positions-table th {
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-primary);
    white-space: nowrap;
    font-size: 11px;
}

.positions-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(30,42,58,0.5);
    white-space: nowrap;
}

.positions-table tr:hover td { background: var(--bg-hover); }

.empty-state {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.log-container {
    padding: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    max-height: 140px;
    overflow-y: auto;
}

.log-entry {
    padding: 2px 0;
    border-bottom: 1px solid rgba(30,42,58,0.3);
}

.log-entry .log-time { color: var(--text-muted); }
.log-entry.log-info .log-msg { color: var(--blue); }
.log-entry.log-success .log-msg { color: var(--green); }
.log-entry.log-error .log-msg { color: var(--red); }
.log-entry.log-warn .log-msg { color: var(--yellow); }

/* ============================================
   TRADING PANEL
   ============================================ */
.trade-panel { padding: 4px; }

.trade-mode-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.mode-btn {
    flex: 1;
    padding: 6px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.mode-btn.active {
    background: var(--blue-bg);
    border-color: var(--blue);
    color: var(--blue);
}

.trade-size { margin-bottom: 12px; }
.trade-size label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
}

.size-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

.size-input input {
    flex: 1;
    padding: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    text-align: center;
}

.size-input input:focus {
    outline: none;
    border-color: var(--blue);
}

.btn-size-dec, .btn-size-inc {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-size-dec:hover, .btn-size-inc:hover {
    background: var(--bg-hover);
}

.trade-sltp { margin-bottom: 12px; }

.sltp-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.sltp-row label {
    width: 70px;
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.sltp-row input[type="number"] {
    flex: 1;
    padding: 5px 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
}

.sltp-row input:focus {
    outline: none;
    border-color: var(--blue);
}

.sl-pips, .tp-pips {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    width: 68px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* SL/TP mode toggle (Пипсы / Цена) */
.sltp-mode-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-primary);
}

.sltp-mode-btn {
    flex: 1;
    padding: 4px 0;
    background: var(--bg-input);
    border: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.sltp-mode-btn:first-child { border-right: 1px solid var(--border-primary); }

.sltp-mode-btn.active {
    background: var(--blue-bg);
    color: var(--blue);
}

.sltp-mode-btn:hover:not(.active) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Candle countdown timer */
.candle-timer {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.3s, border-color 0.3s;
}

.candle-timer i {
    font-size: 10px;
    color: var(--text-muted);
}

.candle-timer-urgent {
    color: var(--red) !important;
    border-color: rgba(255,82,82,0.4) !important;
    animation: timer-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes timer-pulse {
    from { background: var(--bg-tertiary); }
    to   { background: rgba(255,82,82,0.08); }
}

/* MT5 Bridge Info block */
.mt5-bridge-info {
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(68,138,255,0.06);
    border: 1px solid rgba(68,138,255,0.2);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.mt5-bridge-info i {
    color: var(--blue);
    margin-right: 4px;
}

.mt5-bridge-info code {
    background: var(--bg-input);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--yellow);
}

.field-hint {
    display: inline-block;
    width: 14px;
    height: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 50%;
    font-size: 9px;
    text-align: center;
    line-height: 14px;
    color: var(--text-muted);
    cursor: help;
    vertical-align: middle;
}

/* (empty-state is defined above, no duplicate needed) */

.trade-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.btn-trade {
    flex: 1;
    padding: 12px 8px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    font-family: var(--font-mono);
}

.btn-sell {
    background: linear-gradient(135deg, #E53935, #C62828);
    color: white;
}

.btn-sell:hover { background: linear-gradient(135deg, #F44336, #D32F2F); }

.btn-buy {
    background: linear-gradient(135deg, #00C853, #00961F);
    color: white;
}

.btn-buy:hover { background: linear-gradient(135deg, #00E676, #00C853); }

.trade-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
}

.trade-price {
    display: block;
    font-size: 11px;
    opacity: 0.9;
    margin-top: 2px;
}

.auto-settings { padding-top: 8px; }

.auto-settings .form-group {
    margin-bottom: 8px;
}

.auto-settings label {
    font-size: 11px;
    color: var(--text-secondary);
}

.auto-settings input[type="range"] {
    width: 100%;
    accent-color: var(--blue);
}

.auto-settings input[type="number"] {
    width: 60px;
    padding: 4px 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
}

.btn-auto-start {
    width: 100%;
    padding: 10px;
    background: var(--purple);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    transition: var(--transition);
}

.btn-auto-start:hover { opacity: 0.9; }
.btn-auto-start.running { background: var(--red); }

/* Signal Quality */
.signal-quality { text-align: center; }

.sq-meter { position: relative; }
.sq-meter canvas { width: 100%; max-width: 200px; }
.sq-value {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
}

.sq-details { margin-top: 8px; }
.sq-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    font-size: 11px;
    border-bottom: 1px solid rgba(30,42,58,0.3);
}
.sq-row span:first-child { color: var(--text-secondary); }
.sq-row span:last-child { font-family: var(--font-mono); font-weight: 600; }

/* Signal Panel */
.signal-panel { min-height: 60px; }
.signal-none {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
}
.signal-none i { font-size: 20px; margin-bottom: 6px; display: block; }

.signal-card {
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.signal-card.bullish {
    background: var(--green-bg);
    border-color: rgba(0,230,118,0.2);
}

.signal-card.bearish {
    background: var(--red-bg);
    border-color: rgba(255,82,82,0.2);
}

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

.signal-type {
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.signal-quality-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.signal-card.bullish .signal-type { color: var(--green); }
.signal-card.bearish .signal-type { color: var(--red); }
.signal-card.bullish .signal-quality-badge { background: var(--green-bg-strong); color: var(--green); }
.signal-card.bearish .signal-quality-badge { background: var(--red-bg-strong); color: var(--red); }

.signal-body {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.signal-rec {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
}

.modal-content {
    width: 480px;
    max-width: 95vw;
    max-height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
}

.modal-header h2 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close-modal {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-close-modal:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body { padding: 20px; }

.settings-section {
    margin-bottom: 24px;
}

.settings-section h3 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-primary);
}

.btn-secondary {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-secondary:hover { border-color: var(--border-secondary); color: var(--text-primary); }

.mobile-only { display: none; }
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
}

/* Position action buttons */
.btn-close-pos, .btn-edit-pos {
    padding: 3px 8px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
    margin-right: 4px;
}

.btn-close-pos {
    background: var(--red-bg-strong);
    color: var(--red);
}

.btn-close-pos:hover { background: var(--red); color: white; }

.btn-edit-pos {
    background: var(--blue-bg);
    color: var(--blue);
}

.btn-edit-pos:hover { background: var(--blue); color: white; }
