/* ===== Trader Platform - Main Stylesheet ===== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-dark: #0f1117;
    --bg-card: #1a1d27;
    --bg-card-hover: #22263a;
    --bg-sidebar: #141722;
    --bg-input: #1e2234;
    --border: #2a2e3f;
    --text: #e4e6eb;
    --text-muted: #8b8fa3;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --green: #22c55e;
    --green-bg: rgba(34,197,94,0.12);
    --red: #ef4444;
    --red-bg: rgba(239,68,68,0.12);
    --orange: #f59e0b;
    --purple: #8b5cf6;
    --blue: #3b82f6;
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-w: 240px;
    --transition: 0.2s ease;
}

html { font-size: 14px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Login Page --- */
.login-page {
    background: linear-gradient(135deg, #0f1117 0%, #1a1d27 50%, #0f1117 100%);
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; overflow: hidden; position: relative;
}
.login-container { position: relative; z-index: 2; width: 100%; max-width: 420px; padding: 20px; }
.login-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 40px 32px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-icon { font-size: 3rem; color: var(--primary); margin-bottom: 12px; display: block; }
.login-header h1 { font-size: 1.8rem; font-weight: 700; }
.login-header p { color: var(--text-muted); margin-top: 4px; }
.login-footer { text-align: center; margin-top: 20px; }
.login-footer a { color: var(--text-muted); font-size: 0.9rem; }

/* Particles animation */
.particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.particle {
    position: absolute; bottom: -10px; background: var(--primary); border-radius: 50%; opacity: 0.15;
    animation: floatUp linear infinite;
}
@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    10% { opacity: 0.15; }
    90% { opacity: 0.15; }
    100% { transform: translateY(-100vh) scale(0.5); opacity: 0; }
}

