/*
================================================================================
FlowX - Institutional FinTech & Personal Trading Platform
A Platform of Laskaar Universe - Personal Finance, Trading & Investment Desk
Corporate Compact Standard Stylesheet (v3.5.0-compact)
High-Density Layout with Collapsible Accordion Navigation & Scaled Real-Estate
The Deep Water Foundation with Jupiter Gold Accents & Cyan Metrics
================================================================================
*/

:root {
  --bg-primary: #040812;
  --bg-secondary: #0B132B;
  --bg-sidebar: rgba(7, 13, 29, 0.98);
  --bg-card: rgba(18, 18, 18, 0.9);
  --bg-card-hover: rgba(26, 26, 30, 0.96);
  --bg-glass: rgba(11, 19, 43, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(0, 229, 255, 0.25);
  --border-gold: #FFD700;
  
  --text-primary: #F8F9FA;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-cyan: #00E5FF;
  --accent-gold: #FFD700;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --color-bullish: #10b981;
  --color-bullish-bg: rgba(16, 185, 129, 0.14);
  --color-bearish: #ef4444;
  --color-bearish-bg: rgba(239, 68, 68, 0.14);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.14);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Roboto Mono', Menlo, Consolas, monospace;
  --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 4px 20px rgba(0, 229, 255, 0.04);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --border-color: #e2e8f0;
  --border-accent: rgba(2, 132, 199, 0.3);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --color-bullish: #059669;
  --color-bullish-bg: rgba(5, 150, 105, 0.12);
  --color-bearish: #dc2626;
  --color-bearish-bg: rgba(220, 38, 38, 0.12);
  --shadow-glow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

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

html {
  font-size: 12.5px; /* Compact Corporate Terminal Density */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 1. The Deep Water Foundation */
body, .flowx-body {
  background: linear-gradient(135deg, #0B132B 0%, #040812 100%);
  color: #F8F9FA;
  font-family: var(--font-sans);
  line-height: 1.45;
  overflow-x: hidden;
  font-size: 12.5px;
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* ==========================================================================
   2. HIGH-DENSITY ULTRA-WIDE LAYOUT WITH COMPACT SIDEBAR
   ========================================================================== */
.flowx-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Compact Left Sidebar (235px - Saves 45px Real Estate for Charts) */
.flowx-sidebar {
  width: 235px;
  min-width: 235px;
  max-width: 235px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(0, 229, 255, 0.14);
  display: flex;
  flex-direction: column;
  z-index: 100;
  backdrop-filter: blur(16px);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
  overflow-x: hidden;
}

/* Sidebar Brand Header - Ultra-Modern Corporate Logo Container */
.sidebar-brand {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(4, 8, 18, 0.7);
}

.brand-logo-container {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.14) 0%, rgba(4, 8, 18, 0.95) 100%);
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.18);
  transition: var(--transition);
  overflow: hidden;
  cursor: pointer;
}

.brand-logo-container:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.35);
  transform: scale(1.04);
}

.brand-logo-svg {
  width: 32px;
  height: 32px;
}

.brand-custom-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 6px;
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-title {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: #F8F9FA;
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-tag {
  font-size: 8.5px;
  background: rgba(255, 215, 0, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.brand-private-badge {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent-gold);
  background: rgba(255, 215, 0, 0.08);
  padding: 1px 4px;
  border-radius: 2px;
  width: fit-content;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

/* Status Pill */
.sidebar-status-pill {
  padding: 6px 14px;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 229, 255, 0.04);
}

.status-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   3. COLLAPSIBLE ACCORDION SIDEBAR NAVIGATION
   ========================================================================== */
.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Module Group Container */
.menu-module-group {
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  transition: var(--transition);
}

/* Module Header (Clickable Accordion Trigger) */
.menu-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.02);
}

.menu-module-header:hover {
  background: rgba(0, 229, 255, 0.08);
}

.module-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.module-num {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--accent-cyan);
  font-weight: 700;
  opacity: 0.85;
}

.module-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.module-chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

/* Sub-Modules Container (Hidden by default, expands on click) */
.menu-submodules {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 10px;
  margin-top: 2px;
  margin-bottom: 4px;
  border-left: 2px solid rgba(0, 229, 255, 0.2);
  margin-left: 12px;
}

