/* ==============================================================================
   TradeMate Commodity Cockpit - Scoped Stylesheet
   Theme: Clean Institutional Executive Light Theme Only (Rule 10 Compliant)
   Scope: app/pages/commodity/
   ============================================================================== */

:root {
  --cm-bg-page: #F8FAFC;
  --cm-bg-card: #FFFFFF;
  --cm-border-subtle: #E2E8F0;
  --cm-border-strong: #CBD5E1;
  --cm-text-dark: #0F172A;
  --cm-text-muted: #64748B;
  --cm-text-soft: #94A3B8;

  --cm-green: #059669;
  --cm-green-bg: #DCFCE7;
  --cm-green-text: #166534;
  --cm-green-border: #86EFAC;

  --cm-red: #DC2626;
  --cm-red-bg: #FEE2E2;
  --cm-red-text: #991B1B;
  --cm-red-border: #FCA5A5;

  --cm-amber: #D97706;
  --cm-amber-bg: #FEF3C7;
  --cm-amber-text: #92400E;
  --cm-amber-border: #FCD34D;

  --cm-blue: #0284C7;
  --cm-blue-bg: #E0F2FE;
  --cm-blue-text: #0369A1;
  --cm-blue-border: #7DD3FC;

  --cm-purple: #7C3AED;
  --cm-purple-bg: #F3E8FF;
  --cm-purple-text: #6D28D9;
  --cm-purple-border: #D8B4FE;

  --cm-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --cm-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07);
  --cm-radius-sm: 4px;
  --cm-radius-md: 8px;
  --cm-radius-lg: 12px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.cm-body {
  background-color: var(--cm-bg-page);
  color: var(--cm-text-dark);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  min-height: 100vh;
  padding-bottom: 60px;
  -webkit-font-smoothing: antialiased;
}

/* ==============================================================================
   1. APP HEADER BAR (Light Theme Only)
   ============================================================================== */
.cm-header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--cm-border-subtle);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.cm-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cm-btn-back-hub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F1F5F9;
  border: 1px solid var(--cm-border-subtle);
  color: var(--cm-text-dark);
  padding: 5px 12px;
  border-radius: var(--cm-radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}
.cm-btn-back-hub:hover {
  background: #E2E8F0;
  border-color: var(--cm-border-strong);
  color: var(--cm-blue-text);
}

.cm-brand-title {
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--cm-text-dark);
  letter-spacing: -0.02em;
}

.cm-brand-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  margin-right: 8px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.cm-brand-icon-rose {
  background: #FFE4E6;
  color: #E11D48;
}

.cm-brand-icon-purple {
  background: #EDE9FE;
  color: #7C3AED;
}

.cm-title-full {
  display: inline;
}

.cm-title-mobile {
  display: none;
}

.cm-header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.cm-header-center-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  padding: 4px 12px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, "Segoe UI Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  white-space: nowrap;
}

.cm-pill-sep {
  color: #CBD5E1;
  font-weight: 400;
}

.cm-header-center-pill .cm-timer-bold {
  color: #0284C7;
  font-weight: 700;
}

.cm-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cm-btn-hub {
  font-weight: 700;
  color: var(--cm-blue-text);
  background: var(--cm-blue-bg);
  border-color: var(--cm-blue-border);
}
.cm-btn-hub:hover {
  background: #BAE6FD;
}

.cm-btn-broker {
  font-weight: 700;
  color: #064E3B;
  background: #ECFDF5;
  border: 1.5px solid #86EFAC;
}
.cm-btn-broker:hover {
  background: #D1FAE5;
  border-color: #4ADE80;
}
.cm-btn-broker.cm-broker-disc {
  color: #92400E;
  background: #FFFBEB;
  border: 1.5px solid #FCD34D;
}
.cm-btn-broker.cm-broker-disc:hover {
  background: #FEF3C7;
  border-color: #F59E0B;
}

.cm-clock-display {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--cm-text-muted);
  background: #F8FAFC;
  border: 1px solid var(--cm-border-subtle);
  padding: 5px 10px;
  border-radius: var(--cm-radius-sm);
}

.cm-chip-btn {
  background: #FFFFFF;
  border: 1px solid var(--cm-border-subtle);
  color: var(--cm-text-dark);
  padding: 5px 11px;
  border-radius: var(--cm-radius-sm);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.cm-chip-btn:hover {
  background: #F8FAFC;
  border-color: var(--cm-border-strong);
}

.cm-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.cm-dot-green { background: var(--cm-green); box-shadow: 0 0 0 2px var(--cm-green-bg); }
.cm-dot-orange { background: var(--cm-amber); box-shadow: 0 0 0 2px var(--cm-amber-bg); }
.cm-dot-red { background: var(--cm-red); box-shadow: 0 0 0 2px var(--cm-red-bg); }

/* ==============================================================================
   2. COMMODITY STRATEGY CARD CONTAINER
   ============================================================================== */
.cm-main-container {
  max-width: 1560px;
  margin: 18px auto;
  padding: 0 20px;
}

.cm-card-wrapper {
  background: var(--cm-bg-card);
  border: 1px solid var(--cm-border-subtle);
  border-top: 4px solid var(--cm-blue);
  border-radius: var(--cm-radius-md);
  box-shadow: var(--cm-shadow-sm);
  overflow: hidden;
  margin-bottom: 16px;
}

/* 2. Standalone Performance Summary KPI Card */
.cm-summary-kpi-card {
  background: #FFFFFF;
  border: 1px solid var(--cm-border-subtle);
  border-top: 4px solid var(--cm-blue);
  border-radius: var(--cm-radius-md);
  box-shadow: var(--cm-shadow-sm);
  margin-bottom: 16px;
  padding: 12px 14px;
  overflow: hidden;
}

.cm-summary-kpi-card .pnl-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 0;
}

/* Control Bar */
.cm-control-bar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--cm-border-subtle);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cm-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cm-bar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.cm-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cm-timer-display {
  font-size: 12px;
  color: var(--cm-text-muted);
  background: #F8FAFC;
  border: 1px solid var(--cm-border-subtle);
  padding: 4px 10px;
  border-radius: var(--cm-radius-sm);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cm-header-timer {
  margin-left: 6px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  font-size: 11.5px;
  padding: 3px 9px;
  white-space: nowrap;
}
.cm-timer-bold {
  color: var(--cm-blue-text);
  font-weight: 700;
}

.cm-sentiment-capsule,
.sentiment-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #F8FAFC;
  border: 1px solid var(--cm-border-subtle);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.cm-bulls-cnt,
.count-bulls {
  color: #059669;
  font-weight: 700;
  font-size: 13px;
}
.cm-bears-cnt,
.count-bears {
  color: #DC2626;
  font-weight: 700;
  font-size: 13px;
}

.cm-pill-trend,
.sentiment-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
  user-select: none;
}

/* Net Bearish - exact theme from user screenshot */
.cm-pill-trend.cm-trend-bear,
.sentiment-pill.pill-bearish {
  background: #FEE2E2 !important;
  color: #991B1B !important;
  border: 1px solid #FCA5A5 !important;
}

/* Net Bullish - green theme requested by user */
.cm-pill-trend.cm-trend-bull,
.sentiment-pill.pill-bullish {
  background: #D1FAE5 !important;
  color: #065F46 !important;
  border: 1px solid #86EFAC !important;
}

/* Neutral */
.cm-pill-trend.cm-trend-neut,
.sentiment-pill.pill-neutral {
  background: #F1F5F9 !important;
  color: #475569 !important;
  border: 1px solid #CBD5E1 !important;
}

.cm-meta-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--cm-radius-sm);
  background: #F1F5F9;
  border: 1px solid var(--cm-border-subtle);
  color: var(--cm-text-dark);
}
.cm-pill-fixed {
  background: var(--cm-blue-bg);
  color: var(--cm-blue-text);
  border-color: var(--cm-blue-border);
}
.cm-pill-rollover {
  background: var(--cm-purple-bg);
  color: var(--cm-purple-text);
  border-color: var(--cm-purple-border);
}