/* --- Forms --- */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; margin-bottom: 6px; font-weight: 500; color: var(--text-muted); font-size: 0.85rem;
}
.form-group label i { margin-right: 6px; width: 14px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text); font-size: 0.95rem; transition: border var(--transition);
    outline: none;
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-group input::placeholder { color: var(--text-muted); opacity: 0.6; }
.password-wrap { position: relative; }
.toggle-pass {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px;
}
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px;
    border-radius: var(--radius-sm); border: none; font-size: 0.9rem; font-weight: 500;
    cursor: pointer; transition: all var(--transition); text-decoration: none;
}
.btn i { font-size: 0.85rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-warning { background: var(--orange); color: #000; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-xs { padding: 4px 8px; font-size: 0.75rem; }

/* --- Error / Info messages --- */
.error-msg {
    background: var(--red-bg); border: 1px solid var(--red); color: var(--red);
    padding: 10px 14px; border-radius: var(--radius-sm); margin: 12px 0; font-size: 0.85rem;
}
.info-box {
    display: flex; gap: 10px; background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2);
    padding: 12px; border-radius: var(--radius-sm); margin: 12px 0; color: var(--text-muted); font-size: 0.85rem;
}
.info-box i { color: var(--primary); margin-top: 2px; }

/* --- Sidebar --- */
.sidebar {
    position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh;
    background: var(--bg-sidebar); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 100;
}
.sidebar-logo {
    display: flex; align-items: center; gap: 10px; padding: 20px 24px;
    font-size: 1.3rem; font-weight: 700; color: var(--primary); border-bottom: 1px solid var(--border);
}
.sidebar-logo i { font-size: 1.5rem; }
.sidebar-menu { list-style: none; padding: 12px 0; flex: 1; }
.sidebar-menu li a {
    display: flex; align-items: center; gap: 12px; padding: 10px 24px;
    color: var(--text-muted); font-size: 0.9rem; transition: all var(--transition); text-decoration: none;
}
.sidebar-menu li a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.sidebar-menu li a.active { color: var(--primary); background: rgba(59,130,246,0.08); border-right: 3px solid var(--primary); }
.sidebar-menu li a i { width: 20px; text-align: center; }
.sidebar-footer {
    padding: 16px 24px; border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.user-info { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.85rem; }
.user-info i { font-size: 1.2rem; }
.logout-btn { color: var(--text-muted); font-size: 1rem; }
.logout-btn:hover { color: var(--red); }

/* --- Main content --- */
.has-nav .content { margin-left: var(--sidebar-w); padding: 24px 32px; }
.content-full { padding: 24px 32px; }

/* --- Page header --- */
.page-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px;
}
.page-header h1 { font-size: 1.5rem; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.page-header h1 i { color: var(--primary); }
.header-actions { display: flex; gap: 8px; }

/* --- Stats grid --- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; display: flex; align-items: center; gap: 16px;
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center;
    justify-content: center; font-size: 1.2rem;
}
.bg-blue { background: rgba(59,130,246,0.15); color: var(--blue); }
.bg-green { background: var(--green-bg); color: var(--green); }
.bg-red { background: var(--red-bg); color: var(--red); }
.bg-purple { background: rgba(139,92,246,0.15); color: var(--purple); }
.bg-orange { background: rgba(245,158,11,0.15); color: var(--orange); }
.stat-value { display: block; font-size: 1.4rem; font-weight: 700; }
.stat-label { display: block; color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }

/* --- Panels --- */
.panel {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 20px; overflow: hidden;
}
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.panel-header h2 { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-header h2 i { color: var(--primary); }
.panel-body { padding: 20px; }

/* --- Tables --- */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; padding: 10px 12px; font-size: 0.75rem; text-transform: uppercase;
    color: var(--text-muted); border-bottom: 1px solid var(--border); font-weight: 600; white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid rgba(42,46,63,0.5); font-size: 0.85rem; white-space: nowrap; }
.table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* --- Badges --- */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem;
    font-weight: 600; text-transform: uppercase;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-scalp { background: rgba(245,158,11,0.15); color: var(--orange); }
.badge-intraday { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-daily { background: rgba(139,92,246,0.15); color: var(--purple); }
.badge-swing { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-position { background: rgba(239,68,68,0.15); color: var(--red); }

/* --- Status dots --- */
.status-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px;
}
.status-running { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-stopped { background: var(--text-muted); }
.status-error { background: var(--red); box-shadow: 0 0 6px var(--red); }
.status-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
    border-radius: 20px; font-size: 0.75rem; font-weight: 500;
}
.status-badge.status-running { background: var(--green-bg); color: var(--green); }
.status-badge.status-stopped { background: rgba(139,146,163,0.1); color: var(--text-muted); }

/* --- Text colors --- */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }

/* --- Empty state --- */
.empty-state {
    text-align: center; padding: 48px 20px; color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; display: block; opacity: 0.3; }
.empty-state p { font-size: 0.95rem; }

/* --- Strategy grid --- */
.strategy-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 24px; }
.strategy-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; text-align: center; cursor: pointer; transition: all var(--transition);
}
.strategy-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.strategy-icon { font-size: 1.5rem; color: var(--primary); margin-bottom: 8px; }
.strategy-card h3 { font-size: 0.9rem; margin-bottom: 4px; }
.strategy-card p { font-size: 0.7rem; color: var(--text-muted); line-height: 1.4; }

/* --- Bots grid --- */
.bots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.bot-card {
    background: var(--bg-dark); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
    transition: all var(--transition);
}
.bot-card:hover { border-color: rgba(59,130,246,0.3); }
.bot-card.bot-running { border-left: 3px solid var(--green); }
.bot-card.bot-error { border-left: 3px solid var(--red); }
.bot-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.bot-title { display: flex; align-items: center; gap: 10px; }
.bot-title i { color: var(--primary); font-size: 1.2rem; }
.bot-title h3 { font-size: 1rem; }
.bot-details { margin-bottom: 16px; }
.bot-detail { display: flex; justify-content: space-between; padding: 4px 0; font-size: 0.85rem; }
.bot-detail span:first-child { color: var(--text-muted); }
.bot-actions { display: flex; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }

