/* ==========================================================================
   AgentNexus Finance — Terminal Electric Stylesheet (finance.css)
   Aesthetics: Deep Space Terminal, Precision Monospace Telemetry, CRT Glow
   ========================================================================== */

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  position: relative;
  background-color: var(--bg-base);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Background Atmosphere: Fine Terminal Grid & CRT Scanline */
.terminal-grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
}

.terminal-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.22) 50%
  );
  background-size: 100% 4px;
  opacity: 0.6;
}

.finance-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px 80px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==========================================================================
   1. Top Terminal Bar
   ========================================================================== */
.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.terminal-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sharp);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.brand-text h1 {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-text p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.header-center-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: var(--radius-sharp);
  border: 1px solid var(--border-subtle);
}

.nav-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab-btn.active {
  color: #0A0E14;
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  font-weight: 600;
  box-shadow: 0 0 14px var(--accent-cyan-glow);
}

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

.telemetry-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 4px 10px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  color: var(--accent-cyan);
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.live-time-display {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-terminal-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.btn-terminal-sm:hover {
  background: rgba(34, 211, 238, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* ==========================================================================
   2. Hero Telemetry & Countdown Banner
   ========================================================================== */
.hero-telemetry-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}

.hero-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-terminal);
}

.hero-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), transparent);
}

.hero-countdown-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.hero-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
  padding: 3px 8px;
  border-radius: var(--radius-sharp);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.hero-event-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hero-event-agency {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-countdown-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}

.countdown-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sharp);
  padding: 8px 14px;
  min-width: 64px;
}

.countdown-num {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  line-height: 1;
}

.countdown-unit {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.countdown-sep {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--text-muted);
  font-weight: 300;
}

.hero-sub-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-item .label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.stat-item .value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-hero-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-cyan);
  color: #0A0E14;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-sharp);
  text-decoration: none;
  transition: all var(--duration-fast) ease;
}

.btn-hero-action:hover {
  background: var(--border-bright);
  box-shadow: 0 0 16px var(--accent-cyan-glow);
}

/* Right Hero Box: Global Market Sentiment Pulse */
.hero-sentiment-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.sentiment-badge-wrapper {
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.risk-state-badge {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sharp);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.risk-state-badge.risk-on {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
  box-shadow: var(--shadow-green-glow);
}

.risk-state-badge.neutral {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber);
}

.risk-state-badge.risk-off {
  background: var(--accent-red-bg);
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
  box-shadow: var(--shadow-red-glow);
}

.sentiment-gauge-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  margin: 6px 0;
}

.sentiment-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-amber), var(--accent-red));
  transition: width var(--duration-base) ease;
}

.sentiment-metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.pulse-pill {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sharp);
  padding: 8px 10px;
}

.pulse-pill .pill-name {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.pulse-pill .pill-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 2px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

/* ==========================================================================
   3. Main Views Container (Hash Routed)
   ========================================================================== */
.view-section {
  display: none;
  flex-direction: column;
  gap: 20px;
  animation: fadeInView var(--duration-base) var(--ease-out);
}

.view-section.active-view {
  display: flex;
}

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

/* View Sub-Headers & Toolbar */
.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 12px 18px;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-default);
}

.filter-btn.active {
  background: rgba(34, 211, 238, 0.14);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

.search-box-terminal {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box-terminal input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 6px 12px 6px 30px;
  border-radius: var(--radius-sharp);
  outline: none;
  width: 220px;
  transition: all var(--duration-fast) ease;
}

.search-box-terminal input:focus {
  border-color: var(--accent-cyan);
  width: 280px;
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

.search-icon-pos {
  position: absolute;
  left: 9px;
  color: var(--text-muted);
  font-size: 0.8rem;
  pointer-events: none;
}

/* ==========================================================================
   4. Calendar View (#calendar)
   ========================================================================== */
.calendar-grid-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calendar-header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.calendar-month-title {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.calendar-month-matrix {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.calendar-day-col-hdr {
  background: var(--bg-elevated);
  padding: 10px 8px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.calendar-cell {
  background: var(--bg-surface);
  min-height: 115px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background var(--duration-fast) ease;
}

.calendar-cell:hover {
  background: rgba(21, 29, 42, 0.95);
}

.calendar-cell.other-month {
  opacity: 0.35;
  background: rgba(10, 14, 20, 0.5);
}

.calendar-cell.today {
  border: 1px solid var(--accent-cyan);
  background: rgba(34, 211, 238, 0.04);
}

.cell-date-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-cell.today .cell-date-num {
  color: var(--accent-cyan);
}

.cell-events-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.event-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border-radius: var(--radius-sharp);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--duration-fast) ease;
}

.event-chip.tier-1 {
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.4);
  color: #DDD6FE;
  font-weight: 600;
}

.event-chip.tier-1:hover {
  background: rgba(167, 139, 250, 0.25);
  border-color: var(--accent-violet);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.3);
}

.event-chip.tier-2 {
  background: rgba(34, 211, 238, 0.1);
  border-color: var(--border-accent);
  color: var(--accent-cyan);
}

.event-chip.tier-2:hover {
  background: rgba(34, 211, 238, 0.22);
}

.event-chip.tier-3 {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.event-chip.tier-3:hover {
  background: rgba(255, 255, 255, 0.08);
}

.chip-time {
  font-size: 0.65rem;
  opacity: 0.75;
}

/* Timeline / Stream List View */
.timeline-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-event-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all var(--duration-fast) ease;
  cursor: pointer;
}

.timeline-event-row:hover {
  border-color: var(--border-accent);
  background: var(--bg-elevated);
  transform: translateX(4px);
}

.timeline-event-row.tier-1-row {
  border-left: 3px solid var(--accent-violet);
}

.timeline-event-row.tier-2-row {
  border-left: 3px solid var(--accent-cyan);
}

.row-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.row-time-col {
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  min-width: 90px;
}

.row-date {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.row-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.row-info-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.row-title-strip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-event-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.row-ticker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
  padding: 1px 6px;
  border-radius: var(--radius-sharp);
}

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

.row-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.row-consensus-pill {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-sharp);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.row-consensus-pill .lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.row-consensus-pill .val {
  color: var(--accent-green);
  font-weight: 600;
}

.row-countdown-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid var(--border-accent);
  padding: 6px 12px;
  border-radius: var(--radius-sharp);
  min-width: 100px;
  text-align: center;
}

