/* /panel: the referrer panel. Brand field shared with the campaign landings: light lavender,
   Miare purple, the winding road at the bottom; yellow only for the one thing to act on. */
.panel {
  min-height: 100vh;
  background-color: #F6F1FA;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 420' preserveAspectRatio='none'%3E%3Cpath d='M-40 380 C 260 250, 420 420, 700 300 S 1100 120, 1260 210 L 1260 470 L -40 470 Z' fill='%23701F83'/%3E%3Cpath d='M-40 380 C 260 250, 420 420, 700 300 S 1100 120, 1260 210' fill='none' stroke='%238E3BA3' stroke-width='14'/%3E%3Cpath d='M-40 420 C 260 300, 430 460, 720 350 S 1100 190, 1260 270' fill='none' stroke='%23fff' stroke-width='6' stroke-dasharray='34 30' stroke-linecap='round' opacity='.85'/%3E%3C/svg%3E"),
    radial-gradient(60% 40% at 90% 0%, rgba(142, 59, 163, .16), transparent 70%),
    radial-gradient(50% 35% at 0% 25%, rgba(112, 31, 131, .09), transparent 70%);
  background-repeat: no-repeat;
  background-size: 100% 30vh, auto, auto;
  background-position: bottom center, 0 0, 0 0;
  background-attachment: fixed, scroll, scroll;
}

.topbar {
  display: flex; align-items: center; gap: 10px;
  max-width: 720px; margin: 0 auto; padding: 18px 20px 6px;
}
.topbar-label {
  font-size: 13px; font-weight: 700; color: var(--purple);
  padding: 2px 10px; border-radius: 999px; background: rgba(112, 31, 131, .09);
}
.bell-wrap { position: relative; margin-inline-start: auto; }
.bell-wrap + .ghost-btn { margin-inline-start: 0; }
.bell {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--white); color: var(--purple); cursor: pointer;
}
.bell:hover { border-color: var(--purple); }
.bell.has-new svg { animation: ring 1.2s ease-in-out 2; transform-origin: 50% 10%; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
.bell-badge {
  position: absolute; top: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: #E5334B; color: var(--white); font-size: 11.5px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid #F6F1FA;
}
.notifs {
  position: absolute; top: 48px; inset-inline-end: -60px; z-index: 20; width: min(340px, 92vw);
  max-height: 70vh; overflow: auto; padding: 12px; border-radius: 20px; background: var(--white);
  box-shadow: 0 18px 50px rgba(42, 14, 51, .25); border: 1px solid #EFE6F3;
}
.notifs-title { font-weight: 800; color: var(--purple); padding: 2px 6px 8px; }
.notifs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.notifs li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--tint); font-size: 13.5px; line-height: 1.8; }
.notifs li.is-new { background: #FFF6DD; box-shadow: inset 3px 0 0 var(--yellow); }
.notifs li b { color: var(--ink); }
.notifs li small { color: var(--muted); font-size: 11.5px; }
.notifs-empty { padding: 8px 6px; color: var(--muted); font-size: 14px; }
.ghost-btn {
  margin-inline-start: auto; border: 1.5px solid var(--line); background: var(--white);
  color: var(--muted); border-radius: 999px; padding: 4px 14px; font-size: 13px; cursor: pointer;
}
.ghost-btn:hover { border-color: var(--purple); color: var(--purple); }

.shell { max-width: 720px; margin: 0 auto; padding: 10px 20px 32vh; }

/* ---------- login */
.auth { display: grid; gap: 18px; max-width: 440px; margin: 4vh auto 0; }
.auth-card {
  background: var(--white); border-radius: 24px; padding: 28px 24px 24px; text-align: center;
  box-shadow: 0 18px 50px rgba(112, 31, 131, .16), 0 0 0 6px rgba(142, 59, 163, .08);
}
.auth-sign { display: block; margin: 0 auto 10px; }
.auth-card h1 { font-size: 21px; font-weight: 800; color: var(--purple); line-height: 1.6; }
.auth-lede, .auth-note { font-size: 14px; color: var(--muted); margin: 6px 0 18px; line-height: 1.9; }
.auth form { display: grid; gap: 8px; text-align: start; }
.field { font-size: 13px; font-weight: 700; }
.auth input {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--tint); font-size: 18px; text-align: left;
}
.auth input:focus { outline: none; border-color: var(--purple); background: var(--white); box-shadow: 0 0 0 4px rgba(112, 31, 131, .12); }
.otp-input { letter-spacing: 10px; text-align: center !important; font-weight: 800; }
.error { min-height: 1.4em; font-size: 13px; color: var(--error); }
.cta {
  min-height: 54px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--purple); color: var(--white); font-size: 16px; font-weight: 800;
  box-shadow: 0 8px 22px rgba(112, 31, 131, .32); transition: transform .15s, background .15s;
}
.cta:hover { background: var(--purple-deep); transform: translateY(-1px); }
.cta[aria-busy="true"] { opacity: .7; pointer-events: none; }
.link-btn { border: 0; background: none; color: var(--muted); font-size: 14px; text-decoration: underline; cursor: pointer; padding: 6px; }

.how { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.how li {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .7); font-size: 14px;
}
.how b {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--purple); color: var(--white); font-size: 14px;
}

