/* ============================================
   TRADING DASHBOARD CSS - COMPLETE & FIXED
   - All 3 issues fixed
   - Chart without panel wrapper
   - Table overlap fixed
   - Mobile crosshair fixed
   - Ready to copy-paste
   ============================================ */

/* ============================================
   CSS VARIABLES & BASE
   ============================================ */
/* Main CSS Variables are centralized in system.css */
/* Dashboard-specific color variants for trading UI */
:root {
  --bg: var(--bg-primary);
  --panel: var(--bg-secondary);
  --border: var(--border-primary);
  --text: var(--text-primary);
  --muted: var(--text-muted);
  --pos: var(--success);
  --neg: var(--danger);

  /* Positive (Green) color variants for trading UI */
  --pos-rgb: 16, 185, 129;
  --pos-0: rgba(var(--pos-rgb), 0);
  --pos-15: rgba(var(--pos-rgb), 0.15);
  --pos-3: rgba(var(--pos-rgb), 0.3);
  --pos-4: rgba(var(--pos-rgb), 0.4);

  /* Negative (Red) color variants for trading UI */
  --neg-rgb: 239, 68, 68;
  --neg-0: rgba(var(--neg-rgb), 0);
  --neg-15: rgba(var(--neg-rgb), 0.15);
  --neg-3: rgba(var(--neg-rgb), 0.3);
  --neg-4: rgba(var(--neg-rgb), 0.4);

  /* Blue color variants for trading UI */
  --blue-rgb: 59, 130, 246;
  --blue: rgb(var(--blue-rgb));
  --blue-15: rgba(var(--blue-rgb), 0.15);
  --blue-3: rgba(var(--blue-rgb), 0.3);
}

body.dashboard {
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
  height: auto;
  width: 100%;
  max-width: 100vw;
}

body.dashboard {
  display: flex;
  flex-direction: column;
}

/* Trading Paused Banner - Fixed position below navbar */
.trading-paused-banner {
  display: none; /* Hidden by default, shown via JS */
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(245, 158, 11, 0.12);
  border-top: 4px solid var(--bg-primary); /* Spacing from navbar */
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  font-size: 0.75rem;
  font-weight: 500;
  position: fixed;
  top: 64px; /* Navbar height desktop */
  left: 0;
  right: 0;
  z-index: 99; /* Very low - won't interfere with navbar dropdowns (z-index 10000) */
  height: auto;
  min-height: 32px;
  box-sizing: border-box;
  line-height: 1.3;
}

.trading-paused-banner svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  opacity: 0.85;
}

.trading-paused-banner span {
  text-align: center;
}

.trading-paused-banner span strong {
  color: #fcd34d;
  font-weight: 700;
}

body.dashboard .container {
  max-width: 100%;
  margin: 0 auto;
  padding: 100px 1.5rem 1rem 1.5rem;
  width: 100%;
  overflow-x: hidden;
  flex: 1 0 auto;
}

/* Adjust container when banner is visible - add extra padding for banner height */
body.dashboard.trading-paused .container {
  padding-top: 148px; /* 100px normal + 48px for banner */
}

body.dashboard footer {
  margin-top: auto;
  flex-shrink: 0;
}

body.dashboard footer .container {
  max-width: 100%;
  padding: 0 1.5rem;
}

.trading-grid {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 6px;
  margin-bottom: 8px;
  align-items: stretch;
  height: 850px;
  min-height: 850px;
  position: relative;
  z-index: 1;
  isolation: isolate;
}

.orderbook-col,
.center-col,
.trades-col {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  position: relative;
}

.orderbook-col {
  z-index: 3;
}

.center-col {
  z-index: 2;
}

.trades-col {
  z-index: 3;
}

.orderbook-col .panel,
.center-col .panel,
.trades-col .panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.orderbook-col>.panel,
.trades-col>.panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  padding: 0;
}

.trades-col .panel>h3 {
  flex-shrink: 0;
  padding: 12px 12px 4px 12px;
}

.trades-col .tabs {
  flex-shrink: 0;
  padding: 0 12px 8px 12px;
}

.trades-col .panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.trades-col .table-wrap {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 0;
}

.center-col {
  gap: 8px;
  height: 100%;
}

/* ============================================
   CHART PANEL - FIXED (WITHOUT WRAPPER)
   ============================================ */

/* Chart Panel - Transparent wrapper */
.chart-panel {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Chart Panel - Layout */
.center-col>.chart-panel {
  flex: 6 0 0;
  /* 60% of flex container (6 out of 10 total flex units) */
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-bottom: 8px !important;
}

.chart-box {
  position: relative;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-secondary) !important;
  border-radius: 10px !important;
  padding: 8px !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  flex: 1;
  min-height: 0;
  margin: 0 !important;
}

#candleChart {
  width: 100% !important;
  height: 70% !important;
  background: transparent !important;
  flex: 7;
  min-height: 0;
  position: relative;
  touch-action: pan-x pan-y !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

#volumeChart {
  width: 100% !important;
  height: 30% !important;
  background: transparent !important;
  flex: 3;
  min-height: 0;
  position: relative;
  touch-action: pan-x pan-y !important;
}

/* Order Panel - 40% of flex container (4 out of 10 total flex units) */
.center-col>.order-panel {
  flex: 4 0 0;
  /* 40% of flex container */
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  margin: 0;
}

/* Chart Tooltip Styles */
.chart-tooltip {
  font-family: var(--font-numeric);
  line-height: 1.5;
}

.chart-tooltip::-webkit-scrollbar {
  width: 4px;
}

.chart-tooltip::-webkit-scrollbar-thumb {
  background: var(--border-accent);
  border-radius: 2px;
}

/* Legend Container */
.chart-legend {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-titanium);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  z-index: 100;
  display: flex;
  gap: 12px;
  align-items: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  flex-wrap: wrap;
  max-width: calc(100% - 20px);
  transition: all 0.3s ease;
}

.chart-legend.minimized {
  padding: 8px;
  gap: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  justify-content: center;
  cursor: pointer;
}

.chart-legend.minimized .legend-toggle,
.chart-legend.minimized .legend-divider {
  display: none !important;
}

.chart-legend.minimized .legend-minimize-btn {
  margin: 0;
}

/* Legend Toggle Buttons */
.legend-toggle {
  font-family: var(--font-primary);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: rgba(71, 85, 105, 0.2);
  border: 1px solid var(--border-titanium);
  color: #64748b;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.legend-toggle:active {
  transform: scale(0.97);
}

.legend-toggle.active {
  background: var(--blue-15);
  border-color: rgba(168, 197, 218, 0.4);
  color: var(--text-primary);
}

.legend-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: opacity 0.2s ease;
}

.legend-label {
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.legend-divider {
  width: 1px;
  height: 20px;
  background: var(--border-titanium);
  margin: 0 4px;
}

.legend-minimize-btn {
  background: rgba(71, 85, 105, 0.2);
  border: 1px solid var(--border-titanium);
  color: var(--text-muted);
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  width: 28px;
  height: 28px;
}

.legend-minimize-btn:hover {
  background: rgba(71, 85, 105, 0.35);
  border-color: var(--border-accent);
  color: #cbd5e1;
}

/* ============================================
   PANEL BASE
   ============================================ */
.panel {
  /* Unified background: same as orderbook/trades panels */
  background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-overlay) 100%);
  border: 1px solid rgba(71, 85, 105, 0.25);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  contain: layout style;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: auto;
  margin: 0;
  will-change: transform;
  transform: translateZ(0);
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* Disabled panel hover for consistency */

/* ===== MOBILE COMPONENTS ===== */
.mobile-sticky-buttons {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-modal);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  z-index: 9998;
  gap: 12px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mobile-sticky-btn {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  color: #fff;
  transition: all var(--transition-fast);
  letter-spacing: 0.5px;
  will-change: transform, box-shadow;
}

.mobile-sticky-btn.buy {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.mobile-sticky-btn.sell {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 14px var(--neg-4);
}

.mobile-sticky-btn:active {
  transform: scale(0.98);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-order-modal {
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  align-items: flex-end;
}

.mobile-order-modal.show {
  display: flex !important;
}

/* Standalone mobile order content (no parent wrapper needed) */
.mobile-order-content {
  background: var(--bg-secondary);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 70vh;
  position: fixed;
  bottom: calc(var(--bottom-bar-height, 60px) + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  will-change: transform, opacity;
  transform: translate3d(0, 100%, 0);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out, visibility 0.3s;
  z-index: 1001;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  touch-action: none;
  -webkit-overflow-scrolling: auto;
}

.mobile-order-content.show {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  visibility: visible;
}

.market-order-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 10px 12px 8px 12px;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: 8px;
  font-size: 11.5px;
  color: rgba(250, 204, 21, 0.95);
  line-height: 1.3;
}

.market-order-notice svg {
  flex-shrink: 0;
  color: #fbbf24;
  width: 14px;
  height: 14px;
}

.market-order-notice span {
  flex: 1;
  font-weight: 500;
}

.order-panel-new .market-order-notice {
  margin: 4px 0;
  padding: 6px 10px;
  font-size: 10px;
  gap: 6px;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.2);
  border-radius: 6px;
  color: #facc15;
  min-height: 28px;
}

.order-panel-new .market-order-notice svg {
  width: 13px;
  height: 13px;
}

.mobile-order-modal .mobile-order-content {
  background: var(--bg-secondary);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-height: 85vh;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

@keyframes slideUpModal {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.mobile-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mobile-modal-title {
  font-size: clamp(18px, 3vw, 20px);
  font-weight: 700;
  margin: 0;
  color: #e2e8f0;
}

.mobile-modal-title.buy {
  color: var(--success);
}

.mobile-modal-title.sell {
  color: var(--danger);
}

.mobile-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--border-primary);
  color: #cbd5e1;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: all var(--transition-fast);
}

.mobile-close-btn:hover {
  background: var(--border-titanium);
}

.mobile-order-body {
  padding: 16px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-side-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0 16px;
  margin-top: 12px;
  border-bottom: 1px solid var(--border);
}

.mobile-side-tab {
  background: none;
  border: none;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mobile-side-tab.active {
  color: #e2e8f0;
  font-weight: 700;
}

.mobile-side-tab.active.buy {
  color: #22c55e;
}

.mobile-side-tab.active.sell {
  color: #ef4444;
}

.mobile-side-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
}

.mobile-order-tabs {
  margin: 8px 16px 0;
  padding-bottom: 0;
}

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

/* ========================================
   MOBILE ORDER FORM - CLEAN SIMPLE STYLING
   ======================================== */

/* Input Group Container */
.mobile-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Input Label - Always visible above */
.mobile-input-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  padding-left: 2px;
}

/* Input Wrapper with border */
.mobile-input-wrapper {
  display: flex;
  align-items: center;
  height: 44px;
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 8px;
  padding: 0 12px;
  transition: border-color 0.2s;
}

.mobile-input-wrapper:focus-within {
  border-color: #A8C5DA;
}

/* Input Field */
.mobile-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  font-size: 16px;
  background: transparent !important;
  border: none !important;
  color: var(--text);
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  padding: 0;
}

.mobile-input:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

.mobile-input::-webkit-outer-spin-button,
.mobile-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Input Suffix (USD, RDGH) */
.mobile-input-suffix {
  font-size: 13px;
  color: var(--muted);
  margin-left: 8px;
  flex-shrink: 0;
}

/* ========================================
   MOBILE SLIDER - Uses same desktop slider styles
   See .slider-container, .slider-markers, .slider-marker, .amount-slider-new
   ======================================== */
/* Mobile slider container - ensure proper positioning */
.mobile-slider {
  position: relative !important;
  width: 100% !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  margin: 8px 0 !important;
  order: unset !important;
}

