/* ===== NEUBRA TRADING DASHBOARD - CSS GRID LAYOUT ===== */
/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  max-width: 100%;
  -ms-touch-action: manipulation;
  touch-action: manipulation;
}
:root :where(.is-layout-flow) > * {
    margin-block-start: unset;
    margin-block-end: 0;
}
.main-content {
    margin-bottom: 20px;
}

#header, .header, #sidebar, #footer {
  display: none;
}
body {
-webkit-touch-callout: none;                /* prevent callout to copy image, etc when tap to hold */
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-text-size-adjust: none;             /* prevent webkit from resizing text to fit */
}

/* ===== BASE LAYOUT ===== */
html, body {
  width: 100vw;
  height: 100%;
  font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  color: #d4d4d4;
  background-color: #1e1e1e;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

/* ===== APP CONTAINER - CSS GRID LAYOUT ===== */
.app-container {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  height: 100vh;
  height: -webkit-fill-available;
  width: 100vw;
  max-width: 100vw;
  position: relative;
  overflow-x: hidden;
}

/* ===== TOOLBAR ===== */
.toolbar {
  grid-row: 1;
  display: flex;
  align-items: center;
  background-color: #3c3c3c;
  border-bottom: 3px solid #404040;
  user-select: none;
  flex-shrink: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex-shrink: 0;
}



.toolbar-right {
  display: flex;
  flex-shrink: 0;
  min-width: 0;
}

.logo {
  font-weight: bold;
  font-size: 14px;
  color: #4CC9F0;
  flex-shrink: 0;
}

.menu-bar {
  display: flex;
  height: 100%;
  align-items: center;
  margin-left: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  min-width: 0;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.menu-bar::-webkit-scrollbar {
  display: none;
}


.menu-item {
  background: transparent;
  border: none;
  
  color: #d4d4d4;
  padding: 2px 4px;
  cursor: pointer;
  font-size: 12px;
  border-radius: 3px;
  height: 28px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
}




/* ===== MAIN CONTAINER - CSS GRID ===== */
.main-container {
  grid-row: 2;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-height: 0;
  max-width: 100vw;
}

/* ===== SIDEBAR ===== */
.sidebar {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: row;
  background-color: #252526;
  border-bottom: 1px solid #404040;
  width: 100%;
  max-width: 100vw;
  height: 60px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-header {
  display: none;
}

.sidebar-content {
  display: flex;
  flex-direction: row;
  padding: 8px;
  gap: 4px;
  align-items: center;
  width: 100%;
  min-width: max-content;
}

.explorer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
  cursor: pointer;
  border-radius: 3px;
  min-height: 44px;
  min-width: 60px;
  text-align: center;
  min-height: 44px;
  justify-content: center;
  font-size: 10px;
  line-height: 1.2;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.explorer-item:hover, .explorer-item:focus {
  background-color: rgba(90, 93, 94, 0.31);
}

.explorer-item.active {
  background-color: rgba(0, 120, 212, 0.1);
  border: 1px solid #0e639c;
}

.explorer-icon {
  margin-bottom: 2px;
  font-size: 14px;
}

.explorer-item span {
  word-break: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  margin-bottom: 0;
}

/* ===== TAB BAR - FIXED SCROLLING ===== */
.tab-bar {
    display: flex;
    background-color: #2d2d2d;
    border-bottom: 1px solid #404040;
    flex-shrink: 0;
    overflow: scroll;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    cursor: grab;
    z-index: 0;
    width: 100%;
    min-width: 0;
}

.tab-bar:active {
    cursor: grabbing;
}

.tab-bar::-webkit-scrollbar {
  height: 3px;
}

.tab-bar::-webkit-scrollbar-track {
  background: #1e1e1e;
}

.tab-bar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.tab-bar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.tab {
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 32px;
  min-width: 120px;
  max-width: 200px;
  background-color: #252526;
  color: #d4d4d4;
  border-right: 1px solid #404040;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
  position: relative;
      min-height: 44px;
}

.tab.active {
  background-color: #1e1e1e;
  border-top: 2px solid #0e639c;
}

.tab-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.tab-close {
  margin-left: 8px;
  opacity: 0.7;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 2px;
  min-width: 20px;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.tab-close:hover {
  opacity: 1;
  background-color: rgba(255, 55, 55, 0.3);
}

/* ===== CONTENT AREA ===== */
.content-area {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}


@media (hover: none) and (pointer: coarse) {
  .tab {
    min-height: 44px;
    padding: 0 16px;
  }
  
  .explorer-item {
    min-height: 44px;
  }
  
  .menu-item {
    white-space: nowrap; /* don't break the line */
  }
}
/* ===== TRADING DASHBOARD ===== */
.trading-dashboard {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto 1fr 1fr;
    gap: 20px; /* Increased from 16px */
    height: 100%;
    max-width: 100%;
    padding: 8px; /* Add some padding */
}


.account-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.account-metric {
  text-align: center;
  padding: 12px 8px; /* Reduced horizontal padding */
  background-color: rgba(14, 99, 156, 0.1);
  border-radius: 4px;
  border: 1px solid #404040;
  transition: all 0.15s ease;
  min-height: 80px; /* Ensure minimum height */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.account-metric:hover {
  background-color: rgba(14, 99, 156, 0.15);
}

.metric-value {
  font-size: 16px; /* Reduced from 18px */
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
  line-height: 1.2;
  max-height: 2.4em; /* 2 lines max */
}

.metric-label {
  font-size: 11px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== WIDGETS ===== */
.widget {
    background-color: #252526;
    border: 1px solid #404040;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap:5px;
    width: auto;
}

.widget-header {
  padding: 8px 12px;
  background-color: rgba(60, 60, 60, 0.5);
  border-bottom: 1px solid #404040;
  /* display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0; */
    width: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.widget-title {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  width: auto;
}

.widget-content {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    box-sizing: border-box;
}

/* ===== ENHANCED SEMANTIC ANALYSIS ===== */
.semantic-analysis-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: 100%;
}

.semantic-entity-item {
  padding: 12px;
  margin: 8px 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 4px solid #4CC9F0;
  min-height: 120px; /* Increased for long numbers */
}

.semantic-entity-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

/* Enhanced grid for semantic data display */
.semantic-entity-item > div:nth-child(2) {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px; /* Increased gap */
  font-size: 11px;
  margin-bottom: 8px;
  min-height: 60px; /* Allow vertical expansion */
}

.semantic-entity-item > div:nth-child(2) > div {
  display: flex;
  flex-direction: column;
  min-width: 0; /* Allow shrinking */
  overflow: hidden;
}

.semantic-entity-item > div:nth-child(2) > div > div:first-child {
  opacity: 0.7;
  font-size: 9px;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.semantic-entity-item > div:nth-child(2) > div > div:last-child {
  font-weight: bold;
  font-size: 10px;
  word-break: break-all; /* Break long numbers */
  line-height: 1.2;
  overflow-wrap: anywhere; /* Modern browsers */
}

.entity-analysis-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(76, 201, 240, 0.3);
}

.quantum-geometry {
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(76, 201, 240, 0.1);
  border-radius: 6px;
}

.causal-patterns, .quantum-correlations {
  margin-bottom: 16px;
}

/* ===== CORRELATION NETWORK ===== */


/* ===== PERFORMANCE CONTAINER ===== */
.performance-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: 100%;
}


/* ===== TABLES ===== */
.neuraltrade-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  overflow-x: auto;
  display: block;
}

.neuraltrade-table thead,
.neuraltrade-table tbody,
.neuraltrade-table tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.neuraltrade-table th,
.neuraltrade-table td {
  padding: 4px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(64, 64, 64, 0.3);
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.neuraltrade-table th {
  background-color: #2d2d2d;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.neuraltrade-table tr:hover {
  background-color: rgba(64, 64, 64, 0.1);
}


/* Enhanced Active Signals Styling */
.complete-position-analysis {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.position-item {
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    border-left: 4px solid var(--position-color);
    transition: all 0.3s ease;
}

.position-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(4px);
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.position-symbol {
    font-weight: bold;
    font-size: 16px;
    color: #ffffff;
}

.position-name {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 2px;
}

.position-pl {
    text-align: right;
    font-weight: bold;
    font-size: 14px;
}

.position-qty {
    font-size: 10px;
    opacity: 0.8;
}

.entity-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.entity-data-row {
    background: rgba(255,255,255,0.03);
    padding: 6px;
    border-radius: 4px;
    font-size: 9px;
}

.entity-data-label {
    opacity: 0.7;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.entity-data-value {
    font-weight: bold;
    font-size: 10px;
    margin-top: 2px;
    color: #4CC9F0;
}

.patterns-correlations {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.patterns-section, .correlations-section {
    background: rgba(255,255,255,0.05);
    padding: 8px;
    border-radius: 4px;
}

.section-title {
    font-weight: bold;
    font-size: 9px;
    margin-bottom: 4px;
    color: #FFD166;
}

.pattern-item, .correlation-item {
    background: rgba(255,255,255,0.1);
    padding: 3px 6px;
    margin: 2px 0;
    border-radius: 3px;
    font-size: 8px;
    border-left: 2px solid #06D6A0;
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(76, 201, 240, 0.1);
    border-radius: 4px;
    margin-bottom: 12px;
}

.filter-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Enhanced Performance Widget Styling */
.performance-widget {
    height: 100%;
    width: 100%;
    padding: 1px;
    display: flex;
    flex-direction: column;
}

.performance-metrics {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.performance-metric {
    text-align: center;
    padding: 12px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: var(--metric-bg);
}

.performance-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.metric-value {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
    color: var(--metric-color);
}

.metric-label {
    font-size: 9px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-sublabel {
    font-size: 10px;
    margin-top: 2px;
    color: var(--metric-color);
}

.entity-performance-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.entity-performance-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(76, 201, 240, 0.1);
    border-radius: 4px;
    flex-shrink: 0;
}

.performance-filter-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.performance-filter-select {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ffffff;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 9px;
}

.performance-pagination-info {
    font-size: 9px;
    opacity: 0.8;
}

.performance-pagination-buttons {
    display: flex;
    gap: 3px;
}

.performance-pagination-btn {
    background: #4CC9F0;
    border: none;
    color: #000;
    padding: 3px 6px;
    border-radius: 2px;
    font-size: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.performance-pagination-btn:hover {
    background: #06D6A0;
}

.performance-pagination-btn:disabled {
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.5);
    cursor: not-allowed;
}

.entity-performance-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.entity-performance-item {
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    border-left: 3px solid var(--item-color);
    transition: all 0.2s ease;
}

.entity-performance-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(2px);
}

.entity-performance-header {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    margin-bottom: 4px;
}

.entity-symbol {
    font-weight: bold;
    color: #ffffff;
}

.entity-pl {
    font-weight: bold;
    color: var(--item-color);
}

.entity-metrics {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    font-size: 8px;
}

.entity-metric {
    text-align: center;
    padding: 2px;
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
}

.entity-metric-label {
    opacity: 0.7;
    font-size: 7px;
}

.entity-metric-value {
    font-weight: bold;
    color: #4CC9F0;
}

/* Scrollbar styling for performance list */
.entity-performance-list::-webkit-scrollbar {
    width: 4px;
}

.entity-performance-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.entity-performance-list::-webkit-scrollbar-thumb {
    background: rgba(76, 201, 240, 0.5);
    border-radius: 2px;
}

.entity-performance-list::-webkit-scrollbar-thumb:hover {
    background: rgba(76, 201, 240, 0.8);
}

.filter-select, .filter-input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 10px;
}

.pagination-info {
    font-size: 10px;
    opacity: 0.8;
}

.pagination-buttons {
    display: flex;
    gap: 4px;
}

.pagination-btn {
    background: #4CC9F0;
    border: none;
    color: #000;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 9px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.pagination-btn:hover {
    background: #06D6A0;
}

.pagination-btn:disabled {
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.5);
    cursor: not-allowed;
}
/* ===== TERMINAL - CSS GRID POSITIONED ===== */
.terminal-container {
  grid-row: 3;
  display: flex;
  flex-direction: column;
  background-color: #1e1e1e;
  border-top: 1px solid #404040;
  height: 220px;
  flex-shrink: 0;
  position: relative;
  z-index: 999;
}



.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background-color: #2d2d2d;
  border-bottom: 1px solid #404040;
  height: 30px;
  flex-shrink: 0;
}

.terminal-content {
  flex: 1;
  padding: 8px;
  font-family: 'Consolas', monospace;
  font-size: 12px;
  overflow: auto;
  color: #d4d4d4;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.terminal-line {
  padding: 1px 0;
  line-height: 1.4;
}

.terminal-input {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  border-top: 1px solid #404040;
  height: 30px;
  flex-shrink: 0;
}

.terminal-prompt {
  margin-right: 8px;
  color: #4CC9F0;
  font-weight: bold;
}

.terminal-command {
  flex: 1;
  background: transparent;
  border: none;
  color: #d4d4d4;
  font-family: 'Consolas', monospace;
  font-size: 12px;
  outline: none;
}


/* ===== BUTTONS ===== */
.btn {
  padding: 3px 10px;
  background-color: #4d4d4d;
  color: #e0e0e0;
  border: 1px solid #404040;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  min-height: 2.5em;
  display: inline-flex;
  align-items: center;
  justify-content: center;

}

.btn:hover, .btn:focus {
  background-color: #5f5f5f;
}

.btn-primary {
  background-color: #0e639c;
  color: #ffffff;
  border-color: #0e639c;
}

.btn-primary:hover {
  background-color: #0e7bbd;
}

/* ===== FORMS ===== */
.form-control {
  width: 100%;
  padding: 8px;
  background-color: #3c3c3c;
  color: #cccccc;
  border: 1px solid #6b6b6b;
  border-radius: 3px;
  font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  min-height: 36px;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: #0e639c;
  box-shadow: 0 0 0 2px rgba(14, 99, 156, 0.25);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  font-size: 12px;
}

/* ===== SETTINGS PANELS ===== */
.settings-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 16px;
  padding: 16px;
}

.settings-group {
  background-color: #252526;
  border: 1px solid #404040;
  border-radius: 4px;
  padding: 16px;
}

.settings-title {
  font-size: 16px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #404040;
  font-weight: 600;
}

/* ===== UTILITY CLASSES ===== */
.positive { color: #06D6A0 !important; }
.negative { color: #EF476F !important; }
.neutral { color: #4CC9F0 !important; }
.warning { color: #FFD166 !important; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: #d4d4d4;
  opacity: 0.7;
}

.error-message {
  color: #EF476F;
  padding: 12px;
  text-align: center;
  background-color: rgba(239, 71, 111, 0.1);
  border-radius: 4px;
  border: 1px solid #EF476F;
}

.empty-message {
  color: #d4d4d4;
  opacity: 0.5;
  padding: 16px;
  text-align: center;
  font-style: italic;
}
/* ===== GLOBAL SELECT STYLING ===== */
select,
.form-control select,
.filter-select,
.performance-filter-select {
    background: rgba(60, 60, 60, 0.9) !important;
    border: 1px solid #6b6b6b !important;
    color: #ffffff !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace !important;
    min-height: 36px !important;
    transition: all 0.15s ease !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    
    /* Custom dropdown arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 16px !important;
    padding-right: 32px !important;
}

/* Focus states for all selects */
select:focus,
.form-control select:focus,
.filter-select:focus,
.performance-filter-select:focus {
    outline: none !important;
    border-color: #0e639c !important;
    box-shadow: 0 0 0 2px rgba(14, 99, 156, 0.25) !important;
    background-color: rgba(60, 60, 60, 1) !important;
}

/* Hover states for all selects */
select:hover,
.form-control select:hover,
.filter-select:hover,
.performance-filter-select:hover {
    border-color: #8f8f8f !important;
    background-color: rgba(60, 60, 60, 1) !important;
}

/* Option styling for all selects */
select option,
.form-control select option,
.filter-select option,
.performance-filter-select option {
    background: #3c3c3c !important;
    color: #ffffff !important;
    padding: 8px !important;
    border: none !important;
}

/* Disabled state */
select:disabled,
.form-control select:disabled,
.filter-select:disabled,
.performance-filter-select:disabled {
    background-color: rgba(60, 60, 60, 0.5) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    cursor: not-allowed !important;
    border-color: rgba(107, 107, 107, 0.5) !important;
}
/* ===== SELECT SIZE VARIANTS ===== */
.select-sm {
    font-size: 10px !important;
    padding: 4px 8px !important;
    min-height: 28px !important;
    padding-right: 28px !important;
    background-size: 12px !important;
    background-position: right 6px center !important;
}

.select-lg {
    font-size: 14px !important;
    padding: 12px 16px !important;
    min-height: 44px !important;
    padding-right: 40px !important;
    background-size: 20px !important;
    background-position: right 12px center !important;
}
/* ===== CHART PLACEHOLDERS ===== */
.chart-container {
  width: 100%;
  height: 100%;
  min-height: 350px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: auto;
}

.trade-history{
  text-wrap: pretty;
}
.chart-placeholder {
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
}

.chart-overlay-text {
  font-size: 14px;
  opacity: 0.7;
}
@media (max-width: 480px) {
    .correlation-summary > div:first-child {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .semantic-entity-item > div:nth-child(2) {
    grid-template-columns: 1fr; /* Single column on very small screens */
  }
  
  .account-summary {
    grid-template-columns: 1fr; /* Single column for very small screens */
  }
}

/* Correlation data improvements */
.correlation-data > div {
  display: grid;
  grid-template-columns: 80px 1fr 80px 80px 60px;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(64, 64, 64, 0.3);
  align-items: center;
  min-height: 40px;
}

.correlation-data > div > div:nth-child(2) {
  min-width: 0;
  overflow: hidden;
}

.correlation-data > div > div:nth-child(2) > div {
  line-height: 1.2;
  font-size: 10px;
}

.select-primary {
    border-color: #0e639c !important;
    background-color: rgba(14, 99, 156, 0.1) !important;
}

.select-success {
    border-color: #06d6a0 !important;
    background-color: rgba(6, 214, 160, 0.1) !important;
}

.select-warning {
    border-color: #ffd166 !important;
    background-color: rgba(255, 209, 102, 0.1) !important;
}

.select-danger {
    border-color: #ef476f !important;
    background-color: rgba(239, 71, 111, 0.1) !important;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 767px) {
  .toolbar {
    padding: 0 4px;
    height: 40px;
  }

      select,
    .form-control select,
    .filter-select,
    .performance-filter-select {
        font-size: 14px !important;
        padding: 12px 16px !important;
        min-height: 44px !important;
        padding-right: 40px !important;
        background-size: 18px !important;
        background-position: right 12px center !important;
    }
  


  

  .semantic-analysis-container,
  .performance-container {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
    .trading-dashboard {
        gap: 12px;
        padding: 12px;
        grid-template-columns: 1fr; /* Stack widgets on mobile */
        grid-template-rows: auto repeat(4, 1fr);
    }

  .account-summary {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  /* Mobile-specific terminal feedback */
  .terminal-content .terminal-line {
    font-size: 11px;
  }
  .neuraltrade-table {
    font-size: 10px;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  .neuraltrade-table thead,
  .neuraltrade-table tbody,
  .neuraltrade-table tr {
    display: table;
    width: 100%;
    min-width: 600px;
  }
 
  
  .neuraltrade-table th,
  .neuraltrade-table td {
    padding: 2px 4px;
    font-size: 9px;
    min-width: 40px;
  }
  
  .widget {
    min-height: 300px;
    margin-bottom: 8px;
  }
  

  
  .form-control {
    font-size: 16px;
    min-height: 44px;
  }
  

  
  .terminal-container {
    height: 200px;
  }
  

  
  .metric-value {
    font-size: 16px;
  }
  
  .metric-label {
    font-size: 10px;
  }
  
  .tab {
    min-width: 100px;
    max-width: 150px;
  }
  
  .tab-close {
    min-width: 24px;
    min-height: 24px;
  }

  
  .semantic-entity-item > div:nth-child(2) {
    grid-template-columns: 1fr 1fr; /* 2 columns on mobile */
    gap: 8px;
    font-size: 10px;
  }
  
  .semantic-entity-item > div:nth-child(2) > div > div:last-child {
    font-size: 9px;
  }
  
  #entity-popup {
    max-width: 90vw; /* Responsive popup width */
    min-width: 300px;
    font-size: 11px;
  }
  
  #entity-popup > div:nth-of-type(2) {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 8px;
  }
  
  .quantum-geometry > div:last-child {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 8px;
  }
  
  .account-summary {
    grid-template-columns: 1fr 1fr; /* Keep 2 columns */
    gap: 6px;
  }
  
  .metric-value {
    font-size: 12px; /* Smaller on mobile */
    max-height: 3.6em; /* 3 lines on mobile */
  }
  
  .metric-label {
    font-size: 9px;
  }
}

/* ===== TABLET AND UP ===== */
@media (min-width: 768px) {
  .main-container {
    grid-template-columns: 200px 1fr;
    grid-template-rows: 1fr;
  }
  
  .sidebar {
    grid-column: 1;
    grid-row: 1;
    flex-direction: column;
    width: 200px;
    height: 100%;
    border-right: 1px solid #404040;
    border-bottom: none;
    overflow-y: auto;
    overflow-x: hidden;
  }
  
  .main-content {
    grid-column: 2;
    grid-row: 1;
  }
  
  .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #404040;
  }
  
  .sidebar-header h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
  }
  
  .sidebar-content {
    flex-direction: column;
    padding: 8px;
    gap: 0;
    min-width: auto;
  }
  
  .explorer-item {
    flex-direction: row;
    width: 100%;
    padding: 4px 8px;
    text-align: left;
    min-width: auto;
    font-size: 12px;
  }
  
  .explorer-icon {
    margin-right: 8px;
    margin-bottom: 0;
    width: 16px;
    height: 16px;
  }
  
  .account-summary {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .trading-dashboard {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto 1fr 1fr;
    gap: 16px;
  }
  
  .account-summary {
    grid-column: 1 / -1;
  }
  
  .positions-widget {
    grid-column: 1;
    grid-row: 2 / 4;
  }
  
  .terminal-container {
    height: 200px;
  }
  

  .neuraltrade-table th,
  .neuraltrade-table td {
    padding: 8px;
  }
  
  .neuraltrade-table {
    font-size: 14px;
  }
}

/* ===== DESKTOP AND UP ===== */
@media (min-width: 1024px) {
  .sidebar {
    width: 250px;
  }
  
  .main-container {
    grid-template-columns: 250px 1fr;
  }
  
  .trading-dashboard {
    grid-template-columns: 2fr 1fr 1fr;
  }
  
  .positions-widget {
    grid-column: 1 / 3;
  }
  
  
  .widget {
    min-height: 300px;
  }
}

/* ===== LARGE DESKTOP ===== */
@media (min-width: 1200px) {
  .trading-dashboard {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto repeat(2, 1fr);
  }
  
  .account-summary {
    grid-column: 1 / -1;
  }
  
  .positions-widget {
    grid-column: 1 / 3;
    grid-row: 2 / 4;
  }
  
  .panel-content {
    padding: 24px;
  }
}

/* ===== ACCESSIBILITY ===== */
*:focus-visible {
  outline: 2px solid #0e639c;
  outline-offset: 2px;
}



/* ===== SCROLLBARS ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ===== DYNAMIC VIEWPORT HEIGHT SUPPORT ===== */
@supports (height: 100dvh) {
  .app-container {
    height: 100dvh;
  }
}

/* ===== SAFE AREA SUPPORT FOR iOS ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {


  .app-container {
    padding-bottom: env(safe-area-inset-bottom);
  }
}


/* ===== NEWS MODAL STYLES ===== */
.news-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

@supports not (backdrop-filter: blur(5px)) {
    .news-modal {
        background: rgba(0, 0, 0, 0.95);
    }
}

.news-modal-content {
    background: #1e1e1e;
    border: 2px solid #4CC9F0;
    border-radius: 8px;
    width: 95vw;
    max-width: 1200px;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    margin: 5vh auto;
    position: relative;
}

.news-modal-header {
    padding: 12px 16px;
    background: rgba(76, 201, 240, 0.1);
    border-bottom: 1px solid #404040;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    min-height: 50px;
}

.news-modal-title {
    font-size: 16px;
    font-weight: bold;
    color: #4CC9F0;
    margin: 0;
    flex: 1;
    padding-right: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-modal-close {
    background: #EF476F;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    min-width: 36px;
    min-height: 36px;
}

.news-modal-close:hover,
.news-modal-close:focus {
    background: #ff6b8a;
    transform: scale(1.1);
    outline: none;
}

.news-modal-close:active {
    transform: scale(0.95);
}

.news-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.news-correlation-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    height: 100%;
    min-height: 0;
}

.news-entity-section {
    border: 1px solid #404040;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.news-entity-header {
    padding: 12px 16px;
    background: rgba(76, 201, 240, 0.1);
    border-bottom: 1px solid #404040;
    font-weight: bold;
    color: #4CC9F0;
    flex-shrink: 0;
    font-size: 14px;
}

.news-entity-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
}

.news-article {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 4px solid #FFD166;
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-article:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.news-article-title {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #ffffff;
    line-height: 1.4;
    word-break: break-word;
}

.news-article-title a {
    color: #4CC9F0;
    text-decoration: none;
    transition: color 0.3s ease;
    word-break: break-word;
}

.news-article-title a:hover,
.news-article-title a:focus {
    color: #06D6A0;
    outline: none;
}

.news-article-meta {
    font-size: 10px;
    opacity: 0.7;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.news-article-text {
    font-size: 11px;
    line-height: 1.5;
    opacity: 0.9;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

@media (min-width: 768px) {
    .news-modal-content {
        width: 90vw;
        height: 85vh;
        border-radius: 12px;
        margin: 7.5vh auto;
    }
    
    .news-modal-title {
        font-size: 18px;
    }
    
    .news-modal-body {
        padding: 20px;
    }
    
    .news-correlation-container {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .news-article-title {
        font-size: 14px;
    }
    
    .news-article-meta {
        font-size: 11px;
    }
    
    .news-article-text {
        font-size: 12px;
    }
    
    .news-entity-content {
        padding: 16px;
    }
}

@media (min-width: 1024px) {
    .news-modal-content {
        max-width: 1200px;
    }
}