/* --- Exchanges grid --- */
.exchanges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.exchange-card {
    display: flex; align-items: center; gap: 16px; background: var(--bg-dark);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
}
.exchange-logo { font-size: 2rem; color: var(--orange); width: 50px; text-align: center; }
.exchange-info { flex: 1; }
.exchange-info h3 { font-size: 1rem; margin-bottom: 2px; }
.exchange-key { font-family: monospace; font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.exchange-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

/* --- Modals --- */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; }
.modal.active { display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); }
.modal-content {
    position: relative; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; width: 90%; max-width: 520px; max-height: 85vh; overflow-y: auto;
    animation: modalIn 0.2s ease;
}
.modal-lg { max-width: 800px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.modal-header h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.modal-body { max-height: 60vh; overflow-y: auto; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* --- Loading --- */
.loading { text-align: center; padding: 32px; color: var(--text-muted); }
.loading i { margin-right: 8px; }

/* --- Filter --- */
.filter-group select {
    background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
    padding: 6px 12px; border-radius: var(--radius-sm); font-size: 0.85rem;
}

/* ===== Ticker Bar ===== */
.ticker-bar {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 20px; margin-bottom: 16px;
}
.ticker-price { display: flex; align-items: baseline; gap: 12px; }
.ticker-value { font-size: 1.6rem; font-weight: 700; }
.ticker-change { font-size: 1rem; font-weight: 600; }
.ticker-stats { display: flex; gap: 24px; }
.ticker-stats > div { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 0.85rem; }

/* ===== Chart Workspace (sidebar + chart) ===== */
.chart-workspace { display: flex; gap: 0; margin-bottom: 20px; }

/* Indicator sidebar - Binance-style toggle list */
.ind-sidebar {
    width: 100px; min-width: 100px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius) 0 0 var(--radius);
    padding: 8px 0; overflow-y: auto; max-height: 700px;
}
.ind-sidebar-title {
    padding: 8px 12px 4px; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); font-weight: 600;
}
.ind-toggle {
    display: flex; align-items: center; gap: 6px; padding: 8px 10px;
    cursor: pointer; font-size: 0.8rem; color: var(--text-muted);
    transition: all var(--transition); border-left: 2px solid transparent;
}
.ind-toggle:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.ind-toggle.active { color: var(--text); border-left-color: var(--primary); background: rgba(59,130,246,0.06); }
.ind-toggle input[type="checkbox"] {
    width: 14px; height: 14px; accent-color: var(--primary); cursor: pointer;
    flex-shrink: 0;
}
.ind-toggle span { flex: 1; font-weight: 600; }
.ind-toggle i { font-size: 0.6rem; color: var(--text-muted); }

/* Chart main area */
.chart-main { flex: 1; min-width: 0; }
.chart-main .panel { border-radius: 0 var(--radius) var(--radius) 0; }

/* Overlay legend bar */
.overlay-legend {
    display: flex; flex-wrap: wrap; gap: 12px; padding: 6px 16px;
    background: rgba(0,0,0,0.2); border-bottom: 1px solid var(--border); min-height: 28px;
}
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 0.7rem; color: var(--text-muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Sub-chart panels */
.sub-chart-panel { margin-top: 8px; }
.sub-chart-panel .panel-header { padding: 8px 16px; }
.sub-chart-panel .panel-header h2 { font-size: 0.85rem; }
.sub-chart-body { width: 100%; }

/* ===== Analytics Grid ===== */
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* Indicator cards grid */
.indicator-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.ind-card {
    background: var(--bg-dark); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px; text-align: center;
}
.ind-name { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; }
.ind-value { font-size: 1rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.ind-label { font-size: 0.65rem; margin-top: 2px; font-weight: 600; }

/* ===== Signals ===== */
.signal-summary {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; border-radius: var(--radius-sm); margin-bottom: 12px;
}
.signal-buy { background: var(--green-bg); border: 1px solid rgba(34,197,94,0.3); }
.signal-sell { background: var(--red-bg); border: 1px solid rgba(239,68,68,0.3); }
.signal-neutral { background: rgba(139,146,163,0.08); border: 1px solid var(--border); }
.signal-verdict { font-size: 1.4rem; font-weight: 800; }
.signal-buy .signal-verdict { color: var(--green); }
.signal-sell .signal-verdict { color: var(--red); }
.signal-neutral .signal-verdict { color: var(--text-muted); }
.signal-counts { font-size: 0.85rem; }
.signal-list { display: flex; flex-direction: column; gap: 4px; }
.signal-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px; background: var(--bg-dark); border-radius: var(--radius-sm);
    font-size: 0.8rem;
}
.signal-strength { font-family: monospace; font-size: 0.7rem; color: var(--text-muted); }

/* ===== Forecast ===== */
.forecast-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px; border-radius: var(--radius-sm); margin-bottom: 16px;
}
.forecast-long { background: var(--green-bg); border: 1px solid rgba(34,197,94,0.3); }
.forecast-short { background: var(--red-bg); border: 1px solid rgba(239,68,68,0.3); }
.forecast-neutral { background: rgba(139,146,163,0.08); border: 1px solid var(--border); }
.forecast-direction { font-size: 1.8rem; font-weight: 800; }
.forecast-long .forecast-direction { color: var(--green); }
.forecast-short .forecast-direction { color: var(--red); }
.forecast-neutral .forecast-direction { color: var(--text-muted); }