/* Mobile slider markers - adjust alignment for thumb width */
.mobile-slider .slider-markers {
  position: absolute;
  top: 50%;
  /* Adjusted empirically to match thumb position at 0% and 100% */
  left: 8px;
  right: 8px;
  width: auto;
  height: 4px;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 0;
  pointer-events: none;
  padding: 0;
}

/* Mobile slider specific - make markers clickable */
.mobile-slider .slider-marker {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}

.mobile-slider .slider-marker:active {
  transform: scale(1.3);
}

/* Mobile slider input */
.mobile-slider .amount-slider-new {
  width: 100%;
  height: 4px;
  z-index: 1;
  position: relative;
}

/* Mobile slider tooltip */
.mobile-slider .slider-tooltip {
  position: absolute;
  top: -28px;
  left: 9px;
  transform: translateX(-50%);
  background: var(--tooltip-color, var(--success));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.mobile-slider .slider-tooltip::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--tooltip-color, var(--success));
}

/* Show tooltip on slider interaction */
.mobile-slider:active .slider-tooltip,
.mobile-slider:focus-within .slider-tooltip {
  opacity: 1;
}

/* ========================================
   MOBILE INFO SECTION
   ======================================== */
.mobile-info-section {
  background: rgba(30, 41, 59, 0.4);
  border-radius: 8px;
  padding: 10px 12px;
}

.mobile-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}

.mobile-info-label {
  font-size: 12px;
  color: var(--muted);
}

.mobile-info-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

/* ========================================
   MOBILE SUBMIT BUTTON
   ======================================== */
.mobile-submit-btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 4px;
}

.mobile-submit-btn.buy {
  background: var(--success);
  color: #fff;
}

.mobile-submit-btn.sell {
  background: var(--danger);
  color: #fff;
}

.mobile-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mobile Validation Message */
.mobile-validation {
  font-size: 12px;
  color: var(--danger);
  min-height: 16px;
}

.mobile-order-submit {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  color: #fff;
  margin-top: 16px;
  transition: all var(--transition-fast);
}