/* ==========================================================================
   5. Market Pulse Dashboard (#pulse)
   ========================================================================== */
.pulse-widgets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.pulse-widget-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-terminal);
  transition: all var(--duration-fast) ease;
}

.pulse-widget-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.8);
}

.widget-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.widget-title-area h3 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.widget-title-area p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.widget-telemetry-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-sharp);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.widget-telemetry-badge.live {
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent-green);
  border-color: var(--accent-green);
}

.widget-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.widget-price-val {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.widget-change-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sharp);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.widget-change-pill.up {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.widget-change-pill.down {
  background: var(--accent-red-bg);
  color: var(--accent-red);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.widget-change-pill.neutral {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* Sparkline SVG Chart Container */
.sparkline-chart-container {
  width: 100%;
  height: 48px;
  position: relative;
}

.sparkline-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sparkline-path {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline-area {
  opacity: 0.15;
}

.widget-bottom-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

/* Sentiment Surveys & Indices Section */
.surveys-section-block {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title-strip h3 {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.survey-placeholder-card {
  background: var(--bg-surface);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.survey-placeholder-card h4 {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.survey-placeholder-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.survey-latest-summary {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.06);
  padding: 6px 8px;
  border-radius: var(--radius-sharp);
}

.btn-survey-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: var(--radius-sharp);
  text-decoration: none;
  transition: all var(--duration-fast) ease;
}

.btn-survey-link:hover {
  background: var(--accent-cyan);
  color: #0A0E14;
  border-color: var(--accent-cyan);
}

/* ==========================================================================
   6. Asset Reaction Matrix Page (#reactions)
   ========================================================================== */
.reactions-page-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.event-picker-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.event-picker-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.event-picker-btn:hover {
  border-color: var(--border-bright);
  color: var(--text-primary);
}

.event-picker-btn.active {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #0A0E14;
  box-shadow: 0 0 14px var(--accent-cyan-glow);
}

/* 8-Asset Reaction Matrix Table */
.matrix-table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  overflow-x: auto;
  box-shadow: var(--shadow-terminal);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.matrix-table th, .matrix-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
}

.matrix-table th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.matrix-table th:first-child, .matrix-table td:first-child {
  text-align: left;
  font-weight: 700;
  padding-left: 20px;
  min-width: 160px;
}

.matrix-cell-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.matrix-arrow {
  font-size: 1.1rem;
  font-weight: 700;
}

.matrix-arrow.up {
  color: var(--accent-green);
}

.matrix-arrow.down {
  color: var(--accent-red);
}

.matrix-arrow.neutral {
  color: var(--text-muted);
}

.matrix-cell-subtext {
  font-size: 0.65rem;
  color: var(--text-muted);
  max-width: 110px;
  line-height: 1.25;
}

/* Educational Logic Cards */
.education-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.edu-card-terminal {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.edu-card-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.edu-card-terminal p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ==========================================================================
   7. Event Detail Deep Dive View (#event/{id})
   ========================================================================== */
.event-detail-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.detail-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-back-nav {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 8px 14px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-back-nav:hover {
  background: rgba(34, 211, 238, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.detail-heading h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.detail-heading p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Quad-Tabs Selector */
.quad-tabs-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 4px;
}

.quad-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.quad-tab-btn:hover {
  color: var(--text-primary);
}

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

.quad-tab-panel {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-terminal);
}

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

/* Historical Samples Accordion Table */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.history-table th, .history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.history-table th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.history-row {
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}

.history-row:hover {
  background: rgba(34, 211, 238, 0.05);
}

.history-expand-row {
  display: none;
  background: rgba(0, 0, 0, 0.35);
}

.history-expand-row.expanded {
  display: table-row;
}

.expand-details-box {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   8. Asset Prices View (#prices)
   ========================================================================== */
.prices-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.price-detail-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-terminal);
}

.price-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.price-detail-val {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.range-bar-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.range-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  position: relative;
}

.range-bar-thumb {
  position: absolute;
  top: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

/* ==========================================================================
   9. Modals & Notifications
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.terminal-modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 680px;
  padding: 24px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px var(--accent-cyan-glow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.modal-header-strip h3 {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--accent-cyan);
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

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

/* ==========================================================================
   10. Responsive Adjustments
   ========================================================================== */
@media (max-width: 1180px) {
  .hero-telemetry-grid {
    grid-template-columns: 1fr;
  }
  .pulse-widgets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .surveys-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .education-cards-grid {
    grid-template-columns: 1fr;
  }
  .prices-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .terminal-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .header-center-nav {
    overflow-x: auto;
  }
  .pulse-widgets-grid {
    grid-template-columns: 1fr;
  }
  .surveys-cards-grid {
    grid-template-columns: 1fr;
  }
  .prices-cards-grid {
    grid-template-columns: 1fr;
  }
  .calendar-month-matrix {
    font-size: 0.65rem;
  }
  .calendar-cell {
    min-height: 80px;
    padding: 4px;
  }
}
