/* Sorted partner portal — Calibre Cleaning brand.
   calibrecleaning.com.au: blue #2784BE, Clearface serif headings + Roboto body,
   light-blue/grey surfaces, pill buttons. Serif here = Lora. */
:root {
  --brand: #2784be;
  --brand-dark: #1f6c9e;
  --brand-deep: #17557f;
  --brand-tint: #e6f2fa;
  --brand-tint-2: #f2f8fc;

  --bg: #f4f7f9;
  --surface: #ffffff;
  --ink: #2b2b2b;
  --ink-2: #454545;
  --muted: #6c7681;
  --faint: #9aa4ae;
  --line: #e5eaef;

  --money: #1f6c9e;

  /* stage colours (keyed by data status) */
  --st-upcoming: #2784be;   /* Booked · scheduled clean      (data: Upcoming)      */
  --st-completed: #2f9e6e;  /* Booked · clean done           (data: Completed)     */
  --st-cancelled: #d2686f;  /* Booked · cancelled            (data: Cancelled)     */
  --st-inprog: #e0a32e;     /* Not Converted · still worked  (data: In Progress)   */
  --st-closed: #8a94a0;     /* Not Converted · lost          (data: Not Converted) */

  --r: 16px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(23,85,127,.05), 0 10px 26px -14px rgba(23,85,127,.22);
  --shadow-lg: 0 2px 6px rgba(23,85,127,.06), 0 26px 52px -22px rgba(23,85,127,.30);
  --pad: clamp(18px, 4vw, 44px);
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Roboto", system-ui, -apple-system, sans-serif;
  --mono: "Roboto Mono", ui-monospace, 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(1100px 460px at 88% -10%, var(--brand-tint) 0%, transparent 60%),
    radial-gradient(760px 360px at -6% 2%, #eef4f8 0%, transparent 55%);
  background-attachment: fixed; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; color: var(--ink-2); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--pad); }
body.leads .wrap { max-width: 1440px; }

/* ---- top bar + nav ---- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.85); backdrop-filter: saturate(1.3) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 14px; height: 72px; }
.lockup { display: flex; align-items: center; gap: 13px; text-decoration: none; }
.lockup img { height: 34px; width: auto; display: block; }
.lockup .div { width: 1px; height: 26px; background: var(--line); }
.lockup .co { display: flex; flex-direction: column; line-height: 1.15; }
.lockup .co b { font-family: var(--serif); font-weight: 600; font-size: 15px; color: var(--ink-2); }
.lockup .co span { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); }
.nav { display: flex; gap: 3px; margin-left: 10px; }
.navlink { font: 500 13.5px/1 var(--sans); color: var(--muted); text-decoration: none; padding: 9px 15px; border-radius: 999px; transition: color .15s, background .15s; }
.navlink:hover { color: var(--ink-2); background: var(--brand-tint-2); }
.navlink.on { color: var(--brand); background: var(--brand-tint); }
.topbar .spacer { flex: 1; }
.updated { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.updated b { color: var(--ink-2); font-weight: 500; }
.btn-out { font: 500 13px/1 var(--sans); color: #fff; background: var(--brand); padding: 10px 18px; border-radius: 999px; cursor: pointer; text-decoration: none; border: 0; transition: background .15s; box-shadow: 0 6px 14px -8px rgba(39,132,190,.7); }
.btn-out:hover { background: var(--brand-dark); }

/* ---- masthead ---- */
.mast { padding: clamp(26px, 5vw, 44px) 0 4px; }
.mast .kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--brand); }
.mast h1 { font-size: clamp(27px, 5vw, 44px); line-height: 1.08; margin-top: 13px; max-width: 18ch; }
.mast p { color: var(--muted); margin: 13px 0 0; max-width: 58ch; font-size: 15px; }