.mobile-order-submit.buy {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.mobile-order-submit.sell {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 14px var(--neg-3);
}

.mobile-order-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* Optimize for mobile devices */
@media (max-width: 768px) {

  html,
  body {
    min-height: 0 !important;
    height: auto !important;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.dashboard {
    min-height: 0 !important;
    height: auto !important;
  }

  .panel {
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
  }

  /* Mobile Trading Paused Banner - floating style like nav */
  .trading-paused-banner {
    position: fixed;
    top: calc(20px + 44px + 8px); /* nav top (20px) + nav height (44px) + gap (8px) */
    left: 20px;
    right: 20px;
    width: calc(100% - 40px);
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-size: 0.7rem;
    padding: 0.5rem 0.75rem;
    gap: 0.4rem;
    min-height: auto;
    height: auto;
    z-index: 99; /* Low z-index - won't interfere with dropdowns */
  }

  .trading-paused-banner svg {
    width: 12px;
    height: 12px;
  }

  body.dashboard.trading-paused .container {
    padding-top: 130px; /* space for floating nav + banner */
  }
}

/* Optimize for low-end devices */
@media (prefers-reduced-motion: reduce) {
  .panel {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: none;
  }
}

.chart-panel.panel {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  margin: 0 !important;
}

.panel h3 {
  flex-shrink: 0;
  padding: 12px 12px 4px 12px;
  /* Exact sama dengan Recent Trades h3 */
  margin: 0;
  font-size: clamp(10px, 1.5vw, 11px);
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
}

/* ============================================
   ORDERBOOK
   ============================================ */
.orderbook-col {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.orderbook-col .panel {
  display: flex;
  flex-direction: column;
}

.book-header {
  display: grid;
  grid-template-columns: 38% 32% 30%;
  padding: 6px 8px 4px 8px;
  background: var(--bg-modal);
  border-bottom: 1px solid var(--border);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.3px;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.book-col {
  text-align: right;
}

.book-col:first-child {
  text-align: left;
}

.book-section {
  display: none !important;
}

.book {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.asks-side,
.bids-side {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.asks-side::-webkit-scrollbar,
.bids-side::-webkit-scrollbar {
  display: none;
}

.book-side .table.book {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}

.book-side .table.book thead {
  display: none;
}

.book-side .table.book tbody {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.book-side .table.book tbody tr {
  display: table-row;
  position: relative;
}

/* No hover styling on book table - user requested */

.book-side .table.book tbody td {
  padding: 3px 10px;
  font-size: 11px;
  border: none;
  position: relative;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-side .table.book tbody td:nth-child(1) {
  text-align: left;
  font-weight: 700;
  /* font-family: 'JetBrains Mono', monospace; REMOVED for consistency */
  width: 38%;
  padding: 3px 3px 3px 12px;
}

.book-side .table.book tbody td:nth-child(2) {
  text-align: right;
  width: 32%;
  padding: 3px 3px 3px 3px;
}

.book-side .table.book tbody td:nth-child(3) {
  text-align: right;
  width: 30%;
  padding: 3px 12px 3px 3px;
}

.book-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 6px;
  background: rgba(20, 27, 45, 0.8);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.book-mid .price {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.3px;
  position: relative;
  display: inline-block;
  font-variant-numeric: tabular-nums;
  will-change: contents;
  transition: color 0.3s ease, transform 0.2s ease;
}

.book-mid .price.updating {
  animation: numberPulse 0.4s ease-out;
}

@keyframes numberPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes digitRoll {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.price-digit {
  display: inline-block;
  animation: digitRoll 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-mid .arrow {
  font-size: 14px;
  font-weight: 700;
}

.book-mid .change {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.book-stats {
  padding: 6px 12px;
  background: rgba(17, 24, 39, 0.8);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  cursor: pointer;
  contain: layout;
  overflow: visible;
  z-index: 50;
  min-height: 36px;
}

.book-stats:hover .stats-tooltip {
  opacity: 1;
  visibility: visible;
}

.book-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.book-stat-label {
  color: var(--muted);
  font-weight: 500;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: var(--font-primary);
}

.book-stat-value {
  font-weight: 600;
  font-size: 11px;
  font-family: var(--font-numeric);
}

.book-stat.buy {
  color: #22c55e;
}

.book-stat.sell {
  color: #ef4444;
}

.stats-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  display: flex;
  will-change: transform;
  overflow: hidden;
}

.stats-bar-buy {
  background: #22c55e;
  transition: width var(--transition-slow);
  height: 100%;
  box-shadow: 0 0 4px rgba(34, 199, 94, 0.3);
}

.stats-bar-sell {
  background: #ef4444;
  transition: width var(--transition-slow);
  height: 100%;
  box-shadow: 0 0 4px var(--neg-3);
}

.stats-tooltip {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 27, 45, 0.98);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: 9999;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  will-change: opacity, visibility;
  pointer-events: none;
}

.stats-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-modal);
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 11px;
}

.tooltip-label {
  color: var(--muted);
}

.tooltip-value {
  font-weight: 700;
}

/* ✅ Flash animations removed - cleaner UI without distracting flashes */

/* Taker side styling - PRICE COLUMN ONLY */
/* Buy taker = green (market buyer took liquidity from sell orders) */
.trade-buy td:nth-child(2) {
  color: #22c55e !important;
}

/* Sell taker = red (market seller took liquidity from buy orders) */
.trade-sell td:nth-child(2) {
  color: #ef4444 !important;
}


/* ============================================
   ORDER PANEL
   ============================================ */
.order-panel {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
}

.order-header {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.order-tab {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: rgba(20, 27, 45, 0.3);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: all var(--transition-fast);
  color: var(--muted);
  will-change: background-color, border-color, color;
}

.order-tab:hover {
  background: rgba(20, 27, 45, 0.6);
}

.order-tab.active.buy {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15));
  border-color: #10b981;
  color: #10b981;
}

.order-tab.active.sell {
  background: linear-gradient(135deg, var(--neg-15), rgba(220, 38, 38, 0.15));
  border-color: #ef4444;
  color: #ef4444;
}

.order-form {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: visible;
}

.order-form.active {
  display: flex;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-accent) transparent;
}

.order-form.active::-webkit-scrollbar {
  width: 3px;
}

.order-form.active::-webkit-scrollbar-thumb {
  background: var(--border-accent);
  border-radius: 2px;
}

.form-group {
  margin-bottom: 10px;
}

.form-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: rgba(168, 197, 218, 0.5);
  box-shadow: 0 0 0 3px rgba(168, 197, 218, 0.1);
}

.input-group {
  position: relative;
}

.input-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  pointer-events: none;
}

.input-with-prefix {
  padding-left: 28px;
}



.form-input-new {
  text-align: right;
  padding-right: 0;
  height: 100%;
}

.input-suffix {
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted);
}



.percentage-buttons {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.pct-btn {
  flex: 1;
  padding: 5px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(20, 27, 45, 0.3);
  cursor: pointer;
  font-size: 9px;
  font-weight: 600;
  color: var(--text);
  transition: all var(--transition-fast);
  will-change: background-color;
}

.pct-btn:hover {
  background: rgba(168, 197, 218, 0.2);
  transform: translateY(-1px);
}

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

.order-summary {
  background: rgba(20, 27, 45, 0.5);
  border-radius: 8px;
  padding: 6px;
  margin-bottom: 6px;
}

.summary-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--muted);
}

.info-value {
  font-weight: 700;
  color: var(--text);
}

.submit-btn {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  color: #fff;
  font-family: inherit;
  transition: all var(--transition-fast);
  will-change: transform, box-shadow;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.submit-btn.buy {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.submit-btn.buy:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.submit-btn.sell {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 14px var(--neg-3);
}

.submit-btn.sell:hover:not(:disabled) {
  box-shadow: 0 6px 20px var(--neg-4);
}

/* ✅ GLASSMORPHISM VALIDATION - Smooth & responsive */
.validation-msg {
  font-size: 10px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  display: none;
  font-weight: 600;
  line-height: 1.3;
  color: #fff !important;

  /* Glassmorphism effect */
  background: var(--neg-15) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  pointer-events: none;
  box-shadow: none;

  /* Material Error Style - HIDDEN AS REQUESTED */
  display: none !important;
}

/* ✅ UNIFIED PANEL STYLING (No Animations) */
/* Simple hidden class without transition */
.hidden {
  display: none !important;
}

/* Glassmorphism arrow */
/* Remove arrow for material text style */
.validation-msg::after {
  display: none;
}

/* Smooth slide down animation from top */
@keyframes slideDownSmooth {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px);
  }

  60% {
    opacity: 1;
    transform: translateX(-50%) translateY(2px);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 768px) {
  .validation-msg {
    font-size: 9px;
    padding: 6px 10px;
  }
}

.validation-msg.error {
  color: #fff !important;
  display: block;
  background: var(--neg-15) !important;
  border-color: var(--neg-3) !important;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  animation: slideDownSmooth 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.validation-msg.error::after {
  border-top-color: rgba(239, 68, 68, 0.25);
}

.validation-msg.warning {
  color: #fff !important;
  display: block;
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  animation: slideDownSmooth 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.validation-msg.warning::after {
  border-top-color: rgba(245, 158, 11, 0.25);
}

.validation-msg.success {
  color: #fff !important;
  display: block;
  background: var(--pos-15) !important;
  border-color: var(--pos-3) !important;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  animation: slideDownSmooth 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.validation-msg.success::after {
  border-top-color: rgba(34, 197, 94, 0.25);
}

/* ============================================
   NEW ORDER PANEL - BINANCE STYLE (SIDE BY SIDE)
   ============================================ */
.order-panel-new {
  /* Inherits all styling from .panel class */
  flex: 4 0 0;
  /* 40% of flex container (4 out of 10 total flex units) */
  min-height: 0;
  padding: 0 !important;
  /* Force no padding */
  overflow-y: auto;
  /* Allow scrolling if content is too tall */
  display: flex;
  flex-direction: column;
  /* Order panel has its own internal padding structure */

  /* ✅ Unified Background Styling (Matches .trades-col .panel) */
  background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-overlay) 100%) !important;
  border: 1px solid rgba(71, 85, 105, 0.25) !important;
  backdrop-filter: blur(12px) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
  border-radius: 12px;
}

/* Order Type Tabs - Simple Underline Style */
.order-type-tabs {
  display: flex;
  gap: 0;
  background: transparent;
  padding: 4px 8px;
  border: none;
  flex-shrink: 0;
}

.order-type-tab {
  flex: 1;
  padding: 8px 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.order-type-tab:hover {
  color: var(--text-secondary);
}

.order-type-tab.active {
  color: var(--text-primary);
  font-weight: 700;
}

.order-type-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold-primary);
  z-index: 1;
}

/* Side by Side Container */
.order-forms-container {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  /* Buy | Divider | Sell */
  gap: 0;
  gap: 0;
  padding: 0;
  /* Remove padding */
  min-height: 0;
  flex: 1;
  height: 100%;
  /* Fill height */
  /* Fill available height */
}

.order-form-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Minimal gap */
  padding: 4px;
  /* Minimal padding inside forms */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  justify-content: space-between;
  overflow: visible;
}

.buy-side {
  padding-right: 4px;
}

.sell-side {
  padding-left: 4px;
}

/* Vertical Divider */
.order-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

/* Form Groups */
.form-group-inline {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  margin-bottom: 2px;
  /* Minimal margin */
}

/* Input with Inner Label (like Binance) */
.input-with-label {
  position: relative;
  background: transparent;
  /* Remove background */
  border: none;
  /* Remove border from container */
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  height: 36px;
  /* Compact height */
  margin-top: 0;
  /* No extra margin needed */
}

/* Fieldset Outlined Style */
.input-fieldset {
  position: absolute;
  top: -5px;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0 8px;
  pointer-events: none;
  border: 1px solid rgba(71, 85, 105, 0.4);
  border-radius: 6px;
  transition: border-color 0.2s;
}

.input-legend {
  width: auto;
  padding: 0;
  font-size: 10px;
  visibility: hidden;
  max-width: 0.01px;
  /* Default closed gap */
  transition: max-width 0.1s;
  white-space: nowrap;
  height: 0;
  /* Don't take up space */
  background: transparent !important;
  background-color: transparent !important;
}

.input-legend span {
  padding: 0 4px;
  display: inline-block;
  opacity: 0;
  background: transparent !important;
}

/* Floating Label - True Outlined */
.input-label-floating {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
  transition: all 0.2s;
  z-index: 6;
  font-weight: 500;
  background: transparent !important;
  /* Force transparent */
}

/* Ensure label remains transparent even if input is readonly */
.form-input-new:read-only~.input-label-floating,
.form-input-new:disabled~.input-label-floating {
  background: transparent !important;
}

/* Active State (Focus or Has Value) */
.input-with-label:focus-within .input-fieldset,
.form-input-new:not(:placeholder-shown)~.input-fieldset {
  border-color: #A8C5DA;
}

.input-with-label:focus-within .input-legend,
.form-input-new:not(:placeholder-shown)~.input-fieldset .input-legend {
  max-width: 100%;
  /* Open gap */
}

.input-with-label:focus-within .input-label-floating,
.form-input-new:not(:placeholder-shown)~.input-label-floating {
  top: -6px;
  left: 12px;
  font-size: 10px;
  color: #A8C5DA;
  transform: translateY(0);
  background: transparent !important;
  background-color: transparent !important;
}

.form-input-new:not(:placeholder-shown)~.input-label-floating {
  color: var(--muted);
  /* Keep muted if filled but not focused */
  background: transparent !important;
}

.input-with-label:focus-within .input-label-floating {
  color: #A8C5DA;
  background: transparent !important;
}

.input-with-label.error .form-input-new {
  border-color: #ef4444 !important;
}

.input-with-label.error .input-label-inner {
  color: #ef4444 !important;
}

.form-input-new {
  flex: 1;
  width: 100%;
  background: transparent;
  border: none;
  /* Remove border (handled by fieldset) */
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  padding: 0 12px;
  height: 100%;
  text-align: left !important;
  transition: all 0.2s;
  background: transparent;
  z-index: 5;
}

.form-input-new:hover {
  border-color: var(--border-accent);
}

.form-input-new:focus {
  outline: none;
  box-shadow: none !important;
}

.form-input-new:active {
  outline: none;
  box-shadow: none !important;
}

/* Remove spinner arrows from number input */
.form-input-new::-webkit-outer-spin-button,
.form-input-new::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-input-new[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.form-input-new::placeholder {
  color: var(--muted);
  opacity: 0.5;
}

.form-input-new::selection {
  background: rgba(168, 197, 218, 0.3);
  color: var(--text);
}

/* Force transparent background for readonly/disabled inputs (Fixes "Price" input bg) */
.form-input-new:read-only,
.form-input-new:disabled {
  background: transparent !important;
  opacity: 1 !important;
  /* Keep text visible */
  -webkit-text-fill-color: var(--text);
  /* Ensure text color is correct */
}

/* Navbar styles unified in system.css */

/* ✅ READONLY PRICE INPUT FOR GUEST */
/* Conflicting readonly styles removed */

.form-input-new[readonly]:focus {
  border-color: rgba(255, 165, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.1);
}

/* Inner Label */
/* Inner Label - Compact Side-by-Side */
/* Legacy Inner Label Removed */

/* Input Suffix */
.input-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  pointer-events: none;
}

/* Increment/Decrement Arrows */
.input-increment {
  position: absolute;
  right: 8px;
  width: 20px;
  height: 16px;
  background: var(--border-primary);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
  font-size: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.input-increment.up {
  top: 18px;
}

.input-increment.down {
  bottom: 6px;
}

.input-increment:hover {
  background: var(--border-titanium);
  color: var(--text);
}

.input-increment:active {
  transform: scale(0.9);
}

/* Slider with Tooltip */

/* Slider Tooltip */
.slider-tooltip {
  position: absolute;
  top: -24px;
  left: 0%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, left 0.1s ease;
  z-index: 100;
  will-change: left, opacity;
  min-width: 30px;
  text-align: center;
}

.slider-container:hover .slider-tooltip,
.amount-slider-new:active+.slider-tooltip,
.amount-slider-new:focus+.slider-tooltip {
  opacity: 1;
}

/* Info Rows */
.order-info-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 10px;
}

.info-row-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.info-label-new {
  color: var(--muted);
  font-weight: 500;
}

.info-value-new {
  color: var(--text);
  font-weight: 600;
}

/* Fee Label - tooltip on hover */
.fee-label {
  cursor: help;
}

/* Submit Buttons */
.submit-btn-new {
  width: 100%;
  padding: 14px 12px;
  /* Increased padding */
  border-radius: 6px;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-transform: capitalize;
  font-family: inherit;
  transition: all 0.2s;
  margin-top: auto;
  /* Push button to bottom */
}

.submit-btn-new:hover:not(:disabled) {
  transform: translateY(-2px);
}

.submit-btn-new:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn-new:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.submit-btn-new.buy {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
  box-shadow: 0 4px 12px var(--pos-3);
}

.submit-btn-new.buy:hover:not(:disabled) {
  box-shadow: 0 6px 20px var(--pos-4);
}

.submit-btn-new.sell {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #fff;
  box-shadow: 0 4px 12px var(--neg-3);
}

.submit-btn-new.sell:hover:not(:disabled) {
  box-shadow: 0 6px 20px var(--neg-4);
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {

  /* Hardware acceleration for smooth animations */
  .trading-grid,
  .panel,
  .modal-box,
  .submit-btn-new {
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  /* Touch feedback */
  .btn-primary,
  .submit-btn-new,
  .tab,
  .order-type-tab,
  .mobile-tab {
    -webkit-tap-highlight-color: rgba(168, 197, 218, 0.2);
    touch-action: manipulation;
  }

  /* Smooth scrolling */
  .table-wrap,
  .book-side {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Active state feedback */
  .submit-btn-new:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  .order-forms-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .order-divider {
    display: none;
  }

  .order-form-side {
    padding: 0;
  }

  .buy-side {
    order: 1;
  }

  .sell-side {
    order: 2;
  }
}

/* Desktop Responsive (1080p - 4K) */
@media (min-width: 1920px) {
  .form-input-new {
    font-size: 14px;
  }

  .input-label-inner {
    font-size: 10px;
  }

  .submit-btn-new {
    padding: 14px;
    font-size: 14px;
  }

  .order-forms-container {
    padding: 20px;
  }

  .trading-grid {
    gap: 8px;
  }

  .panel {
    padding: 24px;
  }
}

/* 4K Ultra HD (3840x2160+) */
@media (min-width: 2560px) {
  body {
    font-size: 18px;
  }

  .trading-grid {
    gap: 12px;
  }

  .panel {
    padding: 32px;
  }

  .ticker-price {
    font-size: 42px;
  }

  /* Maintain 60/40 proportion for high resolution */
  .center-col>.chart-panel {
    flex: 6 0 0;
    /* 60% ratio maintained */
    min-height: 600px;
  }

  .center-col>.order-panel-new {
    flex: 4 0 0;
    /* 40% ratio maintained */
    min-height: 400px;
  }
}

/* 4K Display (3840px and up) */
@media (min-width: 3840px) {
  .center-col>.chart-panel {
    flex: 6 0 0;
    /* 60% ratio maintained */
    min-height: 800px;
  }

  .center-col>.order-panel-new {
    flex: 4 0 0;
    /* 40% ratio maintained */
    min-height: 540px;
  }

  .form-input-new {
    height: 56px;
    font-size: 16px;
  }

  .input-label-floating {
    font-size: 14px;
  }

  /* ✅ Price flash animations for ticker */
  .flash-green {
    animation: flashGreen 0.6s ease-out;
  }

  .flash-red {
    animation: flashRed 0.6s ease-out;
  }

  @keyframes flashGreen {
    0% {
      background-color: var(--pos-3);
    }

    100% {
      background-color: transparent;
    }
  }

  @keyframes flashRed {
    0% {
      background-color: var(--neg-3);
    }

    100% {
      background-color: transparent;
    }
  }

  .form-input-new {
    font-size: 16px;
    padding: 16px;
  }

  .submit-btn-new {
    padding: 18px;
    font-size: 16px;
  }
}

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  flex-shrink: 0;
  flex-wrap: nowrap;
  align-items: center;
  background: transparent;
  border: none;
  padding: 4px 0;
}

.tab {
  padding: 8px 12px;
  border: none !important;
  background: transparent !important;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  position: relative;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.tab:hover {
  background: transparent !important;
  color: var(--text-secondary);
  outline: none !important;
  box-shadow: none !important;
}

.tab.active {
  background: transparent !important;
  color: var(--text-primary);
  font-weight: 700;
  outline: none !important;
  box-shadow: none !important;
}

.tab:focus {
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold-primary);
  z-index: 1;
}

/* ============================================
   TABLES
   ============================================ */
.table-wrap {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
  height: 100%;
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position, opacity;
  position: relative;
  z-index: 1;
  isolation: isolate;
  background: transparent;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#tradesTableWrap,
#holdersTableWrap {
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ✅ Hide scrollbar in market trades, top holders, and orders panel */
#tradesTableWrap::-webkit-scrollbar,
#holdersTableWrap::-webkit-scrollbar,
.panel .table-wrap::-webkit-scrollbar {
  display: none;
}

#tradesTableWrap,
#holdersTableWrap,
.panel .table-wrap {
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}

/* ✅ Top Holders - Gold/Silver/Bronze backgrounds */
#holdersBody tr.rank-1 {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.12), rgba(255, 215, 0, 0.04)) !important;
  border-left: 3px solid rgba(255, 215, 0, 0.6);
}

#holdersBody tr.rank-2 {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.12), rgba(192, 192, 192, 0.04)) !important;
  border-left: 3px solid rgba(192, 192, 192, 0.6);
}

#holdersBody tr.rank-3 {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.12), rgba(205, 127, 50, 0.04)) !important;
  border-left: 3px solid rgba(205, 127, 50, 0.6);
}

/* Keep thin scrollbar for other table-wrap (like chart) */
.table-wrap:not(.panel .table-wrap)::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

.table-wrap:not(.panel .table-wrap)::-webkit-scrollbar-thumb {
  background: var(--border-accent);
  border-radius: 2px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table th,
.table td {
  font-size: 11px;
  padding: 5px 6px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table th:first-child,
.table td:first-child {
  text-align: left;
  padding-left: 12px;
}

.table th:last-child,
.table td:last-child {
  padding-right: 12px;
}

.table thead th {
  position: sticky;
  top: 0;
  background: rgba(17, 24, 39, 0.85);
  /* More transparent for glass effect */
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 600;
  /* Slightly lighter weight */
  z-index: 10;
  border-bottom: none;
  /* ✅ REMOVED BORDER as requested */
  padding: 10px 6px;
  /* Increased vertical padding */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  /* Subtle shadow instead of border */
  letter-spacing: 0.05em;
}

.orders-section {
  margin-top: 12px;
  margin-bottom: 24px;
  padding-top: 0;
  position: relative;
  z-index: 1;
  isolation: isolate;
  clear: both;
  display: block;

  /* ✅ Unified Background Styling (Matches .trades-col .panel) */
  background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-overlay) 100%) !important;
  border: 1px solid rgba(71, 85, 105, 0.25) !important;
  backdrop-filter: blur(12px) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
  border-radius: 12px;
}

.orders-section::before {
  content: '';
  display: table;
  clear: both;
}

.orders-section::after {
  content: '';
  display: table;
  clear: both;
}

.orders-section .panel {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  padding: 0 !important;
}

.orders-section .tabs {
  padding: 12px 12px 8px 12px;
  flex-shrink: 0;
}

.orders-section .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}

