﻿:root {
  --bg-0: #020705;
  --bg-1: #06110d;
  --text: #d8f4e7;
  --muted: #89aa9b;
  --line-soft: rgba(47, 121, 90, 0.18);
  --line-mid: rgba(47, 121, 90, 0.34);
  --accent: #18c88d;
  --ok: #55d3a2;
  --warn: #ebd26c;
  --bad: #f29b9b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Sora", "Segoe UI", sans-serif;
  background:
    radial-gradient(1300px 700px at -8% -22%, rgba(24, 200, 141, 0.16), transparent),
    radial-gradient(1200px 660px at 112% 118%, rgba(17, 124, 88, 0.14), transparent),
    linear-gradient(160deg, #010504, #04110c 40%, #03100c 80%, #020806);
  min-height: 100vh;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 3px 3px;
}

.shell {
  width: min(1360px, calc(100% - 34px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-mid);
  background: linear-gradient(180deg, rgba(2, 10, 7, 0.86), rgba(2, 10, 7, 0.58));
}

.topbar-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.08em;
  font-size: 1.95rem;
}

.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 18px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.nav-links a.active,
.nav-links a:hover {
  color: #cbf7e5;
}

.btn {
  border: 1px solid rgba(24, 200, 141, 0.5);
  border-radius: 999px;
  background: rgba(6, 18, 13, 0.78);
  color: #d5fff0;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(78, 233, 174, 0.8);
  box-shadow: 0 10px 24px rgba(24, 200, 141, 0.2);
}

.page {
  position: relative;
  z-index: 1;
  padding: 20px 0 52px;
  display: grid;
  gap: 22px;
}

.cinematic-stage {
  position: relative;
  border: none;
  border-radius: 0;
  min-height: 470px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 12%, rgba(48, 178, 126, 0.28), transparent 42%),
    radial-gradient(circle at 78% 88%, rgba(36, 110, 86, 0.2), transparent 38%),
    linear-gradient(155deg, rgba(5, 18, 13, 0.95), rgba(2, 9, 7, 0.96));
  box-shadow: 0 34px 92px rgba(4, 18, 13, 0.72);
}

.cinematic-stage::before {
  content: "";
  position: absolute;
  inset: -20% -30%;
  pointer-events: none;
  background:
    radial-gradient(circle at 25% 25%, rgba(77, 227, 170, 0.22), transparent 42%),
    radial-gradient(circle at 72% 65%, rgba(100, 194, 255, 0.16), transparent 45%);
  mix-blend-mode: screen;
  animation: cinematicDrift 22s linear infinite;
}

.cinematic-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(201, 255, 231, 0.02) 0px,
      rgba(201, 255, 231, 0.02) 1px,
      transparent 2px,
      transparent 4px
    ),
    linear-gradient(180deg, rgba(7, 16, 13, 0) 78%, rgba(0, 0, 0, 0.28) 100%);
  opacity: 0.44;
}

#sceneCanvas {
  display: block;
  width: 100%;
  height: 390px;
  position: relative;
  z-index: 1;
}

.scene-headline {
  position: relative;
  z-index: 2;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(53, 150, 112, 0.2);
  background:
    linear-gradient(180deg, rgba(8, 20, 15, 0.78), rgba(8, 20, 15, 0.25)),
    radial-gradient(circle at 16% 18%, rgba(31, 123, 92, 0.28), transparent 55%);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5);
}

.scene-headline h2 {
  margin: 8px 0 0;
  font-size: clamp(1.34rem, 2.4vw, 2rem);
  line-height: 1.1;
}

.scene-headline p {
  margin: 8px 0 0;
  color: #b4dacb;
  font-size: 0.96rem;
}

.page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(680px 290px at 18% 16%, rgba(24, 200, 141, 0.08), transparent 72%),
    radial-gradient(740px 340px at 86% 78%, rgba(108, 189, 255, 0.05), transparent 72%);
  z-index: -1;
}

.hero {
  border: none;
  border-radius: 0;
  padding: 24px;
  background: transparent;
  box-shadow: none;
}

.filters,
.kpis,
.agents-board,
.table-section,
.cards-grid {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.filters,
.kpis,
.agents-board,
.table-section {
  border-top: 1px solid rgba(53, 151, 112, 0.22);
  padding-top: 14px;
}

.access-gate {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: rgba(28, 10, 10, 0.4);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.mission-version {
  margin: 7px 0 0;
  color: #9dc6b5;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0 0;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.05;
}

h2 {
  margin: 0;
}

.lead {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 84ch;
}

.status-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: #a8d9c5;
  font-size: 0.9rem;
}

.access-gate {
  padding: 18px 16px;
  border: 1px dashed rgba(242, 155, 155, 0.42);
  background: rgba(28, 10, 10, 0.4);
}

.access-gate p {
  margin: 8px 0 0;
  color: #efc9c9;
}

#missionContent {
  display: grid;
  gap: 18px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 16px;
  align-items: end;
}

.filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.plan-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.plan-filters label,
.auto-refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  color: #b7e9d4;
  font-size: 0.8rem;
  background: rgba(8, 19, 14, 0.22);
  box-shadow: none;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.kpi-card {
  border: none;
  border-radius: 0;
  padding: 8px 10px 12px;
  background: linear-gradient(165deg, rgba(7, 19, 14, 0.34), rgba(3, 10, 8, 0.08));
  box-shadow: none;
  border-bottom: 1px solid rgba(63, 173, 128, 0.2);
}

.kpi-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.kpi-value {
  margin: 6px 0 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.agents-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.agent-card {
  border: none;
  border-radius: 0;
  padding: 8px 8px 10px;
  background: linear-gradient(165deg, rgba(7, 19, 14, 0.28), rgba(3, 10, 8, 0.06));
  box-shadow: none;
  border-bottom: 1px solid rgba(63, 173, 128, 0.2);
}

.agent-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.agent-name {
  margin: 0;
  font-size: 0.9rem;
}

.agent-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}

.agent-badge.state-active {
  color: #03251a;
  background: var(--ok);
}

.agent-badge.state-wait {
  color: #3b3003;
  background: var(--warn);
}

.agent-badge.state-idle {
  color: #213b32;
  background: #a3bbb2;
}

.agent-badge.state-alert {
  color: #411212;
  background: var(--bad);
}

.agent-track {
  margin-top: 10px;
  border: none;
  border-radius: 999px;
  height: 8px;
  background: rgba(4, 12, 9, 0.34);
  position: relative;
  overflow: hidden;
}

.agent-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(0, -50%);
  background: #9fdcc4;
  box-shadow: 0 0 0 3px rgba(159, 220, 196, 0.2);
}

.agent-card.state-active .agent-dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(85, 211, 162, 0.2);
  animation: agentMove 1.8s linear infinite;
}

.agent-card.state-wait .agent-dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(235, 210, 108, 0.2);
  animation: agentMove 3.2s linear infinite;
}

.agent-card.state-idle .agent-dot {
  background: #a3bbb2;
  box-shadow: 0 0 0 3px rgba(163, 187, 178, 0.18);
  animation: agentPulse 2.5s ease-in-out infinite;
}

.agent-card.state-alert .agent-dot {
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(242, 155, 155, 0.2);
  animation: agentMove 1.1s linear infinite;
}

.agent-line {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #c6e5d8;
}

.agent-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.section-head {
  margin: 2px 0 8px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.symbol-card {
  border: none;
  border-radius: 0;
  padding: 10px 10px 12px;
  background: linear-gradient(165deg, rgba(7, 19, 14, 0.52), rgba(3, 10, 8, 0.22));
  box-shadow: none;
  border-bottom: 1px solid rgba(63, 173, 128, 0.2);
}

.symbol-card.plan-open-counter-now {
  background:
    linear-gradient(90deg, rgba(85, 211, 162, 0.14), transparent 38%),
    linear-gradient(165deg, rgba(7, 19, 14, 0.52), rgba(3, 10, 8, 0.22));
}

.symbol-card.plan-open-with-bias-now {
  background:
    linear-gradient(90deg, rgba(108, 189, 255, 0.14), transparent 38%),
    linear-gradient(165deg, rgba(7, 19, 14, 0.52), rgba(3, 10, 8, 0.22));
}

.symbol-card.plan-wait {
  background:
    linear-gradient(90deg, rgba(235, 210, 108, 0.14), transparent 38%),
    linear-gradient(165deg, rgba(7, 19, 14, 0.52), rgba(3, 10, 8, 0.22));
}

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

.symbol-card h3 {
  margin: 0;
  font-size: 1rem;
}

.plan-chip {
  border-radius: 0;
  padding: 0;
  font-size: 0.7rem;
  font-weight: 700;
}

.chip-open-counter-now {
  background: transparent;
  color: var(--ok);
}

.chip-open-with-bias-now {
  background: transparent;
  color: #8ed4ff;
}

.chip-wait {
  background: transparent;
  color: var(--warn);
}

.chip-no-trade {
  background: transparent;
  color: #a8beb5;
}

.card-line {
  margin-top: 7px;
  color: #cce7dc;
  font-size: 0.84rem;
}

.card-muted {
  color: var(--muted);
  font-size: 0.76rem;
}

.error {
  margin: 10px 0 0;
  color: var(--bad);
  min-height: 20px;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .agents-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar-inner {
    flex-wrap: wrap;
    justify-content: center;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #sceneCanvas {
    height: 330px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .kpis,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .agents-grid {
    grid-template-columns: 1fr;
  }

  #sceneCanvas {
    height: 300px;
  }
}

@keyframes agentMove {
  0% {
    left: 0;
  }
  100% {
    left: calc(100% - 14px);
  }
}

@keyframes agentPulse {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
  }
}

@keyframes cinematicDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(2%, -1%, 0) scale(1.04);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}
