* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #334155 rgba(15, 23, 42, 0.4);
}

/* ============================================================ */
/* GLOBAL CUSTOM MODERN SLENDER SCROLLBAR                       */
/* ============================================================ */
::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 9999px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  transition: background 0.2s ease, transform 0.15s ease;
}

::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

::-webkit-scrollbar-thumb:active,
*::-webkit-scrollbar-thumb:active {
  background: #0284c7;
}

::-webkit-scrollbar-corner,
*::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-button,
*::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Light Mode Universal Scrollbars */
body.light-mode,
body.light-mode *,
[data-theme="light"],
[data-theme="light"] * {
  scrollbar-color: #cbd5e1 #f8fafc;
}

body.light-mode ::-webkit-scrollbar-track,
body.light-mode *::-webkit-scrollbar-track,
[data-theme="light"] ::-webkit-scrollbar-track,
[data-theme="light"] *::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
}

body.light-mode ::-webkit-scrollbar-thumb,
body.light-mode *::-webkit-scrollbar-thumb,
[data-theme="light"] ::-webkit-scrollbar-thumb,
[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: #cbd5e1 !important;
  border: 1px solid #f1f5f9 !important;
}

body.light-mode ::-webkit-scrollbar-thumb:hover,
body.light-mode *::-webkit-scrollbar-thumb:hover,
[data-theme="light"] ::-webkit-scrollbar-thumb:hover,
[data-theme="light"] *::-webkit-scrollbar-thumb:hover {
  background: #94a3b8 !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #070b14;
  background-image: url('/bg-pattern.jpg?v=3.8');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #f1f5f9;
  min-height: 100vh;
  padding: 20px 24px;
  width: 100%;
  overflow-x: hidden;
}

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

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 24px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  box-shadow: none;
}

h1 {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 13px;
  color: #94a3b8;
}

.badges {
  display: flex;
  gap: 8px;
}

.badge {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0f172a;
  border: 1px solid #334155;
  color: #cbd5e1;
  transition: all 0.15s ease;
}

.badge-success { background: #0f172a; color: #f8fafc; border: 1px solid #334155; }
.badge-warning { background: #0f172a; color: #f8fafc; border: 1px solid #334155; }
.badge-danger { background: #0f172a; color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-info { background: #0f172a; color: #94a3b8; border: 1px solid #1e293b; }
.badge-purple { background: #0f172a; color: #cbd5e1; border: 1px solid #334155; }
.badge-mode { background: #0f172a; border: 1px solid #334155; color: #f8fafc; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }

.grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

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

.card {
  background: #0b1120;
  border-radius: 12px;
  border: 1px solid #1e293b;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.full-width {
  grid-column: 1 / -1;
}

.card-header {
  padding: 12px 18px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  font-size: 14.5px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  letter-spacing: -0.01em;
}

/* Reusable Sleek Top Header Banner for All Tabs */
.tab-top-banner {
  padding: 12px 18px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  flex-wrap: wrap;
  gap: 10px;
}

.tab-top-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-top-banner-icon {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-top-banner-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.tab-top-banner-badge {
  font-size: 11px;
  color: #10b981;
  font-weight: 500;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tab-top-banner-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-banner-action {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-banner-action:hover {
  background: #334155;
  border-color: #475569;
  transform: translateY(-1px);
}

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

.wallet-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.status-indicator {
  font-size: 13px;
  color: #94a3b8;
}

.card-body {
  padding: 20px;
}

.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.qr-wrapper {
  background: #ffffff;
  padding: 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  min-width: 240px;
  color: #0f172a;
}

.qr-image {
  width: 220px;
  height: 220px;
  display: block;
}

.connected-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border: 2px solid #10b981;
}

.hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 14px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-box {
  background: #0f172a;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #334155;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 12px;
  color: #94a3b8;
}

.stat-val {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.section-title {
  font-size: 14px;
  color: #94a3b8;
  margin: 16px 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.holdings-list {
  background: #0f172a;
  border-radius: 10px;
  border: 1px solid #334155;
  padding: 8px 12px;
  min-height: 50px;
}

.holding-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #1e293b;
  font-size: 14px;
}

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

.coin-symbol {
  font-weight: 600;
  color: #38bdf8;
}

.coin-amount {
  color: #f1f5f9;
}

.empty-state {
  color: #64748b;
  font-size: 13px;
  text-align: center;
  padding: 12px;
}

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

.cmd-item {
  background: #0f172a;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #334155;
}

.cmd-item code {
  background: #1e293b;
  color: #f59e0b;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 6px;
}

.cmd-item p {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.4;
}

.footer {
  text-align: center;
  margin-top: 30px;
  font-size: 13px;
  color: #64748b;
}

/* ==========================================================================
   Professional Footer & Legal Protection Styles
   ========================================================================== */
.app-pro-footer {
  margin-top: 50px;
  padding: 35px 20px 30px;
  border-top: 1px solid #1e293b;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

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

.footer-brand {
  text-align: left;
}

.footer-brand-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.2px;
}

.footer-brand-tagline {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: #64748b;
  max-width: 520px;
  line-height: 1.5;
}

.footer-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  color: #94a3b8;
}

.footer-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.footer-badge .dot-green {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.footer-links-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px dashed rgba(51, 65, 85, 0.4);
  border-bottom: 1px dashed rgba(51, 65, 85, 0.4);
}

.footer-link-btn {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.footer-link-btn:hover {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.1);
  text-decoration: underline;
}

.footer-sep {
  color: #475569;
  font-size: 11px;
}

.footer-time-zone {
  color: #64748b;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.footer-disclaimer-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  padding: 14px 18px;
  text-align: left;
}

.disclaimer-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #f59e0b;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.disclaimer-body {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: #94a3b8;
}

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

.footer-copy {
  margin: 0;
  font-size: 12.5px;
  color: #64748b;
}

.footer-copy strong {
  color: #f1f5f9;
}

.footer-sub-copy {
  margin: 0;
  font-size: 11.5px;
  color: #475569;
}

.spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-left-color: #f59e0b;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

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

.btn-unlink {
  margin-top: 14px;
  background-color: #ef4444;
  color: white;
  border: none;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
  transition: all 0.2s ease;
}

.btn-unlink:hover {
  background-color: #dc2626;
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.4);
}

.btn-unlink:disabled {
  background-color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

/* Quick Settings Controls */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 1100px) {
  .controls-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

.control-section {
  background: #0f172a;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #334155;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.control-title {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 10px;
  display: block;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.quick-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.quick-btn:hover {
  background: #334155;
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}

.quick-btn.active {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  font-weight: 700;
}

.control-hint {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
}

.control-hint code {
  background: #1e293b;
  color: #f59e0b;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 11px;
}

.config-toast {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
}

.config-toast.success {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #10b981;
}

.config-toast.error {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
}

.config-toast.info {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.config-toast.warning {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #f59e0b;
}

/* Centered QR Box & Popup Styles */
#qr-container, .qr-box {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  margin: 14px auto;
}

#qr-reset-popup {
  display: none;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid #38bdf8;
  color: #38bdf8;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin: 0 auto 14px auto;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.25);
  animation: pulse-qr 2s infinite ease-in-out;
}

@keyframes pulse-qr {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); box-shadow: 0 0 18px rgba(56, 189, 248, 0.4); }
  100% { transform: scale(1); }
}

/* Binance-Style Range Drag Sliders */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px 0;
  background: rgba(15, 23, 42, 0.6);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #334155;
}

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

.slider-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.slider-badge {
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.slider-badge.amber {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
}

.slider-badge.emerald {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
}

.crypto-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 6px;
  background: #1e293b;
  outline: none;
  cursor: pointer;
  margin: 8px 0 4px 0;
  border: 1px solid #334155;
}

.crypto-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #38bdf8;
  cursor: grab;
  border: 3px solid #0f172a;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.crypto-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.9);
}

.crypto-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.25);
  box-shadow: 0 0 18px rgba(56, 189, 248, 1);
}

.crypto-slider.amber::-webkit-slider-thumb {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.7);
}
.crypto-slider.amber::-webkit-slider-thumb:hover {
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.9);
}
.crypto-slider.amber::-webkit-slider-thumb:active {
  box-shadow: 0 0 18px rgba(245, 158, 11, 1);
}

.crypto-slider.emerald::-webkit-slider-thumb {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
}
.crypto-slider.emerald::-webkit-slider-thumb:hover {
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.9);
}
.crypto-slider.emerald::-webkit-slider-thumb:active {
  box-shadow: 0 0 18px rgba(16, 185, 129, 1);
}

.crypto-slider.mini::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.crypto-slider.mini::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.crypto-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #38bdf8;
  cursor: grab;
  border: 3px solid #0f172a;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  padding: 0 2px;
}

.wallet-live-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wallet-live-tag.paper {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.wallet-live-tag.testnet {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.btn-api-key {
  background: #0f172a;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-api-key:hover {
  background: #1e293b;
  border-color: #475569;
  color: #ffffff;
}

.btn-api-disconnect {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-api-disconnect:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ffffff;
}

.btn-api-edit {
  background: #0f172a;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-api-edit:hover {
  background: #1e293b;
  border-color: #475569;
  color: #ffffff;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

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

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

.btn-logout:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ip-key {
  background: #0f172a;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ip-key:hover {
  background: #1e293b;
  border-color: #475569;
  color: #ffffff;
}

.btn-open-trade {
  background: #0284c7;
  color: #ffffff;
  border: 1px solid #0284c7;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: none;
}

.btn-open-trade:hover {
  background: #0369a1;
  border-color: #0369a1;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
  transform: translateY(-1px);
}

.btn-history-trade {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: none;
}

.btn-history-trade:hover {
  background: #334155;
  border-color: #64748b;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.4);
  transform: translateY(-1px);
}

.coin-chip {
  background: #0f172a;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.coin-chip:hover, .coin-chip.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #10b981;
}

/* Binance Pro Coin Search & Dropdown */
.coin-search-container {
  position: relative;
  width: 100%;
  margin-bottom: 12px;
}

.coin-chip.search-chip {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.coin-chip.search-chip:hover, .coin-chip.search-chip.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
}

.coin-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.coin-search-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.coin-search-icon-inside {
  position: absolute;
  left: 12px;
  font-size: 14px;
  pointer-events: none;
  color: #64748b;
  display: flex;
  align-items: center;
}

.coin-search-input {
  width: 100%;
  box-sizing: border-box;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 36px 10px 36px;
  color: #f1f5f9;
  font-family: monospace;
  font-size: 14px;
  font-weight: 700;
  outline: none;
  transition: all 0.2s;
}

.coin-search-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.coin-search-clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  display: none;
  transition: all 0.15s;
}

.coin-search-clear-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.1);
}

.coin-price-badge {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: #10b981;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.coin-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #0b1120;
  border: 1px solid #10b981;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(16, 185, 129, 0.2);
  z-index: 1200;
  overflow: hidden;
  animation: fadeInSlide 0.15s ease-out;
}

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

.coin-dropdown-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  overflow-x: auto;
}

.coin-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.coin-tab-btn:hover {
  color: #f1f5f9;
  background: #1e293b;
}

.coin-tab-btn.active {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
}

.coin-table-header {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #080d1a;
  border-bottom: 1px solid #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.coin-search-list {
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
}

.coin-search-list::-webkit-scrollbar {
  width: 6px;
}
.coin-search-list::-webkit-scrollbar-track {
  background: #0b1120;
}
.coin-search-list::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
.coin-search-list::-webkit-scrollbar-thumb:hover {
  background: #10b981;
}

.coin-search-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  align-items: center;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid rgba(30, 41, 59, 0.4);
}

.coin-search-row:hover, .coin-search-row.active-row {
  background: #131e36;
}

.coin-search-row.selected {
  background: rgba(16, 185, 129, 0.12);
}

.coin-sym-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.coin-base-txt {
  font-weight: 700;
  color: #f8fafc;
  font-size: 13.5px;
  font-family: monospace;
}

.coin-quote-txt {
  color: #64748b;
  font-size: 11px;
}

.coin-perp-badge {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  margin-left: 4px;
}

.coin-vol-txt {
  font-size: 10px;
  color: #64748b;
}

.coin-price-col {
  font-family: monospace;
  font-size: 12.5px;
  font-weight: 600;
  color: #f1f5f9;
}

.coin-change-col {
  text-align: right;
}

.coin-change-badge {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: monospace;
}

