/* Bybit Shadow Observability Dashboard — Dark RTL Theme */
:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --blocked: #dc2626;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Cairo", sans-serif;
}

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

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Governance Banner */
.app-header {
  background-color: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
  padding: 16px 24px;
}

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

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

.pulse-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
  display: inline-block;
}

.app-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.badge-sub {
  font-size: 0.8rem;
  background-color: var(--bg-tertiary);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
}

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

.gate-badge.blocked {
  background-color: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
  border: 1px solid var(--blocked);
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
}

.env-badge {
  background-color: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid var(--success);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.mandatory-identity-banner {
  margin-top: 14px;
  background-color: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--warning);
  color: #fde68a;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.95rem;
  text-align: center;
}

.hidden {
  display: none !important;
}

.fixture-demo-banner {
  margin-top: 10px;
  background-color: rgba(220, 38, 38, 0.25);
  border: 2px solid var(--blocked);
  color: #fecaca;
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.2);
}

.mode-badge.fixture {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid var(--warning);
}

.mode-badge.live-projection {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid var(--success);
}

.status-badge-offline {
  background-color: rgba(100, 116, 139, 0.3);
  color: #94a3b8;
  border: 1px solid #64748b;
}

.status-badge-nodata {
  background-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid var(--danger);
}

.status-positive {
  color: #10b981;
  font-weight: 700;
}

.status-negative {
  color: #ef4444;
  font-weight: 700;
}

.status-warning {
  color: #f59e0b;
  font-weight: 700;
}

.status-not-verified {
  color: #fbbf24;
  font-weight: 700;
}

.status-no-data {
  color: #94a3b8;
  font-weight: 700;
}

.status-corrupted {
  color: #ef4444;
  font-weight: 700;
  text-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

.text-subtle {
  font-size: 0.8rem;
  color: #94a3b8;
}

.text-code {
  font-family: monospace;
}

/* Navigation Tabs */
.main-nav {
  display: flex;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-main);
}

.nav-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