.forecast-score { text-align: right; min-width: 200px; }
.score-bar {
    width: 100%; height: 8px; background: var(--bg-dark); border-radius: 4px;
    overflow: hidden; margin-bottom: 6px;
}
.score-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.forecast-score span { font-size: 0.8rem; color: var(--text-muted); }

.forecast-timeframes { margin-bottom: 16px; }
.forecast-timeframes h3 { font-size: 0.95rem; margin-bottom: 12px; color: var(--text-muted); }
.tf-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tf-card {
    background: var(--bg-dark); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px; text-align: center;
}
.tf-name { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; margin-bottom: 6px; }
.tf-direction { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.tf-score { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; }
.tf-details { display: flex; justify-content: center; gap: 12px; font-size: 0.7rem; color: var(--text-muted); }

.forecast-targets { margin-top: 8px; }
.forecast-targets h3 { font-size: 0.95rem; margin-bottom: 12px; }
.targets-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.target-card {
    background: var(--bg-dark); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px; text-align: center;
}
.target-card span { display: block; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; }
.target-card strong { font-size: 1rem; font-family: 'JetBrains Mono', monospace; }
.target-entry { border-color: var(--primary); }
.target-entry strong { color: var(--primary); }
.target-tp { border-color: rgba(34,197,94,0.3); }
.target-tp strong { color: var(--green); }
.target-sl { border-color: rgba(239,68,68,0.3); }
.target-sl strong { color: var(--red); }
.target-wait { text-align: center; padding: 20px; color: var(--text-muted); font-size: 0.9rem; }
.target-wait i { margin-right: 8px; }

/* ===== Market Page ===== */
.market-filters {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.search-box {
    display: flex; align-items: center; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 6px 12px; min-width: 200px;
}
.search-box i { color: var(--text-muted); margin-right: 8px; }
.search-box input {
    background: transparent; border: none; color: var(--text); font-size: 0.85rem;
    outline: none; width: 100%;
}

/* --- Strategies panel --- */
.strategies-consensus { text-align: center; margin-bottom: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.strategies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.strat-card {
    background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px; text-align: center; transition: var(--transition);
}
.strat-card:hover { border-color: var(--primary); }
.strat-card.strat-buy { border-left: 3px solid var(--green); }
.strat-card.strat-sell { border-left: 3px solid var(--red); }
.strat-card.strat-neutral { border-left: 3px solid var(--text-muted); }
.strat-name { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strat-dir { font-weight: 700; font-size: 0.85rem; margin-bottom: 4px; }
.strat-buy .strat-dir { color: var(--green); }
.strat-sell .strat-dir { color: var(--red); }
.strat-neutral .strat-dir { color: var(--text-muted); }
.strat-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 4px; }
.strat-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s ease; }
.strat-score { font-size: 0.7rem; color: var(--text-muted); }

/* --- AI analysis panel --- */
.ai-analysis-content { font-size: 0.9rem; line-height: 1.7; }
.ai-text { white-space: pre-wrap; padding: 12px; background: var(--bg-input); border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 12px; }
.ai-signal-summary { display: flex; gap: 20px; padding: 8px 0; font-size: 0.85rem; }

/* --- Pair recommendation panel (bots) --- */
.pair-recommend-panel { margin-top: 8px; padding: 10px; background: var(--bg-input); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.pair-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pair-chip {
    display: inline-block; padding: 4px 10px; background: var(--bg-card-hover); border: 1px solid var(--border);
    border-radius: 16px; font-size: 0.75rem; cursor: pointer; transition: var(--transition);
}
.pair-chip:hover { border-color: var(--primary); background: rgba(59,130,246,0.1); }
.pair-chip.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.pair-chip-more { font-size: 0.7rem; color: var(--text-muted); padding: 4px 8px; }
.pair-unsuitable-hint { font-size: 0.7rem; color: var(--text-muted); margin-top: 8px; }

/* --- Checkbox label (AI toggle) --- */
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.85rem; }
.checkbox-label input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }

/* --- Market AI signal badges --- */
.badge-green { background: var(--green-bg); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.badge-red { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.market-type-switch { display: flex; gap: 0; }
.market-type-switch .btn { border-radius: 0; }
.market-type-switch .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.market-type-switch .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.quick-filters { display: flex; gap: 4px; }
.quick-filters .btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.badge-xs { font-size: 0.65rem; padding: 1px 6px; vertical-align: middle; background: rgba(59,130,246,0.15); color: var(--primary); border-radius: 4px; }
.loading-state { text-align: center; padding: 40px; color: var(--text-muted); }
.loading-state i { margin-right: 8px; }
.table .clickable { cursor: pointer; }
.table .clickable:hover { background: var(--bg-card-hover); }

/* --- Cron status panel --- */
.cron-status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cron-status-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-input); border-radius: var(--radius-sm); font-size: 0.85rem; }
.cron-job-line { padding: 4px 8px; margin-bottom: 4px; background: var(--bg-input); border-radius: 4px; font-size: 0.8rem; }
.cron-job-line code { color: var(--green); font-family: 'Fira Code', monospace; word-break: break-all; }
.cron-error-line { padding: 4px 8px; margin-bottom: 4px; background: var(--red-bg); border-radius: 4px; font-size: 0.8rem; border-left: 3px solid var(--red); }
.text-orange { color: var(--orange); }

/* --- Responsive --- */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .strategy-grid { grid-template-columns: repeat(3, 1fr); }
    .analytics-grid { grid-template-columns: 1fr; }
    .tf-grid { grid-template-columns: repeat(2, 1fr); }
    .targets-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- Mobile burger button --- */
.mobile-burger {
    display: none; position: fixed; top: 12px; left: 12px; z-index: 201;
    width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text); font-size: 1.2rem;
    cursor: pointer; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.mobile-burger.open i::before { content: "\f00d"; }
.mobile-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 99; backdrop-filter: blur(2px);
}
.mobile-overlay.open { display: block; }

