/* ==========================================================================
   AutoNex Trade — Next-Gen Obsidian Cyber FinTech Trading Terminal
   Design System: Midnight Carbon (#06080E), Laser Emerald (#00F59B), Ruby (#FF3366), Electric Cyan (#00F0FF)
   ========================================================================== */

:root {
  /* Theme Backgrounds */
  --bg-main: #06080E;
  --bg-sidebar: #090D15;
  --bg-card: #0D131F;
  --bg-card-hover: #131B2C;
  --bg-input: #101624;
  --bg-elevated: #162034;
  
  /* Borders & Accents */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(0, 240, 255, 0.16);
  --border-focus: #00F0FF;
  
  /* Vibrant Indicators */
  --green: #00F59B;
  --green-glow: rgba(0, 245, 155, 0.22);
  --green-dark: #008744;
  --red: #FF3366;
  --red-glow: rgba(255, 51, 102, 0.22);
  --red-dark: #990026;
  
  --cyan: #00F0FF;
  --blue: #3B82F6;
  --purple: #A855F7;
  --yellow: #FBBF24;
  
  /* Typography */
  --text-main: #FFFFFF;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Geometry & Shadows */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 20px rgba(0, 240, 255, 0.2);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ==========================================================================
   Theme Systems: Light Mode, Dark Pro, Midnight OLED, Matrix Emerald
   ========================================================================== */
body.theme-light {
  --bg-main: #F4F6FB;
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-input: #FFFFFF;
  --bg-elevated: #F1F5F9;
  
  --border-subtle: #E2E8F0;
  --border-card: #CBD5E1;
  --border-focus: #2563EB;
  
  --green: #089981;
  --green-glow: rgba(8, 153, 129, 0.15);
  --red: #F23645;
  --red-glow: rgba(242, 54, 69, 0.15);
  
  --cyan: #0284C7;
  --blue: #2563EB;
  --purple: #7C3AED;
  --yellow: #D97706;
  
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-dim: #64748B;
  
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Base Body Light Mode */
body.theme-light {
  background-color: var(--bg-main) !important;
  background-image: none !important;
  color: var(--text-main) !important;
}

/* Light Mode Global Text Visibility Overrides */
body.theme-light .text-white {
  color: #0F172A !important;
}

body.theme-light .text-muted {
  color: #475569 !important;
}

body.theme-light .text-dim {
  color: #64748B !important;
}

body.theme-light .card-title,
body.theme-light .view-title,
body.theme-light .brand-title,
body.theme-light .tv-cell-symbol,
body.theme-light .tv-active-sym,
body.theme-light .tv-theme-title,
body.theme-light .metric-value,
body.theme-light .sidebar-balance-value,
body.theme-light .stock-symbol,
body.theme-light .stock-ltp {
  color: #0F172A !important;
}

body.theme-light .view-subtitle,
body.theme-light .brand-tagline,
body.theme-light .metric-label,
body.theme-light .stock-meta,
body.theme-light .tv-stat-title {
  color: #64748B !important;
}

/* Light Mode Core Structural Containers */
body.theme-light .top-navbar,
body.theme-light .left-sidebar,
body.theme-light .sidebar-rail,
body.theme-light .card-panel,
body.theme-light .tv-terminal-container,
body.theme-light .tv-chart-cell,
body.theme-light .tv-top-toolbar,
body.theme-light .tv-drawing-toolbar,
body.theme-light .tv-right-sidebar,
body.theme-light .tv-bottom-bar,
body.theme-light .tv-bottom-dock,
body.theme-light .tv-dock-tabs-bar,
body.theme-light .tv-dock-content,
body.theme-light .tv-cell-header,
body.theme-light .modal-content-card,
body.theme-light .metric-card,
body.theme-light .sidebar-widget-card,
body.theme-light .dashboard-hero-header {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border-color: #E2E8F0 !important;
}

body.theme-light .top-navbar {
  border-bottom: 1px solid #E2E8F0 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

body.theme-light .sidebar-rail {
  border-right: 1px solid #E2E8F0 !important;
  background: #FFFFFF !important;
}

/* Left Sidebar Navigation & Widgets in Light Mode */
body.theme-light .sidebar-item {
  color: #475569 !important;
}

body.theme-light .sidebar-item:hover {
  color: #0F172A !important;
  background: #F1F5F9 !important;
}

body.theme-light .sidebar-item.active {
  color: #2563EB !important;
  background: #EFF6FF !important;
  border-left: 3px solid #2563EB !important;
}

body.theme-light .sidebar-item svg {
  stroke: #64748B !important;
}

body.theme-light .sidebar-item.active svg {
  stroke: #2563EB !important;
}

body.theme-light .sidebar-widget-card {
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
}

body.theme-light .sidebar-profit-badge {
  background: rgba(8, 153, 129, 0.12) !important;
  border: 1px solid rgba(8, 153, 129, 0.25) !important;
}

body.theme-light .sidebar-market-pulse {
  background: #F1F5F9 !important;
  border: 1px solid #E2E8F0 !important;
  color: #475569 !important;
}

/* Inputs, Textareas, Selects & Forms in Light Mode */
body.theme-light .tv-dark-input,
body.theme-light .tv-dark-select,
body.theme-light .custom-input,
body.theme-light .search-input,
body.theme-light .input-num,
body.theme-light .auth-input-sm,
body.theme-light input[type="text"],
body.theme-light input[type="number"],
body.theme-light input[type="password"],
body.theme-light select,
body.theme-light textarea {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid #CBD5E1 !important;
}

body.theme-light .tv-dark-input:focus,
body.theme-light .tv-dark-select:focus,
body.theme-light .custom-input:focus,
body.theme-light .search-input:focus,
body.theme-light .input-num:focus,
body.theme-light .auth-input-sm:focus,
body.theme-light input:focus,
body.theme-light select:focus,
body.theme-light textarea:focus {
  border-color: #2563EB !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
  outline: none !important;
}

/* Navigation & Header Pills / Buttons */
body.theme-light .nav-search-bar {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
}

body.theme-light .market-type-switcher {
  background: #F1F5F9 !important;
  border: 1px solid #E2E8F0 !important;
}

body.theme-light .market-type-btn {
  color: #475569 !important;
  background: transparent !important;
}

body.theme-light .market-type-btn.active {
  background: #FFFFFF !important;
  color: #2563EB !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

body.theme-light .funds-pill-btn {
  background: #F0FDF4 !important;
  border: 1px solid #BBF7D0 !important;
  color: #15803D !important;
}

body.theme-light .ai-pulse-btn {
  background: #FAF5FF !important;
  border: 1px solid #E9D5FF !important;
  color: #7E22CE !important;
}

body.theme-light .broker-status-pill {
  background: #EFF6FF !important;
  border: 1px solid #BFDBFE !important;
  color: #1D4ED8 !important;
}

body.theme-light .btn-icon {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  color: #334155 !important;
}

body.theme-light .btn-icon:hover {
  background: #E2E8F0 !important;
  color: #0F172A !important;
}

body.theme-light .user-profile-badge {
  background: #F8FAFC !important;
  border: 1px solid #CBD5E1 !important;
}

body.theme-light .user-dropdown-menu {
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
  color: #0F172A !important;
}

/* TradingView Multi-Chart Header & Tools in Light Mode */
body.theme-light .tv-symbol-dropdown {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
}

body.theme-light .tv-tf-btn,
body.theme-light .tv-tool-link,
body.theme-light .tv-layout-btn,
body.theme-light .tv-tool-btn,
body.theme-light .tv-range-btn,
body.theme-light .tv-scale-opt,
body.theme-light .tv-dock-tab,
body.theme-light .tab-btn-sm {
  color: #475569 !important;
}

body.theme-light .tv-tf-btn:hover,
body.theme-light .tv-tool-link:hover,
body.theme-light .tv-layout-btn:hover,
body.theme-light .tv-tool-btn:hover,
body.theme-light .tv-range-btn:hover,
body.theme-light .tv-scale-opt:hover,
body.theme-light .tab-btn-sm:hover {
  color: #0F172A !important;
  background: #F1F5F9 !important;
}

body.theme-light .tv-tf-btn.active,
body.theme-light .tv-layout-btn.active,
body.theme-light .tv-tool-btn.active,
body.theme-light .tv-range-btn.active,
body.theme-light .tv-scale-opt.active,
body.theme-light .tab-btn-sm.active {
  color: #2563EB !important;
  background: #EFF6FF !important;
  border-color: #BFDBFE !important;
}

body.theme-light .tv-dock-tab.active {
  color: #2563EB !important;
  background: #FFFFFF !important;
  border-top: 2px solid #2563EB !important;
  font-weight: 700 !important;
}

body.theme-light .tv-publish-btn {
  background: #2563EB !important;
  color: #FFFFFF !important;
}

body.theme-light .tv-quick-spread-group {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
}

body.theme-light .tv-spread-qty {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid #CBD5E1 !important;
}

body.theme-light .tv-spread-btn.sell {
  background: rgba(242, 54, 69, 0.1) !important;
  color: #DC2626 !important;
  border: 1px solid rgba(242, 54, 69, 0.3) !important;
}

body.theme-light .tv-spread-btn.buy {
  background: rgba(8, 153, 129, 0.1) !important;
  color: #059669 !important;
  border: 1px solid rgba(8, 153, 129, 0.3) !important;
}

body.theme-light .tv-cell-ribbon-sub {
  background: #F8FAFC !important;
  border-bottom: 1px solid #E2E8F0 !important;
  color: #2563EB !important;
}

body.theme-light .tv-chart-cell.active-focus {
  border-color: #2563EB !important;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.2) !important;
}

body.theme-light .tv-right-sidebar-btn {
  color: #64748B !important;
}

body.theme-light .tv-right-sidebar-btn:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}

body.theme-light .tv-right-sidebar-btn.active {
  background: #EFF6FF !important;
  color: #2563EB !important;
}

body.theme-light .tv-right-drawer {
  background: #FFFFFF !important;
  border-left: 1px solid #E2E8F0 !important;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08) !important;
  color: #0F172A !important;
}

body.theme-light .tv-drawer-header {
  background: #F8FAFC !important;
  border-bottom: 1px solid #E2E8F0 !important;
  color: #0F172A !important;
}

body.theme-light .tv-drawer-item {
  border-bottom: 1px solid #F1F5F9 !important;
  color: #0F172A !important;
}

body.theme-light .tv-drawer-item:hover {
  background: #F8FAFC !important;
}

/* Replay Bar in Light Mode */
body.theme-light .tv-replay-toolbar {
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12) !important;
}

body.theme-light .tv-replay-badge {
  color: #2563EB !important;
}

body.theme-light .tv-replay-btn {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
}

body.theme-light .tv-replay-btn:hover {
  background: #E2E8F0 !important;
  border-color: #2563EB !important;
  color: #2563EB !important;
}

body.theme-light .tv-replay-select {
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
}

/* Light Mode Tables & Data Rows (Clean & Readable) */
body.theme-light .data-table {
  background: #FFFFFF !important;
}

body.theme-light .data-table th {
  background: #F8FAFC !important;
  color: #334155 !important;
  font-weight: 700 !important;
  border-bottom: 2px solid #E2E8F0 !important;
}

body.theme-light .data-table td {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border-bottom: 1px solid #F1F5F9 !important;
}

body.theme-light .data-table tr:hover td {
  background: #F8FAFC !important;
}

body.theme-light .stock-item-row {
  border-bottom: 1px solid #F1F5F9 !important;
}

body.theme-light .stock-item-row:hover {
  background: #F8FAFC !important;
}

/* Funds & Bank Withdrawal Hub in Light Mode */
body.theme-light .fund-card {
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
  color: #0F172A !important;
}

body.theme-light .fund-card.primary-gradient {
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE) !important;
  border: 1px solid #BFDBFE !important;
}

body.theme-light .fund-card.profit-gradient {
  background: linear-gradient(135deg, #F0FDF4, #DCFCE7) !important;
  border: 1px solid #BBF7D0 !important;
}

body.theme-light .bank-details-card {
  background: #F8FAFC !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
}

body.theme-light .fund-action-box {
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
  color: #0F172A !important;
}

body.theme-light .margin-charges-box {
  background: #F1F5F9 !important;
  border: 1px solid #E2E8F0 !important;
  color: #475569 !important;
}

body.theme-light .pill-select-group {
  background: #E2E8F0 !important;
  border: 1px solid #CBD5E1 !important;
}

body.theme-light .pill-opt {
  color: #475569 !important;
}

body.theme-light .pill-opt.active {
  background: #FFFFFF !important;
  color: #2563EB !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

body.theme-light .history-payout-row,
body.theme-light .deposit-item-row {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  color: #0F172A !important;
}

/* AI Copilot & Signals in Light Mode */
body.theme-light .dash-signals-container {
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
}

body.theme-light .ai-settings-card,
body.theme-light .ai-feature-card,
body.theme-light .ai-rule-item {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  color: #0F172A !important;
}

body.theme-light .ai-log-entry {
  background: #F1F5F9 !important;
  border: 1px solid #E2E8F0 !important;
  color: #334155 !important;
}

body.theme-light .ai-chat-bubble.bot {
  background: #FAF5FF !important;
  border: 1px solid #E9D5FF !important;
  color: #581C87 !important;
}

body.theme-light .ai-chat-bubble.user {
  background: #EFF6FF !important;
  border: 1px solid #BFDBFE !important;
  color: #1E3A8A !important;
}

/* Broker Gateway in Light Mode */
body.theme-light .broker-mode-card,
body.theme-light .broker-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  color: #0F172A !important;
}

body.theme-light .broker-mode-card:hover,
body.theme-light .broker-card:hover {
  border-color: #2563EB !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08) !important;
}

body.theme-light .broker-mode-card.active,
body.theme-light .broker-card.connected {
  background: #EFF6FF !important;
  border-color: #2563EB !important;
}

/* Option Chain Matrix in Light Mode */
body.theme-light .option-chain-table th {
  background: #F1F5F9 !important;
  color: #334155 !important;
  border-bottom: 2px solid #CBD5E1 !important;
}

body.theme-light .option-chain-table td {
  color: #0F172A !important;
  border-bottom: 1px solid #F1F5F9 !important;
}

body.theme-light .option-call-col {
  background: rgba(8, 153, 129, 0.04) !important;
}

body.theme-light .option-put-col {
  background: rgba(242, 54, 69, 0.04) !important;
}

body.theme-light .option-strike-col {
  background: #F8FAFC !important;
  color: #0F172A !important;
  font-weight: 800 !important;
}

body.theme-light .atm-strike-row {
  background: rgba(37, 99, 235, 0.1) !important;
}

/* Excel Database Hub in Light Mode */
body.theme-light .excel-sheet-table th {
  background: #F0FDF4 !important;
  color: #166534 !important;
  border: 1px solid #BBF7D0 !important;
}

body.theme-light .excel-sheet-table td {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid #E2E8F0 !important;
}

body.theme-light .excel-toolbar {
  background: #F8FAFC !important;
  border: 1px solid #CBD5E1 !important;
}

/* Modals & Dialogs in Light Mode */
body.theme-light .modal-overlay {
  background: rgba(15, 23, 42, 0.45) !important;
}

body.theme-light .modal-content-card {
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16) !important;
  color: #0F172A !important;
}

body.theme-light .card-panel-header {
  background: #F8FAFC !important;
  border-bottom: 1px solid #E2E8F0 !important;
  color: #0F172A !important;
}

/* Login Auth Portal in Light Mode */
body.theme-light .auth-portal-overlay {
  background: radial-gradient(circle at 50% 25%, #E2E8F0 0%, #CBD5E1 85%) !important;
}

body.theme-light .small-login-card {
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
  color: #0F172A !important;
}

body.theme-light .auth-input-sm {
  background: #F8FAFC !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
}

body.theme-light .auth-tagline-sm {
  color: #64748B !important;
}

body.theme-light .toast {
  background: #FFFFFF !important;
  color: #0F172A !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
  border: 1px solid #CBD5E1 !important;
}

/* Midnight High Contrast OLED */
body.theme-midnight {
  --bg-main: #000000;
  --bg-sidebar: #040404;
  --bg-card: #080808;
  --bg-input: #0c0c0c;
  --border-subtle: rgba(255, 255, 255, 0.12);
}

body {
  background-color: var(--bg-main);
  background-image: radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.04) 0%, transparent 60%);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 11.5px;
  line-height: 1.4;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Typography & Colors */
.mono { 
  font-family: var(--font-mono); 
  font-variant-numeric: tabular-nums; 
}
.text-green { color: var(--green) !important; }
.text-red { color: var(--red) !important; }
.text-cyan { color: var(--cyan) !important; }
.text-blue { color: var(--blue) !important; }
.text-purple { color: var(--purple) !important; }
.text-yellow { color: var(--yellow) !important; }
.text-white { color: #FFFFFF !important; }
.text-muted { color: var(--text-muted) !important; }
.text-bold { font-weight: 700; }

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.45);
}