.coin-change-badge.up {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.coin-change-badge.down {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.coin-search-footer {
  padding: 6px 14px;
  font-size: 11px;
  color: #64748b;
  background: #080d1a;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preset-chip {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #38bdf8;
}

.preset-chip.active {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.btn-wa-key {
  background: #0f172a;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-wa-key:hover {
  background: #1e293b;
  border-color: #475569;
  color: #ffffff;
}

.btn-wa-key.wa-scan-required {
  background: #0f172a;
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #f59e0b;
}

.btn-wa-key.wa-scan-required:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #ffffff;
}

.btn-phone-key {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #c084fc;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-phone-key:hover {
  background: #a855f7;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

/* Risk Warning Banner & Confirmation Modal */
.risk-banner {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  transition: all 0.3s ease;
}

.risk-banner.confirmed {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.risk-banner-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.risk-banner-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.risk-badge {
  font-size: 13px;
  font-weight: 700;
  color: #f87171;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.risk-banner.confirmed .risk-badge {
  color: #34d399;
}

.risk-status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #334155;
  color: #94a3b8;
}

.risk-banner.confirmed .risk-status {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.risk-banner-text {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
}

.risk-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  padding-top: 4px;
}

.risk-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #ef4444;
  cursor: pointer;
}

.risk-banner.confirmed .risk-checkbox-label input[type="checkbox"] {
  accent-color: #10b981;
}

/* Modal Overlay & Card */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  padding: 20px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.modal-content {
  background: #0b1120;
  border: 1px solid #1e293b;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  border-radius: 10px;
  max-width: 520px;
  width: 100%;
  padding: 22px 24px;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin: auto;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

@keyframes modalPop {
  0% { transform: scale(0.97); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.modal-icon {
  font-size: 20px;
  background: rgba(240, 185, 11, 0.1);
  border: 1px solid rgba(240, 185, 11, 0.25);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #f8fafc;
  margin: 0;
}

.modal-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.modal-body {
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.modal-body::-webkit-scrollbar,
.modal-overlay::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track,
.modal-overlay::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb,
.modal-overlay::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover,
.modal-overlay::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

.modal-stats-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-stat-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #94a3b8;
}

.modal-stat-line.highlight {
  border-top: 1px solid #1e293b;
  padding-top: 8px;
  font-size: 14px;
}

.modal-warning-alert {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #fde68a;
  margin-bottom: 14px;
  line-height: 1.45;
}

.modal-tick-row {
  background: rgba(239, 68, 68, 0.12);
  border: 1px dashed rgba(239, 68, 68, 0.45);
  border-radius: 8px;
  padding: 12px 14px;
}

.modal-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.modal-checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: #ef4444;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-tick-text {
  font-size: 13px;
  color: #f1f5f9;
  line-height: 1.4;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 14px;
  border-top: 1px solid #1e293b;
}

.modal-btn-confirm {
  background: #F0B90B;
  color: #000000;
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.modal-btn-confirm:hover:not(:disabled) {
  background: #fcd535;
}

.modal-btn-confirm:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.modal-btn-queue,
#btn-submit-queue-trade {
  background: #f59e0b !important;
  color: #0f172a !important;
  border: 1px solid #d97706 !important;
  padding: 9px 20px !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  font-family: inherit !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
}

.modal-btn-queue:hover:not(:disabled),
#btn-submit-queue-trade:hover:not(:disabled) {
  background: #d97706 !important;
  border-color: #b45309 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.modal-btn-queue:disabled,
#btn-submit-queue-trade:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
}

.modal-btn-cancel {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  padding: 9px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.modal-btn-cancel:hover {
  background: #334155;
  color: #ffffff;
}

.modal-btn-cancel:hover {
  background: #475569;
}

/* =====================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS
   ===================================================== */

/* Touch-friendly sliders */
.crypto-slider {
  touch-action: pan-y;
}

/* Tablet & Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  body {
    padding: 12px 10px;
    background-image: none !important;
    background-color: #070b14 !important;
  }

  body.light-mode,
  [data-theme="light"] body {
    background-image: none !important;
    background-color: #f8fafc !important;
  }

  #auth-gate-screen {
    background-image: none !important;
    background-color: #070b14 !important;
  }

  .container,
  #app-dashboard {
    background-image: none !important;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
  }

  .logo-area {
    width: 100%;
  }

  .logo-icon {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  h1 {
    font-size: 19px;
    line-height: 1.25;
  }

  .subtitle {
    font-size: 12px;
  }

  .badges {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .badge {
    font-size: 11.5px;
    padding: 4px 10px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 16px;
  }

  .card {
    border-radius: 12px;
  }

  .card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }

  .card-header-title-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
  }

  .card-header-title-wrap h2 {
    font-size: 14.5px;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .card-header-title-wrap .badge-mode {
    font-size: 11px;
    padding: 4px 8px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .wallet-header-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    box-sizing: border-box;
  }

  .wallet-header-actions button {
    width: 100% !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 6px 8px !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  /* + Open Trade button: Top Hero CTA spanning 2 columns */
  .wallet-header-actions .btn-open-trade {
    grid-column: 1 / -1 !important;
    height: 40px !important;
    min-height: 40px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px;
    border-radius: 8px !important;
  }

  /* Disconnect Button: Bottom full width warning */
  .wallet-header-actions .btn-api-disconnect {
    grid-column: 1 / -1 !important;
    height: 36px !important;
    min-height: 36px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
  }

  .wallet-header-actions .wa-status-text,
  .wallet-header-actions .binance-word {
    display: none !important;
  }

  .card-body {
    padding: 14px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }

  .stat-box {
    padding: 10px;
    border-radius: 8px;
  }

  .stat-label {
    font-size: 11px;
  }

  .stat-val {
    font-size: 15px;
  }

  .controls-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .control-section {
    padding: 14px;
    border-radius: 10px;
  }

  .btn-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .quick-btn {
    width: 100%;
    padding: 8px 4px;
    font-size: 12px;
    text-align: center;
  }

  .center-content {
    min-height: 200px;
  }

  .qr-wrapper {
    min-width: auto;
    width: 100%;
    max-width: 240px;
    padding: 12px;
  }

  .qr-image {
    width: 200px;
    height: 200px;
  }

  .connected-box {
    padding: 16px 10px;
  }

  .risk-banner {
    padding: 12px 14px;
    margin-bottom: 16px;
  }

  .risk-banner-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .risk-banner-text {
    font-size: 12px;
  }

  .risk-checkbox-label {
    font-size: 12.5px;
  }

  .modal-overlay {
    padding: 10px;
    align-items: flex-start;
  }

  .modal-content {
    padding: 18px 14px;
    border-radius: 14px;
    max-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
    margin: auto;
    width: 100%;
  }

  .modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
  }

  .modal-header h3 {
    font-size: 16px;
  }

  .modal-icon {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .modal-footer {
    flex-direction: column;
    gap: 8px;
  }

  .modal-btn-confirm, .modal-btn-cancel, #btn-exec-close-position {
    width: 100%;
    padding: 11px;
    text-align: center;
    justify-content: center;
  }
}

/* Small Screen Phones (<= 420px) */
@media (max-width: 420px) {
  body {
    padding: 8px 6px;
  }

  h1 {
    font-size: 17px;
  }

  .subtitle {
    font-size: 11px;
  }

  .card-header {
    padding: 10px 12px;
    gap: 10px;
  }

  .card-header-title-wrap h2 {
    font-size: 13.5px;
  }

  .card-header-title-wrap .badge-mode {
    font-size: 10px;
    padding: 3px 6px;
  }

  .wallet-header-actions {
    gap: 6px !important;
  }

  .wallet-header-actions button {
    height: 34px !important;
    min-height: 34px !important;
    font-size: 10.5px !important;
    padding: 4px 6px !important;
  }

  .wallet-header-actions .btn-open-trade {
    height: 38px !important;
    min-height: 38px !important;
    font-size: 12.5px !important;
  }

  .wallet-header-actions .btn-api-disconnect {
    height: 34px !important;
    min-height: 34px !important;
    font-size: 11px !important;
  }

  .card-body {
    padding: 10px;
  }

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

  .btn-group {
    grid-template-columns: repeat(2, 1fr);
  }

  .control-section {
    padding: 10px;
  }
}

/* Interactive Clickable Coin Symbol in Positions */
.clickable-coin-symbol {
  font-size: 15px;
  font-weight: 700;
  color: #38bdf8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  transition: all 0.2s ease;
  user-select: none;
}

.clickable-coin-symbol:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.clickable-coin-symbol:active {
  transform: translateY(0);
}

/* Timeframe Buttons in Chart Modal */
.chart-tf-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chart-tf-btn:hover {
  color: #ffffff;
  background: rgba(245, 158, 11, 0.2);
}

.chart-tf-btn.active {
  background: #f59e0b !important;
  color: #0f172a !important;
  font-weight: 700 !important;
}

/* Chart Modal UI Components (Default Dark) */
.chart-modal-header {
  background: #0b1120;
  border-bottom: 1px solid #1e293b;
}

.chart-tf-group {
  background: #090d16;
  border: 1px solid #1e293b;
}

.chart-binance-link {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  transition: all 0.15s ease;
}

.chart-binance-link:hover {
  background: #334155;
  border-color: #475569;
  color: #ffffff;
}

.chart-btn-open-trade {
  background: #10b981;
  color: #090d16;
  transition: all 0.15s ease;
}

.chart-btn-open-trade:hover {
  background: #34d399;
}

.chart-modal-close-x {
  color: #64748b;
  transition: color 0.15s ease;
}

.chart-modal-close-x:hover {
  color: #f8fafc;
}

.chart-modal-footer {
  background: #0b1120;
  border-top: 1px solid #334155;
  color: #94a3b8;
}

.chart-btn-trade {
  background: #10b981;
  color: #0f172a;
  transition: all 0.15s ease;
}

.chart-btn-trade:hover {
  background: #34d399;
}

.chart-btn-close {
  background: #334155;
  color: #f1f5f9;
  transition: all 0.15s ease;
}

.chart-btn-close:hover {
  background: #475569;
  color: #ffffff;
}

/* Chart Full Box Expansion - 100% Height & Width */
#tradingview-chart-box {
  width: 100% !important;
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 520px !important;
  position: relative !important;
  overflow: hidden !important;
}

#tradingview-chart-box iframe,
#tradingview-chart-box > div,
#tv-chart-view,
#tv-chart-view > div,
#tv-chart-view iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  display: block !important;
  border: none !important;
}

@media (max-width: 768px) {
  #tradingview-chart-box {
    min-height: 440px !important;
  }
}

/* ========================================================
   DARK / LIGHT THEME TOGGLE & LIGHT MODE STYLES
   ======================================================== */
.theme-toggle-btn {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 9999px;
  transition: all 0.25s ease;
  user-select: none;
  outline: none;
}

.theme-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  filter: brightness(1.1);
}

/* Light Mode Overrides */
body.light-mode,
html.light-mode body,
[data-theme="light"] body {
  background-color: #f8fafc !important;
  background-image:
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(245, 158, 11, 0.06) 0px, transparent 45%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%),
    radial-gradient(rgba(100, 116, 139, 0.07) 1px, transparent 1px) !important;
  background-size: 100% 100%, 100% 100%, 100% 100%, 28px 28px !important;
  background-attachment: fixed !important;
  color: #0f172a !important;
}

body.light-mode .tab-top-banner,
html.light-mode .tab-top-banner,
[data-theme="light"] .tab-top-banner {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .tab-top-banner-title,
html.light-mode .tab-top-banner-title,
[data-theme="light"] .tab-top-banner-title {
  color: #0f172a !important;
}

body.light-mode .btn-banner-action,
html.light-mode .btn-banner-action,
[data-theme="light"] .btn-banner-action {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body.light-mode .btn-banner-action:hover,
html.light-mode .btn-banner-action:hover,
[data-theme="light"] .btn-banner-action:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
}

/* Light Mode Custom Slender Scrollbar */
body.light-mode *,
html.light-mode *,
[data-theme="light"] * {
  scrollbar-color: #cbd5e1 #f1f5f9 !important;
}

body.light-mode ::-webkit-scrollbar-track,
html.light-mode ::-webkit-scrollbar-track,
[data-theme="light"] ::-webkit-scrollbar-track,
body.light-mode *::-webkit-scrollbar-track,
html.light-mode *::-webkit-scrollbar-track,
[data-theme="light"] *::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
}

body.light-mode ::-webkit-scrollbar-thumb,
html.light-mode ::-webkit-scrollbar-thumb,
[data-theme="light"] ::-webkit-scrollbar-thumb,
body.light-mode *::-webkit-scrollbar-thumb,
html.light-mode *::-webkit-scrollbar-thumb,
[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: #cbd5e1 !important;
  border: 1px solid #f1f5f9 !important;
}

body.light-mode ::-webkit-scrollbar-thumb:hover,
html.light-mode ::-webkit-scrollbar-thumb:hover,
[data-theme="light"] ::-webkit-scrollbar-thumb:hover,
body.light-mode *::-webkit-scrollbar-thumb:hover,
html.light-mode *::-webkit-scrollbar-thumb:hover,
[data-theme="light"] *::-webkit-scrollbar-thumb:hover {
  background: #94a3b8 !important;
}

body.light-mode ::-webkit-scrollbar-thumb:active,
html.light-mode ::-webkit-scrollbar-thumb:active,
[data-theme="light"] ::-webkit-scrollbar-thumb:active,
body.light-mode *::-webkit-scrollbar-thumb:active,
html.light-mode *::-webkit-scrollbar-thumb:active,
[data-theme="light"] *::-webkit-scrollbar-thumb:active {
  background: #0284c7 !important;
}

body.light-mode .header {
  border-bottom-color: #e2e8f0 !important;
}

body.light-mode h1 {
  color: #0f172a !important;
}

body.light-mode .subtitle {
  color: #64748b !important;
}

body.light-mode .card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .card-header {
  background: #f8fafc !important;
  border-bottom-color: #e2e8f0 !important;
}

body.light-mode .card-header h2 {
  color: #0f172a !important;
}