@media (max-width: 768px) {
    /* Burger visible */
    .mobile-burger { display: flex; }

    /* Sidebar: off-canvas drawer */
    .sidebar {
        width: var(--sidebar-w); transform: translateX(-100%);
        transition: transform 0.3s ease; z-index: 200;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-logo span, .sidebar-menu li a span, .sidebar-footer .user-info span { display: inline; }
    .sidebar-logo { padding: 20px 24px; justify-content: flex-start; }
    .sidebar-menu li a { padding: 10px 24px; justify-content: flex-start; }

    /* Content: full width */
    .has-nav .content { margin-left: 0; padding: 60px 12px 16px 12px; }
    .content-full { padding: 16px 12px; }

    /* Page header: stack on mobile */
    .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .page-header h1 { font-size: 1.2rem; flex-wrap: wrap; }
    .header-actions { width: 100%; flex-wrap: wrap; }

    /* Stats grid: 2 columns, compact */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
    .stat-card { padding: 12px; gap: 10px; }
    .stat-icon { width: 36px; height: 36px; font-size: 1rem; border-radius: 8px; }
    .stat-value { font-size: 1.1rem; }
    .stat-label { font-size: 0.7rem; }

    /* Panels: tighter spacing */
    .panel { margin-bottom: 12px; border-radius: var(--radius-sm); }
    .panel-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
    .panel-header h2 { font-size: 0.9rem; }
    .panel-body { padding: 12px 14px; }

    /* Tables: smaller text, scrollable */
    .table th, .table td { padding: 8px 6px; font-size: 0.75rem; }
    .table-responsive { margin: -12px -14px; padding: 0 14px; }

    /* Forms */
    .form-row { grid-template-columns: 1fr; gap: 8px; }
    .form-group { margin-bottom: 12px; }
    .form-group input, .form-group select { padding: 10px 12px; font-size: 1rem; }

    /* Modals: full screen on mobile */
    .modal-content { width: 95%; max-width: none; max-height: 90vh; overflow-y: auto; margin: 5vh auto; }

    /* Bot cards */
    .bot-card { padding: 14px; }
    .bot-actions { flex-wrap: wrap; }

    /* Settings grid */
    .settings-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .setting-item { padding: 8px; font-size: 0.8rem; }

    /* Log feed */
    .log-entry { padding: 8px 10px; }
    .log-meta { font-size: 0.75rem; }
    .log-message { font-size: 0.8rem; }

    /* Strategy grid */
    .strategy-grid { grid-template-columns: 1fr; }

    /* Chart */
    .chart-workspace { flex-direction: column; }
    .ind-sidebar { width: 100%; min-width: auto; flex-direction: row; display: flex; flex-wrap: wrap; border-radius: var(--radius) var(--radius) 0 0; max-height: none; }
    .ind-sidebar-title { width: 100%; }
    .chart-main .panel { border-radius: 0 0 var(--radius) var(--radius); }

    /* Ticker bar */
    .ticker-bar { flex-direction: column; gap: 8px; }
    .ticker-stats { flex-wrap: wrap; gap: 12px; }

    /* Timeframes & targets */
    .tf-grid { grid-template-columns: 1fr; }
    .targets-grid { grid-template-columns: 1fr 1fr; }

    /* Forecast */
    .forecast-header { flex-direction: column; gap: 12px; text-align: center; }
    .forecast-score { text-align: center; min-width: auto; }

    /* Pair chips */
    .pair-chips { gap: 4px; }
    .pair-chip { padding: 3px 8px; font-size: 11px; }

    /* Buttons: bigger touch targets */
    .btn { padding: 10px 14px; font-size: 0.85rem; }
    .btn-sm { padding: 8px 12px; }
    .btn-xs { padding: 6px 10px; font-size: 0.75rem; }

    /* Auto-refresh panel */
    .auto-refresh-panel { bottom: 8px; right: 8px; }
    .auto-refresh-menu { bottom: 44px; }

    /* Cron panel */
    .cron-grid { grid-template-columns: 1fr; }

    /* Error message */
    .error-message { font-size: 0.8rem; }
}

/* Extra small screens (< 400px) */
@media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .targets-grid { grid-template-columns: 1fr; }
    .header-actions { flex-direction: column; }
    .header-actions .btn { width: 100%; justify-content: center; }
}