/* ==========================================================================
   Clean & Small Login Modal Overlay
   ========================================================================== */
.auth-portal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 25%, #0B111D 0%, #04060A 85%);
  backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}

.auth-portal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-backdrop-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  height: 320px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.14) 0%, rgba(59, 130, 246, 0.05) 50%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
}

.small-login-card {
  position: relative;
  background: rgba(13, 19, 31, 0.94);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 16px;
  width: 100%;
  max-width: 350px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 240, 255, 0.1);
  padding: 24px 22px;
  backdrop-filter: blur(20px);
  animation: authCardZoom 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardZoom {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-header-compact {
  text-align: center;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-icon-sm {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00F0FF, #00F59B);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.35);
}

.auth-tagline-sm {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.auth-form-compact {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row-sm {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-label-sm {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.input-with-icon-sm {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon-sm {
  position: absolute;
  left: 10px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0.7;
}

.auth-input-sm {
  width: 100%;
  height: 38px;
  background: rgba(16, 22, 36, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: #FFFFFF;
  padding: 0 34px;
  font-size: 12.5px;
  transition: var(--transition);
}

.auth-input-sm:focus {
  border-color: #00F0FF;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
  background: rgba(20, 28, 46, 1);
  outline: none;
}

.btn-toggle-pw-sm {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  opacity: 0.7;
}

.btn-signin-sm {
  height: 40px;
  width: 100%;
  margin-top: 4px;
  background: linear-gradient(135deg, #00F59B, #00C853);
  color: #06080E;
  font-weight: 700;
  font-size: 13px;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 245, 155, 0.35);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-signin-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 245, 155, 0.5);
}

.login-footer-security {
  text-align: center;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px;
  color: var(--text-dim);
}

/* ==========================================================================
   Master App Container Layout
   ========================================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Top Navigation Bar (Sleek Compact Pro FinTech Bar) */
.top-navbar {
  height: 44px;
  background: rgba(9, 13, 21, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 8px;
  z-index: 50;
  flex-shrink: 0;
}

.nav-brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-icon {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #00F0FF, #3B82F6);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
  flex-shrink: 0;
}

.brand-icon svg {
  width: 14px;
  height: 14px;
}

.brand-title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: #FFFFFF;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-tagline {
  font-size: 8px;
  color: var(--text-dim);
  display: block;
  line-height: 1;
  white-space: nowrap;
}

/* Market Switcher */
.market-type-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 2px;
  height: 28px;
  flex-shrink: 0;
}

.market-type-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 0 7px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap !important;
  transition: var(--transition);
}

.market-type-btn.active {
  background: rgba(0, 240, 255, 0.16);
  color: #00F0FF;
}

/* Global Search */
.nav-search-bar {
  position: relative;
  flex: 1;
  max-width: 200px;
  height: 28px;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  height: 28px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 0 26px 0 24px;
  color: var(--text-main);
  font-size: 10.5px;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

.search-icon-left {
  position: absolute;
  left: 7px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-shortcut {
  position: absolute;
  right: 5px;
  font-size: 8px;
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--text-muted);
}

/* Indices Ticker Header */
.indices-ticker-group {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.index-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  padding: 0 7px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  white-space: nowrap !important;
  flex-shrink: 0;
}

.index-name {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.index-val {
  font-size: 10px;
  font-weight: 700;
}

/* Nav Actions Right */
.nav-actions-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.funds-pill-btn {
  background: linear-gradient(135deg, rgba(0, 245, 155, 0.12), rgba(0, 200, 83, 0.08));
  border: 1px solid rgba(0, 245, 155, 0.35);
  color: var(--green);
  padding: 0 8px;
  height: 28px;
  border-radius: 14px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap !important;
  transition: var(--transition);
}

.funds-pill-btn:hover {
  background: rgba(0, 245, 155, 0.2);
  box-shadow: 0 0 10px rgba(0, 245, 155, 0.3);
}

.ai-pulse-btn {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(0, 240, 255, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #D8B4FE;
  padding: 0 8px;
  height: 28px;
  border-radius: 14px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap !important;
  transition: var(--transition);
}

.ai-pulse-btn:hover {
  border-color: #00F0FF;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}

.ai-pulse-orb {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #A855F7;
  flex-shrink: 0;
}

.ai-pulse-orb.active {
  background: #00F59B;
  box-shadow: 0 0 6px #00F59B;
  animation: pulseGreen 1.5s infinite;
}

.broker-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  height: 28px;
  border-radius: 14px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #00F0FF;
  cursor: pointer;
  white-space: nowrap !important;
  flex-shrink: 0;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #00F59B;
  box-shadow: 0 0 5px #00F59B;
  flex-shrink: 0;
}

.view-toggle-btn, .btn-icon {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

.view-toggle-btn:hover, .btn-icon:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.09);
}

/* User Profile Badge */
.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px 0 3px;
  height: 28px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  white-space: nowrap !important;
  transition: var(--transition);
  flex-shrink: 0;
}

.user-profile-badge:hover {
  border-color: var(--cyan);
}

.avatar-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00F0FF, #3B82F6);
  color: #06080E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 10px;
  flex-shrink: 0;
}

.user-dropdown-menu {
  position: absolute;
  top: 110%;
  right: 0;
  width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: var(--shadow-card);
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.user-dropdown-menu.open {
  display: flex;
}

/* ==========================================================================
   App Body & Enhanced Multi-View Architecture
   ========================================================================== */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  height: calc(100vh - 48px);
}

/* Enhanced Sidebar (Compact FinTech Pro Rail) */
.sidebar-rail {
  width: 185px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 6px;
  gap: 8px;
  flex-shrink: 0;
  z-index: 40;
  overflow-y: auto;
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-item {
  width: 100%;
  height: 32px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 0 9px;
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  gap: 8px;
  transition: var(--transition);
  position: relative;
}

.sidebar-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.sidebar-item span {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.sidebar-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-item.active {
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.12);
  border-left: 2.5px solid var(--cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
  font-weight: 600;
}

.sidebar-tag {
  font-size: 8px;
  font-weight: 700;
  background: rgba(179, 136, 255, 0.2);
  color: #B388FF;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: auto;
}

/* Space-Filling Sidebar Bottom Telemetry Widgets */
.sidebar-bottom-widgets {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

.sidebar-widget-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition);
}

.sidebar-widget-card:hover {
  border-color: var(--border-card);
  transform: translateY(-1px);
}

.ai-glow-card {
  background: linear-gradient(135deg, rgba(179, 136, 255, 0.08) 0%, rgba(13, 19, 31, 0.95) 100%);
  border-color: rgba(179, 136, 255, 0.3);
}

.funds-summary-card {
  background: linear-gradient(135deg, rgba(0, 245, 155, 0.06) 0%, rgba(13, 19, 31, 0.95) 100%);
  border-color: rgba(0, 245, 155, 0.25);
  cursor: pointer;
}

.sidebar-widget-card .widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-widget-card .widget-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-main);
}

.sidebar-widget-card .widget-body {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
}

.sidebar-balance-value {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
}

.sidebar-profit-badge {
  font-size: 10px;
}

.sidebar-market-pulse {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 9px;
  padding: 3px 5px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

.sidebar-market-pulse .pulse-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Dynamic Views Wrapper */
.views-wrapper {
  flex: 1;
  overflow-y: auto;
  position: relative;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
}

.view-panel {
  display: none;
  width: 100%;
  height: 100%;
  padding: 10px;
  flex-direction: column;
  gap: 10px;
}

.view-panel.active {
  display: flex;
  animation: fadeIn 0.2s ease-in-out;
}

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

/* View 1: Executive Dashboard Styling (Compact & High-Density) */
.dashboard-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.08) 0%, rgba(13, 19, 31, 0.8) 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
}

.dashboard-hero-header .view-title {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
}

.dashboard-hero-header .view-subtitle {
  font-size: 10.5px;
}

.dashboard-top-actions {
  display: flex;
  gap: 6px;
}

.dashboard-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.metric-card:hover {
  border-color: var(--border-card);
  transform: translateY(-1px);
}

.metric-card .metric-label {
  font-size: 9.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.metric-card .metric-value {
  font-size: 17px;
  font-weight: 800;
}

.metric-card .metric-sub {
  font-size: 9.5px;
}

.badge-growth {
  background: rgba(0, 245, 155, 0.15);
  color: var(--green);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.dashboard-main-split {
  display: flex;
  gap: 12px;
  flex: 1;
}

.dashboard-movers-table-wrapper {
  overflow-y: auto;
  flex: 1;
}

.dash-signals-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
  max-height: 450px;
}

.dash-signal-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.dash-signal-item:hover {
  border-color: rgba(179, 136, 255, 0.4);
}

/* Pro Workspace 3-Column Grid inside Trade Desk View */
.workspace-grid {
  display: grid;
  grid-template-columns: 260px 1fr 310px;
  grid-template-rows: minmax(360px, 1fr) auto;
  gap: 10px;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: var(--bg-main);
}

.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}

.card-panel:hover {
  border-color: rgba(0, 240, 255, 0.2);
}

.card-panel-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.015);
}

.card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #FFFFFF;
}

