/*
 * Version 3 -- Home landing page.
 *
 * Uses the shell's existing tokens throughout and reuses the Force Measurement
 * metric-card anatomy for the KPI strip rather than declaring a second one;
 * only the Home-specific layout lives here.
 *
 * Status is never communicated by colour alone: every system card states its
 * condition in words, and the tone modifier only tints a border beside that
 * sentence.
 */

.v3-home {
  display: flex;
  flex-direction: column;
  gap: var(--v3-space-5);
}

/* ---- header ------------------------------------------------------------- */

.v3-home-header {
  display: flex;
  flex-direction: column;
  gap: var(--v3-space-1);
  padding-bottom: var(--v3-space-3);
  border-bottom: 1px solid var(--v3-border);
}

.v3-home-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--v3-text-muted);
}

.v3-home-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--v3-maroon);
}

.v3-home-context {
  margin: 0;
  font-size: 0.85rem;
  color: var(--v3-text-muted);
}

/* ---- sections ----------------------------------------------------------- */

.v3-home-section {
  display: flex;
  flex-direction: column;
  gap: var(--v3-space-3);
}

.v3-home-section-heading {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--v3-text);
}

.v3-home-section-note {
  margin: calc(var(--v3-space-1) * -1) 0 0;
  font-size: 0.78rem;
  color: var(--v3-text-muted);
}

.v3-home-empty {
  margin: 0;
  padding: var(--v3-space-4);
  border-radius: var(--v3-radius-md);
  border: 1px dashed var(--v3-border-strong);
  background: var(--v3-surface-muted);
  color: var(--v3-text-muted);
}

/* ---- attention ---------------------------------------------------------- */

.v3-home-attention-list {
  display: flex;
  flex-direction: column;
  gap: var(--v3-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.v3-home-attention-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--v3-space-2);
  padding: var(--v3-space-4);
  border-radius: var(--v3-radius-md);
  border: 1px solid var(--v3-border-strong);
  border-left: 4px solid var(--v3-maroon);
  background: var(--v3-surface);
}

.v3-home-attention-label {
  margin: 0;
  font-weight: 700;
  color: var(--v3-text);
}

.v3-home-attention-detail {
  margin: 0;
  font-size: 0.85rem;
  color: var(--v3-text-muted);
}

/* ---- KPI strip ---------------------------------------------------------- */

.v3-home-kpis {
  margin: 0;
}

/* ---- system cards ------------------------------------------------------- */

.v3-home-systems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--v3-space-3);
}

.v3-home-system {
  display: flex;
  flex-direction: column;
  gap: var(--v3-space-2);
  padding: var(--v3-space-4);
  border-radius: var(--v3-radius-md);
  border: 1px solid var(--v3-border);
  border-top: 3px solid var(--v3-border-strong);
  background: var(--v3-surface);
}

/*
 * Tone tints the top border only. The card always carries the same sentence in
 * `.v3-home-system-status`, so removing colour removes no information.
 */
.v3-home-system--ready {
  border-top-color: var(--v3-maroon);
}

.v3-home-system--attention {
  border-top-color: var(--v3-maroon-dark);
}

.v3-home-system--empty {
  border-top-color: var(--v3-border-strong);
  background: var(--v3-surface-muted);
}

.v3-home-system-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--v3-text);
}

.v3-home-system-status {
  margin: 0;
  font-size: 0.82rem;
  color: var(--v3-text-muted);
}

.v3-home-system-facts,
.v3-home-health {
  display: grid;
  gap: var(--v3-space-2);
  margin: 0;
}

.v3-home-system-facts > div,
.v3-home-health > div {
  display: flex;
  justify-content: space-between;
  gap: var(--v3-space-3);
  font-size: 0.82rem;
}

.v3-home-system-facts dt,
.v3-home-health dt {
  margin: 0;
  color: var(--v3-text-muted);
}

.v3-home-system-facts dd,
.v3-home-health dd {
  margin: 0;
  font-weight: 600;
  color: var(--v3-text);
  text-align: right;
}

.v3-home-system-unresolved {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--v3-maroon-dark);
}

.v3-home-system-link,
.v3-home-attention-link {
  align-self: flex-start;
  margin-top: auto;
}

/* ---- data health -------------------------------------------------------- */

.v3-home-health {
  padding: var(--v3-space-4);
  border-radius: var(--v3-radius-md);
  border: 1px solid var(--v3-border);
  background: var(--v3-surface);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* ---- responsive --------------------------------------------------------- */

@media (max-width: 720px) {
  .v3-home-systems {
    grid-template-columns: 1fr;
  }

  .v3-home-system-facts > div,
  .v3-home-health > div {
    flex-direction: column;
    gap: var(--v3-space-1);
  }

  .v3-home-system-facts dd,
  .v3-home-health dd {
    text-align: left;
  }
}