/* === Pair recommendation panel === */
.pair-recommend-panel {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}
.pair-rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    color: #adb5bd;
}
.pair-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.pair-chip {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(0,200,150,0.1);
    border: 1px solid rgba(0,200,150,0.3);
    border-radius: 12px;
    font-size: 12px;
    color: #00c896;
    cursor: pointer;
    transition: all 0.2s;
}
.pair-chip:hover {
    background: rgba(0,200,150,0.25);
    border-color: #00c896;
}
.pair-chip.selected {
    background: #00c896;
    color: #0a0e17;
    font-weight: 600;
}
.pair-chip-more {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.15);
    color: #adb5bd;
    cursor: default;
}
.pair-unsuitable-hint {
    margin-top: 6px;
    color: #f0ad4e;
    font-size: 12px;
}
/* AI checkbox label in bot form */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #00c896;
}
.badge-success {
    background: rgba(0,200,150,0.15);
    color: #00c896;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

/* --- Toggle Switch --- */
.toggle-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-slider { width: 44px; height: 24px; background: var(--border); border-radius: 12px; position: relative; transition: background 0.3s; }
.toggle-slider::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: white; border-radius: 50%; transition: transform 0.3s; }
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(20px); }
.toggle-label { font-size: 14px; color: var(--text-muted); }

/* --- Form Actions --- */
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