/* Open State */
.menu-module-group.open .menu-submodules {
  display: flex;
  animation: slideDown 0.18s ease forwards;
}

.menu-module-group.open .module-chevron {
  transform: rotate(90deg);
  color: var(--accent-cyan);
}

.menu-module-group.open .menu-module-header {
  background: rgba(0, 229, 255, 0.05);
}

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

/* Sub-Module Nav Item */
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.2);
  color: var(--accent-cyan);
  transform: translateX(2px);
}

.nav-item.active {
  background: rgba(0, 229, 255, 0.14);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
}

.nav-icon {
  font-size: 13px;
  width: 16px;
  text-align: center;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  font-size: 8.5px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-muted);
}

.nav-badge-pill {
  font-size: 8.5px;
  padding: 1px 5px;
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-cyan);
  border-radius: 8px;
  font-weight: 700;
}

.nav-badge-gold {
  font-size: 8.5px;
  padding: 1px 5px;
  background: rgba(255, 215, 0, 0.18);
  color: var(--accent-gold);
  border-radius: 8px;
  font-weight: 700;
}

/* Sidebar User Profile Card */
.sidebar-user-card {
  padding: 12px 14px 10px 14px;
  border-top: 1px solid var(--border-color);
  background: rgba(4, 8, 18, 0.85);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #00E5FF;
  color: #040812;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.user-name {
  font-size: 12px;
  font-weight: 700;
  color: #F8F9FA;
  line-height: 1.2;
}

.user-role {
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.2;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid #EF4444;
  color: #EF4444;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-logout:hover {
  background: #EF4444;
  border-color: #EF4444;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.sidebar-bottom-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  color: #00E5FF;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.5px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ==========================================================================
   4. ULTRA-WIDE WORKSPACE WITH STRICT RIGHT-BORDER CONTAINMENT
   ========================================================================== */
.flowx-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

.flowx-main-wrapper {
  flex: 1;
  min-width: 0;
  max-width: calc(100vw - 235px);
  width: calc(100% - 235px);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: transparent;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .flowx-main-wrapper {
    max-width: 100vw;
    width: 100%;
  }
}

/* Compact Top Nav Strip (38px) */
.top-nav-strip {
  height: 38px;
  background: rgba(7, 13, 29, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 90;
  max-width: 100%;
  box-sizing: border-box;
}

.ticker-scroll-wrap {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  align-items: center;
  white-space: nowrap;
  min-width: 0;
  scrollbar-width: none; /* Hide scrollbar for clean ticker look */
}

.ticker-scroll-wrap::-webkit-scrollbar {
  display: none;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.ticker-symbol {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 10px;
}

.ticker-val {
  font-weight: 700;
  font-family: var(--font-mono);
  color: #F8F9FA;
}

.ticker-pct {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  flex-shrink: 0;
}

/* Top Bar Broker Status Pill */
.broker-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 3px 8px;
  border-radius: 5px;
  text-decoration: none;
  font-size: 10px;
  color: #F8F9FA;
  transition: var(--transition);
}

.broker-live-pill:hover {
  background: rgba(255, 215, 0, 0.12);
  border-color: var(--accent-gold);
}

.live-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulse 1.8s infinite;
}

.broker-label {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 9.5px;
}

.broker-state {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-gold);
}

.theme-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #F8F9FA;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.theme-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.quick-logout-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10px;
  text-decoration: none;
  font-weight: 600;
}

.quick-logout-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

/* Compact Content Viewport (Strict Edge Containment) */
.content-viewport {
  flex: 1;
  padding: 14px 18px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Page Header Row */
.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.page-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #F8F9FA;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 11.5px;
  margin-top: 2px;
}

/* ==========================================================================
   5. COMPACT CORPORATE CARDS & WIDGET PANELS (Jupiter Gold Accent)
   ========================================================================== */
.flowx-card, .dashboard-panel {
  background-color: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  border-top: 2.5px solid var(--accent-gold); 
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4); 
  padding: 14px 16px;
  backdrop-filter: blur(10px);
  transition: var(--transition);
  position: relative;
}

