/* ── Reset & Variables ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0b0e14;
  --bg2:       #111520;
  --bg3:       #181d2a;
  --border:    #1f2740;
  --accent:    #00e5ff;
  --accent2:   #6c63ff;
  --profit:    #00e096;
  --loss:      #ff4d6d;
  --text:      #e2e8f0;
  --muted:     #4a5568;
  --font-mono: 'Space Mono', monospace;
  --font-sans: 'DM Sans', sans-serif;
  --radius:    10px;
  --shadow:    0 8px 32px rgba(0,0,0,0.45);
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 14px; }

/* ── Layout ─────────────────────────────────────────── */
.dashboard-wrapper { display: flex; height: 100vh; overflow: hidden; }

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  min-width: 0;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: 200px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 0;
  flex-shrink: 0;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 28px;
  border-bottom: 1px solid var(--border);
}
.brand-icon { font-size: 24px; color: var(--accent); line-height: 1; }
.brand-name { font-family: var(--font-mono); font-size: 13px; font-weight: 700; line-height: 1.3; letter-spacing: 0.05em; }
.brand-name small { color: var(--accent); font-size: 10px; letter-spacing: 0.15em; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 20px 10px; flex: 1; }
.nav-item { display: block; padding: 10px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 13px; transition: all 0.18s; }
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(0,229,255,0.08); color: var(--accent); border-left: 2px solid var(--accent); }
.sidebar-close { display: none; margin-left: auto; background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }

/* ── Topbar ──────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  gap: 12px;
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.topbar-btn-row { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.page-title { font-family: var(--font-mono); font-size: 18px; font-weight: 700; letter-spacing: 0.03em; }

.live-indicator {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  color: var(--profit); letter-spacing: 0.12em;
  padding: 3px 8px;
  background: rgba(0,224,150,0.08); border: 1px solid rgba(0,224,150,0.25); border-radius: 20px;
}
.pulse-dot { width: 6px; height: 6px; background: var(--profit); border-radius: 50%; animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.4; transform:scale(0.8); } }

.from-account-wrap { display: flex; align-items: center; gap: 8px; }
.from-account-label { font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); white-space: nowrap; }

.icon-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: var(--font-sans); font-size: 13px;
  cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,229,255,0.05); }

.login-btn-topbar {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(0,229,255,0.1), rgba(108,99,255,0.1));
  border: 1px solid rgba(0,229,255,0.3); border-radius: 8px;
  color: var(--accent); font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.login-btn-topbar:hover { background: linear-gradient(135deg, rgba(0,229,255,0.2), rgba(108,99,255,0.2)); box-shadow: 0 0 14px rgba(0,229,255,0.15); }

/* ── Hamburger ───────────────────────────────────────── */
.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; flex-shrink: 0; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.2s; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 49; }
.sidebar-overlay.open { display: block; }

/* ── Tab panels ──────────────────────────────────────── */
.tab-panel { display: flex; flex-direction: column; flex: 1; overflow: hidden; min-height: 0; }

/* ── Positions permanent toolbar ────────────────────── */
.positions-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 28px; background: var(--bg2); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.positions-toolbar-left  { display: flex; align-items: center; gap: 8px; }
.positions-toolbar-right { display: flex; align-items: center; gap: 8px; }

/* Consolidated positions — accounts cell */
.positions-table td.accounts {
  color: var(--text);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}
/* Consolidated positions — Hedge trade */