/* Content Container & Panels */
.content-container {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* Grids & Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

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

.metric-sub-spaced {
  margin-top: 6px;
}

.chart-svg {
  overflow: visible;
}

.metric-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 18px 20px;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.metric-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.metric-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.metric-value.status-ok {
  color: var(--success);
}

.warning-text {
  color: var(--warning);
}

.hash-card .hash-text {
  font-family: monospace;
  font-size: 0.75rem;
  word-break: break-all;
  background-color: var(--bg-primary);
  padding: 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

/* Overview Summary Box */
.overview-summary-box {
  margin-top: 24px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
}

.overview-summary-box h3 {
  margin-bottom: 12px;
  font-size: 1.15rem;
  color: var(--accent-cyan);
}

.decision-rationale-alert {
  margin-top: 16px;
  background-color: rgba(220, 38, 38, 0.1);
  border-right: 4px solid var(--blocked);
  padding: 12px 16px;
  border-radius: 4px;
  color: #fca5a5;
  font-size: 0.9rem;
}

/* Table Cards */
.table-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

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

.table-header h3 {
  font-size: 1.1rem;
}

.table-badge {
  font-size: 0.8rem;
  background-color: var(--bg-tertiary);
  color: var(--warning);
  padding: 3px 8px;
  border-radius: 4px;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.9rem;
}

.data-table th {
  background-color: rgba(15, 23, 42, 0.6);
  color: var(--text-muted);
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.data-table tr:hover {
  background-color: rgba(51, 65, 85, 0.3);
}

/* Badges */
.badge-status {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-status.ok {
  background-color: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.badge-status.rejected {
  background-color: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
}

.badge-status.buy {
  background-color: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.badge-status.sell {
  background-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.badge-status.valid {
  background-color: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid #10b981;
}

.badge-status.not-verified {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid #f59e0b;
}

.badge-status.no-data {
  background-color: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid #64748b;
}

.badge-status.corrupted {
  background-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid #ef4444;
  font-weight: 700;
}

/* Charts */
.chart-container-card {
  margin-top: 24px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.legend-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: var(--accent-cyan);
  border-radius: 2px;
  margin-left: 6px;
}

.svg-chart-box {
  width: 100%;
  height: 240px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.methodology-note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Footer */
.app-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .app-header {
    padding: 12px 14px;
  }
  .header-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .logo-area {
    justify-content: flex-start;
  }
  .app-title {
    font-size: 1.15rem;
  }
  .header-badges {
    flex-wrap: wrap;
    gap: 8px;
  }
  .gate-badge.blocked, .env-badge {
    font-size: 0.75rem;
    padding: 3px 8px;
  }
  .mandatory-identity-banner, .fixture-demo-banner {
    font-size: 0.82rem;
    padding: 8px 10px;
  }
  .main-nav {
    padding: 0 8px;
  }
  .nav-tab {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
  .content-container {
    padding: 12px;
  }
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .metric-card {
    padding: 14px 16px;
  }
  .metric-value {
    font-size: 1.25rem;
  }
}


/* ==========================================================================
   B2.6 Shadow Research Workbench Additions
   ========================================================================== */

.segregation-banner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

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

.segregation-zone {
  border-radius: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.zone-research {
  border-right: 4px solid #10b981;
  background: rgba(16, 185, 129, 0.06);
}

.zone-shadow {
  border-right: 4px solid #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}

.zone-execution {
  border-right: 4px solid #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

.zone-badge {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.zone-research .zone-badge { color: #34d399; }
.zone-shadow .zone-badge { color: #fbbf24; }
.zone-execution .zone-badge { color: #f87171; }

.zone-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.workbench-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.workbench-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pulse-indicator.research {
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.btn-export-research {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}

.btn-export-research:hover {
  opacity: 0.9;
}

.provenance-grid {
  margin-top: 10px;
}

/* Market Intelligence UI Styles (R2.6.2 Canonical Integration) */
.badge-category {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-status.regime-risk_on {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid #10b981;
}

.badge-status.regime-risk_off {
  background-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid #ef4444;
}

.badge-status.regime-mixed_divergence {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid #f59e0b;
}

.badge-status.regime-neutral {
  background-color: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border: 1px solid #64748b;
}

.state-banner {
  padding: 12px 16px;
  border-radius: 6px;
  margin-top: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.state-banner.state-loading {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.state-banner.state-error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.state-banner.state-empty {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.hidden {
  display: none !important;
}

/* M3 Integrated Research Studio Elements */
.btn-action-sm {
  background-color: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-sm:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-speed-pill {
  background-color: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-speed-pill.active,
.btn-speed-pill:hover {
  background-color: var(--accent-cyan);
  color: #0f172a;
  border-color: var(--accent-cyan);
}

.badge-lifecycle {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-lifecycle.lifecycle-research {
  background-color: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border: 1px solid #64748b;
}

.badge-lifecycle.lifecycle-candidate {
  background-color: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid #3b82f6;
}

.badge-lifecycle.lifecycle-shadow {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid #f59e0b;
}

.badge-lifecycle.lifecycle-review {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid #10b981;
}


/* Guided Tour Modal */
.tour-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.tour-modal-box {
  background-color: var(--bg-secondary);
  border: 2px solid var(--accent-cyan);
  border-radius: 12px;
  max-width: 540px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  direction: rtl;
  text-align: right;
  animation: modalFadeIn 0.25s ease-out;
}

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

.btn-tour {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-tour:hover {
  background: var(--accent-cyan);
  color: #0f172a;
}

/* Responsive Navigation & Touch Targets */
@media (max-width: 900px) {
  .main-nav {
    display: flex;
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 6px;
    overflow-x: visible;
  }
  .nav-tab {
    padding: 10px 14px;
    font-size: 0.88rem;
    border-radius: 6px;
    border-bottom: 2px solid transparent;
    background: var(--bg-primary);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 calc(33.333% - 6px);
    text-align: center;
  }
  .nav-tab.active {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    font-weight: 700;
  }
  .nav-secondary-group {
    width: 100%;
    margin-right: 0 !important;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
  }
}

@media (max-width: 600px) {
  .nav-tab {
    flex: 1 1 calc(50% - 6px);
  }
  .primary-cards-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   BYBIT UX 2.0 — SIMPLE MODE & EXECUTIVE DASHBOARD STYLES
   ========================================================================== */

.compact-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  gap: 6px;
}
.compact-pill.status-real {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid #10b981;
}
.compact-pill.status-shadow {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid #3b82f6;
}

.mode-toggle-container {
  display: inline-flex;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.mode-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mode-btn.active {
  background: var(--accent-cyan);
  color: #0f172a;
  font-weight: 800;
}

/* Executive Hero Card */
.hero-executive-summary {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(6, 182, 212, 0.06) 100%);
  border: 2px solid var(--accent-cyan);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 24px;
}
.hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.hero-equity-block .hero-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}
.hero-value {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--accent-cyan);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.hero-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 800;
}
.hero-status-pill.status-stable {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid #10b981;
}
.hero-status-pill.status-action {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid #f59e0b;
}

.hero-decision-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-decision-card .decision-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
}
.hero-decision-card .decision-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #34d399;
}
.hero-story-text {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0;
}

/* 4 Simple Cards Grid */
.simple-4-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.simple-card {
  padding: 18px 20px;
  border-radius: 10px;
}
.simple-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.simple-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}
.simple-card-badge {
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  color: var(--accent-cyan);
  padding: 3px 8px;
  border-radius: 4px;
}
.badge-pilot {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border: 1px solid #f59e0b;
}

.btn-expand-analytics {
  background: var(--bg-secondary);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-expand-analytics:hover {
  background: rgba(6, 182, 212, 0.15);
}

.btn-text-link {
  background: transparent;
  color: var(--accent-cyan);
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: underline;
}

/* Connected State Box */
.connected-summary-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid #10b981;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Sub-nav in Lab */
.sub-nav-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 20px;
}
.sub-nav-tab {
  background: var(--bg-primary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sub-nav-tab.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
}

/* Mobile-First Adaptations */
@media (max-width: 768px) {
  .hero-value {
    font-size: 2.1rem;
  }
  .simple-4-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  .hero-executive-summary {
    padding: 18px 18px;
  }
}

/* ==========================================================================
   BARAA Control Plane Assistant (Track B)
   ========================================================================== */

.baraa-launcher {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #0f766e 0%, #0e7490 100%);
  color: #f8fafc;
  border: 2px solid var(--accent-cyan);
  border-radius: 9999px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(6, 182, 212, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.baraa-launcher:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 30px -5px rgba(6, 182, 212, 0.6);
  border-color: #67e8f9;
}

.baraa-launcher-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.baraa-launcher-badge {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
}

.baraa-drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.baraa-drawer.open {
  display: flex !important;
  pointer-events: auto;
}

.baraa-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.baraa-drawer.open .baraa-backdrop {
  opacity: 1;
}

.baraa-panel {
  position: relative;
  width: 440px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  pointer-events: auto;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.baraa-drawer.open .baraa-panel {
  transform: translateX(0);
}

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

.baraa-quick-chips {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  scrollbar-width: thin;
}

.baraa-chip {
  white-space: nowrap;
  background: var(--bg-primary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.baraa-chip:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
}

.baraa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
}

.baraa-message {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  animation: fadeIn 0.2s ease;
}

.baraa-message.user {
  align-self: flex-start;
}

.baraa-message.assistant {
  align-self: flex-end;
  max-width: 95%;
}

.baraa-bubble {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.6;
  word-break: break-word;
}

.baraa-message.user .baraa-bubble {
  background: var(--accent-cyan);
  color: #0f172a;
  font-weight: 600;
  border-bottom-left-radius: 2px;
}

.baraa-message.assistant .baraa-bubble {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-bottom-right-radius: 2px;
}

.baraa-message.blocked .baraa-bubble {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.baraa-why-details {
  margin-top: 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.5);
  font-size: 0.78rem;
  overflow: hidden;
}

.baraa-why-summary {
  padding: 6px 10px;
  color: var(--accent-cyan);
  cursor: pointer;
  font-weight: 700;
  user-select: none;
}

.baraa-why-content {
  padding: 8px 10px;
  color: #94a3b8;
  border-top: 1px dashed var(--border-color);
  line-height: 1.5;
}

.baraa-action-card {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid var(--accent-cyan);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.baraa-input-bar {
  padding: 12px 16px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
}

.baraa-input-bar textarea {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  font-family: inherit;
}

.baraa-input-bar textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

/* Mobile responsive bottom-sheet on <= 640px */
@media (max-width: 640px) {
  .baraa-launcher {
    bottom: 16px;
    left: 16px;
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .baraa-drawer {
    justify-content: flex-end;
    align-items: flex-end;
  }

  .baraa-panel {
    width: 100vw;
    height: 85vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    border-left: none;
    border-top: 2px solid var(--accent-cyan);
  }

  .baraa-drawer.open .baraa-panel {
    transform: translateY(0);
  }
}

/* ==========================================================================
   CSP-Safe Visibility & V2 Research & Decision Platform RTL Styles
   ========================================================================== */
.mandatory-identity-banner:not(.open),
.fixture-demo-banner:not(.open),
.tour-modal-backdrop:not(.open),
.baraa-drawer:not(.open),
.advanced-section:not(.open) {
  display: none;
}

.tour-modal-backdrop.open {
  display: flex;
}

.advanced-section.open {
  display: block;
}

.v2-hub-container {
  background: var(--bg-secondary);
  border: 2px solid var(--accent-cyan);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}

.v2-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.v2-hub-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin: 0 0 6px 0;
}

.v2-hub-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.v2-badges-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.v2-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-main);
}

.v2-mode-badge.badge-historical {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border-color: #3b82f6;
}

.v2-mode-badge.badge-forward {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: #10b981;
}

.v2-mode-badge.badge-virtual {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border-color: #a855f7;
}

.v2-mode-badge.badge-real-locked {
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
  border-color: #f59e0b;
}

.v2-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.v2-tab-btn {
  background: var(--bg-primary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.v2-tab-btn:hover {
  color: var(--text-main);
  border-color: var(--accent-cyan);
}

.v2-tab-btn.active {
  background: var(--accent-cyan);
  color: #0f172a;
  border-color: var(--accent-cyan);
}

.v2-tab-panel {
  display: none;
}

.v2-tab-panel.active {
  display: block;
}

.v2-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.v2-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
}

.v2-card-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.v2-card-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.v2-card-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.v2-section-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.v2-section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin: 0 0 12px 0;
}

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

.v2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: right;
}

.v2-table th,
.v2-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.v2-table th {
  color: var(--text-muted);
  font-weight: 700;
  background: rgba(15, 23, 42, 0.5);
}

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

.v2-btn {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.v2-btn.primary {
  background: var(--accent-cyan);
  color: #0f172a;
  border-color: var(--accent-cyan);
}

.v2-btn.success {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: #10b981;
}

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

.v2-input {
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 7px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  width: 130px;
}

@media (max-width: 640px) {
  .v2-hub-container {
    padding: 14px;
  }
  .v2-tab-btn {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
    padding: 8px 8px;
    font-size: 0.8rem;
  }
  .v2-kpi-grid {
    grid-template-columns: 1fr;
  }
}





/* ==========================================================================
   🏢 INSTITUTIONAL DARK THEME & BENTO GRID SYSTEM (BRO-CEO v2.0)
   ========================================================================== */

:root {
  --bento-bg: #0B0F17;
  --bento-card: #111827;
  --bento-border: rgba(255, 255, 255, 0.08);
  --bento-emerald: #10B981;
  --bento-blue: #3B82F6;
  --bento-amber: #F59E0B;
  --bento-crimson: #EF4444;
}

body {
  background-color: var(--bento-bg) !important;
  color: #F3F4F6 !important;
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.tabular-num {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', 'Consolas', monospace !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -0.02em;
}

/* 5 Core Zones Bento Layout */
.bento-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-top: 18px;
  margin-bottom: 30px;
}

.bento-card {
  background: var(--bento-card);
  border: 1px solid var(--bento-border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

/* Zone 1: Command & Goal Tracker (Full Width 12 cols) */
.bento-zone-1 {
  grid-column: span 12;
}

/* Zone 2: Active Trades Pipeline (7 cols desktop) */
.bento-zone-2 {
  grid-column: span 12;
}

/* Zone 3: Pre-Breakout Scanner (5 cols desktop) */
.bento-zone-3 {
  grid-column: span 12;
}

/* Zone 4: Portfolio Optimizer & Dust Cleaner (7 cols desktop) */
.bento-zone-4 {
  grid-column: span 7;
}

/* Zone 5: Live Execution & Fee Audit (5 cols desktop) */
.bento-zone-5 {
  grid-column: span 5;
}

@media (max-width: 1024px) {
  .bento-zone-2, .bento-zone-3, .bento-zone-4, .bento-zone-5 {
    grid-column: span 12 !important;
  }
}

/* Compounding Progress Bar */
.compounding-bar-container {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 14px;
}

.milestones-track {
  position: relative;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  margin: 18px 0 10px 0;
  overflow: visible;
}

.milestones-progress {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #3B82F6);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.milestones-nodes {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.78rem;
  color: #9CA3AF;
}

/* Visual Trade Lifecycle Stepper */
.stepper-container {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 14px 0;
  position: relative;
}

.stepper-track-bg {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  margin: 14px 0;
}

.stepper-track-active {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  transition: all 0.4s ease;
}

.stepper-beacon {
  position: absolute;
  top: 50%;
  transform: translate(50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px #3B82F6, 0 0 20px #10B981;
  transition: left 0.4s ease;
  z-index: 10;
}

.stepper-node-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #9CA3AF;
}

.stepper-node-labels span.reached {
  color: #10B981;
  font-weight: 800;
}

/* Micro Action Buttons */
.btn-micro-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F3F4F6;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-micro-action:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.btn-micro-action.action-be {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10B981;
  color: #34D399;
}

.btn-micro-action.action-be:hover {
  background: rgba(16, 185, 129, 0.28);
}

.btn-micro-action.action-close {
  background: rgba(239, 68, 68, 0.15);
  border-color: #EF4444;
  color: #F87171;
}

.btn-micro-action.action-close:hover {
  background: rgba(239, 68, 68, 0.28);
}

/* Tab buttons for Portfolio Optimizer */
.optimizer-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #9CA3AF;
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.optimizer-tab-btn.active {
  color: #38BDF8;
  border-bottom-color: #38BDF8;
}