/* ---- funnel (signature) ---- */
.funnel { display: grid; grid-template-columns: repeat(4, 1fr); 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: 24px 26px 22px; display: flex; flex-direction: column; gap: 2px; }
.stage + .stage { border-left: 1px solid var(--line); }
.stage .lab { font-family: var(--mono); font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.stage .num { font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 4vw, 42px); line-height: 1.05; color: var(--ink-2); margin: 8px 0 2px; letter-spacing: -.01em; }
.stage .sub { font-size: 12.5px; color: var(--muted); }
.stage .track { height: 5px; border-radius: 5px; background: #eef2f5; margin-top: 14px; overflow: hidden; }
.stage .track i { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--brand); transition: width 1s cubic-bezier(.2,.7,.2,1); }
.stage.money { background: linear-gradient(180deg, var(--brand-tint), #fff 85%); }
.stage.money .num { 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; }

/* ---- section header ---- */
.sec { margin: 40px 0 14px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sec h2 { font-size: 22px; }
.sec .note { font-size: 13px; color: var(--muted); }

/* ---- commission breakdown (overview) ---- */
.breakdown { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.brow { display: grid; grid-template-columns: 1.5fr 1fr 1.1fr 1.1fr; align-items: center; padding: 15px 24px; gap: 12px; }
.brow + .brow { border-top: 1px solid var(--line); }
.brow.head { background: var(--brand-tint-2); }
.brow.head span { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.brow .m { font-family: var(--serif); font-weight: 600; color: var(--ink-2); font-size: 15.5px; }
.brow .v { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink); text-align: right; }
.brow .v.comm { color: var(--money); font-weight: 600; }
.brow.total { background: var(--brand-tint); }
.brow.total .m { color: var(--brand-deep); }
.brow.total .v { color: var(--brand-deep); font-weight: 600; }
.brow.total .v.comm { color: var(--money); }

/* ---- pipeline breakdown (overview): two status cards ---- */
.pipeline { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px 24px 20px; }
.pcard .phead { display: flex; align-items: center; gap: 10px; }
.pcard .phead .badge { flex: none; }
.pcard .phead .pcount { margin-left: auto; font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1; color: var(--ink-2); letter-spacing: -.01em; }
.pcard .phead .psub { font-size: 12.5px; color: var(--muted); }
.pcard .pbar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; background: #eef2f5; margin: 16px 0 14px; }
.pcard .pbar i { display: block; height: 100%; width: 0; transition: width 1s cubic-bezier(.2,.7,.2,1); }
.pcard .prows { display: flex; flex-direction: column; gap: 2px; }
.prow2 { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 7px 0; }
.prow2 + .prow2 { border-top: 1px solid var(--line); }
.prow2 .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.prow2 .name { font-size: 13.5px; color: var(--ink); }
.prow2 .n { font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.prow2 .n .of { color: var(--faint); font-size: 11.5px; margin-left: 5px; font-weight: 400; }

/* ---- status badge (tinted pill) ---- */
.badge { display: inline-flex; align-items: center; font: 500 12px/1 var(--sans); padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.badge.booked { background: var(--brand-tint); color: var(--brand-deep); }
.badge.notconv { background: #eef1f4; color: #5a636d; }

/* ---- leads table ---- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 20px 0 16px; }
.toolbar .search { flex: 0 1 250px; margin-left: auto; }
.toolbar .search input { width: 100%; font: 400 13.5px var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; transition: border-color .15s; }
.toolbar .search input:focus { outline: none; border-color: var(--brand); }
.chip { font: 500 12.5px/1 var(--sans); color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 9px 14px; 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; }
.chip .c { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.chip:hover { border-color: #cfdbe4; }
.chip.on { color: #fff; border-color: var(--brand); background: var(--brand); box-shadow: 0 6px 14px -8px rgba(39,132,190,.7); }
.chip.on .c { color: rgba(255,255,255,.85); }
/* the two top-level status chips act as group headers: bolder, with a gap before each group */
.chip.chip-status { margin-left: 10px; font-weight: 600; color: var(--ink-2); }
.chip.chip-status.on { color: #fff; }

.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow-x: auto; }
table.leads { width: 100%; border-collapse: collapse; min-width: 860px; }
table.leads th { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--brand-tint-2); cursor: pointer; user-select: none; }
table.leads th.num { text-align: right; }
table.leads th .arw { color: var(--brand); margin-left: 4px; font-size: 9px; }
table.leads td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink); vertical-align: middle; white-space: nowrap; }
table.leads td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.leads tbody tr:last-child td { border-bottom: 0; }
table.leads tbody tr:hover { background: var(--brand-tint-2); }
.idc { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.cust { font-family: var(--serif); font-weight: 600; color: var(--ink-2); font-size: 14.5px; }
.subtle { color: var(--muted); }
.spill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.spill .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.stagecell { display: inline-flex; flex-direction: column; gap: 2px; }
.stagecell .reason { font-size: 11.5px; color: var(--faint); white-space: normal; max-width: 30ch; line-height: 1.3; }
.comm { color: var(--money); font-weight: 600; }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .big { font-family: var(--serif); font-size: 19px; color: var(--ink-2); margin-bottom: 6px; }

footer { padding: 36px 0 48px; 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); }
  .lockup .co { display: none; }
  .brow { grid-template-columns: 1.4fr 1fr 1fr; }
  .brow .jobs { display: none; }
  .pipeline { grid-template-columns: 1fr; }
}
@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; }
  .nav { margin-left: 0; }
}

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { .stage .track i { transition: none; } }