body.light-mode .stat-box {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

body.light-mode .stat-label {
  color: #64748b !important;
}

body.light-mode .section-title {
  color: #475569 !important;
}

body.light-mode .holdings-list {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

body.light-mode .control-section {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-mode .holding-card,
[data-theme="light"] .holding-card {
  background: #ffffff !important;
  border-top-color: #e2e8f0 !important;
  border-right-color: #e2e8f0 !important;
  border-bottom-color: #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .holding-card > div:last-child,
[data-theme="light"] .holding-card > div:last-child {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

body.light-mode .holding-card > div:last-child b,
[data-theme="light"] .holding-card > div:last-child b {
  color: #0f172a !important;
}

body.light-mode .holding-card [style*="background: #0f172a"],
body.light-mode .holding-card [style*="background:#0f172a"],
[data-theme="light"] .holding-card [style*="background: #0f172a"],
[data-theme="light"] .holding-card [style*="background:#0f172a"] {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

body.light-mode .empty-state {
  background: #ffffff !important;
  color: #64748b !important;
  border: 1px dashed #cbd5e1 !important;
}

body.light-mode #non-active-orders-count {
  background: #e2e8f0 !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
}

body.light-mode .footer,
body.light-mode .app-pro-footer {
  border-top-color: #e2e8f0 !important;
  color: #64748b !important;
}

body.light-mode .footer-brand-title {
  color: #0f172a !important;
}

body.light-mode .footer-brand-tagline {
  color: #64748b !important;
}

body.light-mode .footer-badge {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

body.light-mode .footer-links-row {
  border-top-color: #e2e8f0 !important;
  border-bottom-color: #e2e8f0 !important;
}

body.light-mode .footer-link-btn {
  color: #0284c7 !important;
}

body.light-mode .footer-link-btn:hover {
  background: rgba(2, 132, 199, 0.08) !important;
}

body.light-mode .footer-disclaimer-card {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  border-left-color: #d97706 !important;
}

body.light-mode .disclaimer-header {
  color: #b45309 !important;
}

body.light-mode .disclaimer-body {
  color: #475569 !important;
}

body.light-mode .footer-copy {
  color: #64748b !important;
}

body.light-mode .footer-copy strong {
  color: #0f172a !important;
}

body.light-mode .footer-sub-copy {
  color: #94a3b8 !important;
}

body.light-mode .modal-content {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .modal-header {
  border-bottom-color: #e2e8f0 !important;
}

body.light-mode .modal-header h3 {
  color: #0f172a !important;
}

body.light-mode .modal-footer {
  border-top-color: #e2e8f0 !important;
  background: #f8fafc !important;
}

body.light-mode input[type="text"],
body.light-mode input[type="email"],
body.light-mode input[type="password"],
body.light-mode input[type="number"],
body.light-mode select {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body.light-mode .badge-mode {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

body.light-mode .theme-toggle-btn {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: #0f172a !important;
}

body.light-mode .theme-toggle-btn:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25) !important;
}

/* Base text contrast fixes for inline light colors */
body.light-mode [style*="color: #f8fafc"],
body.light-mode [style*="color:#f8fafc"],
body.light-mode [style*="color: #f1f5f9"],
body.light-mode [style*="color:#f1f5f9"],
body.light-mode [style*="color: #e2e8f0"],
body.light-mode [style*="color:#e2e8f0"],
body.light-mode [style*="color: rgb(248, 250, 252)"],
body.light-mode [style*="color: rgb(241, 245, 249)"],
body.light-mode [style*="color: rgb(226, 232, 240)"],
[data-theme="light"] [style*="color: #f8fafc"],
[data-theme="light"] [style*="color:#f8fafc"],
[data-theme="light"] [style*="color: #f1f5f9"],
[data-theme="light"] [style*="color:#f1f5f9"],
[data-theme="light"] [style*="color: #e2e8f0"],
[data-theme="light"] [style*="color:#e2e8f0"] {
  color: #0f172a !important;
}

body.light-mode [style*="color: #cbd5e1"],
body.light-mode [style*="color:#cbd5e1"],
body.light-mode [style*="color: rgb(203, 213, 225)"],
[data-theme="light"] [style*="color: #cbd5e1"],
[data-theme="light"] [style*="color:#cbd5e1"] {
  color: #1e293b !important;
}

body.light-mode [style*="color: #94a3b8"],
body.light-mode [style*="color:#94a3b8"],
body.light-mode [style*="color: rgb(148, 163, 184)"],
[data-theme="light"] [style*="color: #94a3b8"],
[data-theme="light"] [style*="color:#94a3b8"] {
  color: #334155 !important;
}

body.light-mode [style*="color: #64748b"],
body.light-mode [style*="color:#64748b"],
body.light-mode [style*="color: rgb(100, 116, 139)"],
[data-theme="light"] [style*="color: #64748b"],
[data-theme="light"] [style*="color:#64748b"] {
  color: #475569 !important;
}

/* Light text on tinted banners converted to deep readable contrast */
body.light-mode [style*="color: #7dd3fc"],
body.light-mode [style*="color: #93c5fd"],
body.light-mode [style*="color: #bae6fd"],
body.light-mode [style*="color: rgb(125, 211, 252)"],
body.light-mode [style*="color: rgb(186, 230, 253)"],
[data-theme="light"] [style*="color: #7dd3fc"],
[data-theme="light"] [style*="color: #93c5fd"],
[data-theme="light"] [style*="color: #bae6fd"] {
  color: #0369a1 !important;
}

body.light-mode [style*="color: #fbbf24"],
body.light-mode [style*="color: #fcd34d"],
body.light-mode [style*="color: #fde047"],
body.light-mode [style*="color: rgb(251, 191, 36)"],
body.light-mode [style*="color: rgb(252, 211, 77)"],
[data-theme="light"] [style*="color: #fbbf24"],
[data-theme="light"] [style*="color: #fcd34d"],
[data-theme="light"] [style*="color: #fde047"] {
  color: #b45309 !important;
}

body.light-mode [style*="color: #6ee7b7"],
body.light-mode [style*="color: #86efac"],
body.light-mode [style*="color: rgb(110, 231, 183)"],
[data-theme="light"] [style*="color: #6ee7b7"],
[data-theme="light"] [style*="color: #86efac"] {
  color: #047857 !important;
}

body.light-mode [style*="color: #fca5a5"],
body.light-mode [style*="color: #f87171"],
body.light-mode [style*="color: rgb(252, 165, 165)"],
[data-theme="light"] [style*="color: #fca5a5"],
[data-theme="light"] [style*="color: #f87171"] {
  color: #b91c1c !important;
}

/* Dark backgrounds replaced with clean light surfaces */
body.light-mode [style*="background: #090d16"],
body.light-mode [style*="background:#090d16"],
body.light-mode [style*="background: #06090e"],
body.light-mode [style*="background:#06090e"],
body.light-mode [style*="background: #050811"],
body.light-mode [style*="background:#050811"],
body.light-mode [style*="background: #080c14"],
body.light-mode [style*="background:#080c14"],
body.light-mode [style*="background: #080d1a"],
body.light-mode [style*="background:#080d1a"],
body.light-mode [style*="background: #090e1a"],
body.light-mode [style*="background:#090e1a"],
body.light-mode [style*="background: #0b101b"],
body.light-mode [style*="background:#0b101b"],
body.light-mode [style*="background: #0b111e"],
body.light-mode [style*="background:#0b111e"],
body.light-mode [style*="background: #0b1120"],
body.light-mode [style*="background:#0b1120"],
body.light-mode [style*="background: #0b1329"],
body.light-mode [style*="background:#0b1329"],
body.light-mode [style*="background: #0f172a"],
body.light-mode [style*="background: rgb(15, 23, 42)"],
body.light-mode [style*="background:#0f172a"],
body.light-mode [style*="background: #1e293b"],
body.light-mode [style*="background: rgb(30, 41, 59)"],
body.light-mode [style*="background:#1e293b"],
[data-theme="light"] [style*="background: #090d16"],
[data-theme="light"] [style*="background:#090d16"],
[data-theme="light"] [style*="background: #06090e"],
[data-theme="light"] [style*="background:#06090e"],
[data-theme="light"] [style*="background: #050811"],
[data-theme="light"] [style*="background:#050811"],
[data-theme="light"] [style*="background: #080c14"],
[data-theme="light"] [style*="background:#080c14"],
[data-theme="light"] [style*="background: #080d1a"],
[data-theme="light"] [style*="background:#080d1a"],
[data-theme="light"] [style*="background: #090e1a"],
[data-theme="light"] [style*="background:#090e1a"],
[data-theme="light"] [style*="background: #0b101b"],
[data-theme="light"] [style*="background:#0b101b"],
[data-theme="light"] [style*="background: #0b111e"],
[data-theme="light"] [style*="background:#0b111e"],
[data-theme="light"] [style*="background: #0b1120"],
[data-theme="light"] [style*="background:#0b1120"],
[data-theme="light"] [style*="background: #0b1329"],
[data-theme="light"] [style*="background:#0b1329"],
[data-theme="light"] [style*="background: #0f172a"],
[data-theme="light"] [style*="background:#0f172a"],
[data-theme="light"] [style*="background: #1e293b"],
[data-theme="light"] [style*="background:#1e293b"] {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

body.light-mode [style*="background: rgba(15, 23, 42"],
body.light-mode [style*="background: rgba(15,23,42"],
body.light-mode [style*="background: rgba(30, 41, 59"],
body.light-mode [style*="background: rgba(30,41,59"],
body.light-mode [style*="background: rgba(0,0,0,0.2"],
body.light-mode [style*="background: rgba(0, 0, 0, 0.2"],
body.light-mode [style*="background: rgba(0,0,0,0.25"],
body.light-mode [style*="background: rgba(0, 0, 0, 0.25"],
[data-theme="light"] [style*="background: rgba(15, 23, 42"],
[data-theme="light"] [style*="background: rgba(15,23,42"],
[data-theme="light"] [style*="background: rgba(30, 41, 59"],
[data-theme="light"] [style*="background: rgba(30,41,59"],
[data-theme="light"] [style*="background: rgba(0,0,0,0.2"],
[data-theme="light"] [style*="background: rgba(0, 0, 0, 0.2"],
[data-theme="light"] [style*="background: rgba(0,0,0,0.25"],
[data-theme="light"] [style*="background: rgba(0, 0, 0, 0.25"] {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

body.light-mode [style*="background: rgba(51, 65, 85"],
body.light-mode [style*="background: rgba(51,65,85"],
[data-theme="light"] [style*="background: rgba(51, 65, 85"],
[data-theme="light"] [style*="background: rgba(51,65,85"] {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

/* Card header gradients in light mode */
body.light-mode .card-header[style*="linear-gradient"],
[data-theme="light"] .card-header[style*="linear-gradient"] {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode .card-header[style*="rgba(15, 23, 42"],
[data-theme="light"] .card-header[style*="rgba(15, 23, 42"] {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

/* Dark borders replaced with clean light gray */
body.light-mode [style*="border-color: #334155"],
body.light-mode [style*="border: 1px solid #334155"],
body.light-mode [style*="border: 1px solid #1e293b"],
body.light-mode [style*="border: 1px solid #141f32"],
body.light-mode [style*="border-bottom: 1px solid #1e293b"],
body.light-mode [style*="border-top: 1px solid #1e293b"],
body.light-mode [style*="border-left: 1px solid #1e293b"],
body.light-mode [style*="border-right: 1px solid #1e293b"],
body.light-mode [style*="border: 1px dashed #1e293b"],
body.light-mode [style*="border: 1px dashed #334155"],
[data-theme="light"] [style*="border-color: #334155"],
[data-theme="light"] [style*="border: 1px solid #334155"],
[data-theme="light"] [style*="border: 1px solid #1e293b"],
[data-theme="light"] [style*="border: 1px solid #141f32"],
[data-theme="light"] [style*="border-bottom: 1px solid #1e293b"],
[data-theme="light"] [style*="border-top: 1px solid #1e293b"],
[data-theme="light"] [style*="border-left: 1px solid #1e293b"],
[data-theme="light"] [style*="border-right: 1px solid #1e293b"],
[data-theme="light"] [style*="border: 1px dashed #1e293b"],
[data-theme="light"] [style*="border: 1px dashed #334155"] {
  border-color: #cbd5e1 !important;
}

/* Tab 3: Break-Even & Take-Profit Engine Light Mode Overrides */
body.light-mode #be-select-order-type,
body.light-mode #be-select-mode,
body.light-mode #be-select-leverage,
[data-theme="light"] #be-select-order-type,
[data-theme="light"] #be-select-mode,
[data-theme="light"] #be-select-leverage {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

body.light-mode #be-select-order-type option,
body.light-mode #be-select-mode option,
body.light-mode #be-select-leverage option,
body.light-mode select option,
[data-theme="light"] #be-select-order-type option,
[data-theme="light"] #be-select-mode option,
[data-theme="light"] #be-select-leverage option,
[data-theme="light"] select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

body.light-mode #be-entry-hint,
body.light-mode #be-mode-desc-box,
[data-theme="light"] #be-entry-hint,
[data-theme="light"] #be-mode-desc-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}

body.light-mode #be-mode-desc-title,
[data-theme="light"] #be-mode-desc-title {
  color: #b45309 !important;
}

body.light-mode #be-mode-desc-rules,
[data-theme="light"] #be-mode-desc-rules {
  color: #475569 !important;
}

body.light-mode #be-tp-builder-card,
[data-theme="light"] #be-tp-builder-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05) !important;
}

body.light-mode #be-tp-builder-card [style*="border-bottom: 1px solid rgba(255,255,255,0.06)"],
[data-theme="light"] #be-tp-builder-card [style*="border-bottom: 1px solid rgba(255,255,255,0.06)"] {
  border-bottom-color: #e2e8f0 !important;
}

body.light-mode .be-tp-input,
body.light-mode #be-builder-price,
body.light-mode #be-input-symbol,
body.light-mode #be-input-margin,
body.light-mode #be-input-stop-loss,
body.light-mode #be-input-entry-price,
[data-theme="light"] .be-tp-input,
[data-theme="light"] #be-builder-price,
[data-theme="light"] #be-input-symbol,
[data-theme="light"] #be-input-margin,
[data-theme="light"] #be-input-stop-loss,
[data-theme="light"] #be-input-entry-price {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

body.light-mode .be-tp-slider,
[data-theme="light"] .be-tp-slider {
  background: #e2e8f0 !important;
}

body.light-mode #be-builder-pct-num,
[data-theme="light"] #be-builder-pct-num {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #10b981 !important;
}

body.light-mode #be-builder-avail-badge,
[data-theme="light"] #be-builder-avail-badge {
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  color: #0284c7 !important;
}

body.light-mode .be-quick-chip,
[data-theme="light"] .be-quick-chip {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.light-mode .be-quick-chip:hover,
[data-theme="light"] .be-quick-chip:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

body.light-mode #be-configured-tps-container > div,
[data-theme="light"] #be-configured-tps-container > div {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

body.light-mode #be-configured-tps-container [style*="color: #f8fafc"],
[data-theme="light"] #be-configured-tps-container [style*="color: #f8fafc"] {
  color: #0f172a !important;
}

body.light-mode #be-configured-tps-container b[style*="color: #cbd5e1"],
[data-theme="light"] #be-configured-tps-container b[style*="color: #cbd5e1"] {
  color: #1e293b !important;
}

body.light-mode #be-side-short-btn[style*="background: #0f172a"],
body.light-mode #be-side-long-btn[style*="background: #0f172a"],
[data-theme="light"] #be-side-short-btn[style*="background: #0f172a"],
[data-theme="light"] #be-side-long-btn[style*="background: #0f172a"] {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #64748b !important;
}

body.light-mode #be-subtab-pending-btn,
[data-theme="light"] #be-subtab-pending-btn {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

body.light-mode #be-subtab-active-btn,
[data-theme="light"] #be-subtab-active-btn {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

body.light-mode #be-subtab-both-btn,
[data-theme="light"] #be-subtab-both-btn {
  background: #fffbeb !important;
  border-color: #f59e0b !important;
  color: #b45309 !important;
}

body.light-mode #be-view-pending thead tr,
body.light-mode #be-view-active thead tr,
[data-theme="light"] #be-view-pending thead tr,
[data-theme="light"] #be-view-active thead tr {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-bottom: 1px solid #cbd5e1 !important;
}

body.light-mode #be-view-pending tbody tr,
body.light-mode #be-view-active tbody tr,
[data-theme="light"] #be-view-pending tbody tr,
[data-theme="light"] #be-view-active tbody tr {
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode #be-view-pending tbody tr:hover,
body.light-mode #be-view-active tbody tr:hover,
[data-theme="light"] #be-view-pending tbody tr:hover,
[data-theme="light"] #be-view-active tbody tr:hover {
  background: #f8fafc !important;
}

body.light-mode #be-view-pending tbody td,
body.light-mode #be-view-active tbody td,
[data-theme="light"] #be-view-pending tbody td,
[data-theme="light"] #be-view-active tbody td {
  color: #0f172a !important;
}

