/* Rozzzsie Governance Dashboard — sprint-1 v1
 *
 * Director-audience styling: typographic hierarchy, generous whitespace,
 * status-pill semantics, no JavaScript dependency, print-friendly.
 * Designed for both desktop browse and mobile-on-the-go scan.
 */

:root {
  /* Neutral palette — calm, professional */
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-alt: #f4f4f0;
  --border: #e6e4dc;
  --border-strong: #d4d0c4;
  --text: #1f1f1c;
  --text-muted: #6b6962;
  --text-subtle: #94918a;

  /* Accent — governance signal */
  --accent: #2a4d4a;
  --accent-soft: #d8e3e1;

  /* Status semantics */
  --status-executed: #1f6b3e;
  --status-executed-bg: #d8efe1;
  --status-approved: #1d5491;
  --status-approved-bg: #d6e6f5;
  --status-pre-ship: #6b5018;
  --status-pre-ship-bg: #f1e5c8;
  --status-deferred: #5a5751;
  --status-deferred-bg: #e6e4dc;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 2rem 1.25rem 4rem;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
}

/* — Hero / header — */

.hero {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}

.hero-eyebrow {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.hero-tagline {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 56ch;
  font-style: italic;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-meta strong {
  color: var(--text);
  font-weight: 600;
}

.hero-context {
  margin-top: 1.5rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 75ch;
  line-height: 1.55;
}

/* — Section titles — */

section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.section-title-suffix {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-subtle);
}

/* — Metric tiles row — */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.25rem 1rem;
}

.tile-value {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}

.tile-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.tile-detail {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-subtle);
  line-height: 1.4;
}

/* — Two-column band (discipline + cohort) — */

.bands {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 800px) {
  .bands {
    grid-template-columns: 1fr 1fr;
  }
}

