/* ==============================================================================
   ALGO_SOFT — Premium Glassmorphism Dark Theme Design System
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #0f1422;
  --bg-surface: rgba(18, 24, 38, 0.75);
  --bg-surface-hover: rgba(26, 34, 52, 0.85);
  --bg-card: rgba(15, 20, 34, 0.65);
  --bg-modal: rgba(13, 17, 28, 0.95);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;

  --color-buy: #10b981;
  --color-buy-bg: rgba(16, 185, 129, 0.12);
  --color-buy-hover: #059669;

  --color-sell: #ef4444;
  --color-sell-bg: rgba(239, 68, 68, 0.12);
  --color-sell-hover: #dc2626;

  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.12);

  --color-paper: #10b981;
  --color-live: #ef4444;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.25);
  --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.25);
  --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.3);

  --glass-blur: blur(16px);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==============================================================================
   MODE BANNER (Crucial Safety Header)
   ============================================================================== */
.mode-banner {
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.mode-banner.paper {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
  color: #34d399;
  border-bottom-color: rgba(16, 185, 129, 0.3);
}

.mode-banner.live {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.25), rgba(245, 158, 11, 0.2));
  color: #fca5a5;
  border-bottom-color: rgba(239, 68, 68, 0.5);
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0%, 100% { border-bottom-color: rgba(239, 68, 68, 0.4); }
  50% { border-bottom-color: rgba(239, 68, 68, 0.9); }
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.mode-badge.paper {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.mode-badge.live {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.5);
  box-shadow: var(--shadow-glow-red);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.pulse-dot.green {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.pulse-dot.red {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: blink 1.2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ==============================================================================
   NAVIGATION HEADER
   ============================================================================== */
.navbar {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #ffffff;
  box-shadow: var(--shadow-glow-blue);
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-phase {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-left: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 14px;
}

.connection-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 999px;
}

/* ==============================================================================
   LAYOUT & CONTAINERS
   ============================================================================== */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
}

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

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ==============================================================================
   GLASS CARDS & STATS
   ============================================================================== */
.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.grid-cols-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.grid-cols-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

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

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 8px;
}

.stat-value.green {
  color: var(--color-buy);
}

.stat-value.red {
  color: var(--color-sell);
}

.stat-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==============================================================================
   FORM ELEMENTS & MANUAL ORDER TICKET
   ============================================================================== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: rgba(255, 255, 255, 0.07);
}

.form-control:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.2);
}

/* Radio Pill / Segmented Group Styles */
.radio-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.radio-group.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.radio-group.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.radio-group.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

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

.radio-pill {
  position: relative;
  cursor: pointer;
  user-select: none;
  display: block;
}

.radio-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-pill .pill-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 44px;
}

.radio-pill .pill-subtext {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

.radio-pill:hover .pill-box {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.16);
}

.radio-pill:hover .pill-subtext {
  color: var(--text-secondary);
}

.radio-pill input[type="radio"]:checked + .pill-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(6, 182, 212, 0.25));
  border-color: var(--accent-indigo);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.radio-pill input[type="radio"]:checked + .pill-box .pill-subtext {
  color: #c7d2fe;
}

.radio-pill input[type="radio"]:focus-visible + .pill-box {
  outline: 2px solid var(--accent-cyan);
}

.radio-pill.disabled, .radio-pill input[type="radio"]:disabled + .pill-box {
  opacity: 0.35;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.04);
}