.tab-bar-sm {
  display: flex;
  gap: 2px;
  background: var(--bg-input);
  padding: 2px;
  border-radius: 4px;
}

.tab-btn-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 3px;
  cursor: pointer;
}

.tab-btn-sm.active {
  background: rgba(0, 240, 255, 0.18);
  color: #00F0FF;
}

/* ==========================================================================
   Watchlist Panel (Left)
   ========================================================================== */
.panel-marketwatch {
  grid-column: 1;
  grid-row: 1;
  height: 100%;
}

.stock-list {
  flex: 1;
  overflow-y: auto;
}

.stock-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.15s ease;
}

.stock-item-row:hover {
  background: var(--bg-card-hover);
  border-left: 3px solid var(--cyan);
  padding-left: 9px;
}

.stock-symbol {
  font-size: 12.5px;
  font-weight: 700;
  color: #FFFFFF;
}

.stock-meta {
  font-size: 10px;
  color: var(--text-dim);
}

.stock-price-col {
  text-align: right;
}

.stock-ltp {
  font-size: 12.5px;
  font-weight: 700;
}

.stock-chg-badge {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 3px;
  display: inline-block;
  margin-top: 2px;
  font-weight: 600;
}

.stock-chg-badge.green {
  background: rgba(0, 245, 155, 0.15);
  color: var(--green);
}

