/* Business-health Dashboard — full-bleed Outbound Core composition */

.sci-dash-page {
  position: relative;
  margin: -8px -4px 0;
  min-height: calc(var(--sci-app-h, 100dvh) - 88px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sci-dash-page__chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 0 4px;
  z-index: 2;
}

.sci-dash-page__title {
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text, #e7ecff);
  line-height: 1.15;
}

.sci-dash-page__sub {
  color: var(--muted, #a9b3d1);
  font-size: 0.85rem;
  margin-top: 4px;
  max-width: 42ch;
}

.sci-dash-page__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.sci-dash-page__window .Select-control,
.sci-dash-page__window .Select__control {
  min-width: 120px;
}

.sci-dash-page__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sci-dash-page__links a {
  color: var(--accent, #2ee6a6);
  text-decoration: none;
  font-size: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--accent, #2ee6a6) 35%, transparent);
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel, #0e1630) 80%, transparent);
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.sci-dash-page__links a:hover {
  border-color: var(--accent, #2ee6a6);
  color: var(--text, #e7ecff);
  transform: translateY(-1px);
}

.sci-dash-page__stage-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: min(62vh, 640px);
  border-radius: calc(var(--radius, 14px) + 4px);
  overflow: hidden;
  border: 1px solid var(--border, rgba(231, 236, 255, 0.1));
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(46, 230, 166, 0.08), transparent 60%),
    radial-gradient(ellipse 55% 45% at 70% 70%, rgba(45, 125, 255, 0.1), transparent 55%),
    linear-gradient(160deg, #070b14 0%, #0b1020 55%, #0a1428 100%);
  box-shadow: var(--shadow, 0 18px 50px rgba(0, 0, 0, 0.45));
}

.sci-dash-scene {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: min(62vh, 640px);
}

.sci-dash-scene__stage {
  position: absolute;
  inset: 0;
}

.sci-dash-scene__stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.sci-dash-scene__signal {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  padding: 12px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, #070b14 72%, transparent);
  border: 1px solid rgba(231, 236, 255, 0.12);
  backdrop-filter: blur(10px);
  max-width: min(100% - 32px, 560px);
}

.sci-dash-scene__signal-score {
  font-size: 2.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.03em;
}

.sci-dash-scene__signal-label {
  font-weight: 650;
  color: var(--text, #e7ecff);
  font-size: 0.95rem;
}

.sci-dash-scene__signal-sub {
  color: var(--muted, #a9b3d1);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sci-dash-scene__signal-rates {
  display: flex;
  gap: 14px;
  margin-left: 4px;
}

.sci-dash-scene__signal-rates div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sci-dash-scene__signal-rates span {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #a9b3d1);
}

.sci-dash-scene__signal-rates strong {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  color: var(--text, #e7ecff);
}

.sci-dash-scene__panel {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(280px, calc(100% - 32px));
  z-index: 3;
  padding: 14px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, #070b14 78%, transparent);
  border: 1px solid rgba(231, 236, 255, 0.12);
  backdrop-filter: blur(12px);
  opacity: 0.72;
  transform: translateX(8px);
  transition: opacity 220ms ease, transform 220ms ease, border-color 220ms ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.sci-dash-scene__panel.is-open {
  opacity: 1;
  transform: translateX(0);
  border-color: color-mix(in srgb, var(--accent, #2ee6a6) 40%, rgba(231, 236, 255, 0.12));
  pointer-events: auto;
}

.sci-dash-scene__panel-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted, #a9b3d1);
}

.sci-dash-scene__panel-grid {
  display: grid;
  gap: 8px;
  flex: 1 1 auto;
  overflow: auto;
}

.sci-dash-scene__metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  border-bottom: 1px solid rgba(231, 236, 255, 0.06);
  padding-bottom: 6px;
}

.sci-dash-scene__metric span {
  color: var(--muted, #a9b3d1);
  font-size: 0.78rem;
}

.sci-dash-scene__metric strong {
  color: var(--text, #e7ecff);
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}

.sci-dash-scene__spark {
  width: 100%;
  height: 56px;
  opacity: 0.9;
}

.sci-dash-scene__spark-empty {
  font-size: 0.75rem;
  color: var(--muted, #a9b3d1);
}

.sci-dash-fallback {
  height: 100%;
  min-height: 420px;
  display: grid;
  place-items: center;
  gap: 24px;
  padding: 48px 24px;
}

.sci-dash-fallback__core {
  width: min(220px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--accent, #2ee6a6);
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 40% 35%, rgba(46, 230, 166, 0.18), transparent 55%);
}

.sci-dash-fallback__score {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
}

.sci-dash-fallback__label {
  text-align: center;
  color: var(--muted, #a9b3d1);
  margin-top: 6px;
  font-size: 0.85rem;
}

.sci-dash-fallback__rings {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.sci-dash-fallback__ring {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--ring, #2ee6a6) 50%, transparent);
  background: transparent;
  color: var(--text, #e7ecff);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.8rem;
  cursor: pointer;
}

.sci-dash-fallback__ring.is-active {
  background: color-mix(in srgb, var(--ring, #2ee6a6) 22%, transparent);
}

@media (max-width: 900px) {
  .sci-dash-scene__panel {
    position: absolute;
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 42%;
    transform: translateY(8px);
  }

  .sci-dash-scene__panel.is-open {
    transform: translateY(0);
  }

  .sci-dash-scene__signal {
    max-width: calc(100% - 24px);
  }

  .sci-dash-scene__signal-rates {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sci-dash-page__links a,
  .sci-dash-scene__panel {
    transition: none;
  }
}