.flowx-card:hover {
  box-shadow: 0 6px 24px rgba(0, 229, 255, 0.07);
}

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

.card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.card-stat-value {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #F8F9FA;
  letter-spacing: -0.3px;
  margin: 6px 0 3px 0;
}

.card-stat-sub {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   6. HIGH-DENSITY TABLE STYLING & STRICT OVERFLOW CONTAINMENT
   ========================================================================== */
.flowx-table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
  box-sizing: border-box;
  border-radius: 6px;
}

table, .corporate-table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  color: var(--accent-cyan); 
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  padding: 8px 10px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11.5px;
  vertical-align: middle;
}

tbody tr:hover {
  background: rgba(0, 229, 255, 0.04);
}

/* Dense Grids - Edge Bound */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .grid-4, .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   7. COMPACT BUTTONS & BADGES
   ========================================================================== */
.btn-flowx {
  background: linear-gradient(135deg, #00E5FF 0%, #0088cc 100%);
  color: #040812;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 3px 10px rgba(0, 229, 255, 0.2);
}

.btn-flowx:hover {
  background: linear-gradient(135deg, #FFD700 0%, #ffaa00 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 215, 0, 0.3);
  color: #040812;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #F8F9FA;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  transition: var(--transition);
}

.btn-secondary:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.08);
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.badge-bullish {
  background: var(--color-bullish-bg);
  color: var(--color-bullish);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-bearish {
  background: var(--color-bearish-bg);
  color: var(--color-bearish);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.change-up, .color-bullish {
  color: var(--color-bullish);
}

.change-down, .color-bearish {
  color: var(--color-bearish);
}

/* ==========================================================================
   8. COMPACT FOOTER
   ========================================================================== */
.flowx-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(4, 8, 18, 0.6);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   9. ULTRA-PREMIUM TRADING SUITE: GRAPHICS, GAUGES & NEON RISK RATIOS
   ========================================================================== */
.btn-launch-derivatives {
  background: linear-gradient(135deg, #FFB800 0%, #FF8C00 100%);
  color: #000000 !important;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 11.5px;
  box-shadow: 0 4px 15px rgba(255, 184, 0, 0.35);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-launch-derivatives:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 184, 0, 0.55);
  filter: brightness(1.08);
}

.user-top-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 10.5px;
  color: #F8F9FA;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.user-top-pill:hover {
  background: rgba(0, 229, 255, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.kpi-card-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 2px 0;
}

.kpi-sparkline {
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.4));
}

.kpi-sparkline-cyan {
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.4));
}

/* Glowing Neon Cyan Quantitative Risk Ratios Banner */
.risk-ratios-banner {
  background: rgba(10, 22, 45, 0.85);
  border: 1.5px solid #00E5FF;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.18), inset 0 0 15px rgba(0, 229, 255, 0.04);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(14px);
  width: 100%;
  box-sizing: border-box;
}

.risk-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 229, 255, 0.22);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.risk-banner-title {
  font-size: 12px;
  font-weight: 800;
  color: #00E5FF;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

.risk-banner-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.risk-metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  text-align: center;
  align-items: center;
}

.risk-metric-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.risk-metric-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.risk-metric-val {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #F8F9FA;
  line-height: 1.2;
}

.risk-metric-sub {
  font-size: 9.5px;
  color: var(--text-secondary);
  margin-top: 3px;
  font-weight: 500;
}

.risk-gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.risk-gauge-svg {
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.35));
  margin-bottom: 2px;
}

.risk-curve-svg {
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.35));
  margin-bottom: 2px;
}

/* Breakout Cards v2 with inline waveform sparklines */
.breakout-card-v2 {
  background: rgba(10, 20, 42, 0.7);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition);
}

.breakout-card-v2:hover {
  border-color: rgba(0, 229, 255, 0.4);
  background: rgba(13, 26, 54, 0.85);
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.08);
}

.breakout-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breakout-symbol {
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 14px;
  color: #FFFFFF;
}

.breakout-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
  align-items: center;
}

.breakout-catalyst {
  font-size: 10.5px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .risk-metrics-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}