/* Tab 1 Activity Feed, Live Ticker & Snapshots */
body.light-mode #home-bot-activity-feed,
[data-theme="light"] #home-bot-activity-feed {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
}

body.light-mode #home-market-ticker-list > div,
[data-theme="light"] #home-market-ticker-list > div {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
}

body.light-mode .holding-card,
[data-theme="light"] .holding-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #1e293b !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

body.light-mode .holding-card [style*="background: #050811"],
body.light-mode .holding-card [style*="background:#050811"],
[data-theme="light"] .holding-card [style*="background: #050811"],
[data-theme="light"] .holding-card [style*="background:#050811"] {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

body.light-mode .holding-card [style*="background: #050811"] b,
[data-theme="light"] .holding-card [style*="background: #050811"] b {
  color: #0f172a !important;
}

body.light-mode .coin-search-row:hover,
body.light-mode .coin-search-row.active-row,
[data-theme="light"] .coin-search-row:hover,
[data-theme="light"] .coin-search-row.active-row {
  background: #f1f5f9 !important;
}

/* Tab 4 History card & modal */
body.light-mode #tab-history .card,
body.light-mode #history-tab-iframe,
body.light-mode #trade-history-modal .modal-content,
[data-theme="light"] #tab-history .card,
[data-theme="light"] #history-tab-iframe,
[data-theme="light"] #trade-history-modal .modal-content {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

/* Dashboard Statistics & Numbers */
body.light-mode .stat-val {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.light-mode .stat-label {
  color: #334155 !important;
  font-weight: 600 !important;
}

body.light-mode .stat-sub {
  color: #64748b !important;
}

/* Quick Buttons (1x, 2x, 3x, 5x, 10x, 20x, etc.) */
body.light-mode .quick-btn {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  font-weight: 600 !important;
}

body.light-mode .quick-btn:hover {
  background: #e2e8f0 !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

body.light-mode .quick-btn.active {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35) !important;
}

/* Control Labels & Slider Labels */
body.light-mode .control-group label {
  color: #1e293b !important;
  font-weight: 600 !important;
}

body.light-mode .slider-val,
body.light-mode .slider-hint,
body.light-mode #pos-size-calc-val,
body.light-mode #margin-val-display,
body.light-mode #trailing-activation-val,
body.light-mode #trailing-gap-val {
  color: #0f172a !important;
}

body.light-mode .switch-label {
  color: #1e293b !important;
  font-weight: 600 !important;
}

/* Modals & Content */
body.light-mode .modal-content {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .modal-header h3 {
  color: #0f172a !important;
}

body.light-mode .modal-subtitle {
  color: #475569 !important;
}

body.light-mode .modal-stats-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-mode .modal-stat-line span {
  color: #475569 !important;
}

body.light-mode .modal-stat-line b {
  color: #0f172a !important;
}

/* Form Inputs in Light Mode */
body.light-mode input[type="text"],
body.light-mode input[type="email"],
body.light-mode input[type="password"],
body.light-mode input[type="number"],
body.light-mode select,
body.light-mode textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

body.light-mode input::placeholder,
body.light-mode textarea::placeholder {
  color: #94a3b8 !important;
}

/* ============================================================ */
/* Auth Gate Screen (Fullscreen Glassmorphic Wallpaper Layout)  */
/* ============================================================ */
#auth-gate-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  overflow-y: auto;
  background-color: #070b14;
  background-image: radial-gradient(circle at 50% 50%, rgba(7, 11, 20, 0.42) 0%, rgba(7, 11, 20, 0.78) 100%), url('/bg-pattern.jpg?v=3.8');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

#auth-gate-card {
  max-width: 440px;
  width: 100%;
  background: rgba(13, 20, 36, 0.90) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border: 1px solid rgba(197, 160, 89, 0.38) !important;
  border-radius: 16px !important;
  padding: 34px 28px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 30px rgba(197, 160, 89, 0.15) !important;
  position: relative;
  box-sizing: border-box;
  margin: auto;
}

@media (max-width: 480px) {
  #auth-gate-screen {
    padding: 16px 12px;
  }
  #auth-gate-card {
    padding: 24px 18px !important;
  }
}

/* Auth Gate Screen in Light Mode */
body.light-mode #auth-gate-screen {
  background: radial-gradient(circle at 50% 15%, rgba(14, 165, 233, 0.08), transparent 50%), radial-gradient(circle at 80% 85%, rgba(16, 185, 129, 0.06), transparent 45%), #f1f5f9 !important;
}

body.light-mode #auth-gate-card,
body.light-mode #auth-gate-screen > div {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode #auth-gate-screen h1 {
  color: #0f172a !important;
}

body.light-mode #auth-gate-screen p {
  color: #475569 !important;
}

body.light-mode #auth-gate-screen label {
  color: #1e293b !important;
}

body.light-mode #gate-tab-btn-register {
  color: #475569 !important;
}

/* WhatsApp Modal Tabs in Light Mode */
body.light-mode .wa-tab-btn {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.light-mode .wa-tab-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

body.light-mode .qr-box {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

/* Tables in Light Mode */
body.light-mode table thead tr {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-bottom: 1px solid #cbd5e1 !important;
}

body.light-mode table th {
  color: #334155 !important;
}

body.light-mode table td {
  color: #0f172a !important;
}

/* Coin chip and dropdown elements in Light Mode */
body.light-mode .coin-chip {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}

body.light-mode .coin-chip.active {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

body.light-mode .coin-search-input {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body.light-mode .coin-search-dropdown {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12) !important;
}

body.light-mode .coin-dropdown-item {
  color: #334155 !important;
  border-bottom-color: #f1f5f9 !important;
}

body.light-mode .coin-dropdown-item:hover {
  background: #f1f5f9 !important;
}

body.light-mode .clickable-coin-symbol {
  background: #f1f5f9 !important;
  color: #0284c7 !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
}

body.light-mode .preset-chip {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.light-mode .preset-chip:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

body.light-mode #trade-margin-chips .preset-chip.active,
body.light-mode .preset-chip.active {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25) !important;
}

body.light-mode #trade-lev-chips .preset-chip.active {
  background: #f59e0b !important;
  border-color: #f59e0b !important;
  color: #0f172a !important;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25) !important;
}

body.light-mode .coin-price-badge {
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  color: #059669 !important;
}

body.light-mode .crypto-slider {
  background: #e2e8f0 !important;
  border: 1px solid #cbd5e1 !important;
}

body.light-mode .crypto-slider::-webkit-slider-thumb {
  border: 3px solid #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

body.light-mode .crypto-slider::-moz-range-thumb {
  border: 3px solid #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

body.light-mode .modal-btn-cancel {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

body.light-mode .modal-btn-cancel:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

body.light-mode .coin-search-input-wrap {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

body.light-mode .coin-dropdown-tabs {
  background: #f8fafc !important;
  border-bottom-color: #e2e8f0 !important;
}

body.light-mode .coin-table-header {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border-bottom-color: #e2e8f0 !important;
}

body.light-mode .coin-search-footer {
  background: #f8fafc !important;
  border-top-color: #e2e8f0 !important;
  color: #64748b !important;
}

/* TradingView Chart Modal in Light Mode */
body.light-mode #chart-modal [style*="background: #0b1120"] {
  background: #f8fafc !important;
  border-top-color: #e2e8f0 !important;
  color: #475569 !important;
}

body.light-mode #chart-modal .chart-stat-item b {
  color: #0f172a !important;
}

body.light-mode #chart-modal .chart-stat-item span {
  color: #475569 !important;
}

body.light-mode #chart-modal .chart-tf-btn {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.light-mode #chart-modal .chart-tf-btn.active,
[data-theme="light"] #chart-modal .chart-tf-btn.active {
  background: #f59e0b !important;
  color: #0f172a !important;
  border-color: #f59e0b !important;
}

/* ==========================================================================
   GLOBAL MODAL INNER COMPONENTS (BASE STYLES - DARK MODE DEFAULT)
   ========================================================================== */
.modal-inner-card {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 12px 14px;
}

.modal-inner-code {
  background: #06090e;
  border: 1px solid #1e293b;
  border-radius: 6px;
  color: #10b981;
  font-family: monospace;
}

.modal-input {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 6px;
  color: #f1f5f9;
  font-family: monospace;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.modal-input:focus {
  border-color: #f0b90b;
}

.modal-btn-sub {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-btn-sub:hover {
  background: #334155;
  color: #ffffff;
}

/* ==========================================================================
   LIGHT MODE: MODALS & DIALOG SURFACES (EXECUTIVE FINTECH SPECIFICATION)
   ========================================================================== */

body.light-mode .modal-inner-card,
[data-theme="light"] .modal-inner-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
}

body.light-mode .modal-body,
[data-theme="light"] .modal-body {
  color: #1e293b !important;
}

body.light-mode .modal-inner-code,
[data-theme="light"] .modal-inner-code {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #047857 !important;
}

body.light-mode .modal-input,
[data-theme="light"] .modal-input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

body.light-mode .modal-input:focus,
[data-theme="light"] .modal-input:focus {
  border-color: #f0b90b !important;
  box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.2) !important;
}

body.light-mode .modal-btn-sub,
[data-theme="light"] .modal-btn-sub {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.light-mode .modal-btn-sub:hover,
[data-theme="light"] .modal-btn-sub:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

/* 1. Modal Dialog Outer Surface & Overlay */
body.light-mode .modal-overlay,
[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(4px) !important;
}

body.light-mode .modal-content,
[data-theme="light"] .modal-content {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04) !important;
}

body.light-mode .modal-header,
[data-theme="light"] .modal-header {
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode .modal-footer,
[data-theme="light"] .modal-footer {
  border-top: 1px solid #e2e8f0 !important;
}

body.light-mode .modal-header h3,
body.light-mode .modal-content h3,
[data-theme="light"] .modal-header h3,
[data-theme="light"] .modal-content h3 {
  color: #0f172a !important;
}

body.light-mode .modal-subtitle,
[data-theme="light"] .modal-subtitle {
  color: #64748b !important;
}

body.light-mode .modal-close,
[data-theme="light"] .modal-close {
  color: #64748b !important;
}

body.light-mode .modal-close:hover,
[data-theme="light"] .modal-close:hover {
  color: #0f172a !important;
}

/* 2. All Dark Cards & Containers inside Modals */
body.light-mode .modal-content [style*="background: #090d16"],
body.light-mode .modal-content [style*="background:#090d16"],
body.light-mode .modal-content [style*="background: #06090e"],
body.light-mode .modal-content [style*="background:#06090e"],
body.light-mode .modal-content [style*="background: #0b1120"],
body.light-mode .modal-content [style*="background:#0b1120"],
body.light-mode .modal-content [style*="background: #0f172a"],
body.light-mode .modal-content [style*="background:#0f172a"],
[data-theme="light"] .modal-content [style*="background: #090d16"],
[data-theme="light"] .modal-content [style*="background:#090d16"],
[data-theme="light"] .modal-content [style*="background: #06090e"],
[data-theme="light"] .modal-content [style*="background:#06090e"],
[data-theme="light"] .modal-content [style*="background: #0b1120"],
[data-theme="light"] .modal-content [style*="background:#0b1120"],
[data-theme="light"] .modal-content [style*="background: #0f172a"],
[data-theme="light"] .modal-content [style*="background:#0f172a"] {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

body.light-mode .modal-content [style*="border: 1px solid #1e293b"],
body.light-mode .modal-content [style*="border:1px solid #1e293b"],
body.light-mode .modal-content [style*="border-bottom: 1px solid #1e293b"],
body.light-mode .modal-content [style*="border-top: 1px solid #1e293b"],
[data-theme="light"] .modal-content [style*="border: 1px solid #1e293b"],
[data-theme="light"] .modal-content [style*="border:1px solid #1e293b"],
[data-theme="light"] .modal-content [style*="border-bottom: 1px solid #1e293b"],
[data-theme="light"] .modal-content [style*="border-top: 1px solid #1e293b"] {
  border-color: #e2e8f0 !important;
}

/* 3. Text Contrast & Hierarchy inside Modals */
body.light-mode .modal-content,
body.light-mode .modal-body,
body.light-mode .modal-inner-card,
[data-theme="light"] .modal-content,
[data-theme="light"] .modal-body,
[data-theme="light"] .modal-inner-card {
  color: #1e293b !important;
}

body.light-mode .modal-content [style*="color: #f8fafc"],
body.light-mode .modal-content [style*="color:#f8fafc"],
body.light-mode .modal-content [style*="color: #f1f5f9"],
body.light-mode .modal-content [style*="color:#f1f5f9"],
body.light-mode .modal-content [style*="color: rgb(248, 250, 252)"],
body.light-mode .modal-content [style*="color: rgb(241, 245, 249)"],
[data-theme="light"] .modal-content [style*="color: #f8fafc"],
[data-theme="light"] .modal-content [style*="color:#f8fafc"],
[data-theme="light"] .modal-content [style*="color: #f1f5f9"],
[data-theme="light"] .modal-content [style*="color:#f1f5f9"] {
  color: #0f172a !important;
}

body.light-mode .modal-content [style*="color: #cbd5e1"],
body.light-mode .modal-content [style*="color:#cbd5e1"],
body.light-mode .modal-content [style*="color: rgb(203, 213, 225)"],
[data-theme="light"] .modal-content [style*="color: #cbd5e1"],
[data-theme="light"] .modal-content [style*="color:#cbd5e1"] {
  color: #1e293b !important;
}

body.light-mode .modal-content [style*="color: #94a3b8"],
body.light-mode .modal-content [style*="color:#94a3b8"],
body.light-mode .modal-content [style*="color: #64748b"],
body.light-mode .modal-content [style*="color:#64748b"],
body.light-mode .modal-content [style*="color: rgb(148, 163, 184)"],
body.light-mode .modal-content [style*="color: rgb(100, 116, 139)"],
[data-theme="light"] .modal-content [style*="color: #94a3b8"],
[data-theme="light"] .modal-content [style*="color:#94a3b8"],
[data-theme="light"] .modal-content [style*="color: #64748b"],
[data-theme="light"] .modal-content [style*="color:#64748b"] {
  color: #334155 !important;
}

body.light-mode .modal-content p,
body.light-mode .modal-content div,
body.light-mode .modal-content span,
body.light-mode .modal-content li,
[data-theme="light"] .modal-content p,
[data-theme="light"] .modal-content div,
[data-theme="light"] .modal-content span,
[data-theme="light"] .modal-content li {
  color: inherit;
}

body.light-mode .modal-content label,
body.light-mode .modal-body label,
body.light-mode .modal-inner-card label,
[data-theme="light"] .modal-content label,
[data-theme="light"] .modal-body label,
[data-theme="light"] .modal-inner-card label {
  color: #0f172a !important;
  font-weight: 600 !important;
}

body.light-mode .modal-content b,
body.light-mode .modal-content strong,
body.light-mode .modal-inner-card b,
body.light-mode .modal-inner-card strong,
[data-theme="light"] .modal-content b,
[data-theme="light"] .modal-content strong,
[data-theme="light"] .modal-inner-card b,
[data-theme="light"] .modal-inner-card strong {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.light-mode .modal-subtitle,
[data-theme="light"] .modal-subtitle {
  color: #475569 !important;
  font-weight: 500 !important;
}

/* 4. Form Inputs, Selects & Textareas inside Modals */
body.light-mode .modal-content input[type="text"],
body.light-mode .modal-content input[type="password"],
body.light-mode .modal-content input[type="number"],
body.light-mode .modal-content input[type="tel"],
body.light-mode .modal-content input[type="email"],
body.light-mode .modal-content select,
[data-theme="light"] .modal-content input[type="text"],
[data-theme="light"] .modal-content input[type="password"],
[data-theme="light"] .modal-content input[type="number"],
[data-theme="light"] .modal-content input[type="tel"],
[data-theme="light"] .modal-content input[type="email"],
[data-theme="light"] .modal-content select {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

body.light-mode .modal-content input:focus,
body.light-mode .modal-content textarea:focus,
[data-theme="light"] .modal-content input:focus,
[data-theme="light"] .modal-content textarea:focus {
  border-color: #f0b90b !important;
  box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.2) !important;
}

body.light-mode .modal-content input::placeholder,
body.light-mode .modal-content textarea::placeholder,
[data-theme="light"] .modal-content input::placeholder,
[data-theme="light"] .modal-content textarea::placeholder {
  color: #94a3b8 !important;
}

/* Readonly and Monospace Boxes */
body.light-mode #modal-server-ip,
[data-theme="light"] #modal-server-ip {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #047857 !important;
}

body.light-mode #ip-display-input,
[data-theme="light"] #ip-display-input {
  color: #047857 !important;
  background: transparent !important;
}

body.light-mode #combined-ips-input,
[data-theme="light"] #combined-ips-input {
  color: #b45309 !important;
  background: transparent !important;
}

body.light-mode #custom-lev-input,
[data-theme="light"] #custom-lev-input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

/* 5. Stepper Buttons, Utility Buttons & Badges */
body.light-mode .modal-content button[onclick^="adjustModalLevBy"],
body.light-mode .modal-content button[onclick^="adjustTriggerBy"],
body.light-mode .modal-content button[onclick^="adjustGapBy"],
[data-theme="light"] .modal-content button[onclick^="adjustModalLevBy"],
[data-theme="light"] .modal-content button[onclick^="adjustTriggerBy"],
[data-theme="light"] .modal-content button[onclick^="adjustGapBy"] {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
}

body.light-mode .modal-content button[onclick^="adjustModalLevBy"]:hover,
body.light-mode .modal-content button[onclick^="adjustTriggerBy"]:hover,
body.light-mode .modal-content button[onclick^="adjustGapBy"]:hover,
[data-theme="light"] .modal-content button[onclick^="adjustModalLevBy"]:hover,
[data-theme="light"] .modal-content button[onclick^="adjustTriggerBy"]:hover,
[data-theme="light"] .modal-content button[onclick^="adjustGapBy"]:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

body.light-mode #btn-copy-ip,
body.light-mode .modal-content button[onclick^="addExtraIp"],
body.light-mode .modal-content button[onclick^="openChartModal"],
body.light-mode .modal-content button[onclick^="openCustomLevModal"],
body.light-mode .modal-content button[onclick*="getServerIp"],
body.light-mode #btn-send-otp,
[data-theme="light"] #btn-copy-ip,
[data-theme="light"] .modal-content button[onclick^="addExtraIp"],
[data-theme="light"] .modal-content button[onclick^="openChartModal"],
[data-theme="light"] .modal-content button[onclick^="openCustomLevModal"],
[data-theme="light"] .modal-content button[onclick*="getServerIp"],
[data-theme="light"] #btn-send-otp {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.light-mode #btn-copy-ip:hover,
body.light-mode .modal-content button[onclick^="addExtraIp"]:hover,
body.light-mode .modal-content button[onclick^="openChartModal"]:hover,
body.light-mode .modal-content button[onclick^="openCustomLevModal"]:hover,
body.light-mode .modal-content button[onclick*="getServerIp"]:hover,
body.light-mode #btn-send-otp:hover,
[data-theme="light"] #btn-copy-ip:hover,
[data-theme="light"] .modal-content button[onclick^="addExtraIp"]:hover,
[data-theme="light"] .modal-content button[onclick^="openChartModal"]:hover,
[data-theme="light"] .modal-content button[onclick^="openCustomLevModal"]:hover,
[data-theme="light"] .modal-content button[onclick*="getServerIp"]:hover,
[data-theme="light"] #btn-send-otp:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

body.light-mode .modal-btn-cancel,
[data-theme="light"] .modal-btn-cancel {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

body.light-mode .modal-btn-cancel:hover,
[data-theme="light"] .modal-btn-cancel:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

/* 6. Trade Modal Chips, Badges & Sliders */
body.light-mode .modal-content .preset-chip,
[data-theme="light"] .modal-content .preset-chip {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.light-mode .modal-content .preset-chip:hover,
[data-theme="light"] .modal-content .preset-chip:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

body.light-mode #trade-margin-chips .preset-chip.active,
[data-theme="light"] #trade-margin-chips .preset-chip.active {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.3) !important;
}

body.light-mode #trade-lev-chips .preset-chip.active,
[data-theme="light"] #trade-lev-chips .preset-chip.active {
  background: #f59e0b !important;
  border-color: #f59e0b !important;
  color: #000000 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.3) !important;
}

body.light-mode .modal-content .coin-chip,
[data-theme="light"] .modal-content .coin-chip {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.light-mode .modal-content .coin-chip.active,
[data-theme="light"] .modal-content .coin-chip.active {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
}

body.light-mode #trade-coin-price,
[data-theme="light"] #trade-coin-price {
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  color: #047857 !important;
}

body.light-mode #trade-lev-badge,
[data-theme="light"] #trade-lev-badge {
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  color: #b45309 !important;
}

body.light-mode #trail-trigger-val,
[data-theme="light"] #trail-trigger-val {
  color: #047857 !important;
}