.cm-select-ctrl {
  background: #FFFFFF;
  border: 1px solid var(--cm-border-subtle);
  color: var(--cm-text-dark);
  padding: 5px 10px;
  border-radius: var(--cm-radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}
.cm-select-ctrl:focus {
  border-color: var(--cm-blue);
}

.cm-btn-action {
  background: #FFFFFF;
  border: 1px solid var(--cm-border-subtle);
  color: var(--cm-text-dark);
  padding: 5px 12px;
  border-radius: var(--cm-radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.cm-btn-action:hover {
  background: #F8FAFC;
  border-color: var(--cm-border-strong);
}
.cm-btn-primary {
  background: var(--cm-blue);
  color: #FFFFFF;
  border-color: var(--cm-blue);
}
.cm-btn-primary:hover {
  background: #0369A1;
}

/* ==============================================================================
   3. WATCHLIST TABLE (All Center Aligned Data & Headers)
   ============================================================================== */
.cm-table-responsive {
  overflow-x: auto;
  background: #FFFFFF;
}

.cm-watchlist-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

.cm-watchlist-tbl thead th {
  background: #F8FAFC;
  color: var(--cm-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--cm-border-subtle);
  text-align: center;
}

.cm-watchlist-tbl tbody tr.cm-row-item {
  border-bottom: 1px solid var(--cm-border-subtle);
  transition: background 0.15s ease;
  background: #FFFFFF;
}
.cm-watchlist-tbl tbody tr.cm-row-item:hover {
  background: #F8FAFC;
}
.cm-watchlist-tbl tbody tr.cm-row-item.expanded-active {
  background: #F0F9FF;
  border-bottom: 1px solid var(--cm-blue);
}

.cm-watchlist-tbl tbody td {
  padding: 11px 12px;
  vertical-align: middle;
  text-align: center;
}

/* Script Column with Icon & Name */
.cm-script-col {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  cursor: pointer;
}
.cm-script-icon {
  font-size: 14px;
}
.cm-script-title {
  font-weight: 700;
  color: #1E293B;
  font-size: 13px;
}
.cm-script-title:hover {
  color: var(--cm-blue);
}
.cm-script-link {
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}
.cm-script-link:hover {
  color: #2563EB;
  text-decoration: underline;
}

/* Time Cell */
.cm-time-cell {
  font-size: 12px;
  color: #64748B;
  font-weight: 600;
}

/* Price (%) Combo Column */
.cm-price-combo {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}
.cm-price-main {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 800;
  font-size: 13px;
  color: #0F172A;
}
.cm-price-pct {
  font-size: 11px;
  font-weight: 700;
}
.cm-price-pct.cm-val-pos { color: #16A34A; }
.cm-price-pct.cm-val-neg { color: #DC2626; }
.cm-price-pct.cm-val-zero { color: #64748B; }

/* Support & Resistance Levels */
.cm-val-support {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 800;
  font-size: 13px;
  color: #16A34A;
}
.cm-val-resistance {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 800;
  font-size: 13px;
  color: #DC2626;
}

/* Green Action Trade Button */
.cm-btn-trade {
  background: #059669;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 18px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}
.cm-btn-trade:hover {
  background: #047857;
  transform: translateY(-1px);
}

/* Cell Badges with Dots & Emojis matching screenshot */
.cm-cell-badge {
  font-size: 12px;
  font-weight: 700;
}
.cm-cell-badge.cm-text-bullish { color: #16A34A; }
.cm-cell-badge.cm-text-bearish { color: #DC2626; }
.cm-cell-badge.cm-text-neutral { color: #D97706; }

.cm-cell-score {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 13px;
  font-weight: 800;
}
.cm-cell-score.cm-val-pos { color: #16A34A; }
.cm-cell-score.cm-val-neg { color: #DC2626; }
.cm-cell-score.cm-val-zero { color: #64748B; }

/* Sortable column header */
.cm-th-sortable:hover {
  color: var(--cm-blue-text);
}

/* Shooniya Daily Symbol Master Modal */
.cm-modal-box.cm-modal-lg {
  max-width: 820px;
}
.cm-master-sync-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 10px 14px;
}
.cm-master-meta {
  display: flex;
  gap: 24px;
  font-size: 12px;
  color: #475569;
}
.cm-meta-label {
  font-weight: 600;
  color: #64748B;
  margin-right: 4px;
}
.cm-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 80px;
  overflow-y: auto;
  padding: 4px 0;
}
.cm-chip-tag {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #334155;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cm-chip-tag:hover, .cm-chip-tag.active {
  background: #0284C7;
  color: #FFFFFF;
  border-color: #0284C7;
}
.cm-badge-added {
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  background: #D1FAE5;
  padding: 2px 8px;
  border-radius: 4px;
}

.cm-script-chart-link {
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  transition: transform 0.15s ease;
}
.cm-script-chart-link:hover {
  transform: scale(1.25);
}

.cm-btn-open-tv {
  background: #E0F2FE;
  border: 1.5px solid #BAE6FD;
  color: #0284C7;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cm-btn-open-tv:hover {
  background: #BAE6FD;
  border-color: #7DD3FC;
  color: #0369A1;
}

.cm-resolve-match-card {
  background: #F0FDF4;
  border: 1.5px solid #BBF7D0;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 10px;
  margin-bottom: 8px;
  animation: fadeInResolve 0.2s ease-in-out;
}
@keyframes fadeInResolve {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.cm-resolve-match-title {
  font-size: 11px;
  font-weight: 800;
  color: #166534;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.cm-resolve-match-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: #14532D;
}
.cm-resolve-match-grid strong {
  color: #0F172A;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.cm-modal-scripts-tbl tbody td {
  padding: 8px 10px;
  font-size: 12px;
  vertical-align: middle;
}

/* ==============================================================================
   4. INLINE MCX CONTRACTS DRAWER
   ============================================================================== */
.cm-drawer-row {
  display: none;
  background: #F8FAFC;
}
.cm-drawer-row.cm-drawer-open {
  display: table-row;
  animation: fadeInDrawer 0.2s ease-in-out;
}

@keyframes fadeInDrawer {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.cm-drawer-cell {
  padding: 0 !important;
  border-bottom: 2px solid var(--cm-blue) !important;
}

.cm-drawer-inner {
  padding: 16px 22px;
  background: #F8FAFC;
  border-left: 4px solid var(--cm-blue);
}

.cm-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--cm-border-subtle);
}

.cm-drawer-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--cm-text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cm-contracts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #FFFFFF;
  border-radius: var(--cm-radius-sm);
  overflow: hidden;
  border: 1px solid var(--cm-border-strong);
  box-shadow: var(--cm-shadow-sm);
}

.cm-contracts-table thead th {
  background: #F1F5F9;
  color: var(--cm-text-dark);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 9px 12px;
  border-bottom: 1px solid var(--cm-border-strong);
  text-align: center;
}

.cm-contracts-table tbody tr {
  border-bottom: 1px solid var(--cm-border-subtle);
  background: #FFFFFF;
}
.cm-contracts-table tbody tr:last-child {
  border-bottom: none;
}
.cm-contracts-table tbody tr:hover {
  background: #F8FAFC;
}
.cm-contracts-table td {
  padding: 11px 12px;
  vertical-align: middle;
  text-align: center;
}

.cm-cycle-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
}
.cm-cycle-current { background: var(--cm-blue-bg); color: var(--cm-blue-text); border: 1px solid var(--cm-blue-border); }
.cm-cycle-next { background: var(--cm-purple-bg); color: var(--cm-purple-text); border: 1px solid var(--cm-purple-border); }

.cm-dte-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 800;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.cm-dte-safe { background: var(--cm-green-bg); color: var(--cm-green-text); border: 1px solid var(--cm-green-border); }
.cm-dte-warn { background: var(--cm-amber-bg); color: var(--cm-amber-text); border: 1px solid var(--cm-amber-border); }

.cm-pos-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.cm-pos-long { background: var(--cm-green-bg); color: var(--cm-green-text); border: 1px solid var(--cm-green-border); }
.cm-pos-short { background: var(--cm-red-bg); color: var(--cm-red-text); border: 1px solid var(--cm-red-border); }
.cm-pos-flat { background: #F1F5F9; color: var(--cm-text-muted); border: 1px solid var(--cm-border-subtle); }

.cm-exec-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cm-side-group {
  display: inline-flex;
  border: 1px solid var(--cm-border-strong);
  border-radius: 4px;
  overflow: hidden;
}
.cm-btn-side {
  padding: 4px 10px;
  border: none;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  background: #FFFFFF;
  color: var(--cm-text-muted);
}
.cm-btn-side.active-buy { background: var(--cm-green); color: #FFFFFF; }
.cm-btn-side.active-sell { background: var(--cm-red); color: #FFFFFF; }

.cm-inp-num {
  width: 78px;
  padding: 4px 6px;
  border: 1px solid var(--cm-border-strong);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
}

.cm-btn-submit-order {
  background: var(--cm-blue);
  color: #FFFFFF;
  border: none;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cm-btn-submit-order:hover {
  background: #0369A1;
}

/* ==============================================================================
   5. OPERATIONS LEDGER (Dedicated Second Table)
   ============================================================================== */
.cm-ledger-wrapper {
  background: var(--cm-bg-card);
  border: 1px solid var(--cm-border-subtle);
  border-radius: var(--cm-radius-md);
  box-shadow: var(--cm-shadow-sm);
  overflow: hidden;
}

.cm-ledger-header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--cm-border-subtle);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.cm-ledger-tabs {
  display: flex;
  gap: 6px;
}

.cm-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--cm-text-muted);
  padding: 6px 14px;
  border-radius: var(--cm-radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.cm-tab-btn:hover {
  background: #F8FAFC;
  color: var(--cm-text-dark);
}
.cm-tab-btn.active {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: var(--cm-blue-text);
}

.cm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 14px 16px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--cm-border-subtle);
}

.cm-kpi-card {
  background: #FFFFFF;
  border: 1px solid var(--cm-border-subtle);
  border-radius: var(--cm-radius-sm);
  padding: 10px 14px;
}
.cm-kpi-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--cm-text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.cm-kpi-val {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 16px;
  font-weight: 800;
  color: var(--cm-text-dark);
}

/* ==============================================================================
   6. MODAL OVERLAYS (Light Theme)
   ============================================================================== */
.cm-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cm-modal-overlay.active {
  display: flex;
}

.cm-modal-box {
  background: #FFFFFF;
  border-radius: var(--cm-radius-md);
  border: 1px solid var(--cm-border-subtle);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.cm-modal-hdr {
  padding: 14px 18px;
  border-bottom: 1px solid var(--cm-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cm-modal-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--cm-text-dark);
}
.cm-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--cm-text-muted);
}
.cm-modal-body {
  padding: 18px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .cm-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .cm-title-full {
    display: none;
  }
  .cm-title-mobile {
    display: inline;
  }
  .cm-kpi-grid {
    grid-template-columns: 1fr;
  }
  .cm-clock-display {
    display: none;
  }
}

/* ==============================================================================
   7. LOGIN GATE / SECURITY OVERLAY
   ============================================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.login-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 400px;
  padding: 32px;
  animation: fadeInCard 0.25s ease-out;
}

@keyframes fadeInCard {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.login-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.login-header p {
  font-size: 0.85rem;
  color: #64748b;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper .text-input {
  width: 100%;
  padding: 10px 40px 10px 12px;
  font-size: 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.password-input-wrapper .text-input:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.btn-toggle-pwd {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  color: #64748b;
}

.btn-toggle-pwd:hover {
  color: #1e293b;
}

.login-error {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.btn-login-submit {
  width: 100%;
  padding: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #059669;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-login-submit:hover {
  background-color: #047857;
}

.btn-login-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==============================================================================
   TRADEMATE EXECUTIVE STYLES (RANK, MOMENTUM METER, BADGES, PIVOTS, OEMS)
   ============================================================================== */

/* Col 3: RANK with Delta Indicator */
.col-rank, .cell-rank {
  text-align: center !important;
  min-width: 65px;
}
.rank-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-weight: 700;
  font-size: 13px;
}
.rank-wrap.up, .rank-wrap.up .rank-num, .rank-wrap.up .rank-arrow {
  color: #059669 !important;
}
.rank-wrap.down, .rank-wrap.down .rank-num, .rank-wrap.down .rank-arrow {
  color: #DC2626 !important;
}
.rank-wrap.same .rank-num {
  color: #0F172A !important;
}
.rank-wrap.same .rank-arrow, .rank-dash-blue {
  display: inline-block;
  width: 8px;
  height: 2px;
  background-color: #0284C7;
  border-radius: 1px;
}

/* Col 4: DUAL-SIDED HORIZONTAL MOMENTUM SCORE METER */
.col-score, .cell-score {
  text-align: center !important;
  min-width: 145px;
}
.score-row-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.score-meter-track {
  width: 64px;
  height: 6px;
  background: #E2E8F0;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}
.score-zero-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: #64748B;
  z-index: 2;
}
.score-fill-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  transition: width 0.3s ease, left 0.3s ease;
}
.score-fill-pos {
  background: #059669;
}
.score-fill-neg {
  background: #DC2626;
}
.score-val-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  min-width: 48px;
  justify-content: flex-end;
}
.score-val-pos {
  color: #059669;
}
.score-val-neg {
  color: #DC2626;
}
.score-val-zero {
  color: #64748B;
}
.score-arrow-up {
  color: #059669;
  font-size: 10px;
  line-height: 1;
}
.score-arrow-down {
  color: #DC2626;
  font-size: 10px;
  line-height: 1;
}

/* Col 5 & 6: TREND & WAROC (2D Status Badges) */
.col-trend, .cell-trend, .col-waroc, .cell-waroc {
  text-align: center !important;
  min-width: 100px;
}
.badge-status-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.badge-status-box .badge-status-txt {
  font-weight: 700;
}
.badge-status-box .badge-status-icon {
  font-size: 11px;
}
.badge-status-green {
  color: #166534;
}
.badge-status-red {
  color: #991B1B;
}
.badge-status-gray {
  color: #475569;
}

/* Col 7: ZONE (Bollinger Bands Volatility Envelopes) */
.col-zone, .cell-zone {
  text-align: center !important;
  min-width: 80px;
}
.badge-bb-zone {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.3;
  white-space: nowrap;
}
.bb-zone-upper, .bb-zone-u2, .bb-zone-u1, .bb-zone-u0 {
  color: #16A34A !important;
}
.bb-zone-lower, .bb-zone-l2, .bb-zone-l1, .bb-zone-l0 {
  color: #DC2626 !important;
}
.bb-zone-neutral {
  color: #64748B !important;
}

/* Col 8 & 9: SUPPORT & RESISTANCE with Inline Double-Click Edit */
.col-res, .cell-res, .col-sup, .cell-sup {
  text-align: right !important;
  min-width: 105px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.cell-res:hover, .cell-sup:hover {
  background: rgba(2, 132, 199, 0.08);
}
.pivot-val-box {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}
.pivot-val-res {
  color: #DC2626;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
}
.pivot-val-sup {
  color: #059669;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
}
.pivot-edit-form {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: flex-end;
}
.pivot-input {
  width: 80px;
  padding: 2px 5px;
  font-size: 11px;
  font-family: monospace;
  font-weight: 700;
  border: 1.5px solid #0284C7;
  border-radius: 4px;
  outline: none;
  text-align: right;
  background: #FFFFFF;
  color: #0F172A;
}
.pivot-btn-save {
  background: #0284C7;
  color: #FFFFFF;
  border: none;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.pivot-btn-cancel {
  background: #E2E8F0;
  color: #475569;
  border: none;
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 10px;
  cursor: pointer;
}

/* Col 10: ACTION BUTTONS (Stateful colors) */
.btn-action-col {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-width: 72px;
  text-align: center;
  box-sizing: border-box;
}
.btn-act-entry {
  background: #10B981 !important;
  color: #FFFFFF !important;
}
.btn-act-entry:hover {
  background: #059669 !important;
}
.btn-act-exit {
  background: #EF4444 !important;
  color: #FFFFFF !important;
}
.btn-act-exit:hover {
  background: #DC2626 !important;
}
.btn-act-hold-bull {
  background: #10B981 !important;
  color: #FFFFFF !important;
}
.btn-act-hold-bear {
  background: #EF4444 !important;
  color: #FFFFFF !important;
}
.btn-act-rollover {
  background: #7C3AED !important;
  color: #FFFFFF !important;
}
.btn-act-rollover:hover {
  background: #6D28D9 !important;
}
.btn-act-review {
  background: #7C3AED !important;
  color: #FFFFFF !important;
}
.btn-act-review:hover {
  background: #6D28D9 !important;
}
.btn-act-open {
  background: #16A34A !important;
  color: #FFFFFF !important;
}
.btn-act-open:hover {
  background: #15803D !important;
}
.btn-act-trade {
  background: #0284C7 !important;
  color: #FFFFFF !important;
}
.btn-act-trade:hover {
  background: #0369A1 !important;
}
.btn-act-notrade {
  background: #F1F5F9 !important;
  color: #64748B !important;
  border: 1px solid #CBD5E1 !important;
}

/* OEMS 1-CLICK ACTIONS IN CONTRACT DRAWER */
.cm-btn-oems {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.btn-oems-add {
  background: #0284C7;
  color: #FFFFFF;
}
.btn-oems-add:hover {
  background: #0369A1;
}
.btn-oems-exit {
  background: #EF4444;
  color: #FFFFFF;
}
.btn-oems-exit:hover {
  background: #DC2626;
}
.btn-oems-rollover {
  background: #7C3AED;
  color: #FFFFFF;
}
.btn-oems-rollover:hover {
  background: #6D28D9;
}

/* TENDER & DTE BADGES */
.dte-tender {
  background: #FEE2E2 !important;
  color: #991B1B !important;
  border: 1px solid #FCA5A5 !important;
  font-weight: 800;
}
.dte-warning {
  background: #FEF3C7 !important;
  color: #92400E !important;
  border: 1px solid #FCD34D !important;
  font-weight: 700;
}
.dte-safe {
  background: #DCFCE7 !important;
  color: #166534 !important;
  border: 1px solid #86EFAC !important;
  font-weight: 700;
}
.cycle-current {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
  font-weight: 700;
}
.cycle-next {
  background: #F3E8FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
  font-weight: 700;
}

/* ==============================================================================
   EXACT TRADEMATE CONTRACTS DRAWER STYLES
   ============================================================================== */
.drawer-inner-box.cs-pale-drawer {
  padding: 10px 14px 14px 14px !important;
  background: #F0F7FF !important;
}

.desktop-contracts-view {
  display: block;
}
.mobile-contracts-view {
  display: none;
}

.drawer-balance-badge {
  font-family: inherit;
  font-size: 11px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  padding: 4px 10px;
  border-radius: 4px;
  color: #64748B;
  font-weight: 600;
}

.drawer-balance-val {
  color: #0369A1;
  font-weight: 700;
  margin-left: 4px;
}

.contracts-sub-table {
  width: 100%;
  table-layout: fixed;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 12px !important;
  white-space: nowrap;
  background: #F0F7FF !important;
  border-radius: 6px;
  overflow: hidden;
}

.contracts-sub-table thead th {
  background: #E0F2FE !important;
  color: #475569 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  font-family: inherit !important;
  padding: 10px 12px;
  border-bottom: 1.5px solid #BFDBFE !important;
  text-align: center;
}

.contracts-sub-table tbody tr,
.contracts-sub-table tbody tr td {
  border-bottom: 1px solid #E2E8F0;
  transition: background 0.15s ease;
  background: #F0F7FF !important;
}
.contracts-sub-table tbody tr:last-child,
.contracts-sub-table tbody tr:last-child td {
  border-bottom: none;
}
.contracts-sub-table tbody tr:hover,
.contracts-sub-table tbody tr:hover td {
  background: #E0F2FE !important;
}

.contracts-sub-table td {
  padding: 8px 10px;
  vertical-align: middle;
  text-align: center;
  font-size: 12px !important;
  background: #F0F7FF !important;
}

.contract-sym-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.contract-tsym {
  font-weight: 800;
  color: #0F172A;
  font-size: 13px;
  letter-spacing: 0.2px;
}
.contract-cycle-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  width: fit-content;
}

.expiry-dte-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.expiry-date-text {
  font-weight: 700;
  color: #0F172A;
  font-size: 12px;
}
.dte-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 10px;
  font-family: inherit;
  width: fit-content;
}

.execution-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.exec-row-1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.side-toggle-group {
  display: inline-flex;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  overflow: hidden;
  background: #FFFFFF;
  width: 96px;
  box-sizing: border-box;
}
.side-btn {
  flex: 1;
  padding: 4px 0;
  text-align: center;
  border: none;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  background: transparent;
  color: #64748B;
  transition: all 0.15s ease;
}
.side-btn.active-buy {
  background: #059669;
  color: #FFFFFF;
}
.side-btn.active-sell {
  background: #DC2626;
  color: #FFFFFF;
}

.input-with-label {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  padding: 2px 6px;
}
.input-field-lbl {
  font-size: 10px;
  color: #94A3B8;
  font-weight: 700;
  text-transform: uppercase;
}
.exec-num-input {
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  color: #0F172A;
  text-align: right;
}
.exec-num-input:focus {
  outline: none;
}
.input-limit-price {
  width: 72px;
}

.qty-stepper-box {
  display: inline-flex;
  align-items: center;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  overflow: hidden;
  background: #FFFFFF;
}
.qty-step-btn {
  background: #F1F5F9;
  color: #0F172A;
  border: none;
  padding: 4px 7px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.qty-step-btn:hover {
  background: #E2E8F0;
}
.qty-val-input {
  width: 60px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  color: #0F172A;
  padding: 4px 2px;
}
.qty-val-input:focus {
  outline: none;
}

.exec-val-pill {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 700;
  color: #0F172A;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 148px;
  width: auto;
  box-sizing: border-box;
}
.exec-val-label {
  font-size: 10px;
  color: #64748B;
  font-weight: 600;
  text-transform: uppercase;
}

.exec-row-2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.btn-exec-action {
  padding: 6px 18px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  min-height: 30px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
}

.btn-exec-add {
  background: #0284C7;
  color: #FFFFFF;
  border-color: #0284C7;
}
.btn-exec-add:hover:not(:disabled) {
  background: #0369A1;
}

.btn-exec-exit {
  background: #FEE2E2;
  color: #991B1B;
  border-color: #FCA5A5;
}
.btn-exec-exit:hover:not(:disabled) {
  background: #FCA5A5;
}

/* ==============================================================================
   EXACT TRADEMATE OPERATIONS LEDGER CARD & TABLES (ALL 5 TABS)
   ============================================================================== */
.operations-ledger-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-top: 4px solid var(--cm-blue);
  border-radius: var(--cm-radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  margin-top: 0;
  margin-bottom: 24px;
  overflow: hidden;
  transition: all 0.2s ease-in-out;
}

/* Minimized / Collapsed state for Operations Ledger */
.operations-ledger-card.is-minimized .operations-ledger-body {
  display: none !important;
}

/* Desktop: Hide mobile card cells */
.perf-mobile-card-cell,
.tradelog-mobile-card-cell,
.act-mobile-card-cell {
  display: none !important;
}

.operations-ledger-card.is-minimized .operations-ledger-header {
  border-bottom: none;
}

.operations-ledger-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #F8FAFC;
  border-bottom: 1.5px solid #E2E8F0;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 44px;
}

.ledger-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ledger-tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.ledger-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  user-select: none;
}

.ledger-tab-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.ledger-tab-btn.active {
  background: #FFFFFF;
  color: #0284C7;
  border-color: #CBD5E1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-weight: 700;
}

.ledger-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ledger-search-box-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 5px;
  padding: 0 6px;
  height: 28px;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.ledger-search-box-wrap:focus-within {
  border-color: #0284C7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.ledger-search-icon {
  font-size: 11px;
  color: #64748B;
  margin-right: 4px;
  user-select: none;
  pointer-events: none;
}

.ledger-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 11.5px;
  font-family: inherit;
  color: #0F172A;
  width: 150px;
  transition: width 0.2s ease;
  padding: 0;
}

.ledger-search-input:focus {
  width: 180px;
}

.ledger-search-input::placeholder {
  color: #94A3B8;
  font-size: 11px;
}

.ledger-search-clear {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  margin-left: 2px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ledger-search-clear:hover {
  color: #EF4444;
}

.ledger-btn-action {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #334155;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.ledger-btn-action:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #94A3B8;
}

.ledger-sub-bar {
  display: none !important;
}

.ledger-sub-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.strategy-log-cnt-badge {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.ledger-tbl-wrapper {
  border-top: 1px solid #E2E8F0;
  max-height: 340px;
  overflow-y: auto;
  overflow-x: auto;
  background: #FFFFFF;
}

/* 1. OPERATIONS TRADELOG TABLE */
.tradelog-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto !important;
  font-size: 12px;
}

.tradelog-table thead th {
  background: #F8FAFC;
  color: #475569;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 8px 10px;
  border-bottom: 1px solid #CBD5E1;
  position: sticky;
  top: 0;
  z-index: 5;
  white-space: nowrap;
}

.tradelog-table td {
  vertical-align: middle;
  border-bottom: 1px solid #F1F5F9;
}

.tradelog-table tbody tr:hover td {
  background: #F8FAFC;
}

/* 2. STRATEGY ACTIVITY TABLE */
.strat-act-log-tbl {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.strat-act-log-tbl thead th {
  background: #F8FAFC;
  color: #475569;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 7px 12px;
  border-bottom: 1px solid #E2E8F0;
  position: sticky;
  top: 0;
  z-index: 5;
}

.strat-act-log-tbl td {
  padding: 7px 12px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.strat-act-log-tbl tbody tr:last-child td {
  border-bottom: none;
}

.strat-act-log-tbl tbody tr:hover td {
  background: #F8FAFC;
}

.strat-act-log-tbl .col-time {
  width: 120px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: #000000;
  white-space: nowrap;
}

.strat-act-log-tbl .col-event {
  width: 180px;
  white-space: nowrap;
}

.strat-act-log-tbl .col-details,
.strat-act-log-tbl .col-message {
  color: #1E293B;
  line-height: 1.4;
  word-break: break-word;
}

.badge-tg-failed {
  display: inline-inline-flex;
  align-items: center;
  gap: 3px;
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.badge-act-event {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.badge-strat-alert {
  background: #EEF2FF;
  color: #4F46E5;
  border: 1px solid #C7D2FE;
}
.badge-pos-alert {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}
.badge-order-alert {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}
.badge-tg-alert {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}
.badge-scan-alert {
  background: #F0F9FF;
  color: #0284C7;
  border: 1px solid #BAE6FD;
}

.log-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.log-type-auto {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}
.log-type-manual {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.log-event-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2.5px 8px;
  border-radius: 4px;
}
.log-evt-sync { background: #E0F2FE; color: #0369A1; border: 1px solid #BAE6FD; }
.log-evt-alert { background: #EDE9FE; color: #6B21A8; border: 1px solid #D8B4FE; }
.log-evt-trade { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.log-evt-config { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }
.log-evt-broker { background: #F1F5F9; color: #334155; border: 1px solid #CBD5E1; }
.log-evt-default { background: #F8FAFC; color: #475569; border: 1px solid #E2E8F0; }

.log-res-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}
.log-res-success { background: #DCFCE7; color: #166534; border: 1px solid #86EFAC; }
.log-res-filled { background: #DCFCE7; color: #166534; border: 1px solid #86EFAC; }
.log-res-failed { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.log-res-rejected { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.log-res-partial { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.log-res-pending { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.log-res-alert { background: #EDE9FE; color: #5B21B6; border: 1px solid #C4B5FD; }
.log-res-warning { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }

/* 2. P&L KPI CARDS */
.pnl-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.pnl-kpi-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.pnl-kpi-label {
  font-size: 10px;
  font-weight: 800;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pnl-kpi-val {
  font-size: 15px;
  font-weight: 800;
  color: #1E293B;
  margin-top: 3px;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

/* 3. SNAPSHOT ACCORDION SUBROW */
.tradelog-row-clickable {
  cursor: pointer;
}
.tradelog-row-clickable:hover {
  background: #F0F9FF !important;
}
.tradelog-subrow {
  background: #FAFAFA;
}
.snapshot-accordion-box {
  padding: 12px 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  margin: 6px 10px;
}
.snapshot-accordion-title {
  font-size: 11px;
  font-weight: 700;
  color: #0284C7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.snapshot-grid-item {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  padding: 6px 8px;
}
.snapshot-grid-item-label {
  font-size: 9px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.snapshot-grid-item-val {
  font-size: 11px;
  font-weight: 600;
  color: #1E293B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-wl-logs-pill {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  color: #0284C7;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
}
.btn-wl-logs-pill:hover {
  background: #E0F2FE;
  border-color: #7DD3FC;
}

/* ==============================================================================
   10. MOBILE VIEWPORT CUSTOMIZATION (<= 768px)
   ============================================================================== */
@media (max-width: 768px) {
  /* Header: Next Scan information not required on mobile view */
  #cm-timer-display,
  .cm-header-timer {
    display: none !important;
  }

  /* Page Padding & Spacing */
  .cm-main-container {
    padding: 8px 6px !important;
  }

  /* 1. Top P&L KPI Cards: Show only Realized P&L and Open MTM P&L */
  .cm-summary-kpi-card .pnl-summary-cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
  }
  .cm-summary-kpi-card .kpi-card-winrate,
  .cm-summary-kpi-card .kpi-card-trades {
    display: none !important;
  }
  .cm-summary-kpi-card .pnl-kpi-card {
    padding: 8px 6px !important;
  }
  .cm-summary-kpi-card .pnl-kpi-val {
    font-size: 14px !important;
  }

  /* 2. Strategy Cockpit Control Bar: Show only Bulls/Sentiment/Bears & Refresh */
  .cm-control-bar {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 10px !important;
  }
  .cm-bar-left {
    display: none !important;
  }
  #cm-btn-symbol {
    display: none !important;
  }
  .cm-bar-center {
    flex: 1 !important;
    display: flex !important;
    justify-content: flex-start !important;
  }
  .cm-sentiment-capsule {
    font-size: 11px !important;
    padding: 4px 8px !important;
    gap: 6px !important;
  }
  .cm-bar-right {
    display: flex !important;
    align-items: center !important;
  }
  #cm-btn-refresh {
    padding: 5px 12px !important;
    font-size: 12px !important;
  }

  /* 3. Watchlist Table: Show only Script, Momentum Score, and Status */
  .cm-table-responsive {
    overflow-x: hidden !important; /* No horizontal scrollbar needed */
  }
  .cm-watchlist-tbl {
    width: 100% !important;
    table-layout: fixed !important;
  }
  .cm-watchlist-tbl th.col-time,
  .cm-watchlist-tbl td.col-time,
  .cm-watchlist-tbl th.col-price,
  .cm-watchlist-tbl td.col-price,
  .cm-watchlist-tbl th.col-trend,
  .cm-watchlist-tbl td.col-trend,
  .cm-watchlist-tbl th.col-waroc,
  .cm-watchlist-tbl td.col-waroc,
  .cm-watchlist-tbl th.col-zone,
  .cm-watchlist-tbl td.col-zone,
  .cm-watchlist-tbl th.col-res,
  .cm-watchlist-tbl td.col-res,
  .cm-watchlist-tbl th.col-sup,
  .cm-watchlist-tbl td.col-sup {
    display: none !important;
  }

  .cm-watchlist-tbl th.col-script,
  .cm-watchlist-tbl td.col-script {
    width: 38% !important;
    min-width: unset !important;
    padding: 8px 6px !important;
  }
  .cm-script-title {
    font-size: 12px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .cm-script-chart-link {
    font-size: 12px !important;
  }

  .cm-watchlist-tbl th.col-score,
  .cm-watchlist-tbl td.col-score {
    width: 40% !important;
    min-width: unset !important;
    padding: 8px 4px !important;
  }
  .score-row-wrap {
    gap: 4px !important;
    justify-content: center !important;
  }
  .score-meter-track {
    width: 48px !important;
    height: 6px !important;
  }
  .score-val-wrap {
    font-size: 11px !important;
  }

  .cm-watchlist-tbl th.col-status,
  .cm-watchlist-tbl td.col-status {
    width: 22% !important;
    min-width: unset !important;
    padding: 8px 4px !important;
    text-align: center !important;
  }
  .btn-action-col {
    padding: 4px 6px !important;
    font-size: 11px !important;
    min-width: 60px !important;
  }

  /* 4. Contracts Drawer: Dedicated Mobile Cards View */
  .desktop-contracts-view {
    display: none !important;
  }
  .mobile-contracts-view {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 6px 4px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Remove all nested bottlenecks on mobile */
  .cm-drawer-cell {
    padding: 0 !important;
  }
  .cm-drawer-inner {
    padding: 4px 2px !important;
    border-left: 3px solid var(--cm-blue) !important;
    background: #F1F5F9 !important;
  }
  .drawer-inner-box.cs-pale-drawer {
    padding: 2px !important;
    background: transparent !important;
  }
  .cs-unified-card {
    border-radius: 6px !important;
    width: 100% !important;
    background: #F8FAFC !important;
    border: 1.5px solid #BFDBFE !important;
  }
  /* Drawer: Remove top margin header from drawer on mobile view */
  .drawer-top-header {
    display: none !important;
  }

  /* The Mobile Contract Card */
  .mcx-mobile-contract-card {
    background: #FFFFFF !important;
    border: 1px solid #BFDBFE !important;
    border-radius: 6px !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    width: 100% !important;
  }

  /* Card Header: Cycle + DTE (Left), Margin Status (Right) */
  .mcx-card-hdr {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-bottom: 5px !important;
    border-bottom: 1px dashed #CBD5E1 !important;
  }
  .mcx-card-hdr-left {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }
  .mcx-card-hdr-left .contract-cycle-badge {
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
  }
  .mcx-card-hdr-left .dte-pill {
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
  }
  .mcx-card-hdr-right {
    font-size: 11px !important;
    font-weight: 700 !important;
  }

  /* Row 1: Side Toggle | Limit Price | Qty Stepper */
  .mcx-card-row-1 {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .mcx-card-row-1 .side-toggle-group {
    flex: 0 0 78px !important;
    width: 78px !important;
  }
  .mcx-card-row-1 .side-btn {
    padding: 4px 0 !important;
    font-size: 10px !important;
    font-weight: 800 !important;
  }
  .mcx-card-row-1 .input-with-label {
    flex: 1 1 auto !important;
    min-width: 75px !important;
    padding: 2px 4px !important;
  }
  .mcx-card-row-1 .input-limit-price {
    width: 100% !important;
    font-size: 12px !important;
  }
  .mcx-card-row-1 .qty-stepper-box {
    flex: 0 0 88px !important;
    width: 88px !important;
  }
  .mcx-card-row-1 .qty-val-input {
    width: 38px !important;
    font-size: 12px !important;
  }
  .mcx-card-row-1 .qty-step-btn {
    width: 25px !important;
    height: 24px !important;
    font-size: 12px !important;
  }

  /* Row 2: Value Box | Enter/Add Button | Exit Button */
  .mcx-card-row-2 {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .mcx-card-row-2 .exec-val-pill {
    flex: 1.2 1 auto !important;
    padding: 4px 6px !important;
    font-size: 11px !important;
    text-align: center !important;
    min-width: unset !important;
  }
  .mcx-card-row-2 .btn-exec-action {
    flex: 1 1 65px !important;
    padding: 4px 6px !important;
    font-size: 11px !important;
    text-align: center !important;
  }

  /* Row 3: Open Position P&L and Lots */
  .mcx-card-row-3 {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-top: 5px !important;
    border-top: 1px dashed #CBD5E1 !important;
    font-size: 11px !important;
  }

  /* 5. Operations Ledger: Responsive Mobile Card View */
  #operations-ledger-card {
    display: block !important;
    margin-top: 14px !important;
    margin-bottom: 24px !important;
    border-radius: 8px !important;
  }

  .operations-ledger-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 10px !important;
    gap: 8px !important;
  }

  .ledger-header-left {
    width: 100% !important;
  }

  .ledger-tab-bar {
    width: 100% !important;
    display: flex !important;
    gap: 5px !important;
    justify-content: space-between !important;
  }

  .ledger-tab-btn {
    flex: 1 1 0 !important;
    justify-content: center !important;
    padding: 7px 4px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-align: center !important;
    white-space: nowrap !important;
    border-radius: 6px !important;
  }

  .ledger-header-right {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .ledger-search-box-wrap {
    flex: 1 1 auto !important;
    width: auto !important;
    height: 32px !important;
    border-radius: 6px !important;
  }

  .ledger-search-input {
    width: 100% !important;
    font-size: 12px !important;
  }

  .ledger-btn-action {
    flex: 0 0 auto !important;
    height: 32px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
  }

  /* KPI Summary: 2x2 Grid on Mobile */
  .operations-ledger-body .pnl-summary-cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    padding: 8px !important;
    margin-bottom: 8px !important;
  }

  .pnl-kpi-card {
    padding: 8px 10px !important;
    border-radius: 6px !important;
  }

  .pnl-kpi-label {
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #000000 !important;
  }

  .pnl-kpi-val {
    font-size: 14px !important;
  }

  /* Table Container and General Mobile Cards Setup */
  .ledger-tbl-wrapper {
    padding: 0 8px 8px 8px !important;
    overflow-x: visible !important;
  }

  .pnl-table, .tradelog-table, .strat-act-log-tbl {
    display: block !important;
    width: 100% !important;
    border: none !important;
  }

  .pnl-table thead, .tradelog-table thead, .strat-act-log-tbl thead {
    display: none !important;
  }

  .pnl-table tbody, .tradelog-table tbody, .strat-act-log-tbl tbody {
    display: block !important;
    width: 100% !important;
  }

  /* Hide desktop cells */
  .perf-desktop-cell,
  .tradelog-desktop-cell,
  .act-desktop-cell {
    display: none !important;
  }

  /* Show mobile card cells as block */
  .perf-mobile-card-cell,
  .tradelog-mobile-card-cell,
  .act-mobile-card-cell {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
  }

  /* Performance Mobile Cards */
  .pnl-table tbody > tr:not(.perf-drawer-row) {
    display: block !important;
    margin-bottom: 10px !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    background: #FFFFFF !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden !important;
  }

  .perf-mobile-card {
    display: flex !important;
    flex-direction: column !important;
    padding: 10px !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  .perf-mobile-card.is-open {
    background: #F0FDF4 !important;
  }

  .perf-mcard-hdr {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 6px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px dashed #E2E8F0 !important;
  }

  .perf-mcard-hdr-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .perf-mcard-sym {
    font-weight: 800 !important;
    font-size: 13px !important;
    color: #0F172A !important;
  }

  .perf-mcard-tsym {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #0284C7 !important;
  }

  .perf-mcard-body {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
    background: #F8FAFC !important;
    padding: 8px !important;
    border-radius: 6px !important;
  }

  .perf-mcard-trade-pill {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    font-size: 11px !important;
  }

  .perf-mcard-qty {
    font-weight: 700 !important;
    color: #475569 !important;
  }

  .perf-mcard-exec {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 11px !important;
  }

  .perf-mcard-exec-step {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
  }

  .perf-mcard-exec-lbl {
    font-size: 9px !important;
    color: #000000 !important;
    text-transform: uppercase !important;
    font-weight: 800 !important;
  }

  .perf-mcard-exec-val {
    font-weight: 700 !important;
    color: #0F172A !important;
  }

  .perf-mcard-exec-time {
    font-size: 10px !important;
    color: #000000 !important;
    font-weight: 700 !important;
  }

  .perf-mcard-exec-arrow {
    color: #000000 !important;
    font-weight: 800 !important;
  }

  .perf-mcard-ftr {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-top: 4px !important;
  }

  .perf-mcard-pnl {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
  }

  .perf-mcard-pnl-val {
    font-size: 14px !important;
    font-weight: 800 !important;
  }

  .perf-mcard-pnl-sub {
    font-size: 10px !important;
    font-weight: 600 !important;
  }

  .perf-mcard-btn-inspect {
    font-size: 11px !important;
    height: 26px !important;
    padding: 0 8px !important;
  }

  /* Trade Lifecycle Drawer on Mobile */
  .perf-drawer-row > td {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
  }

  .perf-lifecycle-drawer {
    padding: 10px !important;
    margin-bottom: 10px !important;
    border-radius: 8px !important;
  }

  .lifecycle-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .param-card {
    padding: 8px !important;
  }

  .param-items-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  /* Trade Log Mobile Cards */
  .tradelog-table tbody > tr {
    display: block !important;
    margin-bottom: 8px !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    background: #FFFFFF !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
    overflow: hidden !important;
  }

  .tradelog-mobile-card {
    display: flex !important;
    flex-direction: column !important;
    padding: 10px !important;
    gap: 6px !important;
    box-sizing: border-box !important;
  }

  .tradelog-mcard-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 6px !important;
    padding-bottom: 5px !important;
    border-bottom: 1px dashed #E2E8F0 !important;
  }

  .tradelog-mcard-sym-time {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 11px !important;
  }

  .tradelog-mcard-time {
    color: #000000 !important;
    font-weight: 700 !important;
    font-size: 10px !important;
  }

  .tradelog-mcard-sym {
    font-weight: 700 !important;
    color: #0284C7 !important;
  }

  .tradelog-mcard-status {
    font-size: 10px !important;
    font-weight: 700 !important;
  }

  .tradelog-mcard-mid {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 6px !important;
    background: #F8FAFC !important;
    padding: 6px 8px !important;
    border-radius: 6px !important;
  }

  .tradelog-mcard-pill {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 11px !important;
  }

  .tradelog-mcard-qty {
    font-weight: 700 !important;
    color: #334155 !important;
  }

  .tradelog-mcard-at {
    color: #000000 !important;
    font-weight: 700 !important;
  }

  .tradelog-mcard-price {
    font-weight: 700 !important;
    color: #0F172A !important;
  }

  .tradelog-mcard-badges {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  .tradelog-mcard-bottom {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #000000 !important;
  }

  /* Activity Log Mobile Cards */
  .strat-act-log-tbl tbody > tr {
    display: block !important;
    margin-bottom: 8px !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    background: #FFFFFF !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
    overflow: hidden !important;
  }

  .act-mobile-card {
    display: flex !important;
    flex-direction: column !important;
    padding: 10px !important;
    gap: 6px !important;
    box-sizing: border-box !important;
  }

  .act-mcard-hdr {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 6px !important;
    padding-bottom: 5px !important;
    border-bottom: 1px dashed #E2E8F0 !important;
  }

  .act-mcard-time {
    font-size: 10px !important;
    color: #000000 !important;
    font-weight: 700 !important;
    font-family: monospace !important;
  }

  .act-mcard-details {
    font-size: 11px !important;
    color: #334155 !important;
    line-height: 1.4 !important;
  }

  /* Activity Log Mobile Cards Tinted by Event Type */
  .strat-act-log-tbl tbody > tr.act-card-order-alert,
  .act-mobile-card.act-card-order-alert {
    background: #ECFDF5 !important;
    border-color: #A7F3D0 !important;
  }
  .strat-act-log-tbl tbody > tr.act-card-order-alert .act-mcard-hdr {
    border-bottom-color: #A7F3D0 !important;
  }

  .strat-act-log-tbl tbody > tr.act-card-strat-alert,
  .act-mobile-card.act-card-strat-alert {
    background: #EEF2FF !important;
    border-color: #C7D2FE !important;
  }
  .strat-act-log-tbl tbody > tr.act-card-strat-alert .act-mcard-hdr {
    border-bottom-color: #C7D2FE !important;
  }

  .strat-act-log-tbl tbody > tr.act-card-pos-alert,
  .act-mobile-card.act-card-pos-alert {
    background: #FEF3C7 !important;
    border-color: #FDE68A !important;
  }
  .strat-act-log-tbl tbody > tr.act-card-pos-alert .act-mcard-hdr {
    border-bottom-color: #FDE68A !important;
  }

  .strat-act-log-tbl tbody > tr.act-card-tg-alert,
  .act-mobile-card.act-card-tg-alert {
    background: #FEF2F2 !important;
    border-color: #FECACA !important;
  }
  .strat-act-log-tbl tbody > tr.act-card-tg-alert .act-mcard-hdr {
    border-bottom-color: #FECACA !important;
  }

  .strat-act-log-tbl tbody > tr.act-card-scan-alert,
  .act-mobile-card.act-card-scan-alert {
    background: #F0F9FF !important;
    border-color: #BAE6FD !important;
  }
  .strat-act-log-tbl tbody > tr.act-card-scan-alert .act-mcard-hdr {
    border-bottom-color: #BAE6FD !important;
  }
}

/* ==============================================================================
   6. INTERCONNECTED TRADE LIFECYCLE & COMMENT STYLES
   ============================================================================== */
.badge-exchange {
  display: inline-block;
  padding: 2px 6px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #334155;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-segment {
  display: inline-block;
  padding: 2px 6px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.perf-lifecycle-drawer {
  background: #F8FAFC;
  border-bottom: 2px solid #E2E8F0;
  padding: 14px 18px;
}

.lifecycle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 12px;
}

.param-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.param-card-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #F1F5F9;
}

.param-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #1E293B;
  display: flex;
  align-items: center;
  gap: 6px;
}

.param-card-tag {
  font-size: 10.5px;
  font-family: monospace;
  color: #64748B;
  background: #F1F5F9;
  padding: 2px 6px;
  border-radius: 4px;
}

.param-items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-size: 11.5px;
}

.param-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  background: #F8FAFC;
  border-radius: 4px;
}

.param-label {
  color: #64748B;
  font-weight: 500;
}

.param-val {
  font-weight: 700;
  color: #0F172A;
  font-family: monospace;
}

/* Interactive Double-Click Comment Box */
.perf-comment-wrap {
  background: #FFFFFF;
  border: 1px dashed #CBD5E1;
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
}

.perf-comment-wrap:hover {
  border-color: #94A3B8;
  background: #FDFDFE;
}

.perf-comment-view {
  flex: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.perf-comment-text {
  font-size: 12px;
  color: #334155;
  font-style: normal;
}

.perf-comment-text.is-empty {
  color: #94A3B8;
  font-style: italic;
}

.perf-comment-hint {
  font-size: 10.5px;
  color: #0284C7;
  font-weight: 600;
  white-space: nowrap;
}

.perf-comment-edit {
  display: none;
  flex: 1;
  align-items: center;
  gap: 8px;
}

.perf-comment-edit input {
  flex: 1;
  padding: 6px 10px;
  border: 1.5px solid #0284C7;
  border-radius: 5px;
  font-size: 12px;
  color: #0F172A;
  outline: none;
}

.perf-comment-btn-save {
  background: #0284C7;
  color: #FFFFFF;
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.perf-comment-btn-cancel {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
}

/* ==============================================================================
   STOPLOSS DOTTED UNDERLINE & SCAN-BREACH EXIT BUTTON (DESKTOP)
   ============================================================================== */
.sl-dotted-underline {
  font-weight: normal !important;
  text-decoration: underline !important;
  text-decoration-style: dotted !important;
  text-decoration-thickness: 1.8px !important;
  text-underline-offset: 4px !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sl-dotted-underline:hover {
  filter: brightness(0.85);
}

.btn-status-exit {
  background-color: #DC2626 !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 5px 18px !important;
  border-radius: 6px !important;
  border: none !important;
  cursor: pointer !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3) !important;
  transition: all 0.15s ease !important;
}

.btn-status-exit:hover {
  background-color: #B91C1C !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 5px rgba(185, 28, 28, 0.4) !important;
}


/* Credit Spread Drawer Specific Styles */
.spread-sub-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px !important;
      white-space: nowrap;
      background: #F0F7FF !important;
    }
    .spread-sub-table thead th {
      background: #E0F2FE !important;
      color: #0F172A;
      font-size: 11px !important;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.4px;
      padding: 8px 10px;
      border-bottom: 1.5px solid #BFDBFE !important;
      text-align: center;
    }
    .spread-sub-table tbody tr {
      border-bottom: 1px solid #E2E8F0;
      transition: background 0.15s ease;
      background: #F0F7FF !important;
    }
    .spread-sub-table tbody tr:hover {
      background: #E0F2FE !important;
    }
    .spread-sub-table td {
      padding: 8px 10px;
      vertical-align: middle;
      text-align: center;
      font-size: 12px !important;
      background: #F0F7FF !important;
    }

    .qty-stepper-wrap {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .qty-stepper-mini {
      display: inline-flex;
      align-items: center;
      border: 1px solid #CBD5E1;
      border-radius: 4px;
      overflow: hidden;
      background: #FFFFFF;
    }
    .qty-step-btn-mini {
      background: #F1F5F9;
      color: #0F172A;
      border: none;
      padding: 2px 7px;
      font-weight: 800;
      font-size: 11px;
      cursor: pointer;
      transition: background 0.1s ease;
    }
    .qty-step-btn-mini:hover { background: #E2E8F0; }
    .qty-val-input-mini {
      width: 58px;
      border: none;
      background: #FFFFFF;
      text-align: center;
      font-size: 11px !important;
      font-weight: 800;
      font-family: ui-monospace, SFMono-Regular, monospace;
      color: #0F172A;
      outline: none;
    }
    .cs-lot-indicator {
      font-family: ui-monospace, SFMono-Regular, monospace;
      font-size: 12px;
      font-weight: 700;
      color: #1E293B;
      white-space: nowrap;
    }

    .btn-exec-row {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 4px;
    }
    .btn-act-add {
      width: 58px;
      height: 26px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      font-weight: 800;
      border-radius: 4px;
      cursor: pointer;
      border: none;
    }
    .btn-act-add-bull {
      background: #059669 !important;
      color: #FFFFFF !important;
    }
    .btn-act-add-bull:hover { background: #047857 !important; }
    .btn-act-add-bear {
      background: #DC2626 !important;
      color: #FFFFFF !important;
    }
    .btn-act-add-bear:hover { background: #B91C1C !important; }

    .btn-act-exit {
      width: 58px;
      height: 26px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      font-weight: 800;
      border-radius: 4px;
      cursor: pointer;
      background: #FEE2E2;
      color: #991B1B;
      border: 1px solid #FCA5A5;
    }
    .btn-act-exit:disabled {
      background: #F1F5F9;
      color: #94A3B8;
      border-color: #E2E8F0;
      cursor: not-allowed;
    }

    /* ==============================================================================
       5. 
/* Visual 1% Rule */
.cm-pct-green { color: #059669 !important; font-weight: 700 !important; }
.cm-pct-red { color: #DC2626 !important; font-weight: 700 !important; }
.cm-pct-neutral { color: #64748B !important; font-weight: 600 !important; }


/* ==============================================================================
   CREDIT SPREAD DRAWER: RESPONSIVE DESKTOP TABLE VS MOBILE CARDS (OPTION A)
   ============================================================================== */
.cs-desktop-table-view {
  display: block;
}
.cs-mobile-cards-view {
  display: none;
}

@media (max-width: 768px) {
  .cs-desktop-table-view {
    display: none !important;
  }
  .cs-mobile-cards-view {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    padding: 10px 8px 12px 8px;
    background: #F0F7FF;
  }

  /* Drawer Header on Mobile */
  .cs-unified-header {
    padding: 10px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .drawer-left-title {
    width: 100%;
    justify-content: space-between;
  }
  .cs-unified-header > div:last-child {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .cs-unified-header .step-dropdown-wrap {
    flex: 1 1 calc(50% - 4px);
    justify-content: space-between;
  }
  .cs-unified-header .toggle-strat-group {
    width: 100%;
    display: flex !important;
  }
  .cs-unified-header .toggle-strat-btn {
    flex: 1;
    text-align: center;
    padding: 6px 10px !important;
  }

  /* Mobile Card Option A */
  .cs-mobile-card {
    background: #FFFFFF;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
  }

  .cs-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 10px;
    border-bottom: 1px solid #E2E8F0;
  }

  .cs-card-strikes {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .cs-card-strike-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 13px;
    font-weight: 700;
  }

  .cs-strike-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 3px;
    letter-spacing: 0.5px;
  }
  .cs-badge-sell {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FCA5A5;
  }
  .cs-badge-buy {
    background: #DCFCE7;
    color: #059669;
    border: 1px solid #86EFAC;
  }

  .cs-strike-name {
    color: #0F172A;
  }
  .cs-strike-price {
    font-size: 12px;
  }

  .cs-card-tag-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

  .cs-step-tag {
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
  }

  .cs-pos-active-tag {
    background: #DCFCE7;
    color: #059669;
    border: 1px solid #86EFAC;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
  }

  .cs-pos-flat-tag {
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid #CBD5E1;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
  }

  /* 2x3 Metrics Grid */
  .cs-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #E2E8F0;
  }

  .cs-grid-cell {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 6px 10px;
  }

  .cs-cell-label {
    font-size: 9px;
    font-weight: 800;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }

  .cs-cell-val {
    font-size: 13px;
    font-weight: 800;
    font-family: ui-monospace, SFMono-Regular, monospace;
    margin-top: 2px;
  }

  .cs-text-green { color: #059669 !important; }
  .cs-text-red { color: #DC2626 !important; }
  .cs-text-blue { color: #0284C7 !important; }
  .cs-text-muted { color: #64748B !important; }

  /* Footer Controls */
  .cs-card-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
  }

  .cs-card-stepper-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .cs-card-stepper-title {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
  }

  .cs-stepper-touch {
    height: 32px;
  }
  .cs-touch-step {
    width: 32px;
    height: 100%;
    font-size: 15px !important;
  }
  .cs-touch-input {
    width: 60px !important;
    height: 100%;
    font-size: 12px !important;
  }

  .cs-card-btn-row {
    display: flex;
    gap: 8px;
    width: 100%;
  }

  .cs-card-btn {
    flex: 1;
    height: 36px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border-radius: 6px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .cs-btn-entry {
    background: #059669 !important;
    color: #FFFFFF !important;
    border: none !important;
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2);
  }
  .cs-btn-entry:hover {
    background: #047857 !important;
  }

  .cs-btn-exit {
    background: #FEE2E2 !important;
    color: #991B1B !important;
    border: 1px solid #FCA5A5 !important;
  }
  .cs-btn-exit:not(:disabled) {
    background: #DC2626 !important;
    color: #FFFFFF !important;
    border: none !important;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
  }
  .cs-btn-exit:disabled {
    background: #F1F5F9 !important;
    color: #94A3B8 !important;
    border-color: #E2E8F0 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
  }
}

.btn-act-cancel {
  min-width: 82px;
  height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  border-radius: 4px;
  border: 1px solid #B91C1C !important;
  background: #DC2626 !important;
  color: #FFFFFF !important;
  cursor: pointer;
  white-space: nowrap;
  animation: csCancelPulse 1.8s infinite ease-in-out;
}
.btn-act-cancel:hover {
  background: #B91C1C !important;
}
@keyframes csCancelPulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
.cs-chase-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
  margin-top: 2px;
}

/* ==============================================================================
   POSITION & ORDER DRAWERS RESPONSIVE ENHANCEMENTS
   ============================================================================== */
.spread-sub-table {
  width: 100% !important;
  table-layout: fixed !important;
}

.spread-sub-table th,
.spread-sub-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.spread-sub-table th:nth-child(1), .spread-sub-table td:nth-child(1) { width: 15% !important; text-align: center; }
.spread-sub-table th:nth-child(2), .spread-sub-table td:nth-child(2) { width: 25% !important; text-align: center; }
.spread-sub-table th:nth-child(3), .spread-sub-table td:nth-child(3) { width: 14% !important; text-align: right; }
.spread-sub-table th:nth-child(4), .spread-sub-table td:nth-child(4) { width: 14% !important; text-align: right; }
.spread-sub-table th:nth-child(5), .spread-sub-table td:nth-child(5) { width: 12% !important; text-align: center; }
.spread-sub-table th:nth-child(6), .spread-sub-table td:nth-child(6) { width: 12% !important; text-align: center; }
.spread-sub-table th:nth-child(7), .spread-sub-table td:nth-child(7) { width: 8% !important; text-align: center; }

.btn-act-enter {
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2);
  transition: all 0.15s ease;
}
.btn-act-enter:hover {
  background: #047857 !important;
  transform: translateY(-1px);
}
.btn-pos-exit {
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
  transition: all 0.15s ease;
}
.btn-pos-exit:hover {
  background: #B91C1C !important;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .cs-pos-desktop-table {
    display: none !important;
  }
  .cs-pos-mobile-card {
    display: block !important;
  }
  .cs-desktop-table-view {
    display: none !important;
  }
  .cs-mobile-cards-view {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 10px !important;
  }
  .cs-order-header-filters {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
  }
  .toggle-strat-group,
  .step-filter-pills,
  .expiry-cycle-pills {
    width: 100% !important;
    display: flex !important;
    justify-content: space-around !important;
  }
  .toggle-strat-group button,
  .step-filter-pills button,
  .expiry-cycle-pills button {
    flex: 1 !important;
    text-align: center !important;
    padding: 6px 4px !important;
  }
}

@media (min-width: 769px) {
  .cs-pos-mobile-card {
    display: none !important;
  }
  .cs-pos-desktop-table {
    display: block !important;
  }
  .cs-desktop-table-view {
    display: block !important;
  }
  .cs-mobile-cards-view {
    display: none !important;
  }
}

/* ==========================================================================
   PRE-TRADE UNIFIED 4-COLUMN ACTION DEPTH DRAWER (STRICT LIGHT THEME)
   ========================================================================== */
.cr-depth-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-sizing: border-box;
}

.cr-depth-drawer-box {
  background: #FFFFFF;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  max-height: 94vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid #CBD5E1;
  display: flex;
  flex-direction: column;
  animation: crDrawerFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes crDrawerFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cr-depth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #E2E8F0;
  background: #F8FAFC;
}

.cr-depth-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 2.5px 8px;
  border-radius: 4px;
  background: #DCFCE7;
  color: #059669;
  border: 1px solid #86EFAC;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.cr-depth-header-center {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.cr-depth-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #059669;
  display: inline-block;
  animation: crLivePulse 1.8s infinite;
}

@keyframes crLivePulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

.cr-depth-broker-tag {
  background: #DCFCE7;
  color: #065F46;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid #A7F3D0;
}

.cr-depth-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}

.cr-depth-title {
  font-size: 13px;
  font-weight: 900;
  color: #0F172A;
  letter-spacing: -0.2px;
}

.cr-depth-liq-badge {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.cr-depth-stat-profit {
  font-size: 13px;
  font-weight: 900;
  color: #059669;
}

.cr-depth-stat-loss {
  font-size: 11px;
  font-weight: 800;
  color: #DC2626;
  margin-top: 2px;
}

.cr-depth-leg-headers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  border-bottom: 1px solid #CBD5E1;
}

.cr-leg-subhdr {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cr-leg-sell {
  background: #FFF1F2;
  color: #9F1239;
  border-right: 1px solid #E2E8F0;
}

.cr-leg-buy {
  background: #F0FDF4;
  color: #166534;
}

.cr-leg-pill {
  font-size: 9px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 3px;
}
.pill-sell { background: #FECDD3; color: #9F1239; }
.pill-buy { background: #BBF7D0; color: #166534; }

.cr-depth-table-wrapper {
  overflow-x: auto;
  padding: 4px 8px;
}

.cr-depth-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.cr-depth-table th {
  padding: 6px 8px;
  background: #F1F5F9;
  color: #475569;
  font-weight: 700;
  border-bottom: 1px solid #CBD5E1;
  text-align: right;
  white-space: nowrap;
}
.cr-depth-table th.col-b-hdr {
  color: #059669;
  font-weight: 800;
  background: #F0FDF4;
  border-right: 1px solid #E2E8F0;
}
.cr-depth-table th.col-a-hdr {
  color: #DC2626;
  font-weight: 800;
  background: #FEF2F2;
}

.cr-depth-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #F1F5F9;
  text-align: right;
  white-space: nowrap;
}
.cr-depth-table td.col-b-cell {
  font-weight: 800;
  color: #047857;
  background: #F0FDF4;
  border-right: 1px solid #E2E8F0;
}
.cr-depth-table td.col-a-cell {
  font-weight: 800;
  color: #B91C1C;
  background: #FEF2F2;
}

.depth-loading-cell {
  text-align: center !important;
  padding: 24px 10px !important;
  color: #64748B;
  font-style: italic;
}

.cr-depth-walk-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 14px;
  background: #F8FAFC;
  border-top: 1px solid #CBD5E1;
  font-size: 11px;
}

.cr-walk-item.pr-divider {
  border-right: 1px solid #E2E8F0;
  padding-right: 8px;
}
.cr-walk-item:not(.pr-divider) {
  padding-left: 8px;
}

.cr-walk-lbl {
  font-size: 9.5px;
  font-weight: 700;
  color: #64748B;
  display: block;
}

.cr-walk-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
  font-weight: 600;
  color: #334155;
}
.cr-walk-row strong.text-green { color: #047857; font-weight: 900; }
.cr-walk-row strong.text-red { color: #B91C1C; font-weight: 900; }

.cr-depth-action-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #E2E8F0;
  background: #FFFFFF;
}

.btn-cr-cancel {
  width: 32%;
  background: #F1F5F9;
  color: #334155;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid #CBD5E1;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-cr-cancel:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.btn-cr-confirm-exec {
  width: 68%;
  background: #059669;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 12px;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2);
  transition: all 0.15s;
}
.btn-cr-confirm-exec:hover {
  background: #047857;
}
.btn-cr-confirm-exec:disabled {
  background: #94A3B8;
  cursor: not-allowed;
  box-shadow: none;
}





/* ==============================================================================
   5. OPTIONS ORDER DRAWER (FULL-WIDTH INLINE ACCORDION DRAWER)
   ============================================================================== */
.cm-inline-drawer-row {
  background: #FFFFFF !important;
}
.cm-inline-drawer-td {
  padding: 0 !important;
  border-top: 2px solid #0284C7 !important;
  border-bottom: 2px solid #CBD5E1 !important;
}
.row-drawer-active {
  background-color: #F0F9FF !important;
  border-left: 4px solid #0284C7 !important;
}
.row-drawer-active td {
  background-color: #F0F9FF !important;
}

.drawer-container.inline-drawer-container {
  width: 82%;
  max-width: 82%;
  margin: 0 auto;
  background: #FFFFFF;
  border-left: 1px solid #CBD5E1;
  border-right: 1px solid #CBD5E1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: none;
  animation: expandInlineDrawer 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (max-width: 1200px) {
  .drawer-container.inline-drawer-container {
    width: 90%;
    max-width: 90%;
  }
}
@media (max-width: 900px) {
  .drawer-container.inline-drawer-container {
    width: 100%;
    max-width: 100%;
  }
}

@keyframes expandInlineDrawer {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==============================================================================
   OPTIONS ORDER DRAWER - EXACT APPROVED DEMO REPLICA
   Scope: #options-order-drawer / .drawer-main-grid-replica
   ============================================================================== */
.drawer-container.inline-drawer-container {
  width: 100%;
  max-width: 1080px;
  margin: 4px auto 14px auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  overflow: hidden;
  box-sizing: border-box;
}

.drawer-main-grid-replica {
  display: grid;
  grid-template-columns: 480px 1fr;
  background: #ffffff;
  overflow: hidden;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.drawer-main-grid-replica * {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 13px !important;
}

@media (max-width: 1080px) {
  .drawer-main-grid-replica {
    grid-template-columns: 1fr;
  }
}

/* LEFT PANE: Strike Selection */
.drawer-left-pane {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-left-pane .section-title {
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-left-pane .badge {
  background: #e2e8f0;
  color: #64748b;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.drawer-left-pane .strike-table-box {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.drawer-left-pane .strike-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.drawer-left-pane .strike-table th {
  background: #f1f5f9;
  padding: 7px 8px;
  font-weight: 700;
  color: #64748b;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.drawer-left-pane .strike-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 500;
  vertical-align: middle;
  white-space: nowrap;
}

.drawer-left-pane .strike-table tr:last-child td {
  border-bottom: none;
}

.drawer-left-pane .strike-table tr.selected-row {
  background: #eff6ff !important;
}

.drawer-left-pane .strike-table tr:hover {
  background: #f8fafc;
}

.drawer-left-pane .strike-table tr.selected-row:hover {
  background: #e0edff !important;
}

.drawer-left-pane .btn-select {
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
  transition: all 0.15s ease;
}

.drawer-left-pane .btn-select.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  font-weight: 700;
}

/* RIGHT PANE: Strategy Console */
.drawer-right-pane {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
}

/* Header Bar - Alignment: Left = Bullish/Bearish, Middle = Shooniya, Right = ATM */
.drawer-right-pane .top-status-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.drawer-right-pane .trend-group-left {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.drawer-right-pane .broker-group-middle {
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-right-pane .atm-group-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.drawer-right-pane .pill {
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid transparent;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
}

.drawer-right-pane .pill-shoonya {
  background: #ffffff;
  border-color: #e2e8f0;
  cursor: default;
}

.drawer-right-pane .pill-trend-inactive {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #64748b;
}

.drawer-right-pane .pill-trend-active-bull {
  background: #dcfce7;
  color: #16a34a;
  border-color: #86efac;
  font-weight: 700;
}

.drawer-right-pane .pill-trend-active-bear {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
  font-weight: 700;
}

.drawer-right-pane .atm-badge {
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

/* Strategy Tabs */
.drawer-right-pane .button-bar {
  display: flex;
  gap: 6px;
}

.drawer-right-pane .btn-tab {
  flex: 1;
  padding: 6px 0;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  color: #64748b;
  transition: all 0.15s ease;
}

.drawer-right-pane .btn-tab.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  font-weight: 700;
}

/* Expiry Selector */
.drawer-right-pane .expiry-bar {
  display: flex;
  gap: 6px;
}

.drawer-right-pane .btn-expiry {
  flex: 1;
  padding: 6px 0;
  text-align: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
  transition: all 0.15s ease;
}

.drawer-right-pane .btn-expiry.active {
  background: #ffffff !important;
  border-color: #3b82f6 !important;
  color: #2563eb !important;
  font-weight: 700;
}

/* Leg Table */
.drawer-right-pane .table-box {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.drawer-right-pane table.leg-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.drawer-right-pane table.leg-table th {
  background: #f8fafc;
  padding: 7px 10px;
  font-weight: 700;
  color: #64748b;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.drawer-right-pane table.leg-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 500;
  white-space: nowrap;
  vertical-align: middle;
}

.drawer-right-pane table.leg-table tr:last-child td {
  border-bottom: none;
}

.drawer-right-pane tr.row-disabled {
  opacity: 0.45;
  background: #f8fafc;
}

.drawer-right-pane .badge-action {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.drawer-right-pane .badge-sell {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.drawer-right-pane .badge-buy {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #86efac;
}

.drawer-right-pane select.leg-select {
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-weight: 700;
  font-size: 12px;
  color: #0f172a;
  width: auto;
  min-width: 118px;
  max-width: 130px;
  text-align: center;
  text-align-last: center;
  margin: 0 auto;
  display: block;
}

.drawer-right-pane .leg-item-val {
  text-align: center;
  display: block;
  width: 100%;
  font-size: 12px;
}

.drawer-right-pane table.leg-table th:nth-child(2),
.drawer-right-pane table.leg-table td:nth-child(2) {
  text-align: center;
}

/* Single Line Lots & Qty Stepper */
.drawer-right-pane .qty-ctrl-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.drawer-right-pane .qty-btn {
  width: 22px;
  height: 22px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.drawer-right-pane .qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.drawer-right-pane .qty-label-single-line {
  font-weight: 700;
  color: #0f172a;
}

/* Risk Metrics Bar */
.drawer-right-pane .metrics-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 0;
}

.drawer-right-pane .metric-item {
  text-align: center;
  border-right: 1px solid #e2e8f0;
}

.drawer-right-pane .metric-item:last-child {
  border-right: none;
}

.drawer-right-pane .metric-lbl {
  color: #64748b;
  font-weight: 500;
  margin-bottom: 2px;
}

.drawer-right-pane .metric-val {
  font-weight: 700;
  color: #0f172a;
}

/* Action Execution Bar */
.drawer-right-pane .action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
}

.drawer-right-pane .toggle-exec-seq {
  padding: 7px 14px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
}

.drawer-right-pane .toggle-exec-seq.sell-first,
.drawer-right-pane .toggle-exec-seq.is-sell {
  border-color: #fca5a5;
  color: #dc2626;
  background: #fee2e2;
}

.drawer-right-pane .toggle-exec-seq.buy-first,
.drawer-right-pane .toggle-exec-seq.is-buy {
  border-color: #86efac;
  color: #16a34a;
  background: #dcfce7;
}

.drawer-right-pane .btn-group-right {
  display: flex;
  gap: 6px;
}

.drawer-right-pane .btn-action {
  padding: 7px 16px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  line-height: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.drawer-right-pane .btn-cancel,
#drawer-btn-cancel {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}

.drawer-right-pane .btn-cancel:hover,
#drawer-btn-cancel:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

.drawer-right-pane .btn-refresh,
#drawer-btn-refresh {
  background: #ffffff !important;
  border: 1px solid #93c5fd !important;
  color: #1d4ed8 !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}

.drawer-right-pane .btn-refresh:hover,
#drawer-btn-refresh:hover {
  background: #eff6ff !important;
  border-color: #2563eb !important;
}

.drawer-right-pane .btn-execute {
  background: #16a34a !important;
  color: #ffffff !important;
  border: 1px solid #16a34a !important;
  padding: 7px 22px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}

.drawer-right-pane .btn-execute:hover {
  background: #15803d !important;
}

.drawer-alert-msg {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.drawer-alert-error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #f87171;
}

/* Mobile drawer tab switcher retired - replaced by unified single-screen flow */
.drawer-mobile-tabs {
  display: none !important;
}


/* ==============================================================================
   LIQUIDITY & ORDER CONFIRMATION MODAL - DESKTOP OPTIMIZED & MOBILE SLEEK
   ============================================================================== */
.opt-liquidity-modal-box {
  max-width: 620px !important;
  width: 92% !important;
  max-height: 90vh !important;
  border-radius: 10px !important;
  background: #FFFFFF !important;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.25), 0 4px 12px rgba(15, 23, 42, 0.08) !important;
  border: 1px solid #CBD5E1 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
}

.liq-modal-header {
  padding: 12px 18px;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-shrink: 0;
}

.cm-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.liq-modal-main-title {
  font-weight: 800;
  font-size: 14px;
  color: #0F172A;
  letter-spacing: -0.2px;
}

.liq-title-pipe {
  color: #94A3B8;
  font-size: 13px;
  margin: 0 2px;
}

.liq-badge-strategy {
  padding: 2.5px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  background: #EDE9FE;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}

.cm-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #64748B;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s;
}

.cm-modal-close:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.liq-modal-body {
  padding: 14px 18px !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  overflow-y: auto;
}

/* Direct Contract Liquidity Lines */
.liq-contract-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.liq-contract-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
}

.liq-contract-sym {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 800;
  color: #0F172A;
}

.liq-line-pipe {
  color: #94A3B8;
  font-size: 12px;
}

.liq-line-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.liq-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
}

.liq-status-good {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.liq-status-warn {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

/* Verification Status Banner */
.liq-status-banner {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
}

.liq-notice-line {
  margin: 1px 0;
}

.liq-banner-success {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #166534;
}

.liq-banner-warning {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
}

/* Margin Verification Blocks */
.liq-blocks-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.liq-block-card {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.liq-block-header {
  padding: 8px 12px;
  background: #F1F5F9;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.liq-block-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.liq-block-body {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.liq-data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}

.liq-data-lbl {
  font-weight: 600;
  color: #475569;
  font-size: 12px;
}

.liq-data-val {
  font-size: 12.5px;
  font-weight: 700;
  color: #0F172A;
}

/* Modal Actions - Sticky Bottom Footer */
.liq-modal-actions {
  flex-shrink: 0;
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 12px 18px !important;
  background: #F8FAFC !important;
  border-top: 1px solid #E2E8F0 !important;
}

.btn-liq-cancel {
  padding: 8px 18px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.btn-liq-cancel:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.btn-liq-confirm {
  padding: 8px 22px;
  background: #059669;
  border: none;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2);
  transition: all 0.15s;
  text-align: center;
}

.btn-liq-confirm:hover {
  background: #047857;
}

.btn-liq-confirm:disabled {
  background: #94A3B8;
  cursor: not-allowed;
  box-shadow: none;
}

/* Responsive Media Queries (Mobile <= 768px) */
@media (max-width: 768px) {
  .opt-liquidity-modal-box {
    max-width: 95vw !important;
    width: 95vw !important;
    max-height: 94vh !important;
    margin: auto !important;
  }

  .liq-modal-header {
    padding: 10px 14px !important;
  }

  .liq-modal-body {
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  .liq-contract-line {
    padding: 6px 10px !important;
    gap: 6px !important;
  }

  .liq-contract-sym {
    font-size: 11px !important;
  }

  .liq-line-label {
    font-size: 11px !important;
  }

  .liq-status-pill {
    font-size: 10px !important;
    padding: 1.5px 5px !important;
  }

  .liq-block-header {
    padding: 7px 10px !important;
  }

  .liq-block-title {
    font-size: 11px !important;
  }

  .liq-block-body {
    padding: 8px 10px !important;
    gap: 5px !important;
  }

  .liq-data-row {
    font-size: 11.5px !important;
  }

  .liq-data-lbl {
    font-size: 11px !important;
  }

  .liq-data-val {
    font-size: 11.5px !important;
  }

  .liq-modal-actions {
    flex-direction: column-reverse !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }

  .btn-liq-confirm,
  .btn-liq-cancel {
    width: 100% !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
  }
}

/* ==============================================================================
   STRATEGY LOG RESPONSIVE TABLE STYLES (MATCHING COMMODITY SNAPSHOT)
   ============================================================================== */
.stratlog-desktop-header {
  display: table-row;
}
.stratlog-desktop-cell {
  display: table-cell;
}
.stratlog-mobile-header {
  display: none !important;
}
.stratlog-mobile-cell {
  display: none !important;
}

@media (max-width: 640px) {
  .stratlog-desktop-header {
    display: none !important;
  }
  .strategylog-table td.stratlog-desktop-cell {
    display: none !important;
  }

  .stratlog-mobile-header {
    display: table-row !important;
  }
  .stratlog-mobile-header th {
    background: #F8FAFC !important;
    border-bottom: 2px solid #CBD5E1 !important;
    padding: 8px 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
    letter-spacing: 0.3px !important;
  }
  .stratlog-mob-th-info {
    width: 50% !important;
    text-align: left !important;
  }
  .stratlog-mob-th-score {
    width: 28% !important;
    text-align: center !important;
  }
  .stratlog-mob-th-status {
    width: 22% !important;
    text-align: center !important;
  }

  .strategylog-table tbody tr.stratlog-row {
    border-bottom: 1px solid #E2E8F0 !important;
  }
  .strategylog-table tbody tr.stratlog-row:hover {
    background: #F8FAFC !important;
  }

  .strategylog-table td.stratlog-mobile-cell {
    display: table-cell !important;
    vertical-align: middle !important;
    padding: 7px 6px !important;
    box-sizing: border-box !important;
  }

  .stratlog-mob-cell-info {
    width: 50% !important;
    text-align: left !important;
  }
  .stratlog-mob-title {
    font-size: 12.5px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
    line-height: 1.25 !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .stratlog-mob-price-line {
    display: flex !important;
    align-items: baseline !important;
    gap: 4px !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    margin-bottom: 2px !important;
    font-variant-numeric: tabular-nums !important;
  }
  .stratlog-mob-price-val {
    font-weight: 700 !important;
    color: #1E293B !important;
  }
  .stratlog-mob-price-pct {
    font-weight: 700 !important;
    font-size: 10.5px !important;
  }
  .stratlog-mob-meta-line {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 10px !important;
    color: #64748B !important;
    line-height: 1.2 !important;
    font-variant-numeric: tabular-nums !important;
  }
  .stratlog-mob-bullet {
    color: #94A3B8 !important;
    font-size: 8px !important;
  }
  .stratlog-mob-tf {
    display: inline-block !important;
    padding: 0 4px !important;
    background: #F1F5F9 !important;
    border-radius: 3px !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    color: #475569 !important;
  }

  .stratlog-mob-cell-score {
    width: 28% !important;
    text-align: center !important;
    padding: 6px 4px !important;
  }
  .stratlog-mob-cell-score .mob-score-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
  }
  .stratlog-mob-cell-score .score-meter-track {
    width: 44px !important;
    height: 6px !important;
  }
  .stratlog-mob-cell-score .score-val-wrap {
    font-size: 11px !important;
    font-weight: 700 !important;
  }

  .stratlog-mob-cell-status {
    width: 22% !important;
    text-align: center !important;
    padding: 6px 4px !important;
  }
  .stratlog-mob-cell-status .btn-action-col,
  .stratlog-mob-cell-status .btn-status-exit {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    min-width: 52px !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
  }
}

/* ==============================================================================
   OPTIONS ORDER DRAWER RESPONSIVE LOADING & SELECTION LOCKING
   ============================================================================== */
.drawer-updating-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  animation: pulseUpdating 1.5s infinite;
  margin-left: auto;
}

@keyframes pulseUpdating {
  0% { opacity: 0.85; }
  50% { opacity: 1; }
  100% { opacity: 0.85; }
}

.drawer-updating-spinner {
  width: 11px;
  height: 11px;
  border: 2px solid #93C5FD;
  border-top-color: #1D4ED8;
  border-radius: 50%;
  animation: spinUpdating 0.7s linear infinite;
  display: inline-block;
}

.drawer-btn-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spinUpdating 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
}

@keyframes spinUpdating {
  to { transform: rotate(360deg); }
}

/* While drawer is updating, lock interactive elements to avoid freezing and overlapping requests */
#options-order-drawer.is-updating .drawer-matrix-table-wrap,
#options-order-drawer.is-updating .drawer-pills-wrap,
#options-order-drawer.is-updating .drawer-strat-pills-grid-4,
#options-order-drawer.is-updating .drawer-exp-pills-grid-3,
#options-order-drawer.is-updating .drawer-leg-card,
#options-order-drawer.is-updating .drawer-sequence-pills,
#options-order-drawer.is-updating .drawer-btn-refresh {
  pointer-events: none !important;
  opacity: 0.60 !important;
  cursor: wait !important;
  transition: opacity 0.15s ease;
}

#options-order-drawer.is-updating .drawer-btn-execute {
  pointer-events: none !important;
  opacity: 0.88 !important;
  cursor: wait !important;
  background: #059669 !important;
  color: #FFFFFF !important;
  transition: opacity 0.15s ease;
}

#options-order-drawer.is-updating .drawer-matrix-tbl tbody tr {
  cursor: wait !important;
}

#options-order-drawer.is-updating .drawer-btn-cancel {
  pointer-events: auto !important;
  opacity: 1 !important;
  cursor: pointer !important;
}

/* Live vs Indicative vs Updating Badges */
.drawer-updating-badge.drawer-badge-loading {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}

.drawer-updating-badge.drawer-badge-live {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #166534;
  animation: none;
}

.drawer-updating-badge.drawer-badge-indicative {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #B45309;
  animation: none;
}

.drawer-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16A34A;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.drawer-indicative-icon {
  font-size: 11px;
}

/* ==============================================================================
   DRAWER DESKTOP INTEGRITY (>= 769px)
   ============================================================================== */
@media (min-width: 769px) {
  .lbl-full {
    display: inline !important;
  }
  .lbl-short {
    display: none !important;
  }
  .drawer-mobile-tabs {
    display: none !important;
  }
  .drawer-main-grid-replica {
    display: grid !important;
    grid-template-columns: 480px 1fr !important;
  }
  .drawer-left-pane {
    display: flex !important;
  }
  .drawer-right-pane {
    display: flex !important;
    flex-direction: column !important;
  }
  #drawer-sell-box {
    border-radius: 6px 6px 0 0 !important;
    border-bottom: none !important;
    margin-bottom: 0 !important;
  }
  #drawer-buy-box {
    border-radius: 0 0 6px 6px !important;
    border-top: none !important;
    margin-top: 0 !important;
  }
  #drawer-buy-box .buy-leg-header {
    display: none !important;
  }
  .col-matrix-sel { width: 60px !important; }
  .col-matrix-strike { width: auto !important; }
  .col-matrix-steps { width: 70px !important; }
  .col-matrix-val { width: 85px !important; }
  .col-matrix-metric { width: 65px !important; }
}

/* ==============================================================================
   DRAWER MOBILE SINGLE-FLOW REDESIGN (<= 768px)
   Exact Sequence requested by User:
   1. 🟢 Bullish | 🔴 Bearish | Shooniya | ATM : 23,150
   2. Long | Credit | Debit | Ratio
   3. 27-Oct (9) | 23-NOV (36) | 29-DEC(72)
   4. SELL Leg (LEG | STRIKE | LIMIT | LOTS & QTY)
   5. Strike Selection (Select | Strike | Steps | Value | RR)
   6. BUY Leg (LEG | STRIKE | LIMIT | LOTS & QTY)
   7. Payoff Bar (Risk | Reward | RR | POP | Breakeven)
   8. Actions (Sell First | Cancel | Refresh | Execute)
   ============================================================================== */
@media (max-width: 768px) {
  .lbl-full {
    display: none !important;
  }
  .lbl-short {
    display: inline !important;
  }

  .drawer-mobile-tabs {
    display: none !important;
  }

  /* Universal 11px Font Size across 100% of mobile drawer elements */
  #options-order-drawer-host,
  #options-order-drawer-host *,
  #options-order-drawer,
  #options-order-drawer *,
  .drawer-main-grid-replica,
  .drawer-main-grid-replica * {
    font-size: 11px !important;
  }

  /* Clearance for sticky header when auto-scrolling */
  #options-order-drawer-host,
  #options-order-drawer {
    scroll-margin-top: 85px !important;
  }

  .drawer-container.inline-drawer-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 4px 0 16px 0 !important;
    border-radius: 6px !important;
    background: #F0F7FF !important;
    border: 1px solid #BFDBFE !important;
  }

  .drawer-main-grid-replica {
    display: flex !important;
    flex-direction: column !important;
    padding: 8px 6px !important;
    gap: 6px !important;
    background: #F0F7FF !important;
  }

  /* Flatten drawer-right-pane so children participate directly in flex ordering */
  .drawer-right-pane {
    display: contents !important;
  }

  /* 1. Status Bar: Direction + Shooniya + ATM */
  .drawer-right-pane .top-status-bar,
  .top-status-bar {
    order: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 4px 2px !important;
    gap: 4px !important;
    width: 100% !important;
  }
  .trend-group-left {
    display: flex !important;
    gap: 4px !important;
  }
  .trend-group-left .pill {
    padding: 4px 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
  }
  .broker-group-middle .pill {
    padding: 4px 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
  }
  .atm-badge {
    padding: 4px 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
  }

  /* 2. Strategy Selector Bar: Long | Credit | Debit | Ratio */
  .drawer-right-pane .button-bar {
    order: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4px !important;
    margin: 2px 0 4px 0 !important;
    width: 100% !important;
  }
  .drawer-right-pane .button-bar .btn-tab {
    padding: 6px 2px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* 3. Expiry Bar: 27-Oct (9) | 23-Nov (36) | 29-Dec (72) */
  .drawer-right-pane .expiry-bar {
    order: 3 !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
    margin: 2px 0 4px 0 !important;
    width: 100% !important;
  }
  .drawer-right-pane .expiry-bar .btn-expiry {
    padding: 6px 2px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* 4. SELL Leg Table Box */
  #drawer-sell-box {
    order: 4 !important;
    width: 100% !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    margin-bottom: 2px !important;
    background: #ffffff !important;
  }
  #drawer-sell-box.is-buy-only {
    display: none !important;
  }

  /* 5. Inline Strike Selection Box (4-Line Swipe Scroll & Proportional Layout) */
  .drawer-left-pane {
    order: 5 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 6px !important;
    margin: 4px 0 !important;
    gap: 4px !important;
  }
  .drawer-left-pane .section-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 2px 2px 4px 2px !important;
    color: #0F172A !important;
  }
  .drawer-left-pane .strike-table-box {
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    max-height: 158px !important; /* Exactly 4 visible strike lines + sticky header at 11px font */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
  }
  .drawer-left-pane .strike-table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }
  .drawer-left-pane .strike-table thead th {
    position: sticky !important;
    top: 0 !important;
    background: #f1f5f9 !important;
    z-index: 5 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
    padding: 6px 3px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #64748B !important;
  }
  .drawer-left-pane .strike-table td {
    padding: 5px 3px !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 11px !important;
  }
  /* Precise Column Proportions: 16% + 26% + 18% + 24% + 16% = 100% */
  .col-matrix-sel {
    width: 16% !important;
    text-align: center !important;
  }
  .col-matrix-strike {
    width: 26% !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
    padding-left: 2px !important;
  }
  .col-matrix-steps {
    width: 18% !important;
    text-align: center !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    font-weight: 700 !important;
  }
  .col-matrix-val {
    width: 24% !important;
    text-align: right !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
  }
  .col-matrix-metric {
    width: 16% !important;
    text-align: right !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    padding-right: 6px !important;
  }
  .drawer-left-pane .btn-select {
    padding: 2px 4px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    width: 100% !important;
    max-width: 48px !important;
    text-align: center !important;
    display: inline-block !important;
    box-sizing: border-box !important;
  }

  /* 6. BUY Leg Table Box */
  #drawer-buy-box {
    order: 6 !important;
    width: 100% !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    margin-top: 2px !important;
    margin-bottom: 4px !important;
    background: #ffffff !important;
  }
  #drawer-buy-box .buy-leg-header {
    display: table-header-group !important;
  }

  /* Hide LEVEL and VALUE columns on mobile to ensure clean 360px fit */
  .col-hide-mobile {
    display: none !important;
  }

  /* Precise Proportional Columns for Leg Tables: 14% + 38% + 22% + 26% = 100% */
  .leg-table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
  }
  .leg-table th,
  .leg-table td {
    box-sizing: border-box !important;
    vertical-align: middle !important;
    font-size: 11px !important;
  }
  .leg-table th {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #64748B !important;
    padding: 6px 2px !important;
  }
  .leg-table th:nth-child(1),
  .leg-table td:nth-child(1) {
    width: 14% !important;
    text-align: center !important;
    padding: 5px 2px !important;
  }
  .leg-table th:nth-child(2),
  .leg-table td:nth-child(2) {
    width: 38% !important;
    text-align: left !important;
    padding: 5px 4px !important;
  }
  .leg-table th:nth-child(4),
  .leg-table td:nth-child(4) {
    width: 22% !important;
    text-align: right !important;
    padding: 5px 4px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
  }
  .leg-table th:nth-child(6),
  .leg-table td:nth-child(6) {
    width: 26% !important;
    text-align: center !important;
    padding: 5px 2px !important;
  }

  .leg-table .badge-action {
    padding: 2px 4px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
  }
  .leg-table .leg-select {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 2px 2px !important;
    box-sizing: border-box !important;
  }
  .qty-ctrl-inline {
    gap: 2px !important;
    justify-content: center !important;
  }
  .qty-btn {
    width: 20px !important;
    height: 20px !important;
    padding: 0 !important;
    font-size: 11px !important;
    line-height: 18px !important;
  }
  .qty-label-single-line {
    font-size: 11px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  /* 7. Payoff Metrics Strip */
  .drawer-right-pane .metrics-strip {
    order: 7 !important;
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    width: 100% !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 6px 2px !important;
    margin: 4px 0 !important;
  }
  .drawer-right-pane .metric-item {
    padding: 0 2px !important;
  }
  .drawer-right-pane .metric-lbl {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #64748B !important;
  }
  .drawer-right-pane .metric-val {
    font-size: 11px !important;
    font-weight: 800 !important;
  }

  /* 8. Action Controls Bar */
  .drawer-right-pane .action-bar {
    order: 8 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    padding: 6px 0 !important;
    width: 100% !important;
  }
  .drawer-right-pane .toggle-exec-seq {
    padding: 6px 8px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }
  .drawer-right-pane .btn-group-right {
    display: flex !important;
    gap: 4px !important;
    justify-content: flex-end !important;
  }
  .drawer-right-pane .btn-action {
    padding: 6px 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
  }
  .drawer-right-pane .btn-execute {
    padding: 6px 12px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
  }

  /* Alert Message */
  #drawer-alert-msg {
    order: 9 !important;
    width: 100% !important;
    font-size: 11px !important;
  }
}

/* ==========================================================================
   POSITION & PAYOFF DRAWER STYLING (NO TOP HEADER)
   ========================================================================== */
.pos-drawer-container {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
  padding: 14px !important;
  max-width: 1080px !important;
  margin: 8px auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.pos-drawer-main-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
  width: 100% !important;
}

@media (max-width: 960px) {
  .pos-drawer-main-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* LEFT PANE (Payoff & Metrics View) */
.pos-drawer-left-pane,
.pos-drawer-payoff-pane {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 8px !important;
  padding: 12px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 440px !important;
}

/* RIGHT PANE (Strategies & Action Controls) */
.pos-drawer-right-pane,
.pos-drawer-strat-pane {
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 8px !important;
  padding: 12px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 440px !important;
}

.pos-strategy-cards-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  overflow-y: auto !important;
  max-height: 380px !important;
  padding-right: 4px !important;
}

.pos-strategy-card {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
  transition: border-color 0.15s ease !important;
}
.pos-strategy-card:hover {
  border-color: #CBD5E1 !important;
}

/* Card Header Line */
.pos-card-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-bottom: 8px !important;
  margin-bottom: 8px !important;
  border-bottom: 1px solid #F1F5F9 !important;
}
.pos-card-header-left {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.pos-strat-type-badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 2px 8px !important;
  border-radius: 4px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}
.pos-badge-credit {
  background: #ECFDF5 !important;
  color: #059669 !important;
  border: 1px solid #A7F3D0 !important;
}
.pos-badge-debit {
  background: #EFF6FF !important;
  color: #2563EB !important;
  border: 1px solid #BFDBFE !important;
}
.pos-badge-long {
  background: #F0F9FF !important;
  color: #0284C7 !important;
  border: 1px solid #BAE6FD !important;
}
.pos-badge-ratio {
  background: #FAF5FF !important;
  color: #7C3AED !important;
  border: 1px solid #DDD6FE !important;
}

.pos-strat-sym-title {
  font-size: 12px !important;
  font-weight: 800 !important;
  color: #1E293B !important;
}

.pos-card-header-mid {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
}

.pos-card-expiry {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  background: #F0F9FF !important;
  border: 1px solid #BAE6FD !important;
  padding: 2px 8px !important;
  border-radius: 4px !important;
}

.pos-exp-date {
  font-size: 12px !important;
  font-weight: 800 !important;
  color: #0369A1 !important;
  letter-spacing: 0.3px !important;
}

.pos-exp-dte {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #0D9488 !important;
}

.pos-card-header-right {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
.pos-card-pnl {
  font-size: 12px !important;
  font-weight: 800 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
}
.pos-pnl-pos {
  background: #ECFDF5 !important;
  color: #059669 !important;
}
.pos-pnl-neg {
  background: #FFF1F2 !important;
  color: #E11D48 !important;
}
.pos-pnl-zero {
  background: #F1F5F9 !important;
  color: #64748B !important;
}

.pos-card-checkbox-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  cursor: pointer !important;
  user-select: none !important;
}

/* Leg Rows Table */
.pos-legs-table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 11px !important;
  margin-bottom: 8px !important;
}
.pos-legs-table th {
  padding: 3px 6px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #94A3B8 !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid #F1F5F9 !important;
}
.pos-legs-table td {
  padding: 5px 6px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  border-bottom: 1px solid #F8FAFC !important;
}
.pos-leg-side-sell {
  display: inline-block !important;
  padding: 1px 5px !important;
  border-radius: 3px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  background: #FFE4E6 !important;
  color: #E11D48 !important;
}
.pos-leg-side-buy {
  display: inline-block !important;
  padding: 1px 5px !important;
  border-radius: 3px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  background: #E0F2FE !important;
  color: #0369A1 !important;
}
.pos-leg-sym {
  font-weight: 800 !important;
  color: #0F172A !important;
}
.pos-legs-table td.pos-leg-pnl-pos,
.pos-mleg-pnl.pos-leg-pnl-pos {
  color: #059669 !important;
}
.pos-legs-table td.pos-leg-pnl-neg,
.pos-mleg-pnl.pos-leg-pnl-neg {
  color: #E11D48 !important;
}
.pos-legs-table td.pos-leg-pnl-zero,
.pos-mleg-pnl.pos-leg-pnl-zero {
  color: #64748B !important;
}

/* Card Summary Line */
.pos-card-summary {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-top: 6px !important;
  border-top: 1px solid #F1F5F9 !important;
  font-size: 11px !important;
}
.pos-summary-text {
  color: #64748B !important;
}
.pos-summary-text strong {
  color: #0F172A !important;
}
.pos-pct-badge {
  font-weight: 800 !important;
  padding: 1px 5px !important;
  border-radius: 3px !important;
}
.pos-card-exit-btn {
  padding: 3px 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #E11D48 !important;
  background: #FFF1F2 !important;
  border: 1px solid #FECDD3 !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: background 0.15s ease !important;
}
.pos-card-exit-btn:hover {
  background: #FFE4E6 !important;
}

/* Bottom Bar Controls */
.pos-drawer-bottom-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-top: 10px !important;
  margin-top: 10px !important;
  border-top: 1px solid #E2E8F0 !important;
}
.pos-include-all-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #334155 !important;
  cursor: pointer !important;
  user-select: none !important;
}
.pos-custom-checkbox {
  width: 15px !important;
  height: 15px !important;
  accent-color: #0284C7 !important;
  cursor: pointer !important;
}
.pos-bottom-btns {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.pos-btn-action {
  padding: 5px 12px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}
.pos-btn-cancel, .pos-btn-refresh {
  background: #FFFFFF !important;
  color: #475569 !important;
  border: 1px solid #CBD5E1 !important;
}
.pos-btn-cancel:hover, .pos-btn-refresh:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}
.pos-btn-add {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  border: 1px solid #0284C7 !important;
  font-weight: 700 !important;
}
.pos-btn-add:hover {
  background: #0369A1 !important;
}

/* RIGHT PANE (Payoff & Metrics) */
.pos-drawer-right-pane {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 8px !important;
  padding: 12px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 440px !important;
}

.pos-payoff-top-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 8px !important;
}
.pos-payoff-title-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.pos-payoff-title {
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #0F172A !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}
.pos-payoff-badge {
  padding: 2px 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  background: #F0F9FF !important;
  color: #0284C7 !important;
  border: 1px solid #BAE6FD !important;
  border-radius: 4px !important;
}
.pos-spot-display {
  font-size: 12px !important;
  color: #64748B !important;
}
.pos-spot-display strong {
  color: #0F172A !important;
}

/* SVG Chart Box */
.pos-payoff-chart-box {
  position: relative !important;
  width: 100% !important;
  height: 270px !important;
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  padding: 6px !important;
  box-sizing: border-box !important;
}
.pos-payoff-svg {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  cursor: crosshair !important;
}
.pos-chart-tooltip {
  position: absolute !important;
  pointer-events: none !important;
  background: #0F172A !important;
  color: #FFFFFF !important;
  font-size: 11px !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important;
  transform: translate(-50%, -100%) !important;
  z-index: 10 !important;
  white-space: nowrap !important;
}

/* Metrics for View */
.pos-metrics-wrap {
  margin-top: 10px !important;
  padding-top: 10px !important;
  border-top: 1px solid #E2E8F0 !important;
}
.pos-metrics-title {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #64748B !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 6px !important;
}
.pos-metrics-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 8px !important;
}
@media (max-width: 600px) {
  .pos-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
.pos-metric-card {
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 6px !important;
  padding: 6px 8px !important;
}
.pos-metric-lbl {
  font-size: 10px !important;
  font-weight: 600 !important;
  color: #64748B !important;
  margin-bottom: 2px !important;
}
.pos-metric-val {
  font-size: 12px !important;
  font-weight: 800 !important;
  color: #0F172A !important;
}
.pos-val-profit {
  color: #059669 !important;
}
.pos-val-loss {
  color: #E11D48 !important;
}

/* Horizontal Scroll Wrapper for Position Legs Table (Desktop & Tablet) */
.pos-legs-table-wrap {
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  margin-bottom: 8px !important;
}

/* Mobile Legs Card Layout (Hidden by default on Desktop/Tablet) */
.pos-mobile-legs-list {
  display: none !important;
}

/* Responsive Overrides for Position & Payoff Drawer (<= 768px) */
@media (max-width: 768px) {
  .pos-drawer-container {
    padding: 8px !important;
    margin: 4px auto !important;
    max-width: 100% !important;
  }
  .pos-drawer-main-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .pos-drawer-left-pane,
  .pos-drawer-right-pane,
  .pos-drawer-payoff-pane,
  .pos-drawer-strat-pane {
    min-height: auto !important;
    justify-content: flex-start !important;
    padding: 10px 8px !important;
    gap: 10px !important;
  }
  .pos-strategy-cards-list {
    max-height: none !important;
    padding-right: 0 !important;
    gap: 8px !important;
  }
  .pos-strategy-card {
    padding: 8px 8px !important;
  }
  .pos-card-header {
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding-bottom: 6px !important;
    margin-bottom: 6px !important;
  }
  .pos-card-summary {
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding-top: 6px !important;
  }
  .pos-summary-text {
    font-size: 11px !important;
    line-height: 1.4 !important;
  }

  /* 2-Row Clean Bottom Action Bar */
  .pos-drawer-bottom-bar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding-top: 8px !important;
    margin-top: 6px !important;
    border-top: 1px solid #E2E8F0 !important;
  }
  .pos-include-all-label {
    width: 100% !important;
    font-size: 11px !important;
  }
  .pos-bottom-btns {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1.3fr !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .pos-btn-action {
    width: 100% !important;
    padding: 6px 4px !important;
    font-size: 11px !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
  .pos-payoff-chart-box {
    height: 230px !important;
    padding: 4px !important;
    touch-action: pan-y !important;
  }
  .pos-payoff-svg {
    touch-action: pan-y !important;
  }
  .pos-metrics-wrap {
    margin-top: 8px !important;
    padding-top: 8px !important;
  }
  .pos-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
  .pos-metric-card {
    padding: 5px 6px !important;
  }
  .pos-metric-lbl {
    font-size: 9px !important;
  }
  .pos-metric-val {
    font-size: 11px !important;
  }
}

/* Smartphone Specific Overrides (<= 600px): Clean Mobile Leg Cards */
@media (max-width: 600px) {
  .pos-legs-table-wrap {
    display: none !important;
  }
  .pos-mobile-legs-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin-bottom: 8px !important;
  }
  .pos-mobile-leg-card {
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 6px !important;
    padding: 6px 8px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }
  .pos-mleg-row1, .pos-mleg-row2 {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .pos-mleg-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }
  .pos-mleg-strike {
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #0F172A !important;
  }
  .pos-mleg-price-flow {
    font-size: 11px !important;
    color: #64748B !important;
  }
  .pos-mleg-price-flow strong {
    color: #0F172A !important;
  }
  .pos-mleg-qty {
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #64748B !important;
  }
  .pos-mleg-pnl {
    font-size: 11px !important;
    font-weight: 800 !important;
  }
}