.orders-section .table th:first-child {
  text-align: left;
}

.orders-section .table td:first-child {
  text-align: left;
  font-size: 10px;
}

.orders-section .table td {
  font-size: 11px;
}

.btn-cancel {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--neg-4);
  color: #ef4444;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition-fast);
  will-change: background-color, border-color;
  min-width: 70px;
  text-align: center;
}

.btn-cancel:hover {
  background: var(--neg-3);
  border-color: #ef4444;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--neg-3);
}

.btn-cancel:active {
  transform: translateY(0);
  box-shadow: none;
}

.orders-section .tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  flex-shrink: 0;
  flex-wrap: nowrap;
  align-items: center;
  background: transparent;
  border: none;
  padding: 4px 12px;
}

.btn-cancel-all {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--neg-1);
  border: 1px solid var(--neg-4);
  color: var(--danger);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all var(--transition-fast);
  font-family: inherit;
  white-space: nowrap;
  margin-left: auto;
}

.btn-cancel-all:hover:not(:disabled) {
  background: var(--neg-3);
  border-color: #ef4444;
  transform: translateY(-1px);
}

.btn-cancel-all:active:not(:disabled) {
  transform: translateY(0);
}

.btn-cancel-all:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cancel-icon {
  font-size: 12px;
  font-weight: 700;
}

.cancel-spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid var(--neg-3);
  border-top-color: #ef4444;
  border-radius: 50%;
  animation: cancelSpin 0.6s linear infinite;
}

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

.load-more-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  margin-top: 2px;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.load-more-info {
  font-size: 10px;
  color: #64748b;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
}

.load-more-btn {
  width: 100%;
  max-width: 100%;
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(20, 27, 45, 0.4);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: 0.01em;
}

.load-more-btn:hover:not(:disabled) {
  background: rgba(20, 27, 45, 0.6);
  border-color: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}

.load-more-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.load-more-icon {
  font-size: 12px;
  line-height: 1;
  opacity: 0.7;
  animation: bounceDownSubtle 2s ease-in-out infinite;
}

@keyframes bounceDownSubtle {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(2px);
  }
}

.load-more-spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid var(--border-titanium);
  border-top-color: #94a3b8;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ============================================
   UTILITIES
   ============================================ */
/* Skeleton Loading Animation */
.loading {
  text-align: center;
  padding: 15px;
  color: transparent !important;
  background: linear-gradient(90deg,
      rgba(71, 85, 105, 0.1) 0%,
      rgba(71, 85, 105, 0.2) 50%,
      rgba(71, 85, 105, 0.1) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
  font-size: 12px;
  user-select: none;
  pointer-events: none;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Skeleton for table rows */
tr.loading td {
  background: linear-gradient(90deg,
      rgba(71, 85, 105, 0.08) 0%,
      rgba(71, 85, 105, 0.15) 50%,
      rgba(71, 85, 105, 0.08) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  color: transparent !important;
}

.pos {
  color: #22c55e;
}

.neg {
  color: #ef4444;
}


/* ===== MODAL & PAGE LOADER moved to system.css ===== */

.rdgh-ticker {
  margin-top: 0 !important;
  margin-bottom: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: 12px;
  padding: 16px 20px;
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 1;
}

.mobile-market-tabs {
  display: none;
}

.ticker-container {
  display: flex;
  align-items: center;
  gap: 24px;
}

.ticker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.symbol-item {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding-right: 20px;
  border-right: 1px solid var(--border-secondary);
}

.symbol-item svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(240, 185, 11, 0.3));
}

.symbol-pair {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.symbol-pair span {
  color: #94a3b8;
  font-weight: 600;
}

/* WebSocket Status Indicator (Mobile & Desktop) */
.ws-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  margin-left: 8px;
}

.ws-status-indicator.connecting {
  background: rgba(168, 197, 218, 0.1);
  border-color: var(--blue-3);
}

.ws-status-indicator.disconnected {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--neg-3);
}

.ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: pulse 2s ease-in-out infinite;
}

.ws-status-indicator.connecting .ws-dot {
  background: #A8C5DA;
  box-shadow: 0 0 8px rgba(168, 197, 218, 0.6);
}

.ws-status-indicator.disconnected .ws-dot {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  animation: none;
}