body.light-mode #gap-val,
[data-theme="light"] #gap-val {
  color: #0284c7 !important;
}

body.light-mode #trade-modal-wallet-val,
[data-theme="light"] #trade-modal-wallet-val {
  color: #0f172a !important;
}

body.light-mode #trade-calc-pos-size,
[data-theme="light"] #trade-calc-pos-size {
  color: #b45309 !important;
}

body.light-mode #trade-calc-amount,
[data-theme="light"] #trade-calc-amount {
  color: #334155 !important;
}

body.light-mode #trade-trailing-summary-txt,
[data-theme="light"] #trade-trailing-summary-txt {
  color: #047857 !important;
}

body.light-mode #trade-modal-mode-tag,
[data-theme="light"] #trade-modal-mode-tag {
  color: #047857 !important;
}

body.light-mode .trigger-tick-label .tick-txt,
body.light-mode .gap-tick-label .tick-txt,
[data-theme="light"] .trigger-tick-label .tick-txt,
[data-theme="light"] .gap-tick-label .tick-txt {
  color: #475569 !important;
}

/* 7. WhatsApp Modal Specifics */
body.light-mode #wa-modal [style*="display: flex; gap: 4px"],
[data-theme="light"] #wa-modal [style*="display: flex; gap: 4px"] {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-mode #tab-btn-wa-shared,
body.light-mode #tab-btn-wa-qr,
[data-theme="light"] #tab-btn-wa-shared,
[data-theme="light"] #tab-btn-wa-qr {
  color: #475569 !important;
  font-weight: 600 !important;
}

body.light-mode #tab-btn-wa-master,
[data-theme="light"] #tab-btn-wa-master {
  color: #b45309 !important;
  font-weight: 600 !important;
}

body.light-mode #tab-btn-wa-shared.active,
body.light-mode #tab-btn-wa-qr.active,
[data-theme="light"] #tab-btn-wa-shared.active,
[data-theme="light"] #tab-btn-wa-qr.active {
  background: #10b981 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.25) !important;
}

body.light-mode #tab-btn-wa-master.active,
[data-theme="light"] #tab-btn-wa-master.active {
  background: #f59e0b !important;
  color: #000000 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.25) !important;
}

body.light-mode #tab-btn-wa-shared:not(.active):hover,
body.light-mode #tab-btn-wa-qr:not(.active):hover,
[data-theme="light"] #tab-btn-wa-shared:not(.active):hover,
[data-theme="light"] #tab-btn-wa-qr:not(.active):hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* WhatsApp Modal Body Text, Labels & Details */
body.light-mode #wa-modal .modal-inner-card,
[data-theme="light"] #wa-modal .modal-inner-card {
  color: #1e293b !important;
}

body.light-mode #wa-modal .modal-inner-card > div:first-child > div > div:first-child,
[data-theme="light"] #wa-modal .modal-inner-card > div:first-child > div > div:first-child {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.light-mode #wa-modal [style*="color: #25d366"],
[data-theme="light"] #wa-modal [style*="color: #25d366"] {
  color: #047857 !important;
  font-weight: 700 !important;
}

body.light-mode #shared-bot-status-badge,
[data-theme="light"] #shared-bot-status-badge {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #047857 !important;
  font-weight: 600 !important;
}

body.light-mode #wa-modal a[href*="wa.me"],
[data-theme="light"] #wa-modal a[href*="wa.me"] {
  background: #10b981 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.25) !important;
}

body.light-mode #wa-modal a[href*="wa.me"]:hover,
[data-theme="light"] #wa-modal a[href*="wa.me"]:hover {
  background: #059669 !important;
  color: #ffffff !important;
}

body.light-mode #wa-modal [style*="font-size: 12.5px; font-weight: 600"],
[data-theme="light"] #wa-modal [style*="font-size: 12.5px; font-weight: 600"] {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.light-mode #wa-link-current-status,
[data-theme="light"] #wa-link-current-status {
  color: #475569 !important;
  font-weight: 600 !important;
}

body.light-mode #input-user-phone-link,
[data-theme="light"] #input-user-phone-link {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

body.light-mode #wa-modal code,
[data-theme="light"] #wa-modal code {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  font-weight: 600 !important;
}

body.light-mode #user-dedicated-phone,
[data-theme="light"] #user-dedicated-phone {
  color: #0f172a !important;
  font-weight: 600 !important;
}

body.light-mode #master-user-phone,
[data-theme="light"] #master-user-phone {
  color: #047857 !important;
  font-weight: 700 !important;
}

body.light-mode #wa-modal [style*="color: #64748b"],
[data-theme="light"] #wa-modal [style*="color: #64748b"] {
  color: #475569 !important;
}

/* 8. Auth Modal Specifics */
body.light-mode #auth-modal [style*="display: flex; gap: 4px"],
[data-theme="light"] #auth-modal [style*="display: flex; gap: 4px"] {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-mode #tab-auth-login,
body.light-mode #tab-auth-register,
[data-theme="light"] #tab-auth-login,
[data-theme="light"] #tab-auth-register {
  color: #475569 !important;
  font-weight: 600 !important;
}

body.light-mode #tab-auth-login.active,
body.light-mode #tab-auth-register.active,
body.light-mode #tab-auth-login[style*="background: #1e293b"],
body.light-mode #tab-auth-login[style*="background:#1e293b"],
body.light-mode #tab-auth-register[style*="background: #1e293b"],
body.light-mode #tab-auth-register[style*="background:#1e293b"],
[data-theme="light"] #tab-auth-login.active,
[data-theme="light"] #tab-auth-register.active,
[data-theme="light"] #tab-auth-login[style*="background: #1e293b"],
[data-theme="light"] #tab-auth-login[style*="background:#1e293b"],
[data-theme="light"] #tab-auth-register[style*="background: #1e293b"],
[data-theme="light"] #tab-auth-register[style*="background:#1e293b"] {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
  font-weight: 700 !important;
}

/* 9. Confirmation Modals (Disconnect, Close Trade, Logout) */
body.light-mode #logout-confirm-modal .badge,
body.light-mode #close-modal-source,
[data-theme="light"] #logout-confirm-modal .badge,
[data-theme="light"] #close-modal-source {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  font-weight: 600 !important;
}

body.light-mode #close-modal-symbol,
[data-theme="light"] #close-modal-symbol {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.light-mode #close-modal-entry,
body.light-mode #close-modal-margin,
[data-theme="light"] #close-modal-entry,
[data-theme="light"] #close-modal-margin {
  color: #0f172a !important;
  font-weight: 600 !important;
}

body.light-mode #close-modal-size,
[data-theme="light"] #close-modal-size {
  color: #b45309 !important;
  font-weight: 700 !important;
}

