:root {
  color-scheme: dark;
  --bg: #090b14;
  --panel: rgba(18, 22, 38, 0.88);
  --panel-strong: #12162a;
  --text: #f7f8ff;
  --muted: #a9b0c7;
  --line: rgba(255, 255, 255, 0.09);
  --blue: #3b82f6;
  --gold: #f5c451;
  --green: #31d07f;
  --red: #ff6b6b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.24), transparent 34rem),
    radial-gradient(circle at top right, rgba(245, 196, 81, 0.14), transparent 30rem),
    var(--bg);
}

.hero, main, footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 44px 0 26px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.4rem, 6vw, 5rem); line-height: 0.9; letter-spacing: -0.07em; margin-bottom: 18px; }
h2 { font-size: 1.25rem; margin-bottom: 6px; }
h3 { font-size: 1rem; margin-bottom: 8px; }

.subtitle { color: var(--muted); font-size: 1.1rem; max-width: 720px; margin-bottom: 0; }
.eyebrow { color: var(--gold); letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.72rem; font-weight: 800; margin-bottom: 10px; }
.muted { color: var(--muted); }

.status-pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  white-space: nowrap;
}

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

.panel, .kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.panel { padding: 22px; margin-bottom: 16px; }
.kpi-card { padding: 20px; }
.kpi-value { font-size: 2.25rem; font-weight: 900; letter-spacing: -0.05em; margin-bottom: 4px; }
.kpi-label { color: var(--muted); margin-bottom: 12px; }
.kpi-trend { font-size: 0.88rem; color: var(--green); }
.kpi-trend.warn { color: var(--gold); }
.kpi-trend.bad { color: var(--red); }

.pace-panel { display: grid; grid-template-columns: 1fr 420px; align-items: center; gap: 28px; }
.progress-track { height: 18px; background: rgba(255, 255, 255, 0.09); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: inherit; transition: width 700ms ease; }
.progress-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.9rem; margin-top: 10px; }

.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.stack { display: grid; gap: 12px; }
.metric-row { display: flex; justify-content: space-between; gap: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,0.035); }
.metric-row strong { font-size: 1.25rem; }

.table-card { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
tr:last-child td { border-bottom: 0; }
tr.row-warn td { background: rgba(245, 196, 81, 0.07); }
tr.row-alert td { background: rgba(255, 107, 107, 0.10); }
tr.row-warn td:first-child, tr.row-alert td:first-child { border-left: 3px solid var(--gold); }
tr.row-alert td:first-child { border-left-color: var(--red); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 0.78rem; font-weight: 800; background: rgba(49,208,127,0.14); color: var(--green); }
.badge.warn { background: rgba(245,196,81,0.14); color: var(--gold); }
.badge.bad { background: rgba(255,107,107,0.14); color: var(--red); }

.grouped-table thead tr:first-child th { text-align: center; }
.group-heading { font-size: 0.72rem; }
.sales-group { color: var(--blue); border-bottom: 2px solid rgba(59, 130, 246, 0.45); }
.lease-group { color: var(--gold); border-bottom: 2px solid rgba(245, 196, 81, 0.45); }

.funnel-health { display: grid; grid-template-columns: repeat(8, minmax(110px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.funnel-health-stage { min-width: 110px; border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px; background: rgba(255,255,255,0.035); text-align: center; }
.funnel-health-stage.sierra { border-top: 4px solid var(--blue); }
.funnel-health-stage.agreement { border-top: 4px solid var(--gold); }
.funnel-health-stage.brokermint { border-top: 4px solid var(--green); }
.stage-count { font-size: 1.9rem; font-weight: 900; letter-spacing: -0.05em; }
.stage-label { color: var(--muted); font-size: 0.84rem; }

.funnel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.funnel-stage { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: rgba(255,255,255,0.035); }
.funnel-stage.sierra { border-top: 4px solid var(--blue); }
.funnel-stage.agreement { border-top: 4px solid var(--gold); }
.funnel-stage.brokermint { border-top: 4px solid var(--green); }
.funnel-stage ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); }

footer { color: var(--muted); padding: 18px 0 38px; font-size: 0.9rem; }

@media (max-width: 920px) {
  .hero, .section-heading, .pace-panel { grid-template-columns: 1fr; flex-direction: column; }
  .grid-4, .two-col, .funnel { grid-template-columns: 1fr; }
  .status-pill { white-space: normal; }
}