.ws-text {
  font-size: 11px;
  font-weight: 600;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ws-status-indicator.connecting .ws-text {
  color: #A8C5DA;
}

.ws-status-indicator.disconnected .ws-text {
  color: #ef4444;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

.price-item {
  flex: 0 0 auto;
  min-width: 140px;
}

.price-main {
  font-size: 24px !important;
  font-weight: 800 !important;
  color: #22c55e;
  transition: color 0.3s ease;
  font-family: var(--font-numeric);
}

.price-main.pos {
  color: #22c55e !important;
}

.price-main.neg {
  color: #ef4444 !important;
}

.price-sub {
  font-size: 13px !important;
  color: #64748b !important;
  font-weight: 500 !important;
  font-family: var(--font-numeric);
}

/* Mobile-only 24H Change below price */
.price-change-mobile {
  display: none !important;
  /* Hidden on desktop */
  font-size: 12px !important;
  font-weight: 600 !important;
  margin-top: 2px;
  gap: 6px;
}

.price-change-mobile .change-amount {
  font-size: 11px;
  font-weight: 600;
}

.price-change-mobile .change-percent {
  font-size: 12px;
  font-weight: 700;
}

.item-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-value {
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-family: var(--font-numeric);
}

.change-item .item-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.change-amount {
  font-size: 15px;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  margin-right: 6px;
  font-family: var(--font-numeric);
}

.change-percent {
  font-size: 13px;
  font-weight: 700 !important;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  vertical-align: middle;
  min-width: 60px;
  font-family: var(--font-numeric);
}

.change-percent.pos {
  color: #22c55e;
  background: var(--pos-15);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.change-percent.neg {
  color: #ef4444;
  background: var(--neg-15);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.change-percent.neutral {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid var(--border-titanium);
}

.empty-state {
  padding: clamp(40px, 8vw, 100px) clamp(16px, 4vw, 40px) !important;
  text-align: center;
  background: transparent !important;
  border: none !important;
}

.empty-state-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2vw, 20px);
}

.empty-state-content svg {
  width: clamp(32px, 8vw, 64px);
  height: clamp(32px, 8vw, 64px);
  color: #64748b;
  opacity: 0.5;
}

.empty-state-text {
  font-size: clamp(13px, 2vw, 16px);
  color: #94a3b8;
  margin: 0;
  line-height: 1.8;
  text-align: center;
  display: inline;
  /* Inline layout untuk memanjang horizontal */
  white-space: normal;
}

.empty-link {
  color: #A8C5DA;
  /* Blue theme color - sama dengan button accent */
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline;
  /* Keep inline for horizontal flow */
}

.empty-link:hover {
  color: #93c5fd;
  /* Lighter blue on hover */
  text-decoration: underline;
}

.empty-or {
  color: #64748b;
  margin: 0 6px;
  font-weight: 400;
  display: inline;
}

.empty-subtitle {
  color: #94a3b8;
  font-weight: 400;
  display: inline;
  margin-left: 4px;
}

/* ============================================
   RESPONSIVE - MOBILE FIXES
   ============================================ */

@media (max-width: 768px) {
  body {
    padding-bottom: 80px;
  }

  body.dashboard .container {
    padding: 100px 1rem 0 1rem;
  }

  body.dashboard footer .container {
    padding: 0 1rem;
  }

  /* WebSocket Status - Mobile: Only show dot, hide text */
  .ws-status-indicator {
    padding: 3px 6px;
    margin-left: 4px;
    gap: 0;
  }

  .ws-text {
    display: none;
  }

  .ws-dot {
    width: 6px;
    height: 6px;
  }

  /* ✅ FIX: Mobile trading grid with proper spacing and width */
  .trading-grid {
    grid-template-columns: 1fr;
    gap: 0 !important;
    /* No gap between panels inside grid */
    margin-bottom: 12px !important;
    /* Spacing to orders-section */
    padding: 0 !important;
    /* No side padding for full width */
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible;
    width: 100% !important;
  }

  .center-col,
  .orderbook-col,
  .trades-col {
    gap: 0 !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .orders-section .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .orders-section .tab,
  .orders-section .btn-cancel-all {
    flex-shrink: 0;
  }

  /* Panels inside columns - full width */
  .center-col>.chart-panel {
    flex: 6 0 0;
    /* 60% ratio maintained */
    min-height: 400px;
    margin: 0 !important;
    border-radius: 0 !important;
    width: 100% !important;
  }

  .orderbook-col>.panel,
  .trades-col>.panel {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    margin: 0 !important;
    border-radius: 0 !important;
    width: 100% !important;
  }

  /* First visible panel has top radius */
  .center-col>.chart-panel:first-child,
  .orderbook-col>.panel:first-child,
  .trades-col>.panel:first-child {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
  }

  /* ✅ HIDE order panels on mobile - use mobile sticky buttons instead */
  .center-col>.order-panel,
  .center-col>.order-panel-new {
    display: none !important;
  }

  .chart-box {
    padding: 12px 8px 16px 8px;
    height: 100%;
    min-height: 680px;
    pointer-events: auto !important;
    position: relative;
  }


  #candleChart {
    min-height: 680px !important;
    /* Increased for better chart visibility */
    height: 680px !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
  }

  .chart-legend {
    top: 8px;
    left: 8px;
    font-size: 9px;
    padding: 6px 8px;
    gap: 6px;
    max-width: calc(100% - 16px);
    pointer-events: auto !important;
    touch-action: none !important;
  }

  .chart-legend.minimized {
    width: 36px;
    height: 36px;
  }

  .legend-toggle {
    padding: 4px 7px;
    font-size: 8px;
  }

  .legend-dot {
    width: 6px;
    height: 6px;
  }

  .legend-minimize-btn {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  /* Override landing.css chart-tooltip for dashboard */
  body.dashboard .chart-tooltip {
    font-size: 9px !important;
    padding: 6px !important;
    min-width: 120px !important;
    max-width: calc(100vw - 20px) !important;
    line-height: 1.3 !important;
    border-radius: 6px !important;
    pointer-events: none !important;
  }

  /* ✅ FIX: Order Book Mobile - fit in 500px container */
  .orderbook-col {
    min-height: 500px;
    height: 500px;
    display: flex;
    flex-direction: column;
  }

  .orderbook-col .panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
  }

  .orderbook-col .panel h3 {
    flex-shrink: 0;
    /* Removed margin-bottom to match Recent Trades h3 styling */
  }

  .book {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .book-header {
    flex-shrink: 0;
  }

  .asks-side,
  .bids-side {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }

  .book-mid {
    flex-shrink: 0;
  }

  .book-stats {
    flex-shrink: 0;
    margin-top: 8px;
  }

  /* ✅ FIX: Trades Mobile - fit in 500px container */
  .trades-col {
    min-height: 500px;
    height: 500px;
    display: flex;
    flex-direction: column;
  }

  .trades-col .panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
  }

  .trades-col .panel h3 {
    flex-shrink: 0;
  }

  .trades-col .tabs {
    flex-shrink: 0;
  }

  .trades-col .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0;
    margin: 0;
  }

  /* ✅ FIX: Orders section - no gap, seamless connection */
  .orders-section {
    margin-top: 12px !important;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    isolation: isolate;
    clear: both;
  }

  .orders-section .panel {
    min-height: 300px;
    margin: 0;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    padding: 0 !important;
  }

  .orders-section .tabs {
    padding: 12px 12px 8px 12px;
  }

  .orders-section .table-wrap {
    min-height: 0;
    flex: 1 1 auto;
    padding: 0;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .table th,
  .table td {
    font-size: 10px;
    padding: 6px 3px;
  }

  .btn-cancel {
    padding: 5px 12px;
    font-size: 11px;
    min-width: 60px;
  }

  .chip {
    font-size: 10px;
    padding: 4px 8px;
  }

  .mobile-sticky-buttons {
    display: none !important;
  }

  #updateSpeedIndicator {
    display: none !important;
  }

  .modal-content {
    padding: 32px 24px;
    max-width: calc(100% - 32px);
    margin: 0 16px;
  }

  .modal-content h2 {
    font-size: 22px;
  }

  .auth-progress {
    padding: 0 10px;
    margin-bottom: 24px;
  }

  .progress-step {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .progress-line {
    margin: 0 8px;
  }

  .btn-cancel-all {
    padding: 4px 10px;
    font-size: 10px;
  }

  .load-more-container {
    padding: 10px 12px;
    gap: 6px;
  }

  .load-more-info {
    font-size: 9px;
  }

  .load-more-btn {
    padding: 7px 14px;
    font-size: 10px;
  }

  body.dashboard .rdgh-ticker {
    margin-top: 0 !important;
    padding: 2px 4px;
    border-radius: 6px;
  }

  .ticker-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 3px 4px;
    align-items: center;
    justify-items: center;
  }

  .symbol-item {
    grid-column: 1;
    grid-row: 1;
    flex-direction: column;
    gap: 3px;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--border-secondary);
    padding-bottom: 4px;
    align-items: center;
  }

  .symbol-item svg {
    width: 24px;
    height: 24px;
  }

  .symbol-pair {
    font-size: 11px;
  }

  .price-item {
    grid-column: 1;
    grid-row: 2;
    min-width: auto;
    padding-top: 0;
    align-items: center;
  }

  .price-main {
    font-size: 15px !important;
    line-height: 1.2;
    font-weight: 700;
  }

  .price-sub {
    display: none;
  }

  /* Show mobile 24H change on mobile */
  .price-change-mobile {
    display: flex !important;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    padding: 2px 6px;
    margin-top: 2px;
  }

  .change-percent {
    font-size: 10px !important;
  }

  .change-item {
    display: none !important;
  }

  .ticker-item {
    gap: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
  }

  .ticker-item:nth-child(4) {
    grid-column: 2;
    grid-row: 1;
  }

  .ticker-item:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
    padding-top: 1px;
  }

  .ticker-item:nth-child(6) {
    grid-column: 3;
    grid-row: 1;
  }

  .ticker-item:nth-child(7) {
    grid-column: 3;
    grid-row: 2;
    padding-top: 1px;
  }

  .item-label {
    font-size: 9px;
    line-height: 1.2;
    letter-spacing: 0.2px;
    opacity: 0.7;
    text-align: center;
    width: 100%;
  }

  .item-value {
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
    text-align: center;
    width: 100%;
  }

  .empty-state {
    padding: 60px 20px !important;
  }

  .empty-state-content svg {
    width: 40px;
    height: 40px;
  }

  .empty-state-text {
    font-size: 14px;
  }

  /* ✅ Mobile Market Tabs - no margin below */
  .mobile-market-tabs {
    display: flex;
    gap: 0;
    background: rgba(20, 27, 45, 0.7);
    border: 1px solid var(--border-secondary);
    border-radius: 12px;
    padding: 4px;
    margin: 0 0 0 0 !important;
    /* No margin - seamless */
    backdrop-filter: blur(8px);
  }

  .mobile-tab {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #64748b;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .mobile-tab.active {
    background: var(--blue-15);
    color: var(--blue);
  }

  /* ✅ FIX: Trading grid no spacing */
  .trading-grid {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
  }

  /* Hide cols by default, show based on active tab */
  .trading-grid {
    position: relative;
  }

  .trading-grid>div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }

  .trading-grid>.center-col[data-active="true"],
  .trading-grid>.orderbook-col[data-active="true"],
  .trading-grid>.trades-col[data-active="true"] {
    position: relative;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    display: flex !important;
    z-index: 2;
  }
}

/* Tablet landscape and medium devices */
@media (max-width: 1024px) and (min-width: 769px) {
  body.dashboard .container {
    padding: 100px 1.5rem 0 1.5rem;
  }

  body.dashboard footer .container {
    padding: 0 1.5rem;
  }

  .trading-grid {
    grid-template-columns: 260px 1fr 300px;
    gap: 6px;
    height: 750px;
    min-height: 750px;
  }

  .panel h3 {
    font-size: 10px;
  }

  .order-info-rows {
    gap: 3px;
  }

  .info-row-inline {
    font-size: 10px;
  }

  .submit-btn-new {
    padding: 12px 10px;
    font-size: 12px;
  }
}

/* Medium mobile devices (iPhone 12/13, Galaxy S21, etc) */
@media (max-width: 480px) and (min-width: 375px) {
  .trading-grid {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
  }

  .center-col,
  .orderbook-col,
  .trades-col {
    height: 100%;
    min-height: 500px;
    max-height: 500px;
  }

  .center-col>.chart-panel,
  .orderbook-col>.panel,
  .trades-col>.panel {
    flex: 1 !important;
    min-height: 400px !important;
    height: auto !important;
  }

  #candleChart {
    min-height: 550px !important;
    height: 550px !important;
  }

  .chart-box {
    padding: 11px 7px 15px 7px;
    min-height: 550px;
  }

  /* Optimize info rows spacing */
  .order-info-rows {
    gap: 3px;
  }

  .info-row-inline {
    font-size: 10px;
  }
}