body.light-mode #close-modal-mark,
[data-theme="light"] #close-modal-mark {
  color: #0284c7 !important;
  font-weight: 600 !important;
}

body.light-mode #close-modal-pnl,
[data-theme="light"] #close-modal-pnl {
  color: #0f172a !important;
  font-weight: 700 !important;
}

/* 10. Notices, Alerts & Banners inside Modals */
body.light-mode .modal-content [style*="background: rgba(239, 68, 68"],
body.light-mode #trade-modal-wallet-warning,
[data-theme="light"] .modal-content [style*="background: rgba(239, 68, 68"],
[data-theme="light"] #trade-modal-wallet-warning {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  color: #991b1b !important;
}

body.light-mode .modal-content [style*="background: rgba(245, 158, 11"],
body.light-mode #shared-bot-offline-warning,
body.light-mode #master-qr-reset-popup,
[data-theme="light"] .modal-content [style*="background: rgba(245, 158, 11"],
[data-theme="light"] #shared-bot-offline-warning,
[data-theme="light"] #master-qr-reset-popup {
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
  color: #92400e !important;
}

body.light-mode #user-qr-reset-popup,
[data-theme="light"] #user-qr-reset-popup {
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  color: #0369a1 !important;
}

body.light-mode .modal-content [style*="background: rgba(16, 185, 129"],
body.light-mode #api-modal-connected-banner,
[data-theme="light"] .modal-content [style*="background: rgba(16, 185, 129"],
[data-theme="light"] #api-modal-connected-banner {
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  color: #065f46 !important;
}

body.light-mode #api-modal-disconnected-banner,
[data-theme="light"] #api-modal-disconnected-banner {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
}

body.light-mode #api-modal-disconnected-banner [style*="color: #f87171"],
[data-theme="light"] #api-modal-disconnected-banner [style*="color: #f87171"] {
  color: #b91c1c !important;
}

body.light-mode #api-modal-connected-mode,
[data-theme="light"] #api-modal-connected-mode {
  color: #334155 !important;
}

body.light-mode .modal-warning-alert,
[data-theme="light"] .modal-warning-alert {
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
  color: #92400e !important;
}

body.light-mode #btn-submit-open-trade,
[data-theme="light"] #btn-submit-open-trade {
  background: #10b981 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

/* 11. Coin Search Dropdown Light Mode Palette */
body.light-mode .coin-dropdown-tabs,
[data-theme="light"] .coin-dropdown-tabs {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode .coin-tab-btn,
[data-theme="light"] .coin-tab-btn {
  color: #475569 !important;
}

body.light-mode .coin-tab-btn:hover,
[data-theme="light"] .coin-tab-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

body.light-mode .coin-tab-btn.active,
[data-theme="light"] .coin-tab-btn.active {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #047857 !important;
}

body.light-mode .coin-table-header,
[data-theme="light"] .coin-table-header {
  background: #f1f5f9 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

body.light-mode .coin-base-txt,
[data-theme="light"] .coin-base-txt {
  color: #0f172a !important;
}

body.light-mode .coin-quote-txt,
body.light-mode .coin-vol-txt,
[data-theme="light"] .coin-quote-txt,
[data-theme="light"] .coin-vol-txt {
  color: #64748b !important;
}

body.light-mode .coin-price-col,
[data-theme="light"] .coin-price-col {
  color: #0f172a !important;
}

body.light-mode .coin-search-footer,
[data-theme="light"] .coin-search-footer {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

body.light-mode .coin-search-list::-webkit-scrollbar-track,
[data-theme="light"] .coin-search-list::-webkit-scrollbar-track {
  background: #f8fafc !important;
}

/* 12. Risk Modal & IP Whitelist Chips High Contrast */
body.light-mode #risk-modal h3,
[data-theme="light"] #risk-modal h3 {
  color: #b45309 !important;
}

body.light-mode #modal-wallet-val,
body.light-mode #modal-margin-val,
[data-theme="light"] #modal-wallet-val,
[data-theme="light"] #modal-margin-val {
  color: #0f172a !important;
}

body.light-mode #modal-lev-val,
[data-theme="light"] #modal-lev-val {
  color: #b45309 !important;
}

body.light-mode #modal-pos-val,
body.light-mode #modal-excess-val,
[data-theme="light"] #modal-pos-val,
[data-theme="light"] #modal-excess-val {
  color: #dc2626 !important;
}

body.light-mode .modal-tick-text,
[data-theme="light"] .modal-tick-text {
  color: #0f172a !important;
  font-weight: 500 !important;
}

body.light-mode #trusted-ips-chips span,
[data-theme="light"] #trusted-ips-chips span {
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  color: #0369a1 !important;
}

body.light-mode #custom-lev-modal [style*="color: #64748b"],
[data-theme="light"] #custom-lev-modal [style*="color: #64748b"] {
  color: #475569 !important;
}

/* ==========================================================================
   LIGHT MODE: WALLET HEADER ACTIONS & EXECUTIVE ACTION BUTTONS
   ========================================================================== */

/* 1. + Open Trade Primary Hero Button */
body.light-mode .wallet-header-actions .btn-open-trade,
body.light-mode .btn-open-trade,
[data-theme="light"] .wallet-header-actions .btn-open-trade,
[data-theme="light"] .btn-open-trade {
  background: #0284c7 !important;
  border: 1px solid #0284c7 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.25) !important;
}

body.light-mode .wallet-header-actions .btn-open-trade:hover,
body.light-mode .btn-open-trade:hover,
[data-theme="light"] .wallet-header-actions .btn-open-trade:hover,
[data-theme="light"] .btn-open-trade:hover {
  background: #0369a1 !important;
  border-color: #0369a1 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35) !important;
  transform: translateY(-1px);
}

body.light-mode .wallet-header-actions .btn-open-trade:active,
body.light-mode .btn-open-trade:active,
[data-theme="light"] .wallet-header-actions .btn-open-trade:active,
[data-theme="light"] .btn-open-trade:active {
  background: #075985 !important;
  transform: translateY(0);
}

body.light-mode .btn-history-trade,
[data-theme="light"] .btn-history-trade {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

body.light-mode .btn-history-trade:hover,
[data-theme="light"] .btn-history-trade:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  transform: translateY(-1px);
}

/* 2. Secondary Navigation Buttons: WhatsApp, Server IP, API Keys */
body.light-mode .btn-wa-key,
body.light-mode .btn-ip-key,
body.light-mode .btn-api-key,
body.light-mode .btn-api-edit,
[data-theme="light"] .btn-wa-key,
[data-theme="light"] .btn-ip-key,
[data-theme="light"] .btn-api-key,
[data-theme="light"] .btn-api-edit {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

body.light-mode .btn-wa-key:hover,
body.light-mode .btn-ip-key:hover,
body.light-mode .btn-api-key:hover,
body.light-mode .btn-api-edit:hover,
[data-theme="light"] .btn-wa-key:hover,
[data-theme="light"] .btn-ip-key:hover,
[data-theme="light"] .btn-api-key:hover,
[data-theme="light"] .btn-api-edit:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08) !important;
}

body.light-mode .btn-wa-key:active,
body.light-mode .btn-ip-key:active,
body.light-mode .btn-api-key:active,
body.light-mode .btn-api-edit:active,
[data-theme="light"] .btn-wa-key:active,
[data-theme="light"] .btn-ip-key:active,
[data-theme="light"] .btn-api-key:active,
[data-theme="light"] .btn-api-edit:active {
  background: #f1f5f9 !important;
}

/* WhatsApp QR scan required state */
body.light-mode .btn-wa-key.wa-scan-required,
[data-theme="light"] .btn-wa-key.wa-scan-required {
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
  color: #b45309 !important;
  font-weight: 600 !important;
}

body.light-mode .btn-wa-key.wa-scan-required:hover,
[data-theme="light"] .btn-wa-key.wa-scan-required:hover {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
  color: #78350f !important;
}

/* 3. Disconnect Binance (LIVE) Danger Button */
body.light-mode .btn-api-disconnect,
[data-theme="light"] .btn-api-disconnect {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  color: #dc2626 !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.06) !important;
}

body.light-mode .btn-api-disconnect:hover,
[data-theme="light"] .btn-api-disconnect:hover {
  background: #fee2e2 !important;
  border-color: #f87171 !important;
  color: #b91c1c !important;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.12) !important;
}

body.light-mode .btn-api-disconnect:active,
[data-theme="light"] .btn-api-disconnect:active {
  background: #fecaca !important;
}

/* ==========================================================================
   LIGHT MODE: TRADINGVIEW CHART MODAL (HEADER, TOOLBAR, FOOTER & BUTTONS)
   ========================================================================== */

body.light-mode #chart-modal .modal-content,
[data-theme="light"] #chart-modal .modal-content {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18) !important;
}

body.light-mode .chart-modal-header,
[data-theme="light"] .chart-modal-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode #chart-modal-symbol,
[data-theme="light"] #chart-modal-symbol {
  color: #0f172a !important;
}

body.light-mode #chart-modal-pos-info,
[data-theme="light"] #chart-modal-pos-info {
  color: #64748b !important;
}

body.light-mode #chart-modal-pos-info b,
[data-theme="light"] #chart-modal-pos-info b {
  color: #0f172a !important;
}

body.light-mode .chart-tf-group,
[data-theme="light"] .chart-tf-group {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
}

body.light-mode .chart-tf-btn,
[data-theme="light"] .chart-tf-btn {
  background: transparent !important;
  color: #475569 !important;
  border: none !important;
}

body.light-mode .chart-tf-btn:hover,
[data-theme="light"] .chart-tf-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

body.light-mode .chart-tf-btn.active,
[data-theme="light"] .chart-tf-btn.active {
  background: #f59e0b !important;
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.light-mode .chart-binance-link,
[data-theme="light"] .chart-binance-link {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

body.light-mode .chart-binance-link:hover,
[data-theme="light"] .chart-binance-link:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

body.light-mode .chart-btn-open-trade,
[data-theme="light"] .chart-btn-open-trade {
  background: #10b981 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.25) !important;
}

body.light-mode .chart-btn-open-trade:hover,
[data-theme="light"] .chart-btn-open-trade:hover {
  background: #059669 !important;
  color: #ffffff !important;
}

body.light-mode .chart-modal-close-x,
[data-theme="light"] .chart-modal-close-x {
  color: #64748b !important;
}

body.light-mode .chart-modal-close-x:hover,
[data-theme="light"] .chart-modal-close-x:hover {
  color: #0f172a !important;
}

body.light-mode .chart-modal-footer,
[data-theme="light"] .chart-modal-footer {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  color: #64748b !important;
}

body.light-mode .chart-modal-tip,
body.light-mode .chart-tip-text,
body.light-mode .chart-tip-text b,
[data-theme="light"] .chart-modal-tip,
[data-theme="light"] .chart-tip-text,
[data-theme="light"] .chart-tip-text b {
  color: #334155 !important;
}

body.light-mode .chart-btn-trade,
body.light-mode #btn-chart-trade-this,
[data-theme="light"] .chart-btn-trade,
[data-theme="light"] #btn-chart-trade-this {
  background: #10b981 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1px solid #10b981 !important;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.25) !important;
}

body.light-mode .chart-btn-trade:hover,
body.light-mode #btn-chart-trade-this:hover,
[data-theme="light"] .chart-btn-trade:hover,
[data-theme="light"] #btn-chart-trade-this:hover {
  background: #059669 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}

/* Close Chart Button in Light Mode */
body.light-mode .chart-btn-close,
body.light-mode #btn-chart-close,
body.light-mode #chart-modal button[onclick*="closeChartModal"],
[data-theme="light"] .chart-btn-close,
[data-theme="light"] #btn-chart-close,
[data-theme="light"] #chart-modal button[onclick*="closeChartModal"] {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

body.light-mode .chart-btn-close:hover,
body.light-mode #btn-chart-close:hover,
body.light-mode #chart-modal button[onclick*="closeChartModal"]:hover,
[data-theme="light"] .chart-btn-close:hover,
[data-theme="light"] #btn-chart-close:hover,
[data-theme="light"] #chart-modal button[onclick*="closeChartModal"]:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08) !important;
}

/* ==========================================================================
   LIGHT MODE: TOP NAVBAR BADGES & GENERAL CONTROLS
   ========================================================================== */

body.light-mode header .badges .badge,
[data-theme="light"] header .badges .badge {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
}

body.light-mode #binance-status-badge,
[data-theme="light"] #binance-status-badge {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

body.light-mode #binance-status-badge:hover,
[data-theme="light"] #binance-status-badge:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

body.light-mode #binance-badge,
[data-theme="light"] #binance-badge {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

body.light-mode #theme-toggle-btn,
[data-theme="light"] #theme-toggle-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

body.light-mode #theme-toggle-btn:hover,
[data-theme="light"] #theme-toggle-btn:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
}

body.light-mode #btn-header-login,
[data-theme="light"] #btn-header-login {
  background: #0284c7 !important;
  border: 1px solid #0284c7 !important;
  color: #ffffff !important;
}

body.light-mode #btn-header-login:hover,
[data-theme="light"] #btn-header-login:hover {
  background: #0369a1 !important;
  border-color: #0369a1 !important;
}

body.light-mode #btn-header-register,
[data-theme="light"] #btn-header-register {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
}

body.light-mode #btn-header-register:hover,
[data-theme="light"] #btn-header-register:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

body.light-mode #user-profile-badge,
[data-theme="light"] #user-profile-badge {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

body.light-mode #btn-header-logout,
[data-theme="light"] #btn-header-logout,
body.light-mode .btn-logout,
[data-theme="light"] .btn-logout {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  color: #dc2626 !important;
}

body.light-mode #btn-header-logout:hover,
[data-theme="light"] #btn-header-logout:hover,
body.light-mode .btn-logout:hover,
[data-theme="light"] .btn-logout:hover {
  background: #fee2e2 !important;
  border-color: #f87171 !important;
  color: #b91c1c !important;
}

body.light-mode #btn-admin-excel,
[data-theme="light"] #btn-admin-excel {
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  color: #16a34a !important;
}

body.light-mode #btn-admin-excel:hover,
[data-theme="light"] #btn-admin-excel:hover {
  background: #dcfce7 !important;
  border-color: #86efac !important;
  color: #15803d !important;
}

