/* === Command Bar === */
.cmd-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.cmd-bar { width: 480px; max-width: 90vw; background: #1a1a2e; border: 1px solid #2a2a3e; border-radius: 12px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.cmd-bar input { flex: 1; background: transparent; border: none; color: #e8e8f0; font-size: 14px; outline: none; }
.cmd-bar input::placeholder { color: #555; }
.cmd-bar .cmd-slash { color: #4f9cff; font-size: 16px; font-weight: 600; }
.cmd-help { position: fixed; bottom: 20px; right: 20px; background: #1a1a2e; border: 1px solid #2a2a3e; border-radius: 10px; padding: 14px 18px; z-index: 9998; font-size: 12px; color: #888; }
.cmd-help h4 { color: #e8e8f0; font-size: 13px; margin: 0 0 8px; }
.cmd-help table { border-collapse: collapse; }
.cmd-help td { padding: 3px 8px 3px 0; }
.cmd-help td:first-child { color: #4f9cff; font-weight: 600; white-space: nowrap; }

/* === Settings Panel === */
.settings-gear { width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent; color: #888; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; margin-left: 8px; }
.settings-gear:hover { color: #e8e8f0; background: #1a1a2e; }
.settings-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 360px; background: #0f0f18; border-left: 1px solid #1e1e2e; z-index: 9998; overflow-y: auto; padding: 24px; }
.settings-drawer h3 { color: #e8e8f0; font-size: 18px; margin: 0; }
.settings-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.settings-close { background: transparent; border: none; color: #888; font-size: 20px; cursor: pointer; }
.settings-close:hover { color: #e8e8f0; }
.settings-section { margin-bottom: 24px; }
.settings-label { color: #888; font-size: 12px; display: block; margin-bottom: 8px; }
.settings-row { display: flex; gap: 8px; }
.settings-btn { flex: 1; padding: 8px 12px; border-radius: 8px; border: 1px solid #2a2a3e; background: #0a0a0f; color: #888; cursor: pointer; font-size: 13px; }
.settings-btn.active { border: 2px solid #4f9cff; background: rgba(79,156,255,0.1); color: #4f9cff; }
.settings-select { width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid #2a2a3e; background: #0a0a0f; color: #e8e8f0; font-size: 13px; }
.settings-alert-row { display: flex; gap: 8px; margin-bottom: 8px; }
.settings-alert-input { flex: 1; padding: 8px 12px; border-radius: 8px; border: 1px solid #2a2a3e; background: #0a0a0f; color: #e8e8f0; font-size: 12px; }
.settings-alert-list { margin-top: 8px; }
.settings-alert-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #1a1a2e; border-radius: 6px; font-size: 12px; color: #888; }
.settings-alert-item span { flex: 1; }
.settings-alert-remove { background: transparent; border: none; color: #555; cursor: pointer; font-size: 14px; }
.settings-alert-remove:hover { color: #ef4444; }
.settings-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 9997; }

/* === AI Signal Brief === */
.ai-signal-card { margin-bottom: 16px; border: 1px solid rgba(79,156,255,0.3); background: linear-gradient(135deg, #0f0f18 0%, #1a1028 100%); border-radius: 10px; padding: 16px; }
.ai-signal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ai-signal-title { color: #e8e8f0; font-size: 14px; margin: 0; display: flex; align-items: center; gap: 6px; }
.ai-signal-disclaimer { font-size: 10px; color: #555; }
.ai-signal-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.ai-signal-col-title { font-size: 10px; color: #888; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; }
.ai-driver-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ai-driver-symbol { font-size: 11px; color: #e8e8f0; font-weight: 600; }
.ai-driver-move { font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.ai-driver-move.up { background: rgba(34,197,94,0.2); color: #22c55e; }
.ai-driver-move.down { background: rgba(239,68,68,0.2); color: #ef4444; }
.ai-sentiment-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin-top: 3px; }
.ai-sentiment-bar .bull { background: #22c55e; }
.ai-sentiment-bar .neutral { background: #444; }
.ai-sentiment-bar .bear { background: #ef4444; }
.ai-sentiment-labels { display: flex; justify-content: space-between; font-size: 9px; color: #555; margin-top: 2px; }
.ai-watch-item { font-size: 10px; color: #888; margin-bottom: 4px; padding-left: 8px; border-left: 2px solid #4f9cff; }

/* === AI News Filter === */
.news-filter-toggle { font-size: 10px; padding: 4px 10px; border-radius: 12px; cursor: pointer; border: 1px solid #2a2a3e; background: transparent; color: #888; }
.news-filter-toggle.active { border: 1px solid #4f9cff; background: rgba(79,156,255,0.1); color: #4f9cff; }

/* === Watchlist === */
.watchlist-input-row { display: flex; gap: 8px; margin-bottom: 16px; }
.watchlist-input { flex: 1; padding: 10px 14px; border-radius: 8px; border: 1px solid #1e1e2e; background: #0a0a0f; color: #e8e8f0; font-size: 14px; }
.watchlist-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid #1e1e2e; border-radius: 8px; margin-bottom: 8px; background: #0a0a0f; }
.watchlist-item .stock-symbol { font-weight: 600; color: #e8e8f0; font-size: 14px; }
.watchlist-remove { background: transparent; border: none; color: #555; font-size: 16px; cursor: pointer; margin-left: auto; }
.watchlist-remove:hover { color: #ef4444; }

/* === Calendar === */
.event-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #1a1a2e; }
.event-date { color: #4f9cff; font-size: 13px; font-weight: 600; min-width: 60px; }
.event-name { color: #e8e8f0; font-size: 13px; flex: 1; }
.event-type { color: #888; font-size: 11px; padding: 2px 8px; border-radius: 4px; background: #1a1a2e; }

/* === Alerts === */
.alert-form-row { display: grid; grid-template-columns: 80px 1fr 1fr 80px 80px; gap: 8px; margin-bottom: 20px; }
.alert-select, .alert-input { padding: 8px; border-radius: 6px; border: 1px solid #1e1e2e; background: #0a0a0f; color: #e8e8f0; font-size: 13px; }
.alert-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #1e1e2e; border-radius: 8px; margin-bottom: 8px; background: #0a0a0f; }
.alert-info { flex: 1; }
.alert-symbol { font-weight: 600; color: #e8e8f0; font-size: 14px; }
.alert-condition { color: #888; font-size: 13px; margin-left: 10px; }
.alert-toggle { padding: 6px 12px; font-size: 12px; border-radius: 6px; cursor: pointer; }
.alert-toggle.active { background: rgba(79,156,255,0.2); color: #4f9cff; border: 1px solid #4f9cff; }
.alert-toggle.inactive { background: transparent; color: #888; border: 1px solid #2a2a3e; }
.alert-remove { background: transparent; border: none; color: #555; font-size: 16px; cursor: pointer; }
.alert-remove:hover { color: #ef4444; }

/* === Signals === */
.signal-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid #1e1e2e; border-radius: 8px; margin-bottom: 10px; background: #0a0a0f; }
.signal-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex-shrink: 0; }
.signal-icon.buy { background: rgba(34,197,94,0.15); color: #22c55e; }
.signal-icon.sell { background: rgba(239,68,68,0.15); color: #ef4444; }
.signal-icon.hold { background: rgba(255,193,7,0.15); color: #ffc107; }
.signal-icon.watch { background: rgba(136,136,136,0.15); color: #888; }
.signal-info { flex: 1; }
.signal-symbol { color: #e8e8f0; font-weight: 700; font-size: 15px; }
.signal-price { color: #888; font-size: 12px; margin-left: 8px; }
.signal-reason { color: #888; font-size: 12px; margin-top: 4px; line-height: 1.4; }
.signal-confidence { color: #4f9cff; font-size: 11px; margin-top: 4px; }
.signal-badge { padding: 3px 10px; border-radius: 4px; font-size: 10px; font-weight: 600; text-transform: capitalize; }
.signal-badge.buy { background: rgba(34,197,94,0.2); color: #22c55e; }
.signal-badge.sell { background: rgba(239,68,68,0.2); color: #ef4444; }
.signal-badge.hold { background: rgba(255,193,7,0.2); color: #ffc107; }
.signal-badge.watch { background: rgba(136,136,136,0.2); color: #888; }

/* === Bots Page === */
.bots-page { max-width: 900px; margin: 0 auto; padding: 20px 0; }
.bots-page h2 { color: #e8e8f0; font-size: 20px; margin-bottom: 20px; }
.bots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; margin-bottom: 20px; }
.bot-card { background: #0a0a0f; border: 1px solid #1e1e2e; border-radius: 10px; padding: 16px; }
.bot-card.active { border-color: rgba(79,156,255,0.3); }
.bot-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bot-icon { font-size: 20px; }
.bot-name { color: #e8e8f0; font-size: 14px; font-weight: 600; flex: 1; }
.bot-status { font-size: 11px; padding: 3px 10px; border-radius: 10px; }
.bot-status.active { background: rgba(34,197,94,0.2); color: #22c55e; }
.bot-status.idle { background: rgba(136,136,136,0.15); color: #888; }
.bot-status.paused { background: rgba(255,193,7,0.15); color: #ffc107; }
.bot-status.error { background: rgba(239,68,68,0.15); color: #ef4444; }
.bot-meta { color: #888; font-size: 12px; }
.bots-actions { display: flex; gap: 10px; }

/* Search dropdown (#sg / .sgd) */
#sg{position:absolute;top:100%;left:0;right:0;max-height:240px;overflow-y:auto;background:#fff;border:1px solid #ccc;border-radius:0 0 6px 6px;z-index:10000;box-shadow:0 4px 12px rgba(0,0,0,0.15);font-size:13px}
#sg .m{padding:8px 12px;color:#666;font-style:italic}
#sg .sgr{display:flex;align-items:center;padding:8px 12px;cursor:pointer;border-bottom:1px solid #eee}
#sg .sgr:last-child{border-bottom:none}
#sg .sgr:hover{background:#f5f5f5}
#sg .sgt{font-weight:700;min-width:56px}
#sg .sgd2{color:#555;flex:1;padding:0 8px}
#sg .sgp{font-weight:600;text-align:right;white-space:nowrap}
#sg .sgr .up{color:#16a34a}
#sg .sgr .dn{color:#dc2626}

/* Search box (#q) container needs relative positioning for the dropdown */
#sw{position:relative}
