/*
 * Command Centre (the dashboard): the headline estate value, the digital-twin graph with its lenses,
 * the health ring and the selected-object inspector. Everything else is shared components.
 */

.estate-number {
  margin: var(--space-1) 0 var(--space-2);
  color: var(--text);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-none);
}

.estate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  font-size: var(--text-base);
}

.estate-meta span + span::before {
  content: "·";
  margin-right: var(--space-4);
  color: var(--text-faint);
}

/* Digital twin */

.twin-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.command-lenses {
  display: flex;
  gap: var(--space-1);
  width: max-content;
  max-width: calc(100% - var(--space-8));
  overflow-x: auto;
  margin: var(--space-4) var(--space-6) 0;
  padding: var(--space-1);
  border-radius: var(--radius-md);
  background: var(--surface-page);
}

.command-lenses button {
  flex: none;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  cursor: pointer;
}

.command-lenses button.active {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-accent);
}

.command-canvas {
  position: relative;
  overflow: hidden;
  min-height: 455px;
  margin: var(--space-3) var(--space-4) 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 42%, var(--surface-subtle) 0, var(--surface) 46%, var(--surface-subtle) 100%);
}

.command-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--border) 0.7px, transparent 0.7px);
  background-size: 22px 22px;
}

/* Estate health */

.estate-health {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border-subtle);
}

.estate-health b,
.estate-health small {
  display: block;
}

.estate-health > div:last-child b {
  margin: var(--space-1-5) 0 var(--space-0-5);
}

.estate-health small {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.health-ring {
  --score: 95;
  display: grid;
  flex: none;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: conic-gradient(var(--success) calc(var(--score) * 1%), var(--surface-sunken) 0);
}

.health-ring > div {
  display: grid;
  place-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--surface);
  text-align: center;
}

.health-ring b {
  font-size: var(--text-md);
}

.health-ring span {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* Selected-object inspector */

.command-inspector {
  position: fixed;
  top: var(--header-height);
  right: -370px;
  bottom: 0;
  z-index: var(--z-drawer);
  width: 350px;
  padding: var(--space-6);
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  visibility: hidden;
  transition: right var(--duration-base) var(--ease), visibility var(--duration-base);
}

.command-inspector.open {
  right: 0;
  visibility: visible;
}

.command-inspector > button {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 29px;
  height: 29px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-page);
  color: var(--text-tertiary);
  cursor: pointer;
}

.command-inspector h2 {
  margin: var(--space-2) 0 var(--space-1);
  font-size: var(--text-2xl);
}

.command-inspector > p {
  margin: 0 0 var(--space-5);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.command-inspector .inspect-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}

.command-inspector .inspect-row span {
  color: var(--text-muted);
}