/* Brand Title, Emblems & Subtitle in Light Mode */
body.light-mode .logo-area h1 span:first-child,
[data-theme="light"] .logo-area h1 span:first-child {
  color: #0f172a !important;
  text-shadow: none !important;
}

body.light-mode .logo-area h1 span:nth-child(2),
[data-theme="light"] .logo-area h1 span:nth-child(2) {
  color: #b45309 !important;
  text-shadow: none !important;
}

body.light-mode #header-active-tab-title,
[data-theme="light"] #header-active-tab-title {
  color: #64748b !important;
}

body.light-mode .brand-emblem-box,
[data-theme="light"] .brand-emblem-box {
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%) !important;
  border: 1.5px solid #eab308 !important;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.22) !important;
}

/* Drawer Sidebar Light Mode Refinements */
body.light-mode .sidebar-header [style*="color: #f8fafc"],
[data-theme="light"] .sidebar-header [style*="color: #f8fafc"] {
  color: #0f172a !important;
}

body.light-mode .sidebar-header [style*="color: #c5a059"],
[data-theme="light"] .sidebar-header [style*="color: #c5a059"] {
  color: #b45309 !important;
}

body.light-mode .drawer-close-btn,
[data-theme="light"] .drawer-close-btn {
  color: #64748b !important;
}

body.light-mode .drawer-close-btn:hover,
[data-theme="light"] .drawer-close-btn:hover {
  color: #0f172a !important;
  background: #e2e8f0 !important;
}

body.light-mode #sidebar-user-name,
[data-theme="light"] #sidebar-user-name {
  color: #0f172a !important;
}

body.light-mode #sidebar-user-role,
[data-theme="light"] #sidebar-user-role {
  color: #0284c7 !important;
}

body.light-mode .sidebar-logout-btn,
[data-theme="light"] .sidebar-logout-btn {
  color: #64748b !important;
}

body.light-mode .sidebar-logout-btn:hover,
[data-theme="light"] .sidebar-logout-btn:hover {
  color: #dc2626 !important;
}


/* ==========================================================================
   BINANCE API IP RESTRICTION ALERT BANNER (DARK & LIGHT THEMES)
   ========================================================================== */
.binance-ip-alert-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 11px 15px;
  font-size: 12.5px;
  color: #fbbf24;
  line-height: 1.5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  transition: all 0.2s ease;
}

.binance-ip-alert-banner b {
  color: #f59e0b;
}

.binance-ip-alert-banner code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  color: #ffffff;
  font-family: monospace;
}

.binance-ip-alert-banner .btn-notice-copy {
  background: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.binance-ip-alert-banner .btn-notice-copy:hover {
  background: #475569;
}

.binance-ip-alert-banner .btn-notice-sub {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.binance-ip-alert-banner .btn-notice-sub:hover {
  background: #334155;
}

.binance-ip-alert-banner .btn-notice-action {
  background: #f59e0b;
  color: #000000;
  font-weight: 700;
  border: none;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.binance-ip-alert-banner .btn-notice-action:hover {
  background: #fbbf24;
}

.binance-ip-alert-banner .btn-notice-close {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s;
}

.binance-ip-alert-banner .btn-notice-close:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
}

/* Light Mode Overrides for Banner */
body.light-mode .binance-ip-alert-banner,
[data-theme="light"] .binance-ip-alert-banner {
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
  color: #92400e !important;
  box-shadow: 0 1px 3px rgba(180, 83, 9, 0.08) !important;
}

body.light-mode .binance-ip-alert-banner b,
[data-theme="light"] .binance-ip-alert-banner b {
  color: #78350f !important;
  font-weight: 700 !important;
}

body.light-mode .binance-ip-alert-banner code,
[data-theme="light"] .binance-ip-alert-banner code {
  background: #fef3c7 !important;
  border: 1px solid #fde68a !important;
  color: #78350f !important;
}

body.light-mode .binance-ip-alert-banner .btn-notice-copy,
[data-theme="light"] .binance-ip-alert-banner .btn-notice-copy {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
}

body.light-mode .binance-ip-alert-banner .btn-notice-copy:hover,
[data-theme="light"] .binance-ip-alert-banner .btn-notice-copy:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

body.light-mode .binance-ip-alert-banner .btn-notice-sub,
[data-theme="light"] .binance-ip-alert-banner .btn-notice-sub {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
}

body.light-mode .binance-ip-alert-banner .btn-notice-sub:hover,
[data-theme="light"] .binance-ip-alert-banner .btn-notice-sub:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

body.light-mode .binance-ip-alert-banner .btn-notice-action,
[data-theme="light"] .binance-ip-alert-banner .btn-notice-action {
  background: #f59e0b !important;
  color: #000000 !important;
}

body.light-mode .binance-ip-alert-banner .btn-notice-close,
[data-theme="light"] .binance-ip-alert-banner .btn-notice-close {
  color: #92400e !important;
}

body.light-mode .binance-ip-alert-banner .btn-notice-close:hover,
[data-theme="light"] .binance-ip-alert-banner .btn-notice-close:hover {
  color: #000000 !important;
  background: rgba(180, 83, 9, 0.1) !important;
}




/* ============================================================
   Non Active Queued Orders & Queue Modal Styles
   ============================================================ */
.btn-queue-trade {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-queue-trade:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  transform: translateY(-1px);
}

.queue-subtext {
  font-size: 11px;
  color: #64748b;
}

.queue-card {
  background: #0b1120;
  border: 1px solid #1e293b;
  border-left: 4px solid #f59e0b !important;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.btn-activate-queue {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-activate-queue:hover {
  background: #10b981;
  color: #ffffff;
}

.btn-remove-queue {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-remove-queue:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

.modal-btn-queue {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-btn-queue:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
}

/* Light Mode Overrides */
body.light-mode .btn-queue-trade,
[data-theme="light"] .btn-queue-trade {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

body.light-mode .btn-queue-trade:hover,
[data-theme="light"] .btn-queue-trade:hover {
  background: #fde68a !important;
  border-color: #d97706 !important;
}

body.light-mode .queue-subtext,
[data-theme="light"] .queue-subtext {
  color: #64748b !important;
}

body.light-mode .queue-card,
[data-theme="light"] .queue-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-left: 4px solid #f59e0b !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-mode .queue-details-grid,
[data-theme="light"] .queue-details-grid {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

body.light-mode .queue-details-grid b,
[data-theme="light"] .queue-details-grid b {
  color: #0f172a !important;
}

body.light-mode .btn-activate-queue,
[data-theme="light"] .btn-activate-queue {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #047857 !important;
}

body.light-mode .btn-activate-queue:hover,
[data-theme="light"] .btn-activate-queue:hover {
  background: #10b981 !important;
  color: #ffffff !important;
}

body.light-mode .btn-remove-queue,
[data-theme="light"] .btn-remove-queue {
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
}

body.light-mode .btn-remove-queue:hover,
[data-theme="light"] .btn-remove-queue:hover {
  background: #fee2e2 !important;
}

body.light-mode .modal-btn-queue,
[data-theme="light"] .modal-btn-queue {
  background: #fef3c7 !important;
  border: 1px solid #fde68a !important;
  color: #b45309 !important;
}

body.light-mode .modal-btn-queue:hover,
[data-theme="light"] .modal-btn-queue:hover {
  background: #fde68a !important;
  border-color: #d97706 !important;
}

/* Auto Trade Maintainer Button & Modal Styles */
.btn-auto-trade {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  position: relative;
  user-select: none;
}

.btn-auto-trade:hover {
  border-color: #38bdf8;
  color: #f8fafc;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.btn-auto-trade.active {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.25), rgba(16, 185, 129, 0.15));
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
}

.btn-auto-trade.active:hover {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.35), rgba(16, 185, 129, 0.25));
  border-color: #34d399;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.auto-trade-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  display: inline-block;
  transition: all 0.3s ease;
}

.btn-auto-trade.active .auto-trade-indicator {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-green 1.8s infinite;
}

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

.preset-chip {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #f8fafc;
}

.preset-chip.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #10b981;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

body.light-mode .btn-auto-trade,
[data-theme="light"] .btn-auto-trade {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

body.light-mode .btn-auto-trade:hover,
[data-theme="light"] .btn-auto-trade:hover {
  background: #e2e8f0;
  color: #0f172a;
}

body.light-mode .btn-auto-trade.active,
[data-theme="light"] .btn-auto-trade.active {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
}

body.light-mode .preset-chip,
[data-theme="light"] .preset-chip {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

body.light-mode .preset-chip.active,
[data-theme="light"] .preset-chip.active {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
}

/* ============================================================ */
/* PROFESSIONAL SIDEBAR DRAWER & MODULAR TAB SYSTEM            */
/* ============================================================ */

/* Desktop / PC Mode (> 768px): Unified Single Bar Header */
@media (min-width: 769px) {
  .app-persistent-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    margin-bottom: 22px !important;
    padding: 14px 22px !important;
    background: rgba(13, 20, 36, 0.92) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(197, 160, 89, 0.25) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    position: sticky !important;
    top: 10px !important;
    z-index: 1000 !important;
    gap: 14px !important;
  }
  .app-persistent-header .logo-area {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
  }
  .app-persistent-header .badges {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    justify-content: flex-end !important;
  }
}

body.light-mode .app-persistent-header,
[data-theme="light"] .app-persistent-header {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(197, 160, 89, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.hamburger-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(197, 160, 89, 0.3);
  border-radius: 11px;
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.hamburger-btn:hover {
  background: rgba(197, 160, 89, 0.15);
  border-color: #c5a059;
  box-shadow: 0 0 12px rgba(197, 160, 89, 0.3);
}
.hamburger-line {
  width: 22px;
  height: 2.5px;
  background: #f8fafc;
  border-radius: 2px;
  transition: all 0.2s ease;
}
.hamburger-btn:hover .hamburger-line {
  background: #c5a059;
}
.brand-emblem-box:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 6px 22px rgba(197, 160, 89, 0.4) !important;
}
body.light-mode .hamburger-btn,
[data-theme="light"] .hamburger-btn {
  background: #ffffff;
  border-color: #cbd5e1;
}
body.light-mode .hamburger-line,
[data-theme="light"] .hamburger-line {
  background: #0f172a;
}

.drawer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 13, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99990;
  transition: opacity 0.25s ease;
}
.drawer-overlay.active {
  display: block;
}

.app-sidebar-drawer {
  position: fixed;
  top: 0;
  left: -330px;
  width: 310px;
  height: 100vh;
  background: #0b111e;
  border-right: 1px solid #1e293b;
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.85);
  z-index: 99995;
  display: flex;
  flex-direction: column;
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}
.app-sidebar-drawer.open {
  left: 0;
}

body.light-mode .app-sidebar-drawer,
[data-theme="light"] .app-sidebar-drawer {
  background: #ffffff;
  border-right-color: #e2e8f0;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
  padding: 16px 18px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
}
body.light-mode .sidebar-header,
[data-theme="light"] .sidebar-header {
  background: #f1f5f9;
  border-bottom-color: #e2e8f0;
}

.drawer-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 6px;
}
.drawer-close-btn:hover {
  color: #f8fafc;
  background: #1e293b;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s ease;
}
.nav-item:hover {
  background: rgba(30, 41, 59, 0.6);
  color: #f8fafc;
}
.nav-item.active {
  background: rgba(240, 185, 11, 0.12);
  border-color: rgba(240, 185, 11, 0.35);
  color: #f0b90b;
}
body.light-mode .nav-item {
  color: #475569;
}
body.light-mode .nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}
body.light-mode .nav-item.active {
  background: rgba(240, 185, 11, 0.15);
  border-color: #f0b90b;
  color: #b45309;
}

.nav-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  flex-shrink: 0;
}
.nav-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.nav-title {
  font-size: 13.5px;
  font-weight: 600;
  color: inherit;
}
.nav-sub {
  font-size: 11px;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid #1e293b;
  background: #090d16;
}
body.light-mode .sidebar-footer,
[data-theme="light"] .sidebar-footer {
  background: #f8fafc;
  border-top-color: #e2e8f0;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sidebar-user-card:hover {
  background: #1e293b;
  border-color: #38bdf8;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}
body.light-mode .sidebar-user-card,
[data-theme="light"] .sidebar-user-card {
  background: #ffffff;
  border-color: #cbd5e1;
}
body.light-mode .sidebar-user-card:hover,
[data-theme="light"] .sidebar-user-card:hover {
  background: #f1f5f9;
  border-color: #0284c7;
}

.user-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(240, 185, 11, 0.15);
  border: 1.5px solid rgba(240, 185, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar-circle img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-role-badge {
  cursor: pointer;
  transition: all 0.15s ease;
}
.user-role-badge:hover {
  border-color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.15) !important;
}
.sidebar-logout-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  color: #94a3b8;
}
.sidebar-logout-btn:hover {
  color: #ef4444;
}

/* Tab Panes */
.app-tab-pane {
  display: none;
  animation: tabFadeIn 0.18s ease-out;
}
.app-tab-pane.active {
  display: block;
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* User Role & Header Badges */
.user-role-badge {
  background: #0f172a;
  border: 1px solid #334155;
  color: #f8fafc;
  font-weight: 600;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body.light-mode .user-role-badge,
[data-theme="light"] .user-role-badge {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}
.btn-logout {
  cursor: pointer;
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.40) !important;
  color: #f87171 !important;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-logout:hover {
  background: rgba(239, 68, 68, 0.26) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
}

/* Responsive Home & About Tab Bottom Grids */
@media (max-width: 900px) {
  .home-bottom-grid,
  .about-bottom-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Legal Modal Tab & Content Styling */
.lim-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lim-tab-btn:hover {
  color: #f1f5f9;
}

.lim-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
}

body.light-mode .lim-tab-btn {
  color: #64748b;
}

body.light-mode .lim-tab-btn.active {
  color: #0284c7;
  border-bottom-color: #0284c7;
}

body.light-mode #legal-info-modal .modal-content {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

body.light-mode #legal-info-modal .lim-header-wrap,
body.light-mode #legal-info-modal .lim-footer-wrap {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

body.light-mode #legal-info-modal .lim-tabs-wrap {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

body.light-mode #legal-info-modal #lim-title {
  color: #0f172a !important;
}

