/* ==============================================================================
   ANTIGRAVITY TRADING BOT — STYLING & DESIGN SYSTEM
   Cyberpunk / Institutional Trading Desk Dark Mode with Glassmorphism
============================================================================== */

:root {
  --bg-base: #080c14;
  --bg-surface: #0f1624;
  --bg-card: rgba(18, 26, 42, 0.75);
  --bg-card-hover: rgba(26, 36, 58, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.35);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  --font-main: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

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

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.04) 0%, transparent 40%);
}

/* --------------------------------------------------------------------------
   HEADER & NAVIGATION — ULTRA COMPACT SINGLE ROW (52px MAX)
-------------------------------------------------------------------------- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  min-height: 52px;
  height: 52px;
  background: rgba(10, 14, 23, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: nowrap;
  gap: 12px;
  box-sizing: border-box;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-left .logo-pulse {
  width: 32px;
  height: 32px;
  font-size: 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.4);
  animation: pulseLogo 3s infinite alternate;
}

@keyframes pulseLogo {
  0% { transform: scale(0.98); box-shadow: 0 0 10px rgba(14, 165, 233, 0.3); }
  100% { transform: scale(1.02); box-shadow: 0 0 18px rgba(99, 102, 241, 0.5); }
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-algo {
  font-size: 10px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

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

.header-center .market-status-badge {
  display: none;
}

@media (min-width: 1550px) {
  .header-center .market-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-subtle);
    white-space: nowrap;
  }
}

.market-status-badge.badge-open {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--accent-emerald);
}

.market-status-badge.badge-closed {
  background: rgba(100, 116, 139, 0.15);
  border-color: rgba(100, 116, 139, 0.3);
  color: var(--text-secondary);
}

.market-status-badge.badge-holiday {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--accent-amber);
}

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

.status-pulse-dot.pulse-open {
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

.status-pulse-dot.pulse-closed {
  background: var(--text-muted);
}

.status-pulse-dot.pulse-holiday {
  background: var(--accent-amber);
  box-shadow: 0 0 6px var(--accent-amber);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.btn-token-compact {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 5px 10px;
  font-size: 11px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-token-compact:hover {
  background: rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.header-quick-stats {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-user-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-hdr-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-hdr-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-logout-prominent {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #fca5a5;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
  transition: all 0.2s ease;
}

.btn-logout-prominent:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.55);
  transform: translateY(-1px);
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  white-space: nowrap;
}


.stat-badge .lbl {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}

.stat-badge .val {
  font-weight: 700;
}

.stat-badge .vix-chg {
  font-size: 10px;
  margin-left: 2px;
}

.funds-compact .val {
  color: var(--accent-emerald);
}

.broker-funds-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
}

.funds-label {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.funds-val {
  color: var(--accent-emerald);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.3px;
}

/* --------------------------------------------------------------------------
   PILLS & BUTTON CONTROLS
-------------------------------------------------------------------------- */
.instrument-selector, .mode-selector {
  display: flex;
  background: rgba(8, 12, 20, 0.85);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.inst-pill, .mode-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.inst-pill.active {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.4);
}

.mode-pill.active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.master-controls {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
}

.btn-action {
  border: none;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-start {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  padding: 5px 12px;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.btn-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.5);
}

.btn-stop {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 5px 8px;
}

.btn-stop:hover {
  background: rgba(245, 158, 11, 0.25);
}

.btn-kill {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  padding: 5px 8px;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.btn-kill:hover {
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
}

/* Master Control Active & Responsive States */
.btn-start.running {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.75), inset 0 0 8px rgba(255, 255, 255, 0.3) !important;
  border: 1px solid #34d399 !important;
}

.btn-start.running .icon {
  display: inline-block;
  animation: pulse-dot 1.2s infinite ease-in-out;
  color: #a7f3d0;
}

.btn-stop.paused {
  background: rgba(245, 158, 11, 0.25) !important;
  border: 1px solid rgba(245, 158, 11, 0.8) !important;
  color: #fde68a !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45) !important;
}

.btn-action.btn-busy {
  opacity: 0.75;
  pointer-events: none;
  cursor: wait !important;
  filter: brightness(0.9);
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.5; }
}