@media (max-width: 600px) {
  .risk-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   10. TRADINGVIEW PRO TERMINAL: TOOLBAR, CANVAS & SNAPQUOTE DEPTH
   ========================================================================== */
.tv-terminal-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.tv-toolbar {
  background: rgba(7, 14, 30, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.tv-tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-select-symbol {
  background: rgba(4, 8, 18, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #F8F9FA;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.tv-select-symbol:hover, .tv-select-symbol:focus {
  border-color: var(--accent-gold);
}

.tv-quick-pills {
  display: flex;
  gap: 4px;
}

.tv-pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.tv-pill-btn:hover {
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.tv-pill-btn.active {
  background: rgba(0, 229, 255, 0.18);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  font-weight: 700;
}

.tv-intervals {
  display: flex;
  gap: 2px;
  background: rgba(4, 8, 18, 0.7);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tv-interval-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 10.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.tv-interval-btn:hover {
  color: #F8F9FA;
  background: rgba(255, 255, 255, 0.06);
}

.tv-interval-btn.active {
  background: rgba(0, 229, 255, 0.18);
  color: #00E5FF;
  font-weight: 700;
}

.tv-tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #F8F9FA;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.tv-tool-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.tv-indicators-menu {
  position: relative;
}

.tv-indicators-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: rgba(7, 14, 30, 0.98);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.tv-indicators-dropdown label {
  font-size: 11px;
  color: #F8F9FA;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tv-select-small {
  background: rgba(4, 8, 18, 0.8);
  border: 1px solid var(--border-color);
  color: #F8F9FA;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
}

.tv-engine-toggle {
  display: flex;
  background: rgba(4, 8, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 2px;
}

.tv-engine-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.tv-engine-btn.active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 140, 0, 0.2));
  color: var(--accent-gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
  font-weight: 700;
}

.tv-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 9.5px;
  font-family: var(--font-mono);
}

.tv-sub-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: rgba(10, 20, 42, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: var(--font-mono);
}

.tv-symbol-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-symbol-header {
  font-size: 14px;
  font-weight: 800;
  color: #FFFFFF;
}

.tv-exchange-badge {
  background: rgba(0, 229, 255, 0.12);
  color: #00E5FF;
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
}

.tv-active-ltp {
  font-size: 14px;
  font-weight: 800;
  color: #F8F9FA;
}

.tv-ohlc-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
}

.tv-main-grid {
  display: grid;
  grid-template-columns: 40px 1fr 290px;
  gap: 8px;
  width: 100%;
}

.tv-drawing-toolbar {
  background: rgba(7, 14, 30, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
}

.tv-draw-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.tv-draw-btn:hover {
  background: rgba(0, 229, 255, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.tv-draw-btn.active {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.tv-chart-viewport {
  background: #040812;
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  min-height: 600px;
}

.tv-snapquote-sidebar {
  background: rgba(7, 14, 30, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--font-mono);
}

.tv-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  padding-bottom: 6px;
}

.tv-btn-sync {
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #00E5FF;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 6px;
  cursor: pointer;
  transition: var(--transition);
}

.tv-btn-sync:hover {
  background: #00E5FF;
  color: #040812;
}

.tv-depth-box {
  background: rgba(4, 8, 18, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px;
}

.tv-depth-headers {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 4px;
}

.tv-depth-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.tv-depth-table th {
  padding: 3px 2px;
  font-size: 8.5px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}

.tv-depth-table td {
  padding: 3px 2px;
  font-size: 9.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.tv-depth-meter-wrap {
  margin-top: 6px;
}

.tv-depth-meter-bar {
  display: flex;
  width: 100%;
  border-radius: 2px;
  overflow: hidden;
}

.tv-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tv-metric-item {
  background: rgba(4, 8, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tv-m-label {
  font-size: 8.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.tv-m-val {
  font-size: 11px;
  font-weight: 700;
  color: #F8F9FA;
}

.tv-db-status-card {
  background: rgba(0, 229, 255, 0.04);
  border: 1px dashed rgba(0, 229, 255, 0.25);
  border-radius: 6px;
  padding: 8px;
}

@media (max-width: 1100px) {
  .tv-main-grid {
    grid-template-columns: 40px 1fr;
  }
  .tv-snapquote-sidebar {
    grid-column: span 2;
  }
}