/* Smaller mobile devices */
@media (max-width: 480px) {

  /* ✅ FIX: Smaller screens - trading-grid height matches panels */
  .trading-grid {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
  }

  .center-col,
  .orderbook-col,
  .trades-col {
    height: 100%;
    min-height: 450px;
    max-height: 450px;
  }

  .center-col>.chart-panel,
  .orderbook-col>.panel,
  .trades-col>.panel {
    flex: 1 !important;
    min-height: 350px !important;
    height: auto !important;
  }

  #candleChart {
    min-height: 480px !important;
    height: 480px !important;
  }

  .chart-box {
    padding: 10px 6px 14px 6px;
    min-height: 480px;
  }

  .chart-legend {
    font-size: 8px;
    padding: 5px 6px;
    gap: 4px;
    flex-wrap: wrap;
  }

  .chart-legend.minimized {
    width: 32px;
    height: 32px;
  }

  .legend-toggle {
    padding: 3px 6px;
    font-size: 7px;
  }

  .legend-dot {
    width: 5px;
    height: 5px;
  }

  .legend-minimize-btn {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }

  .chart-tooltip {
    font-size: 9px;
    padding: 8px;
    min-width: 150px;
  }

  .modal-box,
  .modal-content {
    padding: 28px 20px;
    max-width: calc(100% - 24px);
    border-radius: 16px;
  }

  .modal-box h3,
  .modal-content h2 {
    font-size: 20px;
  }

  .modal-box p,
  .modal-content>p {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .btn {
    padding: 12px;
    font-size: 14px;
  }

  .mobile-sticky-btn {
    padding: 14px;
    font-size: 14px;
  }

  .orders-section .panel {
    min-height: 350px;
    padding: 0 !important;
  }

  .orders-section .tabs {
    padding: 14px 14px 10px 14px;
  }

  .orders-section .table-wrap {
    min-height: 0;
    flex: 1 1 auto;
    padding: 0;
  }

  .btn-cancel {
    padding: 6px 14px;
    font-size: 12px;
    min-width: 65px;
  }

  .btn-cancel-all {
    padding: 6px 12px;
    font-size: 11px;
  }

  .auth-progress {
    padding: 0 5px;
  }

  .progress-step {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .progress-line {
    margin: 0 6px;
  }

  .loader-card {
    padding: 2rem 1.5rem;
    min-width: 280px;
  }

  .text-main {
    font-size: 1.1rem;
  }

  /* Candlestick styles moved to system.css */

  .rdgh-ticker {
    margin-top: 85px;
    padding: 12px 10px;
  }

  .ticker-container {
    gap: 6px 8px;
  }

  .symbol-item {
    padding-bottom: 6px;
  }

  .symbol-item svg {
    width: 22px;
    height: 22px;
  }

  .symbol-pair {
    font-size: 12px;
  }

  .price-main {
    font-size: 16px !important;
  }

  .item-label {
    font-size: 8px;
  }

  .item-value {
    font-size: 11px;
  }

  .empty-state {
    padding: 50px 15px !important;
  }

  .empty-state-content svg {
    width: 36px;
    height: 36px;
  }

  .empty-state-text {
    font-size: 13px;
  }

  .empty-link {
    font-size: 14px;
  }

  /* Slider extra small screens */
  .slider-container {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  .amount-slider-new {
    width: 100%;
    max-width: 100%;
  }

  .slider-tooltip {
    font-size: 9px;
    padding: 2px 6px;
  }

  /* Form extra small */
  .order-form-side {
    padding: 0 4px;
  }

  .input-with-label {
    padding: 14px 8px 4px 8px;
  }

  .form-input-new {
    font-size: 13px;
  }

  .input-label-inner {
    font-size: 9px;
  }

  /* Mobile order modal responsive */
  .mobile-order-modal .mobile-order-content {
    max-height: 90vh;
    width: 100%;
    max-width: 100%;
  }

  .mobile-order-body {
    padding: 8px;
    max-width: 100%;
  }

  .mobile-order-form {
    width: 100%;
    max-width: 100%;
  }

  .mobile-input-group,
  .mobile-slider,
  .mobile-info-section,
  .mobile-validation,
  .mobile-submit-btn {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Mobile order modal */
  .mobile-order-content {
    max-height: calc(90vh - 70px);
    border-radius: 20px 20px 0 0;
  }

  .mobile-order-header {
    padding: 12px 16px;
  }

  .mobile-order-body {
    padding: 12px 16px;
  }
}

/* Extra small devices (very small phones) */
@media (max-width: 374px) {
  body.dashboard .container {
    padding: 100px 0.75rem 0 0.75rem;
  }

  body.dashboard footer .container {
    padding: 0 0.75rem;
  }

  .center-col>.chart-panel {
    flex: 6 0 0;
    /* 60% ratio maintained */
    min-height: 360px;
  }

  #candleChart {
    min-height: 320px !important;
    height: 320px !important;
  }

  .chart-legend {
    font-size: 7px;
    padding: 4px 5px;
    gap: 3px;
  }

  .chart-legend.minimized {
    width: 30px;
    height: 30px;
  }

  .legend-toggle {
    padding: 2px 5px;
    font-size: 7px;
  }

  .modal-content {
    padding: 24px 16px;
  }

  .progress-step {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .ticker-container {
    gap: 5px 6px;
  }

  .symbol-pair {
    font-size: 11px;
  }

  .price-main {
    font-size: 15px !important;
  }

  .item-label {
    font-size: 7px;
  }

  .item-value {
    font-size: 10px;
  }

  /* Mobile order form adjustments */
  .mobile-order-body {
    padding: 6px;
  }

  .order-info-rows {
    gap: 2px;
    margin-top: 1px;
    margin-bottom: 2px;
  }

  .info-row-inline {
    font-size: 9px;
  }

  .info-label-new {
    font-size: 9px;
  }

  .info-value-new {
    font-size: 9px;
  }

  .submit-btn-new {
    padding: 12px 10px;
    font-size: 13px;
  }

  /* Mobile order - smaller inputs for tiny screens */
  .mobile-input-wrapper {
    height: 40px;
  }

  .mobile-input {
    font-size: 14px;
  }

  .mobile-input-label {
    font-size: 10px;
  }

  .mobile-input-suffix {
    font-size: 12px;
  }

  /* Mobile order modal - small screens */
  .mobile-order-content {
    max-height: calc(92vh - 70px);
    border-radius: 16px 16px 0 0;
  }

  .mobile-order-header {
    padding: 10px 14px;
  }

  .mobile-order-body {
    padding: 10px 14px;
  }
}

/* Landscape orientation - reduce max height */
@media (max-height: 500px) and (orientation: landscape) {
  .mobile-order-content {
    max-height: calc(95vh - 60px);
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: high) {
  :root {
    --border: rgba(255, 255, 255, 0.3);
    --text: #ffffff;
  }

  .btn-cancel-all {
    border-width: 2px;
  }

  .panel {
    border-width: 2px;
  }
}

/* REMOVE ALL TAB/BUTTON HIGHLIGHT - User Request */
:focus-visible {
  outline: none;
}

button:focus-visible,
input:focus-visible,
.tab:focus-visible,
.chip:focus-visible,
.order-type-tab:focus-visible,
.mobile-side-tab:focus-visible {
  outline: none;
}

/* Remove tap highlight on mobile */
button,
.tab,
.order-type-tab,
.mobile-side-tab,
a {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {

  .nav,
  .mobile-sticky-buttons,
  .modal,
  .order-panel,
  .hamburger {
    display: none !important;
  }

  .container {
    max-width: 100%;
  }

  .panel {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Optimize chart rendering */
.chart-box,
.chart-box *,
#candleChart {
  -webkit-tap-highlight-color: transparent;
}

.chart-box {
  will-change: auto;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/**
 * Dashboard Gen Z UI Enhancements
 * Apply modern glassmorphism and micro-interactions to existing dashboard
 */

/* ========================================
   ENHANCED TRADING CARDS
======================================== */
.buy-sell-container,
.orders-container,
.chart-container,
.orderbook-container {
  position: relative;
}

.buy-sell-container::before,
.orders-container::before,
.chart-container::before,
.orderbook-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      rgba(102, 126, 234, 0.3),
      transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.buy-sell-container:hover::before,
.orders-container:hover::before,
.chart-container:hover::before,
.orderbook-container:hover::before {
  opacity: 1;
}

/* ========================================
   ENHANCED ORDER BOOK
======================================== */
.orderbook-row {
  position: relative;
}

/* No hover styling on orderbook - user requested */

/* Animate new orders appearing */
@keyframes orderAppear {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.orderbook-row.new {
  animation: orderAppear 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========================================
   ENHANCED BUTTONS
======================================== */
button.buy-btn:hover,
button.sell-btn:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ========================================
   ENHANCED FORMS
======================================== */
input[type="number"],
input[type="text"],
select {
  transition: all 0.3s ease;
  position: relative;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1),
    0 4px 12px rgba(102, 126, 234, 0.2);
}

/* Animated placeholder */
input[type="number"]::placeholder,
input[type="text"]::placeholder {
  transition: all 0.3s ease;
}

input[type="number"]:focus::placeholder,
input[type="text"]:focus::placeholder {
  transform: translateY(-2px);
  opacity: 0.5;
}

/* ========================================
   ENHANCED TABLES
======================================== */
.orders-table tbody tr {
  transition: all 0.2s ease;
  position: relative;
}

.orders-table tbody tr:hover {
  background: rgba(102, 126, 234, 0.05);
  transform: scale(1.01);
}

.orders-table tbody tr::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      var(--border-primary),
      transparent);
}

/* New trade row animation */
@keyframes tradeFlash {

  0%,
  100% {
    background: transparent;
  }

  50% {
    background: rgba(102, 126, 234, 0.15);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
  }
}

.trades-table tbody tr.new-trade {
  animation: tradeFlash 1s ease;
}

/* ========================================
   ENHANCED TABS
======================================== */
.tab-btn {
  position: relative;
  transition: all 0.3s ease;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transform: translateX(-50%);
  transition: width 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.tab-btn.active::after {
  width: 100%;
}

.tab-btn:hover:not(.active) {
  transform: translateY(-2px);
}

/* ========================================
   BALANCE DISPLAY ENHANCEMENTS
======================================== */
.balance-display,
.shares-display,
.portfolio-value {
  position: relative;
  transition: all 0.3s ease;
}

.balance-display:hover,
.shares-display:hover,
.portfolio-value:hover {
  transform: scale(1.05);
}

/* Shimmer effect on balance update */
@keyframes balanceShimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

.balance-updated {
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(102, 126, 234, 0.2) 50%,
      transparent 100%);
  background-size: 1000px 100%;
  animation: balanceShimmer 1.5s ease;
}

/* ========================================
   CHART CONTAINER ENHANCEMENTS
======================================== */
#tradingChart {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

#tradingChart:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ========================================
   MICRO-INTERACTIONS
======================================== */

/* Cancel button pulse on hover */
@keyframes cancelPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 var(--neg-4);
  }

  50% {
    box-shadow: 0 0 0 8px var(--neg-0);
  }
}

.cancel-btn:hover {
  animation: cancelPulse 1.5s infinite;
}

/* Success state for completed orders */
@keyframes successGlow {

  0%,
  100% {
    box-shadow: 0 0 0 0 var(--pos-4);
  }

  50% {
    box-shadow: 0 0 0 10px var(--pos-0);
  }
}

.order-filled {
  animation: successGlow 1s ease;
}

/* Loading state shimmer */
@keyframes loadingShimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

.loading-row {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.02) 0%,
      var(--border-secondary) 50%,
      rgba(255, 255, 255, 0.02) 100%);
  background-size: 1000px 100%;
  animation: loadingShimmer 2s infinite;
}

/* ========================================
   PRICE TICKER ENHANCEMENTS
======================================== */
.price-ticker {
  position: relative;
  overflow: hidden;
}

.price-ticker::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      var(--border-primary),
      transparent);
  animation: tickerSweep 3s infinite;
}

@keyframes tickerSweep {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

/* ========================================
   NOTIFICATION BADGE
======================================== */
.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #0f172a, 0 4px 12px rgba(239, 68, 68, 0.5);
  z-index: 10;
  animation: badgePop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  line-height: 1;
}

@keyframes badgePop {
  0% {
    transform: scale(0);
  }

  100% {
    transform: scale(1);
  }
}

