/* ══════════════════════════════════════════════════════════════════
   MS EOD ANALYTICS — VANILLA CSS DESIGN SYSTEM TOKEN SHEET
   Dark Theme, Glassmorphism, Micro-Animations & Responsive Layout
   ══════════════════════════════════════════════════════════════════ */

:root {
  /* Dark Theme Color Palette */
  --bg-dark: #0b0f19;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --bg-sidebar: #070a12;
  --bg-topbar: rgba(11, 15, 25, 0.85);
  --bg-nav-active: rgba(37, 99, 235, 0.15);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-glass: rgba(255, 255, 255, 0.12);

  /* Typography Colors */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  /* Accent & Status Colors */
  --brand-blue: #3b82f6;
  --brand-blue-hover: #2563eb;
  --status-emerald: #10b981;
  --status-emerald-bg: rgba(16, 185, 129, 0.12);
  --status-amber: #f59e0b;
  --status-amber-bg: rgba(245, 158, 11, 0.12);
  --status-rose: #ef4444;
  --status-rose-bg: rgba(239, 68, 68, 0.12);
  --status-cyan: #06b6d4;
  --status-cyan-bg: rgba(6, 182, 212, 0.12);
  --accent-purple: #a855f7;
  --accent-purple-bg: rgba(168, 85, 247, 0.15);

  /* Typography Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── App Shell Flex Layout ─── */
.app-shell {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* ─── Sidebar Styling ─── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-brand {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-icon-square {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--brand-blue), #1d4ed8);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.sidebar-nav {
  padding: 16px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  border-radius: 6px;
  transition: all 0.15s ease;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active .nav-link {
  color: #ffffff;
  background-color: var(--bg-nav-active);
  border-left: 3px solid var(--brand-blue);
}

.nav-link i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-label-group {
  display: flex;
  flex-direction: column;
}

.nav-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.nav-desc {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.2;
  margin-top: 2px;
}

.nav-divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin: 4px 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-emerald);
  box-shadow: 0 0 6px var(--status-emerald);
}

/* ─── Main Content Shell ─── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

/* ─── Topbar Navigation Header ─── */
.topbar {
  height: 60px;
  padding: 0 24px;
  background-color: var(--bg-topbar);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.header-title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--status-emerald);
  background-color: var(--status-emerald-bg);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--status-emerald);
  box-shadow: 0 0 6px var(--status-emerald);
}

.header-divider {
  width: 1px;
  height: 20px;
  background-color: var(--border-subtle);
}

.header-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.header-date i {
  width: 14px;
  height: 14px;
}

/* ─── Content Area Viewport ─── */
.content-area {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

/* ─── Placeholder Page Container ─── */
.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  text-align: center;
}

.placeholder-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 40px;
  max-width: 480px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.placeholder-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px auto;
  border-radius: 12px;
  background: var(--bg-nav-active);
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-icon i {
  width: 28px;
  height: 28px;
}

.placeholder-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.placeholder-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.placeholder-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-dim);
}

/* ─── Dashboard Sections & Cards ─── */
.dashboard-section {
  margin-bottom: 24px;
}

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

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px;
  backdrop-filter: blur(8px);
}