/* Form */
.hedge-form         { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.hedge-hint         { font-size: 11px; opacity: .45; display: block; margin-top: 4px; }

/* Qty row */
.hedge-qty-row      { display: flex; gap: 6px; align-items: center; }
.hedge-qty-btn      { width: 32px; height: 32px; border-radius: 6px;
                       border: 1px solid rgba(255,255,255,.2);
                       background: rgba(255,255,255,.08); color: inherit;
                       font-size: 16px; cursor: pointer;
                       display: flex; align-items: center; justify-content: center; }
.hedge-qty-btn:hover { background: rgba(255,255,255,.16); }
.hedge-input        { padding: 8px 10px; border-radius: 6px;
                       border: 1px solid rgba(255,255,255,.15);
                       background: rgba(255,255,255,.06);
                       color: inherit; font-size: 14px; width: 100%; box-sizing: border-box; }

/* Summary chip (step 2) */
.hedge-summary-chip { display: flex; flex-wrap: wrap; gap: 6px 14px;
                       background: rgba(255,255,255,.05);
                       border-radius: 8px; padding: 10px 14px;
                       margin-bottom: 18px; font-size: 13px; }
.hedge-chip-label   { opacity: .5; }
.hedge-chip-val     { font-weight: 600; }
.buy-badge          { color: #22c55e; }

/* Toast */
.hedge-toast        { position: fixed; bottom: 28px; left: 50%;
                       transform: translateX(-50%);
                       background: #22c55e; color: #fff;
                       padding: 10px 22px; border-radius: 8px;
                       font-size: 13px; font-weight: 600;
                       z-index: 9999; animation: fadeInUp .25s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }
/* ── Card style ── */
/* Checkbox in card header */
.pos-card-header      { display: flex; align-items: center; justify-content: space-between; }
.pos-card-check       { margin-left: auto; flex-shrink: 0; }

/* Selected card highlight */
.pos-card-selected    { border-color: var(--accent, #f59e0b) !important;
                         background: rgba(245, 158, 11, 0.06); }

/* ── Neo Search panel overrides ── */
#tab-neo_search {
  display: none;
  flex-direction: column;
  padding: 28px 24px 40px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;           /* allows flex child to shrink correctly */
  align-items: flex-start; /* stop children from stretching full width */
}

#tab-neo_search.active {
  display: flex;
}

.ns-search-wrap {
  position: relative;
  margin-bottom: 6px;
  width: 100%;
  max-width: 480px;
}
.ns-icon-search {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  pointer-events: none;
  flex-shrink: 0;
}
#ns-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px 11px 38px;
  font-size: 15px;
  font-family: inherit;
  border: 1.5px solid #e2e5ea;
  border-radius: 10px;
  background: #fff;
  color: #1a1d23;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#ns-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

#ns-input::placeholder { color: #adb3bf; }

.ns-spin {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid #e2e5ea;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: ns-spin 0.55s linear infinite;
  display: none;
}

@keyframes ns-spin { to { transform: translateY(-50%) rotate(360deg); } }

#ns-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #e2e5ea;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.09);
  overflow: hidden;
  z-index: 200;
  display: none;
}

.ns-dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.1s;
}