.stock-chg-badge.red {
  background: rgba(255, 51, 102, 0.15);
  color: var(--red);
}

/* ==========================================================================
   Chart Panel (Center)
   ========================================================================== */
.panel-chart {
  grid-column: 2;
  grid-row: 1;
  position: relative;
}

.chart-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.chart-symbol-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.symbol-name-lg {
  font-size: 16px;
  font-weight: 800;
  color: #FFFFFF;
}

.symbol-exchange-tag {
  font-size: 9.5px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

.chart-timeframe-group {
  display: flex;
  gap: 2px;
  background: var(--bg-input);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.tf-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.tf-btn.active, .tf-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  color: #00F0FF;
}

.chart-canvas-wrapper {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
}

/* ==========================================================================
   Order Execution & Depth Panel (Right)
   ========================================================================== */
.panel-order {
  grid-column: 3;
  grid-row: 1;
}

.side-toggle-group {
  display: flex;
  padding: 10px 12px;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.side-toggle-btn {
  flex: 1;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  transition: var(--transition);
}

.side-toggle-btn.buy.active {
  background: linear-gradient(135deg, #00F59B, #00C853);
  color: #06080E;
  box-shadow: 0 0 16px rgba(0, 245, 155, 0.4);
}

.side-toggle-btn.sell.active {
  background: linear-gradient(135deg, #FF3366, #D50000);
  color: #FFFFFF;
  box-shadow: 0 0 16px rgba(255, 51, 102, 0.4);
}

.order-form-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group-label {
  font-size: 10.5px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 4px;
}

.pill-group {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  padding: 2px;
  border-radius: var(--radius-sm);
}.pill-opt {
  flex: 1;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 0;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
}

.pill-opt.active {
  background: rgba(0, 240, 255, 0.16);
  color: #00F0FF;
}

.input-num-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-num {
  width: 100%;
  height: 28px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: #FFFFFF;
  padding: 0 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  outline: none;
}

.input-num:focus {
  border-color: var(--cyan);
}

.margin-info-box {
  background: rgba(0, 240, 255, 0.04);
  border: 1px dashed rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
}

.btn-place-order {
  height: 32px;
  width: 100%;
  background: linear-gradient(135deg, #00F59B, #00C853);
  color: #06080E;
  font-weight: 800;
  font-size: 11.5px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 245, 155, 0.3);
  transition: all 0.2s;
}

.btn-place-order:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 245, 155, 0.45);
}

/* Market Depth Table */
.market-depth-container {
  padding: 6px 10px;
  border-top: 1px solid var(--border-subtle);
}

.depth-table {
  width: 100%;
  font-size: 10px;
  font-family: var(--font-mono);
  border-collapse: collapse;
}

.depth-table th {
  color: var(--text-dim);
  font-weight: 600;
  padding-bottom: 3px;
  font-size: 9px;
}

.depth-table td {
  padding: 1.5px 0;
}

/* ==========================================================================
   Bottom Tabbed Dock Panel
   ========================================================================== */
.panel-bottom-dock {
  grid-column: 1 / span 3;
  grid-row: 2;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 8px;
  min-height: 180px;
}

.portfolio-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.portfolio-chart-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.portfolio-metrics-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.metric-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
}

.dock-tables-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-responsive {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 180px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
  text-align: left;
}

.data-table th {
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 9.5px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.ai-decisions-table {
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.ai-decisions-table th {
  position: sticky;
  top: 0;
  background: #0B101B;
  z-index: 2;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-card);
  font-size: 10px;
  color: #94A3B8;
}

.ai-decisions-table td {
  padding: 8px 10px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ai-rationale-cell {
  white-space: normal !important;
  word-break: break-word;
  line-height: 1.4;
  min-width: 260px;
  max-width: 360px;
  font-family: var(--font-sans) !important;
  font-size: 11px !important;
  color: #CBD5E1 !important;
  padding-right: 14px;
}

.status-badge {
  font-size: 8.5px;
  font-weight: 700;
  padding: 1.5px 5px;
  border-radius: 3px;
  display: inline-block;
}

.status-badge.executed {
  background: rgba(0, 245, 155, 0.15);
  color: var(--green);
}

.status-badge.open {
  background: rgba(0, 240, 255, 0.15);
  color: var(--cyan);
}

.status-badge.cancelled {
  background: rgba(255, 51, 102, 0.15);
  color: var(--red);
}

.action-btn-danger {
  background: rgba(255, 51, 102, 0.15);
  border: 1px solid rgba(255, 51, 102, 0.35);
  color: var(--red);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.action-btn-danger:hover {
  background: rgba(255, 51, 102, 0.3);
}

/* ==========================================================================
   Modals & Overlays (Funds, AI, Option Chain, Broker Gateway)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 13, 0.88);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.85);
  width: 90%;
  max-width: 980px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#optionChainModal .modal-content-card {
  max-width: 1160px;
  width: 96vw;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: var(--bg-elevated);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: #FFFFFF;
  font-size: 12px;
  box-shadow: var(--shadow-card);
  animation: slideIn 0.25s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Micro-Interactions */
.flash-green {
  animation: flashGreenAnim 0.7s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.flash-red {
  animation: flashRedAnim 0.7s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes flashGreenAnim {
  0% { background-color: rgba(0, 245, 155, 0.25); color: #00F59B; }
  100% { background-color: transparent; }
}

@keyframes flashRedAnim {
  0% { background-color: rgba(255, 51, 102, 0.25); color: #FF3366; }
  100% { background-color: transparent; }
}

/* ==========================================================================
   Full Responsive Layout Engine: Mobile, Tablet & Desktop
   ========================================================================== */

/* 1. Tablet View (768px - 1024px) */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  .top-navbar {
    padding: 0 10px;
    gap: 6px;
  }

  .nav-search-bar {
    max-width: 140px;
  }

  .indices-ticker-group {
    display: none;
  }

  .sidebar-rail {
    width: 60px !important;
    padding: 8px 4px !important;
    align-items: center;
  }

  .sidebar-item {
    justify-content: center !important;
    padding: 0 !important;
    height: 36px !important;
  }

  .sidebar-item span, .sidebar-tag {
    display: none !important;
  }

  .sidebar-bottom-widgets {
    display: none !important;
  }

  .dashboard-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .dashboard-main-split {
    flex-direction: column !important;
  }

  .workspace-grid {
    grid-template-columns: 220px 1fr !important;
    grid-template-rows: auto auto !important;
  }

  .panel-marketwatch {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .panel-chart {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  .panel-order {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
  }

  .panel-bottom-dock {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    grid-template-columns: 1fr !important;
  }
}

/* 2. Mobile View (< 768px down to 320px) */
@media screen and (max-width: 767px) {
  .app-container {
    height: 100vh;
    overflow: hidden;
  }

  .top-navbar {
    height: 42px !important;
    padding: 0 8px !important;
    gap: 4px !important;
  }

  .brand-tagline, .market-type-switcher, .nav-search-bar, .indices-ticker-group, #audioToggleBtn, #openOcModalBtn {
    display: none !important;
  }

  .brand-title {
    font-size: 12px !important;
  }

  .brand-icon {
    width: 22px !important;
    height: 22px !important;
  }

  .nav-actions-right {
    gap: 4px !important;
  }

  .funds-pill-btn {
    height: 24px !important;
    padding: 0 6px !important;
    font-size: 9px !important;
  }

  .ai-pulse-btn {
    height: 24px !important;
    padding: 0 6px !important;
    font-size: 9px !important;
  }

  .broker-status-pill {
    height: 24px !important;
    padding: 0 6px !important;
    font-size: 9px !important;
  }

  .user-profile-badge {
    height: 24px !important;
    padding: 0 4px 0 2px !important;
  }

  .user-profile-badge div {
    display: none;
  }

  .app-body {
    flex-direction: column !important;
    height: calc(100vh - 42px) !important;
  }

  .views-wrapper {
    padding-bottom: 54px !important; /* Space for bottom floating navigation */
  }

  .view-panel {
    padding: 8px !important;
    gap: 8px !important;
  }

  /* Fixed Mobile Bottom Navigation Bar (FinTech App Style) */
  .sidebar-rail {
    width: 100% !important;
    height: 48px !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: 0 4px !important;
    border-right: none !important;
    border-top: 1px solid var(--border-subtle) !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    background: rgba(9, 13, 21, 0.98) !important;
    backdrop-filter: blur(16px) !important;
    z-index: 99 !important;
    overflow: hidden !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.7) !important;
  }

  .sidebar-nav-group {
    flex-direction: row !important;
    width: 100% !important;
    justify-content: space-around !important;
    align-items: center !important;
    gap: 0 !important;
  }

  .sidebar-item {
    width: auto !important;
    height: 38px !important;
    padding: 0 6px !important;
    border-left: none !important;
    border-bottom: 2.5px solid transparent !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 2px !important;
  }

  .sidebar-item svg {
    width: 15px !important;
    height: 15px !important;
  }

  .sidebar-item span {
    display: block !important;
    font-size: 8px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
  }

  .sidebar-item.active {
    border-left: none !important;
    border-bottom: 2px solid var(--cyan) !important;
    background: rgba(0, 240, 255, 0.1) !important;
    border-radius: 4px !important;
  }

  .sidebar-tag, .sidebar-bottom-widgets {
    display: none !important;
  }

  /* Mobile Dashboard */
  .dashboard-hero-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding: 8px 10px !important;
  }

  .dashboard-top-actions {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .dashboard-top-actions button {
    flex: 1 !important;
    padding: 4px 6px !important;
    font-size: 9.5px !important;
  }

  .dashboard-metrics-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .metric-card {
    padding: 8px 10px !important;
  }

  .metric-card .metric-value {
    font-size: 14px !important;
  }

  .dashboard-main-split {
    flex-direction: column !important;
  }

  /* Mobile Trade Desk */
  .workspace-grid {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    gap: 8px !important;
  }

  .panel-bottom-dock {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Mobile Modals */
  .modal-content-card {
    width: 96% !important;
    max-height: 92vh !important;
    border-radius: 10px !important;
  }

  .funds-wallet-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .funds-actions-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .ai-telemetry-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ==========================================================================
   Funds & Bank Hub Modal Styles
   ========================================================================== */
.funds-wallet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.fund-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.fund-card.primary-gradient {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(59, 130, 246, 0.08));
  border-color: rgba(0, 240, 255, 0.35);
}

.fund-card.profit-gradient {
  background: linear-gradient(135deg, rgba(0, 245, 155, 0.12), rgba(0, 200, 83, 0.08));
  border-color: rgba(0, 245, 155, 0.35);
}

.linked-bank-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bank-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0, 240, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.bank-edit-container {
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.funds-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.fund-action-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

/* ==========================================================================
   AI Copilot Modal Styles
   ========================================================================== */
.ai-agent-hub {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-agent-banner {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(0, 240, 255, 0.08));
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.ai-stat-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-disclaimer-box {
  background: rgba(251, 191, 36, 0.05);
  border: 1px dashed rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.btn-algo-action {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.btn-algo-action.pause {
  background: rgba(255, 51, 102, 0.15);
  border: 1px solid rgba(255, 51, 102, 0.4);
  color: var(--red);
}

.btn-algo-action.start {
  background: rgba(0, 245, 155, 0.15);
  border: 1px solid rgba(0, 245, 155, 0.4);
  color: var(--green);
}

/* ==========================================================================
   Excel Database & Control Center View
   ========================================================================== */
.excel-control-dashboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.excel-hero-ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(0, 245, 155, 0.08) 0%, rgba(6, 8, 14, 0.9) 100%);
  border: 1px solid rgba(0, 245, 155, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  flex-wrap: wrap;
  gap: 12px;
}

.excel-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.excel-badge-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(0, 245, 155, 0.15);
  border: 1px solid rgba(0, 245, 155, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.excel-title {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.excel-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.excel-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.excel-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.excel-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: var(--transition);
}

.excel-kpi-card:hover {
  border-color: rgba(0, 245, 155, 0.3);
  background: var(--bg-card-hover);
}

.kpi-title {
  font-size: 9.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 15px;
  font-weight: 700;
}

.kpi-foot {
  font-size: 9.5px;
  color: var(--text-dim);
}

.excel-import-control-panel {
  background: var(--bg-card);
  border: 1px dashed rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.excel-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}

.excel-dropzone:hover, .excel-dropzone.drag-active {
  background: rgba(0, 240, 255, 0.08);
  border-color: var(--cyan);
}

.dropzone-icon {
  font-size: 26px;
}

.dropzone-text strong {
  display: block;
  font-size: 12px;
  color: var(--text-main);
  margin-bottom: 2px;
}

.dropzone-text span {
  font-size: 10.5px;
  color: var(--text-muted);
}

.excel-batch-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 245, 155, 0.08);
  border: 1px solid rgba(0, 245, 155, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.batch-text {
  font-size: 11.5px;
  color: var(--text-main);
}

.batch-btns {
  display: flex;
  gap: 8px;
}

.excel-sheet-inspector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 8px;
}

.sheet-tabs-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.sheet-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.sheet-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.sheet-tab-btn.active {
  background: rgba(0, 245, 155, 0.15);
  border-color: rgba(0, 245, 155, 0.4);
  color: var(--green);
}

.sheet-search-wrap {
  display: flex;
  align-items: center;
}

.excel-search-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-main);
  outline: none;
  width: 180px;
}

.excel-search-box:focus {
  border-color: var(--cyan);
}

.sheet-table-scroll-container {
  max-height: 460px;
  overflow: auto;
}

.excel-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.excel-data-table th {
  background: #090D15;
  color: var(--text-dim);
  padding: 7px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.excel-data-table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

.excel-data-table tbody tr:hover {
  background: rgba(0, 240, 255, 0.03);
}

.excel-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.btn-primary-action {
  background: var(--green);
  color: #06080E;
  border: none;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-primary-action:hover {
  box-shadow: 0 0 12px var(--green-glow);
  transform: translateY(-1px);
}

.btn-secondary-action {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--cyan);
}

.btn-outline-action {
  background: transparent;
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--cyan);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-outline-action:hover {
  background: rgba(0, 240, 255, 0.1);
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid rgba(255, 51, 102, 0.35);
  color: var(--red);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
}

.btn-outline-danger:hover {
  background: rgba(255, 51, 102, 0.1);
}

.btn-success-action {
  background: rgba(0, 245, 155, 0.2);
  border: 1px solid var(--green);
  color: var(--green);
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-success-action:hover {
  background: var(--green);
  color: #06080E;
}

@media (max-width: 900px) {
  .excel-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .excel-kpi-grid {
    grid-template-columns: 1fr;
  }
  .excel-hero-ribbon {
    flex-direction: column;
    align-items: flex-start;
  }
  .excel-hero-actions {
    width: 100%;
    flex-direction: column;
  }
  .excel-hero-actions button {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   Institutional Option Chain & Derivatives Hub
   ========================================================================== */
.oc-hub-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.oc-top-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
  gap: 10px;
}

.oc-underlying-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.oc-pill-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  transition: var(--transition);
}

.oc-pill-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.oc-pill-tab.active {
  background: rgba(0, 240, 255, 0.14);
  border-color: var(--cyan);
  color: #FFFFFF;
}

.oc-pill-tab .pill-spot {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--cyan);
}

.oc-controls-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.oc-control-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.oc-ctrl-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
}

.oc-custom-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: #FFFFFF;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  outline: none;
  cursor: pointer;
}

.oc-custom-select:focus {
  border-color: var(--cyan);
}

.oc-refresh-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  transition: var(--transition);
}

.oc-refresh-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
}

.oc-refresh-btn.rotating svg {
  animation: spin 0.5s ease-in-out;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.oc-kpi-ribbon {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.oc-kpi-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 130px;
  flex: 1;
}

.oc-kpi-label {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.oc-kpi-val {
  font-size: 12px;
  font-weight: 700;
}

.oc-matrix-container {
  background: #080C14;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  max-height: 520px;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.oc-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
  min-width: 840px;
}

.oc-super-hdr th {
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 4;
}

.call-super-hdr {
  background: rgba(0, 245, 155, 0.12) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.call-text {
  color: var(--green);
}

.strike-super-hdr {
  background: #0D1422 !important;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.put-super-hdr {
  background: rgba(255, 51, 102, 0.12) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.put-text {
  color: var(--red);
}

.super-sub {
  display: block;
  font-size: 8.5px;
  font-weight: 400;
  opacity: 0.75;
}

.oc-sub-hdr th {
  background: #0B101B;
  color: var(--text-dim);
  font-size: 9.5px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 33px;
  z-index: 3;
}

.strike-col-hdr {
  background: #111827 !important;
  color: #FFFFFF !important;
  text-align: center !important;
}

.oc-data-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.15s ease;
}

.oc-data-row:hover {
  background: rgba(0, 240, 255, 0.04);
}

.oc-data-row td {
  padding: 5px 10px;
  vertical-align: middle;
}

.oc-itm-cell {
  background: rgba(251, 191, 36, 0.04);
}

.oc-otm-cell {
  background: transparent;
}

.oc-atm-row {
  background: rgba(0, 240, 255, 0.08) !important;
  outline: 1px solid rgba(0, 240, 255, 0.4);
}

.oc-strike-cell {
  background: #0D1422;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
  font-size: 11.5px;
  color: #FFFFFF;
  padding: 5px 8px;
}

.strike-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.strike-num {
  color: #FFFFFF;
}

.atm-badge-tag {
  background: var(--cyan);
  color: #06080E;
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.oc-actions-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.oc-trade-btn {
  width: 22px;
  height: 20px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.oc-trade-btn.buy-btn {
  background: rgba(0, 245, 155, 0.18);
  border: 1px solid rgba(0, 245, 155, 0.45);
  color: var(--green);
}

.oc-trade-btn.buy-btn:hover {
  background: var(--green);
  color: #06080E;
  box-shadow: 0 0 8px var(--green-glow);
}

.oc-trade-btn.sell-btn {
  background: rgba(255, 51, 102, 0.18);
  border: 1px solid rgba(255, 51, 102, 0.45);
  color: var(--red);
}

.oc-trade-btn.sell-btn:hover {
  background: var(--red);
  color: #FFFFFF;
  box-shadow: 0 0 8px var(--red-glow);
}

.oi-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.oi-bar-fill {
  height: 2.5px;
  border-radius: 2px;
  opacity: 0.6;
}

.oi-bar-fill.call {
  background: var(--green);
  align-self: flex-start;
}

.oi-bar-fill.put {
  background: var(--red);
  align-self: flex-end;
}

.oc-footer-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 10.5px;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-box {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.legend-box.itm {
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.5);
}

.legend-box.atm {
  background: rgba(0, 240, 255, 0.2);
  border: 1px solid var(--cyan);
}

.legend-box.otm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Pro Order Execution Pad & Market Depth Ladder (L2)
   ========================================================================== */
.panel-order {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
  max-height: 100%;
}

.side-toggle-group {
  display: flex;
  gap: 4px;
  width: 100%;
  background: #080C14;
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.side-toggle-btn {
  flex: 1;
  padding: 5px 0;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: var(--transition);
  letter-spacing: 0.5px;
  user-select: none;
}

.side-toggle-btn.buy {
  color: var(--text-muted);
  background: transparent;
}

.side-toggle-btn.buy.active {
  background: rgba(0, 245, 155, 0.16);
  border-color: rgba(0, 245, 155, 0.45);
  color: var(--green);
  box-shadow: 0 0 12px rgba(0, 245, 155, 0.2);
}

.side-toggle-btn.sell {
  color: var(--text-muted);
  background: transparent;
}

.side-toggle-btn.sell.active {
  background: rgba(255, 51, 102, 0.16);
  border-color: rgba(255, 51, 102, 0.45);
  color: var(--red);
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.2);
}

.btn-side-indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}

.side-toggle-btn.buy.active .btn-side-indicator {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.side-toggle-btn.sell.active .btn-side-indicator {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

.order-form-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.form-row-pro {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.form-label-pro {
  font-size: 8.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.product-badge-info, .order-type-badge-info {
  font-size: 8px;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  padding: 0 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.pill-select-group {
  display: flex;
  gap: 3px;
  background: #080C14;
  padding: 2px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  width: 100%;
}

.pill-opt {
  flex: 1;
  text-align: center;
  padding: 4px 2px;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pill-opt:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.04);
}

.pill-opt.active {
  background: rgba(0, 240, 255, 0.14);
  color: var(--cyan);
  border-color: rgba(0, 240, 255, 0.35);
  font-weight: 700;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

.order-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.input-stepper-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-num {
  width: 100%;
  background: #080C14;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: #FFFFFF;
  padding: 5px 8px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  outline: none;
  transition: var(--transition);
}

.input-num:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.margin-charges-card {
  background: rgba(8, 12, 20, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.margin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9.5px;
}

.margin-label {
  color: var(--text-dim);
  font-size: 9px;
}

.btn-place-order {
  width: 100%;
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.6px;
  user-select: none;
  flex-shrink: 0;
  text-transform: uppercase;
}

.btn-place-order.buy-mode {
  background: linear-gradient(135deg, #00F59B 0%, #00C878 100%);
  color: #040810;
  box-shadow: 0 3px 10px rgba(0, 245, 155, 0.28);
}

.btn-place-order.sell-mode {
  background: linear-gradient(135deg, #FF3366 0%, #D80036 100%);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(255, 51, 102, 0.28);
}

.btn-place-order:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(0, 245, 155, 0.4);
}

.btn-place-order.sell-mode:hover {
  box-shadow: 0 4px 14px rgba(255, 51, 102, 0.4);
}

.btn-place-order:active {
  transform: translateY(0);
}

.btn-bolt-icon {
  font-size: 11px;
  line-height: 1;
}

.market-depth-container {
  margin-top: 1px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.depth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
}

.depth-title {
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 8.5px;
  letter-spacing: 0.5px;
}

.depth-ratio-bar {
  display: flex;
  width: 100%;
  height: 2.5px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.ratio-bid-fill {
  background: var(--green);
  height: 100%;
}

.ratio-ask-fill {
  background: var(--red);
  height: 100%;
}

.depth-table {
  width: 100%;
  font-size: 9.5px;
  border-collapse: collapse;
  table-layout: fixed;
}

.depth-table th {
  color: var(--text-dim);
  font-size: 8px;
  text-transform: uppercase;
  padding: 1.5px 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 700;
}

.depth-table td {
  padding: 2px 3px;
}

/* ==========================================================================
   AI Autonomous Hub & Animated Slider Switch (Start / Stop)
   ========================================================================== */

.ai-agent-hub {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px;
}

.ai-agent-banner {
  background: linear-gradient(135deg, rgba(13, 19, 31, 0.95) 0%, rgba(9, 13, 21, 0.98) 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  gap: 16px;
  flex-wrap: wrap;
}

.ai-pulse-orb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.ai-pulse-orb.active {
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
  animation: pulseGreenOrb 2s infinite;
}

.ai-pulse-orb.idle {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

@keyframes pulseGreenOrb {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 245, 155, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(0, 245, 155, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 245, 155, 0); }
}

/* Switch Wrapper and Meta */
.ai-switch-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.ai-switch-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.ai-switch-title {
  color: var(--text-dim);
  font-weight: 700;
}

.ai-switch-status-pill {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.4px;
}

.ai-switch-status-pill.active {
  background: rgba(0, 245, 155, 0.15);
  color: var(--green);
  border: 1px solid rgba(0, 245, 155, 0.3);
}

.ai-switch-status-pill.stopped {
  background: rgba(255, 51, 102, 0.15);
  color: var(--red);
  border: 1px solid rgba(255, 51, 102, 0.3);
}

/* The Animated Slider Switch Track */
.ai-slider-switch {
  position: relative;
  width: 148px;
  height: 38px;
  border-radius: 20px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 12px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.ai-slider-switch:focus-visible {
  box-shadow: 0 0 0 2px var(--cyan), inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Stopped State (OFF / Left) */
.ai-slider-switch.stopped {
  background: linear-gradient(135deg, #1C0F17 0%, #10141E 100%);
  border: 1.5px solid rgba(255, 51, 102, 0.45);
  box-shadow: 0 4px 14px rgba(255, 51, 102, 0.15), inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

.ai-slider-switch.stopped:hover {
  border-color: rgba(255, 51, 102, 0.8);
  box-shadow: 0 4px 20px rgba(255, 51, 102, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.8);
  transform: translateY(-1px);
}

/* Active State (ON / Right) */
.ai-slider-switch.active {
  background: linear-gradient(135deg, #05261B 0%, #081B24 100%);
  border: 1.5px solid rgba(0, 245, 155, 0.55);
  box-shadow: 0 4px 16px rgba(0, 245, 155, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

.ai-slider-switch.active:hover {
  border-color: rgba(0, 245, 155, 0.9);
  box-shadow: 0 4px 24px rgba(0, 245, 155, 0.35), inset 0 2px 6px rgba(0, 0, 0, 0.8);
  transform: translateY(-1px);
}

/* Dynamic Ambient Glow inside the track */
.ai-slider-glow-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.ai-slider-switch.active .ai-slider-glow-layer {
  background: radial-gradient(circle at 80% 50%, rgba(0, 245, 155, 0.4) 0%, transparent 70%);
}

.ai-slider-switch.stopped .ai-slider-glow-layer {
  background: radial-gradient(circle at 20% 50%, rgba(255, 51, 102, 0.3) 0%, transparent 70%);
}

/* Track Labels */
.ai-slider-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  z-index: 1;
  transition: all 0.3s ease;
  pointer-events: none;
}

.ai-slider-label.label-stop {
  color: #FF3366;
  padding-left: 2px;
}

.ai-slider-switch.stopped .ai-slider-label.label-stop {
  opacity: 0;
}

.ai-slider-switch.active .ai-slider-label.label-stop {
  opacity: 0.55;
  color: var(--text-dim);
}

.ai-slider-label.label-start {
  color: #00F59B;
  padding-right: 2px;
}

.ai-slider-switch.active .ai-slider-label.label-start {
  opacity: 0;
}

.ai-slider-switch.stopped .ai-slider-label.label-start {
  opacity: 0.55;
  color: var(--text-dim);
}

/* Animated Sliding Thumb Knob */
.ai-slider-thumb {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, box-shadow 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

/* Stopped (Knob on the Left) */
.ai-slider-switch.stopped .ai-slider-thumb {
  transform: translateX(0);
  background: linear-gradient(135deg, #FF3366 0%, #B8002E 100%);
  box-shadow: 0 2px 10px rgba(255, 51, 102, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

/* Active (Knob smoothly slides to the Right) */
.ai-slider-switch.active .ai-slider-thumb {
  transform: translateX(108px);
  background: linear-gradient(135deg, #00F59B 0%, #00B06F 100%);
  box-shadow: 0 2px 12px rgba(0, 245, 155, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  animation: aiPulseKnob 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

.ai-thumb-icon {
  font-size: 13px;
  line-height: 1;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.ai-slider-switch:hover .ai-thumb-icon {
  transform: scale(1.15);
}

@keyframes aiPulseKnob {
  0% { box-shadow: 0 0 0 0 rgba(0, 245, 155, 0.6), 0 2px 12px rgba(0, 245, 155, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(0, 245, 155, 0), 0 2px 12px rgba(0, 245, 155, 0.7); }
  100% { box-shadow: 0 0 0 0 rgba(0, 245, 155, 0), 0 2px 12px rgba(0, 245, 155, 0.7); }
}

/* AI Telemetry Grid & Stat Boxes */
.ai-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.ai-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-disclaimer-box {
  background: rgba(0, 240, 255, 0.04);
  border: 1px dashed rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 11px;
  color: #94A3B8;
  line-height: 1.5;
  margin-top: 10px;
}

/* ==========================================================================
   Global Modal Overlays & Popups
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 6, 12, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  padding: 16px;
  box-sizing: border-box;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-content-card {
  background: #0D121F;
  border: 1px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 240, 255, 0.15);
  border-radius: 8px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.modal-overlay.active .modal-content-card {
  transform: scale(1);
}

/* ==========================================================================
   TradingView Pro Multi-Chart Terminal GUI (Quad 2x2 Grid & Tools)
   ========================================================================== */

.tv-terminal-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 100px);
  min-height: 680px;
  background: #080A10;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  position: relative;
}

/* 1. Top TradingView Toolbar */
.tv-top-toolbar {
  height: 38px;
  background: #0D111A;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  flex-shrink: 0;
  user-select: none;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.tv-top-toolbar::-webkit-scrollbar {
  display: none;
}

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

.tv-icon-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 13px;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.tv-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.tv-symbol-dropdown {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  font-size: 11px;
  color: #FFFFFF;
  margin-right: 2px;
  flex-shrink: 0;
}

.tv-symbol-dropdown:hover {
  border-color: #00F0FF;
  background: rgba(0, 240, 255, 0.08);
}

.tv-timeframe-group {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.tv-tf-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

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

.tv-tf-btn.active {
  color: #00F0FF;
  background: rgba(0, 240, 255, 0.12);
  font-weight: 700;
}

.tv-separator {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 3px;
  flex-shrink: 0;
}

.tv-tool-link {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.tv-tool-link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
}

.tv-fx-badge {
  color: #2962FF;
  font-family: 'Times New Roman', serif;
  font-style: italic;
  font-weight: 800;
  font-size: 12px;
}

.tv-plus-icon {
  color: #00F0FF;
  font-weight: 700;
}

/* Layout Switcher */
.tv-layout-switcher {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1px;
  flex-shrink: 0;
}

.tv-layout-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
}

.tv-layout-btn:hover {
  color: #FFFFFF;
}

.tv-layout-btn.active {
  background: rgba(41, 98, 255, 0.35);
  color: #00F0FF;
}

.tv-publish-btn {
  background: #2962FF;
  color: #FFFFFF;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(41, 98, 255, 0.4);
  transition: all 0.15s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.tv-publish-btn:hover {
  background: #1E4BD8;
  transform: translateY(-1px);
}

/* 2. Main Viewport */
.tv-main-viewport {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
  width: 100%;
}

/* Left Drawing Toolbar */
.tv-drawing-toolbar {
  width: 42px;
  background: #0C0F17;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 3px;
  flex-shrink: 0;
  user-select: none;
  z-index: 10;
}

.tv-tool-btn {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: #8E9BAE;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tv-tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.tv-tool-btn.active {
  background: rgba(0, 240, 255, 0.15);
  color: #00F0FF;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.tv-tool-divider {
  width: 22px;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

/* Center Content & Multi-Chart Grid */
.tv-center-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #06080E;
  overflow: hidden;
}

.tv-chart-grid {
  flex: 1;
  display: grid;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.tv-chart-grid.layout-single {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
.tv-chart-grid.layout-single .tv-chart-cell:not(.active-focus) {
  display: none;
}

.tv-chart-grid.layout-dual {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}
.tv-chart-grid.layout-dual .tv-chart-cell:nth-child(n+3) {
  display: none;
}

.tv-chart-grid.layout-quad {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

/* Chart Cell */
.tv-chart-cell {
  background: #0B0E17;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: crosshair;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Active Highlighted Chart (Glowing Blue Focus Border like in Image) */
.tv-chart-cell.active-focus {
  border: 1.5px solid #2962FF !important;
  box-shadow: inset 0 0 12px rgba(41, 98, 255, 0.35), 0 0 16px rgba(41, 98, 255, 0.3) !important;
  z-index: 2;
}

.tv-cell-header {
  height: 28px;
  padding: 0 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(11, 14, 23, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  z-index: 5;
  user-select: none;
}

.tv-cell-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.tv-cell-symbol-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 1px 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tv-cell-symbol-btn:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.3);
}

.tv-cell-symbol {
  font-weight: 700;
  color: #FFFFFF;
  font-size: 11px;
}

.tv-cell-indicator-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.tv-cell-indicator-dot.dot-cyan { background: #00F0FF; box-shadow: 0 0 4px #00F0FF; }
.tv-cell-indicator-dot.dot-green { background: #00F59B; box-shadow: 0 0 4px #00F59B; }

.tv-cell-tag-rect {
  width: 6px;
  height: 10px;
  border-radius: 1px;
}
.tv-cell-tag-rect.red-tag { background: #FF3366; }
.tv-cell-tag-rect.purple-tag { background: #A855F7; }

/* Spread Buttons in Active Cell */
.tv-quick-spread-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 3px;
  padding: 1px 3px;
}

.tv-spread-btn {
  border: none;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 2px;
  cursor: pointer;
}
.tv-spread-btn.sell {
  background: #FF3366;
  color: #FFFFFF;
}
.tv-spread-btn.buy {
  background: #2962FF;
  color: #FFFFFF;
}

.tv-spread-diff {
  font-size: 8.5px;
  color: #94A3B8;
  padding: 0 2px;
}

.tv-spread-qty {
  width: 32px;
  height: 18px;
  background: #080C14;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  color: #00F0FF;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  text-align: center;
  outline: none;
  padding: 0 1px;
}

.tv-spread-qty:focus {
  border-color: #00F0FF;
}

.tv-cell-ohlc {
  font-size: 9.5px;
}

.tv-tag-usd {
  font-size: 9.5px;
  color: #64748B;
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 4px;
  border-radius: 2px;
  cursor: pointer;
}

.tv-cell-ribbon-sub {
  position: absolute;
  top: 30px;
  left: 8px;
  z-index: 4;
  pointer-events: none;
}

.tv-cell-canvas-wrap {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 140px;
}

.tv-cell-canvas-wrap canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* 3. Bottom Timeframe Range & Scale Bar */
.tv-bottom-bar {
  height: 26px;
  background: #0C0F17;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  flex-shrink: 0;
  user-select: none;
}

.tv-range-jumpers {
  display: flex;
  align-items: center;
  gap: 1px;
}

.tv-range-btn {
  background: transparent;
  border: none;
  color: #8E9BAE;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  cursor: pointer;
}

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

.tv-range-btn.active {
  color: #00F0FF;
  background: rgba(0, 240, 255, 0.12);
  font-weight: 700;
}

.tv-scale-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}

.tv-utc-clock {
  color: #64748B;
  font-size: 10px;
  margin-right: 4px;
  padding: 1px 4px;
  border-radius: 3px;
  transition: all 0.15s ease;
}

.tv-utc-clock.tv-clickable {
  cursor: pointer;
}

.tv-utc-clock.tv-clickable:hover {
  color: #00F0FF;
  background: rgba(0, 240, 255, 0.1);
}

.tv-scale-opt {
  color: #8E9BAE;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: all 0.15s ease;
}

.tv-scale-opt:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}

.tv-scale-opt.active {
  color: #00F0FF !important;
  font-weight: 700;
  background: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.25);
}

.tv-scale-btn {
  background: transparent;
  border: none;
  color: #8E9BAE;
  cursor: pointer;
  font-size: 11.5px;
  padding: 2px 5px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tv-scale-btn:hover {
  color: #00F0FF;
  background: rgba(255, 255, 255, 0.08);
}

.tv-scale-btn.active {
  color: #00F0FF;
  background: rgba(0, 240, 255, 0.15);
}

/* 4. Bottom Dock */
.tv-bottom-dock {
  background: #0D111A;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tv-bottom-dock.collapsed .tv-dock-content {
  display: none !important;
}

.tv-bottom-dock.maximized {
  height: 380px !important;
}

.tv-dock-tabs-bar {
  height: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  background: #090C15;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  user-select: none;
}

.tv-dock-tab-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tv-dock-tab {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tv-dock-tab:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
}

.tv-dock-tab.active {
  color: #00F0FF !important;
  background: rgba(0, 240, 255, 0.12) !important;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 #00F0FF;
}

.tv-dock-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tv-dock-action-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94A3B8;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}

.tv-dock-action-btn:hover {
  color: #00F0FF;
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.3);
}

.tv-dock-action-btn.active {
  color: #00F0FF;
  background: rgba(0, 240, 255, 0.2);
  border-color: #00F0FF;
}

.tv-dock-content {
  padding: 10px 12px;
  max-height: 150px;
  overflow-y: auto;
  background: #0B0E17;
}

/* Screener Single-Row Controls */
.tv-screener-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tv-screener-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 250px;
  width: 100%;
}

.tv-screener-search-icon {
  position: absolute;
  left: 8px;
  font-size: 11px;
  color: #64748B;
  pointer-events: none;
}

.tv-dark-input {
  background: #080C14 !important;
  border: 1px solid rgba(0, 240, 255, 0.25) !important;
  border-radius: 4px !important;
  color: #FFFFFF !important;
  font-family: var(--font-sans) !important;
  font-size: 11px !important;
  padding: 5px 8px 5px 28px !important;
  outline: none !important;
  width: 100% !important;
  transition: all 0.2s ease !important;
}

.tv-dark-input:focus {
  border-color: #00F0FF !important;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.35) !important;
}

.tv-dark-select {
  background: #080C14 !important;
  border: 1px solid rgba(0, 240, 255, 0.25) !important;
  border-radius: 4px !important;
  color: #00F0FF !important;
  font-family: var(--font-sans) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 5px 12px !important;
  outline: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.tv-dark-select:focus {
  border-color: #00F0FF !important;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.35) !important;
}

.tv-dark-select option {
  background: #0B0E17;
  color: #FFFFFF;
}

.tv-pine-code {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 8px;
  font-size: 10px;
  color: #00F0FF;
  line-height: 1.4;
}

/* 5. Right Action Sidebar */
.tv-right-sidebar {
  width: 42px;
  background: #0C0F17;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 4px;
  flex-shrink: 0;
  user-select: none;
  z-index: 20;
  position: relative;
}

.tv-right-sidebar-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #8E9BAE;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s ease;
  user-select: none;
}

.tv-right-sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  transform: scale(1.06);
}

.tv-right-sidebar-btn.active {
  background: rgba(41, 98, 255, 0.25);
  color: #00F0FF;
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

/* Sliding Right Drawer Panel */
.tv-right-drawer {
  position: absolute;
  right: 42px;
  top: 0;
  bottom: 0;
  width: 270px;
  max-width: calc(100% - 50px);
  background: #0B0E14;
  border-left: 1px solid rgba(0, 240, 255, 0.25);
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.85);
  z-index: 50;
  transform: translateX(120%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, visibility 0.25s ease;
  display: flex;
  flex-direction: column;
}

.tv-right-drawer.open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.tv-drawer-header {
  height: 38px;
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
  font-size: 11px;
  color: #00F0FF;
  letter-spacing: 0.5px;
  background: #0E131D;
}

.tv-drawer-close-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  font-size: 14px;
}
.tv-drawer-close-btn:hover { color: #FFFFFF; }

.tv-drawer-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
}

/* Floating Bar Replay Toolbar */
.tv-replay-toolbar {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  background: #0F172A;
  border: 1px solid #00F0FF;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.35);
  border-radius: 6px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 40;
}

.tv-replay-badge {
  font-size: 10px;
  font-weight: 800;
  color: #00F0FF;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.tv-replay-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F8FAFC;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tv-replay-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: #00F0FF;
  color: #00F0FF;
}

.tv-replay-btn.play {
  background: #2962FF;
  border-color: #2962FF;
  color: #FFFFFF;
}

.tv-replay-btn.play:hover {
  background: #1E4BD8;
}

.tv-replay-select {
  background: #0A0E17;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #00F0FF;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  outline: none;
}

.tv-replay-close {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 14px;
  cursor: pointer;
  margin-left: 4px;
}
.tv-replay-close:hover { color: #EF4444; }

/* Watchlist and Drawer item lists */
.tv-drawer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.tv-drawer-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tv-drawer-item.active {
  background: rgba(41, 98, 255, 0.18);
  border-left: 2px solid #00F0FF;
}

/* DOM Ladder styling */
.tv-dom-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  font-size: 11px;
  padding: 3px 6px;
  font-family: 'JetBrains Mono', monospace;
}

.tv-dom-row.bid { background: rgba(0, 240, 144, 0.08); color: #00F090; }
.tv-dom-row.ask { background: rgba(255, 51, 102, 0.08); color: #FF3366; }
.tv-dom-row.mid { background: rgba(0, 240, 255, 0.15); font-weight: 700; color: #FFFFFF; text-align: center; }

/* Chat room styling */
.tv-chat-message {
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 11px;
}

.tv-chat-user {
  font-weight: 700;
  color: #00F0FF;
  margin-right: 4px;
}

/* Bottom dock views */
.tv-notes-textarea {
  width: 100%;
  height: 90px;
  background: #0A0E17;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #E2E8F0;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  padding: 8px;
  border-radius: 4px;
  resize: none;
  outline: none;
}

.tv-notes-textarea:focus {
  border-color: #00F0FF;
}

.tv-tester-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.tv-stat-card {
  background: #0A0E17;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 8px 10px;
}

.tv-stat-title {
  font-size: 9.5px;
  color: #94A3B8;
  text-transform: uppercase;
}

.tv-stat-val {
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
}

/* Pine Editor styling */
.tv-pine-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tv-pine-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tv-pine-editor {
  width: 100%;
  height: 90px;
  background: #080B10;
  border: 1px solid rgba(0, 240, 255, 0.2);
  color: #00F0FF;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  padding: 8px;
  border-radius: 4px;
  resize: none;
  outline: none;
}

/* ==========================================================================
   Responsive Adaptations for TradingView Terminal
   ========================================================================== */
@media (max-width: 1400px) {
  .tv-tool-link {
    font-size: 10.5px;
    padding: 3px 6px;
  }
  .tv-publish-btn {
    padding: 3px 10px;
    font-size: 10.5px;
  }
}

@media (max-width: 1100px) {
  .tv-tool-link {
    font-size: 10px;
    padding: 2px 5px;
  }
}

/* Tab Bar & Small Button Styles */
.tab-bar-sm {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn-sm {
  background: transparent;
  border: 1px solid transparent;
  color: #94A3B8;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tab-btn-sm:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
}

.tab-btn-sm.active {
  background: rgba(0, 240, 255, 0.15) !important;
  color: #00F0FF !important;
  border-color: rgba(0, 240, 255, 0.4) !important;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

.btn-broker-tab {
  font-size: 11px;
  padding: 5px 12px;
}

@media (max-width: 850px) {
  .tv-top-toolbar {
    padding: 0 4px;
    gap: 4px;
  }
  .tv-drawing-toolbar {
    width: 36px;
  }
  .tv-right-sidebar {
    width: 36px;
  }
  .tv-right-drawer {
    width: 280px;
  }
}

/* Theme Selection Cards in Settings Modal */
.tv-theme-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.tv-theme-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
  transition: all 0.2s ease;
}

.tv-theme-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 240, 255, 0.3);
}

.tv-theme-card.active {
  background: rgba(0, 240, 255, 0.12) !important;
  border-color: #00F0FF !important;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

.tv-theme-preview {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.tv-theme-preview.dark {
  background: linear-gradient(135deg, #06080E 50%, #00F0FF 50%);
}

.tv-theme-preview.light {
  background: linear-gradient(135deg, #FFFFFF 50%, #2962FF 50%);
  border-color: #CBD5E1;
}

.tv-theme-preview.midnight {
  background: linear-gradient(135deg, #000000 50%, #334155 50%);
}

.tv-theme-preview.matrix {
  background: linear-gradient(135deg, #041009 50%, #00FF66 50%);
}

.tv-theme-title {
  font-weight: 700;
  font-size: 11.5px;
  color: #FFFFFF;
}

body.theme-light .tv-theme-title {
  color: #131722;
}

.tv-theme-desc {
  font-size: 9.5px;
  color: #94A3B8;
  margin-top: 2px;
  line-height: 1.3;
}