/* ========================================
   SMOOTH TRANSITIONS FOR STATE CHANGES
======================================== */
.fade-in {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.scale-in {
  animation: scaleIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================
   MOBILE RESPONSIVE ENHANCEMENTS
======================================== */
@media (max-width: 768px) {
  button.buy-btn:hover,
  button.sell-btn:hover,
  .btn-primary:hover,
  .btn-secondary:hover {
    transform: translateY(0);
  }

  .tab-btn:hover:not(.active) {
    transform: translateY(0);
  }

  /* Slider mobile fixes */
  .slider-container {
    overflow: visible;
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  /* Mobile slider specific - ensure proper positioning in form */
  .slider-container.mobile-slider {
    margin: 8px 0 !important;
    height: 32px !important;
  }

  .amount-slider-new {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Form mobile spacing */
  .order-form-side {
    padding: 0 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .buy-side {
    padding-right: 8px;
  }

  .sell-side {
    padding-left: 8px;
  }

  /* Input group mobile */
  .form-group-inline {
    width: 100%;
    max-width: 100%;
    margin-bottom: 8px;
  }

  .input-with-label {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Submit button mobile */
  .submit-btn-new {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    font-size: 14px;
  }

  /* Orderbook compact for mobile */
  .book-side .table.book tbody td {
    padding: 2px 6px !important;
    font-size: 10px !important;
  }

  .book-side .table.book tbody td:nth-child(1) {
    padding-left: 8px !important;
    font-size: 10px !important;
  }

  .book-side .table.book tbody td:nth-child(3) {
    padding-right: 8px !important;
  }

  .book-header .book-col {
    font-size: 9px !important;
    padding: 6px 4px !important;
  }

  /* Mid price compact for mobile */
  .book-mid {
    padding: 5px 6px !important;
    gap: 4px !important;
  }

  .book-mid .price {
    font-size: 13px !important;
    letter-spacing: -0.3px !important;
  }

  .book-mid .arrow {
    font-size: 14px !important;
  }

  /* Book stats - normal size on mobile */
  .book-stats {
    padding: 5px 8px !important;
  }

  .book-stat {
    gap: 3px !important;
  }

  .book-stat-label {
    font-size: 9px !important;
  }

  .book-stat-value {
    font-size: 10px !important;
  }
}

/* ========================================
   ACCESSIBILITY: Reduced Motion
======================================== */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   NEW SLIDER DESIGN (SMOOTH & MARKERS)
   ============================================ */
.slider-container {
  position: relative;
  width: 100%;
  height: 24px;
  /* Increased height for touch */
  display: flex;
  align-items: center;
  margin: 4px 0 8px 0;
  /* Compact margins */
  /* More spacing */
}

/* Markers Container */
.slider-markers {
  position: absolute;
  top: 50%;
  /* Offset by half thumb width (9px) on each side to align markers with thumb center */
  left: 9px;
  right: 9px;
  width: auto;
  height: 4px;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 0;
  pointer-events: none;
  padding: 0;
}

/* Individual Marker */
/* Individual Marker */
.slider-marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-primary);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

/* Active Marker State */
.slider-marker.active {
  background: #fff;
  border-color: #fff;
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Buy Side Active Markers */
.buy-side .slider-marker.active {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Sell Side Active Markers */
.sell-side .slider-marker.active {
  background: #ef4444;
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* The Slider Input */
.amount-slider-new {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: transparent;
  /* Track is handled by markers/container */
  outline: none;
  padding: 0;
  margin: 0;
  z-index: 1;
  /* Above markers */
  cursor: pointer;
  border-radius: 2px;
  position: relative;
}

/* Slider Track (Progress) */
.amount-slider-new {
  /* We use a gradient to simulate the progress bar */
  background: linear-gradient(to right, var(--slider-color) 0%, var(--slider-color) var(--slider-percentage), var(--border-primary) var(--slider-percentage), var(--border-primary) 100%);
}

/* Slider Thumb (The Ball) */
.amount-slider-new::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  border: 2px solid var(--slider-color);
  margin-top: 0;
  /* Centered */
}

.amount-slider-new::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  border: 2px solid var(--slider-color);
}

/* Thumb Hover/Active */
.amount-slider-new::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 4px var(--border-primary);
}

.amount-slider-new:active::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);
}

/* Tooltip */
.slider-tooltip {
  position: absolute;
  top: -28px;
  left: var(--slider-percentage);
  transform: translateX(-50%);
  background: rgba(20, 27, 45, 0.9);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
  border: 1px solid var(--border-primary);
}

.amount-slider-new:hover+.slider-tooltip,
.amount-slider-new:active+.slider-tooltip {
  opacity: 1;
}



/* NOTE: 2025 Animations moved to landing.css (loaded on all pages) */
/* ========================================
   ORDERBOOK & RECENT TRADES - MODERN REDESIGN
   Clean, Professional, Minimal Design
   ======================================== */

/* ===== ORDERBOOK PANEL ===== */
.orderbook-col .panel {
  background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-overlay) 100%) !important;
  border: 1px solid rgba(71, 85, 105, 0.25) !important;
  backdrop-filter: blur(12px) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

.orderbook-col .panel h3 {
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: -0.2px !important;
  color: #f1f5f9 !important;
  padding: 12px 12px 10px 12px !important;
  margin: 0 !important;
  border-bottom: 1px solid rgba(71, 85, 105, 0.2) !important;
}

/* Book Header */
.book-header {
  display: grid !important;
  grid-template-columns: 38% 32% 30% !important;
  padding: 6px 8px 4px 8px !important;
  background: var(--bg-modal) !important;
  border-bottom: 1px solid var(--border) !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  color: var(--muted) !important;
  text-transform: uppercase !important;
}

.book-col {
  flex: 1 !important;
  text-align: right !important;
}

.book-col:first-child {
  text-align: left !important;
  flex: 1.2 !important;
}

/* Orderbook Rows - Modern Look */
.book-side .table.book tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.08) !important;
}

/* No hover styling on book table - user requested */

.book-side .table.book tbody td {
  padding: 8px 4px !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  font-family: var(--font-numeric) !important;
}

.book-side .table.book tbody td:nth-child(1) {
  padding-left: 16px !important;
  font-weight: 600 !important;
  font-feature-settings: "tnum" !important;
  font-variant-numeric: tabular-nums !important;
}

.book-side .table.book tbody td:nth-child(2),
.book-side .table.book tbody td:nth-child(3) {
  padding-right: 16px !important;
  color: #cbd5e1 !important;
}

/* Asks (Sell Orders) - Red Theme with Depth Bar */
.asks-side .table.book tbody tr {
  /* Let JS handle depth gradient dynamically */
}

.asks-side .table.book tbody td:nth-child(1) {
  color: #ef4444 !important; /* Brighter red for price */
}

/* Bids (Buy Orders) - Green Theme with Depth Bar */
.bids-side .table.book tbody tr {
  /* Let JS handle depth gradient dynamically */
}

.bids-side .table.book tbody td:nth-child(1) {
  color: #22c55e !important; /* Brighter green for price */
}

/* Mid Price Section - Compact Design */
.book-mid {
  padding: 4px 6px;
  background: rgba(20, 27, 45, 0.8);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.book-mid .price {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.3px;
  font-family: var(--font-numeric);
}

.book-mid .arrow {
  font-size: 14px;
}

/* Book Stats styles are defined earlier in the file at lines 967-1017 */

/* Stats Bar - Modern Progress */
.stats-bar {
  height: 4px !important;
  border-radius: 2px !important;
  overflow: hidden !important;
  background: var(--bg-card-light) !important;
  margin-top: 8px !important;
}

.stats-bar-buy,
.stats-bar-sell {
  height: 100% !important;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.stats-bar-buy {
  background: linear-gradient(90deg, #22c55e 0%, #10b981 100%) !important;
}

.stats-bar-sell {
  background: #ef4444 !important;
}

/* Stats Tooltip - Enhanced */
.stats-tooltip {
  padding: 12px !important;
  margin-top: 8px !important;
  background: rgb(20, 27, 45) !important;
  border: 1px solid rgba(71, 85, 105, 0.3) !important;
  border-radius: 8px !important;
  font-size: 11px !important;
}

.tooltip-row {
  display: flex !important;
  justify-content: space-between !important;
  padding: 6px 0 !important;
  border-bottom: 1px solid var(--bg-hover), 0.15) !important;
}

.tooltip-row:last-child {
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.tooltip-label {
  color: #94a3b8 !important;
  font-weight: 500 !important;
}

.tooltip-value {
  font-weight: 600 !important;
  font-family: var(--font-numeric) !important;
}

.tooltip-value.pos {
  color: #22c55e !important;
}

.tooltip-value.neg {
  color: #ef4444 !important;
}

/* ===== RECENT TRADES PANEL ===== */
.trades-col .panel {
  background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-overlay) 100%) !important;
  border: 1px solid rgba(71, 85, 105, 0.25) !important;
  backdrop-filter: blur(12px) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

.trades-col .panel>h3 {
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: -0.2px !important;
  color: #f1f5f9 !important;
  padding: 12px 12px 6px 12px !important;
  margin: 0 !important;
}

/* Tabs - Clean Underline Style (like Limit/Market) */
.trades-col .tabs {
  display: flex !important;
  gap: 0 !important;
  padding: 4px 12px !important;
  border: none !important;
  background: transparent !important;
  flex-shrink: 0 !important;
}

.trades-col .tabs .tab {
  padding: 8px 12px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  position: relative !important;
}

.trades-col .tabs .tab:hover {
  background: transparent !important;
  color: var(--text-secondary) !important;
}

.trades-col .tabs .tab.active {
  background: transparent !important;
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}

.trades-col .tabs .tab.active::after {
  content: '' !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 2px !important;
  background: var(--gold-primary) !important;
  z-index: 1 !important;
}

/* Trades Table */
.trades-col .table-wrap {
  padding: 0 !important;
}

.trades-col .table thead {
  background: var(--bg-tertiary) !important;
  border-bottom: 1px solid rgba(71, 85, 105, 0.2) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
}

.trades-col .table thead th {
  padding: 12px 16px !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  color: #94a3b8 !important;
  border-bottom: none !important;
}

.trades-col .table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.08) !important;
}

.trades-col .table tbody td {
  padding: 10px 16px !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  color: #94a3b8; /* Default gray - will be overridden by taker class */
}

.trades-col .table tbody td:nth-child(2) {
  font-weight: 600 !important;
  font-family: var(--font-numeric) !important;
  font-feature-settings: "tnum" !important;
}

/* Taker Type Color Coding in Market Trades - PRICE COLUMN ONLY */
/* Buy taker = green (market buyer took liquidity from sell orders) */
.trades-col .table tbody tr.trade-buy td:nth-child(2) {
  color: #22c55e !important;
}

/* Sell taker = red (market seller took liquidity from buy orders) */
.trades-col .table tbody tr.trade-sell td:nth-child(2) {
  color: #ef4444 !important;
}

/* Flash Animation for New Trades */
@keyframes tradeFlash {
  0% {
    background: var(--blue-3) !important;
    transform: translateX(0) scale(1.02) !important;
  }

  100% {
    background: transparent !important;
    transform: translateX(0) scale(1) !important;
  }
}

.trades-col .table tbody tr.flash-new {
  animation: tradeFlash 0.6s ease-out !important;
}

/* Scrollbar - Minimal Design */
.trades-col .table-wrap::-webkit-scrollbar,
.asks-side::-webkit-scrollbar,
.bids-side::-webkit-scrollbar {
  width: 4px !important;
}

.trades-col .table-wrap::-webkit-scrollbar-track,
.asks-side::-webkit-scrollbar-track,
.bids-side::-webkit-scrollbar-track {
  background: rgba(20, 27, 45, 0.3) !important;
  border-radius: 2px !important;
}

.trades-col .table-wrap::-webkit-scrollbar-thumb,
.asks-side::-webkit-scrollbar-thumb,
.bids-side::-webkit-scrollbar-thumb {
  background: rgba(71, 85, 105, 0.4) !important;
  border-radius: 2px !important;
  transition: background 0.2s !important;
}

.trades-col .table-wrap::-webkit-scrollbar-thumb:hover,
.asks-side::-webkit-scrollbar-thumb:hover,
.bids-side::-webkit-scrollbar-thumb:hover {
  background: rgba(71, 85, 105, 0.6) !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

  .orderbook-col .panel h3,
  .trades-col .panel>h3 {
    font-size: 14px !important;
    padding: 12px !important;
  }

  .book-mid .price {
    font-size: 18px !important;
  }

  .trades-col .tabs .tab {
    padding: 6px 12px !important;
    font-size: 11px !important;
  }

  .book-side .table.book tbody td,
  .trades-col .table tbody td {
    font-size: 11px !important;
    padding: 6px 12px !important;
  }
}
/* Fix: Ensure input labels always transparent */
.order-tab.active .input-label-floating,
.order-form.active .input-label-floating,
.order-panel-new .input-label-floating,
.input-label-floating {
  background: transparent !important;
  background-color: transparent !important;
}

/* Ensure legend also transparent in all states */
.order-tab.active .input-legend,
.order-tab.active .input-legend span,
.order-form.active .input-legend,
.order-form.active .input-legend span,
.input-fieldset .input-legend,
.input-fieldset .input-legend span {
  background: transparent !important;
  background-color: transparent !important;
}

/* Prevent tab active state from adding backgrounds */
.order-tab.active.buy .input-label-floating,
.order-tab.active.sell .input-label-floating,
.order-type-tab.active ~ * .input-label-floating,
.buy-form .input-label-floating,
.sell-form .input-label-floating {
  background: none !important;
  background-color: transparent !important;
  padding: 0 !important;
}

/* Ensure fieldset has no background */
.input-fieldset,
.material-outline .input-fieldset,
.order-panel-new .input-fieldset {
  background: transparent !important;
  background-color: transparent !important;
}

