:root {
  color-scheme: light;
  --ink: #03045e;
  --muted: #3e4f73;
  --faint: #5c6b8a;
  --paper: #ffffff;
  --canvas: #f4f6f8;
  --rail: #03045e;
  --rail-ink: #ffffff;
  --rail-muted: #90e0ef;
  --rail-line: rgba(202, 240, 248, 0.22);
  --line: rgba(3, 4, 94, 0.12);
  --accent: #0077b6;
  --tide: #00b4d8;
  --mist: #90e0ef;
  --lagoon: #caf0f8;
  --ok: #1d6b45;
  --ok-bg: #e5f3eb;
  --warn: #8a5a12;
  --warn-bg: #f8efd8;
  --shadow: 0 18px 40px rgba(3, 4, 94, 0.06);
  --serif: "Instrument Sans", "Segoe UI", sans-serif;
  --sans: "Outfit", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.5 var(--sans);
  color: var(--ink);
  background: var(--canvas);
}

button, select { font: inherit; color: inherit; }

[hidden] { display: none !important; }

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 18px 20px;
  background: var(--rail);
  color: var(--rail-ink);
}

.mark {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  text-decoration: none;
  color: inherit;
}

.mark-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lockup { width: 100%; height: auto; }

.mark-badge {
  width: 44px;
  height: 44px;
  flex: none;
}

.mark-name {
  font-family: var(--serif);
  font-stretch: 75%;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.mark-role {
  color: var(--accent);
  font-size: 12px;
  line-height: 1.35;
}

.rail .mark-role { color: var(--mist); }

nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--rail-muted);
  text-align: left;
  cursor: pointer;
}

.nav:hover { color: var(--rail-ink); background: rgba(144, 224, 239, 0.12); }

.nav[aria-current="page"] {
  color: var(--rail-ink);
  background: rgba(0, 119, 182, 0.45);
}

.nav:disabled {
  color: rgba(144, 224, 239, 0.45);
  cursor: default;
}

.nav:disabled:hover { background: transparent; }

.soon {
  margin-left: 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rail-foot:empty { display: none; }

.rail-foot {
  margin-top: auto;
  padding: 14px 12px 0;
  border-top: 1px solid var(--rail-line);
  color: var(--rail-muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 32px;
}

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.select-clip { display: block; min-width: 0; }

.field select, .field input[type="month"] {
  width: 320px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.field input[type="month"] { width: 168px; }

.freshness {
  margin-left: auto;
  color: var(--faint);
  font-size: 13px;
}

main {
  margin: 0 32px 32px;
  padding: 28px 32px 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.page-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.lede {
  margin: 8px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.section-title {
  margin: 28px 0 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 560;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 18px;
}

.toolbar .field select { width: 190px; }

.finance { margin-top: 28px; }

.chart { margin-top: 22px; }

.chart .section-title { margin-top: 0; }

.chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  margin-right: 6px;
  border-radius: 99px;
  vertical-align: middle;
}

.legend i.visits { background: var(--tide); }
.legend i.signups { background: var(--accent); }
.legend i.payments { background: var(--ink); }

.board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 40px;
  align-items: start;
  margin-top: 28px;
}

.board .funnel,
.board .arrivals { margin-top: 0; }

.arrivals {
  display: grid;
  gap: 14px;
}

.arrivals .section-title { margin-top: 0; }

.funnel {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) 48px;
  gap: 12px;
  align-items: center;
}

.funnel-row span:last-child {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: var(--lagoon);
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bar i.a { background: var(--accent); }
.bar i.b { background: var(--tide); }
.bar i.c { background: var(--mist); }
.bar i.d { background: var(--ink); }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric {
  padding: 18px 18px 16px 0;
}

.metric + .metric { padding-left: 18px; border-left: 1px solid var(--line); }

.metric b {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 30px;
  font-weight: 560;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.note, .error {
  margin: 18px 0 0;
  color: var(--faint);
  font-size: 13px;
}

.error { color: var(--accent); }

.login {
  display: grid;
  gap: 12px;
  max-width: 320px;
  margin-top: 22px;
}

.login input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.home {
  max-width: 640px;
  margin: 0 auto;
  padding: 18vh 24px 48px;
}

.home .wordmark { width: min(100%, 560px); height: auto; }

.enter {
  display: inline-block;
  margin-top: 28px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.ids {
  display: grid;
  gap: 14px;
  margin: 12px 0 0;
}

.ids div { display: grid; gap: 4px; }

.ids dt {
  color: var(--faint);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ids dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.ids code, .secret code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.secret { margin: 8px 0 0; }

.setup {
  display: grid;
  gap: 12px;
  max-width: 420px;
  margin-top: 8px;
}

.setup input, .setup select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.text-button, .solid {
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.text-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.solid {
  margin-top: 12px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
}

.login button, .leave {
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

.leave {
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
}

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  margin-top: 22px;
  border-collapse: collapse;
}

th, td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--faint);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

td { font-variant-numeric: tabular-nums; }

tbody tr:hover td { background: var(--lagoon); }

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 12px;
}

.tag.ok { background: var(--ok-bg); color: var(--ok); }

.reason { margin-left: 8px; color: var(--faint); font-size: 13px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); width: 100%; }
  .rail { gap: 16px; width: 100%; min-width: 0; padding: 18px 16px 14px; }
  nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    width: 100%;
    min-width: 0;
  }
  .nav { width: auto; justify-content: flex-start; }
  .soon { display: none; }
  .rail-foot { margin-top: 0; padding-top: 12px; }
  .topbar { flex-wrap: wrap; padding: 16px; }
  .freshness { margin-left: 0; }
  .field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
    min-width: 0;
  }
  .select-clip { overflow: hidden; }
  .field select, .field input[type="month"], .toolbar .field select { width: 100%; min-width: 0; }
  .shell, .workspace, .rail { max-width: 100%; }
  main { margin: 0 16px 16px; padding: 20px 16px 22px; }
  .board { grid-template-columns: 1fr; }
  .funnel-row { grid-template-columns: 1fr auto; }
  .funnel-row .bar { grid-column: 1 / -1; }
  .metrics { grid-template-columns: 1fr; }
  .metric { padding: 16px 0; }
  .metric + .metric { padding-left: 0; border-left: 0; }
}