/* Executive Toast Notification System */
.toast-container {
  position: fixed;
  top: 68px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 420px;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.15);
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-item.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-item.toast-success {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.35);
}

.toast-item.toast-warning {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.35);
}

.toast-item.toast-danger {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(239, 68, 68, 0.35);
}

.toast-item.toast-info {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.35);
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast-title {
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}

.toast-desc {
  font-size: 11px;
  color: #94a3b8;
}

/* --------------------------------------------------------------------------
   SOUND CONTROLS & DROPDOWN
-------------------------------------------------------------------------- */
.sound-control-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-sound {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding: 5px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.btn-sound:hover {
  background: rgba(14, 165, 233, 0.28);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.btn-sound.muted {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
  border-color: rgba(100, 116, 139, 0.3);
}

.btn-sound-menu {
  background: rgba(14, 165, 233, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-left: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding: 5px 7px;
  font-size: 11px;
}

.btn-sound-menu:hover {
  background: rgba(14, 165, 233, 0.25);
}

.sound-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  padding: 6px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sound-dropdown-header {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2px;
}

.sound-drop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.sound-drop-item:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateX(2px);
}

.sound-drop-item .badge-test {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.sound-drop-item:hover .badge-test {
  background: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

/* Audio Autoplay Floating Banner */
.audio-unlock-banner {
  position: sticky;
  top: 0;
  z-index: 9998;
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.95), rgba(37, 99, 235, 0.95));
  color: #ffffff;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
  font-size: 13px;
  cursor: pointer;
  animation: pulseUnlockBanner 2s infinite ease-in-out;
}

@keyframes pulseUnlockBanner {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 1; filter: brightness(1.1); }
}

.btn-unlock-sound {
  background: #ffffff;
  color: #0284c7;
  font-weight: 800;
  font-size: 12px;
  border: none;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* --------------------------------------------------------------------------
   STATE BADGES
-------------------------------------------------------------------------- */
.badge-state {
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.state-scanning { background: rgba(56, 189, 248, 0.15); color: var(--accent-cyan); border: 1px solid var(--accent-cyan); }
.state-intrade { background: rgba(16, 185, 129, 0.2); color: var(--accent-emerald); border: 1px solid var(--accent-emerald); }
.state-cooldown { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid var(--accent-amber); }
.state-stopped { background: rgba(100, 116, 139, 0.2); color: var(--text-muted); border: 1px solid var(--text-muted); }
.state-halted { background: rgba(244, 63, 94, 0.2); color: var(--accent-rose); border: 1px solid var(--accent-rose); }

/* --------------------------------------------------------------------------
   MAIN GRID & CARDS
-------------------------------------------------------------------------- */
.dashboard-container {
  padding: 24px 28px 80px 28px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s ease;
}

.metric-card:hover {
  border-color: rgba(56, 189, 248, 0.25);
}

.metric-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.metric-value-huge {
  font-size: 30px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin: 6px 0;
}

.metric-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin: 8px 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-online { background: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }
.dot-offline { background: var(--accent-rose); box-shadow: 0 0 8px var(--accent-rose); }

.quick-links {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent-cyan);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  font-family: var(--font-main);
}
.btn-text:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   TRADER'S MIND CARD
-------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.radar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pingRadar 1.5s infinite cubic-bezier(0, 0, 0.2, 1);
}

@keyframes pingRadar {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.badge-tag {
  font-size: 11px;
  font-family: var(--font-mono);
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.card-body {
  padding: 20px 24px;
}

.thought-block, .plan-block {
  margin-bottom: 14px;
}
.plan-block { margin-bottom: 0; }

.thought-badge, .plan-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.thought-badge { color: var(--accent-cyan); }
.plan-badge { color: var(--accent-amber); }

.thought-text, .plan-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   ACTIVE POSITION CARD
-------------------------------------------------------------------------- */
.badge-mini {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 700;
}
.badge-flat { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

.time-stop-tag {
  font-size: 12px;
  font-family: var(--font-mono);
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.empty-state {
  text-align: center;
  padding: 24px 0;
}

.empty-icon { font-size: 32px; margin-bottom: 8px; }
.empty-title { font-size: 15px; font-weight: 700; color: var(--text-secondary); }
.empty-desc { font-size: 13px; color: var(--text-muted); max-width: 440px; margin: 4px auto 0; }

.active-trade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  padding: 6px 0;
}

.trade-col {
  display: flex;
  flex-direction: column;
}

.trade-col .lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.trade-col .val {
  font-size: 18px;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   5-GATE CONFIRMATION FLOW
-------------------------------------------------------------------------- */
.sub-note { font-size: 12px; color: var(--text-muted); }

.gates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 18px;
}

.gate-tile {
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.gate-tile.gate-pass {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}

.gate-tile.gate-fail {
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.05);
}

.gate-tile-ai {
  border-color: rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.04);
}

.gate-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.gate-num {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.gate-status {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.gate-status.status-pass { background: rgba(16, 185, 129, 0.2); color: var(--accent-emerald); }
.gate-status.status-fail { background: rgba(244, 63, 94, 0.2); color: var(--accent-rose); }
.gate-status.status-wait { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }

.gate-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.gate-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   LOG TERMINAL
-------------------------------------------------------------------------- */
.card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-log-action {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.btn-log-action:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.btn-log-download {
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

.btn-log-download:hover {
  background: rgba(56, 189, 248, 0.22);
  color: #ffffff;
  border-color: var(--accent-cyan);
}

.log-terminal {
  background: #060910;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 14px 18px;
  height: 180px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-line {
  display: flex;
  gap: 12px;
  line-height: 1.5;
}

.log-time { color: var(--text-muted); }
.log-lvl-INFO { color: var(--accent-cyan); }
.log-lvl-WARNING { color: var(--accent-amber); }
.log-lvl-ERROR { color: var(--accent-rose); }
.log-msg { color: var(--text-secondary); word-break: break-all; }

/* --------------------------------------------------------------------------
   MODAL & MOBILE BAR
-------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.modal-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

.modal-box input {
  width: 100%;
  background: #080c14;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 20px;
  text-align: center;
  letter-spacing: 6px;
  outline: none;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.btn-modal {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  border: none;
}
.btn-cancel { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }
.btn-confirm { background: var(--accent-cyan); color: #000; }

.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 22, 36, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  padding: 8px 12px;
  justify-content: space-around;
  z-index: 99;
}

.mob-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 8px;
}

.mob-icon { font-size: 18px; }
.mob-btn-start { color: var(--accent-emerald); }
.mob-btn-stop { color: var(--accent-amber); }
.mob-btn-kill { color: var(--accent-rose); }

/* Colors Utilities */
.text-accent { color: var(--accent-cyan); }
.text-success { color: var(--accent-emerald); }
.text-danger { color: var(--accent-rose); }
.text-cyan { color: #22d3ee; }
.text-neutral { color: var(--text-secondary); }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }

/* --------------------------------------------------------------------------
   RESPONSIVE QUERIES
-------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 16px 16px 80px 16px;
  }
  .master-controls {
    display: none; /* Accessible via mobile bottom bar */
  }
  .mobile-bottom-bar {
    display: flex;
  }
  .metric-value-huge {
    font-size: 24px;
  }
}

/* --------------------------------------------------------------------------
   INDIA VIX BADGE & ADAPTIVE CONFLUENCE ENGINE GAUGE
-------------------------------------------------------------------------- */
.vix-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.35);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
}

.vix-label {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.vix-val {
  color: #a78bfa;
  font-weight: 800;
  font-size: 13px;
}

.vix-chg {
  font-size: 11px;
  font-weight: 600;
}

.confluence-banner {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.confluence-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.confluence-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-chip {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.regime-badge {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.confluence-score-box {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.score-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.score-number {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
}

.score-max {
  color: var(--text-muted);
  font-size: 14px;
}

.verdict-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-left: 8px;
  letter-spacing: 0.5px;
}

.verdict-ready {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.verdict-wait {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.confluence-bar-container {
  position: relative;
  width: 100%;
  height: 14px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-full);
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.confluence-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fill-actionable {
  background: linear-gradient(90deg, #10b981, #06b6d4);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.5);
}

.fill-building {
  background: linear-gradient(90deg, #f59e0b, #38bdf8);
}

.fill-low {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}

.confluence-threshold-line {
  position: absolute;
  top: -8px;
  left: 75%;
  height: 30px;
  width: 2px;
  background: #f43f5e;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.6);
  z-index: 2;
}

.threshold-label {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 800;
  color: #f43f5e;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.confluence-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.chip-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  text-align: center;
}

/* ==============================================================================
   MARKET STATUS & HOLIDAY BANNER STYLES
============================================================================== */
.market-status-badge {
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.market-status-badge.badge-open {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.market-status-badge.badge-holiday {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--accent-amber);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.market-status-badge.badge-closed {
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

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

.pulse-open {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

.pulse-holiday {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
  animation: pulseDot 2s infinite;
}

.pulse-closed {
  background: var(--text-muted);
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.btn-token {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.15));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  font-weight: 700;
}

.btn-token:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(99, 102, 241, 0.25));
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

/* Market Session Banner Card */
.market-session-banner {
  background: linear-gradient(135deg, rgba(18, 26, 42, 0.85), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.session-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.session-indicator-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.session-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
}

.session-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.session-pill {
  font-size: 10px;
  padding: 2px 10px;
}

.session-pill.status-open {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.session-pill.status-holiday, .session-pill.status-weekend {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.session-pill.status-closed {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.session-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.session-meta {
  display: flex;
  gap: 20px;
  align-items: center;
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.meta-lbl {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.meta-val {
  font-size: 13px;
  color: var(--accent-cyan);
  font-weight: 600;
}

.upcoming-holidays-bar {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.holidays-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.holidays-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.holiday-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.holiday-chip .h-name {
  font-weight: 600;
  color: var(--text-primary);
}

.holiday-chip .h-date {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 10px;
}

.holiday-chip.chip-soon {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}

.holiday-chip.chip-today {
  border-color: rgba(244, 63, 94, 0.5);
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
}

/* ==============================================================================
   LOSS BUFFER & MAX LOSS METRIC CARD
============================================================================== */
.loss-buffer-wrapper {
  margin: 6px 0;
  width: 100%;
}

.loss-buffer-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.loss-buffer-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease, background 0.4s ease;
}

.loss-buffer-fill.fill-safe {
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.loss-buffer-fill.fill-warning {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.loss-buffer-fill.fill-danger {
  background: linear-gradient(90deg, #f43f5e, #e11d48);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.5);
}

.token-sub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.token-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.token-online {
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

.token-offline {
  background: var(--accent-rose);
  box-shadow: 0 0 6px var(--accent-rose);
}

.btn-text.highlight {
  color: var(--accent-cyan);
  font-weight: 700;
}

/* ==============================================================================
   INSTITUTIONAL RISK MATRIX CARD
============================================================================== */
.risk-matrix-card {
  margin-bottom: 20px;
}

.risk-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding: 16px 20px;
}

.risk-tile {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.risk-tile:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(56, 189, 248, 0.25);
  transform: translateY(-2px);
}

.risk-tile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.risk-tile-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.risk-tile-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
}

.badge-limit {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-info {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-halted {
  background: rgba(244, 63, 94, 0.25);
  color: #fff;
  border: 1px solid var(--accent-rose);
  animation: pulseLogo 1.5s infinite;
}

.risk-tile-val {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.risk-tile-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.risk-tile-sub {
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 6px;
}

/* ==============================================================================
   UPSTOX SEAMLESS TOKEN MODAL
============================================================================== */
.token-modal-box {
  max-width: 540px;
  width: 92%;
  padding: 24px;
}

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

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.token-banner {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0;
}

.token-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.token-badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.token-banner-status {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.token-banner-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.token-banner-right {
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-emerald);
}

.token-option-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.option-title-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.option-num {
  width: 22px;
  height: 22px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.option-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.option-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.option-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-token-login {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-token-login:hover {
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.5);
  transform: translateY(-1px);
}

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

.totp-display-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.totp-code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
}

.totp-code-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 2px;
}

.totp-countdown {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.btn-copy-totp {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-totp:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-cyan);
}

.token-input-group {
  display: flex;
  gap: 8px;
}

.token-input-group input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font-mono);
}

.token-input-group input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.btn-apply-token {
  background: var(--accent-cyan);
  color: #080c14;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-apply-token:hover {
  background: #7dd3fc;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.token-feedback-msg {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.token-feedback-msg.feedback-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.token-feedback-msg.feedback-error {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.token-feedback-msg.feedback-info {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* --------------------------------------------------------------------------
   SLIM MARKET HOLIDAY & SESSION RIBBON (32px)
-------------------------------------------------------------------------- */
.market-ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  gap: 12px;
  overflow: hidden;
}

.ribbon-left {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ribbon-right {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.session-pill-mini {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-family: var(--font-mono);
}

.holidays-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.holidays-chips-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.holiday-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 10px;
  font-family: var(--font-mono);
}

.holiday-chip.chip-soon {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--accent-amber);
}

.holiday-chip.chip-today {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
  color: var(--accent-rose);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   DEDICATED CONTROLS & DIAGNOSTICS BAR
-------------------------------------------------------------------------- */
.controls-diagnostics-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.control-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-box-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.test-btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-diag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-diag:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-test-conn {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}
.btn-test-conn:hover {
  background: rgba(56, 189, 248, 0.2);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.btn-test-ai {
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.35);
  background: rgba(192, 132, 252, 0.08);
}
.btn-test-ai:hover {
  background: rgba(192, 132, 252, 0.2);
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.3);
}

.btn-test-token {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}
.btn-test-token:hover {
  background: rgba(251, 191, 36, 0.2);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

/* Card 4 System & Broker Card Action Buttons */
.server-ip-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 0 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.server-ip-code {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

.card-action-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.btn-card-action {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  flex: 1;
  justify-content: center;
  white-space: nowrap;
}

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

.btn-card-conn {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.25);
}

.btn-card-ai {
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.25);
}

.btn-card-token {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.25);
}

/* --------------------------------------------------------------------------
   TOKEN MODAL EXTENSIONS (REDIRECT SELECTOR & CONFIG)
-------------------------------------------------------------------------- */
.redirect-selector-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.select-redirect {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 4px 8px;
  font-size: 11px;
  outline: none;
}

.select-redirect:focus {
  border-color: var(--accent-cyan);
}

.credentials-details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  margin-top: 8px;
}

.credentials-summary {
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  outline: none;
}

.credentials-summary:hover {
  color: var(--accent-cyan);
}

.credentials-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

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

.form-row input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 12px;
}

.form-row input:focus {
  border-color: var(--accent-cyan);
  outline: none;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.btn-save-creds {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.btn-save-creds:hover {
  background: rgba(56, 189, 248, 0.25);
}

.cred-save-msg {
  font-size: 11px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   RESPONSIVE HEADER SCALING (PREVENT DESKTOP CRAMMING & COLLISION)
-------------------------------------------------------------------------- */
@media (max-width: 1400px) {
  .header-quick-stats {
    display: none !important;
  }
}

@media (max-width: 1240px) {
  #soundLabel {
    display: none !important;
  }
  .btn-hdr-link span {
    font-size: 11px;
  }
  .header-user-actions {
    gap: 5px;
    padding-left: 8px;
  }
}

/* ==============================================================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM (MOBILE & TABLET OPTIMIZATION)
============================================================================== */

/* Modal Mobile Scrolling & Viewport Containment */
.modal-overlay {
  padding: 12px;
  overflow-y: auto;
}

.modal-box {
  max-width: 380px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

.token-modal-box {
  max-width: 540px;
  width: 96%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 18px;
  box-sizing: border-box;
}

/* User Profile Clean Header Pill */
.user-pill-clean {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  color: #f8fafc;
}

.user-avatar-icon {
  font-size: 13px;
}

.user-name-txt {
  font-weight: 700;
  color: #ffffff;
  font-size: 12px;
}

.role-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.role-badge.role-admin {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.role-badge.role-trader {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.btn-logout-clean {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout-clean:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Active Instrument Static Pill (Single NIFTY 50 Badge) */
.active-instrument-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  color: #f8fafc;
}

.inst-live-indicator {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGreenDot 2s infinite ease-in-out;
}

@keyframes pulseGreenDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.inst-sub {
  font-size: 9px;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* Daily Disclaimer Responsive Modal Dialog */
.daily-disclaimer-box {
  max-width: 520px;
  width: 94%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.2);
  text-align: left;
  box-sizing: border-box;
}

.disclaimer-modal-title {
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.daily-disclaimer-scrollable {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 6px;
  margin-bottom: 14px;
}

.disclaimer-intro {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 10px;
}

.sebi-stat-card {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  color: #fca5a5;
  font-size: 12px;
  line-height: 1.45;
}

.sebi-stat-title {
  font-weight: 700;
  color: #f87171;
  margin-bottom: 4px;
}

.disclaimer-points-list {
  padding-left: 18px;
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.55;
}

.disclaimer-points-list li {
  margin-bottom: 6px;
}

.disclaimer-agreement-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
}

.disclaimer-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 12px;
  color: #f8fafc;
  line-height: 1.4;
}

.disclaimer-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 1px;
  accent-color: #10b981;
  cursor: pointer;
}

.disclaimer-checkbox-label a {
  color: #10b981;
  text-decoration: underline;
}

.disclaimer-actions-bar {
  display: flex;
  gap: 10px;
}

.btn-cancel-disclaimer {
  flex: 0 0 100px;
  text-decoration: none;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
}

.btn-confirm-disclaimer {
  flex: 1;
  background: #10b981;
  color: #000000;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

@media (max-width: 600px) {
  .daily-disclaimer-box {
    width: 95%;
    max-height: 90vh;
    padding: 14px;
  }
  .disclaimer-actions-bar {
    flex-direction: column-reverse;
  }
  .btn-cancel-disclaimer, .btn-confirm-disclaimer {
    width: 100%;
    flex: none;
    padding: 12px;
    font-size: 14px;
  }
}

/* Tablet Layout (<= 900px) */
@media (max-width: 900px) {
  .app-header {
    padding: 8px 14px;
    height: auto;
    min-height: 50px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .dashboard-container {
    padding: 12px 12px 85px 12px;
    gap: 12px;
  }
}

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  .app-header {
    height: auto !important;
    min-height: 48px !important;
    padding: 8px 12px !important;
    gap: 8px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
  }

  .header-left {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .header-center {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    gap: 8px !important;
    margin: 2px 0 !important;
  }

  .header-right {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .master-controls {
    display: flex !important;
    gap: 4px !important;
  }

  .btn-action {
    padding: 5px 10px !important;
    font-size: 11px !important;
  }

  .user-name-txt {
    max-width: 110px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .brand-name {
    font-size: 13px !important;
  }

  .badge-state {
    font-size: 9px !important;
    padding: 2px 6px !important;
  }

  .btn-token-compact {
    padding: 4px 8px !important;
    font-size: 10px !important;
  }

  /* Market Ribbon Mobile Layout */
  .market-ribbon {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
    font-size: 11px;
  }

  .ribbon-left {
    white-space: normal;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 11px;
  }

  .ribbon-right {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  /* Grid Metrics: 1 column on mobile */
  .grid-metrics {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .metric-card {
    padding: 14px 16px;
  }

  .metric-value-huge {
    font-size: 26px;
  }

  /* Card Headers */
  .card-header {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .card-title {
    font-size: 11px;
    letter-spacing: 0.3px;
    flex-wrap: wrap;
  }

  /* Institutional Risk Matrix Grid: 1 column on phones */
  .risk-matrix-grid {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 10px;
  }

  .risk-tile {
    padding: 12px 14px;
  }

  .risk-tile-val {
    font-size: 16px;
  }

  /* 5-Gate Confirmation Flow Grid: 1 column on mobile */
  .gates-grid {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 10px;
  }

  /* Controls & Diagnostics Bar Mobile Layout */
  .controls-diagnostics-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }

  .control-box {
    justify-content: space-between;
    width: 100%;
  }

  .test-btn-row {
    width: 100%;
    display: flex;
  }

  .btn-diag {
    flex: 1;
    justify-content: center;
    padding: 6px 4px;
    font-size: 10px;
  }

  /* Confluence Banner */
  .confluence-banner {
    padding: 12px 14px;
    gap: 10px;
  }

  .confluence-chips-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  /* Active Trade Grid */
  .active-trade-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* Log Terminal */
  .log-terminal {
    height: 160px;
    padding: 10px 12px;
    font-size: 11px;
  }

  .log-line {
    font-size: 11px;
    gap: 6px;
  }

  .log-time {
    font-size: 10px;
  }

  /* Mobile Bottom Navigation Bar: Visible & Touch-Optimized */
  .mobile-bottom-bar {
    display: flex !important;
    padding: 6px 4px;
  }

  .mob-btn {
    font-size: 10px;
    padding: 3px 4px;
    flex: 1;
    min-width: 0;
  }

  .mob-icon {
    font-size: 16px;
  }

  /* Main Container bottom spacing for fixed nav */
  .dashboard-container {
    padding: 10px 10px 85px 10px;
    gap: 12px;
  }
}

/* Small Handsets (<= 380px) */
@media (max-width: 380px) {
  .brand-name .badge-algo {
    display: none;
  }

  .app-header {
    padding: 0 8px !important;
  }

  .mob-btn span:last-child {
    font-size: 9px;
  }
}

/* --------------------------------------------------------------------------
   COOLDOWN OVERRIDE BANNER & GREEKS SENTINEL STYLES
-------------------------------------------------------------------------- */
.cooldown-override-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(244, 63, 94, 0.12) 100%);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.2);
  animation: bannerPulse 2s infinite alternate;
}

@keyframes bannerPulse {
  0% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.4); }
  100% { box-shadow: 0 0 28px rgba(245, 158, 11, 0.35); border-color: rgba(245, 158, 11, 0.8); }
}

.override-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.override-pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 1; }
}

.override-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.override-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f59e0b;
  text-transform: uppercase;
}

.override-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}

.override-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.override-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-override-execute {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.btn-override-execute:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.7);
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.btn-override-dismiss {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-override-dismiss:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.decay-sentinel-tag, .time-stop-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.decay-sentinel-tag span {
  font-weight: 700;
}

.decay-safe {
  color: var(--accent-emerald) !important;
}

.decay-warning {
  color: var(--accent-amber) !important;
}

.decay-alert {
  color: var(--accent-rose) !important;
}

/* --------------------------------------------------------------------------
   STICKY COOLDOWN OVERRIDE BANNER
-------------------------------------------------------------------------- */
.sticky-cooldown-alert {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: linear-gradient(90deg, #d97706, #f59e0b, #e11d48);
  color: #ffffff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.5);
  animation: stickyGlow 1.5s infinite alternate;
}

@keyframes stickyGlow {
  0% { box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4); }
  100% { box-shadow: 0 4px 30px rgba(244, 63, 94, 0.7); }
}

.sticky-alert-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
}

.sticky-pulse {
  font-size: 1.25rem;
  animation: pulseDot 0.8s infinite alternate;
}

.sticky-alert-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-sticky-execute {
  background: #000000;
  color: #f59e0b;
  border: 1px solid #000000;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sticky-execute:hover {
  background: #18181b;
  color: #fbbf24;
  transform: scale(1.04);
}

.btn-sticky-dismiss {
  background: rgba(0, 0, 0, 0.3);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

.state-cooldown_override {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(244, 63, 94, 0.25)) !important;
  color: #f59e0b !important;
  border-color: #f59e0b !important;
  animation: pulseDot 1s infinite alternate;
}

/* --------------------------------------------------------------------------
   EXIT-AT-COST & MOMENTUM STALLING UI
-------------------------------------------------------------------------- */
.sticky-exit-cost-alert {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: linear-gradient(90deg, #b45309, #991b1b, #b45309);
  background-size: 200% 100%;
  color: #ffffff;
  border-bottom: 2px solid #f59e0b;
  box-shadow: 0 4px 25px rgba(245, 158, 11, 0.6);
  animation: pulseGlowExit 2.5s infinite alternate;
}

@keyframes pulseGlowExit {
  0% { box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4); }
  100% { box-shadow: 0 4px 30px rgba(239, 68, 68, 0.7); }
}

.btn-sticky-exit-cost {
  background: #f43f5e;
  color: #ffffff;
  border: 1px solid #fda4af;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sticky-exit-cost:hover {
  background: #e11d48;
  transform: scale(1.04);
}

.btn-sticky-trail-be {
  background: #0d9488;
  color: #ffffff;
  border: 1px solid #5eead4;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sticky-trail-be:hover {
  background: #0f766e;
  transform: scale(1.04);
}

.exit-cost-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(244, 63, 94, 0.12));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  animation: borderPulseAmber 2s infinite alternate;
}

@keyframes borderPulseAmber {
  0% { border-color: rgba(245, 158, 11, 0.3); }
  100% { border-color: rgba(244, 63, 94, 0.6); }
}

.exit-cost-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.exit-cost-pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
  animation: pulseDot 0.8s infinite alternate;
}

.exit-cost-badge {
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #f59e0b;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.exit-cost-title {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
}

.exit-cost-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.exit-cost-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-exit-cost-execute {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #ffffff;
  border: 1px solid rgba(244, 63, 94, 0.5);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-exit-cost-execute:hover {
  background: #be123c;
  transform: translateY(-1px);
}

.btn-exit-cost-trail {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-exit-cost-trail:hover {
  background: rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-exit-cost-dismiss {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-exit-cost-dismiss:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   LOT ADJUSTER COMPONENT STYLING
-------------------------------------------------------------------------- */
.lot-adjuster-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lot-adjuster-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lot-stepper {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 32px;
}

.btn-lot-step {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-primary);
  width: 32px;
  height: 100%;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-lot-step:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
}

.lot-display {
  padding: 0 10px;
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 120px;
  justify-content: center;
}

.lot-count-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.lot-count-unit {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.lot-count-unit .qty-sub {
  color: #34d399;
}

.lot-presets {
  display: flex;
  gap: 4px;
  align-items: center;
}

.lot-preset-btn {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  height: 32px;
}

.lot-preset-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.lot-preset-btn.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

/* ==========================================================================
   INSTITUTIONAL EXECUTION STEPPER & CONFLUENCE RADAR (CLIENT COCKPIT)
   ========================================================================== */

.pillar-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  margin-right: 6px;
}

.client-defense-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 1.25rem;
}

@media (max-width: 900px) {
  .client-defense-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.defense-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.defense-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.defense-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.defense-icon {
  font-size: 20px;
  line-height: 1;
}

.defense-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
}

.defense-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #94a3b8;
  text-transform: uppercase;
}

.defense-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.2);
  letter-spacing: 0.3px;
}

.defense-badge.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.defense-badge.badge-armed {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.defense-badge.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.defense-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.defense-metric {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.3px;
}

.defense-desc {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

/* Daily Executed Trades Journal Table */
.trades-journal-card {
  margin-top: 1.25rem;
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.trades-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.trades-table thead {
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.trades-table th {
  padding: 10px 14px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #94a3b8;
  text-transform: uppercase;
  white-space: nowrap;
}

.trades-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  white-space: nowrap;
}

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

.trades-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.trades-table tr.row-active-trade {
  background: rgba(56, 189, 248, 0.05);
  border-left: 3px solid #38bdf8;
}

.badge-side-buy {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-left: 4px;
}

.badge-trade-status {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-trade-status.status-open {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-trade-status.status-profit {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-trade-status.status-loss {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.badge-trade-status.status-neutral {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* ==========================================================================
   SUBSCRIPTION EXPIRY & RENEWAL ALERT RIBBON
   ========================================================================== */
.sub-alert-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  gap: 14px;
  backdrop-filter: blur(14px);
  z-index: 10;
  transition: all 0.2s ease;
}

.sub-alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
  color: #fef3c7;
}

.sub-alert-critical {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.25);
  color: #fecaca;
}

.sub-alert-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sub-alert-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.sub-alert-text {
  line-height: 1.4;
}

.sub-alert-text strong {
  color: #ffffff;
}

.sub-alert-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.3px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.sub-alert-btn-warning {
  background: #f59e0b;
  color: #0b0f19;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
}

.sub-alert-btn-warning:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.7);
}

.sub-alert-btn-danger {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
}

.sub-alert-btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.7);
}

@media (max-width: 640px) {
  .sub-alert-ribbon {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .sub-alert-btn {
    justify-content: center;
    width: 100%;
  }
}