/* BUY / SELL Switcher */
.tx-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.tx-btn {
  padding: 14px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tx-btn.buy {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.tx-btn.buy.active, .tx-btn.buy:hover {
  background: var(--color-buy);
  color: #ffffff;
  border-color: var(--color-buy);
  box-shadow: var(--shadow-glow-green);
}

.tx-btn.sell {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.tx-btn.sell.active, .tx-btn.sell:hover {
  background: var(--color-sell);
  color: #ffffff;
  border-color: var(--color-sell);
  box-shadow: var(--shadow-glow-red);
}

/* Button variants */
.btn {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  color: #ffffff;
  box-shadow: var(--shadow-glow-blue);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-buy {
  background: var(--color-buy);
  color: #ffffff;
  box-shadow: var(--shadow-glow-green);
}

.btn-buy:hover {
  background: var(--color-buy-hover);
  transform: translateY(-1px);
}

.btn-sell {
  background: var(--color-sell);
  color: #ffffff;
  box-shadow: var(--shadow-glow-red);
}

.btn-sell:hover {
  background: var(--color-sell-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-surface-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--color-sell);
  color: #ffffff;
}

.btn-block {
  width: 100%;
}

/* ==============================================================================
   TABLES & DATA DISPLAY
   ============================================================================== */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.table tbody tr {
  transition: background 0.15s ease;
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-complete, .badge-buy {
  background: var(--color-buy-bg);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-open, .badge-pending {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

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

.badge-rejected {
  background: rgba(156, 163, 175, 0.15);
  color: #d1d5db;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.badge-paper {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.badge-live {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  font-weight: 800;
}

/* ==============================================================================
   CONFIRMATION MODAL & DIALOGS
   ============================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.modal-card {
  background: var(--bg-modal);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 520px;
  padding: 30px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #ffffff;
}

.warning-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.warning-box.paper {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.order-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.summary-row {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.summary-val {
  font-size: 1rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

/* ==============================================================================
   TOAST NOTIFICATIONS
   ============================================================================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: #ffffff;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 450px;
  animation: slide-in 0.3s ease;
}

.toast.success {
  border-left: 4px solid var(--color-buy);
}

.toast.error {
  border-left: 4px solid var(--color-sell);
}

.toast.info {
  border-left: 4px solid var(--accent-blue);
}

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

/* ==============================================================================
   AUTH & LOGIN PAGE
   ============================================================================== */
.auth-page {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.auth-card {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 36px;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan));
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  box-shadow: var(--shadow-glow-blue);
  margin-bottom: 16px;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.4;
}

.auth-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 12px;
}

.auth-mode-pill.paper {
  background: var(--color-buy-bg);
  color: var(--color-buy);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.auth-mode-pill.live {
  background: var(--color-sell-bg);
  color: var(--color-sell);
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: var(--shadow-glow-red);
}

.auth-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.auth-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.auth-step-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

.auth-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.auth-step-item.active .auth-step-num {
  background: var(--accent-indigo);
  color: #fff;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 12px;
}

.auth-session-box {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.auth-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.auth-btn-large {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

/* ==============================================================================
   SIDE-BY-SIDE SPLIT VIEW & CENTER ATM OPTION CHAIN STYLES
   ============================================================================== */

.split-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .split-container {
    grid-template-columns: 1fr;
  }
}

.split-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  backdrop-filter: var(--glass-blur);
}

.panel-header {
  padding: 12px 16px;
  background: rgba(15, 20, 34, 0.85);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-symbol {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.panel-exchange {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

.panel-price {
  font-size: 1.2rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}

.price-up {
  color: var(--color-buy) !important;
}

.price-down {
  color: var(--color-sell) !important;
}

.price-change-badge {
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 8px;
  border-radius: 4px;
}

.price-change-badge.up {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.price-change-badge.down {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* Quick Trading Buttons */
.trade-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-trade-buy {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-trade-buy:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-trade-sell {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-trade-sell:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Chart Canvas Container */
.chart-container-box {
  position: relative;
  width: 100%;
  height: 480px;
  background: #090c15;
  border-bottom: 1px solid var(--border-color);
}

.chart-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Feed Toggle and TradingView External Link Buttons */
.btn-feed {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-feed.active {
  background: var(--accent-indigo);
  color: #fff;
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.4);
}

.btn-feed:hover:not(.active) {
  color: #fff;
}

.btn-tv-ext {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-tv-ext:hover {
  background: rgba(6, 182, 212, 0.25);
  color: #fff;
}

/* Action Bar Bottom Tabs */
.action-sub-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(10, 13, 20, 0.9);
  border-top: 1px solid var(--border-color);
  overflow-x: auto;
}

.action-tab-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.action-tab-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-indigo);
  color: #a5b4fc;
}

/* Center ATM Option Chain List Styling */
.option-chain-wrapper {
  padding: 12px;
  background: rgba(15, 20, 34, 0.5);
  max-height: 420px;
  overflow-y: auto;
  border-bottom: 1px solid var(--border-color);
}

.option-chain-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
}

.option-chain-table th {
  padding: 8px;
  background: rgba(9, 12, 21, 0.95);
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--border-color);
}

.option-chain-table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;
  transition: background 0.15s ease;
}

.option-chain-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.option-chain-table tr.atm-row {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15)) !important;
  border-top: 2px solid var(--accent-indigo) !important;
  border-bottom: 2px solid var(--accent-indigo) !important;
}

.option-chain-table tr.atm-row td {
  font-weight: 700;
}

.badge-atm {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  margin-left: 4px;
}

.strike-price-cell {
  font-size: 0.9rem;
  font-weight: 800;
  color: #f3f4f6;
  background: rgba(18, 24, 38, 0.8);
}

.opt-select-btn {
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.opt-select-btn.ce {
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.opt-select-btn.ce:hover, .opt-select-btn.ce.selected {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--color-buy);
}

.opt-select-btn.pe {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.opt-select-btn.pe:hover, .opt-select-btn.pe.selected {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--color-sell);
}

/* Quick Stock Search Header Input */
.stock-search-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.stock-search-input {
  background: rgba(15, 20, 34, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px 6px 32px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  width: 180px;
  transition: all 0.2s ease;
}

.stock-search-input:focus {
  outline: none;
  border-color: var(--accent-indigo);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
  width: 220px;
}

.search-icon-inside {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

/* Stock Suggestion Dropdown */
.stock-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 290px;
  max-width: 380px;
  max-height: 280px;
  overflow-y: auto;
  background: rgba(15, 20, 34, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);
  z-index: 1050;
  display: none;
}

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

.stock-suggestion-item:last-child {
  border-bottom: none;
}

.stock-suggestion-item:hover,
.stock-suggestion-item.active {
  background: rgba(99, 102, 241, 0.22);
}

.stock-suggestion-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  text-align: left;
}

.stock-suggestion-symbol {
  font-weight: 700;
  font-size: 0.88rem;
  color: #f1f5f9;
  letter-spacing: 0.02em;
}

.stock-suggestion-symbol mark {
  background: rgba(99, 102, 241, 0.4);
  color: #fff;
  border-radius: 2px;
  padding: 0 1px;
}

.stock-suggestion-name {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.stock-suggestion-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-left: 10px;
  flex-shrink: 0;
}

.stock-suggestion-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.stock-suggestion-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.stock-suggestion-empty,
.stock-suggestion-loading {
  padding: 12px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}