/* Ultimate override - remove all backgrounds from floating labels */
body .dashboard .order-panel-new .input-label-floating,
body .dashboard .input-with-label .input-label-floating,
.input-with-label:has(.form-input-new:focus) .input-label-floating,
.input-with-label:has(.form-input-new:not(:placeholder-shown)) .input-label-floating {
  background: transparent !important;
  background-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Remove all padding from floating labels */
.input-label-floating,
.input-with-label .input-label-floating,
.form-input-new:focus ~ .input-label-floating,
.form-input-new:not(:placeholder-shown) ~ .input-label-floating {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
}

/* Fix button positioning in order panel */
.order-panel-new {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.order-forms-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  max-height: calc(100% - 80px); /* Reserve space for tabs and button */
  padding: 12px;
}

.submit-btn-new {
  margin-top: 12px !important;
  flex-shrink: 0;
  z-index: 10;
}

/* Fix z-index and overlapping issues */
.order-type-tabs {
  position: relative;
  z-index: 1;
  overflow: visible;
}

.order-type-tab {
  position: relative;
  z-index: 2;
}

.order-forms-container,
.order-form {
  position: relative;
  z-index: 3;
}

.input-with-label {
  position: relative;
  z-index: 4;
}

/* Ensure proper form structure and button positioning */
.order-form.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-bottom: 10px;
}

.order-form.active > *:last-child {
  margin-top: auto;
}

/* Add proper spacing between form inputs */
.form-group-inline {
  margin-bottom: 16px !important;
}

.form-group-inline:first-child {
  margin-top: 8px;
}

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

/* Ensure proper height for order panel */
.order-panel-new .order-forms-container {
  scrollbar-width: thin;
  scrollbar-color: rgba(71, 85, 105, 0.3) transparent;
}

/* Fix padding and height issues */
.order-forms-container {
  padding: 8px !important;
  overflow: hidden !important;
  height: 100%;
}

.order-form-side {
  padding: 8px !important;
  overflow: hidden !important;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.form-group-inline {
  margin-bottom: 12px !important;
}

.order-panel-new {
  overflow: hidden !important;
}

.order-panel-new .order-forms-container {
  max-height: 100%;
  overflow-y: hidden;
  overflow-x: hidden;
}

/* Compact layout with no scrolling */
.order-panel-new {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.order-type-tabs {
  flex-shrink: 0;
  padding: 4px 6px !important;
}

.order-forms-container {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  padding: 6px !important;
  overflow: hidden !important;
  height: 100%;
}

.order-form-side {
  padding: 6px !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group-inline {
  margin-bottom: 8px !important;
}

.form-group-inline:last-of-type {
  margin-bottom: 6px !important;
}

.slider-container {
  margin: 8px 0 !important;
}

.order-info-rows {
  margin: 6px 0 !important;
}

.submit-btn-new {
  margin-top: auto !important;
  margin-bottom: 6px !important;
  flex-shrink: 0;
}

/* FORCE REMOVE ALL BACKGROUNDS FROM FLOATING LABELS */
.input-label-floating,
.input-label-floating::before,
.input-label-floating::after,
label.input-label-floating,
.input-with-label .input-label-floating,
.input-with-label:focus-within .input-label-floating,
.form-input-new:focus ~ .input-label-floating,
.form-input-new:not(:placeholder-shown) ~ .input-label-floating,
body .input-label-floating,
body .dashboard .input-label-floating,
body .dashboard .order-panel-new .input-label-floating,
body .dashboard .order-panel-new .input-with-label .input-label-floating,
.order-panel-new label.input-label-floating,
.material-outline .input-label-floating,
.material-outline label.input-label-floating {
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  border: none !important;
}

/* When label is at top position */
.input-with-label:focus-within .input-label-floating,
.form-input-new:not(:placeholder-shown) ~ .input-label-floating {
  padding: 0 2px !important; /* Only minimal padding for text readability */
  background: none !important;
  background-color: transparent !important;
}

/* Ensure fieldset doesn't add background */
.input-fieldset {
  background: none !important;
  background-color: transparent !important;
}

.input-fieldset legend {
  background: none !important;
  background-color: transparent !important;
  padding: 0 !important;
}

/* ============================================
   RESPONSIVE DESIGN - 4K TO SMALL DESKTOP
   ============================================ */

/* 4K Display (3840px+) */
@media (min-width: 3840px) {
  .order-panel-new {
    font-size: 18px;
  }
  
  .form-input-new {
    height: 52px;
    font-size: 18px;
  }
  
  .form-group-inline {
    margin-bottom: 16px !important;
  }
  
  .order-forms-container {
    padding: 12px !important;
  }
  
  .submit-btn-new {
    height: 56px;
    font-size: 18px;
  }
}

/* QHD/2K Display (2560px - 3839px) */
@media (min-width: 2560px) and (max-width: 3839px) {
  .order-panel-new {
    font-size: 16px;
  }
  
  .form-input-new {
    height: 48px;
    font-size: 16px;
  }
  
  .form-group-inline {
    margin-bottom: 14px !important;
  }
  
  .order-forms-container {
    padding: 10px !important;
  }
  
  .submit-btn-new {
    height: 52px;
    font-size: 16px;
  }
}

/* Full HD (1920px - 2559px) */
@media (min-width: 1920px) and (max-width: 2559px) {
  .order-panel-new {
    font-size: 14px;
  }
  
  .form-input-new {
    height: 44px;
    font-size: 14px;
  }
  
  .form-group-inline {
    margin-bottom: 12px !important;
  }
  
  .order-forms-container {
    padding: 8px !important;
  }
  
  .submit-btn-new {
    height: 48px;
    font-size: 14px;
  }
}

/* HD+ (1600px - 1919px) */
@media (min-width: 1600px) and (max-width: 1919px) {
  .form-input-new {
    height: 42px;
    font-size: 13px;
  }
  
  .form-group-inline {
    margin-bottom: 10px !important;
  }
  
  .order-forms-container {
    padding: 8px !important;
  }
  
  .submit-btn-new {
    height: 44px;
    font-size: 13px;
  }
}

/* Standard Desktop (1366px - 1599px) */
@media (min-width: 1366px) and (max-width: 1599px) {
  .form-input-new {
    height: 40px;
    font-size: 13px;
  }
  
  .form-group-inline {
    margin-bottom: 8px !important;
  }
  
  .order-forms-container {
    padding: 6px !important;
  }
  
  .submit-btn-new {
    height: 42px;
    font-size: 13px;
  }
  
  .slider-container {
    margin: 6px 0 !important;
  }
}

/* Small Desktop (1024px - 1365px) */
@media (min-width: 1024px) and (max-width: 1365px) {
  .form-input-new {
    height: 38px;
    font-size: 12px;
  }
  
  .form-group-inline {
    margin-bottom: 6px !important;
  }
  
  .order-forms-container {
    padding: 4px !important;
  }
  
  .order-form-side {
    padding: 4px !important;
    gap: 4px;
  }
  
  .submit-btn-new {
    height: 40px;
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .slider-container {
    margin: 4px 0 !important;
  }
  
  .order-info-rows {
    margin: 4px 0 !important;
  }
  
  .info-row-inline {
    font-size: 11px;
    padding: 2px 0;
  }
}

/* Very Small Desktop (800px - 1023px) */
@media (min-width: 800px) and (max-width: 1023px) {
  .form-input-new {
    height: 36px;
    font-size: 11px;
  }
  
  .input-label-floating {
    font-size: 11px;
  }
  
  .form-group-inline {
    margin-bottom: 4px !important;
  }
  
  .order-forms-container {
    padding: 3px !important;
    grid-template-columns: 1fr; /* Stack vertically */
  }
  
  .order-form-side {
    padding: 3px !important;
  }
  
  .submit-btn-new {
    height: 36px;
    font-size: 11px;
    padding: 6px 10px;
  }
  
  .order-divider {
    display: none;
  }
}

/* Fix focus state - only show when actually focused */
.input-with-label:not(:focus-within) .input-label-floating {
  color: var(--muted) !important;
}

.input-with-label:not(:focus-within) .input-fieldset {
  border-color: rgba(71, 85, 105, 0.3) !important;
}

/* Only show blue color when input is actually focused */
.form-input-new:focus ~ .input-label-floating {
  color: #A8C5DA !important;
}

.form-input-new:focus ~ .input-fieldset {
  border-color: #A8C5DA !important;
}

/* When input has value but not focused */
.form-input-new:not(:focus):not(:placeholder-shown) ~ .input-label-floating {
  color: var(--muted) !important;
}

.form-input-new:not(:focus):not(:placeholder-shown) ~ .input-fieldset {
  border-color: rgba(71, 85, 105, 0.3) !important;
}

/* Remove any lingering focus styles */
.form-input-new:not(:focus) {
  outline: none !important;
}

/* Override - When input has value but NOT focused, use normal style */
.input-with-label .form-input-new:not(:focus):not(:placeholder-shown) ~ .input-label-floating {
  color: var(--muted) !important;
  background: transparent !important;
}

.input-with-label .form-input-new:not(:focus):not(:placeholder-shown) ~ .input-fieldset {
  border-color: rgba(71, 85, 105, 0.3) !important;
}

/* Blue color ONLY when actually focused (regardless of value) */
}

/* ============================================
   SMOOTH DATA UPDATES - NO FLICKERING
   - Prevents refresh-like visual effects
   - Smooth transitions for real-time data
   ============================================ */

/* Smooth transitions for all table rows */
#asksTable tbody tr,
#bidsTable tbody tr,
#tradesBody tr,
#holdersBody tr,
#ordersTableBody tr {
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.3s ease;
}

/* Smooth entry animation for new rows */
#asksTable tbody tr,
#bidsTable tbody tr,
#tradesBody tr,
#holdersBody tr {
  animation: smoothFadeIn 0.3s ease-out;
}

@keyframes smoothFadeIn {
  from {
    opacity: 0.6;
  }
  to {
    opacity: 1;
  }
}

/* Smooth transitions for ticker values */
#tickerPrice,
#tickerPriceIDR,
#tickerHigh,
#tickerLow,
#tickerVolumeShares,
#tickerVolumeUSD,
#tickerChange,
#tickerChangeMobile,
.mid-price,
.mid-change {
  transition: color 0.3s ease, opacity 0.2s ease;
}

/* Smooth transitions for book stats */
#bidSum, #askSum,
#bidAvg, #askAvg,
#bidAvgFull, #askAvgFull {
  transition: opacity 0.2s ease;
}

/* Smooth bar width transitions */
#bidBar, #askBar {
  transition: width 0.5s ease-out;
}

/* Smooth transitions for portfolio values */
#sharesOwned, #balance,
#portfolioValue, #totalPL,
.portfolio-value, .stat-value {
  transition: color 0.3s ease, opacity 0.2s ease;
}

/* Override flash animations to be more subtle */
.flash-green {
  animation: subtleGreen 0.4s ease-out;
}

.flash-red {
  animation: subtleRed 0.4s ease-out;
}

@keyframes subtleGreen {
  0% {
    background-color: rgba(16, 185, 129, 0.15);
  }
  100% {
    background-color: transparent;
  }
}

@keyframes subtleRed {
  0% {
    background-color: rgba(239, 68, 68, 0.15);
  }
  100% {
    background-color: transparent;
  }
}

/* Smooth skeleton removal - fade out instead of instant remove */
.skeleton {
  transition: opacity 0.3s ease;
}

/* Table cell value smooth updates */
#asksTable td,
#bidsTable td,
#tradesBody td,
#holdersBody td {
  transition: color 0.2s ease;
}

/* Order book depth bars - smooth gradient transition */
#asksTable tbody tr,
#bidsTable tbody tr {
  transition: background 0.4s ease-out, opacity 0.2s ease;
}

/* Prevent layout shift during updates */
#asksTable tbody,
#bidsTable tbody,
#tradesBody,
#holdersBody {
  min-height: 100px;
}

/* Smooth empty state transitions */
.empty-row {
  transition: opacity 0.3s ease;
}

/* Loading state transition */
.loading {
  transition: opacity 0.2s ease;
}