/* ---------- dashboard */
.dash { display: grid; gap: 16px; }
.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 22px 20px 20px; color: var(--white);
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(253, 184, 19, .22), transparent 60%),
    linear-gradient(140deg, #8E3BA3, #701F83 55%, #4F1460);
  box-shadow: 0 18px 44px rgba(112, 31, 131, .35);
}
.hero::after {   /* the box on the courier's bike, as a watermark */
  content: ""; position: absolute; inset-inline-start: -30px; bottom: -40px; width: 170px; height: 170px;
  background: url("Sign-white.svg") center / contain no-repeat; opacity: .08; pointer-events: none;
}
.hero-hi { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.ref-card { position: relative; z-index: 1; display: grid; gap: 10px; }
.ref-card + .ref-card { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .2); }
.ref-kind { font-size: 13px; opacity: .85; }
.ref-code {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 12px; border: 2px dashed rgba(255, 255, 255, .45); border-radius: 18px;
  background: rgba(255, 255, 255, .1); color: var(--white); cursor: copy;
  font-size: 32px; font-weight: 800; letter-spacing: 6px; direction: ltr;
}
.ref-code:hover { background: rgba(255, 255, 255, .16); }
.ref-code small { font-size: 12px; letter-spacing: 0; font-weight: 700; opacity: .8; }
.ref-url {
  display: grid; justify-items: center; gap: 2px; padding: 14px 12px; border-radius: 18px;
  border: 2px dashed rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .1);
  color: var(--white); text-decoration: none; text-align: center;
}
.ref-url:hover { background: rgba(255, 255, 255, .16); }
.ref-url small { font-size: 12px; font-weight: 700; opacity: .8; }
.ref-url bdi {   /* Latin digits: it's a URL */
  direction: ltr; font-size: 17px; font-weight: 800; word-break: break-all;
  font-feature-settings: normal; text-decoration: underline; text-underline-offset: 4px;
}
.ref-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ref-actions button {
  min-height: 46px; border-radius: 999px; font-weight: 800; cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, .55); background: transparent; color: var(--white);
}
.ref-actions button.primary { background: var(--yellow); border-color: var(--yellow); color: #3A1442; }
.ref-actions button:only-child { grid-column: span 2; }
.share-apps { display: flex; gap: 8px; }
.share-apps a {
  flex: 1; text-align: center; padding: 8px 0; border-radius: 12px; text-decoration: none;
  background: rgba(255, 255, 255, .12); color: var(--white); font-size: 13px; font-weight: 700;
}
.share-apps a:hover { background: rgba(255, 255, 255, .2); }

.campaign {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px;
  background: #FFF6DD; border: 1px solid #F6E2A6; font-size: 14px; line-height: 1.9;
}
.campaign::before { content: "🎁"; font-size: 22px; line-height: 1.4; }
.campaign b { display: block; color: #6B4A00; }
.campaign + .campaign { margin-top: 8px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat {
  background: var(--white); border-radius: 18px; padding: 12px 14px;
  box-shadow: 0 6px 18px rgba(112, 31, 131, .07); border: 1px solid #EFE6F3;
}
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat b { display: block; font-size: 22px; font-weight: 800; color: var(--purple); line-height: 1.5; }
.stat.money b { font-size: 16px; }
.stat.ok b { color: var(--ok); }

.leads-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.leads-head h2 { font-size: 17px; font-weight: 800; }
.filters { display: flex; gap: 6px; }
.chip {
  border: 1.5px solid var(--line); background: var(--white); color: var(--muted);
  border-radius: 999px; padding: 2px 12px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.chip.is-on { border-color: var(--purple); background: var(--purple); color: var(--white); }

.leads { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lead {
  background: var(--white); border-radius: 20px; padding: 14px 16px 16px;
  box-shadow: 0 6px 18px rgba(112, 31, 131, .07); border: 1px solid #EFE6F3;
}
.lead-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.lead-name { font-weight: 800; font-size: 15px; }
.lead-meta { font-size: 12.5px; color: var(--muted); }
.lead-meta bdi { direction: ltr; unicode-bidi: isolate; }
.pill { flex: none; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--tint); color: var(--purple); }
.pill.activated, .pill.rewarded { background: #E3F4E8; color: #1B6B35; }
.pill.paid { background: #FFF1C6; color: #7A5600; }
.pill.rejected { background: #FBE9E7; color: var(--error); }

/* the progress track: 4 steps, filled up to the Lead's stage */
.track { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.track li { position: relative; display: grid; justify-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); text-align: center; }
.track li::before {   /* the line to the previous step */
  content: ""; position: absolute; top: 11px; inset-inline-end: 50%; width: 100%; height: 3px; background: var(--line);
}
.track li:first-child::before { display: none; }
.track i {
  position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--white); border: 3px solid var(--line); font-style: normal; font-size: 12px; font-weight: 800; color: var(--white);
}
.track li.done::before, .track li.now::before { background: var(--purple); }
.track li.done i { background: var(--purple); border-color: var(--purple); }
.track li.now i { border-color: var(--purple); box-shadow: 0 0 0 5px rgba(112, 31, 131, .14); }
.track li.now i::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--purple); }
.track li.done, .track li.now { color: var(--ink); font-weight: 700; }
.track.paid li i { background: var(--yellow); border-color: var(--yellow); }
.track.paid li::before { background: var(--yellow) !important; }
.track.rejected { opacity: .45; filter: grayscale(1); }
.lead-hint { margin-top: 12px; padding: 8px 12px; border-radius: 12px; background: var(--tint); font-size: 13px; line-height: 1.9; }
.lead-hint.rejected { background: #FBE9E7; color: var(--error); }

.empty {
  display: grid; justify-items: center; gap: 4px; text-align: center; padding: 26px 18px;
  background: rgba(255, 255, 255, .8); border-radius: 20px; border: 1.5px dashed var(--line);
}
.empty span { font-size: 14px; color: var(--muted); }

.toast {
  position: fixed; inset-inline: 0; bottom: 22px; margin: 0 auto; width: max-content; max-width: 90vw;
  padding: 8px 18px; border-radius: 999px; background: #2A0E33; color: var(--white); font-size: 14px; z-index: 10;
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .ref-code { font-size: 28px; letter-spacing: 4px; }
}