.band {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.band h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.kv-row:last-child {
  border-bottom: none;
}

.kv-key {
  color: var(--text-muted);
}

.kv-val {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.kv-val-mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

/* — Cohort flow — */

.cohort {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cohort-stage {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.85rem;
  background: var(--surface-alt);
  border-radius: 6px;
  font-size: 0.92rem;
}

.cohort-label {
  color: var(--text-muted);
  font-weight: 500;
}

.cohort-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.cohort-arrow {
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
}

/* — Findings table — */

.findings {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.findings-row {
  display: grid;
  grid-template-columns: 4ch 1fr auto 9ch;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 0.92rem;
}

.findings-row:last-child {
  border-bottom: none;
}

.findings-row.header {
  background: var(--surface-alt);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.finding-id {
  font-family: var(--font-mono);
  color: var(--text-subtle);
  font-size: 0.88em;
}

.finding-title {
  color: var(--text);
}

.finding-cat {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: right;
}

/* — Status pills — */

.pill {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  white-space: nowrap;
}

.pill-executed {
  background: var(--status-executed-bg);
  color: var(--status-executed);
}

.pill-approved {
  background: var(--status-approved-bg);
  color: var(--status-approved);
}

.pill-pre-ship {
  background: var(--status-pre-ship-bg);
  color: var(--status-pre-ship);
}

.pill-deferred {
  background: var(--status-deferred-bg);
  color: var(--status-deferred);
}

/* — Luma tally bar chart — */

.tally {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tally-row {
  display: grid;
  grid-template-columns: 28ch 1fr 3ch;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.88rem;
}

.tally-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: lowercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.tally-bar {
  height: 8px;
  background: var(--accent-soft);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.tally-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}

.tally-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  text-align: right;
}

/* — Meta-finding callout — louder visual hierarchy so reviewers' eyes land here */

.callout {
  background: var(--accent-soft);
  border-left: 6px solid var(--accent);
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  padding: 1.5rem 1.75rem;
  border-radius: 6px;
  margin-top: 2rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  box-shadow: 0 2px 8px rgba(42, 77, 74, 0.08);
}

.callout-icon {
  font-size: 1.75rem;
  line-height: 1.2;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: -0.1rem;
}

.callout-body {
  flex: 1;
  min-width: 0;
}

.callout-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.callout-text {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.55;
  font-weight: 500;
}

/* — Scope-honest footer — thin attribution band, full container width (v1.2: industry-standard) */

.scope-honest {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-subtle);
  text-align: center;
  line-height: 1.6;
}

.scope-honest p {
  margin: 0;
}

.scope-honest a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}

.scope-honest a:hover {
  border-bottom-style: solid;
}

.scope-honest .sep {
  margin: 0 0.5rem;
  color: var(--text-subtle);
  opacity: 0.5;
}

.scope-honest a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.scope-honest code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-alt);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  color: var(--text);
}

/* — Print — */

@media print {
  body {
    background: white;
    padding: 1rem;
  }
  .tile, .band, .findings, .callout {
    break-inside: avoid;
    box-shadow: none;
  }
}

/* ─── Fam dispatch widget (v1.4) ─────────────────────────────────────── */

.fam-widget {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--band-bg, #f7f7f8);
  border-radius: 8px;
}

.fam-sub-band {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fam-sub-band-label {
  margin: 0 0 0.35rem 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-fg, #6a6a72);
}

.fam-row {
  display: grid;
  grid-template-columns: 11ch 5ch 1fr;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.2rem 0;
}

.fam-row .kv-key {
  font-weight: 500;
}

.fam-row .kv-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.fam-row-role {
  color: var(--muted-fg, #6a6a72);
  font-size: 0.88rem;
}

.fam-row-detail {
  display: block;
  grid-column: 3 / -1;
  margin-top: 0.1rem;
  color: var(--muted-fg, #6a6a72);
  font-size: 0.82rem;
  font-style: italic;
}

.fam-row-total {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border-color, #d8d8de);
  font-weight: 600;
}

.kv-row-muted,
.fam-row-muted {
  opacity: 0.55;
}

.kv-row-muted .kv-val,
.fam-row-muted .kv-val {
  font-style: italic;
  color: var(--muted-fg, #6a6a72);
}

/* ─── Luma facet deep-dive panel (relocated v1.4) ────────────────────── */

.deep-dive .section-title {
  font-size: 1rem;
  color: var(--muted-fg, #6a6a72);
}

.deep-dive .bands {
  background: transparent;
}

.kv-row-detail .kv-key {
  font-style: italic;
  color: var(--muted-fg, #6a6a72);
  font-size: 0.88rem;
}

/* ─── Luma facet co-line treatment (v1.4 follow-up — band-tier muted) ── */

.band-muted {
  opacity: 0.92;
}

.band-muted h3 {
  color: var(--muted-fg, #6a6a72);
}

.band-title-suffix {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted-fg, #6a6a72);
  letter-spacing: 0.02em;
  margin-left: 0.4em;
}

/* ─── Trend chart (v2.0 sprint-2 — multi-retro rendering) ─────────── */

.trend-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 800px) {
  .trend-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.trend-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.trend-card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.trend-card-suffix {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-left: 0.4em;
}

.trend-values {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.trend-arrow {
  color: var(--text-subtle);
  font-weight: 400;
  font-size: 0.95rem;
}

.trend-svg {
  display: block;
  width: 100%;
  height: 60px;
  margin: 0.2rem 0 0.1rem;
}

.trend-axis-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 0.5rem;
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.trend-annotation {
  font-size: 0.82rem;
  margin-top: 0.2rem;
  font-weight: 500;
}

.trend-up {
  color: var(--status-executed);
}

.trend-down {
  color: #a13a2c;
}

.trend-flat {
  color: var(--text-muted);
}

.trend-note {
  font-size: 0.72rem;
  color: var(--text-subtle);
  line-height: 1.4;
  margin: 0.4rem 0 0;
}

.trend-empty {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 1.5rem;
}