body.light-mode #legal-info-modal #lim-body {
  color: #334155 !important;
}

/* ==========================================================================
   Comprehensive Mobile & Phone Responsiveness Enhancements (<= 768px & <= 480px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Prevent horizontal screen jiggle and respect mobile safe areas */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  body {
    padding: 10px 8px env(safe-area-inset-bottom, 10px) !important;
  }

  /* Mobile Phone Mode (<= 768px): 2 Distinct Separate Bars */
  .app-persistent-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    padding: 0 !important;
    margin-bottom: 12px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }

  /* BAR 1: Mobile Logo & Brand Top Bar */
  .app-persistent-header .logo-area {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 14px !important;
    background: rgba(13, 20, 36, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(197, 160, 89, 0.32) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .app-persistent-header .hamburger-btn {
    width: 42px !important;
    height: 42px !important;
    border-radius: 9px !important;
    padding: 7px !important;
    flex-shrink: 0 !important;
  }

  .app-persistent-header .brand-emblem-box {
    width: 42px !important;
    height: 42px !important;
    border-radius: 9px !important;
    padding: 3px !important;
    flex-shrink: 0 !important;
  }

  .app-persistent-header .brand-emblem-box img {
    width: 28px !important;
    height: 28px !important;
  }

  .app-persistent-header .logo-area h1 {
    font-size: 18px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .app-persistent-header .logo-area .subtitle {
    font-size: 11px !important;
    color: #94a3b8 !important;
    margin-top: 2px !important;
  }

  /* BAR 2: Mobile Actions & Controls Toolbar */
  .app-persistent-header .badges {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 8px 10px !important;
    background: rgba(13, 20, 36, 0.90) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(197, 160, 89, 0.22) !important;
    border-radius: 11px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    white-space: normal !important;
    -webkit-overflow-scrolling: auto !important;
    scrollbar-width: none !important;
  }

  .app-persistent-header .badges::-webkit-scrollbar {
    display: none !important;
  }

  /* Flatten auth controls on mobile so buttons participate in direct flex ordering */
  .app-persistent-header .badges #auth-user-controls {
    display: contents !important;
  }
  .app-persistent-header .badges #auth-user-controls[style*="none"] {
    display: none !important;
  }
  .app-persistent-header .badges #auth-guest-controls {
    display: contents !important;
  }
  .app-persistent-header .badges #auth-guest-controls[style*="none"] {
    display: none !important;
  }

  /* Mobile Bar 2 Item Order: Place 🚪 Log Out directly next to ☀️ Light! */
  .app-persistent-header #binance-status-badge {
    order: 1 !important;
  }
  .app-persistent-header #theme-toggle-btn {
    order: 2 !important;
  }
  .app-persistent-header #btn-header-logout {
    order: 3 !important;
  }
  .app-persistent-header #btn-header-login {
    order: 3 !important;
  }
  .app-persistent-header #btn-header-register {
    order: 4 !important;
  }
  .app-persistent-header #user-profile-badge {
    order: 4 !important;
  }
  .app-persistent-header #btn-admin-excel {
    order: 5 !important;
  }

  .app-persistent-header .badges .badge,
  .app-persistent-header .badges button,
  .app-persistent-header .badges a {
    flex-shrink: 0 !important;
    font-size: 11.5px !important;
    padding: 6px 10px !important;
    border-radius: 7px !important;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(197, 160, 89, 0.25);
    color: #f1f5f9;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    height: 32px !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
  }

  /* Mobile Dark Mode Distinct Button Accents */
  .app-persistent-header #btn-header-logout.btn-logout {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    color: #f87171 !important;
  }
  .app-persistent-header #btn-header-logout.btn-logout:hover,
  .app-persistent-header #btn-header-logout.btn-logout:active {
    background: rgba(239, 68, 68, 0.28) !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
  }
  .app-persistent-header #btn-header-login {
    background: #0284c7 !important;
    border: 1px solid #0284c7 !important;
    color: #ffffff !important;
  }
  .app-persistent-header #btn-admin-excel {
    background: rgba(16, 185, 129, 0.12) !important;
    border: 1px solid rgba(16, 185, 129, 0.40) !important;
    color: #34d399 !important;
  }

  body.light-mode .app-persistent-header,
  [data-theme="light"] .app-persistent-header {
    background: transparent !important;
  }
  body.light-mode .app-persistent-header .logo-area,
  [data-theme="light"] .app-persistent-header .logo-area {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(197, 160, 89, 0.35) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
  }
  body.light-mode .app-persistent-header .badges,
  [data-theme="light"] .app-persistent-header .badges {
    background: rgba(248, 250, 252, 0.96) !important;
    border-color: rgba(197, 160, 89, 0.30) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
  }
  body.light-mode .app-persistent-header .badges .badge,
  body.light-mode .app-persistent-header .badges button,
  body.light-mode .app-persistent-header .badges a,
  [data-theme="light"] .app-persistent-header .badges .badge,
  [data-theme="light"] .app-persistent-header .badges button,
  [data-theme="light"] .app-persistent-header .badges a {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
  }
  body.light-mode .app-persistent-header #btn-header-logout.btn-logout,
  [data-theme="light"] .app-persistent-header #btn-header-logout.btn-logout {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #dc2626 !important;
  }
  body.light-mode .app-persistent-header #btn-header-logout.btn-logout:hover,
  [data-theme="light"] .app-persistent-header #btn-header-logout.btn-logout:hover {
    background: #fee2e2 !important;
    border-color: #f87171 !important;
    color: #b91c1c !important;
  }
  body.light-mode .app-persistent-header #btn-header-login,
  [data-theme="light"] .app-persistent-header #btn-header-login {
    background: #0284c7 !important;
    border: 1px solid #0284c7 !important;
    color: #ffffff !important;
  }
  body.light-mode .app-persistent-header #btn-admin-excel,
  [data-theme="light"] .app-persistent-header #btn-admin-excel {
    background: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    color: #16a34a !important;
  }

  /* Slide-in Drawer on Mobile Phones */
  .app-sidebar-drawer {
    width: min(300px, 84vw) !important;
  }

  /* Cards & Containers on Mobile */
  .card {
    border-radius: 12px !important;
    margin-bottom: 12px !important;
  }

  .card-header {
    padding: 12px 14px !important;
  }

  .card-body {
    padding: 12px !important;
  }

  /* Stats Row in Wallet card */
  .stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .stat-box {
    padding: 9px 10px !important;
  }

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

  .stat-val {
    font-size: 14.5px !important;
  }

  /* Touch-Friendly Action Buttons */
  .wallet-header-actions {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .wallet-header-actions button {
    height: 38px !important;
    min-height: 38px !important;
    font-size: 11.5px !important;
    border-radius: 8px !important;
  }

  .wallet-header-actions .btn-open-trade {
    height: 42px !important;
    min-height: 42px !important;
    font-size: 13px !important;
    letter-spacing: 0.2px;
  }

  /* Open Positions Cards on Mobile */
  .holding-card {
    padding: 10px 12px !important;
    border-radius: 8px !important;
  }

  .holding-card > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }

  .holding-card > div:first-child > div:last-child {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  /* Mobile Modals (Bottom-sheet & Touch responsive) */
  .modal-overlay {
    padding: 6px !important;
    align-items: flex-end !important;
  }

  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 18px 18px 10px 10px !important;
    margin: 0 !important;
  }

  /* Trade Modal on Phone */
  #trade-modal .modal-content {
    max-height: 94vh !important;
  }

  #trade-modal .crypto-slider {
    height: 8px !important;
    touch-action: pan-x !important;
  }

  #trade-modal .crypto-slider::-webkit-slider-thumb {
    width: 24px !important;
    height: 24px !important;
  }

  /* Chart Modal on Phone */
  #chart-modal .modal-content {
    height: 90vh !important;
    max-height: 90vh !important;
  }

  #chart-modal-iframe-wrap {
    height: calc(90vh - 120px) !important;
    min-height: 300px !important;
  }

  /* Trade History Modal on Phone */
  #trade-history-modal .modal-content {
    height: 95vh !important;
    max-height: 95vh !important;
    width: 100% !important;
    border-radius: 16px 16px 8px 8px !important;
  }

  /* Form inputs touch target on mobile (prevents iOS auto-zoom) */
  input[type="text"],
  input[type="number"],
  input[type="password"],
  select {
    font-size: 14.5px !important;
    min-height: 40px !important;
  }

  /* Footer on Mobile */
  .app-pro-footer {
    padding: 24px 12px 20px !important;
    margin-top: 30px !important;
  }

  .footer-top-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

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

  .footer-badges {
    width: 100% !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  .footer-badge {
    font-size: 11px !important;
    padding: 4px 9px !important;
  }

  .footer-links-row {
    gap: 8px !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }

  .footer-link-btn {
    font-size: 12px !important;
    padding: 4px 6px !important;
  }

  .footer-disclaimer-card {
    padding: 12px 14px !important;
  }

  .disclaimer-body {
    font-size: 11px !important;
    line-height: 1.55 !important;
  }

  .footer-bottom-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }
}

/* Extra small phones (<= 380px, e.g. iPhone SE, compact Androids) */
@media (max-width: 380px) {
  body {
    padding: 6px 4px !important;
  }

  .logo-area h1 {
    font-size: 13px !important;
  }

  .card-header-title-wrap h2 {
    font-size: 12px !important;
  }

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

  .wallet-header-actions button {
    font-size: 10px !important;
    padding: 4px !important;
  }
}

/* ==========================================================================
   Mobile-Optimized Compact Typography (Phone Scaling <= 768px & <= 480px)
   Reduces oversized text for crisp, balanced, ergonomic viewing on phones
   ========================================================================== */
@media (max-width: 768px) {
  html {
    font-size: 13px !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  /* Headings & Titles */
  h1 {
    font-size: 16px !important;
    line-height: 1.25 !important;
  }
  .logo-area h1, .app-persistent-header h1 {
    font-size: 19px !important;
    line-height: 1.25 !important;
  }
  h2, .card-header h2, .card-header-title-wrap h2, .section-title {
    font-size: 13px !important;
    line-height: 1.3 !important;
  }
  h3, .modal-header h3 {
    font-size: 13px !important;
  }
  h4 {
    font-size: 11.5px !important;
  }

  .subtitle, .app-subtitle {
    font-size: 10.5px !important;
  }

  /* Wallet & Balances / Numbers */
  .stat-val, .wallet-balance-val, .metric-value, .stat-number, .balance-amount {
    font-size: 14.5px !important;
  }
  .stat-label, .metric-label, .sub-label {
    font-size: 10px !important;
  }

  /* Active Trades, Positions & Lists */
  .holding-card {
    font-size: 11px !important;
    padding: 8px 10px !important;
  }
  .holding-card .symbol-name, .coin-title {
    font-size: 11.5px !important;
  }
  .holding-card .pnl-badge, .holding-card .roe-badge {
    font-size: 10px !important;
    padding: 2px 5px !important;
  }

  /* Tables, Rows & Data grids */
  table th, table td, .table-row, .trade-row {
    font-size: 10.5px !important;
    padding: 5px 6px !important;
  }

  /* Buttons, Badges & Chips */
  button, .btn, .btn-action, .btn-sm, .preset-chip {
    font-size: 11px !important;
  }
  .badge, .status-badge, .status-indicator {
    font-size: 9.5px !important;
    padding: 2px 6px !important;
  }

  /* Inputs, Sliders & Forms */
  input, select, textarea {
    font-size: 12.5px !important;
  }
  #auto-trade-target-input {
    font-size: 15px !important;
    padding: 6px 10px !important;
  }

  /* Modals & Dialogs */
  .modal-content {
    font-size: 11.5px !important;
  }
  .modal-inner-card, .info-box, .notice-box {
    font-size: 11px !important;
    padding: 8px 10px !important;
  }

  /* Navigation Bar / Tabs */
  .nav-tab, .app-tab-btn, .lim-tab-btn {
    font-size: 10.5px !important;
    padding: 6px 8px !important;
  }

  /* Proportional scaling for inline styled elements */
  [style*="font-size: 26px"], [style*="font-size:26px"],
  [style*="font-size: 24px"], [style*="font-size:24px"],
  [style*="font-size: 22px"], [style*="font-size:22px"] {
    font-size: 15px !important;
  }

  [style*="font-size: 20px"], [style*="font-size:20px"],
  [style*="font-size: 19px"], [style*="font-size:19px"],
  [style*="font-size: 18px"], [style*="font-size:18px"] {
    font-size: 13.5px !important;
  }

  [style*="font-size: 17px"], [style*="font-size:17px"],
  [style*="font-size: 16px"], [style*="font-size:16px"],
  [style*="font-size: 15px"], [style*="font-size:15px"] {
    font-size: 12px !important;
  }

  [style*="font-size: 14px"], [style*="font-size:14px"],
  [style*="font-size: 14.5px"], [style*="font-size:14.5px"],
  [style*="font-size: 13.5px"], [style*="font-size:13.5px"] {
    font-size: 11px !important;
  }

  [style*="font-size: 13px"], [style*="font-size:13px"],
  [style*="font-size: 12.5px"], [style*="font-size:12.5px"] {
    font-size: 10.5px !important;
  }
}

/* Extra Compact Scaling for Small Smartphones (<= 480px) */
@media (max-width: 480px) {
  html {
    font-size: 12px !important;
  }

  body {
    font-size: 11px !important;
  }

  h1, .logo-area h1 {
    font-size: 13px !important;
  }

  h2, .card-header h2 {
    font-size: 11.5px !important;
  }

  .stat-val {
    font-size: 13px !important;
  }

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

  button, .btn {
    font-size: 10.5px !important;
  }

  .badge {
    font-size: 9px !important;
  }

  table th, table td {
    font-size: 9.5px !important;
    padding: 4px 5px !important;
  }
}
/* PC Desktop View (> 768px): Maintain exact natural order with Log Out at far right */
@media (min-width: 769px) {
  .app-persistent-header #auth-user-controls {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }
  .app-persistent-header #btn-admin-excel {
    order: 1 !important;
  }
  .app-persistent-header #user-profile-badge {
    order: 2 !important;
  }
  .app-persistent-header #btn-header-logout {
    order: 3 !important;
  }
}

