FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
libraries updated
tilakpatel22af44c4876984
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.mdindex d89a4102c..8454740c2 100644--- a/.github/ISSUE_TEMPLATE/bug_report.md+++ b/.github/ISSUE_TEMPLATE/bug_report.md@@ -6,116 +6,20 @@ labels: "type:bug, status:triage"assignees: ""----## Preliminary Checks-<!-- Please confirm you've done the following by checking the boxes -->-- [ ] I have searched existing issues to ensure this bug hasn't been reported before-- [ ] I have tried the latest version of the application-- [ ] I have read the troubleshooting documentation+## What happened?+<!-- Describe the bug and what you expected to happen -->-## Bug Information-### Bug Severity-<!-- Select the severity level -->-- [ ] Low - Minor issue, doesn't affect core functionality-- [ ] Medium - Affects functionality but workaround exists-- [ ] High - Significantly impacts functionality, no workaround-- [ ] Critical - Application crashes or data loss+## How to reproduce?+<!-- Steps to reproduce the issue -->+1.+2.+3.-### Bug Category-<!-- Select the affected area -->-- [ ] User Interface-- [ ] Data Processing-- [ ] Performance-- [ ] Installation/Setup-- [ ] Authentication-- [ ] API/Integration-- [ ] Documentation-- [ ] Other: ___________--## 🐛 Bug Description-<!-- A clear and concise description of what the bug is -->---## 🔄 Steps to Reproduce-<!-- Exact steps to reproduce the behavior -->-1. Go to '...'-2. Click on '...'-3. Scroll down to '...'-4. See error--**Reproduction Rate:**-- [ ] Always (100%)-- [ ] Often (75-99%)-- [ ] Sometimes (25-74%)-- [ ] Rarely (1-24%)-- [ ] Unable to reproduce--## ✅ Expected Behavior-<!-- What you expected to happen -->---## ❌ Actual Behavior-<!-- What actually happened -->---## 📋 Error Messages/Logs-<!-- Any error messages, stack traces, or relevant log output -->-```-Paste any error messages or logs here...-```--**Console Output:**+## Environment+- **OS:**+- **Version:**+- **Error logs (if any):**```-Paste console output here if applicable...-```--## 🖥️ Environment Information-<!-- Information about your environment -->-- **OS:** [e.g. Ubuntu 20.04, macOS 13.0, Windows 11]-- **Python Version:** [e.g. 3.11.0]-- **Fincept Terminal Version:** [e.g. 1.2.3]-- **Docker Version:** [e.g. 20.10.17]-- **Browser (if applicable):** [e.g. Chrome 108.0.5359.71]-- **Terminal/Shell:** [e.g. bash, zsh, PowerShell]--## 📚 Additional Context-<!-- Any other context about the problem -->--**When did this start happening?**---**Does it happen consistently or intermittently?**---**Any recent changes to your setup?**---**Screenshots or screen recordings:**-<!-- Drag and drop files here -->---**Related issues or discussions:**---## 🔄 Workarounds-<!-- Any temporary workarounds you've found -->---## 🧪 Testing-<!-- Would you be willing to test a potential fix? -->-- [ ] Yes, I can test fixes-- [ ] Yes, with guidance-- [ ] Maybe, depending on complexity-- [ ] No, not available for testing--## 📊 Impact Assessment-<!-- How does this bug affect your usage? -->-- [ ] Blocks all functionality-- [ ] Blocks some critical functionality-- [ ] Reduces efficiency-- [ ] Minor inconvenience-- [ ] Cosmetic issue only-------**Thank you for taking the time to report this bug! 🐛**\ No newline at end of file+Paste error messages here+```\ No newline at end of filediff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.mdindex 8c3399d7f..23859169b 100644--- a/.github/ISSUE_TEMPLATE/documentation.md+++ b/.github/ISSUE_TEMPLATE/documentation.md@@ -6,210 +6,13 @@ labels: "type:documentation, status:triage"assignees: ""----## Preliminary Checks-<!-- Please confirm you've done the following by checking the boxes -->-- [ ] I have searched existing documentation issues-- [ ] I have checked multiple documentation sources (README, wiki, etc.)-- [ ] I have looked for community discussions about this topic+## What's the documentation issue?+<!-- Describe what's missing, unclear, or incorrect -->-## Documentation Issue Details-### Documentation Type-<!-- Select the type of documentation issue -->-- [ ] Missing documentation-- [ ] Incorrect/outdated information-- [ ] Unclear/confusing explanation-- [ ] Broken links or references-- [ ] Code examples don't work-- [ ] API documentation issues-- [ ] Installation/setup guide issues-- [ ] Tutorial/guide improvements-- [ ] Other: ___________+## Where is it located?+<!-- File path, page URL, or section name -->-### Documentation Section-<!-- Which section of documentation is affected? -->-- [ ] README-- [ ] Installation Guide-- [ ] Quick Start/Getting Started-- [ ] API Reference-- [ ] Configuration Guide-- [ ] Tutorials/Examples-- [ ] Troubleshooting-- [ ] Contributing Guidelines-- [ ] Code Comments/Docstrings-- [ ] Other: ___________-### Urgency Level-<!-- How urgent is this documentation fix? -->-- [ ] Low - Nice to have improvement-- [ ] Medium - Important for user experience-- [ ] High - Blocking users from using features-- [ ] Critical - Causing widespread confusion/errors--## 📍 Documentation Location-<!-- Where is the documentation issue located? -->--**File/Page:** [e.g., README.md, docs/installation.md]--**Section/Heading:** [e.g., "Installation via Docker"]--**Line numbers:** [if applicable]--**URL:** [if online documentation]--**Direct link to problematic section:**---## 📚 Issue Description-<!-- Describe the documentation problem in detail -->--**What exactly is wrong with the current documentation?**---**What information is missing or unclear?**---**What confusion does this cause?**---## 👥 User Impact-<!-- How does this documentation issue affect users? -->--**Who is affected?**-- [ ] New users-- [ ] Experienced users-- [ ] Developers/Contributors-- [ ] System administrators-- [ ] API consumers-- [ ] All users--**What problems does this cause?**---**How does this impact the user experience?**---**Examples of user confusion or complaints:**---## ✅ Expected Documentation-<!-- What should the documentation say or include? -->--**What information should be added?**---**How should it be explained?**---**What examples would be helpful?**---**Suggested structure/organization:**---## 🔄 Current Workaround-<!-- How are users currently finding this information? -->--**Alternative sources of information:**---**Trial and error process users go through:**---**Community discussions/forums addressing this:**---## 💡 Suggested Improvement-<!-- Your specific suggestions for improving the documentation -->--**Specific text changes:**---**Additional sections to add:**---**Better examples or code snippets:**-```-// Example code here-```--**Improved organization/structure:**---**Visual aids needed:**-- [ ] Diagrams-- [ ] Screenshots-- [ ] Flow charts-- [ ] Code snippets-- [ ] Video tutorials--## 📚 Additional Context-<!-- Any other relevant information -->--**Related documentation that works well:**---**External resources that could be referenced:**---**User feedback received:**---**Screenshots of confusing sections:**-<!-- Drag and drop images here -->--**Standards or best practices to follow:**---## 🤝 Contribution Willingness-<!-- Are you willing to help improve the documentation? -->-- [ ] Yes, I can write/update the documentation-- [ ] Yes, I can review proposed changes-- [ ] I can provide feedback on drafts-- [ ] I can help with proofreading-- [ ] I can help with technical accuracy review-- [ ] No, but I can provide more details if needed--**Contribution timeline:**-- [ ] Available immediately-- [ ] Available within a week-- [ ] Available within a month-- [ ] Available when convenient--## 📝 Content Suggestions-<!-- Draft content or outline for the improvement -->--**Proposed content outline:**-1.-2.-3.--**Draft text (if you have suggestions):**---**Code examples to include:**-```-// Suggested code examples-```--## 🔍 Quality Standards-<!-- How should we ensure the documentation meets quality standards? -->--**Documentation should include:**-- [ ] Clear step-by-step instructions-- [ ] Working code examples-- [ ] Prerequisites clearly stated-- [ ] Expected outcomes described-- [ ] Troubleshooting section-- [ ] Links to related topics-- [ ] Version information--**Target audience considerations:**-- [ ] Beginner-friendly language-- [ ] Technical accuracy for developers-- [ ] Cross-platform compatibility notes-- [ ] Multiple usage scenarios-------**Thank you for helping us improve Fincept Terminal's documentation! 📚**\ No newline at end of file+## What should it say instead?+<!-- Your suggestion for improvement -->diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.mdindex fc0176d09..485efc781 100644--- a/.github/ISSUE_TEMPLATE/feature_request.md+++ b/.github/ISSUE_TEMPLATE/feature_request.md@@ -6,124 +6,13 @@ labels: "type:feature, status:triage"assignees: ""----## Preliminary Checks-<!-- Please confirm you've done the following by checking the boxes -->-- [ ] I have searched existing issues to ensure this feature hasn't been requested before-- [ ] I have checked the project roadmap/documentation-- [ ] I understand this is for requesting new functionality+## What feature would you like?+<!-- Describe the feature you want to see -->-## Feature Information-### Feature Category-<!-- Select the most appropriate category -->-- [ ] UI/UX Enhancement-- [ ] Performance Improvement-- [ ] New Functionality-- [ ] Integration/API-- [ ] Documentation-- [ ] Developer Experience-- [ ] Security-- [ ] Other: ___________+## What problem does this solve?+<!-- Explain the use case and who would benefit -->-### Priority Level-<!-- Select the priority level -->-- [ ] Low - Nice to have-- [ ] Medium - Would improve workflow-- [ ] High - Significantly impacts productivity-- [ ] Critical - Blocking current work-## 🌟 Feature Description-<!-- Provide a clear and detailed description of the feature -->---## 🛠️ Use Case & Problem Statement-<!-- Explain the problem this feature solves and who benefits from it -->--**What problem does this solve?**---**Who will use this feature?**---**How often would it be used?**---**What's the impact of not having this feature?**---## 🎯 Detailed Feature Specification-<!-- Describe exactly how you expect the feature to work -->--**Step-by-step workflow:**-1.-2.-3.--**User interactions:**---**Expected outputs/results:**---**Integration points:**---**Configuration options:**---## ✅ Acceptance Criteria-<!-- Define what "done" looks like for this feature -->-- [ ] User can perform action X-- [ ] System responds with Y-- [ ] Feature works on platforms A, B, C-- [ ] Documentation is updated-- [ ] Tests are included--## 🔄 Alternatives Considered-<!-- What alternative solutions have you considered? -->--**Alternative approach 1:**---**Alternative approach 2:**---**Why the proposed solution is better:**---## 📚 Additional Context & Resources-<!-- Any additional information, links, or resources -->--**Links to relevant documentation:**---**Examples from other projects:**---**Research or articles:**---**Dependencies or constraints:**---**Technical specifications:**---## 🤝 Implementation-<!-- Are you willing to help implement this feature? -->-- [ ] Yes, I can implement this feature-- [ ] Yes, I can help with implementation-- [ ] I can provide guidance/review-- [ ] I can help with testing-- [ ] No, but I can provide feedback--## 🖥️ Environment Information-<!-- Your current environment (if relevant) -->-- **OS:** [e.g. Ubuntu 20.04, macOS 13.0, Windows 11]-- **Python Version:** [e.g. 3.11.0]-- **Fincept Terminal Version:** [e.g. 1.2.3]-- **Docker Version:** [e.g. 20.10.17]-------**Thank you for taking the time to suggest this feature! We appreciate your contribution. 🙏**\ No newline at end of file+## Any alternatives or additional context?+<!-- Optional: alternatives considered, examples, mockups, etc. -->diff --git a/.github/ISSUE_TEMPLATE/improvement.md b/.github/ISSUE_TEMPLATE/improvement.mdindex 343c39675..f1ae801a2 100644--- a/.github/ISSUE_TEMPLATE/improvement.md+++ b/.github/ISSUE_TEMPLATE/improvement.md@@ -6,249 +6,13 @@ labels: "type:enhancement, status:triage"assignees: ""----## Preliminary Checks-<!-- Please confirm you've done the following by checking the boxes -->-- [ ] I have searched existing issues to ensure this improvement hasn't been suggested before-- [ ] I have checked the project roadmap and current development plans-- [ ] I understand this is for improving existing features (not adding new ones)+## What feature needs improvement?+<!-- Identify the existing feature or area -->-## Improvement Details-### Improvement Category-<!-- Select the type of improvement -->-- [ ] User Interface/Experience-- [ ] Performance Enhancement-- [ ] Code Quality/Refactoring-- [ ] Error Handling/Messaging-- [ ] Configuration/Settings-- [ ] Accessibility-- [ ] Developer Experience-- [ ] Testing/Quality Assurance-- [ ] Documentation Enhancement-- [ ] Security Improvement-- [ ] Other: ___________+## How should it be improved?+<!-- Describe your suggested enhancement and why it's better -->-### Impact Scope-<!-- Who would benefit from this improvement? -->-- [ ] End Users-- [ ] Developers/Contributors-- [ ] System Administrators-- [ ] All Users-- [ ] Specific User Group: ___________-### Improvement Priority-<!-- How important is this improvement? -->-- [ ] Low - Minor enhancement, quality of life improvement-- [ ] Medium - Noticeable improvement to user experience-- [ ] High - Significant impact on usability or efficiency-- [ ] Critical - Addresses major pain points or blockers--## ✨ Feature/Area to be Improved-<!-- Clearly identify what existing feature or area needs improvement -->--**Which specific feature, component, or area needs improvement?**---**What version are you currently using?**---**Why does this need improvement?**---## 📋 Current Behavior-<!-- Describe how the feature currently works -->--**Current workflow or process:**-1.-2.-3.--**Current limitations or pain points:**---**What makes it difficult or inefficient?**---**User frustrations with current implementation:**---## 🎯 Proposed Improvement-<!-- Describe your suggested enhancement in detail -->--**How should it work instead?**---**What specific changes would you make?**---**Improved workflow:**-1.-2.-3.--**Key benefits of the improvement:**---## 👤 User Stories-<!-- Describe the improvement from a user's perspective -->--**Primary user story:**-As a [type of user], I want [improvement] so that [benefit/outcome].--**Additional scenarios:**-- As a _____, I want _____ so that _____-- As a _____, I want _____ so that _____--**Example use cases:**---## ✅ Expected Outcomes & Benefits-<!-- What positive impacts would this improvement have? -->--**Improved user experience:**---**Performance gains:**---**Reduced errors/confusion:**---**Time savings:**---**Better accessibility:**---**Easier maintenance:**---**Other benefits:**---## 📊 Success Metrics-<!-- How would you measure the success of this improvement? -->--**Quantifiable metrics:**-- [ ] Reduced time to complete task X by ___%-- [ ] Decreased error rates by ___%-- [ ] Improved user satisfaction scores-- [ ] Better performance benchmarks-- [ ] Reduced support requests by ___%--**Qualitative indicators:**---## 🛠️ Suggested Implementation Approach-<!-- How do you think this improvement could be implemented? -->--**Technical approach or strategy:**---**Potential tools/libraries to use:**---**Step-by-step implementation plan:**-1.-2.-3.--**Considerations for backward compatibility:**---**Required changes to existing code/config:**---## 🔄 Alternatives Considered-<!-- What other approaches did you consider? -->--**Alternative approach 1:**-- Description:-- Pros:-- Cons:--**Alternative approach 2:**-- Description:-- Pros:-- Cons:--**Why your suggested approach is preferred:**---## ⚠️ Potential Challenges/Drawbacks-<!-- What challenges or negative impacts might this improvement have? -->--**Potential issues:**-- [ ] Breaking changes or compatibility issues-- [ ] Performance trade-offs-- [ ] Increased complexity-- [ ] Learning curve for users-- [ ] Implementation difficulty-- [ ] Resource requirements--**Mitigation strategies:**---## 📚 Additional Context & Resources-<!-- Any additional information, examples, or resources -->--**Links to similar implementations in other tools:**---**User feedback or complaints about current behavior:**---**Research or articles supporting the improvement:**---**Screenshots or mockups of proposed changes:**-<!-- Drag and drop images here -->--**Relevant standards or best practices:**---## 🤝 Implementation Contribution-<!-- Are you willing to help implement this improvement? -->-- [ ] Yes, I can implement this improvement myself-- [ ] Yes, I can help with implementation-- [ ] I can provide technical guidance/review-- [ ] I can help with testing and validation-- [ ] I can provide feedback on proposed solutions-- [ ] No, but I can provide detailed requirements--**Technical expertise:**-- [ ] Frontend development-- [ ] Backend development-- [ ] Database design-- [ ] UI/UX design-- [ ] Testing/QA-- [ ] Documentation-- [ ] Other: ___________--## 🖥️ Environment Information-<!-- Your current environment (if relevant to the improvement) -->-- **OS:** [e.g. Ubuntu 20.04, macOS 13.0, Windows 11]-- **Python Version:** [e.g. 3.11.0]-- **Fincept Terminal Version:** [e.g. 1.2.3]-- **Usage Context:** [e.g. local development, production deployment]--## ⏰ Timeline Preference-<!-- When would you like to see this improvement? -->-- [ ] Next patch release (urgent)-- [ ] Next minor release (1-2 months)-- [ ] Next major release (3-6 months)-- [ ] Future release (6+ months)-- [ ] No specific timeline--**Reasoning for timeline:**---## 🔗 Related Issues/Discussions-<!-- Link any related issues or discussions -->-- Related to #-- Mentioned in #-- Discussed in [forum/discussion link]-------**Thank you for helping us improve Fincept Terminal! ✨**\ No newline at end of file+## Any additional context?+<!-- Optional: mockups, examples, alternatives, etc. -->diff --git a/.github/ISSUE_TEMPLATE/performance_issues.md b/.github/ISSUE_TEMPLATE/performance_issues.mdindex 7badc7e52..b2d514301 100644--- a/.github/ISSUE_TEMPLATE/performance_issues.md+++ b/.github/ISSUE_TEMPLATE/performance_issues.md@@ -6,164 +6,19 @@ labels: "type:performance, status:triage"assignees: ""----## Preliminary Checks-<!-- Please confirm you've done the following by checking the boxes -->-- [ ] I have searched existing issues for similar performance problems-- [ ] I have verified this isn't caused by my system/network-- [ ] I have tried with minimal configuration/plugins--## Performance Issue Details--### Performance Issue Type-<!-- Select the type of performance issue -->-- [ ] Slow startup/initialization-- [ ] Slow data processing-- [ ] High memory usage-- [ ] High CPU usage-- [ ] Slow UI responsiveness-- [ ] Network/API delays-- [ ] Database query performance-- [ ] Memory leaks-- [ ] Other: ___________--### Impact Severity-<!-- How much does this impact your usage? -->-- [ ] Low - Slightly noticeable, doesn't affect workflow-- [ ] Medium - Noticeable delays, minor workflow impact-- [ ] High - Significant delays, major workflow impact-- [ ] Critical - Unusable, blocks all work--## ⚡ Performance Issue Description-<!-- Describe the performance problem in detail -->--**What specific operation or feature is slow?**---**How long does it take vs. how long should it take?**---## 📊 Performance Metrics-<!-- Provide specific performance measurements -->--| Metric | Current Performance | Expected Performance | Difference |-|--------|-------------------|---------------------|------------|-| **Operation Time** | ___ seconds/minutes | ___ seconds/minutes | ___% slower |-| **Memory Usage** | ___ MB/GB | ___ MB/GB | ___% higher |-| **CPU Usage** | ___% | ___% | ___% higher |-| **Data Size** | ___ records/MB | ___ records/MB | - |--**Frequency:** How often does this happen?-- [ ] Every time-- [ ] Most of the time (75-99%)-- [ ] Sometimes (25-74%)-- [ ] Rarely (1-24%)--## 🔄 Steps to Reproduce-<!-- Exact steps to reproduce the performance issue -->-1. Load dataset of size X-2. Perform operation Y-3. Observe slow performance-4. Measure timing/resource usage--## 🔍 Profiling Information-<!-- Any profiling data, benchmarks, or performance logs -->--**Tools used for measurement:**-- [ ] Built-in timing-- [ ] cProfile-- [ ] memory_profiler-- [ ] htop/top-- [ ] Browser DevTools-- [ ] Other: ___________--**Profiling Data:**-```-Paste profiling output, performance logs, or benchmark results here-```--**Screenshots of system monitors:**-<!-- Drag and drop images here -->--## 🖥️ Environment Information-<!-- Detailed system information -->--**System Specifications:**-- **OS:** [e.g. Ubuntu 20.04]-- **CPU:** [e.g. Intel i7-9700K, 8 cores]-- **RAM:** [e.g. 16GB]-- **Storage:** [e.g. SSD, HDD]-- **Python Version:** [e.g. 3.11.0]-- **Fincept Terminal Version:** [e.g. 1.2.3]--**Configuration:**-- **Docker:** [ ] Yes [ ] No (Version: _______)-- **Data source:** [e.g. local files, remote API, database]-- **Dataset size:** [e.g. 10k rows, 100MB file]-- **Concurrent users:** [e.g. 1, 10, 100]--## 📈 Performance Comparison-<!-- How does performance compare in different scenarios? -->--**Different data sizes:**-- Small dataset (___): ___-- Medium dataset (___): ___-- Large dataset (___): ___--**Different environments:**-- Local: ___-- Docker: ___-- Cloud: ___--**Previous versions:**-- Version X.X.X: ___-- Current version: ___--**Similar tools comparison:**-- Tool Y: ___-- Tool Z: ___--## 📚 Additional Context-<!-- Any other relevant information -->--**When did you first notice this performance issue?**---**Has performance degraded over time?**---**Any recent changes that might have caused this?**---**Network conditions (if relevant):**---**Other applications running:**---## 🛠️ Potential Solutions-<!-- Any ideas for improving performance -->--**Suggestions:**-- [ ] Caching improvements-- [ ] Algorithm optimization-- [ ] Database indexing-- [ ] Parallel processing-- [ ] Memory optimization-- [ ] Other: ___________--## 🧪 Testing Availability-<!-- Can you help test performance improvements? -->-- [ ] Yes, I can run benchmarks and provide feedback-- [ ] Yes, but need guidance on testing-- [ ] Limited availability for testing-- [ ] No, not available for testing--**Testing commitment:**-- [ ] Can test within 24 hours-- [ ] Can test within a week-- [ ] Can test when convenient-- [ ] Cannot commit to testing timeline-------**Thank you for helping us improve Fincept Terminal's performance! ⚡**\ No newline at end of file+## What's slow?+<!-- Describe the performance issue and when it occurs -->+++## How to reproduce?+<!-- Steps to reproduce the slowness -->+1.+2.+3.++## Environment & measurements+- **OS:**+- **Version:**+- **Dataset/Operation size:**+- **Time taken:**+- **Expected time:**\ No newline at end of filediff --git a/fincept-terminal-desktop/src-tauri/examples/test_kraken_ws.rs b/fincept-terminal-desktop/src-tauri/examples/test_kraken_ws.rsdeleted file mode 100644index f8993c59b..000000000--- a/fincept-terminal-desktop/src-tauri/examples/test_kraken_ws.rs+++ /dev/null@@ -1,96 +0,0 @@-// Standalone test for Kraken WebSocket connection-// Run with: cargo run --example test_kraken_ws--use tokio_tungstenite::{connect_async, tungstenite::Message};-use futures_util::StreamExt;--const KRAKEN_WS_URL: &str = "wss://ws.kraken.com/v2";--#[tokio::main]-async fn main() -> Result<(), Box<dyn std::error::Error>> {- println!("===========================================");- println!("Testing Kraken WebSocket Connection");- println!("===========================================");-- println!("\n[1] Connecting to: {}", KRAKEN_WS_URL);-- let (ws_stream, response) = connect_async(KRAKEN_WS_URL).await?;-- println!("✓ Connected successfully!");- println!(" Status: {}", response.status());- println!(" Headers: {:?}", response.headers());-- let (mut write, mut read) = ws_stream.split();-- println!("\n[2] Subscribing to BTC/USD ticker...");-- let subscribe_msg = serde_json::json!({- "method": "subscribe",- "params": {- "channel": "ticker",- "symbol": ["BTC/USD"]- }- });-- let msg_str = serde_json::to_string(&subscribe_msg)?;- println!(" Sending: {}", msg_str);-- use futures_util::SinkExt;- write.send(Message::Text(msg_str)).await?;-- println!("✓ Subscription message sent!");-- println!("\n[3] Waiting for messages (10 seconds)...");- println!(" Press Ctrl+C to stop\n");-- let mut count = 0;- let timeout = tokio::time::sleep(tokio::time::Duration::from_secs(10));- tokio::pin!(timeout);-- loop {- tokio::select! {- _ = &mut timeout => {- println!("\n⏱ 10 seconds elapsed, stopping...");- break;- }- msg = read.next() => {- match msg {- Some(Ok(Message::Text(text))) => {- count += 1;- println!("\n📨 Message {}: {}", count, &text[..text.len().min(200)]);-- // Try to parse and show key info- if let Ok(json) = serde_json::from_str::<serde_json::Value>(&text) {- if let Some(channel) = json.get("channel") {- println!(" Channel: {}", channel);- }- if let Some(data) = json.get("data") {- println!(" Data: {}", serde_json::to_string_pretty(data)?);- }- }- }- Some(Ok(Message::Close(frame))) => {- println!("\n❌ Connection closed: {:?}", frame);- break;- }- Some(Err(e)) => {- println!("\n❌ Error: {}", e);- break;- }- None => {- println!("\n❌ Stream ended");- break;- }- _ => {}- }- }- }- }-- println!("\n===========================================");- println!("Test Complete!");- println!("Messages received: {}", count);- println!("===========================================");-- Ok(())-}diff --git a/fincept-terminal-desktop/src-tauri/installer-hooks.nsh b/fincept-terminal-desktop/src-tauri/installer-hooks.nshnew file mode 100644index 000000000..d2e7baadb--- /dev/null+++ b/fincept-terminal-desktop/src-tauri/installer-hooks.nsh@@ -0,0 +1,45 @@+; Fincept Terminal - NSIS Installer Hooks+; Custom cleanup during uninstallation++!macro NSIS_HOOK_PREINSTALL+ ; Hook executed before installation starts+ ; Add any pre-installation logic here if needed+!macroend++!macro NSIS_HOOK_POSTINSTALL+ ; Hook executed after installation completes+ ; Add any post-installation logic here if needed+!macroend++!macro NSIS_HOOK_PREUNINSTALL+ ; Hook executed before uninstallation starts+ ; This is where we clean up application data++ ; Remove AppData directory (user-specific data)+ RMDir /r "$APPDATA\com.fincept.terminal"++ ; Remove LocalAppData directory (cache, logs, databases)+ RMDir /r "$LOCALAPPDATA\com.fincept.terminal"++ ; Remove any configuration files+ Delete "$APPDATA\fincept-terminal.config"++ ; Clean up any temp files+ RMDir /r "$TEMP\fincept-terminal"++!macroend++!macro NSIS_HOOK_POSTUNINSTALL+ ; Hook executed after uninstallation completes+ ; Final cleanup after files are removed++ ; Remove any leftover registry keys (if any were created)+ DeleteRegKey HKCU "Software\Fincept Corporation\FinceptTerminal"++ ; Remove from Add/Remove Programs if any artifacts remain+ DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\FinceptTerminal"++ ; Show cleanup confirmation message+ MessageBox MB_OK "Fincept Terminal has been completely removed from your system.$\n$\nAll application data, settings, and cache files have been deleted."++!macroenddiff --git a/fincept-terminal-desktop/src-tauri/resources/requirements-numpy1.txt b/fincept-terminal-desktop/src-tauri/resources/requirements-numpy1.txtindex 3f2d6fc19..c5e91ad9d 100644--- a/fincept-terminal-desktop/src-tauri/resources/requirements-numpy1.txt+++ b/fincept-terminal-desktop/src-tauri/resources/requirements-numpy1.txt@@ -1,127 +1,26 @@-# NumPy 1.x Environment - Legacy Finance Libraries-# For libraries that don't support NumPy 2.x yet+# NumPy 1.x Environment - ONLY Libraries That REQUIRE NumPy 1.x+# These libraries are incompatible with NumPy 2.x# Core dependenciesnumpy>=1.26.4,<2.0pandas>=2.0.0,<2.3.0-# Data fetching-aiohappyeyeballs==2.6.1-aiohttp==3.13.2-aiosignal==1.4.0-attrs==25.4.0-beautifulsoup4==4.14.2-certifi==2025.11.12-cffi==2.0.0-charset-normalizer==3.4.4-curl_cffi==0.13.0-databento==0.66.0-databento-dbn==0.44.0-dnspython==2.8.0-feedparser==6.0.12-frozendict==2.4.7-frozenlist==1.8.0-gnews==0.4.2-idna==3.11-multidict==6.7.0-multitasking==0.0.12-pip_system_certs==5.3-platformdirs==4.5.0-propcache==0.4.1-protobuf>=3.20.2,<6.0.0-pyarrow==22.0.0-pycparser==2.23-python-dateutil==2.9.0.post0-pytz==2025.2-requests==2.32.5-sgmllib3k==1.0.0-six==1.17.0-soupsieve==2.8-typing_extensions==4.15.0-tzdata==2025.2-urllib3==2.5.0-websockets==15.0.1-yarl==1.22.0-yfinance==0.2.66-zstandard==0.25.0-# Backtesting and trading (NumPy 1.x dependent)vectorbt==0.28.2backtesting==0.6.5-# Time series and forecasting+# Time series and forecasting (NumPy 1.x dependent)gluonts[torch]==0.16.2-statsmodels==0.14.6-pmdarima==2.1.1functime==0.1.10-tsmoothie==1.0.5--# Technical analysis-ta==0.11.0-talipp==2.7.0-# Financial modeling-py_vollib==1.0.1-pypme==0.6.2-# Use specific llvmlite/numba versions with pre-built wheels for macOS+# Financial modeling (requires old numba - incompatible with NumPy 2.x)llvmlite==0.43.0numba==0.60.0financepy==1.0.1-ffn==1.1.2-fortitudo.tech==1.2-rateslib==2.1.1-# Portfolio optimization+# Portfolio optimization (requires plotly<6.0.0)PyPortfolioOpt==1.5.6-finquant-enhanced-cvxpy>=1.0.0-cvxopt==1.3.2--# Visualization-matplotlib>=3.8.0,<3.10.0plotly>=5.18.0,<6.0.0-seaborn>=0.12.0-jinja2==3.1.3-weasyprint==62.3--# ML libraries (NumPy 1.x compatible)-scikit-learn>=1.3.0,<1.6.0-scipy>=1.10.0,<1.15.0-lightgbm>=4.0.0,<5.0.0-xgboost>=2.0.0,<2.2.0-catboost>=1.2.0,<1.3.0-# Qlib and RD-Agent-pyqlib==0.9.7-rdagent==0.8.0-mlflow>=2.0.0-dill>=0.3.0-fire>=0.4.0-gym>=0.26.0-jupyter>=1.0.0-loguru>=0.6.0-nbconvert>=7.0.0-pydantic-settings>=2.0.0-python-redis-lock>=4.0.0-# Use ruamel.yaml version with pre-built wheels (avoid C extension build issues)-ruamel.yaml>=0.17.38,<0.18.0-nbformat>=5.0.0-pandarallel>=1.6.0-rich>=13.0.0-selenium>=4.0.0-setuptools-scm>=8.0.0-streamlit>=1.47-tiktoken>=0.5.0-typer>=0.9.0-tables>=3.8.0--# LLM/AI-langchain>=0.1.0-langchain-community>=0.0.1-litellm>=1.73--# Database-peewee>=3.17.0,<3.18.0--# Quant finance-gs-quant==1.4.67+# Visualization (for PyPortfolioOpt compatibility)+matplotlib>=3.8.0,<3.10.0diff --git a/fincept-terminal-desktop/src-tauri/resources/requirements-numpy2.txt b/fincept-terminal-desktop/src-tauri/resources/requirements-numpy2.txtindex 74e7bd7f7..c1824a1aa 100644--- a/fincept-terminal-desktop/src-tauri/resources/requirements-numpy2.txt+++ b/fincept-terminal-desktop/src-tauri/resources/requirements-numpy2.txt@@ -1,5 +1,5 @@-# NumPy 2.x Environment - Modern Libraries-# For libraries that require or support NumPy 2.x+# NumPy 2.x Environment - Modern Libraries (DEFAULT - USE THIS)+# All libraries compatible with NumPy 2.x# Core dependenciesnumpy>=2.2.3,<3.0@@ -19,6 +19,33 @@ databento==0.66.0databento-dbn==0.44.0feedparser==6.0.12gnews==0.4.2+aiohappyeyeballs==2.6.1+aiosignal==1.4.0+attrs==25.4.0+certifi==2025.11.12+cffi==2.0.0+charset-normalizer==3.4.4+curl_cffi==0.13.0+dnspython==2.8.0+frozendict==2.4.7+frozenlist==1.8.0+idna==3.11+multidict==6.7.0+multitasking==0.0.12+pip_system_certs==5.3+platformdirs==4.5.0+propcache==0.4.1+pycparser==2.23+python-dateutil==2.9.0.post0+pytz==2025.2+sgmllib3k==1.0.0+six==1.17.0+soupsieve==2.8+typing_extensions==4.15.0+tzdata==2025.2+urllib3==2.5.0+yarl==1.22.0+zstandard==0.25.0# SEC EDGAR dataedgartools>=5.6.0@@ -45,13 +72,13 @@ catboost>=1.2.0,<1.3.0# Time series and forecasting (NumPy 2.x compatible)statsmodels>=0.14.2pmdarima>=2.1.1+tsmoothie==1.0.5# Technical analysista==0.11.0talipp==2.7.0# Portfolio optimization-# Note: PyPortfolioOpt moved to NumPy 1.x due to plotly<6.0.0 requirementfinquant-enhancedcvxpy>=1.0.0cvxopt==1.3.2@@ -59,7 +86,6 @@ cvxopt==1.3.2# Financial modelingpy_vollib==1.0.1pypme==0.6.2-# financepy moved to NumPy 1.x (requires old numba incompatible with Python 3.12)ffn==1.1.2fortitudo.tech==1.2rateslib==2.1.1@@ -69,9 +95,6 @@ pyqlib==0.9.7rdagent==0.8.0gs-quant==1.4.67-# Time series (additional)-tsmoothie==1.0.5-# Visualizationplotly>=6.0.0matplotlib>=3.9.3,<4.0@@ -92,47 +115,17 @@ loguru>=0.6.0pydantic-settings>=2.0.0fire>=0.4.0dill>=0.3.0-# Use ruamel.yaml version with pre-built wheels (avoid C extension build issues)ruamel.yaml>=0.17.38,<0.18.0python-redis-lock>=4.0.0setuptools-scm>=8.0.0tables>=3.8.0selenium>=4.0.0pyarrow>=16.0.0+pandarallel>=1.6.0+gym>=0.26.0# Databasepeewee>=3.17.0,<3.18.0# MLflowmlflow>=2.0.0--# Additional data utilities-aiohappyeyeballs==2.6.1-aiosignal==1.4.0-attrs==25.4.0-certifi==2025.11.12-cffi==2.0.0-charset-normalizer==3.4.4-curl_cffi==0.13.0-dnspython==2.8.0-frozendict==2.4.7-frozenlist==1.8.0-idna==3.11-multidict==6.7.0-multitasking==0.0.12-pip_system_certs==5.3-platformdirs==4.5.0-propcache==0.4.1-pycparser==2.23-python-dateutil==2.9.0.post0-pytz==2025.2-sgmllib3k==1.0.0-six==1.17.0-soupsieve==2.8-typing_extensions==4.15.0-tzdata==2025.2-urllib3==2.5.0-yarl==1.22.0-zstandard==0.25.0-pandarallel>=1.6.0-gym>=0.26.0diff --git a/fincept-terminal-desktop/src-tauri/tauri.conf.json b/fincept-terminal-desktop/src-tauri/tauri.conf.jsonindex 699de419d..e8f4804d0 100644--- a/fincept-terminal-desktop/src-tauri/tauri.conf.json+++ b/fincept-terminal-desktop/src-tauri/tauri.conf.json@@ -61,7 +61,8 @@"nsis": {"installerIcon": "icons/icon.ico","installMode": "currentUser",- "compression": "lzma"+ "compression": "lzma",+ "installerHooks": "./installer-hooks.nsh"}}},diff --git a/fincept-terminal-desktop/src/components/auth/RegisterScreen.tsx b/fincept-terminal-desktop/src/components/auth/RegisterScreen.tsxindex fec68c529..90b89b840 100644--- a/fincept-terminal-desktop/src/components/auth/RegisterScreen.tsx+++ b/fincept-terminal-desktop/src/components/auth/RegisterScreen.tsx@@ -45,6 +45,25 @@ const RegisterScreen: React.FC<RegisterScreenProps> = ({ onNavigate }) => {hasSpecialChar: false});+ // Username validation state+ const [usernameValidation, setUsernameValidation] = useState({+ isValid: false,+ length: 0,+ message: ''+ });++ // Email validation state+ const [emailValidation, setEmailValidation] = useState({+ isValid: false,+ message: ''+ });++ // Phone validation state+ const [phoneValidation, setPhoneValidation] = useState({+ isValid: false,+ message: ''+ });+// Handle navigation after successful authenticationuseEffect(() => {if (session?.authenticated && session?.user_type === 'registered' && isVerificationComplete) {@@ -75,11 +94,83 @@ const RegisterScreen: React.FC<RegisterScreenProps> = ({ onNavigate }) => {hasSpecialChar: /[!@#$%^&*(),.?":{}|<>]/.test(value)});}++ // Real-time email validation+ if (field === 'email') {+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;+ const isValid = emailRegex.test(value);+ setEmailValidation({+ isValid: isValid || value === '',+ message: value && !isValid ? 'Invalid email format' : ''+ });+ }++ // Real-time username validation (firstName or lastName changes)+ if (field === 'firstName' || field === 'lastName') {+ const updatedFormData = { ...formData, [field]: value };+ const username = `${updatedFormData.firstName.trim()}${updatedFormData.lastName.trim()}`.toLowerCase();+ const length = username.length;++ if (updatedFormData.firstName || updatedFormData.lastName) {+ if (length < 3) {+ setUsernameValidation({+ isValid: false,+ length,+ message: `Username too short (${length}/3 min)`+ });+ } else if (length > 50) {+ setUsernameValidation({+ isValid: false,+ length,+ message: `Username too long (${length}/50 max)`+ });+ } else {+ setUsernameValidation({+ isValid: true,+ length,+ message: `Username valid (${length} characters)`+ });+ }+ } else {+ setUsernameValidation({+ isValid: false,+ length: 0,+ message: ''+ });+ }+ }};const handlePhoneChange = (value: string | undefined) => {setPhoneNumber(value);if (error) setError("");++ // Real-time phone validation+ if (value) {+ // Basic validation - check if it has enough digits (minimum 7)+ const digitsOnly = value.replace(/\D/g, '');+ if (digitsOnly.length < 7) {+ setPhoneValidation({+ isValid: false,+ message: 'Phone number too short'+ });+ } else if (digitsOnly.length > 15) {+ setPhoneValidation({+ isValid: false,+ message: 'Phone number too long'+ });+ } else {+ setPhoneValidation({+ isValid: true,+ message: 'Valid phone number'+ });+ }+ } else {+ setPhoneValidation({+ isValid: false,+ message: 'Phone number required'+ });+ }};const handleRegister = async (e: React.FormEvent) => {@@ -90,6 +181,11 @@ const RegisterScreen: React.FC<RegisterScreenProps> = ({ onNavigate }) => {return;}+ if (!phoneNumber) {+ setError('Phone number is required');+ return;+ }+if (formData.password !== formData.confirmPassword) {setError(t('register.errors.passwordMismatch'));return;@@ -110,6 +206,13 @@ const RegisterScreen: React.FC<RegisterScreenProps> = ({ onNavigate }) => {const username = `${formData.firstName.trim()}${formData.lastName.trim()}`.toLowerCase();console.log('Generated username:', username);+ // Validate username length (3-50 characters as per API requirement)+ if (username.length < 3 || username.length > 50) {+ setError('Username must be between 3 and 50 characters. Please use shorter first/last names.');+ setIsLoading(false);+ return;+ }+// Parse phone number if providedlet phone = '';let country = '';@@ -277,9 +380,12 @@ const RegisterScreen: React.FC<RegisterScreenProps> = ({ onNavigate }) => {placeholder={t('register.firstNamePlaceholder')}value={formData.firstName}onChange={(e) => handleChange("firstName", e.target.value)}- className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pl-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ className={`bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pl-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500 ${+ formData.firstName && formData.firstName.length < 1 ? 'border-red-500' : ''+ }`}disabled={isLoading}required+ minLength={1}/></div></div>@@ -294,13 +400,26 @@ const RegisterScreen: React.FC<RegisterScreenProps> = ({ onNavigate }) => {placeholder={t('register.lastNamePlaceholder')}value={formData.lastName}onChange={(e) => handleChange("lastName", e.target.value)}- className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ className={`bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500 ${+ formData.lastName && formData.lastName.length < 1 ? 'border-red-500' : ''+ }`}disabled={isLoading}required+ minLength={1}/></div></div>+ {/* Username validation feedback */}+ {(formData.firstName || formData.lastName) && usernameValidation.message && (+ <div className={`flex items-center gap-1.5 text-xs ${+ usernameValidation.isValid ? 'text-green-400' : 'text-amber-400'+ }`}>+ {usernameValidation.isValid ? <Check className="h-3 w-3" /> : <X className="h-3 w-3" />}+ <span>{usernameValidation.message}</span>+ </div>+ )}+<div className="space-y-1"><Label htmlFor="email" className="text-white text-xs">{t('register.emailLabel')}@@ -313,16 +432,24 @@ const RegisterScreen: React.FC<RegisterScreenProps> = ({ onNavigate }) => {placeholder={t('register.emailPlaceholder')}value={formData.email}onChange={(e) => handleChange("email", e.target.value)}- className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pl-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ className={`bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pl-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500 ${+ emailValidation.message ? 'border-red-500' : ''+ }`}disabled={isLoading}required/></div>+ {emailValidation.message && (+ <div className="flex items-center gap-1.5 text-red-400 text-xs">+ <X className="h-3 w-3" />+ <span>{emailValidation.message}</span>+ </div>+ )}</div><div className="space-y-1"><Label htmlFor="phone" className="text-white text-xs">- {t('register.phoneLabel')} <span className="text-zinc-500">(Optional)</span>+ {t('register.phoneLabel')}</Label><PhoneInputinternational@@ -331,7 +458,8 @@ const RegisterScreen: React.FC<RegisterScreenProps> = ({ onNavigate }) => {onChange={handlePhoneChange}disabled={isLoading}placeholder={t('register.phonePlaceholder')}- className="phone-input-custom"+ className={`phone-input-custom ${!phoneValidation.isValid && phoneNumber ? 'phone-input-error' : ''}`}+ requiredstyle={{'--PhoneInput-color--focus': '#71717a','--PhoneInputInternationalIconPhone-opacity': '0.8',@@ -352,6 +480,14 @@ const RegisterScreen: React.FC<RegisterScreenProps> = ({ onNavigate }) => {'--PhoneInputCountryFlag-backgroundColor--loading': 'rgba(0,0,0,0.1)'} as any}/>+ {phoneValidation.message && (+ <div className={`flex items-center gap-1.5 text-xs ${+ phoneValidation.isValid ? 'text-green-400' : 'text-amber-400'+ }`}>+ {phoneValidation.isValid ? <Check className="h-3 w-3" /> : <X className="h-3 w-3" />}+ <span>{phoneValidation.message}</span>+ </div>+ )}</div><div className="space-y-1">diff --git a/fincept-terminal-desktop/src/components/auth/phone-input.css b/fincept-terminal-desktop/src/components/auth/phone-input.cssindex 57422e9f6..3d16e1079 100644--- a/fincept-terminal-desktop/src/components/auth/phone-input.css+++ b/fincept-terminal-desktop/src/components/auth/phone-input.css@@ -103,3 +103,12 @@.PhoneInputCountrySelect option:focus {background-color: #3f3f46; /* hover:bg-zinc-700 */}++/* Error state */+.phone-input-error .PhoneInputInput {+ border-color: #ef4444 !important; /* border-red-500 */+}++.phone-input-error .PhoneInputCountry {+ border-color: #ef4444 !important; /* border-red-500 */+}diff --git a/fincept-terminal-desktop/src/components/tabs/EquityResearchTab.tsx b/fincept-terminal-desktop/src/components/tabs/EquityResearchTab.tsxindex a113659fd..c41e1b910 100644--- a/fincept-terminal-desktop/src/components/tabs/EquityResearchTab.tsx+++ b/fincept-terminal-desktop/src/components/tabs/EquityResearchTab.tsx@@ -8,21 +8,27 @@ import { FinancialAnalysisPanel } from './equity-research/components/FinancialAnimport { PeerComparisonPanel } from './equity-research/components/PeerComparisonPanel';import { TabFooter } from '@/components/common/TabFooter';import { useTranslation } from 'react-i18next';+import { Search, TrendingUp, BarChart3, FileText, Users, Newspaper, RefreshCw, AlertCircle } from 'lucide-react';++// Import Bloomberg styles+import { BLOOMBERG, TYPOGRAPHY, SPACING, BORDERS, LAYOUT, EFFECTS, COMMON_STYLES } from './portfolio-tab/bloombergStyles';const COLORS = {- ORANGE: '#FFA500',- WHITE: '#FFFFFF',- RED: '#ef4444',- GREEN: '#10b981',- YELLOW: '#fbbf24',- GRAY: '#787878',- BLUE: '#3b82f6',- CYAN: '#06b6d4',- DARK_BG: '#0a0a0a',- PANEL_BG: '#1a1a1a',- BORDER: '#333333',+ ORANGE: BLOOMBERG.ORANGE,+ WHITE: BLOOMBERG.WHITE,+ RED: BLOOMBERG.RED,+ GREEN: BLOOMBERG.GREEN,+ YELLOW: BLOOMBERG.YELLOW,+ GRAY: BLOOMBERG.GRAY,+ BLUE: BLOOMBERG.BLUE,+ CYAN: BLOOMBERG.CYAN,+ DARK_BG: BLOOMBERG.DARK_BG,+ PANEL_BG: BLOOMBERG.PANEL_BG,+ BORDER: BLOOMBERG.BORDER,MAGENTA: '#FF00FF',- PURPLE: '#9D4EDD',+ PURPLE: BLOOMBERG.PURPLE,+ HEADER_BG: BLOOMBERG.HEADER_BG,+ HOVER: BLOOMBERG.HOVER,};interface StockInfo {@@ -1098,17 +1104,29 @@ const EquityResearchTab: React.FC = () => {// Update financial charts when data or metrics changeuseEffect(() => {if (activeTab === 'financials' && financials) {- // Cleanup existing charts+ // Cleanup existing charts with safety checkif (financialChart1InstanceRef.current) {- financialChart1InstanceRef.current.remove();+ try {+ financialChart1InstanceRef.current.remove();+ } catch (e) {+ // Chart already disposed, ignore error+ }financialChart1InstanceRef.current = null;}if (financialChart2InstanceRef.current) {- financialChart2InstanceRef.current.remove();+ try {+ financialChart2InstanceRef.current.remove();+ } catch (e) {+ // Chart already disposed, ignore error+ }financialChart2InstanceRef.current = null;}if (financialChart3InstanceRef.current) {- financialChart3InstanceRef.current.remove();+ try {+ financialChart3InstanceRef.current.remove();+ } catch (e) {+ // Chart already disposed, ignore error+ }financialChart3InstanceRef.current = null;}@@ -1155,9 +1173,31 @@ const EquityResearchTab: React.FC = () => {window.addEventListener('resize', handleResize);return () => {window.removeEventListener('resize', handleResize);- if (financialChart1InstanceRef.current) financialChart1InstanceRef.current.remove();- if (financialChart2InstanceRef.current) financialChart2InstanceRef.current.remove();- if (financialChart3InstanceRef.current) financialChart3InstanceRef.current.remove();+ // Safe cleanup with try-catch to prevent disposal errors+ if (financialChart1InstanceRef.current) {+ try {+ financialChart1InstanceRef.current.remove();+ } catch (e) {+ // Chart already disposed, ignore error+ }+ financialChart1InstanceRef.current = null;+ }+ if (financialChart2InstanceRef.current) {+ try {+ financialChart2InstanceRef.current.remove();+ } catch (e) {+ // Chart already disposed, ignore error+ }+ financialChart2InstanceRef.current = null;+ }+ if (financialChart3InstanceRef.current) {+ try {+ financialChart3InstanceRef.current.remove();+ } catch (e) {+ // Chart already disposed, ignore error+ }+ financialChart3InstanceRef.current = null;+ }};}}, [financials, activeTab, chart1Metrics, chart2Metrics, chart3Metrics]);@@ -1302,167 +1342,315 @@ const EquityResearchTab: React.FC = () => {return (<div style={{- height: '100%',- width: '100%',- backgroundColor: COLORS.DARK_BG,- color: COLORS.WHITE,- fontFamily: 'Consolas, monospace',- display: 'flex',- flexDirection: 'column',- fontSize: '11px',- overflow: 'hidden',+ ...COMMON_STYLES.container,+ fontFamily: TYPOGRAPHY.MONO,}}>- {/* Header */}+ {/* Bloomberg-Style Header */}<div style={{- backgroundColor: COLORS.PANEL_BG,- borderBottom: `1px solid ${COLORS.BORDER}`,- padding: '6px 12px',- flexShrink: 0,+ ...COMMON_STYLES.header,+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ flexWrap: 'wrap',+ gap: SPACING.MEDIUM,}}>- <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>- <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>- <span style={{ color: COLORS.ORANGE, fontWeight: 'bold', fontSize: '13px' }}>{t('title')} TERMINAL</span>- <span style={{ color: COLORS.GRAY }}>|</span>- <div style={{ display: 'flex', alignItems: 'center', gap: '4px' }}>+ {/* Left Section */}+ <div style={{ display: 'flex', alignItems: 'center', gap: SPACING.LARGE, flex: 1 }}>+ {/* Title with Icon */}+ <div style={{ display: 'flex', alignItems: 'center', gap: SPACING.SMALL }}>+ <TrendingUp size={16} color={COLORS.ORANGE} />+ <span style={{+ color: COLORS.ORANGE,+ fontWeight: TYPOGRAPHY.BOLD,+ fontSize: TYPOGRAPHY.SUBHEADING,+ letterSpacing: TYPOGRAPHY.WIDE,+ textTransform: 'uppercase',+ }}>+ RESEARCH+ </span>+ </div>++ {/* Divider */}+ <div style={COMMON_STYLES.verticalDivider} />++ {/* Symbol Search */}+ <div style={{ display: 'flex', alignItems: 'center', gap: SPACING.SMALL }}>+ <div style={{ position: 'relative', display: 'flex', alignItems: 'center' }}>+ <Search size={14} style={{+ position: 'absolute',+ left: '6px',+ pointerEvents: 'none',+ color: COLORS.GRAY+ }} /><inputtype="text"value={searchSymbol}onChange={(e) => setSearchSymbol(e.target.value)}onKeyPress={(e) => e.key === 'Enter' && handleSearch()}- placeholder="Enter symbol..."+ placeholder="SYMBOL..."style={{- backgroundColor: COLORS.DARK_BG,- border: `1px solid ${COLORS.BORDER}`,- color: COLORS.WHITE,- padding: '3px 8px',- fontSize: '11px',- width: '120px',- fontFamily: 'Consolas, monospace',+ ...COMMON_STYLES.inputField,+ paddingLeft: '26px',+ width: '140px',+ fontSize: TYPOGRAPHY.BODY,+ padding: `${SPACING.SMALL} ${SPACING.SMALL} ${SPACING.SMALL} 26px`,+ textTransform: 'uppercase',}}+ onFocus={(e) => e.currentTarget.style.borderColor = COLORS.ORANGE}+ onBlur={(e) => e.currentTarget.style.borderColor = COLORS.BORDER}/>- <button- onClick={handleSearch}- style={{- backgroundColor: COLORS.ORANGE,- border: 'none',- color: COLORS.DARK_BG,- padding: '3px 10px',- fontSize: '10px',- cursor: 'pointer',- fontWeight: 'bold',- }}- >- SEARCH- </button></div>+ <button+ onClick={handleSearch}+ style={{+ ...COMMON_STYLES.buttonPrimary,+ padding: `${SPACING.SMALL} ${SPACING.DEFAULT}`,+ fontSize: TYPOGRAPHY.SMALL,+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.TINY,+ }}+ onMouseEnter={(e) => e.currentTarget.style.opacity = '0.85'}+ onMouseLeave={(e) => e.currentTarget.style.opacity = '1'}+ >+ <Search size={12} />+ SEARCH+ </button>+ <button+ onClick={() => fetchStockData(currentSymbol)}+ style={{+ ...COMMON_STYLES.buttonSecondary,+ padding: `${SPACING.SMALL} ${SPACING.MEDIUM}`,+ fontSize: TYPOGRAPHY.SMALL,+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.TINY,+ }}+ onMouseEnter={(e) => e.currentTarget.style.backgroundColor = COLORS.HOVER}+ onMouseLeave={(e) => e.currentTarget.style.backgroundColor = 'transparent'}+ >+ <RefreshCw size={12} />+ REFRESH+ </button></div>- <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '10px' }}>- <span style={{ color: COLORS.GRAY }}>{currentTime.toLocaleTimeString()}</span>- <span style={{ color: COLORS.GRAY }}>|</span>- <span style={{ color: COLORS.CYAN, fontWeight: 'bold' }}>{currentSymbol}</span>- {loading && <span style={{ color: COLORS.YELLOW }}>● LOADING...</span>}- {!loading && <span style={{ color: COLORS.GREEN }}>● LIVE</span>}++ {/* Divider */}+ <div style={COMMON_STYLES.verticalDivider} />++ {/* Tab Navigation Buttons */}+ <div style={{ display: 'flex', alignItems: 'center', gap: SPACING.SMALL }}>+ {[+ { id: 'overview', label: 'OVERVIEW', icon: TrendingUp },+ { id: 'financials', label: 'FINANCIALS', icon: BarChart3 },+ { id: 'analysis', label: 'ANALYSIS', icon: FileText },+ { id: 'technicals', label: 'TECHNICALS', icon: BarChart3 },+ { id: 'peers', label: 'PEERS', icon: Users },+ { id: 'news', label: 'NEWS', icon: Newspaper },+ ].map((tab) => {+ const Icon = tab.icon;+ return (+ <button+ key={tab.id}+ onClick={() => setActiveTab(tab.id as typeof activeTab)}+ style={{+ padding: `${SPACING.SMALL} ${SPACING.DEFAULT}`,+ backgroundColor: activeTab === tab.id ? COLORS.ORANGE : 'transparent',+ border: BORDERS.STANDARD,+ borderColor: activeTab === tab.id ? COLORS.ORANGE : COLORS.BORDER,+ color: activeTab === tab.id ? COLORS.DARK_BG : COLORS.GRAY,+ fontSize: TYPOGRAPHY.SMALL,+ fontWeight: TYPOGRAPHY.BOLD,+ cursor: 'pointer',+ textTransform: 'uppercase',+ letterSpacing: TYPOGRAPHY.NORMAL,+ transition: EFFECTS.TRANSITION_FAST,+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.SMALL,+ }}+ onMouseEnter={(e) => {+ if (activeTab !== tab.id) {+ e.currentTarget.style.backgroundColor = COLORS.HOVER;+ e.currentTarget.style.borderColor = COLORS.ORANGE;+ }+ }}+ onMouseLeave={(e) => {+ if (activeTab !== tab.id) {+ e.currentTarget.style.backgroundColor = 'transparent';+ e.currentTarget.style.borderColor = COLORS.BORDER;+ }+ }}+ title={tab.label}+ >+ <Icon size={12} />+ <span>{tab.label}</span>+ </button>+ );+ })}</div></div>- </div>- {/* Main Content */}- <div style={{- flex: 1,- overflow: 'auto',- scrollbarColor: 'rgba(120, 120, 120, 0.3) transparent',- scrollbarWidth: 'thin',- minHeight: 0,- backgroundColor: COLORS.DARK_BG,- }} className="custom-scrollbar">-- {/* Stock Header with Price */}+ {/* Right Section - Status */}<div style={{- backgroundColor: COLORS.PANEL_BG,- border: `1px solid ${COLORS.BORDER}`,- padding: '12px',- margin: '8px',+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.DEFAULT,+ fontSize: TYPOGRAPHY.BODY,}}>- <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>- <div>- <div style={{ display: 'flex', alignItems: 'center', gap: '12px', marginBottom: '4px' }}>- <span style={{ color: COLORS.ORANGE, fontSize: '20px', fontWeight: 'bold' }}>{currentSymbol}</span>- <span style={{ color: COLORS.WHITE, fontSize: '14px' }}>{stockInfo?.company_name || 'Loading...'}</span>- {stockInfo?.sector && (- <span style={{- color: COLORS.BLUE,- fontSize: '10px',- padding: '2px 6px',- backgroundColor: 'rgba(100,150,250,0.2)',- border: `1px solid ${COLORS.BLUE}`,- }}>- {stockInfo.sector}- </span>- )}- {stockInfo?.recommendation_key && (- <span style={{- color: getRecommendationColor(stockInfo.recommendation_key),- fontSize: '10px',- padding: '2px 6px',- backgroundColor: `${getRecommendationColor(stockInfo.recommendation_key)}20`,- border: `1px solid ${getRecommendationColor(stockInfo.recommendation_key)}`,- fontWeight: 'bold',- }}>- {getRecommendationText(stockInfo.recommendation_key)}- </span>- )}- </div>- <div style={{ fontSize: '10px', color: COLORS.GRAY }}>- {stockInfo?.exchange || 'N/A'} | {stockInfo?.industry || 'N/A'} | {stockInfo?.country || 'N/A'}- </div>+ <span style={{ color: COLORS.GRAY, fontSize: TYPOGRAPHY.SMALL }}>+ {currentTime.toLocaleTimeString()}+ </span>+ <div style={COMMON_STYLES.verticalDivider} />+ <span style={{ color: COLORS.CYAN, fontWeight: TYPOGRAPHY.BOLD }}>+ {currentSymbol}+ </span>+ <div style={{+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.TINY,+ padding: `${SPACING.TINY} ${SPACING.SMALL}`,+ backgroundColor: loading ? `${COLORS.YELLOW}15` : `${COLORS.GREEN}15`,+ border: `1px solid ${loading ? COLORS.YELLOW : COLORS.GREEN}`,+ }}>+ <div style={{+ width: '6px',+ height: '6px',+ borderRadius: '50%',+ backgroundColor: loading ? COLORS.YELLOW : COLORS.GREEN,+ animation: loading ? 'pulse 1.5s ease-in-out infinite' : 'none',+ }} />+ <span style={{+ color: loading ? COLORS.YELLOW : COLORS.GREEN,+ fontWeight: TYPOGRAPHY.BOLD,+ fontSize: TYPOGRAPHY.SMALL,+ }}>+ {loading ? 'LOADING' : 'LIVE'}+ </span>+ </div>+ </div>+ </div>++ {/* Ticker Bar - Stock Price and Info */}+ <div style={{+ backgroundColor: COLORS.PANEL_BG,+ borderBottom: BORDERS.STANDARD,+ padding: `${SPACING.MEDIUM} ${SPACING.DEFAULT}`,+ flexShrink: 0,+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ }}>+ {/* Left - Company Info */}+ <div style={{ display: 'flex', alignItems: 'center', gap: SPACING.LARGE }}>+ <div>+ <div style={{ display: 'flex', alignItems: 'center', gap: SPACING.MEDIUM, marginBottom: SPACING.TINY }}>+ <span style={{+ color: COLORS.ORANGE,+ fontSize: TYPOGRAPHY.LARGE,+ fontWeight: TYPOGRAPHY.BOLD,+ letterSpacing: TYPOGRAPHY.WIDE,+ }}>+ {currentSymbol}+ </span>+ <span style={{+ color: COLORS.WHITE,+ fontSize: TYPOGRAPHY.SUBHEADING,+ fontWeight: TYPOGRAPHY.SEMIBOLD,+ }}>+ {stockInfo?.company_name || 'Loading...'}+ </span>+ {stockInfo?.sector && (+ <span style={{+ color: COLORS.BLUE,+ fontSize: TYPOGRAPHY.SMALL,+ padding: `${SPACING.TINY} ${SPACING.SMALL}`,+ backgroundColor: `${COLORS.BLUE}15`,+ border: `1px solid ${COLORS.BLUE}`,+ fontWeight: TYPOGRAPHY.SEMIBOLD,+ textTransform: 'uppercase',+ letterSpacing: TYPOGRAPHY.NORMAL,+ }}>+ {stockInfo.sector}+ </span>+ )}+ {stockInfo?.recommendation_key && (+ <span style={{+ color: getRecommendationColor(stockInfo.recommendation_key),+ fontSize: TYPOGRAPHY.SMALL,+ padding: `${SPACING.TINY} ${SPACING.SMALL}`,+ backgroundColor: `${getRecommendationColor(stockInfo.recommendation_key)}20`,+ border: `1px solid ${getRecommendationColor(stockInfo.recommendation_key)}`,+ fontWeight: TYPOGRAPHY.BOLD,+ textTransform: 'uppercase',+ }}>+ {getRecommendationText(stockInfo.recommendation_key)}+ </span>+ )}</div>- <div style={{ textAlign: 'right' }}>- <div style={{ fontSize: '24px', fontWeight: 'bold', color: COLORS.WHITE, marginBottom: '2px' }}>- ${formatNumber(currentPrice)}- </div>- <div style={{ fontSize: '12px', color: priceChange >= 0 ? COLORS.GREEN : COLORS.RED }}>- {priceChange >= 0 ? '▲' : '▼'} ${Math.abs(priceChange).toFixed(2)} ({priceChangePercent.toFixed(2)}%)- </div>+ <div style={{+ fontSize: TYPOGRAPHY.SMALL,+ color: COLORS.GRAY,+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.SMALL,+ }}>+ <span>{stockInfo?.exchange || 'N/A'}</span>+ <span>•</span>+ <span>{stockInfo?.industry || 'N/A'}</span>+ <span>•</span>+ <span>{stockInfo?.country || 'N/A'}</span></div></div></div>- {/* Tab Navigation */}+ {/* Right - Price Info */}<div style={{- backgroundColor: COLORS.PANEL_BG,- border: `1px solid ${COLORS.BORDER}`,- margin: '0 8px 8px 8px',display: 'flex',- gap: '1px',+ flexDirection: 'column',+ alignItems: 'flex-end',+ gap: SPACING.TINY,}}>- {(['overview', 'financials', 'analysis', 'technicals', 'peers', 'news'] as const).map((tab) => (- <button- key={tab}- onClick={() => setActiveTab(tab)}- style={{- flex: 1,- backgroundColor: activeTab === tab ? COLORS.ORANGE : COLORS.DARK_BG,- border: 'none',- color: activeTab === tab ? COLORS.DARK_BG : COLORS.WHITE,- padding: '8px 16px',- fontSize: '11px',- cursor: 'pointer',- fontWeight: activeTab === tab ? 'bold' : 'normal',- textTransform: 'uppercase',- }}- >- {tab}- </button>- ))}+ <div style={{+ fontSize: '28px',+ fontWeight: TYPOGRAPHY.BOLD,+ color: COLORS.WHITE,+ fontFamily: TYPOGRAPHY.MONO,+ letterSpacing: TYPOGRAPHY.TIGHT,+ }}>+ ${formatNumber(currentPrice)}+ </div>+ <div style={{+ fontSize: TYPOGRAPHY.SUBHEADING,+ color: priceChange >= 0 ? COLORS.GREEN : COLORS.RED,+ fontWeight: TYPOGRAPHY.BOLD,+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.TINY,+ }}>+ <span>{priceChange >= 0 ? '▲' : '▼'}</span>+ <span>${Math.abs(priceChange).toFixed(2)}</span>+ <span>({priceChangePercent.toFixed(2)}%)</span>+ </div></div>+ </div>++ {/* Main Content Area */}+ <div style={{+ flex: 1,+ overflow: 'auto',+ scrollbarColor: 'rgba(120, 120, 120, 0.3) transparent',+ scrollbarWidth: 'thin',+ minHeight: 0,+ backgroundColor: COLORS.DARK_BG,+ }} className="custom-scrollbar">{/* Overview Tab */}{activeTab === 'overview' && (<div style={{display: 'flex',flexDirection: 'column',- gap: '6px',- padding: '8px',+ gap: SPACING.MEDIUM,+ padding: SPACING.DEFAULT,height: '100%',boxSizing: 'border-box',}}>@@ -1470,117 +1658,139 @@ const EquityResearchTab: React.FC = () => {<div style={{display: 'grid',gridTemplateColumns: 'repeat(4, 1fr)',- gap: '6px',+ gap: SPACING.MEDIUM,flex: '0 0 auto',minHeight: '400px',}}>{/* Column 1 - Trading & Valuation */}- <div style={{ display: 'flex', flexDirection: 'column', gap: '6px' }}>+ <div style={{ display: 'flex', flexDirection: 'column', gap: SPACING.MEDIUM }}>{/* Today's Trading */}<div style={{- backgroundColor: COLORS.PANEL_BG,- border: `1px solid ${COLORS.BORDER}`,- padding: '6px',+ ...COMMON_STYLES.panel,+ padding: SPACING.MEDIUM,}}>- <div style={{ color: COLORS.ORANGE, fontSize: '10px', fontWeight: 'bold', marginBottom: '6px', borderBottom: `1px solid ${COLORS.BORDER}`, paddingBottom: '3px' }}>+ <div style={{+ ...COMMON_STYLES.sectionHeader,+ fontSize: TYPOGRAPHY.BODY,+ paddingBottom: SPACING.TINY,+ marginBottom: SPACING.SMALL,+ borderBottom: BORDERS.STANDARD,+ }}>TODAY'S TRADING</div>- <div style={{ display: 'flex', flexDirection: 'column', gap: '4px', fontSize: '9px' }}>+ <div style={{ display: 'flex', flexDirection: 'column', gap: SPACING.SMALL, fontSize: TYPOGRAPHY.SMALL }}><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>OPEN:</span>- <span style={{ color: COLORS.CYAN }}>${formatNumber(quoteData?.open)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>OPEN</span>+ <span style={{ color: COLORS.CYAN, fontWeight: TYPOGRAPHY.SEMIBOLD }}>${formatNumber(quoteData?.open)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>HIGH:</span>- <span style={{ color: COLORS.GREEN }}>${formatNumber(quoteData?.high)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>HIGH</span>+ <span style={{ color: COLORS.GREEN, fontWeight: TYPOGRAPHY.SEMIBOLD }}>${formatNumber(quoteData?.high)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>LOW:</span>- <span style={{ color: COLORS.RED }}>${formatNumber(quoteData?.low)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>LOW</span>+ <span style={{ color: COLORS.RED, fontWeight: TYPOGRAPHY.SEMIBOLD }}>${formatNumber(quoteData?.low)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>PREV CLOSE:</span>- <span style={{ color: COLORS.WHITE }}>${formatNumber(quoteData?.previous_close)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>PREV CLOSE</span>+ <span style={{ color: COLORS.WHITE, fontWeight: TYPOGRAPHY.SEMIBOLD }}>${formatNumber(quoteData?.previous_close)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>VOLUME:</span>- <span style={{ color: COLORS.YELLOW }}>{formatNumber(quoteData?.volume || 0, 0)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>VOLUME</span>+ <span style={{ color: COLORS.YELLOW, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{formatNumber(quoteData?.volume || 0, 0)}</span></div></div></div>{/* Valuation Metrics */}<div style={{- backgroundColor: COLORS.PANEL_BG,- border: `1px solid ${COLORS.BORDER}`,- padding: '6px',+ ...COMMON_STYLES.panel,+ padding: SPACING.MEDIUM,}}>- <div style={{ color: COLORS.CYAN, fontSize: '10px', fontWeight: 'bold', marginBottom: '6px', borderBottom: `1px solid ${COLORS.BORDER}`, paddingBottom: '3px' }}>+ <div style={{+ color: COLORS.CYAN,+ fontSize: TYPOGRAPHY.BODY,+ fontWeight: TYPOGRAPHY.BOLD,+ letterSpacing: TYPOGRAPHY.WIDE,+ textTransform: 'uppercase',+ paddingBottom: SPACING.TINY,+ marginBottom: SPACING.SMALL,+ borderBottom: BORDERS.STANDARD,+ }}>VALUATION</div>- <div style={{ display: 'flex', flexDirection: 'column', gap: '4px', fontSize: '9px' }}>+ <div style={{ display: 'flex', flexDirection: 'column', gap: SPACING.SMALL, fontSize: TYPOGRAPHY.SMALL }}><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>MARKET CAP:</span>- <span style={{ color: COLORS.CYAN }}>{formatLargeNumber(stockInfo?.market_cap)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>MARKET CAP</span>+ <span style={{ color: COLORS.CYAN, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{formatLargeNumber(stockInfo?.market_cap)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>P/E RATIO:</span>- <span style={{ color: COLORS.YELLOW }}>{formatNumber(stockInfo?.pe_ratio)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>P/E RATIO</span>+ <span style={{ color: COLORS.YELLOW, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{formatNumber(stockInfo?.pe_ratio)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>FWD P/E:</span>- <span style={{ color: COLORS.YELLOW }}>{formatNumber(stockInfo?.forward_pe)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>FWD P/E</span>+ <span style={{ color: COLORS.YELLOW, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{formatNumber(stockInfo?.forward_pe)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>PEG RATIO:</span>- <span style={{ color: COLORS.YELLOW }}>{formatNumber(stockInfo?.peg_ratio)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>PEG RATIO</span>+ <span style={{ color: COLORS.YELLOW, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{formatNumber(stockInfo?.peg_ratio)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>P/B RATIO:</span>- <span style={{ color: COLORS.CYAN }}>{formatNumber(stockInfo?.price_to_book)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>P/B RATIO</span>+ <span style={{ color: COLORS.CYAN, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{formatNumber(stockInfo?.price_to_book)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>DIV YIELD:</span>- <span style={{ color: COLORS.GREEN }}>+ <span style={{ ...COMMON_STYLES.dataLabel }}>DIV YIELD</span>+ <span style={{ color: COLORS.GREEN, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{formatPercent(stockInfo?.dividend_yield)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>BETA:</span>- <span style={{ color: COLORS.WHITE }}>{formatNumber(stockInfo?.beta)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>BETA</span>+ <span style={{ color: COLORS.WHITE, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{formatNumber(stockInfo?.beta)}</span></div></div></div>{/* Share Statistics */}<div style={{- backgroundColor: COLORS.PANEL_BG,- border: `1px solid ${COLORS.BORDER}`,- padding: '6px',+ ...COMMON_STYLES.panel,+ padding: SPACING.MEDIUM,+ flex: 1,}}>- <div style={{ color: COLORS.CYAN, fontSize: '10px', fontWeight: 'bold', marginBottom: '6px', borderBottom: `1px solid ${COLORS.BORDER}`, paddingBottom: '3px' }}>+ <div style={{+ color: COLORS.PURPLE,+ fontSize: TYPOGRAPHY.BODY,+ fontWeight: TYPOGRAPHY.BOLD,+ letterSpacing: TYPOGRAPHY.WIDE,+ textTransform: 'uppercase',+ paddingBottom: SPACING.TINY,+ marginBottom: SPACING.SMALL,+ borderBottom: BORDERS.STANDARD,+ }}>SHARE STATS</div>- <div style={{ display: 'flex', flexDirection: 'column', gap: '4px', fontSize: '9px' }}>+ <div style={{ display: 'flex', flexDirection: 'column', gap: SPACING.SMALL, fontSize: TYPOGRAPHY.SMALL }}><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>SHARES OUT:</span>- <span style={{ color: COLORS.CYAN }}>{formatLargeNumber(stockInfo?.shares_outstanding)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>SHARES OUT</span>+ <span style={{ color: COLORS.CYAN, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{formatLargeNumber(stockInfo?.shares_outstanding)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>FLOAT:</span>- <span style={{ color: COLORS.CYAN }}>{formatLargeNumber(stockInfo?.float_shares)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>FLOAT</span>+ <span style={{ color: COLORS.CYAN, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{formatLargeNumber(stockInfo?.float_shares)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>INSIDERS:</span>- <span style={{ color: COLORS.YELLOW }}>{formatPercent(stockInfo?.held_percent_insiders)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>INSIDERS</span>+ <span style={{ color: COLORS.YELLOW, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{formatPercent(stockInfo?.held_percent_insiders)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>INSTITUTIONS:</span>- <span style={{ color: COLORS.YELLOW }}>{formatPercent(stockInfo?.held_percent_institutions)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>INSTITUTIONS</span>+ <span style={{ color: COLORS.YELLOW, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{formatPercent(stockInfo?.held_percent_institutions)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>SHORT %:</span>- <span style={{ color: COLORS.RED }}>{formatPercent(stockInfo?.short_percent_of_float)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>SHORT %</span>+ <span style={{ color: COLORS.RED, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{formatPercent(stockInfo?.short_percent_of_float)}</span></div></div></div>@@ -1590,34 +1800,52 @@ const EquityResearchTab: React.FC = () => {<div style={{display: 'flex',flexDirection: 'column',- gap: '6px',+ gap: SPACING.MEDIUM,gridColumn: 'span 2',overflow: 'hidden',minHeight: 0,}}>{/* Chart Period Selector */}<div style={{- backgroundColor: COLORS.PANEL_BG,- border: `1px solid ${COLORS.BORDER}`,- padding: '4px 6px',+ ...COMMON_STYLES.panel,+ padding: SPACING.SMALL,display: 'flex',alignItems: 'center',- gap: '6px',+ gap: SPACING.SMALL,flexShrink: 0,}}>- <span style={{ color: COLORS.GRAY, fontSize: '9px' }}>PERIOD:</span>+ <span style={{+ ...COMMON_STYLES.dataLabel,+ marginRight: SPACING.TINY,+ }}>+ PERIOD+ </span>{(['1M', '3M', '6M', '1Y', '5Y'] as const).map((period) => (<buttonkey={period}onClick={() => setChartPeriod(period)}style={{- backgroundColor: chartPeriod === period ? COLORS.ORANGE : COLORS.DARK_BG,- border: `1px solid ${COLORS.BORDER}`,+ padding: `${SPACING.TINY} ${SPACING.MEDIUM}`,+ backgroundColor: chartPeriod === period ? COLORS.ORANGE : 'transparent',+ border: BORDERS.STANDARD,+ borderColor: chartPeriod === period ? COLORS.ORANGE : COLORS.BORDER,color: chartPeriod === period ? COLORS.DARK_BG : COLORS.WHITE,- padding: '3px 8px',- fontSize: '8px',+ fontSize: TYPOGRAPHY.SMALL,cursor: 'pointer',- fontWeight: chartPeriod === period ? 'bold' : 'normal',+ fontWeight: TYPOGRAPHY.BOLD,+ transition: EFFECTS.TRANSITION_FAST,+ }}+ onMouseEnter={(e) => {+ if (chartPeriod !== period) {+ e.currentTarget.style.backgroundColor = COLORS.HOVER;+ e.currentTarget.style.borderColor = COLORS.ORANGE;+ }+ }}+ onMouseLeave={(e) => {+ if (chartPeriod !== period) {+ e.currentTarget.style.backgroundColor = 'transparent';+ e.currentTarget.style.borderColor = COLORS.BORDER;+ }}}>{period}@@ -1625,10 +1853,10 @@ const EquityResearchTab: React.FC = () => {))}</div>- {/* Chart with Volume - NOW WITH FULL TRADING TOOLKIT! */}+ {/* Chart with Volume - Full Trading Toolkit */}<div style={{- backgroundColor: COLORS.PANEL_BG,- border: `1px solid ${COLORS.BORDER}`,+ ...COMMON_STYLES.panel,+ padding: SPACING.NONE,overflow: 'hidden',flex: 1,display: 'flex',@@ -1660,82 +1888,110 @@ const EquityResearchTab: React.FC = () => {justifyContent: 'center',height: '100%',color: COLORS.GRAY,- fontSize: '11px',+ fontSize: TYPOGRAPHY.DEFAULT,+ flexDirection: 'column',+ gap: SPACING.MEDIUM,}}>- {loading ? 'Loading chart data...' : 'No chart data available'}+ <AlertCircle size={32} color={COLORS.GRAY} />+ <span>{loading ? 'Loading chart data...' : 'No chart data available'}</span></div>)}</div></div>{/* Column 3 - Analyst & Performance */}- <div style={{ display: 'flex', flexDirection: 'column', gap: '6px' }}>+ <div style={{ display: 'flex', flexDirection: 'column', gap: SPACING.MEDIUM }}>{/* Analyst Targets */}<div style={{- backgroundColor: COLORS.PANEL_BG,- border: `1px solid ${COLORS.BORDER}`,- padding: '6px',+ ...COMMON_STYLES.panel,+ padding: SPACING.MEDIUM,}}>- <div style={{ color: COLORS.MAGENTA, fontSize: '10px', fontWeight: 'bold', marginBottom: '6px', borderBottom: `1px solid ${COLORS.BORDER}`, paddingBottom: '3px' }}>+ <div style={{+ color: COLORS.MAGENTA,+ fontSize: TYPOGRAPHY.BODY,+ fontWeight: TYPOGRAPHY.BOLD,+ letterSpacing: TYPOGRAPHY.WIDE,+ textTransform: 'uppercase',+ paddingBottom: SPACING.TINY,+ marginBottom: SPACING.SMALL,+ borderBottom: BORDERS.STANDARD,+ }}>ANALYST TARGETS</div>- <div style={{ display: 'flex', flexDirection: 'column', gap: '4px', fontSize: '9px' }}>+ <div style={{ display: 'flex', flexDirection: 'column', gap: SPACING.SMALL, fontSize: TYPOGRAPHY.SMALL }}><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>HIGH:</span>- <span style={{ color: COLORS.GREEN }}>${formatNumber(stockInfo?.target_high_price)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>HIGH</span>+ <span style={{ color: COLORS.GREEN, fontWeight: TYPOGRAPHY.SEMIBOLD }}>${formatNumber(stockInfo?.target_high_price)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>MEAN:</span>- <span style={{ color: COLORS.YELLOW }}>${formatNumber(stockInfo?.target_mean_price)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>MEAN</span>+ <span style={{ color: COLORS.YELLOW, fontWeight: TYPOGRAPHY.SEMIBOLD }}>${formatNumber(stockInfo?.target_mean_price)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>LOW:</span>- <span style={{ color: COLORS.RED }}>${formatNumber(stockInfo?.target_low_price)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>LOW</span>+ <span style={{ color: COLORS.RED, fontWeight: TYPOGRAPHY.SEMIBOLD }}>${formatNumber(stockInfo?.target_low_price)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>ANALYSTS:</span>- <span style={{ color: COLORS.CYAN }}>{stockInfo?.number_of_analyst_opinions || 'N/A'}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>ANALYSTS</span>+ <span style={{ color: COLORS.CYAN, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{stockInfo?.number_of_analyst_opinions || 'N/A'}</span></div></div></div>{/* 52 Week Range */}<div style={{- backgroundColor: COLORS.PANEL_BG,- border: `1px solid ${COLORS.BORDER}`,- padding: '6px',+ ...COMMON_STYLES.panel,+ padding: SPACING.MEDIUM,}}>- <div style={{ color: COLORS.YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '6px', borderBottom: `1px solid ${COLORS.BORDER}`, paddingBottom: '3px' }}>+ <div style={{+ color: COLORS.YELLOW,+ fontSize: TYPOGRAPHY.BODY,+ fontWeight: TYPOGRAPHY.BOLD,+ letterSpacing: TYPOGRAPHY.WIDE,+ textTransform: 'uppercase',+ paddingBottom: SPACING.TINY,+ marginBottom: SPACING.SMALL,+ borderBottom: BORDERS.STANDARD,+ }}>52 WEEK RANGE</div>- <div style={{ display: 'flex', flexDirection: 'column', gap: '4px', fontSize: '9px' }}>+ <div style={{ display: 'flex', flexDirection: 'column', gap: SPACING.SMALL, fontSize: TYPOGRAPHY.SMALL }}><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>HIGH:</span>- <span style={{ color: COLORS.GREEN }}>${formatNumber(stockInfo?.fifty_two_week_high)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>HIGH</span>+ <span style={{ color: COLORS.GREEN, fontWeight: TYPOGRAPHY.SEMIBOLD }}>${formatNumber(stockInfo?.fifty_two_week_high)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>LOW:</span>- <span style={{ color: COLORS.RED }}>${formatNumber(stockInfo?.fifty_two_week_low)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>LOW</span>+ <span style={{ color: COLORS.RED, fontWeight: TYPOGRAPHY.SEMIBOLD }}>${formatNumber(stockInfo?.fifty_two_week_low)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>AVG VOL:</span>- <span style={{ color: COLORS.CYAN }}>{formatNumber(stockInfo?.average_volume, 0)}</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>AVG VOL</span>+ <span style={{ color: COLORS.CYAN, fontWeight: TYPOGRAPHY.SEMIBOLD }}>{formatNumber(stockInfo?.average_volume, 0)}</span></div></div></div>{/* Profitability */}<div style={{- backgroundColor: COLORS.PANEL_BG,- border: `1px solid ${COLORS.BORDER}`,- padding: '6px',+ ...COMMON_STYLES.panel,+ padding: SPACING.MEDIUM,+ flex: 1,}}>- <div style={{ color: COLORS.GREEN, fontSize: '10px', fontWeight: 'bold', marginBottom: '6px', borderBottom: `1px solid ${COLORS.BORDER}`, paddingBottom: '3px' }}>+ <div style={{+ color: COLORS.GREEN,+ fontSize: TYPOGRAPHY.BODY,+ fontWeight: TYPOGRAPHY.BOLD,+ letterSpacing: TYPOGRAPHY.WIDE,+ textTransform: 'uppercase',+ paddingBottom: SPACING.TINY,+ marginBottom: SPACING.SMALL,+ borderBottom: BORDERS.STANDARD,+ }}>PROFITABILITY</div>- <div style={{ display: 'flex', flexDirection: 'column', gap: '4px', fontSize: '9px' }}>+ <div style={{ display: 'flex', flexDirection: 'column', gap: SPACING.SMALL, fontSize: TYPOGRAPHY.SMALL }}><div style={{ display: 'flex', justifyContent: 'space-between' }}>- <span style={{ color: COLORS.GRAY }}>GROSS MARGIN:</span>+ <span style={{ ...COMMON_STYLES.dataLabel }}>GROSS MARGIN</span><span style={{ color: COLORS.GREEN }}>{formatPercent(stockInfo?.gross_margins)}</span></div><div style={{ display: 'flex', justifyContent: 'space-between' }}>@@ -2292,135 +2548,430 @@ const EquityResearchTab: React.FC = () => {{/* Analysis Tab */}{activeTab === 'analysis' && (- <div style={{ padding: '0 8px 8px 8px' }}>+ <div style={{ padding: SPACING.DEFAULT }}>{/* Financial Analysis Panel - CFA-Compliant Analysis */}- <div style={{ marginBottom: '8px' }}>+ <div style={{ marginBottom: SPACING.MEDIUM }}><FinancialAnalysisPanelticker={currentSymbol}companyName={stockInfo?.company_name || currentSymbol}/></div>- <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '8px' }}>++ {/* Financial Metrics Grid - 2x2 */}+ <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: SPACING.MEDIUM }}>{/* Financial Health */}<div style={{- backgroundColor: COLORS.PANEL_BG,- border: `1px solid ${COLORS.BORDER}`,- padding: '12px',+ ...COMMON_STYLES.panel,+ padding: SPACING.LARGE,}}>- <div style={{ color: COLORS.ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px', borderBottom: `1px solid ${COLORS.BORDER}`, paddingBottom: '6px' }}>+ <div style={{+ ...COMMON_STYLES.sectionHeader,+ fontSize: TYPOGRAPHY.SUBHEADING,+ paddingBottom: SPACING.SMALL,+ marginBottom: SPACING.LARGE,+ borderBottom: BORDERS.ORANGE,+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.SMALL,+ }}>+ <div style={{+ width: '4px',+ height: '16px',+ backgroundColor: COLORS.ORANGE,+ }} />FINANCIAL HEALTH</div>- <div style={{ display: 'flex', flexDirection: 'column', gap: '10px', fontSize: '11px' }}>+ <div style={{+ display: 'grid',+ gridTemplateColumns: '1fr 1fr',+ gap: SPACING.LARGE,+ }}><div>- <div style={{ color: COLORS.GRAY, fontSize: '10px', marginBottom: '4px' }}>TOTAL CASH</div>- <div style={{ color: COLORS.GREEN, fontSize: '16px', fontWeight: 'bold' }}>{formatLargeNumber(stockInfo?.total_cash)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ TOTAL CASH+ </div>+ <div style={{+ color: COLORS.GREEN,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatLargeNumber(stockInfo?.total_cash)}+ </div></div><div>- <div style={{ color: COLORS.GRAY, fontSize: '10px', marginBottom: '4px' }}>TOTAL DEBT</div>- <div style={{ color: COLORS.RED, fontSize: '16px', fontWeight: 'bold' }}>{formatLargeNumber(stockInfo?.total_debt)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ TOTAL DEBT+ </div>+ <div style={{+ color: COLORS.RED,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatLargeNumber(stockInfo?.total_debt)}+ </div></div><div>- <div style={{ color: COLORS.GRAY, fontSize: '10px', marginBottom: '4px' }}>FREE CASHFLOW</div>- <div style={{ color: COLORS.CYAN, fontSize: '16px', fontWeight: 'bold' }}>{formatLargeNumber(stockInfo?.free_cashflow)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ FREE CASHFLOW+ </div>+ <div style={{+ color: COLORS.CYAN,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatLargeNumber(stockInfo?.free_cashflow)}+ </div></div><div>- <div style={{ color: COLORS.GRAY, fontSize: '10px', marginBottom: '4px' }}>OPERATING CASHFLOW</div>- <div style={{ color: COLORS.BLUE, fontSize: '16px', fontWeight: 'bold' }}>{formatLargeNumber(stockInfo?.operating_cashflow)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ OPERATING CF+ </div>+ <div style={{+ color: COLORS.BLUE,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatLargeNumber(stockInfo?.operating_cashflow)}+ </div></div></div></div>{/* Enterprise Value */}<div style={{- backgroundColor: COLORS.PANEL_BG,- border: `1px solid ${COLORS.BORDER}`,- padding: '12px',+ ...COMMON_STYLES.panel,+ padding: SPACING.LARGE,}}>- <div style={{ color: COLORS.CYAN, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px', borderBottom: `1px solid ${COLORS.BORDER}`, paddingBottom: '6px' }}>- ENTERPRISE VALUE METRICS+ <div style={{+ color: COLORS.CYAN,+ fontSize: TYPOGRAPHY.SUBHEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ letterSpacing: TYPOGRAPHY.WIDE,+ textTransform: 'uppercase',+ paddingBottom: SPACING.SMALL,+ marginBottom: SPACING.LARGE,+ borderBottom: BORDERS.CYAN,+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.SMALL,+ }}>+ <div style={{+ width: '4px',+ height: '16px',+ backgroundColor: COLORS.CYAN,+ }} />+ ENTERPRISE VALUE</div>- <div style={{ display: 'flex', flexDirection: 'column', gap: '10px', fontSize: '11px' }}>+ <div style={{+ display: 'grid',+ gridTemplateColumns: '1fr 1fr',+ gap: SPACING.LARGE,+ }}><div>- <div style={{ color: COLORS.GRAY, fontSize: '10px', marginBottom: '4px' }}>ENTERPRISE VALUE</div>- <div style={{ color: COLORS.YELLOW, fontSize: '16px', fontWeight: 'bold' }}>{formatLargeNumber(stockInfo?.enterprise_value)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ ENTERPRISE VALUE+ </div>+ <div style={{+ color: COLORS.YELLOW,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatLargeNumber(stockInfo?.enterprise_value)}+ </div></div><div>- <div style={{ color: COLORS.GRAY, fontSize: '10px', marginBottom: '4px' }}>EV/REVENUE</div>- <div style={{ color: COLORS.CYAN, fontSize: '16px', fontWeight: 'bold' }}>{formatNumber(stockInfo?.enterprise_to_revenue)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ EV/REVENUE+ </div>+ <div style={{+ color: COLORS.CYAN,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatNumber(stockInfo?.enterprise_to_revenue)}+ </div></div><div>- <div style={{ color: COLORS.GRAY, fontSize: '10px', marginBottom: '4px' }}>EV/EBITDA</div>- <div style={{ color: COLORS.CYAN, fontSize: '16px', fontWeight: 'bold' }}>{formatNumber(stockInfo?.enterprise_to_ebitda)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ EV/EBITDA+ </div>+ <div style={{+ color: COLORS.CYAN,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatNumber(stockInfo?.enterprise_to_ebitda)}+ </div></div><div>- <div style={{ color: COLORS.GRAY, fontSize: '10px', marginBottom: '4px' }}>BOOK VALUE</div>- <div style={{ color: COLORS.WHITE, fontSize: '16px', fontWeight: 'bold' }}>${formatNumber(stockInfo?.book_value)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ BOOK VALUE+ </div>+ <div style={{+ color: COLORS.WHITE,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ ${formatNumber(stockInfo?.book_value)}+ </div></div></div></div>{/* Revenue & Profits */}<div style={{- backgroundColor: COLORS.PANEL_BG,- border: `1px solid ${COLORS.BORDER}`,- padding: '12px',+ ...COMMON_STYLES.panel,+ padding: SPACING.LARGE,}}>- <div style={{ color: COLORS.GREEN, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px', borderBottom: `1px solid ${COLORS.BORDER}`, paddingBottom: '6px' }}>+ <div style={{+ color: COLORS.GREEN,+ fontSize: TYPOGRAPHY.SUBHEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ letterSpacing: TYPOGRAPHY.WIDE,+ textTransform: 'uppercase',+ paddingBottom: SPACING.SMALL,+ marginBottom: SPACING.LARGE,+ borderBottom: BORDERS.GREEN,+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.SMALL,+ }}>+ <div style={{+ width: '4px',+ height: '16px',+ backgroundColor: COLORS.GREEN,+ }} />REVENUE & PROFITS</div>- <div style={{ display: 'flex', flexDirection: 'column', gap: '10px', fontSize: '11px' }}>+ <div style={{+ display: 'grid',+ gridTemplateColumns: '1fr 1fr',+ gap: SPACING.LARGE,+ }}><div>- <div style={{ color: COLORS.GRAY, fontSize: '10px', marginBottom: '4px' }}>TOTAL REVENUE</div>- <div style={{ color: COLORS.GREEN, fontSize: '16px', fontWeight: 'bold' }}>{formatLargeNumber(stockInfo?.total_revenue)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ TOTAL REVENUE+ </div>+ <div style={{+ color: COLORS.GREEN,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatLargeNumber(stockInfo?.total_revenue)}+ </div></div><div>- <div style={{ color: COLORS.GRAY, fontSize: '10px', marginBottom: '4px' }}>REVENUE PER SHARE</div>- <div style={{ color: COLORS.CYAN, fontSize: '16px', fontWeight: 'bold' }}>${formatNumber(stockInfo?.revenue_per_share)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ REVENUE/SHARE+ </div>+ <div style={{+ color: COLORS.CYAN,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ ${formatNumber(stockInfo?.revenue_per_share)}+ </div></div><div>- <div style={{ color: COLORS.GRAY, fontSize: '10px', marginBottom: '4px' }}>GROSS PROFITS</div>- <div style={{ color: COLORS.GREEN, fontSize: '16px', fontWeight: 'bold' }}>{formatLargeNumber(stockInfo?.gross_profits)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ GROSS PROFITS+ </div>+ <div style={{+ color: COLORS.GREEN,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatLargeNumber(stockInfo?.gross_profits)}+ </div></div><div>- <div style={{ color: COLORS.GRAY, fontSize: '10px', marginBottom: '4px' }}>EBITDA MARGINS</div>- <div style={{ color: COLORS.YELLOW, fontSize: '16px', fontWeight: 'bold' }}>{formatPercent(stockInfo?.ebitda_margins)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ EBITDA MARGINS+ </div>+ <div style={{+ color: COLORS.YELLOW,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatPercent(stockInfo?.ebitda_margins)}+ </div></div></div></div>{/* Key Ratios Summary */}<div style={{- backgroundColor: COLORS.PANEL_BG,- border: `1px solid ${COLORS.BORDER}`,- padding: '12px',+ ...COMMON_STYLES.panel,+ padding: SPACING.LARGE,}}>- <div style={{ color: COLORS.YELLOW, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px', borderBottom: `1px solid ${COLORS.BORDER}`, paddingBottom: '6px' }}>- KEY RATIOS SUMMARY+ <div style={{+ color: COLORS.PURPLE,+ fontSize: TYPOGRAPHY.SUBHEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ letterSpacing: TYPOGRAPHY.WIDE,+ textTransform: 'uppercase',+ paddingBottom: SPACING.SMALL,+ marginBottom: SPACING.LARGE,+ borderBottom: `2px solid ${COLORS.PURPLE}`,+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.SMALL,+ }}>+ <div style={{+ width: '4px',+ height: '16px',+ backgroundColor: COLORS.PURPLE,+ }} />+ KEY RATIOS</div>- <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '10px', fontSize: '10px' }}>+ <div style={{+ display: 'grid',+ gridTemplateColumns: '1fr 1fr',+ gap: SPACING.LARGE,+ }}><div>- <div style={{ color: COLORS.GRAY, fontSize: '9px', marginBottom: '3px' }}>P/E RATIO</div>- <div style={{ color: COLORS.WHITE, fontSize: '14px', fontWeight: 'bold' }}>{formatNumber(stockInfo?.pe_ratio)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ P/E RATIO+ </div>+ <div style={{+ color: COLORS.WHITE,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatNumber(stockInfo?.pe_ratio)}+ </div></div><div>- <div style={{ color: COLORS.GRAY, fontSize: '9px', marginBottom: '3px' }}>PEG RATIO</div>- <div style={{ color: COLORS.WHITE, fontSize: '14px', fontWeight: 'bold' }}>{formatNumber(stockInfo?.peg_ratio)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ PEG RATIO+ </div>+ <div style={{+ color: COLORS.WHITE,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatNumber(stockInfo?.peg_ratio)}+ </div></div><div>- <div style={{ color: COLORS.GRAY, fontSize: '9px', marginBottom: '3px' }}>ROE</div>- <div style={{ color: COLORS.GREEN, fontSize: '14px', fontWeight: 'bold' }}>{formatPercent(stockInfo?.return_on_equity)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ ROE+ </div>+ <div style={{+ color: COLORS.GREEN,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatPercent(stockInfo?.return_on_equity)}+ </div></div><div>- <div style={{ color: COLORS.GRAY, fontSize: '9px', marginBottom: '3px' }}>ROA</div>- <div style={{ color: COLORS.GREEN, fontSize: '14px', fontWeight: 'bold' }}>{formatPercent(stockInfo?.return_on_assets)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ ROA+ </div>+ <div style={{+ color: COLORS.GREEN,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatPercent(stockInfo?.return_on_assets)}+ </div></div><div>- <div style={{ color: COLORS.GRAY, fontSize: '9px', marginBottom: '3px' }}>BETA</div>- <div style={{ color: COLORS.CYAN, fontSize: '14px', fontWeight: 'bold' }}>{formatNumber(stockInfo?.beta)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ BETA+ </div>+ <div style={{+ color: COLORS.CYAN,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatNumber(stockInfo?.beta)}+ </div></div><div>- <div style={{ color: COLORS.GRAY, fontSize: '9px', marginBottom: '3px' }}>SHORT RATIO</div>- <div style={{ color: COLORS.RED, fontSize: '14px', fontWeight: 'bold' }}>{formatNumber(stockInfo?.short_ratio)}</div>+ <div style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ SHORT RATIO+ </div>+ <div style={{+ color: COLORS.RED,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}>+ {formatNumber(stockInfo?.short_ratio)}+ </div></div></div></div>diff --git a/fincept-terminal-desktop/src/components/tabs/equity-research/components/FinancialAnalysisPanel.tsx b/fincept-terminal-desktop/src/components/tabs/equity-research/components/FinancialAnalysisPanel.tsxindex 15592c5d7..229a49f25 100644--- a/fincept-terminal-desktop/src/components/tabs/equity-research/components/FinancialAnalysisPanel.tsx+++ b/fincept-terminal-desktop/src/components/tabs/equity-research/components/FinancialAnalysisPanel.tsx@@ -1,19 +1,35 @@-// Financial Analysis Panel+// Financial Analysis Panel - Bloomberg Styleimport React, { useState, useCallback } from 'react';import { invoke } from '@tauri-apps/api/core';import { AlertCircle, CheckCircle, BarChart3, DollarSign, PieChart, Activity, FileText, ChevronDown, ChevronUp, Loader2 } from 'lucide-react';+// Bloomberg color constants+const COLORS = {+ ORANGE: '#FF8800',+ WHITE: '#FFFFFF',+ RED: '#FF3B3B',+ GREEN: '#00D66F',+ YELLOW: '#FFD700',+ GRAY: '#787878',+ CYAN: '#00E5FF',+ DARK_BG: '#000000',+ PANEL_BG: '#0F0F0F',+ HEADER_BG: '#1A1A1A',+ BORDER: '#2A2A2A',+ HOVER: '#1F1F1F',+};+interface FinancialsInput { revenue?: number; net_income?: number; total_assets?: number; operating_cash_flow?: number; }interface FinancialDataInput { company: { ticker: string; name: string; sector?: string; country?: string }; period: { period_end: string; fiscal_year: number }; financials: FinancialsInput; }interface AnalysisResult { success: boolean; metrics?: Record<string, any>; summary?: string; error?: string; results?: any[]; }type AnalysisType = 'income' | 'balance' | 'cashflow' | 'comprehensive' | 'metrics';const ANALYSIS_TYPES = [- { type: 'income' as AnalysisType, label: 'Income', icon: <DollarSign className="w-4 h-4" /> },- { type: 'balance' as AnalysisType, label: 'Balance', icon: <PieChart className="w-4 h-4" /> },- { type: 'cashflow' as AnalysisType, label: 'Cash Flow', icon: <Activity className="w-4 h-4" /> },- { type: 'comprehensive' as AnalysisType, label: 'Full', icon: <FileText className="w-4 h-4" /> },- { type: 'metrics' as AnalysisType, label: 'Metrics', icon: <BarChart3 className="w-4 h-4" /> },+ { type: 'income' as AnalysisType, label: 'Income', icon: DollarSign },+ { type: 'balance' as AnalysisType, label: 'Balance', icon: PieChart },+ { type: 'cashflow' as AnalysisType, label: 'Cash Flow', icon: Activity },+ { type: 'comprehensive' as AnalysisType, label: 'Full', icon: FileText },+ { type: 'metrics' as AnalysisType, label: 'Metrics', icon: BarChart3 },];export const FinancialAnalysisPanel: React.FC<{ ticker?: string; companyName?: string; }> = ({ ticker = 'AAPL', companyName = 'Apple Inc.' }) => {@@ -25,41 +41,211 @@ export const FinancialAnalysisPanel: React.FC<{ ticker?: string; companyName?: sconst run = useCallback(async () => {setLoading(true);try {- const cmds: Record<AnalysisType, string> = { income: 'analyze_income_statement', balance: 'analyze_balance_sheet', cashflow: 'analyze_cash_flow', comprehensive: 'analyze_financial_statements', metrics: 'get_financial_key_metrics' };- const res = await invoke<string>(cmds[selected], { data: { company: { ticker, name: companyName }, period: { period_end: new Date().toISOString().split('T')[0], fiscal_year: new Date().getFullYear() }, financials: {} } });+ const cmds: Record<AnalysisType, string> = {+ income: 'analyze_income_statement',+ balance: 'analyze_balance_sheet',+ cashflow: 'analyze_cash_flow',+ comprehensive: 'analyze_financial_statements',+ metrics: 'get_financial_key_metrics'+ };+ const res = await invoke<string>(cmds[selected], {+ data: {+ company: { ticker, name: companyName },+ period: { period_end: new Date().toISOString().split('T')[0], fiscal_year: new Date().getFullYear() },+ financials: {}+ }+ });const p = JSON.parse(res);setResult({ success: p.success !== false, summary: p.summary || p.error, results: p.results, metrics: p.metrics, error: p.error });- } catch (e) { setResult({ success: false, error: e instanceof Error ? e.message : 'Failed' }); }- finally { setLoading(false); }+ } catch (e) {+ setResult({ success: false, error: e instanceof Error ? e.message : 'Failed' });+ } finally {+ setLoading(false);+ }}, [selected, ticker, companyName]);return (- <div className="bg-gray-900 rounded-xl border border-gray-700/50 overflow-hidden">- <div className="flex items-center justify-between p-4 bg-gray-800/50 cursor-pointer" onClick={() => setExpanded(!expanded)}>- <div className="flex items-center gap-3"><BarChart3 className="w5 h-5 text-blue-400" /><h3 className="font-semibold text-white">Financial Analysis</h3></div>- {expanded ? <ChevronUp className="w-5 h-5 text-gray-400" /> : <ChevronDown className="w5 h-5 text-gray-400" />}+ <div style={{+ backgroundColor: COLORS.PANEL_BG,+ border: `1px solid ${COLORS.BORDER}`,+ overflow: 'hidden',+ }}>+ {/* Header */}+ <div+ style={{+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ padding: '12px 16px',+ backgroundColor: COLORS.HEADER_BG,+ borderBottom: `2px solid ${COLORS.ORANGE}`,+ cursor: 'pointer',+ }}+ onClick={() => setExpanded(!expanded)}+ >+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <BarChart3 size={20} color={COLORS.ORANGE} />+ <h3 style={{+ fontWeight: 700,+ color: COLORS.WHITE,+ fontSize: '12px',+ letterSpacing: '0.5px',+ textTransform: 'uppercase',+ }}>+ Financial Analysis+ </h3>+ </div>+ {expanded ?+ <ChevronUp size={20} color={COLORS.GRAY} /> :+ <ChevronDown size={20} color={COLORS.GRAY} />+ }</div>++ {/* Content */}{expanded && (- <div className="p-4 space-y-4">- <div className="flex flex-wrap gap-2">{ANALYSIS_TYPES.map(({ type, label, icon }) => (<button key={type} onClick={() => setSelected(type)} className={selected === type ? 'flex items-center gap-2 px-3 py-2 rounded-lg text-sm bg-blue-600 text-white' : 'flex items-center gap-2 px-3 py-2 rounded-lg text-sm bg-gray-800 text-gray-300'}>{icon}<span>{label}</span></button>))}</div>- <button onClick={run} disabled={loading} className="w-full py-3 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-700 text-white rounded-lg flex items-center justify-center gap-2">{loading ? <><Loader2 className="w-5 h-5 animate-spin" />Analyzing...</> : <><BarChart3 className="w-5 h-5" />Run Analysis</>}</button>+ <div style={{ padding: '16px', display: 'flex', flexDirection: 'column', gap: '16px' }}>+ {/* Analysis Type Buttons */}+ <div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>+ {ANALYSIS_TYPES.map(({ type, label, icon: Icon }) => (+ <button+ key={type}+ onClick={() => setSelected(type)}+ style={{+ display: 'flex',+ alignItems: 'center',+ gap: '8px',+ padding: '8px 16px',+ backgroundColor: selected === type ? COLORS.ORANGE : 'transparent',+ border: `1px solid ${selected === type ? COLORS.ORANGE : COLORS.BORDER}`,+ color: selected === type ? COLORS.DARK_BG : COLORS.GRAY,+ fontSize: '10px',+ fontWeight: 700,+ textTransform: 'uppercase',+ letterSpacing: '0.5px',+ cursor: 'pointer',+ transition: 'all 0.15s ease',+ }}+ onMouseEnter={(e) => {+ if (selected !== type) {+ e.currentTarget.style.backgroundColor = COLORS.HOVER;+ e.currentTarget.style.borderColor = COLORS.ORANGE;+ }+ }}+ onMouseLeave={(e) => {+ if (selected !== type) {+ e.currentTarget.style.backgroundColor = 'transparent';+ e.currentTarget.style.borderColor = COLORS.BORDER;+ }+ }}+ >+ <Icon size={14} />+ <span>{label}</span>+ </button>+ ))}+ </div>++ {/* Run Analysis Button */}+ <button+ onClick={run}+ disabled={loading}+ style={{+ width: '100%',+ padding: '12px',+ backgroundColor: loading ? COLORS.BORDER : COLORS.ORANGE,+ border: 'none',+ color: loading ? COLORS.GRAY : COLORS.DARK_BG,+ fontSize: '11px',+ fontWeight: 700,+ textTransform: 'uppercase',+ letterSpacing: '0.5px',+ cursor: loading ? 'not-allowed' : 'pointer',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ gap: '8px',+ opacity: loading ? 0.6 : 1,+ transition: 'all 0.15s ease',+ }}+ onMouseEnter={(e) => {+ if (!loading) e.currentTarget.style.opacity = '0.85';+ }}+ onMouseLeave={(e) => {+ if (!loading) e.currentTarget.style.opacity = '1';+ }}+ >+ {loading ? (+ <>+ <Loader2 size={18} className="animate-spin" />+ <span>Analyzing...</span>+ </>+ ) : (+ <>+ <BarChart3 size={18} />+ <span>Run Analysis</span>+ </>+ )}+ </button>++ {/* Results */}{result && (- <div className={result.success ? "p-4 bg-green-900/20 border border-green-700/30 rounded-lg" : "p-4 bg-red-900/20 border border-red-700/30 rounded-lg"}>- <div className="flex items-center gap-2 mb-2">- {result.success ? <CheckCircle className="w-5 h-5 text-green-400" /> : <AlertCircle className="w-5 h-5 text-red-400" />}- <span className={result.success ? "text-green-400 font-bold" : "text-red-400 font-bold"}>+ <div style={{+ padding: '16px',+ backgroundColor: result.success ? `${COLORS.GREEN}15` : `${COLORS.RED}15`,+ border: `1px solid ${result.success ? COLORS.GREEN : COLORS.RED}`,+ }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', marginBottom: '8px' }}>+ {result.success ?+ <CheckCircle size={18} color={COLORS.GREEN} /> :+ <AlertCircle size={18} color={COLORS.RED} />+ }+ <span style={{+ color: result.success ? COLORS.GREEN : COLORS.RED,+ fontWeight: 700,+ fontSize: '11px',+ textTransform: 'uppercase',+ letterSpacing: '0.5px',+ }}>{result.success ? 'Analysis Complete' : 'Analysis Failed'}</span></div>- {result.summary && <div className="text-gray-300 text-sm mb-2">{result.summary}</div>}- {result.error && !result.success && <div className="text-red-400 text-sm">{result.error}</div>}++ {result.summary && (+ <div style={{ color: COLORS.WHITE, fontSize: '10px', marginBottom: '8px' }}>+ {result.summary}+ </div>+ )}++ {result.error && !result.success && (+ <div style={{ color: COLORS.RED, fontSize: '10px' }}>+ {result.error}+ </div>+ )}+{result.results && result.results.length > 0 && (- <div className="mt-2 max-h-40 overflow-y-auto">- <div className="text-gray-500 text-xs mb-1">{result.results.length} metrics analyzed</div>- {result.results.slice(0,5).map((r: any, i: number) => (- <div key={i} className="flex justify-between text-xs py-1 border-b border-gray-700">- <span className="text-cyan-400">{r.metric_name}</span>- <span className={r.risk_level === 'low' ? 'text-green-400' : r.risk_level === 'high' ? 'text-red-400' : 'text-yellow-400'}>+ <div style={{ marginTop: '8px', maxHeight: '160px', overflowY: 'auto' }}>+ <div style={{ color: COLORS.GRAY, fontSize: '9px', marginBottom: '4px' }}>+ {result.results.length} metrics analyzed+ </div>+ {result.results.slice(0, 5).map((r: any, i: number) => (+ <div+ key={i}+ style={{+ display: 'flex',+ justifyContent: 'space-between',+ fontSize: '10px',+ padding: '4px 0',+ borderBottom: `1px solid ${COLORS.BORDER}`,+ }}+ >+ <span style={{ color: COLORS.CYAN, textTransform: 'uppercase' }}>+ {r.metric_name}+ </span>+ <span style={{+ color: r.risk_level === 'low' ? COLORS.GREEN :+ r.risk_level === 'high' ? COLORS.RED :+ COLORS.YELLOW,+ fontWeight: 600,+ }}>{typeof r.value === 'number' ? r.value.toFixed(4) : r.value}</span></div>diff --git a/fincept-terminal-desktop/src/components/tabs/equity-research/components/PeerComparisonPanel.tsx b/fincept-terminal-desktop/src/components/tabs/equity-research/components/PeerComparisonPanel.tsxindex 86b6b7785..5c13989a9 100644--- a/fincept-terminal-desktop/src/components/tabs/equity-research/components/PeerComparisonPanel.tsx+++ b/fincept-terminal-desktop/src/components/tabs/equity-research/components/PeerComparisonPanel.tsx@@ -1,4 +1,4 @@-// Peer Comparison Panel Component+// Peer Comparison Panel Component - Bloomberg Style// Main UI for peer analysis and comparisonimport React, { useState } from 'react';@@ -7,6 +7,7 @@ import type { PeerCompany, CompanyMetrics, ViewMode } from '../../../../types/peimport { formatMetricValue, getMetricValue, getAllMetricNames } from '../../../../types/peer';import { usePeerComparison } from '../../../../hooks/usePeerComparison';import { PercentileRankMini } from './PercentileRankChart';+import { BLOOMBERG, TYPOGRAPHY, SPACING, BORDERS, COMMON_STYLES } from '../../portfolio-tab/bloombergStyles';interface PeerComparisonPanelProps {initialSymbol?: string;@@ -149,86 +150,197 @@ export const PeerComparisonPanel: React.FC<PeerComparisonPanelProps> = ({ initia}, [comparisonData, selectedMetrics]);return (- <div className="space-y-6">+ <div style={{ display: 'flex', flexDirection: 'column', gap: SPACING.LARGE }}>{/* Header */}- <div className="flex justify-between items-center">- <div className="flex-1">- <h2 className="text-2xl font-bold text-white mb-3">Peer Comparison</h2>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: SPACING.LARGE }}>+ <div style={{ flex: 1 }}>+ <h2 style={{+ ...COMMON_STYLES.sectionHeader,+ fontSize: TYPOGRAPHY.LARGE,+ marginBottom: SPACING.MEDIUM,+ }}>+ PEER COMPARISON+ </h2>{/* Target Symbol Input */}- <div className="flex gap-2 max-w-md">- <div className="flex-1">- <label className="text-xs text-gray-400 mb-1 block">Target Company Symbol</label>+ <div style={{ display: 'flex', gap: SPACING.SMALL, maxWidth: '500px' }}>+ <div style={{ flex: 1 }}>+ <label style={{+ ...COMMON_STYLES.dataLabel,+ display: 'block',+ marginBottom: SPACING.TINY,+ }}>+ TARGET COMPANY SYMBOL+ </label><inputtype="text"value={targetSymbol}onChange={(e) => setTargetSymbol(e.target.value.toUpperCase())}- placeholder="Enter symbol (e.g., AAPL, GOOGL)"- className="w-full px-3 py-2 bg-gray-800 border border-gray-700 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm"+ placeholder="e.g., AAPL, GOOGL"+ style={{+ ...COMMON_STYLES.inputField,+ fontSize: TYPOGRAPHY.BODY,+ }}+ onFocus={(e) => e.currentTarget.style.borderColor = BLOOMBERG.ORANGE}+ onBlur={(e) => e.currentTarget.style.borderColor = BLOOMBERG.BORDER}/></div></div>- <p className="text-gray-400 text-xs mt-2">+ <p style={{+ color: BLOOMBERG.GRAY,+ fontSize: TYPOGRAPHY.SMALL,+ marginTop: SPACING.SMALL,+ }}>Select target company and add peer companies to compare</p></div>- <div className="flex gap-2">+ <div style={{ display: 'flex', gap: SPACING.SMALL }}>{comparisonData && (<buttononClick={handleExportToCSV}- className="px-4 py-2 bg-gray-700 hover:bg-gray-600 text-white rounded-lg transition-colors font-medium flex items-center gap-2"+ style={{+ ...COMMON_STYLES.buttonSecondary,+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.SMALL,+ }}+ onMouseEnter={(e) => {+ e.currentTarget.style.backgroundColor = BLOOMBERG.HOVER;+ e.currentTarget.style.borderColor = BLOOMBERG.ORANGE;+ }}+ onMouseLeave={(e) => {+ e.currentTarget.style.backgroundColor = 'transparent';+ e.currentTarget.style.borderColor = BLOOMBERG.BORDER;+ }}>- <svg className="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg style={{ width: '14px', height: '14px' }} fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>- Export CSV+ <span>EXPORT CSV</span></button>)}<buttononClick={handleRunComparison}disabled={loading || !targetSymbol || selectedPeers.length === 0}- className="px-4 py-2 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-700 disabled:cursor-not-allowed text-white rounded-lg transition-colors font-medium"+ style={{+ ...COMMON_STYLES.buttonPrimary,+ opacity: (loading || !targetSymbol || selectedPeers.length === 0) ? 0.5 : 1,+ cursor: (loading || !targetSymbol || selectedPeers.length === 0) ? 'not-allowed' : 'pointer',+ }}+ onMouseEnter={(e) => {+ if (!loading && targetSymbol && selectedPeers.length > 0) {+ e.currentTarget.style.opacity = '0.85';+ }+ }}+ onMouseLeave={(e) => {+ if (!loading && targetSymbol && selectedPeers.length > 0) {+ e.currentTarget.style.opacity = '1';+ }+ }}>- {loading ? 'Comparing...' : 'Run Comparison'}+ {loading ? 'COMPARING...' : 'RUN COMPARISON'}</button></div></div>{/* Error Display */}{error && (- <div className="bg-red-900/20 border border-red-700 rounded-lg p-4">- <p className="text-red-400">{error}</p>+ <div style={{+ backgroundColor: `${BLOOMBERG.RED}15`,+ border: `1px solid ${BLOOMBERG.RED}`,+ padding: SPACING.DEFAULT,+ }}>+ <p style={{ color: BLOOMBERG.RED, fontSize: TYPOGRAPHY.BODY }}>{error}</p></div>)}{/* Peer Selection */}- <div className="bg-gray-900 rounded-lg p-4 border border-gray-700">- <h3 className="text-lg font-semibold text-white mb-3">Selected Peers ({selectedPeers.length})</h3>+ <div style={{+ ...COMMON_STYLES.panel,+ padding: SPACING.LARGE,+ }}>+ <h3 style={{+ color: BLOOMBERG.WHITE,+ fontSize: TYPOGRAPHY.SUBHEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ marginBottom: SPACING.MEDIUM,+ letterSpacing: TYPOGRAPHY.WIDE,+ textTransform: 'uppercase',+ }}>+ SELECTED PEERS ({selectedPeers.length})+ </h3>{selectedPeers.length === 0 ? (- <p className="text-gray-400 text-sm">No peers selected. Add peers manually using the input below.</p>+ <p style={{+ color: BLOOMBERG.GRAY,+ fontSize: TYPOGRAPHY.BODY,+ }}>+ No peers selected. Add peers manually using the input below.+ </p>) : (- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">+ <div style={{+ display: 'grid',+ gridTemplateColumns: 'repeat(auto-fill, minmax(250px, 1fr))',+ gap: SPACING.MEDIUM,+ }}>{selectedPeers.map((peer) => (<divkey={peer.symbol}- className="flex items-center justify-between p-3 bg-gray-800 rounded-lg border border-gray-700"+ style={{+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ padding: SPACING.MEDIUM,+ backgroundColor: BLOOMBERG.DARK_BG,+ border: BORDERS.STANDARD,+ }}>- <div className="flex-1">- <div className="flex items-center gap-2">- <span className="font-semibold text-white">{peer.symbol}</span>- <span className="text-xs px-2 py-0.5 bg-blue-900/30 text-blue-400 rounded">- {(peer.similarityScore * 100).toFixed(0)}% match+ <div style={{ flex: 1 }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: SPACING.SMALL }}>+ <span style={{+ fontWeight: TYPOGRAPHY.BOLD,+ color: BLOOMBERG.WHITE,+ fontSize: TYPOGRAPHY.DEFAULT,+ }}>+ {peer.symbol}+ </span>+ <span style={{+ fontSize: TYPOGRAPHY.TINY,+ padding: `${SPACING.TINY} ${SPACING.SMALL}`,+ backgroundColor: `${BLOOMBERG.CYAN}20`,+ color: BLOOMBERG.CYAN,+ border: `1px solid ${BLOOMBERG.CYAN}`,+ }}>+ {(peer.similarityScore * 100).toFixed(0)}% MATCH</span></div>- <p className="text-xs text-gray-400 truncate">{peer.name}</p>+ <p style={{+ fontSize: TYPOGRAPHY.SMALL,+ color: BLOOMBERG.GRAY,+ marginTop: SPACING.TINY,+ overflow: 'hidden',+ textOverflow: 'ellipsis',+ whiteSpace: 'nowrap',+ }}>+ {peer.name}+ </p></div><buttononClick={() => removePeer(peer.symbol)}- className="ml-2 p-1 hover:bg-gray-700 rounded transition-colors"+ style={{+ marginLeft: SPACING.SMALL,+ padding: SPACING.TINY,+ backgroundColor: 'transparent',+ border: 'none',+ cursor: 'pointer',+ color: BLOOMBERG.GRAY,+ transition: 'color 0.2s',+ }}+ onMouseEnter={(e) => e.currentTarget.style.color = BLOOMBERG.RED}+ onMouseLeave={(e) => e.currentTarget.style.color = BLOOMBERG.GRAY}>- <svg className="w-5 h-5 text-gray-400 hover:text-red-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg style={{ width: '16px', height: '16px' }} fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" /></svg></button>@@ -238,42 +350,93 @@ export const PeerComparisonPanel: React.FC<PeerComparisonPanelProps> = ({ initia)}{/* Manual Peer Input */}- <div className="mt-4">- <h4 className="text-sm font-medium text-gray-400 mb-2">Add Peer Manually</h4>- <div className="flex gap-2">+ <div style={{ marginTop: SPACING.LARGE }}>+ <h4 style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.SMALL,+ }}>+ ADD PEER MANUALLY+ </h4>+ <div style={{ display: 'flex', gap: SPACING.SMALL }}><inputtype="text"value={manualPeerSymbol}onChange={(e) => setManualPeerSymbol(e.target.value.toUpperCase())}onKeyPress={(e) => e.key === 'Enter' && handleAddManualPeer()}- placeholder="Enter peer symbol (e.g., MSFT, GOOGL)"- className="flex-1 px-3 py-2 bg-gray-800 border border-gray-700 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm"+ placeholder="e.g., MSFT, GOOGL"+ style={{+ ...COMMON_STYLES.inputField,+ flex: 1,+ fontSize: TYPOGRAPHY.BODY,+ }}+ onFocus={(e) => e.currentTarget.style.borderColor = BLOOMBERG.ORANGE}+ onBlur={(e) => e.currentTarget.style.borderColor = BLOOMBERG.BORDER}/><buttononClick={handleAddManualPeer}disabled={!manualPeerSymbol.trim()}- className="px-4 py-2 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-700 disabled:cursor-not-allowed text-white rounded-lg transition-colors font-medium text-sm"+ style={{+ ...COMMON_STYLES.buttonPrimary,+ opacity: !manualPeerSymbol.trim() ? 0.5 : 1,+ cursor: !manualPeerSymbol.trim() ? 'not-allowed' : 'pointer',+ }}+ onMouseEnter={(e) => {+ if (manualPeerSymbol.trim()) {+ e.currentTarget.style.opacity = '0.85';+ }+ }}+ onMouseLeave={(e) => {+ if (manualPeerSymbol.trim()) {+ e.currentTarget.style.opacity = '1';+ }+ }}>- Add Peer+ ADD PEER</button></div>- <p className="text-xs text-gray-500 mt-1">+ <p style={{+ fontSize: TYPOGRAPHY.SMALL,+ color: BLOOMBERG.MUTED,+ marginTop: SPACING.TINY,+ }}>Tip: Add companies from the same industry/sector for better comparison</p></div>{/* Available Peers */}{availablePeers.length > 0 && (- <div className="mt-4">- <h4 className="text-sm font-medium text-gray-400 mb-2">Available Peers</h4>- <div className="flex flex-wrap gap-2">+ <div style={{ marginTop: SPACING.LARGE }}>+ <h4 style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.SMALL,+ }}>+ AVAILABLE PEERS+ </h4>+ <div style={{ display: 'flex', flexWrap: 'wrap', gap: SPACING.SMALL }}>{availablePeers.filter((peer) => !selectedPeers.find((p) => p.symbol === peer.symbol)).map((peer) => (<buttonkey={peer.symbol}onClick={() => addPeer(peer)}- className="px-3 py-1 text-sm bg-gray-800 hover:bg-gray-700 border border-gray-700 text-white rounded transition-colors"+ style={{+ padding: `${SPACING.TINY} ${SPACING.MEDIUM}`,+ fontSize: TYPOGRAPHY.BODY,+ backgroundColor: BLOOMBERG.DARK_BG,+ border: BORDERS.STANDARD,+ color: BLOOMBERG.WHITE,+ cursor: 'pointer',+ transition: 'all 0.2s',+ fontWeight: TYPOGRAPHY.SEMIBOLD,+ }}+ onMouseEnter={(e) => {+ e.currentTarget.style.backgroundColor = BLOOMBERG.HOVER;+ e.currentTarget.style.borderColor = BLOOMBERG.ORANGE;+ }}+ onMouseLeave={(e) => {+ e.currentTarget.style.backgroundColor = BLOOMBERG.DARK_BG;+ e.currentTarget.style.borderColor = BLOOMBERG.BORDER;+ }}>+ {peer.symbol}</button>@@ -285,18 +448,40 @@ export const PeerComparisonPanel: React.FC<PeerComparisonPanelProps> = ({ initia{/* View Mode Selector */}{comparisonData && (- <div className="flex gap-2 border-b border-gray-700">+ <div style={{+ display: 'flex',+ gap: SPACING.SMALL,+ borderBottom: BORDERS.STANDARD,+ }}>{(['table', 'chart', 'radar'] as ViewMode[]).map((mode) => (<buttonkey={mode}onClick={() => setViewMode(mode)}- className={`px-4 py-2 font-medium transition-colors ${- viewMode === mode- ? 'text-blue-400 border-b-2 border-blue-400'- : 'text-gray-400 hover:text-gray-300'- }`}+ style={{+ padding: `${SPACING.MEDIUM} ${SPACING.LARGE}`,+ fontWeight: TYPOGRAPHY.BOLD,+ fontSize: TYPOGRAPHY.BODY,+ textTransform: 'uppercase',+ letterSpacing: TYPOGRAPHY.NORMAL,+ transition: 'all 0.2s',+ backgroundColor: 'transparent',+ border: 'none',+ borderBottom: viewMode === mode ? `2px solid ${BLOOMBERG.ORANGE}` : '2px solid transparent',+ color: viewMode === mode ? BLOOMBERG.ORANGE : BLOOMBERG.GRAY,+ cursor: 'pointer',+ }}+ onMouseEnter={(e) => {+ if (viewMode !== mode) {+ e.currentTarget.style.color = BLOOMBERG.WHITE;+ }+ }}+ onMouseLeave={(e) => {+ if (viewMode !== mode) {+ e.currentTarget.style.color = BLOOMBERG.GRAY;+ }+ }}>- {mode.charAt(0).toUpperCase() + mode.slice(1)}+ {mode.toUpperCase()}</button>))}</div>@@ -304,7 +489,7 @@ export const PeerComparisonPanel: React.FC<PeerComparisonPanelProps> = ({ initia{/* Comparison Results */}{comparisonData && (- <div className="space-y-4">+ <div style={{ display: 'flex', flexDirection: 'column', gap: SPACING.LARGE }}>{/* Valuation Assessment */}{(() => {// Calculate valuation status based on percentiles@@ -337,29 +522,57 @@ export const PeerComparisonPanel: React.FC<PeerComparisonPanelProps> = ({ initiaelse if (psPercentile > 66) score--;const getStatus = () => {- if (score >= 2) return { label: 'Undervalued', color: 'green', bgColor: 'bg-green-900/30', textColor: 'text-green-400', borderColor: 'border-green-700' };- if (score >= 1) return { label: 'Potentially Undervalued', color: 'emerald', bgColor: 'bg-emerald-900/30', textColor: 'text-emerald-400', borderColor: 'border-emerald-700' };- if (score <= -2) return { label: 'Overvalued', color: 'red', bgColor: 'bg-red-900/30', textColor: 'text-red-400', borderColor: 'border-red-700' };- if (score <= -1) return { label: 'Potentially Overvalued', color: 'orange', bgColor: 'bg-orange-900/30', textColor: 'text-orange-400', borderColor: 'border-orange-700' };- return { label: 'Fairly Valued', color: 'blue', bgColor: 'bg-blue-900/30', textColor: 'text-blue-400', borderColor: 'border-blue-700' };+ if (score >= 2) return { label: 'UNDERVALUED', bgColor: `${BLOOMBERG.GREEN}15`, textColor: BLOOMBERG.GREEN, borderColor: BLOOMBERG.GREEN };+ if (score >= 1) return { label: 'POTENTIALLY UNDERVALUED', bgColor: `${BLOOMBERG.GREEN}10`, textColor: BLOOMBERG.GREEN, borderColor: BLOOMBERG.GREEN };+ if (score <= -2) return { label: 'OVERVALUED', bgColor: `${BLOOMBERG.RED}15`, textColor: BLOOMBERG.RED, borderColor: BLOOMBERG.RED };+ if (score <= -1) return { label: 'POTENTIALLY OVERVALUED', bgColor: `${BLOOMBERG.YELLOW}15`, textColor: BLOOMBERG.YELLOW, borderColor: BLOOMBERG.YELLOW };+ return { label: 'FAIRLY VALUED', bgColor: `${BLOOMBERG.CYAN}15`, textColor: BLOOMBERG.CYAN, borderColor: BLOOMBERG.CYAN };};const status = getStatus();return (- <div className={`rounded-lg p-4 border ${status.borderColor} ${status.bgColor}`}>- <div className="flex items-center justify-between">+ <div style={{+ padding: SPACING.LARGE,+ border: `1px solid ${status.borderColor}`,+ backgroundColor: status.bgColor,+ }}>+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}><div>- <h3 className="text-lg font-semibold text-white mb-1">Valuation Assessment</h3>- <p className="text-sm text-gray-400">+ <h3 style={{+ fontSize: TYPOGRAPHY.SUBHEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ color: BLOOMBERG.WHITE,+ marginBottom: SPACING.TINY,+ letterSpacing: TYPOGRAPHY.WIDE,+ textTransform: 'uppercase',+ }}>+ VALUATION ASSESSMENT+ </h3>+ <p style={{+ fontSize: TYPOGRAPHY.BODY,+ color: BLOOMBERG.GRAY,+ }}>Based on P/E, P/B, and P/S percentile rankings vs peers</p></div>- <div className="text-right">- <span className={`inline-block px-4 py-2 rounded-lg font-semibold text-lg ${status.textColor}`}>+ <div style={{ textAlign: 'right' }}>+ <span style={{+ display: 'inline-block',+ padding: `${SPACING.SMALL} ${SPACING.LARGE}`,+ fontWeight: TYPOGRAPHY.BOLD,+ fontSize: TYPOGRAPHY.SUBHEADING,+ color: status.textColor,+ border: `1px solid ${status.borderColor}`,+ letterSpacing: TYPOGRAPHY.WIDE,+ }}>{status.label}</span>- <p className="text-xs text-gray-400 mt-1">+ <p style={{+ fontSize: TYPOGRAPHY.SMALL,+ color: BLOOMBERG.GRAY,+ marginTop: SPACING.TINY,+ }}>P/E: {pePercentile.toFixed(0)}th • P/B: {pbPercentile.toFixed(0)}th • P/S: {psPercentile.toFixed(0)}th percentile</p></div>@@ -369,41 +582,138 @@ export const PeerComparisonPanel: React.FC<PeerComparisonPanelProps> = ({ initia})()}{/* Sector Benchmarks Card */}- <div className="bg-gray-900 rounded-lg p-6 border border-gray-700">- <div className="flex items-center justify-between mb-4">- <h3 className="text-lg font-semibold text-white">Sector Benchmarks</h3>- <span className="text-xs px-2 py-1 bg-blue-900/30 text-blue-400 rounded">+ <div style={{+ ...COMMON_STYLES.panel,+ padding: SPACING.XLARGE,+ }}>+ <div style={{+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ marginBottom: SPACING.LARGE,+ }}>+ <h3 style={{+ fontSize: TYPOGRAPHY.SUBHEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ color: BLOOMBERG.WHITE,+ letterSpacing: TYPOGRAPHY.WIDE,+ textTransform: 'uppercase',+ }}>+ SECTOR BENCHMARKS+ </h3>+ <span style={{+ fontSize: TYPOGRAPHY.SMALL,+ padding: `${SPACING.TINY} ${SPACING.SMALL}`,+ backgroundColor: `${BLOOMBERG.CYAN}20`,+ color: BLOOMBERG.CYAN,+ border: `1px solid ${BLOOMBERG.CYAN}`,+ fontWeight: TYPOGRAPHY.BOLD,+ }}>{comparisonData.benchmarks.sector}</span></div>- <div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4">- <div className="bg-gray-800 rounded-lg p-3">- <p className="text-xs text-gray-400 mb-1">Median P/E</p>- <p className="text-xl font-semibold text-white">+ <div style={{+ display: 'grid',+ gridTemplateColumns: 'repeat(auto-fit, minmax(120px, 1fr))',+ gap: SPACING.LARGE,+ }}>+ <div style={{+ backgroundColor: BLOOMBERG.DARK_BG,+ border: BORDERS.STANDARD,+ padding: SPACING.MEDIUM,+ }}>+ <p style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ MEDIAN P/E+ </p>+ <p style={{+ fontSize: TYPOGRAPHY.LARGE,+ fontWeight: TYPOGRAPHY.BOLD,+ color: BLOOMBERG.WHITE,+ fontFamily: TYPOGRAPHY.MONO,+ }}>{comparisonData.benchmarks.medianPe?.toFixed(1) || 'N/A'}</p></div>- <div className="bg-gray-800 rounded-lg p-3">- <p className="text-xs text-gray-400 mb-1">Median P/B</p>- <p className="text-xl font-semibold text-white">+ <div style={{+ backgroundColor: BLOOMBERG.DARK_BG,+ border: BORDERS.STANDARD,+ padding: SPACING.MEDIUM,+ }}>+ <p style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ MEDIAN P/B+ </p>+ <p style={{+ fontSize: TYPOGRAPHY.LARGE,+ fontWeight: TYPOGRAPHY.BOLD,+ color: BLOOMBERG.WHITE,+ fontFamily: TYPOGRAPHY.MONO,+ }}>{comparisonData.benchmarks.medianPb?.toFixed(1) || 'N/A'}</p></div>- <div className="bg-gray-800 rounded-lg p-3">- <p className="text-xs text-gray-400 mb-1">Median ROE</p>- <p className="text-xl font-semibold text-white">+ <div style={{+ backgroundColor: BLOOMBERG.DARK_BG,+ border: BORDERS.STANDARD,+ padding: SPACING.MEDIUM,+ }}>+ <p style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ MEDIAN ROE+ </p>+ <p style={{+ fontSize: TYPOGRAPHY.LARGE,+ fontWeight: TYPOGRAPHY.BOLD,+ color: BLOOMBERG.WHITE,+ fontFamily: TYPOGRAPHY.MONO,+ }}>{comparisonData.benchmarks.medianRoe?.toFixed(1) || 'N/A'}%</p></div>- <div className="bg-gray-800 rounded-lg p-3">- <p className="text-xs text-gray-400 mb-1">Median Revenue Growth</p>- <p className="text-xl font-semibold text-white">+ <div style={{+ backgroundColor: BLOOMBERG.DARK_BG,+ border: BORDERS.STANDARD,+ padding: SPACING.MEDIUM,+ }}>+ <p style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ MEDIAN REV GROWTH+ </p>+ <p style={{+ fontSize: TYPOGRAPHY.LARGE,+ fontWeight: TYPOGRAPHY.BOLD,+ color: BLOOMBERG.WHITE,+ fontFamily: TYPOGRAPHY.MONO,+ }}>{comparisonData.benchmarks.medianRevenueGrowth?.toFixed(1) || 'N/A'}%</p></div>- <div className="bg-gray-800 rounded-lg p-3">- <p className="text-xs text-gray-400 mb-1">Median D/E</p>- <p className="text-xl font-semibold text-white">+ <div style={{+ backgroundColor: BLOOMBERG.DARK_BG,+ border: BORDERS.STANDARD,+ padding: SPACING.MEDIUM,+ }}>+ <p style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.TINY,+ }}>+ MEDIAN D/E+ </p>+ <p style={{+ fontSize: TYPOGRAPHY.LARGE,+ fontWeight: TYPOGRAPHY.BOLD,+ color: BLOOMBERG.WHITE,+ fontFamily: TYPOGRAPHY.MONO,+ }}>{comparisonData.benchmarks.medianDebtToEquity?.toFixed(2) || 'N/A'}</p></div>