.ns-dd-item:last-child { border-bottom: none; }
.ns-dd-item:hover { background: #f5f7fb; }
.ns-dd-item:hover .ns-dd-sym { color: #2563eb; }

.ns-dd-sym {
  font-size: 14px;
  font-weight: 600;
  color: #1a1d23;
}

.ns-dd-ltp {
  font-size: 13px;
  color: #8a8f98;
  font-variant-numeric: tabular-nums;
}

.ns-dd-empty {
  padding: 14px;
  font-size: 13px;
  color: #8a8f98;
  text-align: center;
}
/* ── Neo Search Modals ─────────────────────────── */
.ns-modal {
  width: 100%;
  max-width: 380px;
  border-radius: 14px;
  overflow: hidden;
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  /* color: var(--text-primary, #1a1d23); */
  color: var(--text-inverse, #ffffff);
  letter-spacing: 0.01em;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--color-muted, #8a8f98);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

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

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 0 18px 18px;
}

.ns-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ns-modal-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-muted, #8a8f98);
  white-space: nowrap;
  min-width: 70px;
}

.ns-modal-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-accent, var(--accent-primary, #4f8ef7));
  font-variant-numeric: tabular-nums;
}

.ns-modal-input {
  flex: 1;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--border-color, #e2e5ea);
  border-radius: 8px;
  background: var(--input-bg, #fafbfc);
  color: var(--text-primary, #1a1d23);
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.ns-modal-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.09);
}

/* BUY/SELL toggle */
.ns-toggle-wrap {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--border-color, #e2e5ea);
}

.ns-toggle-btn {
  flex: 1;
  padding: 7px 22px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  border: none;
  cursor: pointer;
  background: var(--input-bg, #f5f7fb);
  color: var(--color-muted, #8a8f98);
  transition: background 0.15s, color 0.15s;
}

.ns-toggle-btn.active.ns-toggle-sell {
  background: #dc2626;
  color: #fff;
}

.ns-toggle-btn.active.ns-toggle-buy {
  background: #16a34a;
  color: #fff;
}

/* Submit button */
.ns-modal-submit {
  width: 100%;
  padding: 11px 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s;
}

.ns-modal-submit:hover { opacity: 0.88; }
.ns-modal-submit:disabled { opacity: 0.45; cursor: not-allowed; }

.ns-btn-spinner {
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ns-spin 0.55s linear infinite;
}

.ns-modal-status {
  margin: 0 18px 14px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.ns-modal-status.success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.ns-modal-status.error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.ns-modal-status.loading { background: #f5f7fb; color: #6b7280; border: 1px solid #e2e5ea; }
/* ── Action Bar ──────────────────────────────────────── */
.action-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 28px;
  background: rgba(108,99,255,0.08); border-bottom: 1px solid rgba(108,99,255,0.2);
  opacity: 0; max-height: 0; overflow: hidden; transition: all 0.25s; flex-shrink: 0;
}
.action-bar.visible { opacity: 1; max-height: 56px; }
.action-bar-left  { display: flex; align-items: center; gap: 12px; }
.action-bar-right { display: flex; align-items: center; gap: 8px; }

.selected-snos { display: flex; gap: 5px; flex-wrap: wrap; }
.sno-tag { background: rgba(0,229,255,0.1); border: 1px solid rgba(0,229,255,0.25); color: var(--accent); font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border-radius: 20px; }

.action-btn { display: flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.18s; border: none; }
.copy-btn   { background: rgba(0,229,255,0.12);  color: var(--accent);  border: 1px solid rgba(0,229,255,0.25); }
.copy-btn:hover { background: rgba(0,229,255,0.22); box-shadow: 0 0 12px rgba(0,229,255,0.15); }
.clone-btn  { background: rgba(108,99,255,0.12); color: #a09cf7; border: 1px solid rgba(108,99,255,0.3); }
.clone-btn:hover { background: rgba(108,99,255,0.22); }
.clear-btn  { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.clear-btn:hover { color: var(--loss); border-color: var(--loss); }
.odte-btn   { background: linear-gradient(135deg, rgba(255,193,7,0.12), rgba(255,140,0,0.12)); color: #ffc107; border: 1px solid rgba(255,193,7,0.3); }
.odte-btn:hover { background: linear-gradient(135deg, rgba(255,193,7,0.22), rgba(255,140,0,0.22)); }
.repeat-btn { background: rgba(0,229,255,0.08); color: var(--accent); border: 1px solid rgba(0,229,255,0.2); }
.repeat-btn:hover { background: rgba(0,229,255,0.16); }

/* ── Table ───────────────────────────────────────────── */
.table-container { flex: 1; overflow-y: auto; padding: 20px 28px; }
.table-container::-webkit-scrollbar { width: 6px; }
.table-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.positions-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.positions-table thead tr { background: var(--bg3); }
.positions-table th {
  padding: 13px 16px; font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
  text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.check-col { width: 44px; }
.positions-table tbody tr { transition: background 0.15s; animation: rowIn 0.3s ease forwards; opacity: 0; }
@keyframes rowIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
.positions-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.positions-table tbody tr.selected-row { background: rgba(108,99,255,0.07); border-left: 2px solid var(--accent2); }
.positions-table td { padding: 13px 16px; border-bottom: 1px solid rgba(31,39,64,0.7); font-size: 13.5px; vertical-align: middle; }
.positions-table tbody tr:last-child td { border-bottom: none; }

/* P&L and Qty colours */
.positions-table td.profit { color: #00e096 !important; font-weight: 700; background: rgba(0,224,150,0.06); }
.positions-table td.loss   { color: #ff4d6d !important; font-weight: 700; background: rgba(255,77,109,0.06); }

.symbol-cell { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; }
.num-cell    { font-family: var(--font-mono); font-size: 12.5px; text-align: right; padding-right: 20px; }
.sno-cell    { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* ── Custom Checkbox ─────────────────────────────────── */
.custom-check { display: inline-flex; cursor: pointer; position: relative; }
.custom-check input { display: none; }
.checkmark { width: 17px; height: 17px; border: 1.5px solid var(--muted); border-radius: 4px; background: transparent; transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.custom-check input:checked + .checkmark { background: var(--accent2); border-color: var(--accent2); }
.custom-check input:checked + .checkmark::after { content: ''; width: 5px; height: 9px; border: 2px solid white; border-top: none; border-left: none; transform: rotate(45deg) translate(-1px,-1px); display: block; }

/* ── Empty State ─────────────────────────────────────── */
.empty-state td { padding: 56px 20px !important; }
.empty-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.empty-icon  { font-size: 36px; opacity: 0.5; }

/* ── Account Dropdown ────────────────────────────────── */
.account-dropdown-wrap { position: relative; display: flex; align-items: center; }
.account-dropdown {
  width: 100%; appearance: none; background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: var(--font-sans); font-size: 13px;
  padding: 10px 36px 10px 14px; cursor: pointer; transition: border-color 0.18s; outline: none;
}
.account-dropdown:focus { border-color: var(--accent2); }
.account-dropdown option { background: #1a2035; color: var(--text); }
.dropdown-arrow { position: absolute; right: 12px; color: var(--muted); pointer-events: none; font-size: 12px; }

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(6px); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
  width: 480px; max-width: 95vw; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow); animation: slideUp 0.25s ease; overflow: hidden;
}
.modal-wide { width: 90vw; max-width: 900px; max-height: 92vh; }

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

.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-header h2 { font-family: var(--font-mono); font-size: 15px; font-weight: 700; letter-spacing: 0.04em; }
.modal-header-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.modal-header-left .from-acc-badge { margin-bottom: 0; font-size: 10px; padding: 3px 10px; }

.modal-close { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; transition: color 0.15s; }
.modal-close:hover { color: var(--loss); }

.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; border-top: 1px solid var(--border); flex-shrink: 0; }

.modal-section-label { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

.modal-note { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); padding: 10px 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 7px; }

/* Step containers */
#copyStep1, #copyStep2, #copyStep3,
#odteStep1, #odteStep2, #odteStep3 {
  display: flex; flex-direction: column; flex: 1; overflow: hidden; min-height: 0;
}

.modal-btn { display: flex; align-items: center; gap: 7px; padding: 9px 20px; border-radius: 8px; font-family: var(--font-sans); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.18s; border: none; }
.modal-btn.secondary { background: var(--bg3); color: var(--muted); border: 1px solid var(--border); }
.modal-btn.secondary:hover { color: var(--text); border-color: var(--text); }
.modal-btn.primary { background: linear-gradient(135deg, var(--accent2), #5a52e8); color: white; box-shadow: 0 4px 14px rgba(108,99,255,0.35); }
.modal-btn.primary:hover { box-shadow: 0 4px 20px rgba(108,99,255,0.55); transform: translateY(-1px); }

/* ── From-acc badge ──────────────────────────────────── */
.from-acc-badge {
  display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--accent2); background: rgba(108,99,255,0.1); border: 1px solid rgba(108,99,255,0.25);
  padding: 4px 12px; border-radius: 20px; margin-bottom: 14px; letter-spacing: 0.04em;
}

/* ── Current Account Pill ────────────────────────────── */
.current-account { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 12px 14px; background: rgba(108,99,255,0.08); border: 1.5px solid rgba(108,99,255,0.3); border-radius: 10px; animation: slideUp 0.2s ease; }
.current-account-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent2), var(--accent)); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: white; flex-shrink: 0; }
.current-account-name { font-size: 13px; font-weight: 600; color: var(--text); }
.current-account-id   { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 2px; }
.current-account-remove { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: 4px; transition: color 0.15s; }
.current-account-remove:hover { color: var(--loss); }

/* ── Selected Rows Display ───────────────────────────── */
.selected-rows-display { display: flex; flex-wrap: wrap; gap: 6px; min-height: 32px; padding: 8px 10px; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; }
.tag { background: rgba(0,229,255,0.08); border: 1px solid rgba(0,229,255,0.2); color: var(--accent); font-family: var(--font-mono); font-size: 11px; padding: 3px 10px; border-radius: 20px; }

/* ── Copy Trades Table ───────────────────────────────── */
.copy-trades-table-wrap { border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.copy-trades-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.copy-trades-table th { background: var(--bg3); padding: 9px 14px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); text-align: left; border-bottom: 1px solid var(--border); }
.copy-trades-table td { padding: 10px 14px; border-bottom: 1px solid rgba(31,39,64,0.6); font-size: 13px; vertical-align: middle; }
.copy-trades-table tbody tr:last-child td { border-bottom: none; }

/* Column widths */
.copy-trades-table th:nth-child(1), .copy-trades-table td:nth-child(1) { min-width: 140px; }
.copy-trades-table th:nth-child(2), .copy-trades-table td:nth-child(2) { width: 110px; }
.copy-trades-table th:nth-child(3), .copy-trades-table td:nth-child(3) { width: 190px; }
.copy-trades-table th:nth-child(4), .copy-trades-table td:nth-child(4) { width: 52px; text-align: center; }
.copy-trades-table th:nth-child(5), .copy-trades-table td:nth-child(5) { width: 200px; }

/* ── Qty Stepper ─────────────────────────────────────── */
.qty-stepper { display: flex; align-items: center; gap: 8px; }
.step-btn { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); background: var(--bg3); color: var(--text); font-size: 16px; font-weight: 300; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s; line-height: 1; user-select: none; }
.step-btn:hover  { border-color: var(--accent2); color: var(--accent2); background: rgba(108,99,255,0.08); }
.step-btn:active { transform: scale(0.93); }

.qty-input { width: 90px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 6px; color: var(--text); font-family: var(--font-mono); font-size: 13px; padding: 6px 10px; outline: none; transition: border-color 0.15s; }
.qty-input:focus { border-color: var(--accent2); }
.qty-stepper .qty-input { width: 90px; text-align: center; }
.price-input { width: 130px; }
.qty-input:disabled { opacity: 0.45; cursor: not-allowed; border-color: var(--border); }

/* Hide native spinners */
.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.no-spinner { -moz-appearance: textfield; }

/* ── BUY/SELL Toggle ─────────────────────────────────── */
.side-toggle { display: inline-flex; border-radius: 7px; overflow: hidden; border: 1px solid var(--border); }
.side-btn { padding: 5px 10px; font-size: 10px; font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.06em; border: none; background: var(--bg3); color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s; }
.buy-btn.active  { background: rgba(0,224,150,0.18);  color: #00e096; }
.sell-btn.active { background: rgba(255,77,109,0.18); color: #ff4d6d; }
.side-btn:not(.active):hover { background: var(--bg2); color: var(--text); }

/* ── Max Checkbox ────────────────────────────────────── */
.max-col { text-align: center; }
.max-check-wrap { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.max-check-wrap input { display: none; }
.max-checkmark { width: 18px; height: 18px; border: 1.5px solid var(--muted); border-radius: 4px; background: transparent; transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.max-check-wrap input:checked + .max-checkmark { background: var(--accent2); border-color: var(--accent2); }
.max-check-wrap input:checked + .max-checkmark::after { content: ''; width: 5px; height: 9px; border: 2px solid white; border-top: none; border-left: none; transform: rotate(45deg) translate(-1px,-1px); display: block; }
.no-max { color: var(--muted); font-size: 12px; }

/* ── Step 2 loading ──────────────────────────────────── */
.step2-loading { display: flex; align-items: center; gap: 12px; padding: 28px 0; color: var(--muted); font-size: 13px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent2); border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Execution log ───────────────────────────────────── */
.exec-summary { margin-bottom: 14px; min-height: 28px; }
.exec-status { display: inline-block; font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; padding: 5px 14px; border-radius: 20px; }
.exec-status.pending  { background: rgba(74,85,104,0.3);  color: var(--muted); }
.exec-status.success  { background: rgba(0,224,150,0.12); color: var(--profit); border: 1px solid rgba(0,224,150,0.3); }
.exec-status.partial  { background: rgba(255,165,0,0.1);  color: #ffa500; border: 1px solid rgba(255,165,0,0.3); }
.exec-status.fail     { background: rgba(255,77,109,0.1); color: var(--loss);   border: 1px solid rgba(255,77,109,0.3); }
.exec-log { display: flex; flex-direction: column; gap: 7px; max-height: 260px; overflow-y: auto; padding-right: 4px; }
.exec-log::-webkit-scrollbar { width: 4px; }
.exec-log::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.exec-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; font-size: 13px; animation: rowIn 0.2s ease forwards; }
.exec-ok   { background: rgba(0,224,150,0.07);  border: 1px solid rgba(0,224,150,0.18); }
.exec-fail { background: rgba(255,77,109,0.07); border: 1px solid rgba(255,77,109,0.18); }
.exec-icon   { font-size: 14px; font-weight: 700; flex-shrink: 0; }
.exec-ok .exec-icon   { color: var(--profit); }
.exec-fail .exec-icon { color: var(--loss); }
.exec-symbol { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--text); min-width: 90px; }
.exec-qty    { font-family: var(--font-mono); font-size: 11px; color: var(--muted); min-width: 60px; }
.exec-price  { font-family: var(--font-mono); font-size: 11px; color: var(--muted); min-width: 70px; }
.exec-msg    { font-size: 12px; color: var(--muted); flex: 1; }

/* ── Clone Modal ─────────────────────────────────────── */
.clone-options { display: flex; align-items: center; justify-content: space-between; padding: 14px; background: var(--bg3); border: 1px solid var(--border); border-radius: 9px; margin-top: 14px; }
.option-label  { font-size: 13px; font-weight: 500; color: var(--text); }
.qty-controls  { display: flex; align-items: center; gap: 12px; }
.qty-btn { width: 28px; height: 28px; border-radius: 7px; background: var(--bg2); border: 1px solid var(--border); color: var(--text); font-size: 16px; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
#multiplierVal { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--accent); min-width: 32px; text-align: center; }

/* ── Orders Tab ──────────────────────────────────────── */
.orders-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 28px; border-bottom: 1px solid var(--border); background: var(--bg2); flex-shrink: 0; }
.orders-toolbar-info { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.05em; }
.orders-table th, .orders-table td { white-space: nowrap; }

.order-status { display: inline-block; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 10px; border-radius: 20px; }
.status-open     { background: rgba(255,193,7,0.12);  color: #ffc107; border: 1px solid rgba(255,193,7,0.3); }
.status-complete { background: rgba(0,224,150,0.10);  color: #00e096; border: 1px solid rgba(0,224,150,0.3); }
.status-rejected { background: rgba(255,77,109,0.10); color: #ff4d6d; border: 1px solid rgba(255,77,109,0.3); }

.order-actions { white-space: nowrap; }
.order-action-btn { padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer; border: 1px solid; transition: all 0.15s; margin-right: 4px; }
.modify-btn       { background: rgba(108,99,255,0.1); color: #a09cf7; border-color: rgba(108,99,255,0.3); }
.modify-btn:hover { background: rgba(108,99,255,0.2); }
.cancel-btn       { background: rgba(255,77,109,0.1); color: #ff4d6d; border-color: rgba(255,77,109,0.3); }
.cancel-btn:hover { background: rgba(255,77,109,0.2); }
.save-btn         { background: rgba(0,224,150,0.1);  color: #00e096; border-color: rgba(0,224,150,0.3); }
.save-btn:hover   { background: rgba(0,224,150,0.2); }
.cancel-edit-btn  { background: transparent; color: var(--muted); border-color: var(--border); }
.cancel-edit-btn:hover { color: var(--text); border-color: var(--text); }

.inline-input { background: var(--bg); border: 1.5px solid var(--accent2); border-radius: 5px; color: var(--text); font-family: var(--font-mono); font-size: 12px; padding: 4px 8px; outline: none; text-align: right; }
.inline-input:focus { border-color: var(--accent); }

/* ── ODTE ────────────────────────────────────────────── */
.odte-premium-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.odte-premium-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.odte-premium-label { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.pe-label { color: #ff4d6d; }
.ce-label { color: #00e096; }

/* ── Toast ───────────────────────────────────────────── */
.toast { position: fixed; bottom: 28px; right: 28px; background: var(--bg2); border: 1px solid var(--border); color: var(--text); padding: 13px 20px; border-radius: 10px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow); transform: translateY(20px); opacity: 0; pointer-events: none; transition: all 0.3s; z-index: 200; max-width: 320px; }
.toast.show    { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(0,224,150,0.4);  color: var(--profit); }
.toast.error   { border-color: rgba(255,77,109,0.4); color: var(--loss); }

/* ── Mobile ──────────────────────────────────────────── */
.hamburger { display: none; }

@media (max-width: 768px) {
  .hamburger     { display: flex; }
  .sidebar-close { display: block; }
  .sidebar { position: fixed; left: -220px; top: 0; height: 100vh; width: 220px; z-index: 50; transition: left 0.25s; padding-top: 20px; }
  .sidebar.open  { left: 0; }

  .topbar { flex-wrap: wrap; padding: 12px 14px; gap: 8px; }
  .topbar-left  { gap: 8px; flex: 1; }
  .topbar-right { align-items: flex-end; }
  .topbar-btn-row { gap: 6px; }
  .page-title   { font-size: 14px; }
  .live-indicator { font-size: 9px; padding: 2px 7px; }
  .from-account-label { display: none; }
  .account-dropdown-wrap { min-width: 0 !important; }
  .account-dropdown { font-size: 12px; padding: 8px 28px 8px 10px; }
  .icon-btn         { padding: 7px 10px; font-size: 12px; }
  .login-btn-topbar { padding: 7px 10px; font-size: 12px; }

  .positions-toolbar { padding: 8px 14px; }
  .action-bar { flex-direction: column; align-items: flex-start; gap: 8px; max-height: none; padding: 10px 16px; }
  .action-bar.visible { max-height: 200px; }
  .action-bar-right { flex-wrap: wrap; gap: 6px; }

  .table-container { padding: 12px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .positions-table { min-width: 560px; border-radius: 0; border-left: none; border-right: none; }
  .positions-table th, .positions-table td { padding: 10px 12px; font-size: 12px; }

  .modal { width: 100%; max-width: 100%; max-height: 85vh; margin: 0; border-radius: 18px 18px 0 0; position: fixed; bottom: 0; left: 0; right: 0; }
  .modal-overlay { align-items: flex-end; }
  .modal-wide { max-width: 100%; }
  .modal-body { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px 16px; flex-wrap: wrap; }
  .modal-btn { flex: 1; justify-content: center; }

  .orders-toolbar { padding: 10px 16px; }
  .order-action-btn { padding: 3px 8px; font-size: 10px; }
  .step-btn { width: 24px; height: 24px; font-size: 14px; }
  .qty-stepper .qty-input { width: 70px; }
  .side-btn { padding: 4px 7px; font-size: 9px; }
  .odte-premium-grid { grid-template-columns: 1fr; }
  .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

/* ── Add / Exit buttons ─────────────────────────────── */
.add-btn  { background: rgba(0,224,150,0.12); color: #00e096; border: 1px solid rgba(0,224,150,0.3); }
.add-btn:hover  { background: rgba(0,224,150,0.22); }
.exit-btn { background: rgba(255,77,109,0.12); color: #ff4d6d; border: 1px solid rgba(255,77,109,0.3); }
.exit-btn:hover { background: rgba(255,77,109,0.22); }

/* ── Margins tab ─────────────────────────────────────── */
.margins-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-content: start;
}

.margins-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: var(--muted);
  font-size: 13px;
  grid-column: 1 / -1;
}

.margin-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;    /* reduced from 18px 20px */
  display: flex;
  flex-direction: column;
  gap: 8px;              /* reduced from 12px */
  transition: border-color 0.2s;
}
.margin-card:hover { border-color: var(--accent2); }

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

.margin-acc-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  flex-shrink: 0;        /* name never shrinks */
  min-width: 80px;
}

.margin-pct {
  font-family: var(--font-mono);
  font-size: 13px;	/* smaller than before 18px*/
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}
.margin-na {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
}

.margin-bar-track {
  width: 100%;
  /* flex: 1; */               /* bar takes all middle space */
  height: 10px;           /* slightly slimmer bar from 10px*/
  background: var(--bg3);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.margin-bar-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 0.6s ease;
}

.bar-green  { background: #00e096; color: #00e096; }
.bar-yellow { background: #ffc107; color: #ffc107; }
.bar-red    { background: #ff4d6d; color: #ff4d6d; }

.pct-green  { color: #00e096; }
.pct-yellow { color: #ffc107; }
.pct-red    { color: #ff4d6d; }

.margin-card-footer {
  display: flex;
  justify-content: space-between;
}

.margin-label {
  font-size: 12px;
  color: var(--muted);
}
.margin-label strong { color: var(--text); }
.value-red {
    color: #ff4d6d !important;
}

.value-green {
    color: #00e096 !important;
}
@media (max-width: 768px) {
  .margins-container { padding: 14px 16px; grid-template-columns: 1fr; }
}

/* ── Mobile Cards ────────────────────────────────────── */
.cards-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

/* ── Position Card ───────────────────────────────────── */
.pos-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, background 0.15s;
  animation: rowIn 0.25s ease forwards;
  opacity: 0;
}
.pos-card.selected-card {
  border-color: var(--accent2);
  background: rgba(108,99,255,0.07);
}

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

.pos-card-symbol {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.pos-card-symbol.profit { color: #00e096; }
.pos-card-symbol.loss   { color: #ff4d6d; }

.pos-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pos-card-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pos-card-label {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.pos-card-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.pos-card-value.profit { color: #00e096; }
.pos-card-value.loss   { color: #ff4d6d; }

/* ── Order Card ──────────────────────────────────────── */
.order-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: rowIn 0.25s ease forwards;
  opacity: 0;
}

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

.order-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

/* 3-column row for orders */
.order-card .pos-card-row {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Show cards on mobile, table on desktop */
@media (max-width: 768px) {
  #positionsTableContainer { display: none !important; }
  #positionsCards           { display: flex !important; }
  #ordersTableContainer     { display: none !important; }
  #ordersCards              { display: flex !important; }
}

@media (min-width: 769px) {
  #positionsCards { display: none !important; }
  #ordersCards    { display: none !important; }
}
.changed {
  transition: color 0.6s ease;
  color: var(--accent, #f0a500); /* or whatever highlight color you want */
}
/* ── Mobile layout overrides ─────────────────────────── */
@media (max-width: 768px) {

  /* Sidebar */
  .hamburger     { display: flex; }
  .sidebar-close { display: block; }
  .sidebar { position: fixed; left: -220px; top: 0; height: 100vh; width: 220px; z-index: 50; transition: left 0.25s; padding-top: 20px; }
  .sidebar.open  { left: 0; }

  /* Topbar — compact single row, hide title + LIVE */
  .topbar {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    padding: 8px 12px;
    gap: 8px;
  }
  .topbar-left  { flex: 0; gap: 6px; }
  .page-title   { display: none; }
  .live-indicator { display: none; }

  .topbar-right {
    flex: 1;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .from-account-wrap { flex: 1; gap: 4px; min-width: 0; }
  .from-account-label { display: none; }
  .account-dropdown-wrap { min-width: 0 !important; flex: 1; }
  .account-dropdown { font-size: 11px; padding: 6px 24px 6px 8px; }
  .topbar-btn-row { gap: 4px; flex-shrink: 0; }
  .icon-btn         { padding: 6px 8px; font-size: 11px; gap: 4px; }
  .login-btn-topbar { padding: 6px 8px; font-size: 11px; gap: 4px; }

  /* Positions toolbar + action bar — single merged row on mobile */
  .positions-toolbar {
    padding: 6px 10px;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
  }
  .positions-toolbar-left { gap: 5px; }

  /* Action bar — no separate row, flows into toolbar visually */
  .action-bar {
    padding: 0 10px 6px;
    background: rgba(108,99,255,0.06);
    border-bottom: 1px solid rgba(108,99,255,0.15);
    flex-wrap: wrap;
    gap: 5px;
    max-height: none;
  }
  .action-bar.visible {
    opacity: 1;
    max-height: 120px;
  }
  .action-bar-left  { display: none; } /* hide sno tags on mobile — saves space */
  .action-bar-right { flex-wrap: wrap; gap: 5px; }
  .action-btn { padding: 5px 8px; font-size: 11px; gap: 3px; }
  .action-btn svg { display: none; } /* hide icons on mobile to save space */

  /* Smaller cards */
  .cards-container { padding: 8px 10px; gap: 7px; }

  .pos-card {
    padding: 9px 11px;
    gap: 6px;
    border-radius: 10px;
  }
  .pos-card-symbol { font-size: 12px; }
  .pos-card-row    { gap: 6px; grid-template-columns: 1fr 1fr 1fr 1fr; }
  .pos-card-label  { font-size: 9px; }
  .pos-card-value  { font-size: 11px; }

  .order-card { padding: 9px 11px; gap: 6px; border-radius: 10px; }
  .order-card .pos-card-row { gap: 6px; }

  /* Modal bottom sheet */
  .modal { width: 100%; max-width: 100%; max-height: 85vh; margin: 0; border-radius: 18px 18px 0 0; position: relative; bottom: auto; left: 0; right: 0; }
  .modal-overlay {
	  display: none;
	  position: fixed;
	  top: 0; left: 0; right: 0; bottom: 0;
	  background: rgba(0, 0, 0, 0.6);
	  z-index: 1000;
	  align-items: center;
	  justify-content: center;
	}

	.modal-overlay.active {
	  display: flex;
	}
  .modal-wide { max-width: 100%; }
  .modal-body { padding: 12px 14px; }
  .modal-footer { padding: 10px 14px 14px; flex-wrap: wrap; }
  .modal-btn { flex: 1; justify-content: center; font-size: 12px; padding: 8px 12px; }

  /* Orders toolbar */
  .orders-toolbar { padding: 8px 12px; }
  .order-action-btn { padding: 3px 7px; font-size: 10px; }

  /* Toast */
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; font-size: 12px; }

  /* Stepper controls in modals */
  .step-btn { width: 24px; height: 24px; font-size: 14px; }
  .qty-stepper .qty-input { width: 64px; font-size: 12px; }
  .side-btn { padding: 4px 7px; font-size: 9px; }
  .odte-premium-grid { grid-template-columns: 1fr; }

  /* Positions toolbar — ODTE/Repeat buttons smaller */
  .odte-btn, .repeat-btn { padding: 5px 8px; font-size: 11px; }
}

/* ── Review Cards (mobile modal) ─────────────────────── */
.review-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.review-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.review-card-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-card-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.review-card-field .pos-card-label {
  min-width: 44px;
  font-size: 10px;
}

.review-card-field .qty-stepper { flex: 1; justify-content: flex-end; }
.review-card-field .qty-input   { width: 72px; font-size: 12px; }
.review-card-field .price-input { width: 90px; }

/* ── Dashboard Login Screen ─────────────────────────── */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 40px;
  width: 360px;
  max-width: 95vw;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.login-input {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.18s;
}
.login-input:focus { border-color: var(--accent2); }

.login-error {
  font-size: 12px;
  color: var(--loss);
  padding: 8px 12px;
  background: rgba(255,77,109,0.08);
  border: 1px solid rgba(255,77,109,0.2);
  border-radius: 6px;
}

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  background: linear-gradient(135deg, var(--accent2), #5a52e8);
  border: none;
  border-radius: 8px;
  color: white;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(108,99,255,0.35);
  margin-top: 4px;
}
.login-submit:hover { box-shadow: 0 4px 20px rgba(108,99,255,0.55); transform: translateY(-1px); }

/* ── Sidebar logout ──────────────────────────────────── */
.sidebar-footer-logout {
  padding: 14px 12px 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.logout-username {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(255,77,109,0.08);
  border: 1px solid rgba(255,77,109,0.2);
  border-radius: 6px;
  color: #ff4d6d;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.logout-btn:hover { background: rgba(255,77,109,0.16); }

/* ── ODTE leg cards ──────────────────────────────────── */
.odte-legs {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;    
  overflow-y: auto;	/* ←  so legs scroll instead of pushing footer out */
}

.odte-leg-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.odte-leg-type {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.odte-leg-type.profit { color: #00e096; }
.odte-leg-type.loss   { color: #ff4d6d; }

.odte-leg-field {
  display: flex;
  align-items: center;
  gap: 10px;
}
.odte-leg-field .pos-card-label { min-width: 50px; font-size: 10px; }
.odte-leg-field .account-dropdown-wrap { flex: 1; }
.odte-leg-field .account-dropdown { font-size: 12px; padding: 7px 28px 7px 10px; }



/* ── ODTE Step 2 layout new changes ───────────────────────────────── */

@media (min-width: 600px) {
  .odte-step2-body { padding: 0; display: flex; flex-direction: column; }
  .odte-step2-layout { display: flex; flex-direction: row; flex: 1; min-height: 0; height: 100%; }
  .odte-legs-wrap { flex: 1; overflow-y: auto; min-height: 0; padding: 20px 16px 20px 24px; }
  .odte-action-panel {
    width: 130px; flex-shrink: 0;
    display: flex; flex-direction: column;
    justify-content: flex-end;
	align-items: stretch;
    gap: 10px; padding: 20px 16px 20px 8px;
    border-left: 1px solid var(--border);
	position: sticky;
	top: 0;
  }
  .odte-action-panel .modal-btn { width: 100%; justify-content: center; }
}

@media (max-width: 599px) {
  .odte-step2-layout { flex-direction: column; }
  .odte-legs-wrap { padding: 16px; overflow-y: auto; flex: 1; min-height: 0; }
  .odte-action-panel {
    display: flex;flex-direction: row; justify-content: flex-end;
    align-items: center;gap: 10px; padding: 12px 16px;
    border-left: none; border-top: 1px solid var(--border);
    width: 100%;box-sizing: border-box;
  }
}

/* ── ODTE leg cards ───────────────────────────────────── */
.odte-legs { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; }
.odte-leg-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.odte-leg-header { display: flex; align-items: center; justify-content: space-between; }
.odte-leg-type { font-family: var(--font-mono); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; }