/* ─── Segmented Control Toggle Switch (FII / DII) ─── */
.segmented-control {
  display: inline-flex;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.segmented-btn {
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.segmented-btn:hover {
  color: #ffffff;
}

.segmented-btn.active {
  background-color: var(--brand-blue);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

/* ─── Badges ─── */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-pill--emerald {
  background-color: var(--status-emerald-bg);
  color: var(--status-emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-pill--amber {
  background-color: var(--status-amber-bg);
  color: var(--status-amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-pill--rose {
  background-color: var(--status-rose-bg);
  color: var(--status-rose);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-pill--blue {
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--brand-blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-pill--cyan {
  background-color: var(--status-cyan-bg);
  color: var(--status-cyan);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-pill--purple {
  background-color: var(--accent-purple-bg);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* ─── State Pill Matrix ─── */
.state-pill-matrix {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.state-pill {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
}

.state-pill.active-state {
  background: var(--brand-blue);
  color: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* ─── Tables & Clickable Headers ─── */
.table-wrapper {
  overflow-x: auto;
}

.eod-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.eod-table th {
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  background-color: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.eod-table th.clickable-header {
  cursor: pointer;
  user-select: none;
}

.eod-table th.clickable-header:hover {
  color: #ffffff;
  background-color: rgba(59, 130, 246, 0.1);
}

.eod-table th.clickable-header.active-period {
  color: #ffffff;
  background-color: rgba(59, 130, 246, 0.25);
  border-bottom: 2px solid var(--brand-blue);
  box-shadow: inset 0 -2px 0 var(--brand-blue);
}

.eod-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.eod-table tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.val-pos {
  color: var(--status-emerald);
  font-weight: 600;
}

.val-neg {
  color: var(--status-rose);
  font-weight: 600;
}

.code-snippet {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--status-cyan);
}

/* ─── Grid Systems ─── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kv-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kv-label {
  font-size: 11px;
  color: var(--text-muted);
}

.kv-value {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

/* ─── SVG Bar Chart Container ─── */
.chart-container {
  width: 100%;
  height: 250px;
  position: relative;
}

.chart-svg {
  width: 100%;
  height: 100%;
}

/* ─── Responsive Media Queries ─── */
@media (max-width: 992px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .grid-2, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ─── Grouped Header Table & Sticky Column/Header (Derivative OI Page) ─── */
.table-wrapper-grouped {
  overflow-x: auto;
  max-height: 520px;
  position: relative;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.eod-table-grouped {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

/* First Column (Participant) Alignment */
.eod-table-grouped th:first-child,
.eod-table-grouped td:first-child {
  text-align: left;
}

/* Sticky Column: Participant */
.eod-table-grouped .sticky-col {
  position: sticky;
  left: 0;
  background-color: #0f172a !important;
  z-index: 10;
  border-right: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.4);
}

.eod-table-grouped th.sticky-col {
  z-index: 30;
  background-color: #1e293b !important;
}

/* Sticky Top Headers */
.eod-table-grouped thead tr:first-child th {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: #1e293b;
}

.eod-table-grouped thead tr:nth-child(2) th {
  position: sticky;
  top: 32px;
  z-index: 20;
  background-color: #162032;
}

/* Group Headers (Top Row) */
.eod-table-grouped th.header-group {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.eod-table-grouped th.header-group.group-now {
  background-color: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-bottom: 2px solid #3b82f6;
}

.eod-table-grouped th.header-group.group-day {
  background-color: rgba(16, 185, 129, 0.08);
  color: #34d399;
  border-bottom: 2px solid #10b981;
}

.eod-table-grouped th.header-group.group-week {
  background-color: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  border-bottom: 2px solid #f59e0b;
}

.eod-table-grouped th.header-group.group-month {
  background-color: rgba(168, 85, 247, 0.08);
  color: #c084fc;
  border-bottom: 2px solid #a855f7;
}

/* Sub Headers (Second Row) */
.eod-table-grouped th.sub-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.eod-table-grouped th.sub-header.sub-header-net {
  border-right: 2px solid rgba(255, 255, 255, 0.1);
  font-weight: 700;
  color: var(--text-main);
}

.eod-table-grouped td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.eod-table-grouped td.cell-net {
  border-right: 2px solid rgba(255, 255, 255, 0.1);
  font-weight: 700;
}

.eod-table-grouped tr:hover td {
  background-color: rgba(255, 255, 255, 0.03);
}

/* ─── FULLSCREEN TREND MODAL ─── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: 90vw;
  max-width: 1100px;
  height: 80vh;
  max-height: 750px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #1e293b;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.modal-body {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.net-trend-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  transition: all 0.2s ease;
}

.net-trend-icon-btn:hover {
  background: rgba(59, 130, 246, 0.35);
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════════════
   AGENT REPORT PAGE STYLING SYSTEM
   ══════════════════════════════════════════════════════════════════ */
.hero-bias-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 24px;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.12), transparent 70%), rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.hero-bias-card.bias-bullish {
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.15), transparent 70%), rgba(17, 24, 39, 0.7);
  border-color: rgba(16, 185, 129, 0.35);
}

.hero-bias-card.bias-bearish {
  background: radial-gradient(circle at 50% 0%, rgba(239, 68, 68, 0.15), transparent 70%), rgba(17, 24, 39, 0.7);
  border-color: rgba(239, 68, 68, 0.35);
}

.hero-bias-card.bias-neutral {
  background: radial-gradient(circle at 50% 0%, rgba(156, 163, 175, 0.12), transparent 70%), rgba(17, 24, 39, 0.7);
  border-color: rgba(156, 163, 175, 0.25);
}

.hero-bias-card.bias-mixed {
  background: radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.15), transparent 70%), rgba(17, 24, 39, 0.7);
  border-color: rgba(245, 158, 11, 0.35);
}

.hero-bias-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.hero-bias-value {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 8px;
  line-height: 1.1;
}

.hero-bias-score {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
}

.quick-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  gap: 16px;
  transition: all 0.2s ease;
}

.quick-summary-row:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: var(--border-glass);
}

.quick-summary-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.quick-summary-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

@media (min-width: 900px) {
  .agent-grid-2x2 {
    grid-template-columns: repeat(2, 1fr);
  }
}


