/* Sorted × Calibre — partner portal. Fresh-linen / eucalyptus / brass.
   Committed to a single light identity on purpose: the brand IS "clean". */
:root {
  --bg: #ECF2EF;
  --surface: #ffffff;
  --surface-2: #f4f8f6;
  --ink: #10201b;
  --muted: #5e6f68;
  --faint: #8598906b;
  --line: #dce6e1;
  --brand: #0e5a46;
  --brand-bright: #17a67c;
  --money: #9a6b12;
  --money-tint: #f7efdd;

  --st-progress: #c0872b;
  --st-upcoming: #2e7c9e;
  --st-completed: #17a67c;
  --st-notconv: #7d908a;
  --st-cancelled: #b0575f;

  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 1px 2px rgba(16,32,27,.04), 0 8px 24px -12px rgba(16,32,27,.14);
  --shadow-lg: 0 2px 6px rgba(16,32,27,.05), 0 22px 48px -20px rgba(16,32,27,.22);
  --pad: clamp(18px, 4vw, 44px);
  --sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --disp: "Space Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 480px at 85% -8%, #d9ece3 0%, transparent 62%),
    radial-gradient(900px 420px at -5% 0%, #e6efe9 0%, transparent 55%);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--disp); font-weight: 600; letter-spacing: -.01em; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--pad); }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: baseline; gap: 9px; font-family: var(--disp); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand .x { color: var(--faint); font-weight: 500; font-size: 15px; transform: translateY(-1px); }
.brand .sorted { color: var(--brand); }
.brand .cal { color: var(--ink); }
.eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.topbar .spacer { flex: 1; }
.updated { font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.updated b { color: var(--ink); font-weight: 600; }
.btn-out {
  font: 600 12.5px/1 var(--sans); color: var(--brand);
  background: var(--surface); border: 1px solid var(--line);
  padding: 9px 13px; border-radius: 999px; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn-out:hover { background: var(--surface-2); border-color: #cdddd5; }

/* ---- masthead ---- */
.mast { padding: clamp(26px, 5vw, 46px) 0 8px; }
.mast .kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--brand-bright); }
.mast h1 { font-size: clamp(26px, 4.6vw, 40px); line-height: 1.05; margin-top: 12px; max-width: 18ch; }
.mast p { color: var(--muted); margin: 12px 0 0; max-width: 56ch; font-size: 15px; }

/* ---- funnel (the signature) ---- */
.funnel {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0; margin: 26px 0 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden;
}
.stage { position: relative; padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 3px; }
.stage + .stage { border-left: 1px solid var(--line); }
.stage .lab { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stage .num { font-family: var(--disp); font-weight: 600; font-size: clamp(30px, 4vw, 40px); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 6px 0 2px; }
.stage .sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage .track { height: 4px; border-radius: 4px; background: var(--surface-2); margin-top: 12px; overflow: hidden; }
.stage .track i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--brand-bright); transition: width 1s cubic-bezier(.2,.7,.2,1); }
.stage.money { background: linear-gradient(180deg, var(--money-tint), #fff); }
.stage.money .num { color: var(--money); }
.stage.money .lab { color: var(--money); }
.stage.money .track i { background: var(--money); }
.stage .arrow { position: absolute; right: -9px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%) rotate(45deg); background: var(--surface); border-top: 1px solid var(--line); border-right: 1px solid var(--line); z-index: 3; }
.stage.money .arrow, .stage:last-child .arrow { display: none; }

/* ---- controls ---- */
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 30px 0 16px; }
.chip {
  font: 500 12.5px/1 var(--sans); color: var(--muted);
  background: var(--surface); border: 1px solid var(--line);
  padding: 8px 13px; border-radius: 999px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center;
  transition: color .15s, border-color .15s, background .15s;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .55; }
.chip .c { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.chip:hover { border-color: #cdddd5; }
.chip.on { color: var(--ink); border-color: var(--brand); background: color-mix(in srgb, var(--brand-bright) 8%, #fff); }
.chip.on .c { color: var(--brand); }
.controls .count { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

/* ---- leads ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; padding-bottom: 8px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 17px 18px 16px 20px; box-shadow: var(--shadow);
  transition: transform .18s cubic-bezier(.2,.7,.2,1), box-shadow .18s;
}
.card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--edge, var(--line)); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card .row1 { display: flex; align-items: center; gap: 10px; }
.card .id { font-family: var(--mono); font-weight: 600; font-size: 12px; color: var(--muted); letter-spacing: .01em; }
.card .pill { margin-left: auto; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; white-space: nowrap; color: var(--edge); background: color-mix(in srgb, var(--edge) 12%, #fff); }
.card .name { font-family: var(--disp); font-weight: 600; font-size: 17px; margin: 10px 0 2px; letter-spacing: -.01em; }
.card .svc { font-size: 13px; color: var(--ink); }
.card .loc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card .meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 13px; border-top: 1px dashed var(--line); }
.card .when .k, .card .money .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); display: block; margin-bottom: 3px; }
.card .when .v { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.card .when .v.none { color: var(--muted); font-weight: 400; }
.card .money { text-align: right; }
.card .money .v { font-family: var(--disp); font-weight: 600; font-size: 16px; color: var(--money); font-variant-numeric: tabular-nums; }
.card .money .sub { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-family: var(--disp); font-size: 18px; color: var(--ink); margin-bottom: 6px; }

footer { padding: 34px 0 46px; color: var(--muted); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
footer .dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }

@media (max-width: 760px) {
  .funnel { grid-template-columns: repeat(2, 1fr); }
  .stage:nth-child(2) .arrow { display: none; }
  .stage:nth-child(3) { border-left: none; border-top: 1px solid var(--line); }
  .stage:nth-child(4) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .funnel { grid-template-columns: 1fr; }
  .stage + .stage { border-left: none; border-top: 1px solid var(--line); }
  .stage .arrow { display: none !important; }
}

/* card entrance */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card { animation: rise .5s both cubic-bezier(.2,.7,.2,1); }
:focus-visible { outline: 2px solid var(--brand-bright); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .stage .track i { transition: none; }
  * { scroll-behavior: auto; }
}
